]> scripts.mit.edu Git - autoinstalls/wordpress.git/commitdiff
Wordpress 3.6 wordpress-3.6
authorEdward Z. Yang <ezyang@mit.edu>
Wed, 7 Aug 2013 03:32:34 +0000 (20:32 -0700)
committerEdward Z. Yang <ezyang@mit.edu>
Wed, 7 Aug 2013 03:32:34 +0000 (20:32 -0700)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
564 files changed:
license.txt
readme.html
wp-activate.php
wp-admin/about.php
wp-admin/admin-ajax.php
wp-admin/admin-header.php
wp-admin/admin.php
wp-admin/async-upload.php
wp-admin/credits.php
wp-admin/css/colors-classic.css
wp-admin/css/colors-classic.min.css
wp-admin/css/colors-fresh.css
wp-admin/css/colors-fresh.min.css
wp-admin/css/customize-controls-rtl.css
wp-admin/css/customize-controls-rtl.min.css
wp-admin/css/customize-controls.css
wp-admin/css/customize-controls.min.css
wp-admin/css/ie-rtl.css
wp-admin/css/ie.css
wp-admin/css/ie.min.css
wp-admin/css/wp-admin-rtl.css
wp-admin/css/wp-admin-rtl.min.css
wp-admin/css/wp-admin.css
wp-admin/css/wp-admin.min.css
wp-admin/custom-background.php
wp-admin/custom-header.php
wp-admin/customize.php
wp-admin/edit-comments.php
wp-admin/edit-form-advanced.php
wp-admin/edit-form-comment.php
wp-admin/edit-link-form.php
wp-admin/edit-tags.php
wp-admin/edit.php
wp-admin/freedoms.php
wp-admin/images/arrows-pr-2x.png [new file with mode: 0644]
wp-admin/images/arrows-pr.png [new file with mode: 0644]
wp-admin/images/lock-2x.png [new file with mode: 0644]
wp-admin/images/lock.png [new file with mode: 0644]
wp-admin/images/post-formats-vs.png [new file with mode: 0644]
wp-admin/images/post-formats.png [new file with mode: 0644]
wp-admin/images/post-formats32-vs.png [new file with mode: 0644]
wp-admin/images/post-formats32.png [new file with mode: 0644]
wp-admin/images/screenshots/about-color-picker.png [deleted file]
wp-admin/images/screenshots/about-media.png [deleted file]
wp-admin/images/screenshots/about-retina.png [deleted file]
wp-admin/images/screenshots/about-twenty-twelve.png [deleted file]
wp-admin/includes/ajax-actions.php
wp-admin/includes/bookmark.php
wp-admin/includes/class-ftp-pure.php
wp-admin/includes/class-ftp-sockets.php
wp-admin/includes/class-ftp.php
wp-admin/includes/class-wp-comments-list-table.php
wp-admin/includes/class-wp-filesystem-base.php
wp-admin/includes/class-wp-filesystem-direct.php
wp-admin/includes/class-wp-filesystem-ftpsockets.php
wp-admin/includes/class-wp-filesystem-ssh2.php
wp-admin/includes/class-wp-importer.php
wp-admin/includes/class-wp-links-list-table.php
wp-admin/includes/class-wp-list-table.php
wp-admin/includes/class-wp-media-list-table.php
wp-admin/includes/class-wp-ms-sites-list-table.php
wp-admin/includes/class-wp-ms-themes-list-table.php
wp-admin/includes/class-wp-ms-users-list-table.php
wp-admin/includes/class-wp-plugin-install-list-table.php
wp-admin/includes/class-wp-plugins-list-table.php
wp-admin/includes/class-wp-posts-list-table.php
wp-admin/includes/class-wp-terms-list-table.php
wp-admin/includes/class-wp-theme-install-list-table.php
wp-admin/includes/class-wp-themes-list-table.php
wp-admin/includes/class-wp-upgrader.php
wp-admin/includes/class-wp-users-list-table.php
wp-admin/includes/comment.php
wp-admin/includes/dashboard.php
wp-admin/includes/deprecated.php
wp-admin/includes/export.php
wp-admin/includes/file.php
wp-admin/includes/image-edit.php
wp-admin/includes/image.php
wp-admin/includes/import.php
wp-admin/includes/media.php
wp-admin/includes/menu.php
wp-admin/includes/meta-boxes.php
wp-admin/includes/misc.php
wp-admin/includes/ms.php
wp-admin/includes/nav-menu.php
wp-admin/includes/plugin-install.php
wp-admin/includes/plugin.php
wp-admin/includes/post.php
wp-admin/includes/revision.php [new file with mode: 0644]
wp-admin/includes/schema.php
wp-admin/includes/screen.php
wp-admin/includes/taxonomy.php
wp-admin/includes/template.php
wp-admin/includes/theme-install.php
wp-admin/includes/theme.php
wp-admin/includes/update-core.php
wp-admin/includes/upgrade.php
wp-admin/includes/user.php
wp-admin/includes/widgets.php
wp-admin/index.php
wp-admin/install.php
wp-admin/js/accordion.js [new file with mode: 0644]
wp-admin/js/accordion.min.js [new file with mode: 0644]
wp-admin/js/categories.js
wp-admin/js/categories.min.js
wp-admin/js/color-picker.js
wp-admin/js/color-picker.min.js
wp-admin/js/common.js
wp-admin/js/common.min.js
wp-admin/js/custom-fields.js
wp-admin/js/custom-fields.min.js
wp-admin/js/customize-controls.js
wp-admin/js/customize-controls.min.js
wp-admin/js/editor.js
wp-admin/js/editor.min.js
wp-admin/js/inline-edit-post.js
wp-admin/js/inline-edit-post.min.js
wp-admin/js/inline-edit-tax.js
wp-admin/js/inline-edit-tax.min.js
wp-admin/js/iris.min.js
wp-admin/js/link.js
wp-admin/js/link.min.js
wp-admin/js/nav-menu.js
wp-admin/js/nav-menu.min.js
wp-admin/js/plugin-install.js
wp-admin/js/plugin-install.min.js
wp-admin/js/post.js
wp-admin/js/post.min.js
wp-admin/js/revisions-js.php [deleted file]
wp-admin/js/revisions.js [new file with mode: 0644]
wp-admin/js/revisions.min.js [new file with mode: 0644]
wp-admin/js/tags.js
wp-admin/js/tags.min.js
wp-admin/js/theme.js
wp-admin/js/theme.min.js
wp-admin/link-add.php
wp-admin/link-manager.php
wp-admin/link.php
wp-admin/load-scripts.php
wp-admin/load-styles.php
wp-admin/maint/repair.php
wp-admin/media-new.php
wp-admin/menu-header.php
wp-admin/menu.php
wp-admin/nav-menus.php
wp-admin/network.php
wp-admin/network/index.php
wp-admin/network/menu.php
wp-admin/network/settings.php
wp-admin/network/site-info.php
wp-admin/network/site-new.php
wp-admin/network/site-settings.php
wp-admin/network/site-users.php
wp-admin/network/sites.php
wp-admin/network/themes.php
wp-admin/network/upgrade.php
wp-admin/network/user-new.php
wp-admin/options-discussion.php
wp-admin/options-head.php
wp-admin/options-media.php
wp-admin/options-permalink.php
wp-admin/options-writing.php
wp-admin/options.php
wp-admin/plugin-editor.php
wp-admin/plugin-install.php
wp-admin/plugins.php
wp-admin/post-new.php
wp-admin/post.php
wp-admin/press-this.php
wp-admin/revision.php
wp-admin/setup-config.php
wp-admin/theme-editor.php
wp-admin/theme-install.php
wp-admin/themes.php
wp-admin/tools.php
wp-admin/update-core.php
wp-admin/upgrade.php
wp-admin/upload.php
wp-admin/user-edit.php
wp-admin/user-new.php
wp-admin/users.php
wp-comments-post.php
wp-content/plugins/akismet/.htaccess [deleted file]
wp-content/plugins/akismet/admin.php
wp-content/plugins/akismet/akismet.php
wp-content/plugins/akismet/img/logo.png [new file with mode: 0644]
wp-content/plugins/akismet/img/logo@2x.png [new file with mode: 0644]
wp-content/plugins/akismet/readme.txt
wp-content/plugins/hello.php
wp-content/themes/twentyeleven/404.php [deleted file]
wp-content/themes/twentyeleven/archive.php [deleted file]
wp-content/themes/twentyeleven/author.php [deleted file]
wp-content/themes/twentyeleven/category.php [deleted file]
wp-content/themes/twentyeleven/colors/dark.css [deleted file]
wp-content/themes/twentyeleven/comments.php [deleted file]
wp-content/themes/twentyeleven/content-aside.php [deleted file]
wp-content/themes/twentyeleven/content-featured.php [deleted file]
wp-content/themes/twentyeleven/content-gallery.php [deleted file]
wp-content/themes/twentyeleven/content-image.php [deleted file]
wp-content/themes/twentyeleven/content-intro.php [deleted file]
wp-content/themes/twentyeleven/content-link.php [deleted file]
wp-content/themes/twentyeleven/content-page.php [deleted file]
wp-content/themes/twentyeleven/content-quote.php [deleted file]
wp-content/themes/twentyeleven/content-single.php [deleted file]
wp-content/themes/twentyeleven/content-status.php [deleted file]
wp-content/themes/twentyeleven/content.php [deleted file]
wp-content/themes/twentyeleven/editor-style-rtl.css [deleted file]
wp-content/themes/twentyeleven/editor-style.css [deleted file]
wp-content/themes/twentyeleven/footer.php [deleted file]
wp-content/themes/twentyeleven/functions.php [deleted file]
wp-content/themes/twentyeleven/header.php [deleted file]
wp-content/themes/twentyeleven/image.php [deleted file]
wp-content/themes/twentyeleven/images/comment-arrow-bypostauthor-dark-rtl.png [deleted file]
wp-content/themes/twentyeleven/images/comment-arrow-bypostauthor-dark.png [deleted file]
wp-content/themes/twentyeleven/images/comment-arrow-bypostauthor-rtl.png [deleted file]
wp-content/themes/twentyeleven/images/comment-arrow-bypostauthor.png [deleted file]
wp-content/themes/twentyeleven/images/comment-arrow-dark-rtl.png [deleted file]
wp-content/themes/twentyeleven/images/comment-arrow-dark.png [deleted file]
wp-content/themes/twentyeleven/images/comment-arrow-rtl.png [deleted file]
wp-content/themes/twentyeleven/images/comment-arrow.png [deleted file]
wp-content/themes/twentyeleven/images/comment-bubble-dark-rtl.png [deleted file]
wp-content/themes/twentyeleven/images/comment-bubble-dark.png [deleted file]
wp-content/themes/twentyeleven/images/comment-bubble-rtl.png [deleted file]
wp-content/themes/twentyeleven/images/comment-bubble.png [deleted file]
wp-content/themes/twentyeleven/images/headers/chessboard-thumbnail.jpg [deleted file]
wp-content/themes/twentyeleven/images/headers/chessboard.jpg [deleted file]
wp-content/themes/twentyeleven/images/headers/hanoi-thumbnail.jpg [deleted file]
wp-content/themes/twentyeleven/images/headers/hanoi.jpg [deleted file]
wp-content/themes/twentyeleven/images/headers/lanterns-thumbnail.jpg [deleted file]
wp-content/themes/twentyeleven/images/headers/lanterns.jpg [deleted file]
wp-content/themes/twentyeleven/images/headers/pine-cone-thumbnail.jpg [deleted file]
wp-content/themes/twentyeleven/images/headers/pine-cone.jpg [deleted file]
wp-content/themes/twentyeleven/images/headers/shore-thumbnail.jpg [deleted file]
wp-content/themes/twentyeleven/images/headers/shore.jpg [deleted file]
wp-content/themes/twentyeleven/images/headers/trolley-thumbnail.jpg [deleted file]
wp-content/themes/twentyeleven/images/headers/trolley.jpg [deleted file]
wp-content/themes/twentyeleven/images/headers/wheel-thumbnail.jpg [deleted file]
wp-content/themes/twentyeleven/images/headers/wheel.jpg [deleted file]
wp-content/themes/twentyeleven/images/headers/willow-thumbnail.jpg [deleted file]
wp-content/themes/twentyeleven/images/headers/willow.jpg [deleted file]
wp-content/themes/twentyeleven/images/search.png [deleted file]
wp-content/themes/twentyeleven/images/wordpress.png [deleted file]
wp-content/themes/twentyeleven/inc/images/content-sidebar.png [deleted file]
wp-content/themes/twentyeleven/inc/images/content.png [deleted file]
wp-content/themes/twentyeleven/inc/images/dark.png [deleted file]
wp-content/themes/twentyeleven/inc/images/light.png [deleted file]
wp-content/themes/twentyeleven/inc/images/sidebar-content.png [deleted file]
wp-content/themes/twentyeleven/inc/theme-customizer.js [deleted file]
wp-content/themes/twentyeleven/inc/theme-options.css [deleted file]
wp-content/themes/twentyeleven/inc/theme-options.js [deleted file]
wp-content/themes/twentyeleven/inc/theme-options.php [deleted file]
wp-content/themes/twentyeleven/inc/widgets.php [deleted file]
wp-content/themes/twentyeleven/index.php [deleted file]
wp-content/themes/twentyeleven/js/showcase.js [deleted file]
wp-content/themes/twentyeleven/languages/twentyeleven.pot [deleted file]
wp-content/themes/twentyeleven/page.php [deleted file]
wp-content/themes/twentyeleven/readme.txt [deleted file]
wp-content/themes/twentyeleven/rtl.css [deleted file]
wp-content/themes/twentyeleven/screenshot.png [deleted file]
wp-content/themes/twentyeleven/search.php [deleted file]
wp-content/themes/twentyeleven/searchform.php [deleted file]
wp-content/themes/twentyeleven/showcase.php [deleted file]
wp-content/themes/twentyeleven/sidebar-footer.php [deleted file]
wp-content/themes/twentyeleven/sidebar-page.php [deleted file]
wp-content/themes/twentyeleven/sidebar.php [deleted file]
wp-content/themes/twentyeleven/single.php [deleted file]
wp-content/themes/twentyeleven/style.css [deleted file]
wp-content/themes/twentyeleven/tag.php [deleted file]
wp-content/themes/twentythirteen/404.php [new file with mode: 0644]
wp-content/themes/twentythirteen/archive.php [new file with mode: 0644]
wp-content/themes/twentythirteen/author-bio.php [new file with mode: 0644]
wp-content/themes/twentythirteen/author.php [new file with mode: 0644]
wp-content/themes/twentythirteen/category.php [new file with mode: 0644]
wp-content/themes/twentythirteen/comments.php [new file with mode: 0644]
wp-content/themes/twentythirteen/content-aside.php [new file with mode: 0644]
wp-content/themes/twentythirteen/content-audio.php [new file with mode: 0644]
wp-content/themes/twentythirteen/content-chat.php [new file with mode: 0644]
wp-content/themes/twentythirteen/content-gallery.php [new file with mode: 0644]
wp-content/themes/twentythirteen/content-image.php [new file with mode: 0644]
wp-content/themes/twentythirteen/content-link.php [new file with mode: 0644]
wp-content/themes/twentythirteen/content-none.php [new file with mode: 0644]
wp-content/themes/twentythirteen/content-quote.php [new file with mode: 0644]
wp-content/themes/twentythirteen/content-status.php [new file with mode: 0644]
wp-content/themes/twentythirteen/content-video.php [new file with mode: 0644]
wp-content/themes/twentythirteen/content.php [new file with mode: 0644]
wp-content/themes/twentythirteen/css/editor-style.css [new file with mode: 0644]
wp-content/themes/twentythirteen/css/ie.css [new file with mode: 0644]
wp-content/themes/twentythirteen/fonts/COPYING.txt [new file with mode: 0644]
wp-content/themes/twentythirteen/fonts/LICENSE.txt [moved from wp-content/themes/twentyeleven/license.txt with 81% similarity]
wp-content/themes/twentythirteen/fonts/genericons-regular-webfont.eot [new file with mode: 0644]
wp-content/themes/twentythirteen/fonts/genericons-regular-webfont.svg [new file with mode: 0644]
wp-content/themes/twentythirteen/fonts/genericons-regular-webfont.ttf [new file with mode: 0644]
wp-content/themes/twentythirteen/fonts/genericons-regular-webfont.woff [new file with mode: 0644]
wp-content/themes/twentythirteen/fonts/genericons.css [new file with mode: 0644]
wp-content/themes/twentythirteen/footer.php [new file with mode: 0644]
wp-content/themes/twentythirteen/functions.php [new file with mode: 0644]
wp-content/themes/twentythirteen/header.php [new file with mode: 0644]
wp-content/themes/twentythirteen/image.php [new file with mode: 0644]
wp-content/themes/twentythirteen/images/dotted-line-2x.png [new file with mode: 0644]
wp-content/themes/twentythirteen/images/dotted-line-light-2x.png [new file with mode: 0644]
wp-content/themes/twentythirteen/images/dotted-line-light.png [new file with mode: 0644]
wp-content/themes/twentythirteen/images/dotted-line.png [new file with mode: 0644]
wp-content/themes/twentythirteen/images/headers/circle-thumbnail.png [new file with mode: 0644]
wp-content/themes/twentythirteen/images/headers/circle.png [new file with mode: 0644]
wp-content/themes/twentythirteen/images/headers/diamond-thumbnail.png [new file with mode: 0644]
wp-content/themes/twentythirteen/images/headers/diamond.png [new file with mode: 0644]
wp-content/themes/twentythirteen/images/headers/star-thumbnail.png [new file with mode: 0644]
wp-content/themes/twentythirteen/images/headers/star.png [new file with mode: 0644]
wp-content/themes/twentythirteen/images/search-icon-2x.png [new file with mode: 0644]
wp-content/themes/twentythirteen/images/search-icon.png [new file with mode: 0644]
wp-content/themes/twentythirteen/inc/back-compat.php [new file with mode: 0644]
wp-content/themes/twentythirteen/inc/custom-header.php [new file with mode: 0644]
wp-content/themes/twentythirteen/index.php [new file with mode: 0644]
wp-content/themes/twentythirteen/js/functions.js [new file with mode: 0644]
wp-content/themes/twentythirteen/js/html5.js [moved from wp-content/themes/twentyeleven/js/html5.js with 97% similarity]
wp-content/themes/twentythirteen/js/theme-customizer.js [new file with mode: 0644]
wp-content/themes/twentythirteen/languages/twentythirteen.pot [new file with mode: 0644]
wp-content/themes/twentythirteen/page.php [new file with mode: 0644]
wp-content/themes/twentythirteen/rtl.css [new file with mode: 0644]
wp-content/themes/twentythirteen/screenshot.png [new file with mode: 0644]
wp-content/themes/twentythirteen/search.php [new file with mode: 0644]
wp-content/themes/twentythirteen/sidebar-main.php [new file with mode: 0644]
wp-content/themes/twentythirteen/sidebar.php [new file with mode: 0644]
wp-content/themes/twentythirteen/single.php [new file with mode: 0644]
wp-content/themes/twentythirteen/style.css [new file with mode: 0644]
wp-content/themes/twentythirteen/tag.php [new file with mode: 0644]
wp-content/themes/twentythirteen/taxonomy-post_format.php [new file with mode: 0644]
wp-content/themes/twentytwelve/content-aside.php
wp-content/themes/twentytwelve/content-image.php
wp-content/themes/twentytwelve/content-page.php
wp-content/themes/twentytwelve/content.php
wp-content/themes/twentytwelve/editor-style.css
wp-content/themes/twentytwelve/functions.php
wp-content/themes/twentytwelve/inc/custom-header.php
wp-content/themes/twentytwelve/js/theme-customizer.js
wp-content/themes/twentytwelve/languages/twentytwelve.pot
wp-content/themes/twentytwelve/rtl.css
wp-content/themes/twentytwelve/style.css
wp-includes/ID3/getid3.lib.php [new file with mode: 0644]
wp-includes/ID3/getid3.php [new file with mode: 0644]
wp-includes/ID3/license.commercial.txt [new file with mode: 0644]
wp-includes/ID3/license.txt [new file with mode: 0644]
wp-includes/ID3/module.audio-video.asf.php [new file with mode: 0644]
wp-includes/ID3/module.audio-video.flv.php [new file with mode: 0644]
wp-includes/ID3/module.audio-video.matroska.php [new file with mode: 0644]
wp-includes/ID3/module.audio-video.quicktime.php [new file with mode: 0644]
wp-includes/ID3/module.audio-video.riff.php [new file with mode: 0644]
wp-includes/ID3/module.audio.ac3.php [new file with mode: 0644]
wp-includes/ID3/module.audio.dts.php [new file with mode: 0644]
wp-includes/ID3/module.audio.flac.php [new file with mode: 0644]
wp-includes/ID3/module.audio.mp3.php [new file with mode: 0644]
wp-includes/ID3/module.audio.ogg.php [new file with mode: 0644]
wp-includes/ID3/module.tag.apetag.php [new file with mode: 0644]
wp-includes/ID3/module.tag.id3v1.php [new file with mode: 0644]
wp-includes/ID3/module.tag.id3v2.php [new file with mode: 0644]
wp-includes/ID3/module.tag.lyrics3.php [new file with mode: 0644]
wp-includes/ID3/readme.txt [new file with mode: 0644]
wp-includes/SimplePie/Misc.php
wp-includes/Text/Diff.php
wp-includes/Text/Diff/Engine/native.php
wp-includes/Text/Diff/Engine/string.php
wp-includes/Text/Diff/Engine/xdiff.php
wp-includes/Text/Diff/Renderer.php
wp-includes/admin-bar.php
wp-includes/atomlib.php
wp-includes/author-template.php
wp-includes/bookmark.php
wp-includes/cache.php
wp-includes/canonical.php
wp-includes/capabilities.php
wp-includes/category-template.php
wp-includes/class-feed.php
wp-includes/class-http.php
wp-includes/class-json.php
wp-includes/class-oembed.php
wp-includes/class-phpmailer.php
wp-includes/class-smtp.php
wp-includes/class-snoopy.php
wp-includes/class-wp-customize-control.php
wp-includes/class-wp-customize-manager.php
wp-includes/class-wp-customize-section.php
wp-includes/class-wp-customize-setting.php
wp-includes/class-wp-editor.php
wp-includes/class-wp-error.php
wp-includes/class-wp-image-editor-gd.php
wp-includes/class-wp-image-editor-imagick.php
wp-includes/class-wp-image-editor.php
wp-includes/class-wp-theme.php
wp-includes/class-wp-walker.php
wp-includes/class-wp-xmlrpc-server.php
wp-includes/class-wp.php
wp-includes/class.wp-scripts.php
wp-includes/class.wp-styles.php
wp-includes/comment-template.php
wp-includes/comment.php
wp-includes/cron.php
wp-includes/css/admin-bar.css
wp-includes/css/admin-bar.min.css
wp-includes/css/editor.css
wp-includes/css/editor.min.css
wp-includes/css/jquery-ui-dialog.css
wp-includes/css/jquery-ui-dialog.min.css
wp-includes/css/media-views-rtl.css
wp-includes/css/media-views-rtl.min.css
wp-includes/css/wp-auth-check.css [new file with mode: 0644]
wp-includes/css/wp-auth-check.min.css [new file with mode: 0644]
wp-includes/default-constants.php
wp-includes/default-filters.php
wp-includes/default-widgets.php
wp-includes/deprecated.php
wp-includes/feed-atom-comments.php
wp-includes/feed.php
wp-includes/formatting.php
wp-includes/functions.php
wp-includes/functions.wp-scripts.php
wp-includes/functions.wp-styles.php
wp-includes/general-template.php
wp-includes/http.php
wp-includes/js/admin-bar.js
wp-includes/js/admin-bar.min.js
wp-includes/js/autosave.js
wp-includes/js/autosave.min.js
wp-includes/js/backbone.min.js
wp-includes/js/crop/cropper.css
wp-includes/js/heartbeat.js [new file with mode: 0644]
wp-includes/js/heartbeat.min.js [new file with mode: 0644]
wp-includes/js/hoverIntent.js
wp-includes/js/hoverIntent.min.js
wp-includes/js/jquery/jquery-migrate.js [new file with mode: 0644]
wp-includes/js/jquery/jquery-migrate.min.js [new file with mode: 0644]
wp-includes/js/jquery/jquery.color.min.js
wp-includes/js/jquery/jquery.js
wp-includes/js/jquery/jquery.query.js
wp-includes/js/jquery/suggest.js
wp-includes/js/jquery/suggest.min.js
wp-includes/js/jquery/ui/jquery.ui.accordion.min.js
wp-includes/js/jquery/ui/jquery.ui.autocomplete.min.js
wp-includes/js/jquery/ui/jquery.ui.button.min.js
wp-includes/js/jquery/ui/jquery.ui.core.min.js
wp-includes/js/jquery/ui/jquery.ui.datepicker.min.js
wp-includes/js/jquery/ui/jquery.ui.dialog.min.js
wp-includes/js/jquery/ui/jquery.ui.draggable.min.js
wp-includes/js/jquery/ui/jquery.ui.droppable.min.js
wp-includes/js/jquery/ui/jquery.ui.effect-blind.min.js
wp-includes/js/jquery/ui/jquery.ui.effect-bounce.min.js
wp-includes/js/jquery/ui/jquery.ui.effect-clip.min.js
wp-includes/js/jquery/ui/jquery.ui.effect-drop.min.js
wp-includes/js/jquery/ui/jquery.ui.effect-explode.min.js
wp-includes/js/jquery/ui/jquery.ui.effect-fade.min.js
wp-includes/js/jquery/ui/jquery.ui.effect-fold.min.js
wp-includes/js/jquery/ui/jquery.ui.effect-highlight.min.js
wp-includes/js/jquery/ui/jquery.ui.effect-pulsate.min.js
wp-includes/js/jquery/ui/jquery.ui.effect-scale.min.js
wp-includes/js/jquery/ui/jquery.ui.effect-shake.min.js
wp-includes/js/jquery/ui/jquery.ui.effect-slide.min.js
wp-includes/js/jquery/ui/jquery.ui.effect-transfer.min.js
wp-includes/js/jquery/ui/jquery.ui.effect.min.js
wp-includes/js/jquery/ui/jquery.ui.menu.min.js
wp-includes/js/jquery/ui/jquery.ui.mouse.min.js
wp-includes/js/jquery/ui/jquery.ui.position.min.js
wp-includes/js/jquery/ui/jquery.ui.progressbar.min.js
wp-includes/js/jquery/ui/jquery.ui.resizable.min.js
wp-includes/js/jquery/ui/jquery.ui.selectable.min.js
wp-includes/js/jquery/ui/jquery.ui.slider.min.js
wp-includes/js/jquery/ui/jquery.ui.sortable.min.js
wp-includes/js/jquery/ui/jquery.ui.spinner.min.js
wp-includes/js/jquery/ui/jquery.ui.tabs.min.js
wp-includes/js/jquery/ui/jquery.ui.tooltip.min.js
wp-includes/js/jquery/ui/jquery.ui.widget.min.js
wp-includes/js/media-editor.js
wp-includes/js/media-editor.min.js
wp-includes/js/media-models.js
wp-includes/js/media-models.min.js
wp-includes/js/media-views.js
wp-includes/js/media-views.min.js
wp-includes/js/mediaelement/background.png [new file with mode: 0644]
wp-includes/js/mediaelement/bigplay.png [new file with mode: 0644]
wp-includes/js/mediaelement/bigplay.svg [new file with mode: 0644]
wp-includes/js/mediaelement/controls.png [new file with mode: 0644]
wp-includes/js/mediaelement/controls.svg [new file with mode: 0644]
wp-includes/js/mediaelement/flashmediaelement.swf [new file with mode: 0644]
wp-includes/js/mediaelement/loading.gif [new file with mode: 0644]
wp-includes/js/mediaelement/mediaelement-and-player.min.js [new file with mode: 0644]
wp-includes/js/mediaelement/mediaelementplayer.min.css [new file with mode: 0644]
wp-includes/js/mediaelement/silverlightmediaelement.xap [new file with mode: 0644]
wp-includes/js/mediaelement/wp-mediaelement.css [new file with mode: 0644]
wp-includes/js/mediaelement/wp-mediaelement.js [new file with mode: 0644]
wp-includes/js/plupload/changelog.txt
wp-includes/js/plupload/plupload.flash.js
wp-includes/js/plupload/plupload.html4.js
wp-includes/js/plupload/plupload.html5.js
wp-includes/js/plupload/plupload.js
wp-includes/js/plupload/plupload.silverlight.js
wp-includes/js/plupload/plupload.silverlight.xap
wp-includes/js/quicktags.js
wp-includes/js/quicktags.min.js
wp-includes/js/swfupload/swfupload.swf
wp-includes/js/thickbox/thickbox.js
wp-includes/js/tinymce/plugins/media/editor_plugin_src.js
wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js
wp-includes/js/tinymce/plugins/wordpress/editor_plugin_src.js
wp-includes/js/tinymce/plugins/wpdialogs/editor_plugin_src.js
wp-includes/js/tinymce/plugins/wpdialogs/js/popup.js
wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js
wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js
wp-includes/js/tinymce/plugins/wpgallery/editor_plugin_src.js
wp-includes/js/tinymce/plugins/wplink/editor_plugin_src.js
wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css
wp-includes/js/tinymce/wp-tinymce-schema.js
wp-includes/js/tinymce/wp-tinymce.js.gz
wp-includes/js/underscore.min.js
wp-includes/js/wp-auth-check.js [new file with mode: 0644]
wp-includes/js/wp-auth-check.min.js [new file with mode: 0644]
wp-includes/js/wp-backbone.js [new file with mode: 0644]
wp-includes/js/wp-backbone.min.js [new file with mode: 0644]
wp-includes/js/wp-util.js [new file with mode: 0644]
wp-includes/js/wp-util.min.js [new file with mode: 0644]
wp-includes/js/wplink.js
wp-includes/js/wplink.min.js
wp-includes/link-template.php
wp-includes/load.php
wp-includes/locale.php
wp-includes/media-template.php
wp-includes/media.php
wp-includes/meta.php
wp-includes/ms-blogs.php
wp-includes/ms-default-filters.php
wp-includes/ms-deprecated.php
wp-includes/ms-files.php
wp-includes/ms-functions.php
wp-includes/ms-load.php
wp-includes/nav-menu-template.php
wp-includes/nav-menu.php
wp-includes/option.php
wp-includes/pluggable-deprecated.php
wp-includes/pluggable.php
wp-includes/plugin.php
wp-includes/pomo/translations.php
wp-includes/post-formats.php [new file with mode: 0644]
wp-includes/post-template.php
wp-includes/post-thumbnail-template.php
wp-includes/post.php
wp-includes/query.php
wp-includes/revision.php [new file with mode: 0644]
wp-includes/rewrite.php
wp-includes/rss.php
wp-includes/script-loader.php
wp-includes/shortcodes.php
wp-includes/taxonomy.php
wp-includes/template.php
wp-includes/theme.php
wp-includes/update.php
wp-includes/user.php
wp-includes/vars.php
wp-includes/version.php
wp-includes/widgets.php
wp-includes/wp-db.php
wp-includes/wp-diff.php
wp-login.php
wp-mail.php
wp-settings.php
wp-signup.php
wp-trackback.php
xmlrpc.php

index ec05d2948477d42941702b9de842a00558c9170f..06c105b129adb885fbad99c37672d3ee0429252d 100644 (file)
@@ -1,6 +1,6 @@
 WordPress - Web publishing software\r
 \r
-Copyright 2011 by the contributors\r
+Copyright 2013 by the contributors\r
 \r
 This program is free software; you can redistribute it and/or modify\r
 it under the terms of the GNU General Public License as published by\r
index 1f66b202db45f3fecdce94c49be451f02ed85df7..1dde82294ff2f8c214055a8f90b49c53e7a0e57f 100644 (file)
@@ -1,5 +1,5 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+<!DOCTYPE html>
+<html>
 <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>WordPress &#8250; ReadMe</title>
@@ -8,12 +8,12 @@
 <body>
 <h1 id="logo">
        <a href="http://wordpress.org/"><img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /></a>
-       <br /> Version 3.5.2
+       <br /> Version 3.6
 </h1>
 <p style="text-align: center">Semantic Personal Publishing Platform</p>
 
 <h1>First Things First</h1>
-<p>Welcome. WordPress is a very special project to me. Every developer and contributor adds something unique to the mix, and together we create something beautiful that I'm proud to be a part of. Thousands of hours have gone into WordPress, and we're dedicated to making it better every day. Thank you for making it part of your world.</p>
+<p>Welcome. WordPress is a very special project to me. Every developer and contributor adds something unique to the mix, and together we create something beautiful that I&#8217;m proud to be a part of. Thousands of hours have gone into WordPress, and we&#8217;re dedicated to making it better every day. Thank you for making it part of your world.</p>
 <p style="text-align: right">&#8212; Matt Mullenweg</p>
 
 <h1>Installation: Famous 5-minute install</h1>
        <li>Unzip the package in an empty directory and upload everything.</li>
        <li>Open <span class="file"><a href="wp-admin/install.php">wp-admin/install.php</a></span> in your browser. It will take you through the process to set up a <code>wp-config.php</code> file with your database connection details.
                <ol>
-                       <li>If for some reason this doesn't work, don't worry. It doesn't work on all web hosts. Open up <code>wp-config-sample.php</code> with a text editor like WordPad or similar and fill in your database connection details.</li>
+                       <li>If for some reason this doesn&#8217;t work, don&#8217;t worry. It doesn&#8217;t work on all web hosts. Open up <code>wp-config-sample.php</code> with a text editor like WordPad or similar and fill in your database connection details.</li>
                        <li>Save the file as <code>wp-config.php</code> and upload it.</li>
                        <li>Open <span class="file"><a href="wp-admin/install.php">wp-admin/install.php</a></span> in your browser.</li>
                </ol>
        </li>
        <li>Once the configuration file is set up, the installer will set up the tables needed for your blog. If there is an error, double check your <code>wp-config.php</code> file, and try again. If it fails again, please go to the <a href="http://wordpress.org/support/" title="WordPress support">support forums</a> with as much data as you can gather.</li>
        <li><strong>If you did not enter a password, note the password given to you.</strong> If you did not provide a username, it will be <code>admin</code>.</li>
-       <li>The installer should then send you to the <a href="wp-login.php">login page</a>. Sign in with the username and password you chose during the installation. If a password was generated for you, you can then click on 'Profile' to change the password.</li>
+       <li>The installer should then send you to the <a href="wp-login.php">login page</a>. Sign in with the username and password you chose during the installation. If a password was generated for you, you can then click on &#8220;Profile&#8221; to change the password.</li>
 </ol>
 
 <h1>Updating</h1>
 <h2>Using the Automatic Updater</h2>
 <p>If you are updating from version 2.7 or higher, you can use the automatic updater:</p>
 <ol>
-       <li>Open the <span class="file"><a href="wp-admin/update-core.php">wp-admin/update-core.php</a></span> in your browser and follow the instructions.</li>
-       <li>You wanted more, perhaps? That's it!</li>
+       <li>Open <span class="file"><a href="wp-admin/update-core.php">wp-admin/update-core.php</a></span> in your browser and follow the instructions.</li>
+       <li>You wanted more, perhaps? That&#8217;s it!</li>
 </ol>
 
 <h2>Updating Manually</h2>
 <ol>
        <li>Before you update anything, make sure you have backup copies of any files you may have modified such as <code>index.php</code>.</li>
-       <li>Delete your old WordPress files, saving ones you've modified.</li>
+       <li>Delete your old WordPress files, saving ones you&#8217;ve modified.</li>
        <li>Upload the new files.</li>
        <li>Point your browser to <span class="file"><a href="wp-admin/upgrade.php">/wp-admin/upgrade.php</a>.</span></li>
 </ol>
 
-<h2>Theme Template Changes</h2>
-<p>If you have customized your theme templates, you may have to make some changes across major versions.</p>
-
 <h1>Migrating from other systems</h1>
 <p>WordPress can <a href="http://codex.wordpress.org/Importing_Content">import from a number of systems</a>. First you need to get WordPress installed and working as described above, before using <a href="wp-admin/import.php" title="Import to WordPress">our import tools</a>.</p>
 
 </ul>
 
 <h1>Online Resources</h1>
-<p>If you have any questions that aren't addressed in this document, please take advantage of WordPress' numerous online resources:</p>
+<p>If you have any questions that aren&#8217;t addressed in this document, please take advantage of WordPress&#8217; numerous online resources:</p>
 <dl>
        <dt><a href="http://codex.wordpress.org/">The WordPress Codex</a></dt>
                <dd>The Codex is the encyclopedia of all things WordPress. It is the most comprehensive source of information for WordPress available.</dd>
        <dt><a href="http://wordpress.org/news/">The WordPress Blog</a></dt>
-               <dd>This is where you'll find the latest updates and news related to WordPress. Recent WordPress news appears in your administrative dashboard by default.</dd>
+               <dd>This is where you&#8217;ll find the latest updates and news related to WordPress. Recent WordPress news appears in your administrative dashboard by default.</dd>
        <dt><a href="http://planet.wordpress.org/">WordPress Planet</a></dt>
                <dd>The WordPress Planet is a news aggregator that brings together posts from WordPress blogs around the web.</dd>
        <dt><a href="http://wordpress.org/support/">WordPress Support Forums</a></dt>
-               <dd>If you've looked everywhere and still can't find an answer, the support forums are very active and have a large community ready to help. To help them help you be sure to use a descriptive thread title and describe your question in as much detail as possible.</dd>
+               <dd>If you&#8217;ve looked everywhere and still can&#8217;t find an answer, the support forums are very active and have a large community ready to help. To help them help you be sure to use a descriptive thread title and describe your question in as much detail as possible.</dd>
        <dt><a href="http://codex.wordpress.org/IRC">WordPress <abbr title="Internet Relay Chat">IRC</abbr> Channel</a></dt>
                <dd>There is an online chat channel that is used for discussion among people who use WordPress and occasionally support topics. The above wiki page should point you in the right direction. (<a href="irc://irc.freenode.net/wordpress">irc.freenode.net #wordpress</a>)</dd>
 </dl>
 
-<h1><abbr title="eXtensible Markup Language">XML</abbr>-<abbr title="Remote Procedure Call">RPC</abbr> and Atom Interface</h1>
-<p>You can post to your WordPress blog with tools like <a href="http://download.live.com/writer">Windows Live Writer</a>, <a href="http://illuminex.com/ecto/">Ecto</a>, <a href="http://bloggar.com/">w.bloggar</a>, <a href="http://radio.userland.com/">Radio Userland</a> (which means you can use Radio's email-to-blog feature), <a href="http://www.newzcrawler.com/">NewzCrawler</a>, and other tools that support the blogging <abbr title="application programming interface">API</abbr>s! :) You can read more about <a href="http://codex.wordpress.org/XML-RPC_Support"><abbr>XML</abbr>-<abbr>RPC</abbr> support on the Codex</a>.</p>
-
-<h1>Post via Email</h1>
-<p>You can post from an email client! To set this up go to your &quot;Writing&quot; options screen and fill in the connection details for your secret <abbr title="Post Office Protocol version 3">POP3</abbr> account. Then you need to set up <code>wp-mail.php</code> to execute periodically to check the mailbox for new posts. You can do it with <a href="http://en.wikipedia.org/wiki/Cron">cron</a>-jobs, or if your host doesn't support it you can look into the various website-monitoring services, and make them check your <code>wp-mail.php</code> <abbr title="Uniform Resource Locator">URL</abbr>.</p>
-<p>Posting is easy: Any email sent to the address you specify will be posted, with the subject as the title. It is best to keep the address discrete. The script will <em>delete</em> emails that are successfully posted.</p>
-
-<h1>User Roles</h1>
-<p>We introduced a very flexible roles system in version 2.0. You can <a href="http://codex.wordpress.org/Roles_and_Capabilities" title="WordPress roles and capabilities">read more about Roles and Capabilities on the Codex</a>.</p>
-
 <h1>Final Notes</h1>
 <ul>
        <li>If you have any suggestions, ideas, or comments, or if you (gasp!) found a bug, join us in the <a href="http://wordpress.org/support/">Support Forums</a>.</li>
-       <li>WordPress has a robust plugin <abbr title="application programming interface">API</abbr> that makes extending the code easy. If you are a developer interested in utilizing this, see the <a href="http://codex.wordpress.org/Plugin_API" title="WordPress plugin API">plugin documentation in the Codex</a>. You shouldn't modify any of the core code.</li>
+       <li>WordPress has a robust plugin <abbr title="application programming interface">API</abbr> that makes extending the code easy. If you are a developer interested in utilizing this, see the <a href="http://codex.wordpress.org/Plugin_API" title="WordPress plugin API">plugin documentation in the Codex</a>. You shouldn&#8217;t modify any of the core code.</li>
 </ul>
 
 <h1>Share the Love</h1>
index 0d5f1dca36dbd7e09e516132f31414327ab794af..6a474b12fb2bc7d43c0cc39d27efc1d0e1954e3b 100644 (file)
@@ -6,7 +6,6 @@
  * @package WordPress
  */
 
-/** Define ABSPATH as this file's directory */
 define( 'WP_INSTALLING', true );
 
 /** Sets up the WordPress Environment. */
index 552437d67511d8708ad42002dfc85da9ed1f2ac0..8b155d21b42b0d736952b31aa00692a3e61eeb3d 100644 (file)
@@ -19,7 +19,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
 
 <h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
 
-<div class="about-text"><?php printf( __( 'Thank you for updating to the latest version! WordPress %s is more polished and enjoyable than ever before. We hope you like it.' ), $display_version ); ?></div>
+<div class="about-text"><?php printf( __( 'Thank you for updating to the latest version. WordPress %s makes your writing experience even better.' ), $display_version ); ?></div>
 
 <div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
 
@@ -33,67 +33,66 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
        </a>
 </h2>
 
-<div class="changelog point-releases">
-       <h3><?php echo _n( 'Maintenance and Security Release', 'Maintenance and Security Releases', 2 ); ?></h3>
-       <p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
-         '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 12 ), '3.5.2', number_format_i18n( 12 ) ); ?>
-               <?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'http://codex.wordpress.org/Version_3.5.2' ); ?>
-       </p>
-       <p><?php printf( _n( '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
-         '<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.', 37 ), '3.5.1', number_format_i18n( 37 ) ); ?>
-               <?php printf( __( 'For more information, see <a href="%s">the release notes</a>.' ), 'http://codex.wordpress.org/Version_3.5.1' ); ?>
-       </p>
-</div>
-
 <div class="changelog">
-       <h3><?php _e( 'New Media Manager' ); ?></h3>
+       <h3><?php _e( 'Colorful New Theme' ); ?></h3>
 
-       <div class="feature-section col two-col">
-               <img alt="" src="<?php echo esc_url( admin_url( 'images/screenshots/about-media.png' ) ); ?>" class="image-100" />
-
-               <div>
-                       <h4><?php _e( 'Beautiful Interface' ); ?></h4>
-                       <p><?php _e( 'Adding media has been streamlined with an all-new experience, making it a breeze to upload files and place them into your posts.' ); ?></p>
-               </div>
-               <div class="last-feature">
-                       <h4><?php _e( 'Picturesque Galleries' ); ?></h4>
-                       <p><?php _e( 'Creating image galleries is faster with drag and drop reordering, inline caption editing, and simplified controls for layout.' ); ?></p>
-               </div>
+       <div class="feature-section images-stagger-right">
+               <img alt="" src="<?php echo is_ssl() ? 'https://' : '//s.'; ?>wordpress.org/images/core/3.6/twentythirteen.png" class="image-66" />
+               <h4><?php _e( 'Introducing Twenty Thirteen' ); ?></h4>
+               <p><?php printf( __( "The new default theme puts focus on your content with a colorful, single-column design made for media-rich blogging." ) ); ?></p>
+               <p><?php _e( 'Inspired by modern art, Twenty Thirteen features quirky details, beautiful typography, and bold, high-contrast colors &mdash; all with a flexible layout that looks great on any device, big or small.' ); ?></p>
        </div>
 </div>
 
 <div class="changelog">
-       <h3><?php _e( 'New Default Theme' ); ?></h3>
+       <h3><?php _e( 'Write with Confidence' ); ?></h3>
 
        <div class="feature-section images-stagger-right">
-               <img alt="" src="<?php echo esc_url( admin_url( 'images/screenshots/about-twenty-twelve.png' ) ); ?>" class="image-66" />
-               <h4><?php _e( 'Introducing Twenty Twelve' ); ?></h4>
-               <p><?php _e( 'The newest default theme for WordPress is simple, flexible, and elegant.' ); ?></p>
-               <p><?php _e( 'What makes it really shine are the design details, like the gorgeous Open Sans typeface and a fully responsive design that looks great on any device.' ); ?></p>
-               <p><?php _e( 'Naturally, Twenty Twelve supports all the theme features you’ve come to know and love, but it is also designed to be as great for a website as it is for a blog.' ); ?></p>
+               <img alt="" src="<?php echo is_ssl() ? 'https://' : '//s.'; ?>wordpress.org/images/core/3.6/revisions.png" class="image-66" />
+               <h4><?php _e( 'Explore Revisions' ); ?></h4>
+               <p></p>
+               <p><?php _e( 'From the first word you write, WordPress saves every change. Each revision is always at your fingertips. Text is highlighted as you scroll through revisions at lightning speed, so you can see what changes have been made along the way.' ); ?></p>
+               <p><?php _e( 'It&#8217;s easy to compare two revisions from any point in time, and to restore a revision and go back to writing. Now you can be confident that no mistake is permanent.' ); ?></p>
        </div>
-</div>
 
-<div class="changelog">
-       <h3><?php _e( 'Retina Ready' ); ?></h3>
-
-       <div class="feature-section images-stagger-right">
-               <img alt="" src="<?php echo esc_url( admin_url( 'images/screenshots/about-retina.png' ) ); ?>" class="image-66" />
-               <h4><?php _e( 'So Sharp You Can&#8217;t See the Pixels' ); ?></h4>
-               <p><?php _e( 'The WordPress dashboard now looks beautiful on high-resolution screens like those found on the iPad, Kindle Fire HD, Nexus 10, and MacBook Pro with Retina Display. Icons and other visual elements are crystal clear and full of detail.' ); ?></p>
+       <div class="feature-section col two-col">
+               <div>
+                       <h4><?php _e( 'Improved Autosaves' ); ?></h4>
+                       <p><?php _e( 'Never lose a word you&#8217;ve written. Autosaving is now even better; whether your power goes out, your browser crashes, or you lose your internet connection, your content is safe.' ); ?></p>
+               </div>
+               <div class="last-feature">
+                       <h4><?php _e( 'Better Post Locking' ); ?></h4>
+                       <p><?php _e( 'Always know who&#8217;s editing with live updates that appear in the list of posts. And if someone leaves for lunch with a post open, you can take over where they left off.' ); ?></p>
+               </div>
        </div>
 </div>
 
 <div class="changelog">
-       <h3><?php _e( 'Smoother Experience' ); ?></h3>
+       <h3><?php _e( 'Support for Audio and Video' ); ?></h3>
 
        <div class="feature-section images-stagger-right">
-               <img alt="" src="<?php echo esc_url( admin_url( 'images/screenshots/about-color-picker.png' ) ); ?>" class="image-30" />
-               <h4><?php _e( 'Better Accessibility' ); ?></h4>
-               <p><?php _e( 'WordPress supports more usage modes than ever before. Screenreaders, touch devices, and mouseless workflows all have improved ease of use and accessibility.' ); ?></p>
-
-               <h4><?php _e( 'More Polish' ); ?></h4>
-               <p><?php _e( 'A number of screens and controls have been refined. For example, a new color picker makes it easier for you to choose that perfect shade of blue.' ); ?></p>
+               <div class="video image-66"><?php
+                       $sample_video = ( is_ssl() ? 'https://' : 'http://s.' ) . 'wordpress.org/images/core/3.6/sample-video';
+                       $args = array(
+                               'mp4' => "$sample_video.mp4",
+                               'ogv' => "$sample_video.ogv",
+                               'width' => 625,
+                               'height' => 360,
+                       );
+                       // Opera 12 (Presto, pre-Chromium) fails to load ogv properly
+                       // when combined with ME.js. Works fine in Opera 15.
+                       // Don't serve ogv to Opera 12 to avoid complete brokeness.
+                       if ( $GLOBALS['is_opera'] )
+                               unset( $args['ogv'] );
+                       // Our current ME.js API is limited to shortcodes in posts.
+                       echo wp_video_shortcode( $args );
+               ?></div>
+               <h4><?php _e( 'New Media Player' ); ?></h4>
+               <p><?php _e( 'Share your audio and video with the new built-in HTML5 media player. Upload files using the media manager and embed them in your posts.' ); ?></p>
+
+               <h4><?php _e( 'Embed Music from Spotify, Rdio, and SoundCloud' ); ?></h4>
+               <p><?php _e( 'Embed songs and albums from your favorite artists, or playlists you&#8217;ve mixed yourself. It&#8217;s as simple as pasting a URL into a post on its own line.' ); ?></p>
+               <p><?php printf( __( '(Love another service? Check out all of the <a href="%s">embeds</a> that WordPress supports.)' ), 'http://codex.wordpress.org/Embeds' ); ?></p>
        </div>
 </div>
 
@@ -102,31 +101,33 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
 
        <div class="feature-section col three-col">
                <div>
-                       <h4><?php _e( 'Meta Query Additions' ); ?></h4>
-                       <p><?php _e( 'The <code>WP_Comment_Query</code> and <code>WP_User_Query</code> classes now support meta queries just like <code>WP_Query.</code> Meta queries now support querying for objects without a particular meta key.' ); ?></p>
+                       <h4><?php _e( 'Audio/Video API' ); ?></h4>
+                       <p><?php _e( 'The new audio/video APIs give developers access to powerful media metadata, like ID3 tags.' ); ?></p>
                </div>
                <div>
-                       <h4><?php _e( 'Post Objects' ); ?></h4>
-                       <p><?php _e( 'Post objects are now instances of a <code>WP_Post</code> class, which improves performance by loading selected properties on demand.' ); ?></p>
+                       <h4><?php _e( 'Semantic Markup' ); ?></h4>
+                       <p><?php _e( 'Themes can now choose improved HTML5 markup for comment forms, search forms, and comment lists.' ); ?></p>
                </div>
                <div class="last-feature">
-                       <h4><?php _e( 'Image Editing API' ); ?></h4>
-                       <p><?php _e( 'The <code>WP_Image_Editor</code> class abstracts image editing functionality such as cropping and scaling, and uses ImageMagick when available.' ); ?></p>
+                       <h4><?php _e( 'JavaScript Utilities' ); ?></h4>
+                       <p><?php _e( 'Handy JavaScript utilities ease common tasks like Ajax requests, templating, and Backbone view management.' ); ?></p>
                </div>
        </div>
 
        <div class="feature-section col three-col">
                <div>
-                       <h4><?php _e( 'Multisite Improvements' ); ?></h4>
-                       <p><?php _e( '<code>switch_to_blog()</code> is now significantly faster and more reliable.' ); ?></p>
+                       <h4><?php _e( 'Shortcode Improvements' ); ?></h4>
+                       <p><?php _e( 'Search content for shortcodes with <code>has_shortcode()</code> and adjust shortcode attributes with a new filter.' ); ?></p>
                </div>
                <div>
-                       <h4><?php _e( 'XML-RPC API' ); ?></h4>
-                       <p><?php printf( __( 'The <a href="%s">WordPress API</a> is now always enabled, and supports fetching users, editing profiles, managing post revisions, and searching posts.' ), __( 'http://codex.wordpress.org/XML-RPC_WordPress_API' ) ); ?></p>
+                       <h4><?php _e( 'Revision Control' ); ?></h4>
+                       <p><?php _e( 'Fine-grained revision controls allow you to keep a different number of revisions for each post type.' ); ?></p>
                </div>
                <div class="last-feature">
                        <h4><?php _e( 'External Libraries' ); ?></h4>
-                       <p><?php printf( __( 'WordPress now includes the <a href="%1$s">Underscore</a> and <a href="%2$s">Backbone</a> JavaScript libraries. TinyMCE, jQuery, jQuery UI, and SimplePie have all been updated to the latest versions.' ), 'http://underscorejs.org/', 'http://backbonejs.org/' ); ?></p>
+                       <p><?php
+                               /* translators: placeholders 2, 3 and 4 are version numbers */
+                               printf( __( 'New and updated libraries: <a href="%1$s">MediaElement.js</a>, jQuery %2$s, jQuery UI %3$s, jQuery Migrate, Backbone %4$s.' ), 'http://mediaelementjs.com/', '1.10.2', '1.10.3', '1.0' ); ?></p>
                </div>
        </div>
 </div>
index 716e384da46155803b423a2cd9fe71e8b1cf42e6..c638d78aad27a3f8d907e9b42afce5be329bd8ed 100644 (file)
@@ -56,7 +56,7 @@ $core_actions_post = array(
        'save-widget', 'set-post-thumbnail', 'date_format', 'time_format', 'wp-fullscreen-save-post',
        'wp-remove-post-lock', 'dismiss-wp-pointer', 'upload-attachment', 'get-attachment',
        'query-attachments', 'save-attachment', 'save-attachment-compat', 'send-link-to-editor',
-       'send-attachment-to-editor', 'save-attachment-order',
+       'send-attachment-to-editor', 'save-attachment-order', 'heartbeat', 'get-revision-diffs',
 );
 
 // Register core Ajax calls.
@@ -66,7 +66,7 @@ if ( ! empty( $_GET['action'] ) && in_array( $_GET['action'], $core_actions_get
 if ( ! empty( $_POST['action'] ) && in_array( $_POST['action'], $core_actions_post ) )
        add_action( 'wp_ajax_' . $_POST['action'], 'wp_ajax_' . str_replace( '-', '_', $_POST['action'] ), 1 );
 
-add_action( 'wp_ajax_nopriv_autosave', 'wp_ajax_nopriv_autosave', 1 );
+add_action( 'wp_ajax_nopriv_heartbeat', 'wp_ajax_nopriv_heartbeat', 1 );
 
 if ( is_user_logged_in() )
        do_action( 'wp_ajax_' . $_REQUEST['action'] ); // Authenticated actions
index f99934e58e6eba8543d85a293959e3dbdbc3531c..00ad2996956efdef30f4b412f047d8056ceb8bd7 100644 (file)
@@ -98,9 +98,8 @@ $admin_body_class .= ' no-customize-support';
 </script>
 
 <?php
-// If the customize-loader script is enqueued, make sure the customize
-// body classes are correct as early as possible.
-if ( wp_script_is( 'customize-loader', 'queue' ) && current_user_can( 'edit_theme_options' ) )
+// Make sure the customize body classes are correct as early as possible.
+if ( current_user_can( 'edit_theme_options' ) )
        wp_customize_support_script();
 ?>
 
index bd2e5406a6ab55282ba73bc9369ab34f92ec05a8..4e739c3c8d088ce873e4c22b3a26f3ceb3cbe644 100644 (file)
@@ -43,7 +43,7 @@ if ( get_option('db_upgraded') ) {
        do_action('after_db_upgrade');
 } elseif ( get_option('db_version') != $wp_db_version && empty($_POST) ) {
        if ( !is_multisite() ) {
-               wp_redirect(admin_url('upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI']))));
+               wp_redirect( admin_url( 'upgrade.php?_wp_http_referer=' . urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
                exit;
        } elseif ( apply_filters( 'do_mu_upgrade', true ) ) {
                /**
@@ -77,14 +77,12 @@ set_screen_options();
 $date_format = get_option('date_format');
 $time_format = get_option('time_format');
 
-wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'text', 'trackback', 'pingback'));
-
 wp_enqueue_script( 'common' );
 
 $editing = false;
 
 if ( isset($_GET['page']) ) {
-       $plugin_page = stripslashes($_GET['page']);
+       $plugin_page = wp_unslash( $_GET['page'] );
        $plugin_page = plugin_basename($plugin_page);
 }
 
index 5f2938e84f34c8731ac46169a887f2e554f6d8c7..296342eaa13f4729daa10f46faacb669c3c56b58 100644 (file)
@@ -47,8 +47,7 @@ if ( isset($_REQUEST['attachment_id']) && ($id = intval($_REQUEST['attachment_id
        $post = get_post( $id );
        if ( 'attachment' != $post->post_type )
                wp_die( __( 'Unknown post type.' ) );
-       $post_type_object = get_post_type_object( 'attachment' );
-       if ( ! current_user_can( $post_type_object->cap->edit_post, $id ) )
+       if ( ! current_user_can( 'edit_post', $id ) )
                wp_die( __( 'You are not allowed to edit this item.' ) );
 
        switch ( $_REQUEST['fetch'] ) {
@@ -57,7 +56,7 @@ if ( isset($_REQUEST['attachment_id']) && ($id = intval($_REQUEST['attachment_id
                                echo '<img class="pinkynail" src="' . esc_url( $thumb_url[0] ) . '" alt="" />';
                        echo '<a class="edit-attachment" href="' . esc_url( get_edit_post_link( $id ) ) . '" target="_blank">' . _x( 'Edit', 'media item' ) . '</a>';
                        $title = $post->post_title ? $post->post_title : wp_basename( $post->guid ); // title shouldn't ever be empty, but use filename just in cas.e
-                       echo '<div class="filename new"><span class="title">' . esc_html( wp_html_excerpt( $title, 60 ) ) . '</span></div>';
+                       echo '<div class="filename new"><span class="title">' . esc_html( wp_html_excerpt( $title, 60, '&hellip;' ) ) . '</span></div>';
                        break;
                case 2 :
                        add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2);
index 5249e1181b218aed2ef70683c599c362b79c25db..7052357b8b8f3487d9331f5bc71d20e3fd11798c 100644 (file)
@@ -52,7 +52,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
 
 <h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
 
-<div class="about-text"><?php printf( __( 'Thank you for updating to the latest version! WordPress %s is more polished and enjoyable than ever before. We hope you like it.' ), $display_version ); ?></div>
+<div class="about-text"><?php printf( __( 'Thank you for updating to the latest version. WordPress %s makes your writing experience even better.' ), $display_version ); ?></div>
 
 <div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
 
index 2a2054541744ca97d108514083757227ff91c4d6..2dbbb30a50ff7bf76c62eb0f77c63d23d1ba4471 100644 (file)
@@ -83,7 +83,7 @@ div.dashboard-widget,
        background-color: #f1f1f1;
 }
 
-.widefat {
+table.widefat {
        border-color: #d1e5ee;
        background-color: #fff;
 }
@@ -164,6 +164,7 @@ textarea.disabled {
        color: #fff;
 }
 
+.revisions-meta,
 .widget .widget-top,
 .postbox h3,
 .stuffbox h3,
@@ -1457,25 +1458,81 @@ div.wp-menu-image {
 
 /* end screen icons */
 
+/* Post format icons */
+
+.post-format-icon {
+       background: url(../images/post-formats-vs.png) no-repeat;
+}
+
 /* Diff */
 table.diff .diff-deletedline {
-       background-color: #fdd;
+       background-color: #ffe9e9;
 }
 
 table.diff .diff-deletedline del {
-       background-color: #f99;
+       background-color: #faa;
 }
 
 table.diff .diff-addedline {
-       background-color: #dfd;
+       background-color: #e9ffe9;
 }
 
 table.diff .diff-addedline ins {
-       background-color: #9f9;
+       background-color: #afa;
 }
 
-#att-info {
-       background-color: #e4f2fd;
+.revisions-meta {
+       border: 1px solid #d1e5ee;
+}
+
+.revisions-controls {
+       background: #fff;
+       background: -webkit-gradient(linear, left bottom, left top, color-stop(0%,rgba(255,255,255,1)), color-stop(30px,rgba(255,255,255,1)), color-stop(100%,rgba(255,255,255,1)));
+       background: -webkit-linear-gradient(bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%);
+       background:    -moz-linear-gradient(bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%);
+       background:      -o-linear-gradient(bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%);
+       background: linear-gradient(to top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%);
+}
+
+.revisions-tooltip,
+.revisions-tooltip-arrow span {
+       border-color: #d1e5ee;
+       background-color: #fff;
+}
+
+.revisions-tickmarks > div {
+       border-color: #d1e5ee;
+}
+
+/* jQuery UI Slider */
+.wp-slider.ui-slider {
+       border-color: #d1e5ee;
+}
+
+.wp-slider .ui-slider-handle {
+       color: #333;
+       border-color: none;
+}
+
+.wp-slider .ui-slider-handle {
+       border-color: #d0dfe9;
+       background: #eff8ff;
+       background-image: -webkit-gradient(linear, left bottom, left top, from(#eff8ff), to(#fff));
+       background-image: -webkit-linear-gradient(bottom, #eff8ff, #fff);
+       background-image:    -moz-linear-gradient(bottom, #eff8ff, #fff);
+       background-image:      -o-linear-gradient(bottom, #eff8ff, #fff);
+       background-image: linear-gradient(to top, #eff8ff, #fff);
+}
+
+.wp-slider .ui-slider-handle:hover,
+.wp-slider .ui-slider-handle:focus {
+       border-color: #a0c3d5;
+}
+
+.wp-slider .ui-slider-handle.ui-state-hover,
+.wp-slider .ui-slider-handle.ui-state-focus {
+       border-color: #a0c3d5;
+       outline: none;
 }
 
 /* edit image */
@@ -1535,11 +1592,6 @@ table.diff .diff-addedline ins {
        border-color: #ddd;
 }
 
-.inline-editor .categories .catshow,
-.inline-editor .categories .cathide {
-       color: #21759b;
-}
-
 .inline-editor .quick-edit-save {
        background-color: #f1f1f1;
 }
@@ -2198,4 +2250,10 @@ h2.nav-tab-wrapper, h3.nav-tab-wrapper {
                background-size: 16px auto;
        }
 
+       /* 16px post formats */
+       .post-format-icon {
+               background-image: url(../images/post-formats32-vs.png);
+               background-size: 16px 304px;
+       }
+
 }
index 8b368f33a9e8771c74bd9b050554e52a22d418f0..8c49a6bd93bf776ec0aacbf3c888d043b82fbb0a 100644 (file)
@@ -1 +1 @@
-.find-box-search,.find-box-buttons{background-color:#eff8ff;border-top:1px solid #dce6f8}.find-box{background-color:#5589aa}.find-box-head{color:#fff}.find-box-inside{background-color:#fff}a.page-numbers:hover{border-color:#999}body,#wpbody,.form-table .pre,.ui-autocomplete li a{color:#333}body>#upload-menu{border-bottom-color:#fff}#postcustomstuff table,#your-profile fieldset,#rightnow,div.dashboard-widget,#dashboard-widgets p.dashboard-widget-links{border-color:#d1e5ee}#poststuff .inside label.spam,#poststuff .inside label.deleted{color:red}#poststuff .inside label.waiting{color:orange}#poststuff .inside label.approved{color:green}#postcustomstuff table{border-color:#dfdfdf;background-color:#f9f9f9}#postcustomstuff thead th{background-color:#f1f1f1}.widefat{border-color:#d1e5ee;background-color:#fff}div.dashboard-widget-error{background-color:#c43}div.dashboard-widget-notice{background-color:#cfe1ef}div.dashboard-widget-submit{border-top-color:#ccc}ul.category-tabs li{border-color:transparent}div.tabs-panel,.wp-tab-panel,ul.add-menu-item-tabs li.tabs,.wp-tab-active{border-color:#d1e5ee;background-color:#fff}ul.category-tabs li.tabs{border-color:#d1e5ee #d1e5ee #fff}ul.category-tabs li.tabs,ul.add-menu-item-tabs li.tabs,.wp-tab-active{background-color:#fff}kbd,code{background:#eff8ff}textarea,input[type="text"],input[type="password"],input[type="file"],input[type="email"],input[type="number"],input[type="search"],input[type="tel"],input[type="url"],select{border-color:#d1e5ee}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="file"]:focus,input[type="email"]:focus,input[type="number"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="url"]:focus,select:focus{border-color:#b0c8d7}input.disabled,textarea.disabled{background-color:#ccc}#plugin-information .action-button a,#plugin-information .action-button a:hover,#plugin-information .action-button a:visited{color:#fff}.widget .widget-top,.postbox h3,.stuffbox h3,.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small,.sidebar-name,#nav-menu-header,#nav-menu-footer,.menu-item-handle,#fullscreen-topbar{background:#f5fafd;background-image:-webkit-gradient(linear,left bottom,left top,from(#eff8ff),to(#f7fcfe));background-image:-webkit-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:-moz-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:-o-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:linear-gradient(to top,#eff8ff,#f7fcfe)}.widget .widget-top,.postbox h3,.stuffbox h3{border-bottom-color:#d1e5ee;text-shadow:#fff 0 1px 0;-webkit-box-shadow:0 1px 0 #fff;box-shadow:0 1px 0 #fff}.form-table th,.form-wrap label{color:#222;text-shadow:#fff 0 1px 0}.description,.form-wrap p{color:#666}strong .post-com-count span{background-color:#21759b}.sorthelper{background-color:#ccf3fa}.ac_match,.subsubsub a.current{color:#000}.wrap h2{color:#174f69}.wrap .add-new-h2,.wrap .add-new-h2:active{background:#f1f1f1}.subtitle{color:#777}.ac_over{background-color:#f0f0b8}.ac_results{background-color:#fff;border-color:#b0c8d7}.ac_results li{color:#101010}.alternate,.alt{background-color:#f7fcfe}.available-theme a.screenshot{background-color:#eff8ff;border-color:#acd}#current-theme{border-bottom-color:#d1e5ee}.bar{background-color:#e8e8e8;border-right-color:#99d}#media-upload,#media-upload .media-item .slidetoggle{background:#fff}#media-upload .slidetoggle{border-top-color:#dfdfdf}div.error,.login #login_error{background-color:#ffebe8;border-color:#c00}div.error a{color:#c00}.form-invalid{background-color:#ffebe8!important}.form-invalid input,.form-invalid select{border-color:#c00!important}.submit,#commentsdiv #add-new-comment{border-color:#dfdfdf}.highlight{background-color:#e4f2fd;color:#000}.howto,.nonessential,#edit-slug-box,.form-input-tip,.subsubsub{color:#666}.media-upload-form label.form-help,td.help{color:#9a9a9a}.ui-autocomplete{border-color:#b0c8d7;background-color:#eff8ff}.ui-autocomplete li a.ui-state-focus{background-color:#def1ff}.post-com-count{color:#fff}.post-com-count span{background-color:#bbb;color:#fff}.post-com-count:hover span{background-color:#d54e21}.quicktags,.search{background-color:#ccc;color:#000}.side-info h5{border-bottom-color:#dadada}.side-info ul{color:#666}a:hover,a:active{color:#d54e21}a:focus{color:#124964}#adminmenu a:hover,#adminmenu li.menu-top>a:focus,#adminmenu .wp-submenu a:hover,#the-comment-list .comment a:hover,#rightnow a:hover,#media-upload a.del-link:hover,div.dashboard-widget-submit input:hover,.subsubsub a:hover,.subsubsub a.current:hover,.ui-tabs-nav a:hover,.plugins .inactive a:hover,#all-plugins-table .plugins .inactive a:hover,#search-plugins-table .plugins .inactive a:hover{color:#d54e21}#the-comment-list .comment-item,#dashboard-widgets #dashboard_quick_press form p.submit{border-color:#dfdfdf}#side-sortables .category-tabs .tabs a,#side-sortables .add-menu-item-tabs .tabs a,.wp-tab-bar .wp-tab-active a{color:#333}#dashboard_right_now .table_content,#dashboard_right_now .table_discussion{border-top-color:#d1e5ee}#rightnow .rbutton{background-color:#ebebeb;color:#264761}.submitbox .submit{background-color:#464646;color:#ccc}.plugins a.delete:hover,#all-plugins-table .plugins a.delete:hover,#search-plugins-table .plugins a.delete:hover,.submitbox .submitdelete{color:#f00;border-bottom-color:#f00}.submitbox .submitdelete:hover,#media-items a.delete:hover,#media-items a.delete-permanently:hover{color:#fff;background-color:#f00;border-bottom-color:#f00}#normal-sortables .submitbox .submitdelete:hover{color:#000;background-color:#f00;border-bottom-color:#f00}.tablenav .dots{border-color:transparent}.tablenav .next,.tablenav .prev{border-color:transparent;color:#21759b}.tablenav .next:hover,.tablenav .prev:hover{border-color:transparent;color:#d54e21}div.updated,.login .message{background-color:#ffffe0;border-color:#e6db55}.update-message{color:#000}a.page-numbers{border-bottom-color:#b8d3e2}.commentlist li{border-bottom-color:#ccc}.widefat td,.widefat th{border-top-color:#fff;border-bottom-color:#d0dfe9}.widefat th{text-shadow:rgba(255,255,255,0.8) 0 1px 0}.widefat td{color:#555}.widefat p,.widefat ol,.widefat ul{color:#333}.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small{color:#333}th.sortable a:hover,th.sortable a:active,th.sortable a:focus{color:#333}th.sortable a:focus{background:#e1e1e1;background-image:-webkit-gradient(linear,left bottom,left top,from(#dcdcdc),to(#e9e9e9));background-image:-webkit-linear-gradient(bottom,#dcdcdc,#e9e9e9);background-image:-moz-linear-gradient(bottom,#dcdcdc,#e9e9e9);background-image:-o-linear-gradient(bottom,#dcdcdc,#e9e9e9);background-image:linear-gradient(to top,#dcdcdc,#e9e9e9)}h3.dashboard-widget-title small a{color:#d7d7d7}h3.dashboard-widget-title small a:hover{color:#fff}a,#adminmenu a,#the-comment-list p.comment-author strong a,#media-upload a.del-link,#media-items a.delete,#media-items a.delete-permanently,.plugins a.delete,.ui-tabs-nav a{color:#21759b}#adminmenu .awaiting-mod,#adminmenu .update-plugins,#sidemenu a .update-plugins,#rightnow .reallynow{background-color:#464646;color:#fff;-webkit-box-shadow:rgba(255,255,255,0.5) 0 1px 0;box-shadow:rgba(255,255,255,0.5) 0 1px 0}#plugin-information .action-button{background-color:#d54e21;color:#fff}#adminmenu li.current a .awaiting-mod,#adminmenu li a.wp-has-current-submenu .update-plugins{background-color:#464646;color:#fff;-webkit-box-shadow:rgba(255,255,255,0.5) 0 1px 0;box-shadow:rgba(255,255,255,0.5) 0 1px 0}div#media-upload-header,div#plugin-information-header{background-color:#f9f9f9;border-bottom-color:#dfdfdf}#currenttheme img{border-color:#666}#dashboard_secondary div.dashboard-widget-content ul li a{background-color:#f9f9f9}input.readonly,textarea.readonly{background-color:#ddd}#editable-post-name{background-color:#fffbcc}#edit-slug-box strong,.tablenav .displaying-num,#submitted-on,.submitted-on{color:#777}.login #nav a,.login #backtoblog a{color:#21759b!important}.login #nav a:hover,.login #backtoblog a:hover{color:#d54e21!important}#wpfooter{color:#777;border-color:#b0c8d7}.imgedit-group,#media-items .media-item,.media-item .describe{border-color:#dfdfdf}.checkbox,.side-info,.plugins tr,#your-profile #rich_editing{background-color:#fcfcfc}.plugins .inactive,.plugins .inactive th,.plugins .inactive td,tr.inactive+tr.plugin-update-tr .plugin-update{background-color:#f7fcfe}.plugin-update-tr .update-message{background-color:#fffbe4;border-color:#dfdfdf}.plugins .active,.plugins .active th,.plugins .active td{color:#000}.plugins .inactive a{color:#579}#the-comment-list tr.undo,#the-comment-list div.undo{background-color:#f4f4f4}#the-comment-list .unapproved{background-color:#ffffe0}#the-comment-list .approve a{color:#006505}#the-comment-list .unapprove a{color:#d98500}table.widefat span.delete a,table.widefat span.trash a,table.widefat span.spam a,#dashboard_recent_comments .delete a,#dashboard_recent_comments .trash a,#dashboard_recent_comments .spam a{color:#bc0b0b}.welcome-panel{background:#f5fafd;background-image:-webkit-gradient(linear,left bottom,left top,from(#eff8ff),to(#f7fcfe));background-image:-webkit-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:-moz-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:-o-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:linear-gradient(to top,#eff8ff,#f7fcfe);border-color:#d1e5ee}.welcome-panel p{color:#777}.welcome-panel-column p{color:#464646}.welcome-panel h3{text-shadow:1px 1px 1px #fff}.widget,#widget-list .widget-top,.postbox,#titlediv,#poststuff .postarea,.stuffbox{border-color:#d1e5ee;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;-webkit-border-radius:3px;border-radius:3px}.widget,#widget-list .widget-top,.postbox,.menu-item-settings{background:#f5fafd;background-image:-webkit-gradient(linear,left bottom,left top,from(#eff8ff),to(#f7fcfe));background-image:-webkit-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:-moz-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:-o-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:linear-gradient(to top,#eff8ff,#f7fcfe)}.postbox h3{color:#174f69}.widget .widget-top{color:#174f69}.js .sidebar-name:hover h3,.js .postbox h3:hover{color:#000}.curtime #timestamp{background-image:url(../images/date-button.gif)}#quicktags #ed_link{color:#00f}#rightnow .youhave{background-color:#f0f6fb}#rightnow a{color:#448abd}.tagchecklist span a,#bulk-titles div a{background:url(../images/xit.gif) no-repeat}.tagchecklist span a:hover,#bulk-titles div a:hover{background:url(../images/xit.gif) no-repeat -10px 0}#update-nag,.update-nag{background-color:#fffbcc;border-color:#e6db55;color:#555}#screen-meta{background-color:#eff8ff;border-color:#d1e5ee;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.05);box-shadow:0 1px 3px rgba(0,0,0,0.05)}#contextual-help-back{background:#fff}.contextual-help-tabs a:hover{background-color:#ceeaff;color:#333}#contextual-help-back,.contextual-help-tabs .active{border-color:#d1e5ee}.contextual-help-tabs .active,.contextual-help-tabs .active a,.contextual-help-tabs .active a:hover{background:#fff;color:#000}#screen-options-link-wrap,#contextual-help-link-wrap{border-right:1px solid #d1e5ee;border-left:1px solid #d1e5ee;border-bottom:1px solid #d1e5ee;background:#eff8ff;background-image:-webkit-gradient(linear,left bottom,left top,from(#def1ff),to(#eff8ff));background-image:-webkit-linear-gradient(bottom,#def1ff,#eff8ff);background-image:-moz-linear-gradient(bottom,#def1ff,#eff8ff);background-image:-o-linear-gradient(bottom,#def1ff,#eff8ff);background-image:linear-gradient(to top,#def1ff,#eff8ff)}#screen-meta-links a{color:#606060;background:transparent url(../images/arrows.png) no-repeat right 4px}#screen-meta-links a:hover,#screen-meta-links a:active{color:#000;background-color:transparent}#screen-meta-links a.screen-meta-active{background-position:right -31px}.login #backtoblog a{color:#464646}#wphead{border-bottom:1px solid #d0dfe9}#wphead h1 a{color:#174f69}#wpfooter a:link,#wpfooter a:visited{text-decoration:none}#wpfooter a:hover{color:#000;text-decoration:underline}.file-error,abbr.required,.widget-control-remove:hover,table.widefat .delete a:hover,table.widefat .trash a:hover,table.widefat .spam a:hover,#dashboard_recent_comments .delete a:hover,#dashboard_recent_comments .trash a:hover #dashboard_recent_comments .spam a:hover{color:#f00}#pass-strength-result{background-color:#eee;border-color:#ddd!important}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important}#poststuff .wp-editor-wrap .wp_themeSkin .mceStatusbar{border-color:#d0dfe9;background-color:#eff8ff}#poststuff .wp-editor-wrap .wp_themeSkin .mceStatusbar *{color:#555}#poststuff #editor-toolbar .active{border-color:#d0dfe9 #d0dfe9 #eff8ff;background-color:#eff8ff;color:#333}.wp-editor-wrap .wp-editor-container,.wp-editor-wrap .wp_themeSkin table.mceLayout{border-color:#d1e5ee #d1e5ee #d0dfe9}#editorcontainer{border-color:#d1e5ee #d1e5ee #d0dfe9}#post-status-info{border-color:#d0dfe9 #d1e5ee #d1e5ee}.wp-admin .wp-editor-wrap .wp-switch-editor{background-color:#d3e9f2;border-color:#d1e5ee #d1e5ee #d3e9f2;color:#174f69}.wp-admin .wp-editor-wrap .wp-switch-editor:active{background-color:#f5fafd}.wp-admin .wp-editor-wrap.tmce-active .switch-tmce,.wp-admin .wp-editor-wrap.html-active .switch-html{background:#f7fcfe;border-color:#d1e5ee #d1e5ee #f7fcfe}.wp-admin .wp-editor-wrap .quicktags-toolbar,.wp-admin .wp-editor-wrap .wp_themeSkin tr.mceFirst td.mceToolbar{border-color:#d0dfe9;background-color:#f5fafd;background-image:-webkit-gradient(linear,left bottom,left top,from(#eff8ff),to(#f7fcfe));background-image:-webkit-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:-moz-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:-o-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:linear-gradient(to top,#eff8ff,#f7fcfe)}.wp-admin .wp_themeSkin table.mceListBox{border-color:#d1e5ee}.wp-admin .wp_themeSkin table.mceListBoxEnabled:hover,.wp-admin .wp_themeSkin table.mceListBoxEnabled:active,.wp-admin .wp_themeSkin table.mceListBoxHover,.wp-admin .wp_themeSkin table.mceListBoxHover:active,.wp-admin .wp_themeSkin table.mceListBoxSelected{border-color:#b8cfdf}.wp-admin .wp_themeSkin a.mceButtonEnabled:hover,.wp-admin .wp_themeSkin table.mceSplitButton:hover{border-color:#c3d2dc;background:#f4f9fc;background-image:-webkit-gradient(linear,left bottom,left top,from(#f4f9fc),to(#fff));background-image:-webkit-linear-gradient(bottom,#f4f9fc,#fff);background-image:-moz-linear-gradient(bottom,#f4f9fc,#fff);background-image:-o-linear-gradient(bottom,#f4f9fc,#fff);background-image:linear-gradient(to top,#f4f9fc,#fff)}.wp-admin .wp_themeSkin a.mceButton:active,.wp-admin .wp_themeSkin a.mceButtonEnabled:active,.wp-admin .wp_themeSkin a.mceButtonSelected:active,.wp-admin .wp_themeSkin a.mceButtonActive,.wp-admin .wp_themeSkin a.mceButtonActive:active,.wp-admin .wp_themeSkin a.mceButtonActive:hover,.wp-admin .wp_themeSkin .mceSplitButtonSelected table,.wp-admin .wp_themeSkin .mceSplitButtonSelected table:hover{border-color:#8f9da9 #c3d2dc #c3d2dc #8f9da9;background:#f4f9fc;background-image:-webkit-gradient(linear,left bottom,left top,from(#fff),to(#f4f9fc));background-image:-webkit-linear-gradient(bottom,#fff,#f4f9fc);background-image:-moz-linear-gradient(bottom,#fff,#f4f9fc);background-image:-o-linear-gradient(bottom,#fff,#f4f9fc);background-image:linear-gradient(to top,#fff,#f4f9fc)}.wp-admin .wp_themeSkin .mceSplitButtonSelected table a.mceOpen,.wp-admin .wp_themeSkin .mceSplitButtonSelected table a.mceAction{border-color:#8f9da9 #c3d2dc #c3d2dc #8f9da9}.wp-admin .wp_themeSkin .mceSplitButton:hover a{border-color:#c3d2dc}.editwidget .widget-inside{border-color:#d0dfe9}#titlediv #title{background-color:#fff}#tTips p#tTips_inside{background-color:#ddd;color:#333}#poststuff .inside .the-tagcloud{border-color:#ddd}#adminmenuback,#adminmenuwrap{background-color:#eff8ff;border-color:#d1e5ee}#adminmenushadow,#adminmenuback{background-image:url(../images/menu-shadow.png);background-position:top right;background-repeat:repeat-y}#adminmenu li.wp-menu-separator{background:#d1e5ee;border-color:#bed1dd}#adminmenu div.separator{border-color:#d1e5ee}#adminmenu a.menu-top,#adminmenu .wp-submenu .wp-submenu-head{border-top-color:#fff;border-bottom-color:#cae6ff}#adminmenu li.wp-menu-open{border-color:#d1e5ee}#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{background-color:#e0f1ff;color:#d54e21;text-shadow:0 1px 0 rgba(255,255,255,0.4)}#adminmenu li.menu-top:hover>a span,#adminmenu li.menu-top>a:focus span{text-shadow:none}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu li.current a.menu-top,.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.current.menu-top,#adminmenu .wp-menu-arrow,#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{background:#5589aa;background-image:-webkit-gradient(linear,left bottom,left top,from(#5589aa),to(#619bbb));background-image:-webkit-linear-gradient(bottom,#5589aa,#619bbb);background-image:-moz-linear-gradient(bottom,#5589aa,#619bbb);background-image:-o-linear-gradient(bottom,#5589aa,#619bbb);background-image:linear-gradient(to top,#5589aa,#619bbb)}#adminmenu .wp-menu-arrow div{background:#5589aa;background-image:-webkit-gradient(linear,right bottom,left top,from(#5589aa),to(#619bbb));background-image:-webkit-linear-gradient(bottom right,#5589aa,#619bbb);background-image:-moz-linear-gradient(bottom right,#5589aa,#619bbb);background-image:-o-linear-gradient(bottom right,#5589aa,#619bbb);background-image:linear-gradient(to top left,#5589aa,#619bbb)}#adminmenu li.wp-not-current-submenu .wp-menu-arrow{border-top-color:#fff;border-bottom-color:#cae6ff;background:#e0f1ff}#adminmenu li.wp-not-current-submenu .wp-menu-arrow div{background:#e0f1ff;border-color:#cae6ff}.folded #adminmenu li.menu-top li:hover a{background-image:none}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu li.current a.menu-top,#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{text-shadow:0 -1px 0 #333;color:#fff;border-top-color:#5a8fad;border-bottom-color:#5589aa}.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{border-top-color:#5a8fad;border-bottom-color:#5589aa}#adminmenu .wp-submenu a:hover,#adminmenu .wp-submenu a:focus{background-color:#eff8ff;color:#333}#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover{color:#333}#adminmenu .wp-submenu,.folded #adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background-color:#fff;border-color:#d0dfe9;-webkit-box-shadow:2px 3px 6px rgba(0,0,0,0.4);box-shadow:2px 3px 6px rgba(0,0,0,0.4)}#adminmenu .wp-submenu .wp-submenu-head{background-color:#e0f1ff;color:#333}#collapse-menu{color:#a0c3d5;border-top-color:#f9f9f9}#collapse-menu:hover{color:#5a8fad}#collapse-button{border-color:#d0dfe9;background:#eff8ff;background-image:-webkit-gradient(linear,left bottom,left top,from(#eff8ff),to(#fff));background-image:-webkit-linear-gradient(bottom,#eff8ff,#fff);background-image:-moz-linear-gradient(bottom,#eff8ff,#fff);background-image:-o-linear-gradient(bottom,#eff8ff,#fff);background-image:linear-gradient(to top,#eff8ff,#fff)}#collapse-menu:hover #collapse-button{border-color:#a0c3d5}#collapse-button div{background:transparent url(../images/arrows-vs.png) no-repeat 0 -72px}.folded #collapse-button div{background-position:0 -108px}@media only screen and (max-width:900px){.auto-fold #adminmenu li.wp-has-current-submenu,.auto-fold #adminmenu li.current.menu-top{background-color:#5589aa;background-image:-webkit-gradient(linear,left bottom,left top,from(#5589aa),to(#619bbb));background-image:-webkit-linear-gradient(bottom,#5589aa,#619bbb);background-image:-moz-linear-gradient(bottom,#5589aa,#619bbb);background-image:-o-linear-gradient(bottom,#5589aa,#619bbb);background-image:linear-gradient(bottom,#5589aa,#619bbb)}.auto-fold #adminmenu li.wp-has-current-submenu,.auto-fold #adminmenu li.current.menu-top{border-top-color:#5a8fad;border-bottom-color:#5589aa}.auto-fold #adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu{background-color:#fff;border-color:#d0dfe9;-webkit-box-shadow:2px 3px 6px rgba(0,0,0,0.4);box-shadow:2px 3px 6px rgba(0,0,0,0.4)}.auto-fold #collapse-button div{background-position:0 -108px}}.icon16,.icon32,div.wp-menu-image{background-color:transparent;background-repeat:no-repeat}.icon16.icon-dashboard,.menu-icon-dashboard div.wp-menu-image,.icon16.icon-post,.menu-icon-post div.wp-menu-image,.icon16.icon-media,.menu-icon-media div.wp-menu-image,.icon16.icon-links,.menu-icon-links div.wp-menu-image,.icon16.icon-page,.menu-icon-page div.wp-menu-image,.icon16.icon-comments,.menu-icon-comments div.wp-menu-image,.icon16.icon-appearance,.menu-icon-appearance div.wp-menu-image,.icon16.icon-plugins,.menu-icon-plugins div.wp-menu-image,.icon16.icon-users,.menu-icon-users div.wp-menu-image,.icon16.icon-tools,.menu-icon-tools div.wp-menu-image,.icon16.icon-settings,.menu-icon-settings div.wp-menu-image,.icon16.icon-site,.menu-icon-site div.wp-menu-image,.icon16.icon-generic,.menu-icon-generic div.wp-menu-image{background-image:url(../images/menu-vs.png?ver=20121105)}.icon16.icon-dashboard,#adminmenu .menu-icon-dashboard div.wp-menu-image{background-position:-59px -33px}#adminmenu .menu-icon-dashboard:hover div.wp-menu-image,#adminmenu .menu-icon-dashboard.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-dashboard.current div.wp-menu-image{background-position:-59px -1px}.icon16.icon-post,#adminmenu .menu-icon-post div.wp-menu-image{background-position:-269px -33px}#adminmenu .menu-icon-post:hover div.wp-menu-image,#adminmenu .menu-icon-post.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-post.current div.wp-menu-image{background-position:-269px -1px}.icon16.icon-media,#adminmenu .menu-icon-media div.wp-menu-image{background-position:-119px -33px}#adminmenu .menu-icon-media:hover div.wp-menu-image,#adminmenu .menu-icon-media.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-media.current div.wp-menu-image{background-position:-119px -1px}.icon16.icon-links,#adminmenu .menu-icon-links div.wp-menu-image{background-position:-89px -33px}#adminmenu .menu-icon-links:hover div.wp-menu-image,#adminmenu .menu-icon-links.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-links.current div.wp-menu-image{background-position:-89px -1px}.icon16.icon-page,#adminmenu .menu-icon-page div.wp-menu-image{background-position:-149px -33px}#adminmenu .menu-icon-page:hover div.wp-menu-image,#adminmenu .menu-icon-page.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-page.current div.wp-menu-image{background-position:-149px -1px}.icon16.icon-comments,#adminmenu .menu-icon-comments div.wp-menu-image{background-position:-29px -33px}#adminmenu .menu-icon-comments:hover div.wp-menu-image,#adminmenu .menu-icon-comments.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-comments.current div.wp-menu-image{background-position:-29px -1px}.icon16.icon-appearance,#adminmenu .menu-icon-appearance div.wp-menu-image{background-position:1px -33px}#adminmenu .menu-icon-appearance:hover div.wp-menu-image,#adminmenu .menu-icon-appearance.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-appearance.current div.wp-menu-image{background-position:1px -1px}.icon16.icon-plugins,#adminmenu .menu-icon-plugins div.wp-menu-image{background-position:-179px -33px}#adminmenu .menu-icon-plugins:hover div.wp-menu-image,#adminmenu .menu-icon-plugins.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-plugins.current div.wp-menu-image{background-position:-179px -1px}.icon16.icon-users,#adminmenu .menu-icon-users div.wp-menu-image{background-position:-300px -33px}#adminmenu .menu-icon-users:hover div.wp-menu-image,#adminmenu .menu-icon-users.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-users.current div.wp-menu-image{background-position:-300px -1px}.icon16.icon-tools,#adminmenu .menu-icon-tools div.wp-menu-image{background-position:-209px -33px}#adminmenu .menu-icon-tools:hover div.wp-menu-image,#adminmenu .menu-icon-tools.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-tools.current div.wp-menu-image{background-position:-209px -1px}.icon16.icon-settings,#adminmenu .menu-icon-settings div.wp-menu-image{background-position:-239px -33px}#adminmenu .menu-icon-settings:hover div.wp-menu-image,#adminmenu .menu-icon-settings.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-settings.current div.wp-menu-image{background-position:-239px -1px}.icon16.icon-site,#adminmenu .menu-icon-site div.wp-menu-image{background-position:-359px -33px}#adminmenu .menu-icon-site:hover div.wp-menu-image,#adminmenu .menu-icon-site.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-site.current div.wp-menu-image{background-position:-359px -1px}.icon16.icon-generic,#adminmenu .menu-icon-generic div.wp-menu-image{background-position:-330px -33px}#adminmenu .menu-icon-generic:hover div.wp-menu-image,#adminmenu .menu-icon-generic.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-generic.current div.wp-menu-image{background-position:-330px -1px}.icon32.icon-post,#icon-edit,#icon-post,.icon32.icon-dashboard,#icon-index,.icon32.icon-media,#icon-upload,.icon32.icon-links,#icon-link-manager,#icon-link,#icon-link-category,.icon32.icon-page,#icon-edit-pages,#icon-page,.icon32.icon-comments,#icon-edit-comments,.icon32.icon-appearance,#icon-themes,.icon32.icon-plugins,#icon-plugins,.icon32.icon-users,#icon-users,#icon-profile,#icon-user-edit,.icon32.icon-tools,#icon-tools,#icon-admin,.icon32.icon-settings,#icon-options-general,.icon32.icon-site,#icon-ms-admin,.icon32.icon-generic,#icon-generic{background-image:url(../images/icons32-vs.png?ver=20121105)}.icon32.icon-post,#icon-edit,#icon-post{background-position:-552px -5px}.icon32.icon-dashboard,#icon-index{background-position:-137px -5px}.icon32.icon-media,#icon-upload{background-position:-251px -5px}.icon32.icon-links,#icon-link-manager,#icon-link,#icon-link-category{background-position:-190px -5px}.icon32.icon-page,#icon-edit-pages,#icon-page{background-position:-312px -5px}.icon32.icon-comments,#icon-edit-comments{background-position:-72px -5px}.icon32.icon-appearance,#icon-themes{background-position:-11px -5px}.icon32.icon-plugins,#icon-plugins{background-position:-370px -5px}.icon32.icon-users,#icon-users,#icon-profile,#icon-user-edit{background-position:-600px -5px}.icon32.icon-tools,#icon-tools,#icon-admin{background-position:-432px -5px}.icon32.icon-settings,#icon-options-general{background-position:-492px -5px}.icon32.icon-site,#icon-ms-admin{background-position:-659px -5px}.icon32.icon-generic,#icon-generic{background-position:-708px -5px}table.diff .diff-deletedline{background-color:#fdd}table.diff .diff-deletedline del{background-color:#f99}table.diff .diff-addedline{background-color:#dfd}table.diff .diff-addedline ins{background-color:#9f9}#att-info{background-color:#e4f2fd}#sidemenu a{background-color:#f9f9f9;border-color:#f9f9f9;border-bottom-color:#dfdfdf}#sidemenu a.current{background-color:#fff;border-color:#dfdfdf #dfdfdf #fff;color:#d54e21}#replyerror{border-color:#ddd;background-color:#f9f9f9}.vim-current,.vim-current th,.vim-current td{background-color:#e4f2fd!important}#plugin-information .fyi ul{background-color:#eaf3fa}#plugin-information .fyi h2.mainheader{background-color:#cee1ef}#plugin-information pre,#plugin-information code{background-color:#ededff}#plugin-information pre{border:1px solid #ccc}#bulk-titles{border-color:#ddd}.inline-editor div.title{background-color:#eaf3fa}.inline-editor ul.cat-checklist{background-color:#fff;border-color:#ddd}.inline-editor .categories .catshow,.inline-editor .categories .cathide{color:#21759b}.inline-editor .quick-edit-save{background-color:#f1f1f1}fieldset.inline-edit-col-right .inline-edit-col{border-color:#dfdfdf}.attention{color:#d54e21}.js .meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/arrows-vs.png) no-repeat 6px 7px}.tablenav .tablenav-pages{color:#555}.tablenav .tablenav-pages a{border-color:#d1e5ee;background:#eee;-moz-box-shadow:inset 0 1px 0 #fff;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.tablenav .tablenav-pages a:hover,.tablenav .tablenav-pages a:focus{color:#d54e21}.tablenav .tablenav-pages a.disabled,.tablenav .tablenav-pages a.disabled:hover,.tablenav .tablenav-pages a.disabled:focus{color:#aaa}.tablenav .tablenav-pages .current{background:#dfdfdf;border-color:#d3d3d3}#availablethemes,#availablethemes td{border-color:#acd}#current-theme img{border-color:#b0c8d7}#TB_window #TB_title a.tb-theme-preview-link,#TB_window #TB_title a.tb-theme-preview-link:visited{color:#999}#TB_window #TB_title a.tb-theme-preview-link:hover,#TB_window #TB_title a.tb-theme-preview-link:focus{color:#ccc}.misc-pub-section{border-top-color:#fff;border-bottom-color:#d1e5ee}#minor-publishing{border-bottom-color:#cae6ff}#post-body .misc-pub-section{border-left-color:#eee}.post-com-count span{background-color:#bbb}.form-table .color-palette td{border-color:#fff}.sortable-placeholder{border-color:#bbb;background-color:#f5f5f5}#post-body ul.category-tabs li.tabs a,#post-body ul.add-menu-item-tabs li.tabs a,body.press-this ul.category-tabs li.tabs a{color:#333}.view-switch #view-switch-list,.view-switch #view-switch-excerpt{background-color:transparent;background-image:url('../images/list.png');background-repeat:no-repeat}.view-switch #view-switch-list{background-position:0 0}.view-switch .current #view-switch-list{background-position:-40px 0}.view-switch #view-switch-excerpt{background-position:-20px 0}.view-switch .current #view-switch-excerpt{background-position:-60px 0}#header-logo{background:transparent url(../images/wp-logo-vs.png?ver=20101102) no-repeat scroll center center}.popular-tags,.feature-filter{background-color:#fff;border-color:#d1e5ee}div.widgets-sortables,#widgets-left .inactive,#available-widgets .widget-holder{background-color:#f7fcfe;border-color:#d0dfe9}#available-widgets .widget-description{color:#555}.sidebar-name{color:#464646;text-shadow:#fff 0 1px 0;border-color:#d0dfe9;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.js .sidebar-name:hover,.js #removing-widget{color:#d54e21}#removing-widget span{color:black}.js .sidebar-name-arrow{background:transparent url(../images/arrows-vs.png) no-repeat 5px 9px}.js .sidebar-name:hover .sidebar-name-arrow{background:transparent url(../images/arrows-dark-vs.png) no-repeat 5px 9px}.in-widget-title{color:#606060}.deleting .widget-title *{color:#aaa}.imgedit-menu div{border-color:#d5d5d5;background-color:#f1f1f1}.imgedit-menu div:hover{border-color:#c1c1c1;background-color:#eaeaea}.imgedit-menu div.disabled{border-color:#ccc;background-color:#ddd;filter:alpha(opacity=50);opacity:.5}#dashboard_recent_comments div.undo{border-top-color:#dfdfdf}.comment-ays,.comment-ays th{border-color:#ddd}.comment-ays th{background-color:#f1f1f1}#menu-management .menu-edit{border-color:#d0dfe9}#post-body{background:#fff;border-top-color:#fff;border-bottom-color:#d0dfe9}#nav-menu-header{border-bottom-color:#d0dfe9}#nav-menu-footer{border-top-color:#fff}#menu-management .nav-tabs-arrow a{color:#c1c1c1}#menu-management .nav-tabs-arrow a:hover{color:#d54e21}#menu-management .nav-tabs-arrow a:active{color:#464646}#menu-management .nav-tab-active{border-color:#dfdfdf}#menu-management .nav-tab{background:#f7fcfe;border-color:#d0dfe9}.js .input-with-default-title{color:#aaa}#cancel-save{color:#f00}#cancel-save:hover{background-color:#f00;color:#fff}.list-container{border-color:#dfdfdf}.menu-item-handle{border-color:#d0dfe9}.menu li.deleting .menu-item-handle{background-color:#f66;text-shadow:#ccc}.item-type{color:#999}.item-controls .menu-item-delete:hover{color:#f00}.nav-menus-php .item-edit{background:transparent url(../images/arrows-vs.png) no-repeat 8px 10px;border-bottom-color:#eff8ff}.nav-menus-php .item-edit:hover{background:transparent url(../images/arrows-dark-vs.png) no-repeat 8px 10px}.menu-item-settings{border-color:#d0dfe9}.link-to-original{color:#777;border-color:#d0dfe9}#cancel-save:hover{color:#fff!important}#update-menu-item{color:#fff!important}#update-menu-item:hover,#update-menu-item:active,#update-menu-item:focus{color:#eaf2fa!important;border-color:#13455b!important}.submitbox .submitcancel{color:#21759b;border-bottom-color:#21759b}.submitbox .submitcancel:hover{background:#21759b;color:#fff}.nav-tab{border-color:#d1e5ee #d1e5ee #fff}.nav-tab:hover,.nav-tab-active{border-color:#acd #acd #fff}h2.nav-tab-wrapper,h3.nav-tab-wrapper{border-bottom-color:#acd}#menu-management .nav-tab-active,.menu-item-handle,.menu-item-settings{-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}#menu-management .nav-tab-active{background:#f7fcfe;border-bottom-color:#f7fcfe}#upload-form label{color:#777}.fullscreen-overlay{background:#fff}.wp-fullscreen-focus #wp-fullscreen-title,.wp-fullscreen-focus #wp-fullscreen-container{border-color:#bed1dd}#fullscreen-topbar{border-bottom-color:#d1e5ee}.about-wrap h1{color:#333;text-shadow:1px 1px 1px #fff}.about-text{color:#777}.wp-badge{color:#fff;text-shadow:0 -1px 0 rgba(22,57,81,0.3)}.about-wrap h2 .nav-tab{color:#21759b}.about-wrap h2 .nav-tab:hover{color:#d54e21}.about-wrap h2 .nav-tab-active,.about-wrap h2 .nav-tab-active:hover{color:#333}.about-wrap h2 .nav-tab-active{text-shadow:1px 1px 1px #fff;color:#464646}.about-wrap h3{color:#333;text-shadow:1px 1px 1px #fff}.about-wrap .feature-section h4{color:#464646}.about-wrap .feature-section img{background:#fff;border:1px #ccc solid;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.3);box-shadow:0 1px 3px rgba(0,0,0,0.3)}.about-wrap h4.wp-people-group{text-shadow:1px 1px 1px #fff}.about-wrap .point-releases{border-bottom:1px solid #dfdfdf}.about-wrap .point-releases h3{border-top:1px solid #dfdfdf}.about-wrap .point-releases h3:first-child{border:0}.about-wrap li.wp-person img.gravatar{-webkit-box-shadow:0 0 4px rgba(0,0,0,0.4);box-shadow:0 0 4px rgba(0,0,0,0.4)}.about-wrap li.wp-person .title{color:#464646;text-shadow:1px 1px 1px #fff}.freedoms-php .about-wrap ol li{color:#999}.freedoms-php .about-wrap ol p{color:#464646}.rtl .bar{border-right-color:transparent;border-left-color:#99d}.rtl #screen-meta-links a.show-settings{background-position:left 3px}.rtl #screen-meta-links a.show-settings.screen-meta-active{background-position:left -33px}.rtl #adminmenushadow,.rtl #adminmenuback{background-image:url(../images/menu-shadow-rtl.png);background-position:top left}.rtl #adminmenu .wp-submenu .wp-submenu-head{border-right-color:transparent;border-left-color:#d1e5ee}.rtl #adminmenu .wp-submenu,.rtl.folded #adminmenu .wp-has-current-submenu .wp-submenu{-webkit-box-shadow:-2px 2px 5px rgba(0,0,0,0.4);box-shadow:-2px 2px 5px rgba(0,0,0,0.4)}.rtl #adminmenu .wp-has-current-submenu .wp-submenu{-webkit-box-shadow:none;box-shadow:none}.rtl #collapse-button div{background-position:0 -108px}.rtl.folded #collapse-button div{background-position:0 -72px}@media only screen and (max-width:900px){.rtl.auto-fold #adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.rtl.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu{-webkit-box-shadow:-2px 2px 5px rgba(0,0,0,0.4);box-shadow:-2px 2px 5px rgba(0,0,0,0.4)}.rtl.auto-fold #collapse-button div{background-position:0 -72px}}.js.rtl .meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/arrows-vs.png) no-repeat 6px 7px}.rtl #post-body .misc-pub-section{border-right-color:transparent;border-left-color:#d1e5ee}.js.rtl .sidebar-name-arrow{background:transparent url(../images/arrows-vs.png) no-repeat 5px 9px}.js.rtl .sidebar-name:hover .sidebar-name-arrow{background:transparent url(../images/arrows-dark-vs.png) no-repeat 5px 9px}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.curtime #timestamp{background-image:url("../images/date-button-2x.gif?ver=20120916");background-size:16px auto}.tagchecklist span a,#bulk-titles div a,.tagchecklist span a:hover,#bulk-titles div a:hover{background-image:url("../images/xit-2x.gif?ver=20120916");background-size:20px auto}#screen-meta-links a.show-settings,#screen-meta-links a.show-settings.screen-meta-active,#adminmenu .wp-has-submenu:hover .wp-menu-toggle,#adminmenu .wp-menu-open .wp-menu-toggle,#collapse-button div,.nav-menus-php .item-edit,.js .meta-box-sortables .postbox:hover .handlediv,.sidebar-name-arrow,.rtl #adminmenu .wp-has-submenu:hover .wp-menu-toggle,.rtl #adminmenu .wp-menu-open .wp-menu-toggle,.js.rtl .meta-box-sortables .postbox:hover .handlediv,.rtl .sidebar-name-arrow{background-image:url("../images/arrows-vs-2x.png?ver=20120916");background-size:15px 123px}#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle,.nav-menus-php .item-edit:hover,.sidebar-name:hover .sidebar-name-arrow,.rtl #adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,.rtl #adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle,.rtl .sidebar-name:hover .sidebar-name-arrow{background-image:url("../images/arrows-dark-vs-2x.png?ver=20120916");background-size:15px 123px}.view-switch #view-switch-list,.view-switch #view-switch-excerpt{background-image:url("../images/list-2x.png?ver=20120916");background-size:80px 20px}.icon32.icon-post,#icon-edit,#icon-post,.icon32.icon-dashboard,#icon-index,.icon32.icon-media,#icon-upload,.icon32.icon-links,#icon-link-manager,#icon-link,#icon-link-category,.icon32.icon-page,#icon-edit-pages,#icon-page,.icon32.icon-comments,#icon-edit-comments,.icon32.icon-appearance,#icon-themes,.icon32.icon-plugins,#icon-plugins,.icon32.icon-users,#icon-users,#icon-profile,#icon-user-edit,.icon32.icon-tools,#icon-tools,#icon-admin,.icon32.icon-settings,#icon-options-general,.icon32.icon-site,#icon-ms-admin,.icon32.icon-generic,#icon-generic{background-image:url(../images/icons32-vs-2x.png?ver=20121105);background-size:756px 45px}.icon16.icon-dashboard,.menu-icon-dashboard div.wp-menu-image,.icon16.icon-post,.menu-icon-post div.wp-menu-image,.icon16.icon-media,.menu-icon-media div.wp-menu-image,.icon16.icon-links,.menu-icon-links div.wp-menu-image,.icon16.icon-page,.menu-icon-page div.wp-menu-image,.icon16.icon-comments,.menu-icon-comments div.wp-menu-image,.icon16.icon-appearance,.menu-icon-appearance div.wp-menu-image,.icon16.icon-plugins,.menu-icon-plugins div.wp-menu-image,.icon16.icon-users,.menu-icon-users div.wp-menu-image,.icon16.icon-tools,.menu-icon-tools div.wp-menu-image,.icon16.icon-settings,.menu-icon-settings div.wp-menu-image,.icon16.icon-site,.menu-icon-site div.wp-menu-image,.icon16.icon-generic,.menu-icon-generic div.wp-menu-image{background-image:url('../images/menu-vs-2x.png?ver=20121105');background-size:390px 64px}#header-logo{background-image:url('../images/wp-logo-vs-2x.png?ver=20120916');background-size:16px auto}}
\ No newline at end of file
+.find-box-search,.find-box-buttons{background-color:#eff8ff;border-top:1px solid #dce6f8}.find-box{background-color:#5589aa}.find-box-head{color:#fff}.find-box-inside{background-color:#fff}a.page-numbers:hover{border-color:#999}body,#wpbody,.form-table .pre,.ui-autocomplete li a{color:#333}body>#upload-menu{border-bottom-color:#fff}#postcustomstuff table,#your-profile fieldset,#rightnow,div.dashboard-widget,#dashboard-widgets p.dashboard-widget-links{border-color:#d1e5ee}#poststuff .inside label.spam,#poststuff .inside label.deleted{color:red}#poststuff .inside label.waiting{color:orange}#poststuff .inside label.approved{color:green}#postcustomstuff table{border-color:#dfdfdf;background-color:#f9f9f9}#postcustomstuff thead th{background-color:#f1f1f1}table.widefat{border-color:#d1e5ee;background-color:#fff}div.dashboard-widget-error{background-color:#c43}div.dashboard-widget-notice{background-color:#cfe1ef}div.dashboard-widget-submit{border-top-color:#ccc}ul.category-tabs li{border-color:transparent}div.tabs-panel,.wp-tab-panel,ul.add-menu-item-tabs li.tabs,.wp-tab-active{border-color:#d1e5ee;background-color:#fff}ul.category-tabs li.tabs{border-color:#d1e5ee #d1e5ee #fff}ul.category-tabs li.tabs,ul.add-menu-item-tabs li.tabs,.wp-tab-active{background-color:#fff}kbd,code{background:#eff8ff}textarea,input[type="text"],input[type="password"],input[type="file"],input[type="email"],input[type="number"],input[type="search"],input[type="tel"],input[type="url"],select{border-color:#d1e5ee}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="file"]:focus,input[type="email"]:focus,input[type="number"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="url"]:focus,select:focus{border-color:#b0c8d7}input.disabled,textarea.disabled{background-color:#ccc}#plugin-information .action-button a,#plugin-information .action-button a:hover,#plugin-information .action-button a:visited{color:#fff}.revisions-meta,.widget .widget-top,.postbox h3,.stuffbox h3,.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small,.sidebar-name,#nav-menu-header,#nav-menu-footer,.menu-item-handle,#fullscreen-topbar{background:#f5fafd;background-image:-webkit-gradient(linear,left bottom,left top,from(#eff8ff),to(#f7fcfe));background-image:-webkit-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:-moz-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:-o-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:linear-gradient(to top,#eff8ff,#f7fcfe)}.widget .widget-top,.postbox h3,.stuffbox h3{border-bottom-color:#d1e5ee;text-shadow:#fff 0 1px 0;-webkit-box-shadow:0 1px 0 #fff;box-shadow:0 1px 0 #fff}.form-table th,.form-wrap label{color:#222;text-shadow:#fff 0 1px 0}.description,.form-wrap p{color:#666}strong .post-com-count span{background-color:#21759b}.sorthelper{background-color:#ccf3fa}.ac_match,.subsubsub a.current{color:#000}.wrap h2{color:#174f69}.wrap .add-new-h2,.wrap .add-new-h2:active{background:#f1f1f1}.subtitle{color:#777}.ac_over{background-color:#f0f0b8}.ac_results{background-color:#fff;border-color:#b0c8d7}.ac_results li{color:#101010}.alternate,.alt{background-color:#f7fcfe}.available-theme a.screenshot{background-color:#eff8ff;border-color:#acd}#current-theme{border-bottom-color:#d1e5ee}.bar{background-color:#e8e8e8;border-right-color:#99d}#media-upload,#media-upload .media-item .slidetoggle{background:#fff}#media-upload .slidetoggle{border-top-color:#dfdfdf}div.error,.login #login_error{background-color:#ffebe8;border-color:#c00}div.error a{color:#c00}.form-invalid{background-color:#ffebe8!important}.form-invalid input,.form-invalid select{border-color:#c00!important}.submit,#commentsdiv #add-new-comment{border-color:#dfdfdf}.highlight{background-color:#e4f2fd;color:#000}.howto,.nonessential,#edit-slug-box,.form-input-tip,.subsubsub{color:#666}.media-upload-form label.form-help,td.help{color:#9a9a9a}.ui-autocomplete{border-color:#b0c8d7;background-color:#eff8ff}.ui-autocomplete li a.ui-state-focus{background-color:#def1ff}.post-com-count{color:#fff}.post-com-count span{background-color:#bbb;color:#fff}.post-com-count:hover span{background-color:#d54e21}.quicktags,.search{background-color:#ccc;color:#000}.side-info h5{border-bottom-color:#dadada}.side-info ul{color:#666}a:hover,a:active{color:#d54e21}a:focus{color:#124964}#adminmenu a:hover,#adminmenu li.menu-top>a:focus,#adminmenu .wp-submenu a:hover,#the-comment-list .comment a:hover,#rightnow a:hover,#media-upload a.del-link:hover,div.dashboard-widget-submit input:hover,.subsubsub a:hover,.subsubsub a.current:hover,.ui-tabs-nav a:hover,.plugins .inactive a:hover,#all-plugins-table .plugins .inactive a:hover,#search-plugins-table .plugins .inactive a:hover{color:#d54e21}#the-comment-list .comment-item,#dashboard-widgets #dashboard_quick_press form p.submit{border-color:#dfdfdf}#side-sortables .category-tabs .tabs a,#side-sortables .add-menu-item-tabs .tabs a,.wp-tab-bar .wp-tab-active a{color:#333}#dashboard_right_now .table_content,#dashboard_right_now .table_discussion{border-top-color:#d1e5ee}#rightnow .rbutton{background-color:#ebebeb;color:#264761}.submitbox .submit{background-color:#464646;color:#ccc}.plugins a.delete:hover,#all-plugins-table .plugins a.delete:hover,#search-plugins-table .plugins a.delete:hover,.submitbox .submitdelete{color:#f00;border-bottom-color:#f00}.submitbox .submitdelete:hover,#media-items a.delete:hover,#media-items a.delete-permanently:hover{color:#fff;background-color:#f00;border-bottom-color:#f00}#normal-sortables .submitbox .submitdelete:hover{color:#000;background-color:#f00;border-bottom-color:#f00}.tablenav .dots{border-color:transparent}.tablenav .next,.tablenav .prev{border-color:transparent;color:#21759b}.tablenav .next:hover,.tablenav .prev:hover{border-color:transparent;color:#d54e21}div.updated,.login .message{background-color:#ffffe0;border-color:#e6db55}.update-message{color:#000}a.page-numbers{border-bottom-color:#b8d3e2}.commentlist li{border-bottom-color:#ccc}.widefat td,.widefat th{border-top-color:#fff;border-bottom-color:#d0dfe9}.widefat th{text-shadow:rgba(255,255,255,0.8) 0 1px 0}.widefat td{color:#555}.widefat p,.widefat ol,.widefat ul{color:#333}.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small{color:#333}th.sortable a:hover,th.sortable a:active,th.sortable a:focus{color:#333}th.sortable a:focus{background:#e1e1e1;background-image:-webkit-gradient(linear,left bottom,left top,from(#dcdcdc),to(#e9e9e9));background-image:-webkit-linear-gradient(bottom,#dcdcdc,#e9e9e9);background-image:-moz-linear-gradient(bottom,#dcdcdc,#e9e9e9);background-image:-o-linear-gradient(bottom,#dcdcdc,#e9e9e9);background-image:linear-gradient(to top,#dcdcdc,#e9e9e9)}h3.dashboard-widget-title small a{color:#d7d7d7}h3.dashboard-widget-title small a:hover{color:#fff}a,#adminmenu a,#the-comment-list p.comment-author strong a,#media-upload a.del-link,#media-items a.delete,#media-items a.delete-permanently,.plugins a.delete,.ui-tabs-nav a{color:#21759b}#adminmenu .awaiting-mod,#adminmenu .update-plugins,#sidemenu a .update-plugins,#rightnow .reallynow{background-color:#464646;color:#fff;-webkit-box-shadow:rgba(255,255,255,0.5) 0 1px 0;box-shadow:rgba(255,255,255,0.5) 0 1px 0}#plugin-information .action-button{background-color:#d54e21;color:#fff}#adminmenu li.current a .awaiting-mod,#adminmenu li a.wp-has-current-submenu .update-plugins{background-color:#464646;color:#fff;-webkit-box-shadow:rgba(255,255,255,0.5) 0 1px 0;box-shadow:rgba(255,255,255,0.5) 0 1px 0}div#media-upload-header,div#plugin-information-header{background-color:#f9f9f9;border-bottom-color:#dfdfdf}#currenttheme img{border-color:#666}#dashboard_secondary div.dashboard-widget-content ul li a{background-color:#f9f9f9}input.readonly,textarea.readonly{background-color:#ddd}#editable-post-name{background-color:#fffbcc}#edit-slug-box strong,.tablenav .displaying-num,#submitted-on,.submitted-on{color:#777}.login #nav a,.login #backtoblog a{color:#21759b!important}.login #nav a:hover,.login #backtoblog a:hover{color:#d54e21!important}#wpfooter{color:#777;border-color:#b0c8d7}.imgedit-group,#media-items .media-item,.media-item .describe{border-color:#dfdfdf}.checkbox,.side-info,.plugins tr,#your-profile #rich_editing{background-color:#fcfcfc}.plugins .inactive,.plugins .inactive th,.plugins .inactive td,tr.inactive+tr.plugin-update-tr .plugin-update{background-color:#f7fcfe}.plugin-update-tr .update-message{background-color:#fffbe4;border-color:#dfdfdf}.plugins .active,.plugins .active th,.plugins .active td{color:#000}.plugins .inactive a{color:#579}#the-comment-list tr.undo,#the-comment-list div.undo{background-color:#f4f4f4}#the-comment-list .unapproved{background-color:#ffffe0}#the-comment-list .approve a{color:#006505}#the-comment-list .unapprove a{color:#d98500}table.widefat span.delete a,table.widefat span.trash a,table.widefat span.spam a,#dashboard_recent_comments .delete a,#dashboard_recent_comments .trash a,#dashboard_recent_comments .spam a{color:#bc0b0b}.welcome-panel{background:#f5fafd;background-image:-webkit-gradient(linear,left bottom,left top,from(#eff8ff),to(#f7fcfe));background-image:-webkit-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:-moz-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:-o-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:linear-gradient(to top,#eff8ff,#f7fcfe);border-color:#d1e5ee}.welcome-panel p{color:#777}.welcome-panel-column p{color:#464646}.welcome-panel h3{text-shadow:1px 1px 1px #fff}.widget,#widget-list .widget-top,.postbox,#titlediv,#poststuff .postarea,.stuffbox{border-color:#d1e5ee;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;-webkit-border-radius:3px;border-radius:3px}.widget,#widget-list .widget-top,.postbox,.menu-item-settings{background:#f5fafd;background-image:-webkit-gradient(linear,left bottom,left top,from(#eff8ff),to(#f7fcfe));background-image:-webkit-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:-moz-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:-o-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:linear-gradient(to top,#eff8ff,#f7fcfe)}.postbox h3{color:#174f69}.widget .widget-top{color:#174f69}.js .sidebar-name:hover h3,.js .postbox h3:hover{color:#000}.curtime #timestamp{background-image:url(../images/date-button.gif)}#quicktags #ed_link{color:#00f}#rightnow .youhave{background-color:#f0f6fb}#rightnow a{color:#448abd}.tagchecklist span a,#bulk-titles div a{background:url(../images/xit.gif) no-repeat}.tagchecklist span a:hover,#bulk-titles div a:hover{background:url(../images/xit.gif) no-repeat -10px 0}#update-nag,.update-nag{background-color:#fffbcc;border-color:#e6db55;color:#555}#screen-meta{background-color:#eff8ff;border-color:#d1e5ee;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.05);box-shadow:0 1px 3px rgba(0,0,0,0.05)}#contextual-help-back{background:#fff}.contextual-help-tabs a:hover{background-color:#ceeaff;color:#333}#contextual-help-back,.contextual-help-tabs .active{border-color:#d1e5ee}.contextual-help-tabs .active,.contextual-help-tabs .active a,.contextual-help-tabs .active a:hover{background:#fff;color:#000}#screen-options-link-wrap,#contextual-help-link-wrap{border-right:1px solid #d1e5ee;border-left:1px solid #d1e5ee;border-bottom:1px solid #d1e5ee;background:#eff8ff;background-image:-webkit-gradient(linear,left bottom,left top,from(#def1ff),to(#eff8ff));background-image:-webkit-linear-gradient(bottom,#def1ff,#eff8ff);background-image:-moz-linear-gradient(bottom,#def1ff,#eff8ff);background-image:-o-linear-gradient(bottom,#def1ff,#eff8ff);background-image:linear-gradient(to top,#def1ff,#eff8ff)}#screen-meta-links a{color:#606060;background:transparent url(../images/arrows.png) no-repeat right 4px}#screen-meta-links a:hover,#screen-meta-links a:active{color:#000;background-color:transparent}#screen-meta-links a.screen-meta-active{background-position:right -31px}.login #backtoblog a{color:#464646}#wphead{border-bottom:1px solid #d0dfe9}#wphead h1 a{color:#174f69}#wpfooter a:link,#wpfooter a:visited{text-decoration:none}#wpfooter a:hover{color:#000;text-decoration:underline}.file-error,abbr.required,.widget-control-remove:hover,table.widefat .delete a:hover,table.widefat .trash a:hover,table.widefat .spam a:hover,#dashboard_recent_comments .delete a:hover,#dashboard_recent_comments .trash a:hover #dashboard_recent_comments .spam a:hover{color:#f00}#pass-strength-result{background-color:#eee;border-color:#ddd!important}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important}#poststuff .wp-editor-wrap .wp_themeSkin .mceStatusbar{border-color:#d0dfe9;background-color:#eff8ff}#poststuff .wp-editor-wrap .wp_themeSkin .mceStatusbar *{color:#555}#poststuff #editor-toolbar .active{border-color:#d0dfe9 #d0dfe9 #eff8ff;background-color:#eff8ff;color:#333}.wp-editor-wrap .wp-editor-container,.wp-editor-wrap .wp_themeSkin table.mceLayout{border-color:#d1e5ee #d1e5ee #d0dfe9}#editorcontainer{border-color:#d1e5ee #d1e5ee #d0dfe9}#post-status-info{border-color:#d0dfe9 #d1e5ee #d1e5ee}.wp-admin .wp-editor-wrap .wp-switch-editor{background-color:#d3e9f2;border-color:#d1e5ee #d1e5ee #d3e9f2;color:#174f69}.wp-admin .wp-editor-wrap .wp-switch-editor:active{background-color:#f5fafd}.wp-admin .wp-editor-wrap.tmce-active .switch-tmce,.wp-admin .wp-editor-wrap.html-active .switch-html{background:#f7fcfe;border-color:#d1e5ee #d1e5ee #f7fcfe}.wp-admin .wp-editor-wrap .quicktags-toolbar,.wp-admin .wp-editor-wrap .wp_themeSkin tr.mceFirst td.mceToolbar{border-color:#d0dfe9;background-color:#f5fafd;background-image:-webkit-gradient(linear,left bottom,left top,from(#eff8ff),to(#f7fcfe));background-image:-webkit-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:-moz-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:-o-linear-gradient(bottom,#eff8ff,#f7fcfe);background-image:linear-gradient(to top,#eff8ff,#f7fcfe)}.wp-admin .wp_themeSkin table.mceListBox{border-color:#d1e5ee}.wp-admin .wp_themeSkin table.mceListBoxEnabled:hover,.wp-admin .wp_themeSkin table.mceListBoxEnabled:active,.wp-admin .wp_themeSkin table.mceListBoxHover,.wp-admin .wp_themeSkin table.mceListBoxHover:active,.wp-admin .wp_themeSkin table.mceListBoxSelected{border-color:#b8cfdf}.wp-admin .wp_themeSkin a.mceButtonEnabled:hover,.wp-admin .wp_themeSkin table.mceSplitButton:hover{border-color:#c3d2dc;background:#f4f9fc;background-image:-webkit-gradient(linear,left bottom,left top,from(#f4f9fc),to(#fff));background-image:-webkit-linear-gradient(bottom,#f4f9fc,#fff);background-image:-moz-linear-gradient(bottom,#f4f9fc,#fff);background-image:-o-linear-gradient(bottom,#f4f9fc,#fff);background-image:linear-gradient(to top,#f4f9fc,#fff)}.wp-admin .wp_themeSkin a.mceButton:active,.wp-admin .wp_themeSkin a.mceButtonEnabled:active,.wp-admin .wp_themeSkin a.mceButtonSelected:active,.wp-admin .wp_themeSkin a.mceButtonActive,.wp-admin .wp_themeSkin a.mceButtonActive:active,.wp-admin .wp_themeSkin a.mceButtonActive:hover,.wp-admin .wp_themeSkin .mceSplitButtonSelected table,.wp-admin .wp_themeSkin .mceSplitButtonSelected table:hover{border-color:#8f9da9 #c3d2dc #c3d2dc #8f9da9;background:#f4f9fc;background-image:-webkit-gradient(linear,left bottom,left top,from(#fff),to(#f4f9fc));background-image:-webkit-linear-gradient(bottom,#fff,#f4f9fc);background-image:-moz-linear-gradient(bottom,#fff,#f4f9fc);background-image:-o-linear-gradient(bottom,#fff,#f4f9fc);background-image:linear-gradient(to top,#fff,#f4f9fc)}.wp-admin .wp_themeSkin .mceSplitButtonSelected table a.mceOpen,.wp-admin .wp_themeSkin .mceSplitButtonSelected table a.mceAction{border-color:#8f9da9 #c3d2dc #c3d2dc #8f9da9}.wp-admin .wp_themeSkin .mceSplitButton:hover a{border-color:#c3d2dc}.editwidget .widget-inside{border-color:#d0dfe9}#titlediv #title{background-color:#fff}#tTips p#tTips_inside{background-color:#ddd;color:#333}#poststuff .inside .the-tagcloud{border-color:#ddd}#adminmenuback,#adminmenuwrap{background-color:#eff8ff;border-color:#d1e5ee}#adminmenushadow,#adminmenuback{background-image:url(../images/menu-shadow.png);background-position:top right;background-repeat:repeat-y}#adminmenu li.wp-menu-separator{background:#d1e5ee;border-color:#bed1dd}#adminmenu div.separator{border-color:#d1e5ee}#adminmenu a.menu-top,#adminmenu .wp-submenu .wp-submenu-head{border-top-color:#fff;border-bottom-color:#cae6ff}#adminmenu li.wp-menu-open{border-color:#d1e5ee}#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{background-color:#e0f1ff;color:#d54e21;text-shadow:0 1px 0 rgba(255,255,255,0.4)}#adminmenu li.menu-top:hover>a span,#adminmenu li.menu-top>a:focus span{text-shadow:none}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu li.current a.menu-top,.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.current.menu-top,#adminmenu .wp-menu-arrow,#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{background:#5589aa;background-image:-webkit-gradient(linear,left bottom,left top,from(#5589aa),to(#619bbb));background-image:-webkit-linear-gradient(bottom,#5589aa,#619bbb);background-image:-moz-linear-gradient(bottom,#5589aa,#619bbb);background-image:-o-linear-gradient(bottom,#5589aa,#619bbb);background-image:linear-gradient(to top,#5589aa,#619bbb)}#adminmenu .wp-menu-arrow div{background:#5589aa;background-image:-webkit-gradient(linear,right bottom,left top,from(#5589aa),to(#619bbb));background-image:-webkit-linear-gradient(bottom right,#5589aa,#619bbb);background-image:-moz-linear-gradient(bottom right,#5589aa,#619bbb);background-image:-o-linear-gradient(bottom right,#5589aa,#619bbb);background-image:linear-gradient(to top left,#5589aa,#619bbb)}#adminmenu li.wp-not-current-submenu .wp-menu-arrow{border-top-color:#fff;border-bottom-color:#cae6ff;background:#e0f1ff}#adminmenu li.wp-not-current-submenu .wp-menu-arrow div{background:#e0f1ff;border-color:#cae6ff}.folded #adminmenu li.menu-top li:hover a{background-image:none}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu li.current a.menu-top,#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{text-shadow:0 -1px 0 #333;color:#fff;border-top-color:#5a8fad;border-bottom-color:#5589aa}.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{border-top-color:#5a8fad;border-bottom-color:#5589aa}#adminmenu .wp-submenu a:hover,#adminmenu .wp-submenu a:focus{background-color:#eff8ff;color:#333}#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover{color:#333}#adminmenu .wp-submenu,.folded #adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background-color:#fff;border-color:#d0dfe9;-webkit-box-shadow:2px 3px 6px rgba(0,0,0,0.4);box-shadow:2px 3px 6px rgba(0,0,0,0.4)}#adminmenu .wp-submenu .wp-submenu-head{background-color:#e0f1ff;color:#333}#collapse-menu{color:#a0c3d5;border-top-color:#f9f9f9}#collapse-menu:hover{color:#5a8fad}#collapse-button{border-color:#d0dfe9;background:#eff8ff;background-image:-webkit-gradient(linear,left bottom,left top,from(#eff8ff),to(#fff));background-image:-webkit-linear-gradient(bottom,#eff8ff,#fff);background-image:-moz-linear-gradient(bottom,#eff8ff,#fff);background-image:-o-linear-gradient(bottom,#eff8ff,#fff);background-image:linear-gradient(to top,#eff8ff,#fff)}#collapse-menu:hover #collapse-button{border-color:#a0c3d5}#collapse-button div{background:transparent url(../images/arrows-vs.png) no-repeat 0 -72px}.folded #collapse-button div{background-position:0 -108px}@media only screen and (max-width:900px){.auto-fold #adminmenu li.wp-has-current-submenu,.auto-fold #adminmenu li.current.menu-top{background-color:#5589aa;background-image:-webkit-gradient(linear,left bottom,left top,from(#5589aa),to(#619bbb));background-image:-webkit-linear-gradient(bottom,#5589aa,#619bbb);background-image:-moz-linear-gradient(bottom,#5589aa,#619bbb);background-image:-o-linear-gradient(bottom,#5589aa,#619bbb);background-image:linear-gradient(bottom,#5589aa,#619bbb)}.auto-fold #adminmenu li.wp-has-current-submenu,.auto-fold #adminmenu li.current.menu-top{border-top-color:#5a8fad;border-bottom-color:#5589aa}.auto-fold #adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu{background-color:#fff;border-color:#d0dfe9;-webkit-box-shadow:2px 3px 6px rgba(0,0,0,0.4);box-shadow:2px 3px 6px rgba(0,0,0,0.4)}.auto-fold #collapse-button div{background-position:0 -108px}}.icon16,.icon32,div.wp-menu-image{background-color:transparent;background-repeat:no-repeat}.icon16.icon-dashboard,.menu-icon-dashboard div.wp-menu-image,.icon16.icon-post,.menu-icon-post div.wp-menu-image,.icon16.icon-media,.menu-icon-media div.wp-menu-image,.icon16.icon-links,.menu-icon-links div.wp-menu-image,.icon16.icon-page,.menu-icon-page div.wp-menu-image,.icon16.icon-comments,.menu-icon-comments div.wp-menu-image,.icon16.icon-appearance,.menu-icon-appearance div.wp-menu-image,.icon16.icon-plugins,.menu-icon-plugins div.wp-menu-image,.icon16.icon-users,.menu-icon-users div.wp-menu-image,.icon16.icon-tools,.menu-icon-tools div.wp-menu-image,.icon16.icon-settings,.menu-icon-settings div.wp-menu-image,.icon16.icon-site,.menu-icon-site div.wp-menu-image,.icon16.icon-generic,.menu-icon-generic div.wp-menu-image{background-image:url(../images/menu-vs.png?ver=20121105)}.icon16.icon-dashboard,#adminmenu .menu-icon-dashboard div.wp-menu-image{background-position:-59px -33px}#adminmenu .menu-icon-dashboard:hover div.wp-menu-image,#adminmenu .menu-icon-dashboard.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-dashboard.current div.wp-menu-image{background-position:-59px -1px}.icon16.icon-post,#adminmenu .menu-icon-post div.wp-menu-image{background-position:-269px -33px}#adminmenu .menu-icon-post:hover div.wp-menu-image,#adminmenu .menu-icon-post.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-post.current div.wp-menu-image{background-position:-269px -1px}.icon16.icon-media,#adminmenu .menu-icon-media div.wp-menu-image{background-position:-119px -33px}#adminmenu .menu-icon-media:hover div.wp-menu-image,#adminmenu .menu-icon-media.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-media.current div.wp-menu-image{background-position:-119px -1px}.icon16.icon-links,#adminmenu .menu-icon-links div.wp-menu-image{background-position:-89px -33px}#adminmenu .menu-icon-links:hover div.wp-menu-image,#adminmenu .menu-icon-links.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-links.current div.wp-menu-image{background-position:-89px -1px}.icon16.icon-page,#adminmenu .menu-icon-page div.wp-menu-image{background-position:-149px -33px}#adminmenu .menu-icon-page:hover div.wp-menu-image,#adminmenu .menu-icon-page.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-page.current div.wp-menu-image{background-position:-149px -1px}.icon16.icon-comments,#adminmenu .menu-icon-comments div.wp-menu-image{background-position:-29px -33px}#adminmenu .menu-icon-comments:hover div.wp-menu-image,#adminmenu .menu-icon-comments.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-comments.current div.wp-menu-image{background-position:-29px -1px}.icon16.icon-appearance,#adminmenu .menu-icon-appearance div.wp-menu-image{background-position:1px -33px}#adminmenu .menu-icon-appearance:hover div.wp-menu-image,#adminmenu .menu-icon-appearance.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-appearance.current div.wp-menu-image{background-position:1px -1px}.icon16.icon-plugins,#adminmenu .menu-icon-plugins div.wp-menu-image{background-position:-179px -33px}#adminmenu .menu-icon-plugins:hover div.wp-menu-image,#adminmenu .menu-icon-plugins.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-plugins.current div.wp-menu-image{background-position:-179px -1px}.icon16.icon-users,#adminmenu .menu-icon-users div.wp-menu-image{background-position:-300px -33px}#adminmenu .menu-icon-users:hover div.wp-menu-image,#adminmenu .menu-icon-users.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-users.current div.wp-menu-image{background-position:-300px -1px}.icon16.icon-tools,#adminmenu .menu-icon-tools div.wp-menu-image{background-position:-209px -33px}#adminmenu .menu-icon-tools:hover div.wp-menu-image,#adminmenu .menu-icon-tools.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-tools.current div.wp-menu-image{background-position:-209px -1px}.icon16.icon-settings,#adminmenu .menu-icon-settings div.wp-menu-image{background-position:-239px -33px}#adminmenu .menu-icon-settings:hover div.wp-menu-image,#adminmenu .menu-icon-settings.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-settings.current div.wp-menu-image{background-position:-239px -1px}.icon16.icon-site,#adminmenu .menu-icon-site div.wp-menu-image{background-position:-359px -33px}#adminmenu .menu-icon-site:hover div.wp-menu-image,#adminmenu .menu-icon-site.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-site.current div.wp-menu-image{background-position:-359px -1px}.icon16.icon-generic,#adminmenu .menu-icon-generic div.wp-menu-image{background-position:-330px -33px}#adminmenu .menu-icon-generic:hover div.wp-menu-image,#adminmenu .menu-icon-generic.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-generic.current div.wp-menu-image{background-position:-330px -1px}.icon32.icon-post,#icon-edit,#icon-post,.icon32.icon-dashboard,#icon-index,.icon32.icon-media,#icon-upload,.icon32.icon-links,#icon-link-manager,#icon-link,#icon-link-category,.icon32.icon-page,#icon-edit-pages,#icon-page,.icon32.icon-comments,#icon-edit-comments,.icon32.icon-appearance,#icon-themes,.icon32.icon-plugins,#icon-plugins,.icon32.icon-users,#icon-users,#icon-profile,#icon-user-edit,.icon32.icon-tools,#icon-tools,#icon-admin,.icon32.icon-settings,#icon-options-general,.icon32.icon-site,#icon-ms-admin,.icon32.icon-generic,#icon-generic{background-image:url(../images/icons32-vs.png?ver=20121105)}.icon32.icon-post,#icon-edit,#icon-post{background-position:-552px -5px}.icon32.icon-dashboard,#icon-index{background-position:-137px -5px}.icon32.icon-media,#icon-upload{background-position:-251px -5px}.icon32.icon-links,#icon-link-manager,#icon-link,#icon-link-category{background-position:-190px -5px}.icon32.icon-page,#icon-edit-pages,#icon-page{background-position:-312px -5px}.icon32.icon-comments,#icon-edit-comments{background-position:-72px -5px}.icon32.icon-appearance,#icon-themes{background-position:-11px -5px}.icon32.icon-plugins,#icon-plugins{background-position:-370px -5px}.icon32.icon-users,#icon-users,#icon-profile,#icon-user-edit{background-position:-600px -5px}.icon32.icon-tools,#icon-tools,#icon-admin{background-position:-432px -5px}.icon32.icon-settings,#icon-options-general{background-position:-492px -5px}.icon32.icon-site,#icon-ms-admin{background-position:-659px -5px}.icon32.icon-generic,#icon-generic{background-position:-708px -5px}.post-format-icon{background:url(../images/post-formats-vs.png) no-repeat}table.diff .diff-deletedline{background-color:#ffe9e9}table.diff .diff-deletedline del{background-color:#faa}table.diff .diff-addedline{background-color:#e9ffe9}table.diff .diff-addedline ins{background-color:#afa}.revisions-meta{border:1px solid #d1e5ee}.revisions-controls{background:#fff;background:-webkit-gradient(linear,left bottom,left top,color-stop(0%,rgba(255,255,255,1)),color-stop(30px,rgba(255,255,255,1)),color-stop(100%,rgba(255,255,255,1)));background:-webkit-linear-gradient(bottom,rgba(255,255,255,0) 0,rgba(255,255,255,1) 30px,rgba(255,255,255,1) 100%);background:-moz-linear-gradient(bottom,rgba(255,255,255,0) 0,rgba(255,255,255,1) 30px,rgba(255,255,255,1) 100%);background:-o-linear-gradient(bottom,rgba(255,255,255,0) 0,rgba(255,255,255,1) 30px,rgba(255,255,255,1) 100%);background:linear-gradient(to top,rgba(255,255,255,0) 0,rgba(255,255,255,1) 30px,rgba(255,255,255,1) 100%)}.revisions-tooltip,.revisions-tooltip-arrow span{border-color:#d1e5ee;background-color:#fff}.revisions-tickmarks>div{border-color:#d1e5ee}.wp-slider.ui-slider{border-color:#d1e5ee}.wp-slider .ui-slider-handle{color:#333;border-color:none}.wp-slider .ui-slider-handle{border-color:#d0dfe9;background:#eff8ff;background-image:-webkit-gradient(linear,left bottom,left top,from(#eff8ff),to(#fff));background-image:-webkit-linear-gradient(bottom,#eff8ff,#fff);background-image:-moz-linear-gradient(bottom,#eff8ff,#fff);background-image:-o-linear-gradient(bottom,#eff8ff,#fff);background-image:linear-gradient(to top,#eff8ff,#fff)}.wp-slider .ui-slider-handle:hover,.wp-slider .ui-slider-handle:focus{border-color:#a0c3d5}.wp-slider .ui-slider-handle.ui-state-hover,.wp-slider .ui-slider-handle.ui-state-focus{border-color:#a0c3d5;outline:0}#sidemenu a{background-color:#f9f9f9;border-color:#f9f9f9;border-bottom-color:#dfdfdf}#sidemenu a.current{background-color:#fff;border-color:#dfdfdf #dfdfdf #fff;color:#d54e21}#replyerror{border-color:#ddd;background-color:#f9f9f9}.vim-current,.vim-current th,.vim-current td{background-color:#e4f2fd!important}#plugin-information .fyi ul{background-color:#eaf3fa}#plugin-information .fyi h2.mainheader{background-color:#cee1ef}#plugin-information pre,#plugin-information code{background-color:#ededff}#plugin-information pre{border:1px solid #ccc}#bulk-titles{border-color:#ddd}.inline-editor div.title{background-color:#eaf3fa}.inline-editor ul.cat-checklist{background-color:#fff;border-color:#ddd}.inline-editor .quick-edit-save{background-color:#f1f1f1}fieldset.inline-edit-col-right .inline-edit-col{border-color:#dfdfdf}.attention{color:#d54e21}.js .meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/arrows-vs.png) no-repeat 6px 7px}.tablenav .tablenav-pages{color:#555}.tablenav .tablenav-pages a{border-color:#d1e5ee;background:#eee;-moz-box-shadow:inset 0 1px 0 #fff;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.tablenav .tablenav-pages a:hover,.tablenav .tablenav-pages a:focus{color:#d54e21}.tablenav .tablenav-pages a.disabled,.tablenav .tablenav-pages a.disabled:hover,.tablenav .tablenav-pages a.disabled:focus{color:#aaa}.tablenav .tablenav-pages .current{background:#dfdfdf;border-color:#d3d3d3}#availablethemes,#availablethemes td{border-color:#acd}#current-theme img{border-color:#b0c8d7}#TB_window #TB_title a.tb-theme-preview-link,#TB_window #TB_title a.tb-theme-preview-link:visited{color:#999}#TB_window #TB_title a.tb-theme-preview-link:hover,#TB_window #TB_title a.tb-theme-preview-link:focus{color:#ccc}.misc-pub-section{border-top-color:#fff;border-bottom-color:#d1e5ee}#minor-publishing{border-bottom-color:#cae6ff}#post-body .misc-pub-section{border-left-color:#eee}.post-com-count span{background-color:#bbb}.form-table .color-palette td{border-color:#fff}.sortable-placeholder{border-color:#bbb;background-color:#f5f5f5}#post-body ul.category-tabs li.tabs a,#post-body ul.add-menu-item-tabs li.tabs a,body.press-this ul.category-tabs li.tabs a{color:#333}.view-switch #view-switch-list,.view-switch #view-switch-excerpt{background-color:transparent;background-image:url('../images/list.png');background-repeat:no-repeat}.view-switch #view-switch-list{background-position:0 0}.view-switch .current #view-switch-list{background-position:-40px 0}.view-switch #view-switch-excerpt{background-position:-20px 0}.view-switch .current #view-switch-excerpt{background-position:-60px 0}#header-logo{background:transparent url(../images/wp-logo-vs.png?ver=20101102) no-repeat scroll center center}.popular-tags,.feature-filter{background-color:#fff;border-color:#d1e5ee}div.widgets-sortables,#widgets-left .inactive,#available-widgets .widget-holder{background-color:#f7fcfe;border-color:#d0dfe9}#available-widgets .widget-description{color:#555}.sidebar-name{color:#464646;text-shadow:#fff 0 1px 0;border-color:#d0dfe9;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.js .sidebar-name:hover,.js #removing-widget{color:#d54e21}#removing-widget span{color:black}.js .sidebar-name-arrow{background:transparent url(../images/arrows-vs.png) no-repeat 5px 9px}.js .sidebar-name:hover .sidebar-name-arrow{background:transparent url(../images/arrows-dark-vs.png) no-repeat 5px 9px}.in-widget-title{color:#606060}.deleting .widget-title *{color:#aaa}.imgedit-menu div{border-color:#d5d5d5;background-color:#f1f1f1}.imgedit-menu div:hover{border-color:#c1c1c1;background-color:#eaeaea}.imgedit-menu div.disabled{border-color:#ccc;background-color:#ddd;filter:alpha(opacity=50);opacity:.5}#dashboard_recent_comments div.undo{border-top-color:#dfdfdf}.comment-ays,.comment-ays th{border-color:#ddd}.comment-ays th{background-color:#f1f1f1}#menu-management .menu-edit{border-color:#d0dfe9}#post-body{background:#fff;border-top-color:#fff;border-bottom-color:#d0dfe9}#nav-menu-header{border-bottom-color:#d0dfe9}#nav-menu-footer{border-top-color:#fff}#menu-management .nav-tabs-arrow a{color:#c1c1c1}#menu-management .nav-tabs-arrow a:hover{color:#d54e21}#menu-management .nav-tabs-arrow a:active{color:#464646}#menu-management .nav-tab-active{border-color:#dfdfdf}#menu-management .nav-tab{background:#f7fcfe;border-color:#d0dfe9}.js .input-with-default-title{color:#aaa}#cancel-save{color:#f00}#cancel-save:hover{background-color:#f00;color:#fff}.list-container{border-color:#dfdfdf}.menu-item-handle{border-color:#d0dfe9}.menu li.deleting .menu-item-handle{background-color:#f66;text-shadow:#ccc}.item-type{color:#999}.item-controls .menu-item-delete:hover{color:#f00}.nav-menus-php .item-edit{background:transparent url(../images/arrows-vs.png) no-repeat 8px 10px;border-bottom-color:#eff8ff}.nav-menus-php .item-edit:hover{background:transparent url(../images/arrows-dark-vs.png) no-repeat 8px 10px}.menu-item-settings{border-color:#d0dfe9}.link-to-original{color:#777;border-color:#d0dfe9}#cancel-save:hover{color:#fff!important}#update-menu-item{color:#fff!important}#update-menu-item:hover,#update-menu-item:active,#update-menu-item:focus{color:#eaf2fa!important;border-color:#13455b!important}.submitbox .submitcancel{color:#21759b;border-bottom-color:#21759b}.submitbox .submitcancel:hover{background:#21759b;color:#fff}.nav-tab{border-color:#d1e5ee #d1e5ee #fff}.nav-tab:hover,.nav-tab-active{border-color:#acd #acd #fff}h2.nav-tab-wrapper,h3.nav-tab-wrapper{border-bottom-color:#acd}#menu-management .nav-tab-active,.menu-item-handle,.menu-item-settings{-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}#menu-management .nav-tab-active{background:#f7fcfe;border-bottom-color:#f7fcfe}#upload-form label{color:#777}.fullscreen-overlay{background:#fff}.wp-fullscreen-focus #wp-fullscreen-title,.wp-fullscreen-focus #wp-fullscreen-container{border-color:#bed1dd}#fullscreen-topbar{border-bottom-color:#d1e5ee}.about-wrap h1{color:#333;text-shadow:1px 1px 1px #fff}.about-text{color:#777}.wp-badge{color:#fff;text-shadow:0 -1px 0 rgba(22,57,81,0.3)}.about-wrap h2 .nav-tab{color:#21759b}.about-wrap h2 .nav-tab:hover{color:#d54e21}.about-wrap h2 .nav-tab-active,.about-wrap h2 .nav-tab-active:hover{color:#333}.about-wrap h2 .nav-tab-active{text-shadow:1px 1px 1px #fff;color:#464646}.about-wrap h3{color:#333;text-shadow:1px 1px 1px #fff}.about-wrap .feature-section h4{color:#464646}.about-wrap .feature-section img{background:#fff;border:1px #ccc solid;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.3);box-shadow:0 1px 3px rgba(0,0,0,0.3)}.about-wrap h4.wp-people-group{text-shadow:1px 1px 1px #fff}.about-wrap .point-releases{border-bottom:1px solid #dfdfdf}.about-wrap .point-releases h3{border-top:1px solid #dfdfdf}.about-wrap .point-releases h3:first-child{border:0}.about-wrap li.wp-person img.gravatar{-webkit-box-shadow:0 0 4px rgba(0,0,0,0.4);box-shadow:0 0 4px rgba(0,0,0,0.4)}.about-wrap li.wp-person .title{color:#464646;text-shadow:1px 1px 1px #fff}.freedoms-php .about-wrap ol li{color:#999}.freedoms-php .about-wrap ol p{color:#464646}.rtl .bar{border-right-color:transparent;border-left-color:#99d}.rtl #screen-meta-links a.show-settings{background-position:left 3px}.rtl #screen-meta-links a.show-settings.screen-meta-active{background-position:left -33px}.rtl #adminmenushadow,.rtl #adminmenuback{background-image:url(../images/menu-shadow-rtl.png);background-position:top left}.rtl #adminmenu .wp-submenu .wp-submenu-head{border-right-color:transparent;border-left-color:#d1e5ee}.rtl #adminmenu .wp-submenu,.rtl.folded #adminmenu .wp-has-current-submenu .wp-submenu{-webkit-box-shadow:-2px 2px 5px rgba(0,0,0,0.4);box-shadow:-2px 2px 5px rgba(0,0,0,0.4)}.rtl #adminmenu .wp-has-current-submenu .wp-submenu{-webkit-box-shadow:none;box-shadow:none}.rtl #collapse-button div{background-position:0 -108px}.rtl.folded #collapse-button div{background-position:0 -72px}@media only screen and (max-width:900px){.rtl.auto-fold #adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.rtl.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu{-webkit-box-shadow:-2px 2px 5px rgba(0,0,0,0.4);box-shadow:-2px 2px 5px rgba(0,0,0,0.4)}.rtl.auto-fold #collapse-button div{background-position:0 -72px}}.js.rtl .meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/arrows-vs.png) no-repeat 6px 7px}.rtl #post-body .misc-pub-section{border-right-color:transparent;border-left-color:#d1e5ee}.js.rtl .sidebar-name-arrow{background:transparent url(../images/arrows-vs.png) no-repeat 5px 9px}.js.rtl .sidebar-name:hover .sidebar-name-arrow{background:transparent url(../images/arrows-dark-vs.png) no-repeat 5px 9px}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.curtime #timestamp{background-image:url("../images/date-button-2x.gif?ver=20120916");background-size:16px auto}.tagchecklist span a,#bulk-titles div a,.tagchecklist span a:hover,#bulk-titles div a:hover{background-image:url("../images/xit-2x.gif?ver=20120916");background-size:20px auto}#screen-meta-links a.show-settings,#screen-meta-links a.show-settings.screen-meta-active,#adminmenu .wp-has-submenu:hover .wp-menu-toggle,#adminmenu .wp-menu-open .wp-menu-toggle,#collapse-button div,.nav-menus-php .item-edit,.js .meta-box-sortables .postbox:hover .handlediv,.sidebar-name-arrow,.rtl #adminmenu .wp-has-submenu:hover .wp-menu-toggle,.rtl #adminmenu .wp-menu-open .wp-menu-toggle,.js.rtl .meta-box-sortables .postbox:hover .handlediv,.rtl .sidebar-name-arrow{background-image:url("../images/arrows-vs-2x.png?ver=20120916");background-size:15px 123px}#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle,.nav-menus-php .item-edit:hover,.sidebar-name:hover .sidebar-name-arrow,.rtl #adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,.rtl #adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle,.rtl .sidebar-name:hover .sidebar-name-arrow{background-image:url("../images/arrows-dark-vs-2x.png?ver=20120916");background-size:15px 123px}.view-switch #view-switch-list,.view-switch #view-switch-excerpt{background-image:url("../images/list-2x.png?ver=20120916");background-size:80px 20px}.icon32.icon-post,#icon-edit,#icon-post,.icon32.icon-dashboard,#icon-index,.icon32.icon-media,#icon-upload,.icon32.icon-links,#icon-link-manager,#icon-link,#icon-link-category,.icon32.icon-page,#icon-edit-pages,#icon-page,.icon32.icon-comments,#icon-edit-comments,.icon32.icon-appearance,#icon-themes,.icon32.icon-plugins,#icon-plugins,.icon32.icon-users,#icon-users,#icon-profile,#icon-user-edit,.icon32.icon-tools,#icon-tools,#icon-admin,.icon32.icon-settings,#icon-options-general,.icon32.icon-site,#icon-ms-admin,.icon32.icon-generic,#icon-generic{background-image:url(../images/icons32-vs-2x.png?ver=20121105);background-size:756px 45px}.icon16.icon-dashboard,.menu-icon-dashboard div.wp-menu-image,.icon16.icon-post,.menu-icon-post div.wp-menu-image,.icon16.icon-media,.menu-icon-media div.wp-menu-image,.icon16.icon-links,.menu-icon-links div.wp-menu-image,.icon16.icon-page,.menu-icon-page div.wp-menu-image,.icon16.icon-comments,.menu-icon-comments div.wp-menu-image,.icon16.icon-appearance,.menu-icon-appearance div.wp-menu-image,.icon16.icon-plugins,.menu-icon-plugins div.wp-menu-image,.icon16.icon-users,.menu-icon-users div.wp-menu-image,.icon16.icon-tools,.menu-icon-tools div.wp-menu-image,.icon16.icon-settings,.menu-icon-settings div.wp-menu-image,.icon16.icon-site,.menu-icon-site div.wp-menu-image,.icon16.icon-generic,.menu-icon-generic div.wp-menu-image{background-image:url('../images/menu-vs-2x.png?ver=20121105');background-size:390px 64px}#header-logo{background-image:url('../images/wp-logo-vs-2x.png?ver=20120916');background-size:16px auto}.post-format-icon{background-image:url(../images/post-formats32-vs.png);background-size:16px 304px}}
\ No newline at end of file
index 63f768159381602785c1761633b2207b391094c7..92d8332daf292c15333413711f1b62e72d526382 100644 (file)
@@ -83,13 +83,10 @@ div.dashboard-widget,
        background-color: #f1f1f1;
 }
 
-.widefat {
+table.widefat {
        border-color: #dfdfdf;
        background-color: #f9f9f9;
 }
-textarea.widefat {
-       background-color: #fff;
-}
 
 div.dashboard-widget-error {
        background-color: #c43;
@@ -167,6 +164,7 @@ textarea.disabled {
        color: #fff;
 }
 
+.revisions-meta,
 .widget .widget-top,
 .postbox h3,
 .stuffbox h3,
@@ -187,6 +185,8 @@ h3.dashboard-widget-title small,
        background-image: linear-gradient(to top, #ececec, #f9f9f9);
 }
 
+
+
 .widget .widget-top,
 .postbox h3,
 .stuffbox h3 {
@@ -412,7 +412,8 @@ div.dashboard-widget-submit input:hover,
 
 .submitbox .submitdelete:hover,
 #media-items a.delete:hover,
-#media-items a.delete-permanently:hover {
+#media-items a.delete-permanently:hover,
+#nav-menu-footer .menu-delete:hover {
        color: #fff;
        background-color: #f00;
        border-bottom-color: #f00;
@@ -1351,25 +1352,78 @@ div.wp-menu-image {
 
 /* end screen icons */
 
+/* Post format icons */
+
+.post-format-icon {
+       background: url(../images/post-formats.png) no-repeat;
+}
+
 /* Diff */
 table.diff .diff-deletedline {
-       background-color: #fdd;
+       background-color: #ffe9e9;
 }
 
 table.diff .diff-deletedline del {
-       background-color: #f99;
+       background-color: #faa;
 }
 
 table.diff .diff-addedline {
-       background-color: #dfd;
+       background-color: #e9ffe9;
 }
 
 table.diff .diff-addedline ins {
-       background-color: #9f9;
+       background-color: #afa;
 }
 
-#att-info {
-       background-color: #e4f2Fd;
+.revisions-meta {
+       border: 1px solid #dfdfdf;
+}
+
+.revisions-controls {
+       background: #fff;
+       background: -webkit-gradient(linear, left bottom, left top, color-stop(0%,rgba(255,255,255,1)), color-stop(30px,rgba(255,255,255,1)), color-stop(100%,rgba(255,255,255,1)));
+       background: -webkit-linear-gradient(bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%);
+       background:    -moz-linear-gradient(bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%);
+       background:      -o-linear-gradient(bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%);
+       background: linear-gradient(to top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 30px, rgba(255,255,255,1) 100%);
+}
+
+.revisions-tooltip,
+.revisions-tooltip-arrow span {
+       border-color: #d7d7d7;
+       background-color: #fff;
+}
+
+.revisions-tickmarks > div {
+       border-color: #aaa;
+}
+
+/* jQuery UI Slider */
+.wp-slider.ui-slider {
+       border-color: #d7d7d7;
+}
+
+.wp-slider .ui-slider-handle {
+       border-color: #ccc;
+       border-radius: 50%;
+       background: #f4f4f4;
+       background-image: -webkit-gradient(linear, left bottom, left top, from(#dfdfdf), to(#fff));
+       background-image: -webkit-linear-gradient(bottom, #dfdfdf, #fff);
+       background-image:    -moz-linear-gradient(bottom, #dfdfdf, #fff);
+       background-image:      -o-linear-gradient(bottom, #dfdfdf, #fff);
+       background-image: linear-gradient(to top, #dfdfdf, #fff);
+       color: #333;
+}
+
+.wp-slider .ui-slider-handle:hover,
+.wp-slider .ui-slider-handle:focus {
+       border-color: #aaa;
+}
+
+.wp-slider .ui-slider-handle.ui-state-hover,
+.wp-slider .ui-slider-handle.ui-state-focus {
+       border-color: #aaa;
+       outline: none;
 }
 
 /* edit image */
@@ -1429,11 +1483,6 @@ table.diff .diff-addedline ins {
        border-color: #ddd;
 }
 
-.inline-editor .categories .catshow,
-.inline-editor .categories .cathide {
-       color: #21759b;
-}
-
 .inline-editor .quick-edit-save {
        background-color: #f1f1f1;
 }
@@ -1749,6 +1798,23 @@ div.widgets-sortables,
        background: #21759b;
        color: #fff;
 }
+
+.manage-menus {
+       border: 1px solid #eeeeee;
+       background: #fbfbfb;
+}
+
+.theme-location-set {
+       color: #999999;
+}
+
+.nav-menus-php .delete-action a {
+       color: #bc0b0b;
+}
+
+.is-submenu {
+       color: #999999;
+}
 /* end added from nav-menu.css */
 
 .nav-tab {
@@ -2073,4 +2139,10 @@ h2.nav-tab-wrapper, h3.nav-tab-wrapper {
                background-size: 16px auto;
        }
 
+       /* 16px post formats */
+       .post-format-icon {
+               background-image: url(../images/post-formats32.png);
+               background-size: 16px 304px;
+       }
+
 }
index 77ae813976314925e5a94f735483672137fc02d3..9e9ed8b53a3b508e5b1451dd78c15caeee94826d 100644 (file)
@@ -1 +1 @@
-.find-box-search,.find-box-buttons{background-color:#f7f7f7;border-top:1px solid #ddd}.find-box{background-color:#444}.find-box-head{color:#eee}.find-box-inside{background-color:#fff}a.page-numbers:hover{border-color:#999}body,#wpbody,.form-table .pre,.ui-autocomplete li a{color:#333}body>#upload-menu{border-bottom-color:#fff}#postcustomstuff table,#your-profile fieldset,#rightnow,div.dashboard-widget,#dashboard-widgets p.dashboard-widget-links{border-color:#ccc}#poststuff .inside label.spam,#poststuff .inside label.deleted{color:red}#poststuff .inside label.waiting{color:orange}#poststuff .inside label.approved{color:green}#postcustomstuff table{border-color:#dfdfdf;background-color:#f9f9f9}#postcustomstuff thead th{background-color:#f1f1f1}.widefat{border-color:#dfdfdf;background-color:#f9f9f9}textarea.widefat{background-color:#fff}div.dashboard-widget-error{background-color:#c43}div.dashboard-widget-notice{background-color:#cfe1ef}div.dashboard-widget-submit{border-top-color:#ccc}ul.category-tabs li{border-color:transparent}div.tabs-panel,.wp-tab-panel,ul.add-menu-item-tabs li.tabs,.wp-tab-active{border-color:#dfdfdf;background-color:#fff}ul.category-tabs li.tabs{border-color:#dfdfdf #dfdfdf #fff}ul.category-tabs li.tabs,ul.add-menu-item-tabs li.tabs,.wp-tab-active{background-color:#fff}kbd,code{background:#eaeaea}textarea,input[type="text"],input[type="password"],input[type="file"],input[type="email"],input[type="number"],input[type="search"],input[type="tel"],input[type="url"],select{border-color:#dfdfdf}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="file"]:focus,input[type="email"]:focus,input[type="number"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="url"]:focus,select:focus{border-color:#aaa}input.disabled,textarea.disabled{background-color:#ccc}#plugin-information .action-button a,#plugin-information .action-button a:hover,#plugin-information .action-button a:visited{color:#fff}.widget .widget-top,.postbox h3,.stuffbox h3,.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small,.sidebar-name,#nav-menu-header,#nav-menu-footer,.menu-item-handle{background:#f1f1f1;background-image:-webkit-gradient(linear,left bottom,left top,from(#ececec),to(#f9f9f9));background-image:-webkit-linear-gradient(bottom,#ececec,#f9f9f9);background-image:-moz-linear-gradient(bottom,#ececec,#f9f9f9);background-image:-o-linear-gradient(bottom,#ececec,#f9f9f9);background-image:linear-gradient(to top,#ececec,#f9f9f9)}.widget .widget-top,.postbox h3,.stuffbox h3{border-bottom-color:#dfdfdf;text-shadow:#fff 0 1px 0;-webkit-box-shadow:0 1px 0 #fff;box-shadow:0 1px 0 #fff}.form-table th,.form-wrap label{color:#222;text-shadow:#fff 0 1px 0}.description,.form-wrap p{color:#666}strong .post-com-count span{background-color:#21759b}.sorthelper{background-color:#ccf3fa}.ac_match,.subsubsub a.current{color:#000}.wrap h2{color:#464646}.wrap .add-new-h2,.wrap .add-new-h2:active{background:#f1f1f1}.subtitle{color:#777}.ac_over{background-color:#f0f0b8}.ac_results{background-color:#fff;border-color:#808080}.ac_results li{color:#101010}.alternate,.alt{background-color:#fcfcfc}.available-theme a.screenshot{background-color:#f1f1f1;border-color:#ddd}#current-theme{border-bottom-color:#dfdfdf}.bar{background-color:#e8e8e8;border-right-color:#99d}#media-upload,#media-upload .media-item .slidetoggle{background:#fff}#media-upload .slidetoggle{border-top-color:#dfdfdf}div.error,.login #login_error{background-color:#ffebe8;border-color:#c00}div.error a{color:#c00}.form-invalid{background-color:#ffebe8!important}.form-invalid input,.form-invalid select{border-color:#c00!important}.submit,#commentsdiv #add-new-comment{border-color:#dfdfdf}.highlight{background-color:#e4f2fd;color:#000}.howto,.nonessential,#edit-slug-box,.form-input-tip,.subsubsub{color:#666}.media-upload-form label.form-help,td.help{color:#9a9a9a}.ui-autocomplete{border-color:#aaa;background-color:#efefef}.ui-autocomplete li a.ui-state-focus{background-color:#ddd}.post-com-count{color:#fff}.post-com-count span{background-color:#bbb;color:#fff}.post-com-count:hover span{background-color:#d54e21}.quicktags,.search{background-color:#ccc;color:#000}.side-info h5{border-bottom-color:#dadada}.side-info ul{color:#666}a:hover,a:active{color:#d54e21}a:focus{color:#124964}#adminmenu a:hover,#adminmenu li.menu-top>a:focus,#adminmenu .wp-submenu a:hover,#the-comment-list .comment a:hover,#rightnow a:hover,#media-upload a.del-link:hover,div.dashboard-widget-submit input:hover,.subsubsub a:hover,.subsubsub a.current:hover,.ui-tabs-nav a:hover,.plugins .inactive a:hover,#all-plugins-table .plugins .inactive a:hover,#search-plugins-table .plugins .inactive a:hover{color:#d54e21}#the-comment-list .comment-item,#dashboard-widgets #dashboard_quick_press form p.submit{border-color:#dfdfdf}#side-sortables .category-tabs .tabs a,#side-sortables .add-menu-item-tabs .tabs a,.wp-tab-bar .wp-tab-active a{color:#333}#rightnow .rbutton{background-color:#ebebeb;color:#264761}#dashboard_right_now .table_content,#dashboard_right_now .table_discussion{border-top-color:#ececec}.submitbox .submit{background-color:#464646;color:#ccc}.plugins a.delete:hover,#all-plugins-table .plugins a.delete:hover,#search-plugins-table .plugins a.delete:hover,.submitbox .submitdelete{color:#f00;border-bottom-color:#f00}.submitbox .submitdelete:hover,#media-items a.delete:hover,#media-items a.delete-permanently:hover{color:#fff;background-color:#f00;border-bottom-color:#f00}#normal-sortables .submitbox .submitdelete:hover{color:#000;background-color:#f00;border-bottom-color:#f00}.tablenav .dots{border-color:transparent}.tablenav .next,.tablenav .prev{border-color:transparent;color:#21759b}.tablenav .next:hover,.tablenav .prev:hover{border-color:transparent;color:#d54e21}div.updated,.login .message{background-color:#ffffe0;border-color:#e6db55}.update-message{color:#000}a.page-numbers{border-bottom-color:#b8d3e2}.commentlist li{border-bottom-color:#ccc}.widefat td,.widefat th{border-top-color:#fff;border-bottom-color:#dfdfdf}.widefat th{text-shadow:rgba(255,255,255,0.8) 0 1px 0}.widefat td{color:#555}.widefat p,.widefat ol,.widefat ul{color:#333}.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small{color:#333}th.sortable a:hover,th.sortable a:active,th.sortable a:focus{color:#333}th.sortable a:focus{background:#e1e1e1;background-image:-webkit-gradient(linear,left bottom,left top,from(#dcdcdc),to(#e9e9e9));background-image:-webkit-linear-gradient(bottom,#dcdcdc,#e9e9e9);background-image:-moz-linear-gradient(bottom,#dcdcdc,#e9e9e9);background-image:-o-linear-gradient(bottom,#dcdcdc,#e9e9e9);background-image:linear-gradient(to top,#dcdcdc,#e9e9e9)}h3.dashboard-widget-title small a{color:#d7d7d7}h3.dashboard-widget-title small a:hover{color:#fff}a,#adminmenu a,#the-comment-list p.comment-author strong a,#media-upload a.del-link,#media-items a.delete,#media-items a.delete-permanently,.plugins a.delete,.ui-tabs-nav a{color:#21759b}#adminmenu .awaiting-mod,#adminmenu .update-plugins,#sidemenu a .update-plugins,#rightnow .reallynow{background-color:#464646;color:#fff;-webkit-box-shadow:rgba(255,255,255,0.5) 0 1px 0;box-shadow:rgba(255,255,255,0.5) 0 1px 0}#plugin-information .action-button{background-color:#d54e21;color:#fff}#adminmenu li.current a .awaiting-mod,#adminmenu li a.wp-has-current-submenu .update-plugins{background-color:#464646;color:#fff;-webkit-box-shadow:rgba(255,255,255,0.5) 0 1px 0;box-shadow:rgba(255,255,255,0.5) 0 1px 0}div#media-upload-header,div#plugin-information-header{background-color:#f9f9f9;border-bottom-color:#dfdfdf}#currenttheme img{border-color:#666}#dashboard_secondary div.dashboard-widget-content ul li a{background-color:#f9f9f9}input.readonly,textarea.readonly{background-color:#ddd}#editable-post-name{background-color:#fffbcc}#edit-slug-box strong,.tablenav .displaying-num,#submitted-on,.submitted-on{color:#777}.login #nav a,.login #backtoblog a{color:#21759b!important}.login #nav a:hover,.login #backtoblog a:hover{color:#d54e21!important}#wpfooter{color:#777;border-color:#dfdfdf}.imgedit-group,#media-items .media-item,.media-item .describe{border-color:#dfdfdf}.checkbox,.side-info,.plugins tr,#your-profile #rich_editing{background-color:#fcfcfc}.plugins .inactive,.plugins .inactive th,.plugins .inactive td,tr.inactive+tr.plugin-update-tr .plugin-update{background-color:#f4f4f4}.plugin-update-tr .update-message{background-color:#fffbe4;border-color:#dfdfdf}.plugins .active,.plugins .active th,.plugins .active td{color:#000}.plugins .inactive a{color:#579}#the-comment-list tr.undo,#the-comment-list div.undo{background-color:#f4f4f4}#the-comment-list .unapproved{background-color:#ffffe0}#the-comment-list .approve a{color:#006505}#the-comment-list .unapprove a{color:#d98500}table.widefat span.delete a,table.widefat span.trash a,table.widefat span.spam a,#dashboard_recent_comments .delete a,#dashboard_recent_comments .trash a,#dashboard_recent_comments .spam a{color:#bc0b0b}.welcome-panel{background:#f5f5f5;background-image:-webkit-gradient(linear,left bottom,left top,from(#f5f5f5),to(#fafafa));background-image:-webkit-linear-gradient(bottom,#f5f5f5,#fafafa);background-image:-moz-linear-gradient(bottom,#f5f5f5,#fafafa);background-image:-o-linear-gradient(bottom,#f5f5f5,#fafafa);background-image:linear-gradient(to top,#f5f5f5,#fafafa);border-color:#dfdfdf}.welcome-panel p{color:#777}.welcome-panel-column p{color:#464646}.welcome-panel h3{text-shadow:1px 1px 1px #fff}.widget,#widget-list .widget-top,.postbox,#titlediv,#poststuff .postarea,.stuffbox{border-color:#dfdfdf;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;-webkit-border-radius:3px;border-radius:3px}.widget,#widget-list .widget-top,.postbox,.menu-item-settings{background:#f5f5f5;background-image:-webkit-gradient(linear,left bottom,left top,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(bottom,#f5f5f5,#f9f9f9);background-image:-moz-linear-gradient(bottom,#f5f5f5,#f9f9f9);background-image:-o-linear-gradient(bottom,#f5f5f5,#f9f9f9);background-image:linear-gradient(to top,#f5f5f5,#f9f9f9)}.postbox h3{color:#464646}.widget .widget-top{color:#222}.js .sidebar-name:hover h3,.js .postbox h3:hover{color:#000}.curtime #timestamp{background-image:url(../images/date-button.gif)}#rightnow .youhave{background-color:#f0f6fb}#rightnow a{color:#448abd}.tagchecklist span a,#bulk-titles div a{background:url(../images/xit.gif) no-repeat}.tagchecklist span a:hover,#bulk-titles div a:hover{background:url(../images/xit.gif) no-repeat -10px 0}#update-nag,.update-nag{background-color:#fffbcc;border-color:#e6db55;color:#555}#screen-meta{background-color:#f1f1f1;border-color:#ccc;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.05);box-shadow:0 1px 3px rgba(0,0,0,0.05)}#contextual-help-back{background:#fff}.contextual-help-tabs a:hover{color:#333}#contextual-help-back,.contextual-help-tabs .active{border-color:#ccc}.contextual-help-tabs .active,.contextual-help-tabs .active a,.contextual-help-tabs .active a:hover{background:#fff;color:#333}#screen-options-link-wrap,#contextual-help-link-wrap{border-right:1px solid #ccc;border-left:1px solid #ccc;border-bottom:1px solid #ccc;background:#e3e3e3;background-image:-webkit-gradient(linear,left bottom,left top,from(#dfdfdf),to(#f1f1f1));background-image:-webkit-linear-gradient(bottom,#dfdfdf,#f1f1f1);background-image:-moz-linear-gradient(bottom,#dfdfdf,#f1f1f1);background-image:-o-linear-gradient(bottom,#dfdfdf,#f1f1f1);background-image:linear-gradient(to top,#dfdfdf,#f1f1f1)}#screen-meta-links a{color:#777;background:transparent url(../images/arrows.png) no-repeat right 4px}#screen-meta-links a:hover,#screen-meta-links a:active{color:#333;background-color:transparent}#screen-meta-links a.screen-meta-active{background-position:right -31px}.login #backtoblog a{color:#464646}#wphead{border-bottom:#dfdfdf 1px solid}#wphead h1 a{color:#464646}#wpfooter a:link,#wpfooter a:visited{text-decoration:none}#wpfooter a:hover{text-decoration:underline}.file-error,abbr.required,.widget-control-remove:hover,table.widefat .delete a:hover,table.widefat .trash a:hover,table.widefat .spam a:hover,#dashboard_recent_comments .delete a:hover,#dashboard_recent_comments .trash a:hover #dashboard_recent_comments .spam a:hover{color:#f00}#pass-strength-result{background-color:#eee;border-color:#ddd!important}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important}#post-status-info{border-color:#dfdfdf #ccc #ccc;background-color:#eaeaea}.editwidget .widget-inside{border-color:#dfdfdf}#titlediv #title{background-color:#fff}#tTips p#tTips_inside{background-color:#ddd;color:#333}#poststuff .inside .the-tagcloud{border-color:#ddd}#adminmenuback,#adminmenuwrap{background-color:#ececec;border-color:#ccc}#adminmenushadow,#adminmenuback{background-image:url(../images/menu-shadow.png);background-position:top right;background-repeat:repeat-y}#adminmenu li.wp-menu-separator{background:#dfdfdf;border-color:#cfcfcf}#adminmenu div.separator{border-color:#e1e1e1}#adminmenu a.menu-top,#adminmenu .wp-submenu .wp-submenu-head{border-top-color:#f9f9f9;border-bottom-color:#dfdfdf}#adminmenu li.wp-menu-open{border-color:#dfdfdf}#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{background-color:#e4e4e4;color:#d54e21;text-shadow:0 1px 0 rgba(255,255,255,0.4)}#adminmenu li.menu-top:hover>a span,#adminmenu li.menu-top>a:focus span{text-shadow:none}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu li.current a.menu-top,.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.current.menu-top,#adminmenu .wp-menu-arrow,#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{background:#777;background-image:-webkit-gradient(linear,left bottom,left top,from(#6d6d6d),to(#808080));background-image:-webkit-linear-gradient(bottom,#6d6d6d,#808080);background-image:-moz-linear-gradient(bottom,#6d6d6d,#808080);background-image:-o-linear-gradient(bottom,#6d6d6d,#808080);background-image:linear-gradient(to top,#6d6d6d,#808080)}#adminmenu .wp-menu-arrow div{background:#777;background-image:-webkit-gradient(linear,right bottom,left top,from(#6d6d6d),to(#808080));background-image:-webkit-linear-gradient(bottom right,#6d6d6d,#808080);background-image:-moz-linear-gradient(bottom right,#6d6d6d,#808080);background-image:-o-linear-gradient(bottom right,#6d6d6d,#808080);background-image:linear-gradient(to top left,#6d6d6d,#808080)}#adminmenu li.wp-not-current-submenu .wp-menu-arrow{border-top-color:#f9f9f9;border-bottom-color:#dfdfdf;background:#e4e4e4}#adminmenu li.wp-not-current-submenu .wp-menu-arrow div{background:#e4e4e4;border-color:#ccc}.folded #adminmenu li.menu-top li:hover a{background-image:none}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu li.current a.menu-top,#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{text-shadow:0 -1px 0 #333;color:#fff;border-top-color:#808080;border-bottom-color:#6d6d6d}.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{border-top-color:#808080;border-bottom-color:#6d6d6d}#adminmenu .wp-submenu a:hover,#adminmenu .wp-submenu a:focus{background-color:#eaf2fa;color:#333}#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover{color:#333}#adminmenu .wp-submenu,.folded #adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background-color:#fff;border-color:#dfdfdf;-webkit-box-shadow:2px 3px 6px rgba(0,0,0,0.4);box-shadow:2px 3px 6px rgba(0,0,0,0.4)}#adminmenu .wp-submenu .wp-submenu-head{background-color:#e4e4e4;color:#333}#collapse-menu{color:#aaa;border-top-color:#f9f9f9}#collapse-menu:hover{color:#999}#collapse-button{border-color:#ccc;background:#f4f4f4;background-image:-webkit-gradient(linear,left bottom,left top,from(#dfdfdf),to(#fff));background-image:-webkit-linear-gradient(bottom,#dfdfdf,#fff);background-image:-moz-linear-gradient(bottom,#dfdfdf,#fff);background-image:-o-linear-gradient(bottom,#dfdfdf,#fff);background-image:linear-gradient(to top,#dfdfdf,#fff)}#collapse-menu:hover #collapse-button{border-color:#aaa}#collapse-button div{background:transparent url(../images/arrows.png) no-repeat 0 -72px}.folded #collapse-button div{background-position:0 -108px}@media only screen and (max-width:900px){.auto-fold #adminmenu li.wp-has-current-submenu,.auto-fold #adminmenu li.current.menu-top{background-color:#777;background-image:-webkit-gradient(linear,left bottom,left top,from(#6d6d6d),to(#808080));background-image:-webkit-linear-gradient(bottom,#6d6d6d,#808080);background-image:-moz-linear-gradient(bottom,#6d6d6d,#808080);background-image:-o-linear-gradient(bottom,#6d6d6d,#808080);background-image:linear-gradient(bottom,#6d6d6d,#808080)}.auto-fold #adminmenu li.wp-has-current-submenu,.auto-fold #adminmenu li.current.menu-top{border-top-color:#808080;border-bottom-color:#6d6d6d}.auto-fold #adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu{background-color:#fff;border-color:#dfdfdf;-webkit-box-shadow:2px 3px 6px rgba(0,0,0,0.4);box-shadow:2px 3px 6px rgba(0,0,0,0.4)}.auto-fold #collapse-button div{background-position:0 -108px}}.icon16,.icon32,div.wp-menu-image{background-color:transparent;background-repeat:no-repeat}.icon16.icon-dashboard,.menu-icon-dashboard div.wp-menu-image,.icon16.icon-post,.menu-icon-post div.wp-menu-image,.icon16.icon-media,.menu-icon-media div.wp-menu-image,.icon16.icon-links,.menu-icon-links div.wp-menu-image,.icon16.icon-page,.menu-icon-page div.wp-menu-image,.icon16.icon-comments,.menu-icon-comments div.wp-menu-image,.icon16.icon-appearance,.menu-icon-appearance div.wp-menu-image,.icon16.icon-plugins,.menu-icon-plugins div.wp-menu-image,.icon16.icon-users,.menu-icon-users div.wp-menu-image,.icon16.icon-tools,.menu-icon-tools div.wp-menu-image,.icon16.icon-settings,.menu-icon-settings div.wp-menu-image,.icon16.icon-site,.menu-icon-site div.wp-menu-image,.icon16.icon-generic,.menu-icon-generic div.wp-menu-image{background-image:url(../images/menu.png?ver=20121105)}.icon16.icon-dashboard,#adminmenu .menu-icon-dashboard div.wp-menu-image{background-position:-59px -33px}#adminmenu .menu-icon-dashboard:hover div.wp-menu-image,#adminmenu .menu-icon-dashboard.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-dashboard.current div.wp-menu-image{background-position:-59px -1px}.icon16.icon-post,#adminmenu .menu-icon-post div.wp-menu-image{background-position:-269px -33px}#adminmenu .menu-icon-post:hover div.wp-menu-image,#adminmenu .menu-icon-post.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-post.current div.wp-menu-image{background-position:-269px -1px}.icon16.icon-media,#adminmenu .menu-icon-media div.wp-menu-image{background-position:-119px -33px}#adminmenu .menu-icon-media:hover div.wp-menu-image,#adminmenu .menu-icon-media.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-media.current div.wp-menu-image{background-position:-119px -1px}.icon16.icon-links,#adminmenu .menu-icon-links div.wp-menu-image{background-position:-89px -33px}#adminmenu .menu-icon-links:hover div.wp-menu-image,#adminmenu .menu-icon-links.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-links.current div.wp-menu-image{background-position:-89px -1px}.icon16.icon-page,#adminmenu .menu-icon-page div.wp-menu-image{background-position:-149px -33px}#adminmenu .menu-icon-page:hover div.wp-menu-image,#adminmenu .menu-icon-page.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-page.current div.wp-menu-image{background-position:-149px -1px}.icon16.icon-comments,#adminmenu .menu-icon-comments div.wp-menu-image{background-position:-29px -33px}#adminmenu .menu-icon-comments:hover div.wp-menu-image,#adminmenu .menu-icon-comments.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-comments.current div.wp-menu-image{background-position:-29px -1px}.icon16.icon-appearance,#adminmenu .menu-icon-appearance div.wp-menu-image{background-position:1px -33px}#adminmenu .menu-icon-appearance:hover div.wp-menu-image,#adminmenu .menu-icon-appearance.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-appearance.current div.wp-menu-image{background-position:1px -1px}.icon16.icon-plugins,#adminmenu .menu-icon-plugins div.wp-menu-image{background-position:-179px -33px}#adminmenu .menu-icon-plugins:hover div.wp-menu-image,#adminmenu .menu-icon-plugins.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-plugins.current div.wp-menu-image{background-position:-179px -1px}.icon16.icon-users,#adminmenu .menu-icon-users div.wp-menu-image{background-position:-300px -33px}#adminmenu .menu-icon-users:hover div.wp-menu-image,#adminmenu .menu-icon-users.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-users.current div.wp-menu-image{background-position:-300px -1px}.icon16.icon-tools,#adminmenu .menu-icon-tools div.wp-menu-image{background-position:-209px -33px}#adminmenu .menu-icon-tools:hover div.wp-menu-image,#adminmenu .menu-icon-tools.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-tools.current div.wp-menu-image{background-position:-209px -1px}.icon16.icon-settings,#adminmenu .menu-icon-settings div.wp-menu-image{background-position:-239px -33px}#adminmenu .menu-icon-settings:hover div.wp-menu-image,#adminmenu .menu-icon-settings.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-settings.current div.wp-menu-image{background-position:-239px -1px}.icon16.icon-site,#adminmenu .menu-icon-site div.wp-menu-image{background-position:-359px -33px}#adminmenu .menu-icon-site:hover div.wp-menu-image,#adminmenu .menu-icon-site.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-site.current div.wp-menu-image{background-position:-359px -1px}.icon16.icon-generic,#adminmenu .menu-icon-generic div.wp-menu-image{background-position:-330px -33px}#adminmenu .menu-icon-generic:hover div.wp-menu-image,#adminmenu .menu-icon-generic.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-generic.current div.wp-menu-image{background-position:-330px -1px}.icon32.icon-post,#icon-edit,#icon-post,.icon32.icon-dashboard,#icon-index,.icon32.icon-media,#icon-upload,.icon32.icon-links,#icon-link-manager,#icon-link,#icon-link-category,.icon32.icon-page,#icon-edit-pages,#icon-page,.icon32.icon-comments,#icon-edit-comments,.icon32.icon-appearance,#icon-themes,.icon32.icon-plugins,#icon-plugins,.icon32.icon-users,#icon-users,#icon-profile,#icon-user-edit,.icon32.icon-tools,#icon-tools,#icon-admin,.icon32.icon-settings,#icon-options-general,.icon32.icon-site,#icon-ms-admin,.icon32.icon-generic,#icon-generic{background-image:url(../images/icons32.png?ver=20121105)}.icon32.icon-post,#icon-edit,#icon-post{background-position:-552px -5px}.icon32.icon-dashboard,#icon-index{background-position:-137px -5px}.icon32.icon-media,#icon-upload{background-position:-251px -5px}.icon32.icon-links,#icon-link-manager,#icon-link,#icon-link-category{background-position:-190px -5px}.icon32.icon-page,#icon-edit-pages,#icon-page{background-position:-312px -5px}.icon32.icon-comments,#icon-edit-comments{background-position:-72px -5px}.icon32.icon-appearance,#icon-themes{background-position:-11px -5px}.icon32.icon-plugins,#icon-plugins{background-position:-370px -5px}.icon32.icon-users,#icon-users,#icon-profile,#icon-user-edit{background-position:-600px -5px}.icon32.icon-tools,#icon-tools,#icon-admin{background-position:-432px -5px}.icon32.icon-settings,#icon-options-general{background-position:-492px -5px}.icon32.icon-site,#icon-ms-admin{background-position:-659px -5px}.icon32.icon-generic,#icon-generic{background-position:-708px -5px}table.diff .diff-deletedline{background-color:#fdd}table.diff .diff-deletedline del{background-color:#f99}table.diff .diff-addedline{background-color:#dfd}table.diff .diff-addedline ins{background-color:#9f9}#att-info{background-color:#e4f2fd}#sidemenu a{background-color:#f9f9f9;border-color:#f9f9f9;border-bottom-color:#dfdfdf}#sidemenu a.current{background-color:#fff;border-color:#dfdfdf #dfdfdf #fff;color:#d54e21}#replyerror{border-color:#ddd;background-color:#f9f9f9}.vim-current,.vim-current th,.vim-current td{background-color:#e4f2fd!important}#plugin-information .fyi ul{background-color:#eaf3fa}#plugin-information .fyi h2.mainheader{background-color:#cee1ef}#plugin-information pre,#plugin-information code{background-color:#ededff}#plugin-information pre{border:1px solid #ccc}#bulk-titles{border-color:#ddd}.inline-editor div.title{background-color:#eaf3fa}.inline-editor ul.cat-checklist{background-color:#fff;border-color:#ddd}.inline-editor .categories .catshow,.inline-editor .categories .cathide{color:#21759b}.inline-editor .quick-edit-save{background-color:#f1f1f1}fieldset.inline-edit-col-right .inline-edit-col{border-color:#dfdfdf}.attention{color:#d54e21}.js .meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/arrows.png) no-repeat 6px 7px}.tablenav .tablenav-pages{color:#555}.tablenav .tablenav-pages a{border-color:#e3e3e3;background:#eee;-moz-box-shadow:inset 0 1px 0 #fff;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.tablenav .tablenav-pages a:hover,.tablenav .tablenav-pages a:focus{color:#d54e21}.tablenav .tablenav-pages a.disabled,.tablenav .tablenav-pages a.disabled:hover,.tablenav .tablenav-pages a.disabled:focus{color:#aaa}.tablenav .tablenav-pages .current{background:#dfdfdf;border-color:#d3d3d3}#availablethemes,#availablethemes td{border-color:#ddd}#current-theme img{border-color:#999}#TB_window #TB_title a.tb-theme-preview-link,#TB_window #TB_title a.tb-theme-preview-link:visited{color:#999}#TB_window #TB_title a.tb-theme-preview-link:hover,#TB_window #TB_title a.tb-theme-preview-link:focus{color:#ccc}.misc-pub-section{border-top-color:#fff;border-bottom-color:#dfdfdf}#minor-publishing{border-bottom-color:#dfdfdf}#post-body .misc-pub-section{border-left-color:#eee}.post-com-count span{background-color:#bbb}.form-table .color-palette td{border-color:#fff}.sortable-placeholder{border-color:#bbb;background-color:#f5f5f5}#post-body ul.category-tabs li.tabs a,#post-body ul.add-menu-item-tabs li.tabs a,body.press-this ul.category-tabs li.tabs a{color:#333}.view-switch #view-switch-list,.view-switch #view-switch-excerpt{background-color:transparent;background-image:url('../images/list.png');background-repeat:no-repeat}.view-switch #view-switch-list{background-position:0 0}.view-switch .current #view-switch-list{background-position:-40px 0}.view-switch #view-switch-excerpt{background-position:-20px 0}.view-switch .current #view-switch-excerpt{background-position:-60px 0}#header-logo{background:transparent url(../images/wp-logo.png?ver=20110504) no-repeat scroll center center}.popular-tags,.feature-filter{background-color:#fff;border-color:#dfdfdf}div.widgets-sortables,#widgets-left .inactive,#available-widgets .widget-holder{background-color:#fcfcfc;border-color:#dfdfdf}#available-widgets .widget-description{color:#555}.sidebar-name{color:#464646;text-shadow:#fff 0 1px 0;border-color:#dfdfdf;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.js .sidebar-name:hover,.js #removing-widget{color:#d54e21}#removing-widget span{color:black}.js .sidebar-name-arrow{background:transparent url(../images/arrows.png) no-repeat 5px 9px}.js .sidebar-name:hover .sidebar-name-arrow{background:transparent url(../images/arrows-dark.png) no-repeat 5px 9px}.in-widget-title{color:#606060}.deleting .widget-title *{color:#aaa}.imgedit-menu div{border-color:#d5d5d5;background-color:#f1f1f1}.imgedit-menu div:hover{border-color:#c1c1c1;background-color:#eaeaea}.imgedit-menu div.disabled{border-color:#ccc;background-color:#ddd;filter:alpha(opacity=50);opacity:.5}#dashboard_recent_comments div.undo{border-top-color:#dfdfdf}.comment-ays,.comment-ays th{border-color:#ddd}.comment-ays th{background-color:#f1f1f1}#menu-management .menu-edit{border-color:#dfdfdf}#post-body{background:#fff;border-top-color:#fff;border-bottom-color:#dfdfdf}#nav-menu-header{border-bottom-color:#dfdfdf}#nav-menu-footer{border-top-color:#fff}#menu-management .nav-tabs-arrow a{color:#c1c1c1}#menu-management .nav-tabs-arrow a:hover{color:#d54e21}#menu-management .nav-tabs-arrow a:active{color:#464646}#menu-management .nav-tab-active{border-color:#dfdfdf}#menu-management .nav-tab{background:#fbfbfb;border-color:#dfdfdf}.js .input-with-default-title{color:#aaa}#cancel-save{color:#f00}#cancel-save:hover{background-color:#f00;color:#fff}.list-container,.menu-item-handle{border-color:#dfdfdf}.menu li.deleting .menu-item-handle{background-color:#f66;text-shadow:#ccc}.item-type{color:#999}.item-controls .menu-item-delete:hover{color:#f00}.nav-menus-php .item-edit{background:transparent url(../images/arrows.png) no-repeat 8px 10px;border-bottom-color:#eee}.nav-menus-php .item-edit:hover{background:transparent url(../images/arrows-dark.png) no-repeat 8px 10px}.menu-item-settings{border-color:#dfdfdf}.link-to-original{color:#777;border-color:#dfdfdf}#cancel-save:hover{color:#fff!important}#update-menu-item{color:#fff!important}#update-menu-item:hover,#update-menu-item:active,#update-menu-item:focus{color:#eaf2fa!important;border-color:#13455b!important}.submitbox .submitcancel{color:#21759b;border-bottom-color:#21759b}.submitbox .submitcancel:hover{background:#21759b;color:#fff}.nav-tab{border-color:#dfdfdf #dfdfdf #fff}.nav-tab:hover,.nav-tab-active{border-color:#ccc #ccc #fff}h2.nav-tab-wrapper,h3.nav-tab-wrapper{border-bottom-color:#ccc}#menu-management .nav-tab-active,.menu-item-handle,.menu-item-settings{-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}#menu-management .nav-tab-active{background:#f9f9f9;border-bottom-color:#f9f9f9}#upload-form label{color:#777}.about-wrap h1{color:#333;text-shadow:1px 1px 1px #fff}.about-text{color:#777}.wp-badge{color:#fff;text-shadow:0 -1px 0 rgba(22,57,81,0.3)}.about-wrap h2 .nav-tab{color:#21759b}.about-wrap h2 .nav-tab:hover{color:#d54e21}.about-wrap h2 .nav-tab-active,.about-wrap h2 .nav-tab-active:hover{color:#333}.about-wrap h2 .nav-tab-active{text-shadow:1px 1px 1px #fff;color:#464646}.about-wrap h3{color:#333;text-shadow:1px 1px 1px #fff}.about-wrap .feature-section h4{color:#464646}.about-wrap .feature-section img{background:#fff;border:1px #ccc solid;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.3);box-shadow:0 1px 3px rgba(0,0,0,0.3)}.about-wrap h4.wp-people-group{text-shadow:1px 1px 1px #fff}.about-wrap .point-releases{border-bottom:1px solid #dfdfdf}.about-wrap .point-releases h3{border-top:1px solid #dfdfdf}.about-wrap .point-releases h3:first-child{border:0}.about-wrap li.wp-person img.gravatar{-webkit-box-shadow:0 0 4px rgba(0,0,0,0.4);box-shadow:0 0 4px rgba(0,0,0,0.4)}.about-wrap li.wp-person .title{color:#464646;text-shadow:1px 1px 1px #fff}.freedoms-php .about-wrap ol li{color:#999}.freedoms-php .about-wrap ol p{color:#464646}.rtl .bar{border-right-color:transparent;border-left-color:#99d}.rtl #screen-meta-links a.show-settings{background-position:left 3px}.rtl #screen-meta-links a.show-settings.screen-meta-active{background-position:left -33px}.rtl #adminmenushadow,.rtl #adminmenuback{background-image:url(../images/menu-shadow-rtl.png);background-position:top left}.rtl #adminmenu .wp-submenu .wp-submenu-head{border-right-color:transparent;border-left-color:#dfdfdf}.rtl #adminmenu .wp-submenu,.rtl.folded #adminmenu .wp-has-current-submenu .wp-submenu{-webkit-box-shadow:-2px 2px 5px rgba(0,0,0,0.4);box-shadow:-2px 2px 5px rgba(0,0,0,0.4)}.rtl #adminmenu .wp-has-current-submenu .wp-submenu{-webkit-box-shadow:none;box-shadow:none}.rtl #collapse-button div{background-position:0 -108px}.rtl.folded #collapse-button div{background-position:0 -72px}@media only screen and (max-width:900px){.rtl.auto-fold #adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.rtl.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu{-webkit-box-shadow:-2px 2px 5px rgba(0,0,0,0.4);box-shadow:-2px 2px 5px rgba(0,0,0,0.4)}.rtl.auto-fold #collapse-button div{background-position:0 -72px}}.js.rtl .meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/arrows.png) no-repeat 6px 7px}.rtl #post-body .misc-pub-section{border-right-color:transparent;border-left-color:#eee}.js.rtl .sidebar-name-arrow{background:transparent url(../images/arrows.png) no-repeat 5px 9px}.js.rtl .sidebar-name:hover .sidebar-name-arrow{background:transparent url(../images/arrows-dark.png) no-repeat 5px 9px}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.curtime #timestamp{background-image:url("../images/date-button-2x.gif?ver=20120916");background-size:16px auto}.tagchecklist span a,#bulk-titles div a,.tagchecklist span a:hover,#bulk-titles div a:hover{background-image:url("../images/xit-2x.gif?ver=20120916");background-size:20px auto}#screen-meta-links a.show-settings,#screen-meta-links a.show-settings.screen-meta-active,#adminmenu .wp-has-submenu:hover .wp-menu-toggle,#adminmenu .wp-menu-open .wp-menu-toggle,#collapse-button div,.nav-menus-php .item-edit,.js .meta-box-sortables .postbox:hover .handlediv,.sidebar-name-arrow,.rtl #adminmenu .wp-has-submenu:hover .wp-menu-toggle,.rtl #adminmenu .wp-menu-open .wp-menu-toggle,.js.rtl .meta-box-sortables .postbox:hover .handlediv,.rtl .sidebar-name-arrow{background-image:url("../images/arrows-2x.png?ver=20120916");background-size:15px 123px}#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle,.sidebar-name:hover .sidebar-name-arrow,.nav-menus-php .item-edit:hover,.rtl #adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,.rtl #adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle,.rtl .sidebar-name:hover .sidebar-name-arrow{background-image:url("../images/arrows-dark-2x.png?ver=20120916");background-size:15px 123px}.view-switch #view-switch-list,.view-switch #view-switch-excerpt{background-image:url("../images/list-2x.png?ver=20120916");background-size:80px 20px}.icon32.icon-post,#icon-edit,#icon-post,.icon32.icon-dashboard,#icon-index,.icon32.icon-media,#icon-upload,.icon32.icon-links,#icon-link-manager,#icon-link,#icon-link-category,.icon32.icon-page,#icon-edit-pages,#icon-page,.icon32.icon-comments,#icon-edit-comments,.icon32.icon-appearance,#icon-themes,.icon32.icon-plugins,#icon-plugins,.icon32.icon-users,#icon-users,#icon-profile,#icon-user-edit,.icon32.icon-tools,#icon-tools,#icon-admin,.icon32.icon-settings,#icon-options-general,.icon32.icon-site,#icon-ms-admin,.icon32.icon-generic,#icon-generic{background-image:url(../images/icons32-2x.png?ver=20121105);background-size:756px 45px}.icon16.icon-dashboard,.menu-icon-dashboard div.wp-menu-image,.icon16.icon-post,.menu-icon-post div.wp-menu-image,.icon16.icon-media,.menu-icon-media div.wp-menu-image,.icon16.icon-links,.menu-icon-links div.wp-menu-image,.icon16.icon-page,.menu-icon-page div.wp-menu-image,.icon16.icon-comments,.menu-icon-comments div.wp-menu-image,.icon16.icon-appearance,.menu-icon-appearance div.wp-menu-image,.icon16.icon-plugins,.menu-icon-plugins div.wp-menu-image,.icon16.icon-users,.menu-icon-users div.wp-menu-image,.icon16.icon-tools,.menu-icon-tools div.wp-menu-image,.icon16.icon-settings,.menu-icon-settings div.wp-menu-image,.icon16.icon-site,.menu-icon-site div.wp-menu-image,.icon16.icon-generic,.menu-icon-generic div.wp-menu-image{background-image:url('../images/menu-2x.png?ver=20121105');background-size:390px 64px}#header-logo{background-image:url('../images/wp-logo-2x.png?ver=20120916');background-size:16px auto}}
\ No newline at end of file
+.find-box-search,.find-box-buttons{background-color:#f7f7f7;border-top:1px solid #ddd}.find-box{background-color:#444}.find-box-head{color:#eee}.find-box-inside{background-color:#fff}a.page-numbers:hover{border-color:#999}body,#wpbody,.form-table .pre,.ui-autocomplete li a{color:#333}body>#upload-menu{border-bottom-color:#fff}#postcustomstuff table,#your-profile fieldset,#rightnow,div.dashboard-widget,#dashboard-widgets p.dashboard-widget-links{border-color:#ccc}#poststuff .inside label.spam,#poststuff .inside label.deleted{color:red}#poststuff .inside label.waiting{color:orange}#poststuff .inside label.approved{color:green}#postcustomstuff table{border-color:#dfdfdf;background-color:#f9f9f9}#postcustomstuff thead th{background-color:#f1f1f1}table.widefat{border-color:#dfdfdf;background-color:#f9f9f9}div.dashboard-widget-error{background-color:#c43}div.dashboard-widget-notice{background-color:#cfe1ef}div.dashboard-widget-submit{border-top-color:#ccc}ul.category-tabs li{border-color:transparent}div.tabs-panel,.wp-tab-panel,ul.add-menu-item-tabs li.tabs,.wp-tab-active{border-color:#dfdfdf;background-color:#fff}ul.category-tabs li.tabs{border-color:#dfdfdf #dfdfdf #fff}ul.category-tabs li.tabs,ul.add-menu-item-tabs li.tabs,.wp-tab-active{background-color:#fff}kbd,code{background:#eaeaea}textarea,input[type="text"],input[type="password"],input[type="file"],input[type="email"],input[type="number"],input[type="search"],input[type="tel"],input[type="url"],select{border-color:#dfdfdf}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="file"]:focus,input[type="email"]:focus,input[type="number"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="url"]:focus,select:focus{border-color:#aaa}input.disabled,textarea.disabled{background-color:#ccc}#plugin-information .action-button a,#plugin-information .action-button a:hover,#plugin-information .action-button a:visited{color:#fff}.revisions-meta,.widget .widget-top,.postbox h3,.stuffbox h3,.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small,.sidebar-name,#nav-menu-header,#nav-menu-footer,.menu-item-handle{background:#f1f1f1;background-image:-webkit-gradient(linear,left bottom,left top,from(#ececec),to(#f9f9f9));background-image:-webkit-linear-gradient(bottom,#ececec,#f9f9f9);background-image:-moz-linear-gradient(bottom,#ececec,#f9f9f9);background-image:-o-linear-gradient(bottom,#ececec,#f9f9f9);background-image:linear-gradient(to top,#ececec,#f9f9f9)}.widget .widget-top,.postbox h3,.stuffbox h3{border-bottom-color:#dfdfdf;text-shadow:#fff 0 1px 0;-webkit-box-shadow:0 1px 0 #fff;box-shadow:0 1px 0 #fff}.form-table th,.form-wrap label{color:#222;text-shadow:#fff 0 1px 0}.description,.form-wrap p{color:#666}strong .post-com-count span{background-color:#21759b}.sorthelper{background-color:#ccf3fa}.ac_match,.subsubsub a.current{color:#000}.wrap h2{color:#464646}.wrap .add-new-h2,.wrap .add-new-h2:active{background:#f1f1f1}.subtitle{color:#777}.ac_over{background-color:#f0f0b8}.ac_results{background-color:#fff;border-color:#808080}.ac_results li{color:#101010}.alternate,.alt{background-color:#fcfcfc}.available-theme a.screenshot{background-color:#f1f1f1;border-color:#ddd}#current-theme{border-bottom-color:#dfdfdf}.bar{background-color:#e8e8e8;border-right-color:#99d}#media-upload,#media-upload .media-item .slidetoggle{background:#fff}#media-upload .slidetoggle{border-top-color:#dfdfdf}div.error,.login #login_error{background-color:#ffebe8;border-color:#c00}div.error a{color:#c00}.form-invalid{background-color:#ffebe8!important}.form-invalid input,.form-invalid select{border-color:#c00!important}.submit,#commentsdiv #add-new-comment{border-color:#dfdfdf}.highlight{background-color:#e4f2fd;color:#000}.howto,.nonessential,#edit-slug-box,.form-input-tip,.subsubsub{color:#666}.media-upload-form label.form-help,td.help{color:#9a9a9a}.ui-autocomplete{border-color:#aaa;background-color:#efefef}.ui-autocomplete li a.ui-state-focus{background-color:#ddd}.post-com-count{color:#fff}.post-com-count span{background-color:#bbb;color:#fff}.post-com-count:hover span{background-color:#d54e21}.quicktags,.search{background-color:#ccc;color:#000}.side-info h5{border-bottom-color:#dadada}.side-info ul{color:#666}a:hover,a:active{color:#d54e21}a:focus{color:#124964}#adminmenu a:hover,#adminmenu li.menu-top>a:focus,#adminmenu .wp-submenu a:hover,#the-comment-list .comment a:hover,#rightnow a:hover,#media-upload a.del-link:hover,div.dashboard-widget-submit input:hover,.subsubsub a:hover,.subsubsub a.current:hover,.ui-tabs-nav a:hover,.plugins .inactive a:hover,#all-plugins-table .plugins .inactive a:hover,#search-plugins-table .plugins .inactive a:hover{color:#d54e21}#the-comment-list .comment-item,#dashboard-widgets #dashboard_quick_press form p.submit{border-color:#dfdfdf}#side-sortables .category-tabs .tabs a,#side-sortables .add-menu-item-tabs .tabs a,.wp-tab-bar .wp-tab-active a{color:#333}#rightnow .rbutton{background-color:#ebebeb;color:#264761}#dashboard_right_now .table_content,#dashboard_right_now .table_discussion{border-top-color:#ececec}.submitbox .submit{background-color:#464646;color:#ccc}.plugins a.delete:hover,#all-plugins-table .plugins a.delete:hover,#search-plugins-table .plugins a.delete:hover,.submitbox .submitdelete{color:#f00;border-bottom-color:#f00}.submitbox .submitdelete:hover,#media-items a.delete:hover,#media-items a.delete-permanently:hover,#nav-menu-footer .menu-delete:hover{color:#fff;background-color:#f00;border-bottom-color:#f00}#normal-sortables .submitbox .submitdelete:hover{color:#000;background-color:#f00;border-bottom-color:#f00}.tablenav .dots{border-color:transparent}.tablenav .next,.tablenav .prev{border-color:transparent;color:#21759b}.tablenav .next:hover,.tablenav .prev:hover{border-color:transparent;color:#d54e21}div.updated,.login .message{background-color:#ffffe0;border-color:#e6db55}.update-message{color:#000}a.page-numbers{border-bottom-color:#b8d3e2}.commentlist li{border-bottom-color:#ccc}.widefat td,.widefat th{border-top-color:#fff;border-bottom-color:#dfdfdf}.widefat th{text-shadow:rgba(255,255,255,0.8) 0 1px 0}.widefat td{color:#555}.widefat p,.widefat ol,.widefat ul{color:#333}.widefat thead tr th,.widefat tfoot tr th,h3.dashboard-widget-title,h3.dashboard-widget-title span,h3.dashboard-widget-title small{color:#333}th.sortable a:hover,th.sortable a:active,th.sortable a:focus{color:#333}th.sortable a:focus{background:#e1e1e1;background-image:-webkit-gradient(linear,left bottom,left top,from(#dcdcdc),to(#e9e9e9));background-image:-webkit-linear-gradient(bottom,#dcdcdc,#e9e9e9);background-image:-moz-linear-gradient(bottom,#dcdcdc,#e9e9e9);background-image:-o-linear-gradient(bottom,#dcdcdc,#e9e9e9);background-image:linear-gradient(to top,#dcdcdc,#e9e9e9)}h3.dashboard-widget-title small a{color:#d7d7d7}h3.dashboard-widget-title small a:hover{color:#fff}a,#adminmenu a,#the-comment-list p.comment-author strong a,#media-upload a.del-link,#media-items a.delete,#media-items a.delete-permanently,.plugins a.delete,.ui-tabs-nav a{color:#21759b}#adminmenu .awaiting-mod,#adminmenu .update-plugins,#sidemenu a .update-plugins,#rightnow .reallynow{background-color:#464646;color:#fff;-webkit-box-shadow:rgba(255,255,255,0.5) 0 1px 0;box-shadow:rgba(255,255,255,0.5) 0 1px 0}#plugin-information .action-button{background-color:#d54e21;color:#fff}#adminmenu li.current a .awaiting-mod,#adminmenu li a.wp-has-current-submenu .update-plugins{background-color:#464646;color:#fff;-webkit-box-shadow:rgba(255,255,255,0.5) 0 1px 0;box-shadow:rgba(255,255,255,0.5) 0 1px 0}div#media-upload-header,div#plugin-information-header{background-color:#f9f9f9;border-bottom-color:#dfdfdf}#currenttheme img{border-color:#666}#dashboard_secondary div.dashboard-widget-content ul li a{background-color:#f9f9f9}input.readonly,textarea.readonly{background-color:#ddd}#editable-post-name{background-color:#fffbcc}#edit-slug-box strong,.tablenav .displaying-num,#submitted-on,.submitted-on{color:#777}.login #nav a,.login #backtoblog a{color:#21759b!important}.login #nav a:hover,.login #backtoblog a:hover{color:#d54e21!important}#wpfooter{color:#777;border-color:#dfdfdf}.imgedit-group,#media-items .media-item,.media-item .describe{border-color:#dfdfdf}.checkbox,.side-info,.plugins tr,#your-profile #rich_editing{background-color:#fcfcfc}.plugins .inactive,.plugins .inactive th,.plugins .inactive td,tr.inactive+tr.plugin-update-tr .plugin-update{background-color:#f4f4f4}.plugin-update-tr .update-message{background-color:#fffbe4;border-color:#dfdfdf}.plugins .active,.plugins .active th,.plugins .active td{color:#000}.plugins .inactive a{color:#579}#the-comment-list tr.undo,#the-comment-list div.undo{background-color:#f4f4f4}#the-comment-list .unapproved{background-color:#ffffe0}#the-comment-list .approve a{color:#006505}#the-comment-list .unapprove a{color:#d98500}table.widefat span.delete a,table.widefat span.trash a,table.widefat span.spam a,#dashboard_recent_comments .delete a,#dashboard_recent_comments .trash a,#dashboard_recent_comments .spam a{color:#bc0b0b}.welcome-panel{background:#f5f5f5;background-image:-webkit-gradient(linear,left bottom,left top,from(#f5f5f5),to(#fafafa));background-image:-webkit-linear-gradient(bottom,#f5f5f5,#fafafa);background-image:-moz-linear-gradient(bottom,#f5f5f5,#fafafa);background-image:-o-linear-gradient(bottom,#f5f5f5,#fafafa);background-image:linear-gradient(to top,#f5f5f5,#fafafa);border-color:#dfdfdf}.welcome-panel p{color:#777}.welcome-panel-column p{color:#464646}.welcome-panel h3{text-shadow:1px 1px 1px #fff}.widget,#widget-list .widget-top,.postbox,#titlediv,#poststuff .postarea,.stuffbox{border-color:#dfdfdf;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff;-webkit-border-radius:3px;border-radius:3px}.widget,#widget-list .widget-top,.postbox,.menu-item-settings{background:#f5f5f5;background-image:-webkit-gradient(linear,left bottom,left top,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(bottom,#f5f5f5,#f9f9f9);background-image:-moz-linear-gradient(bottom,#f5f5f5,#f9f9f9);background-image:-o-linear-gradient(bottom,#f5f5f5,#f9f9f9);background-image:linear-gradient(to top,#f5f5f5,#f9f9f9)}.postbox h3{color:#464646}.widget .widget-top{color:#222}.js .sidebar-name:hover h3,.js .postbox h3:hover{color:#000}.curtime #timestamp{background-image:url(../images/date-button.gif)}#rightnow .youhave{background-color:#f0f6fb}#rightnow a{color:#448abd}.tagchecklist span a,#bulk-titles div a{background:url(../images/xit.gif) no-repeat}.tagchecklist span a:hover,#bulk-titles div a:hover{background:url(../images/xit.gif) no-repeat -10px 0}#update-nag,.update-nag{background-color:#fffbcc;border-color:#e6db55;color:#555}#screen-meta{background-color:#f1f1f1;border-color:#ccc;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.05);box-shadow:0 1px 3px rgba(0,0,0,0.05)}#contextual-help-back{background:#fff}.contextual-help-tabs a:hover{color:#333}#contextual-help-back,.contextual-help-tabs .active{border-color:#ccc}.contextual-help-tabs .active,.contextual-help-tabs .active a,.contextual-help-tabs .active a:hover{background:#fff;color:#333}#screen-options-link-wrap,#contextual-help-link-wrap{border-right:1px solid #ccc;border-left:1px solid #ccc;border-bottom:1px solid #ccc;background:#e3e3e3;background-image:-webkit-gradient(linear,left bottom,left top,from(#dfdfdf),to(#f1f1f1));background-image:-webkit-linear-gradient(bottom,#dfdfdf,#f1f1f1);background-image:-moz-linear-gradient(bottom,#dfdfdf,#f1f1f1);background-image:-o-linear-gradient(bottom,#dfdfdf,#f1f1f1);background-image:linear-gradient(to top,#dfdfdf,#f1f1f1)}#screen-meta-links a{color:#777;background:transparent url(../images/arrows.png) no-repeat right 4px}#screen-meta-links a:hover,#screen-meta-links a:active{color:#333;background-color:transparent}#screen-meta-links a.screen-meta-active{background-position:right -31px}.login #backtoblog a{color:#464646}#wphead{border-bottom:#dfdfdf 1px solid}#wphead h1 a{color:#464646}#wpfooter a:link,#wpfooter a:visited{text-decoration:none}#wpfooter a:hover{text-decoration:underline}.file-error,abbr.required,.widget-control-remove:hover,table.widefat .delete a:hover,table.widefat .trash a:hover,table.widefat .spam a:hover,#dashboard_recent_comments .delete a:hover,#dashboard_recent_comments .trash a:hover #dashboard_recent_comments .spam a:hover{color:#f00}#pass-strength-result{background-color:#eee;border-color:#ddd!important}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important}#post-status-info{border-color:#dfdfdf #ccc #ccc;background-color:#eaeaea}.editwidget .widget-inside{border-color:#dfdfdf}#titlediv #title{background-color:#fff}#tTips p#tTips_inside{background-color:#ddd;color:#333}#poststuff .inside .the-tagcloud{border-color:#ddd}#adminmenuback,#adminmenuwrap{background-color:#ececec;border-color:#ccc}#adminmenushadow,#adminmenuback{background-image:url(../images/menu-shadow.png);background-position:top right;background-repeat:repeat-y}#adminmenu li.wp-menu-separator{background:#dfdfdf;border-color:#cfcfcf}#adminmenu div.separator{border-color:#e1e1e1}#adminmenu a.menu-top,#adminmenu .wp-submenu .wp-submenu-head{border-top-color:#f9f9f9;border-bottom-color:#dfdfdf}#adminmenu li.wp-menu-open{border-color:#dfdfdf}#adminmenu li.menu-top:hover,#adminmenu li.opensub>a.menu-top,#adminmenu li>a.menu-top:focus{background-color:#e4e4e4;color:#d54e21;text-shadow:0 1px 0 rgba(255,255,255,0.4)}#adminmenu li.menu-top:hover>a span,#adminmenu li.menu-top>a:focus span{text-shadow:none}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu li.current a.menu-top,.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.current.menu-top,#adminmenu .wp-menu-arrow,#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{background:#777;background-image:-webkit-gradient(linear,left bottom,left top,from(#6d6d6d),to(#808080));background-image:-webkit-linear-gradient(bottom,#6d6d6d,#808080);background-image:-moz-linear-gradient(bottom,#6d6d6d,#808080);background-image:-o-linear-gradient(bottom,#6d6d6d,#808080);background-image:linear-gradient(to top,#6d6d6d,#808080)}#adminmenu .wp-menu-arrow div{background:#777;background-image:-webkit-gradient(linear,right bottom,left top,from(#6d6d6d),to(#808080));background-image:-webkit-linear-gradient(bottom right,#6d6d6d,#808080);background-image:-moz-linear-gradient(bottom right,#6d6d6d,#808080);background-image:-o-linear-gradient(bottom right,#6d6d6d,#808080);background-image:linear-gradient(to top left,#6d6d6d,#808080)}#adminmenu li.wp-not-current-submenu .wp-menu-arrow{border-top-color:#f9f9f9;border-bottom-color:#dfdfdf;background:#e4e4e4}#adminmenu li.wp-not-current-submenu .wp-menu-arrow div{background:#e4e4e4;border-color:#ccc}.folded #adminmenu li.menu-top li:hover a{background-image:none}#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,#adminmenu li.current a.menu-top,#adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head{text-shadow:0 -1px 0 #333;color:#fff;border-top-color:#808080;border-bottom-color:#6d6d6d}.folded #adminmenu li.wp-has-current-submenu,.folded #adminmenu li.current.menu-top{border-top-color:#808080;border-bottom-color:#6d6d6d}#adminmenu .wp-submenu a:hover,#adminmenu .wp-submenu a:focus{background-color:#eaf2fa;color:#333}#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover{color:#333}#adminmenu .wp-submenu,.folded #adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{background-color:#fff;border-color:#dfdfdf;-webkit-box-shadow:2px 3px 6px rgba(0,0,0,0.4);box-shadow:2px 3px 6px rgba(0,0,0,0.4)}#adminmenu .wp-submenu .wp-submenu-head{background-color:#e4e4e4;color:#333}#collapse-menu{color:#aaa;border-top-color:#f9f9f9}#collapse-menu:hover{color:#999}#collapse-button{border-color:#ccc;background:#f4f4f4;background-image:-webkit-gradient(linear,left bottom,left top,from(#dfdfdf),to(#fff));background-image:-webkit-linear-gradient(bottom,#dfdfdf,#fff);background-image:-moz-linear-gradient(bottom,#dfdfdf,#fff);background-image:-o-linear-gradient(bottom,#dfdfdf,#fff);background-image:linear-gradient(to top,#dfdfdf,#fff)}#collapse-menu:hover #collapse-button{border-color:#aaa}#collapse-button div{background:transparent url(../images/arrows.png) no-repeat 0 -72px}.folded #collapse-button div{background-position:0 -108px}@media only screen and (max-width:900px){.auto-fold #adminmenu li.wp-has-current-submenu,.auto-fold #adminmenu li.current.menu-top{background-color:#777;background-image:-webkit-gradient(linear,left bottom,left top,from(#6d6d6d),to(#808080));background-image:-webkit-linear-gradient(bottom,#6d6d6d,#808080);background-image:-moz-linear-gradient(bottom,#6d6d6d,#808080);background-image:-o-linear-gradient(bottom,#6d6d6d,#808080);background-image:linear-gradient(bottom,#6d6d6d,#808080)}.auto-fold #adminmenu li.wp-has-current-submenu,.auto-fold #adminmenu li.current.menu-top{border-top-color:#808080;border-bottom-color:#6d6d6d}.auto-fold #adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu{background-color:#fff;border-color:#dfdfdf;-webkit-box-shadow:2px 3px 6px rgba(0,0,0,0.4);box-shadow:2px 3px 6px rgba(0,0,0,0.4)}.auto-fold #collapse-button div{background-position:0 -108px}}.icon16,.icon32,div.wp-menu-image{background-color:transparent;background-repeat:no-repeat}.icon16.icon-dashboard,.menu-icon-dashboard div.wp-menu-image,.icon16.icon-post,.menu-icon-post div.wp-menu-image,.icon16.icon-media,.menu-icon-media div.wp-menu-image,.icon16.icon-links,.menu-icon-links div.wp-menu-image,.icon16.icon-page,.menu-icon-page div.wp-menu-image,.icon16.icon-comments,.menu-icon-comments div.wp-menu-image,.icon16.icon-appearance,.menu-icon-appearance div.wp-menu-image,.icon16.icon-plugins,.menu-icon-plugins div.wp-menu-image,.icon16.icon-users,.menu-icon-users div.wp-menu-image,.icon16.icon-tools,.menu-icon-tools div.wp-menu-image,.icon16.icon-settings,.menu-icon-settings div.wp-menu-image,.icon16.icon-site,.menu-icon-site div.wp-menu-image,.icon16.icon-generic,.menu-icon-generic div.wp-menu-image{background-image:url(../images/menu.png?ver=20121105)}.icon16.icon-dashboard,#adminmenu .menu-icon-dashboard div.wp-menu-image{background-position:-59px -33px}#adminmenu .menu-icon-dashboard:hover div.wp-menu-image,#adminmenu .menu-icon-dashboard.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-dashboard.current div.wp-menu-image{background-position:-59px -1px}.icon16.icon-post,#adminmenu .menu-icon-post div.wp-menu-image{background-position:-269px -33px}#adminmenu .menu-icon-post:hover div.wp-menu-image,#adminmenu .menu-icon-post.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-post.current div.wp-menu-image{background-position:-269px -1px}.icon16.icon-media,#adminmenu .menu-icon-media div.wp-menu-image{background-position:-119px -33px}#adminmenu .menu-icon-media:hover div.wp-menu-image,#adminmenu .menu-icon-media.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-media.current div.wp-menu-image{background-position:-119px -1px}.icon16.icon-links,#adminmenu .menu-icon-links div.wp-menu-image{background-position:-89px -33px}#adminmenu .menu-icon-links:hover div.wp-menu-image,#adminmenu .menu-icon-links.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-links.current div.wp-menu-image{background-position:-89px -1px}.icon16.icon-page,#adminmenu .menu-icon-page div.wp-menu-image{background-position:-149px -33px}#adminmenu .menu-icon-page:hover div.wp-menu-image,#adminmenu .menu-icon-page.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-page.current div.wp-menu-image{background-position:-149px -1px}.icon16.icon-comments,#adminmenu .menu-icon-comments div.wp-menu-image{background-position:-29px -33px}#adminmenu .menu-icon-comments:hover div.wp-menu-image,#adminmenu .menu-icon-comments.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-comments.current div.wp-menu-image{background-position:-29px -1px}.icon16.icon-appearance,#adminmenu .menu-icon-appearance div.wp-menu-image{background-position:1px -33px}#adminmenu .menu-icon-appearance:hover div.wp-menu-image,#adminmenu .menu-icon-appearance.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-appearance.current div.wp-menu-image{background-position:1px -1px}.icon16.icon-plugins,#adminmenu .menu-icon-plugins div.wp-menu-image{background-position:-179px -33px}#adminmenu .menu-icon-plugins:hover div.wp-menu-image,#adminmenu .menu-icon-plugins.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-plugins.current div.wp-menu-image{background-position:-179px -1px}.icon16.icon-users,#adminmenu .menu-icon-users div.wp-menu-image{background-position:-300px -33px}#adminmenu .menu-icon-users:hover div.wp-menu-image,#adminmenu .menu-icon-users.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-users.current div.wp-menu-image{background-position:-300px -1px}.icon16.icon-tools,#adminmenu .menu-icon-tools div.wp-menu-image{background-position:-209px -33px}#adminmenu .menu-icon-tools:hover div.wp-menu-image,#adminmenu .menu-icon-tools.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-tools.current div.wp-menu-image{background-position:-209px -1px}.icon16.icon-settings,#adminmenu .menu-icon-settings div.wp-menu-image{background-position:-239px -33px}#adminmenu .menu-icon-settings:hover div.wp-menu-image,#adminmenu .menu-icon-settings.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-settings.current div.wp-menu-image{background-position:-239px -1px}.icon16.icon-site,#adminmenu .menu-icon-site div.wp-menu-image{background-position:-359px -33px}#adminmenu .menu-icon-site:hover div.wp-menu-image,#adminmenu .menu-icon-site.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-site.current div.wp-menu-image{background-position:-359px -1px}.icon16.icon-generic,#adminmenu .menu-icon-generic div.wp-menu-image{background-position:-330px -33px}#adminmenu .menu-icon-generic:hover div.wp-menu-image,#adminmenu .menu-icon-generic.wp-has-current-submenu div.wp-menu-image,#adminmenu .menu-icon-generic.current div.wp-menu-image{background-position:-330px -1px}.icon32.icon-post,#icon-edit,#icon-post,.icon32.icon-dashboard,#icon-index,.icon32.icon-media,#icon-upload,.icon32.icon-links,#icon-link-manager,#icon-link,#icon-link-category,.icon32.icon-page,#icon-edit-pages,#icon-page,.icon32.icon-comments,#icon-edit-comments,.icon32.icon-appearance,#icon-themes,.icon32.icon-plugins,#icon-plugins,.icon32.icon-users,#icon-users,#icon-profile,#icon-user-edit,.icon32.icon-tools,#icon-tools,#icon-admin,.icon32.icon-settings,#icon-options-general,.icon32.icon-site,#icon-ms-admin,.icon32.icon-generic,#icon-generic{background-image:url(../images/icons32.png?ver=20121105)}.icon32.icon-post,#icon-edit,#icon-post{background-position:-552px -5px}.icon32.icon-dashboard,#icon-index{background-position:-137px -5px}.icon32.icon-media,#icon-upload{background-position:-251px -5px}.icon32.icon-links,#icon-link-manager,#icon-link,#icon-link-category{background-position:-190px -5px}.icon32.icon-page,#icon-edit-pages,#icon-page{background-position:-312px -5px}.icon32.icon-comments,#icon-edit-comments{background-position:-72px -5px}.icon32.icon-appearance,#icon-themes{background-position:-11px -5px}.icon32.icon-plugins,#icon-plugins{background-position:-370px -5px}.icon32.icon-users,#icon-users,#icon-profile,#icon-user-edit{background-position:-600px -5px}.icon32.icon-tools,#icon-tools,#icon-admin{background-position:-432px -5px}.icon32.icon-settings,#icon-options-general{background-position:-492px -5px}.icon32.icon-site,#icon-ms-admin{background-position:-659px -5px}.icon32.icon-generic,#icon-generic{background-position:-708px -5px}.post-format-icon{background:url(../images/post-formats.png) no-repeat}table.diff .diff-deletedline{background-color:#ffe9e9}table.diff .diff-deletedline del{background-color:#faa}table.diff .diff-addedline{background-color:#e9ffe9}table.diff .diff-addedline ins{background-color:#afa}.revisions-meta{border:1px solid #dfdfdf}.revisions-controls{background:#fff;background:-webkit-gradient(linear,left bottom,left top,color-stop(0%,rgba(255,255,255,1)),color-stop(30px,rgba(255,255,255,1)),color-stop(100%,rgba(255,255,255,1)));background:-webkit-linear-gradient(bottom,rgba(255,255,255,0) 0,rgba(255,255,255,1) 30px,rgba(255,255,255,1) 100%);background:-moz-linear-gradient(bottom,rgba(255,255,255,0) 0,rgba(255,255,255,1) 30px,rgba(255,255,255,1) 100%);background:-o-linear-gradient(bottom,rgba(255,255,255,0) 0,rgba(255,255,255,1) 30px,rgba(255,255,255,1) 100%);background:linear-gradient(to top,rgba(255,255,255,0) 0,rgba(255,255,255,1) 30px,rgba(255,255,255,1) 100%)}.revisions-tooltip,.revisions-tooltip-arrow span{border-color:#d7d7d7;background-color:#fff}.revisions-tickmarks>div{border-color:#aaa}.wp-slider.ui-slider{border-color:#d7d7d7}.wp-slider .ui-slider-handle{border-color:#ccc;border-radius:50%;background:#f4f4f4;background-image:-webkit-gradient(linear,left bottom,left top,from(#dfdfdf),to(#fff));background-image:-webkit-linear-gradient(bottom,#dfdfdf,#fff);background-image:-moz-linear-gradient(bottom,#dfdfdf,#fff);background-image:-o-linear-gradient(bottom,#dfdfdf,#fff);background-image:linear-gradient(to top,#dfdfdf,#fff);color:#333}.wp-slider .ui-slider-handle:hover,.wp-slider .ui-slider-handle:focus{border-color:#aaa}.wp-slider .ui-slider-handle.ui-state-hover,.wp-slider .ui-slider-handle.ui-state-focus{border-color:#aaa;outline:0}#sidemenu a{background-color:#f9f9f9;border-color:#f9f9f9;border-bottom-color:#dfdfdf}#sidemenu a.current{background-color:#fff;border-color:#dfdfdf #dfdfdf #fff;color:#d54e21}#replyerror{border-color:#ddd;background-color:#f9f9f9}.vim-current,.vim-current th,.vim-current td{background-color:#e4f2fd!important}#plugin-information .fyi ul{background-color:#eaf3fa}#plugin-information .fyi h2.mainheader{background-color:#cee1ef}#plugin-information pre,#plugin-information code{background-color:#ededff}#plugin-information pre{border:1px solid #ccc}#bulk-titles{border-color:#ddd}.inline-editor div.title{background-color:#eaf3fa}.inline-editor ul.cat-checklist{background-color:#fff;border-color:#ddd}.inline-editor .quick-edit-save{background-color:#f1f1f1}fieldset.inline-edit-col-right .inline-edit-col{border-color:#dfdfdf}.attention{color:#d54e21}.js .meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/arrows.png) no-repeat 6px 7px}.tablenav .tablenav-pages{color:#555}.tablenav .tablenav-pages a{border-color:#e3e3e3;background:#eee;-moz-box-shadow:inset 0 1px 0 #fff;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.tablenav .tablenav-pages a:hover,.tablenav .tablenav-pages a:focus{color:#d54e21}.tablenav .tablenav-pages a.disabled,.tablenav .tablenav-pages a.disabled:hover,.tablenav .tablenav-pages a.disabled:focus{color:#aaa}.tablenav .tablenav-pages .current{background:#dfdfdf;border-color:#d3d3d3}#availablethemes,#availablethemes td{border-color:#ddd}#current-theme img{border-color:#999}#TB_window #TB_title a.tb-theme-preview-link,#TB_window #TB_title a.tb-theme-preview-link:visited{color:#999}#TB_window #TB_title a.tb-theme-preview-link:hover,#TB_window #TB_title a.tb-theme-preview-link:focus{color:#ccc}.misc-pub-section{border-top-color:#fff;border-bottom-color:#dfdfdf}#minor-publishing{border-bottom-color:#dfdfdf}#post-body .misc-pub-section{border-left-color:#eee}.post-com-count span{background-color:#bbb}.form-table .color-palette td{border-color:#fff}.sortable-placeholder{border-color:#bbb;background-color:#f5f5f5}#post-body ul.category-tabs li.tabs a,#post-body ul.add-menu-item-tabs li.tabs a,body.press-this ul.category-tabs li.tabs a{color:#333}.view-switch #view-switch-list,.view-switch #view-switch-excerpt{background-color:transparent;background-image:url('../images/list.png');background-repeat:no-repeat}.view-switch #view-switch-list{background-position:0 0}.view-switch .current #view-switch-list{background-position:-40px 0}.view-switch #view-switch-excerpt{background-position:-20px 0}.view-switch .current #view-switch-excerpt{background-position:-60px 0}#header-logo{background:transparent url(../images/wp-logo.png?ver=20110504) no-repeat scroll center center}.popular-tags,.feature-filter{background-color:#fff;border-color:#dfdfdf}div.widgets-sortables,#widgets-left .inactive,#available-widgets .widget-holder{background-color:#fcfcfc;border-color:#dfdfdf}#available-widgets .widget-description{color:#555}.sidebar-name{color:#464646;text-shadow:#fff 0 1px 0;border-color:#dfdfdf;-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.js .sidebar-name:hover,.js #removing-widget{color:#d54e21}#removing-widget span{color:black}.js .sidebar-name-arrow{background:transparent url(../images/arrows.png) no-repeat 5px 9px}.js .sidebar-name:hover .sidebar-name-arrow{background:transparent url(../images/arrows-dark.png) no-repeat 5px 9px}.in-widget-title{color:#606060}.deleting .widget-title *{color:#aaa}.imgedit-menu div{border-color:#d5d5d5;background-color:#f1f1f1}.imgedit-menu div:hover{border-color:#c1c1c1;background-color:#eaeaea}.imgedit-menu div.disabled{border-color:#ccc;background-color:#ddd;filter:alpha(opacity=50);opacity:.5}#dashboard_recent_comments div.undo{border-top-color:#dfdfdf}.comment-ays,.comment-ays th{border-color:#ddd}.comment-ays th{background-color:#f1f1f1}#menu-management .menu-edit{border-color:#dfdfdf}#post-body{background:#fff;border-top-color:#fff;border-bottom-color:#dfdfdf}#nav-menu-header{border-bottom-color:#dfdfdf}#nav-menu-footer{border-top-color:#fff}#menu-management .nav-tabs-arrow a{color:#c1c1c1}#menu-management .nav-tabs-arrow a:hover{color:#d54e21}#menu-management .nav-tabs-arrow a:active{color:#464646}#menu-management .nav-tab-active{border-color:#dfdfdf}#menu-management .nav-tab{background:#fbfbfb;border-color:#dfdfdf}.js .input-with-default-title{color:#aaa}#cancel-save{color:#f00}#cancel-save:hover{background-color:#f00;color:#fff}.list-container,.menu-item-handle{border-color:#dfdfdf}.menu li.deleting .menu-item-handle{background-color:#f66;text-shadow:#ccc}.item-type{color:#999}.item-controls .menu-item-delete:hover{color:#f00}.nav-menus-php .item-edit{background:transparent url(../images/arrows.png) no-repeat 8px 10px;border-bottom-color:#eee}.nav-menus-php .item-edit:hover{background:transparent url(../images/arrows-dark.png) no-repeat 8px 10px}.menu-item-settings{border-color:#dfdfdf}.link-to-original{color:#777;border-color:#dfdfdf}#cancel-save:hover{color:#fff!important}#update-menu-item{color:#fff!important}#update-menu-item:hover,#update-menu-item:active,#update-menu-item:focus{color:#eaf2fa!important;border-color:#13455b!important}.submitbox .submitcancel{color:#21759b;border-bottom-color:#21759b}.submitbox .submitcancel:hover{background:#21759b;color:#fff}.manage-menus{border:1px solid #eee;background:#fbfbfb}.theme-location-set{color:#999}.nav-menus-php .delete-action a{color:#bc0b0b}.is-submenu{color:#999}.nav-tab{border-color:#dfdfdf #dfdfdf #fff}.nav-tab:hover,.nav-tab-active{border-color:#ccc #ccc #fff}h2.nav-tab-wrapper,h3.nav-tab-wrapper{border-bottom-color:#ccc}#menu-management .nav-tab-active,.menu-item-handle,.menu-item-settings{-webkit-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}#menu-management .nav-tab-active{background:#f9f9f9;border-bottom-color:#f9f9f9}#upload-form label{color:#777}.about-wrap h1{color:#333;text-shadow:1px 1px 1px #fff}.about-text{color:#777}.wp-badge{color:#fff;text-shadow:0 -1px 0 rgba(22,57,81,0.3)}.about-wrap h2 .nav-tab{color:#21759b}.about-wrap h2 .nav-tab:hover{color:#d54e21}.about-wrap h2 .nav-tab-active,.about-wrap h2 .nav-tab-active:hover{color:#333}.about-wrap h2 .nav-tab-active{text-shadow:1px 1px 1px #fff;color:#464646}.about-wrap h3{color:#333;text-shadow:1px 1px 1px #fff}.about-wrap .feature-section h4{color:#464646}.about-wrap .feature-section img{background:#fff;border:1px #ccc solid;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.3);box-shadow:0 1px 3px rgba(0,0,0,0.3)}.about-wrap h4.wp-people-group{text-shadow:1px 1px 1px #fff}.about-wrap .point-releases{border-bottom:1px solid #dfdfdf}.about-wrap .point-releases h3{border-top:1px solid #dfdfdf}.about-wrap .point-releases h3:first-child{border:0}.about-wrap li.wp-person img.gravatar{-webkit-box-shadow:0 0 4px rgba(0,0,0,0.4);box-shadow:0 0 4px rgba(0,0,0,0.4)}.about-wrap li.wp-person .title{color:#464646;text-shadow:1px 1px 1px #fff}.freedoms-php .about-wrap ol li{color:#999}.freedoms-php .about-wrap ol p{color:#464646}.rtl .bar{border-right-color:transparent;border-left-color:#99d}.rtl #screen-meta-links a.show-settings{background-position:left 3px}.rtl #screen-meta-links a.show-settings.screen-meta-active{background-position:left -33px}.rtl #adminmenushadow,.rtl #adminmenuback{background-image:url(../images/menu-shadow-rtl.png);background-position:top left}.rtl #adminmenu .wp-submenu .wp-submenu-head{border-right-color:transparent;border-left-color:#dfdfdf}.rtl #adminmenu .wp-submenu,.rtl.folded #adminmenu .wp-has-current-submenu .wp-submenu{-webkit-box-shadow:-2px 2px 5px rgba(0,0,0,0.4);box-shadow:-2px 2px 5px rgba(0,0,0,0.4)}.rtl #adminmenu .wp-has-current-submenu .wp-submenu{-webkit-box-shadow:none;box-shadow:none}.rtl #collapse-button div{background-position:0 -108px}.rtl.folded #collapse-button div{background-position:0 -72px}@media only screen and (max-width:900px){.rtl.auto-fold #adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.rtl.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu{-webkit-box-shadow:-2px 2px 5px rgba(0,0,0,0.4);box-shadow:-2px 2px 5px rgba(0,0,0,0.4)}.rtl.auto-fold #collapse-button div{background-position:0 -72px}}.js.rtl .meta-box-sortables .postbox:hover .handlediv{background:transparent url(../images/arrows.png) no-repeat 6px 7px}.rtl #post-body .misc-pub-section{border-right-color:transparent;border-left-color:#eee}.js.rtl .sidebar-name-arrow{background:transparent url(../images/arrows.png) no-repeat 5px 9px}.js.rtl .sidebar-name:hover .sidebar-name-arrow{background:transparent url(../images/arrows-dark.png) no-repeat 5px 9px}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.curtime #timestamp{background-image:url("../images/date-button-2x.gif?ver=20120916");background-size:16px auto}.tagchecklist span a,#bulk-titles div a,.tagchecklist span a:hover,#bulk-titles div a:hover{background-image:url("../images/xit-2x.gif?ver=20120916");background-size:20px auto}#screen-meta-links a.show-settings,#screen-meta-links a.show-settings.screen-meta-active,#adminmenu .wp-has-submenu:hover .wp-menu-toggle,#adminmenu .wp-menu-open .wp-menu-toggle,#collapse-button div,.nav-menus-php .item-edit,.js .meta-box-sortables .postbox:hover .handlediv,.sidebar-name-arrow,.rtl #adminmenu .wp-has-submenu:hover .wp-menu-toggle,.rtl #adminmenu .wp-menu-open .wp-menu-toggle,.js.rtl .meta-box-sortables .postbox:hover .handlediv,.rtl .sidebar-name-arrow{background-image:url("../images/arrows-2x.png?ver=20120916");background-size:15px 123px}#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle,.sidebar-name:hover .sidebar-name-arrow,.nav-menus-php .item-edit:hover,.rtl #adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle,.rtl #adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle,.rtl .sidebar-name:hover .sidebar-name-arrow{background-image:url("../images/arrows-dark-2x.png?ver=20120916");background-size:15px 123px}.view-switch #view-switch-list,.view-switch #view-switch-excerpt{background-image:url("../images/list-2x.png?ver=20120916");background-size:80px 20px}.icon32.icon-post,#icon-edit,#icon-post,.icon32.icon-dashboard,#icon-index,.icon32.icon-media,#icon-upload,.icon32.icon-links,#icon-link-manager,#icon-link,#icon-link-category,.icon32.icon-page,#icon-edit-pages,#icon-page,.icon32.icon-comments,#icon-edit-comments,.icon32.icon-appearance,#icon-themes,.icon32.icon-plugins,#icon-plugins,.icon32.icon-users,#icon-users,#icon-profile,#icon-user-edit,.icon32.icon-tools,#icon-tools,#icon-admin,.icon32.icon-settings,#icon-options-general,.icon32.icon-site,#icon-ms-admin,.icon32.icon-generic,#icon-generic{background-image:url(../images/icons32-2x.png?ver=20121105);background-size:756px 45px}.icon16.icon-dashboard,.menu-icon-dashboard div.wp-menu-image,.icon16.icon-post,.menu-icon-post div.wp-menu-image,.icon16.icon-media,.menu-icon-media div.wp-menu-image,.icon16.icon-links,.menu-icon-links div.wp-menu-image,.icon16.icon-page,.menu-icon-page div.wp-menu-image,.icon16.icon-comments,.menu-icon-comments div.wp-menu-image,.icon16.icon-appearance,.menu-icon-appearance div.wp-menu-image,.icon16.icon-plugins,.menu-icon-plugins div.wp-menu-image,.icon16.icon-users,.menu-icon-users div.wp-menu-image,.icon16.icon-tools,.menu-icon-tools div.wp-menu-image,.icon16.icon-settings,.menu-icon-settings div.wp-menu-image,.icon16.icon-site,.menu-icon-site div.wp-menu-image,.icon16.icon-generic,.menu-icon-generic div.wp-menu-image{background-image:url('../images/menu-2x.png?ver=20121105');background-size:390px 64px}#header-logo{background-image:url('../images/wp-logo-2x.png?ver=20120916');background-size:16px auto}.post-format-icon{background-image:url(../images/post-formats32.png);background-size:16px 304px}}
\ No newline at end of file
index de8fd8577b58359b25f1b59b3cf88e74734becee..236d85d8cef4ecf151673d0869d8c7fb95d7e1f8 100644 (file)
@@ -1,11 +1,3 @@
-.control-section .customize-section-title {
-       font-family: Tahoma, Arial, sans-serif;
-}
-.customize-section-title:after {
-       right: auto;
-       left: 20px;
-}
-
 #customize-header-actions .button-primary {
        float: left;
 }
 /*
  * Dropdowns
  */
-.customize-section .dropdown {
+.accordion-section .dropdown {
        float: right;
 }
 
-.customize-section .dropdown-content {
+.accordion-section .dropdown-content {
        float: right;
        margin-right: 0px;
        margin-left: 16px;
        margin-left: 5px;
 }
 
-.customize-section input[type="text"].color-picker-hex {
-       float: right;
+.accordion-section input[type="text"].color-picker-hex {
+       direction: ltr;
 }
 
 /*
  * Image Picker
  */
-.customize-section .customize-control-image .actions {
+.accordion-section .customize-control-image .actions {
        text-align: left;
 }
 
 .customize-control-image .library,
 .customize-control-image .actions,
-.customize-section .customize-control-image .library ul,
-.customize-section .customize-control-image .library li,
-.customize-section .customize-control-image .library-content {
+.accordion-section .customize-control-image .library ul,
+.accordion-section .customize-control-image .library li,
+.accordion-section .customize-control-image .library-content {
        float: right;
 }
index 374168e2ec36e779b70e8d0873442ac12ae19ed8..498d0ce19e4b925fd9fb8e605f5fb3f44a43b605 100644 (file)
@@ -1 +1 @@
-.control-section .customize-section-title{font-family:Tahoma,Arial,sans-serif}.customize-section-title:after{right:auto;left:20px}#customize-header-actions .button-primary{float:left}#customize-header-actions .spinner{float:left;margin-right:0;margin-left:4px}.customize-control{float:right}.customize-control-radio input,.customize-control-checkbox input{margin-right:0;margin-left:5px}.customize-section .dropdown{float:right}.customize-section .dropdown-content{float:right;margin-right:0;margin-left:16px;-webkit-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.customize-control .dropdown-arrow{right:auto;left:0;border-color:#ccc;border-style:solid;border-width:1px 0 1px 1px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.customize-control .dropdown-arrow:after{right:auto;left:4px}.customize-control-color .dropdown{margin-right:0;margin-left:5px}.customize-section input[type="text"].color-picker-hex{float:right}.customize-section .customize-control-image .actions{text-align:left}.customize-control-image .library,.customize-control-image .actions,.customize-section .customize-control-image .library ul,.customize-section .customize-control-image .library li,.customize-section .customize-control-image .library-content{float:right}
\ No newline at end of file
+#customize-header-actions .button-primary{float:left}#customize-header-actions .spinner{float:left;margin-right:0;margin-left:4px}.customize-control{float:right}.customize-control-radio input,.customize-control-checkbox input{margin-right:0;margin-left:5px}.accordion-section .dropdown{float:right}.accordion-section .dropdown-content{float:right;margin-right:0;margin-left:16px;-webkit-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.customize-control .dropdown-arrow{right:auto;left:0;border-color:#ccc;border-style:solid;border-width:1px 0 1px 1px;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.customize-control .dropdown-arrow:after{right:auto;left:4px}.customize-control-color .dropdown{margin-right:0;margin-left:5px}.accordion-section input[type="text"].color-picker-hex{direction:ltr}.accordion-section .customize-control-image .actions{text-align:left}.customize-control-image .library,.customize-control-image .actions,.accordion-section .customize-control-image .library ul,.accordion-section .customize-control-image .library li,.accordion-section .customize-control-image .library-content{float:right}
\ No newline at end of file
index 7441dea279830c30b242956a57cd611576f59edb..14f6f212d16a308789740fbed22b8d76ef52c5e9 100644 (file)
@@ -6,124 +6,7 @@ body {
        text-decoration: none;
 }
 
-.customize-section {
-       border-top: 1px solid #fff;
-       border-bottom: 1px solid #dfdfdf;
-       margin: 0;
-}
-
-.control-section.customize-section:hover,
-.control-section.customize-section.open {
-       border-top-color: #808080;
-}
-
-.control-section.customize-section:hover {
-       border-bottom-color: #6d6d6d;
-}
-
-.customize-section.open:hover {
-       border-bottom-color: #dfdfdf;
-}
-
-.customize-section:last-child {
-       box-shadow: 0 1px 0 0px #fff;
-}
-
-.customize-section-title {
-       margin: 0;
-       padding: 15px 20px;
-       position: relative;
-
-       cursor: pointer;
-
-       -webkit-user-select: none;
-       -moz-user-select: none;
-       user-select: none;
-}
-
-.customize-section-title:focus {
-       outline: none;
-}
-
-.cannot-expand .customize-section-title {
-       cursor: auto;
-}
-
-.customize-section-content {
-       display: none;
-       padding: 10px 20px 15px;
-       overflow: hidden;
-}
-
-.control-section .customize-section-title {
-       padding: 10px 20px;
-       font-size: 15px;
-       font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
-       font-weight: normal;
-       text-shadow: 0 1px 0 #fff;
-       background: #f5f5f5;
-       background-image: -webkit-gradient(linear, left bottom, left top, from(#eee), to(#f5f5f5));
-       background-image: -webkit-linear-gradient(bottom, #eee, #f5f5f5);
-       background-image:    -moz-linear-gradient(bottom, #eee, #f5f5f5);
-       background-image:      -o-linear-gradient(bottom, #eee, #f5f5f5);
-       background-image: linear-gradient(to top, #eee, #f5f5f5);
-}
-
-.control-section:hover .customize-section-title,
-.control-section .customize-section-title:hover,
-.control-section.open .customize-section-title,
-.control-section .customize-section-title:focus {
-       color: #fff;
-       text-shadow: 0 -1px 0 #333;
-       background: #808080;
-       background-image: -webkit-gradient(linear, left bottom, left top, from(#6d6d6d), to(#808080));
-       background-image: -webkit-linear-gradient(bottom, #6d6d6d, #808080);
-       background-image:    -moz-linear-gradient(bottom, #6d6d6d, #808080);
-       background-image:      -o-linear-gradient(bottom, #6d6d6d, #808080);
-       background-image: linear-gradient(to top, #6d6d6d, #808080);
-}
-
-.control-section.open .customize-section-title {
-       border-bottom: 1px solid #6d6d6d;
-}
-
-.customize-section.open .customize-section-content {
-       display: block;
-       background: #fdfdfd;
-}
-
-.customize-section-title:after {
-       content: '';
-       width: 0;
-       height: 0;
-       border-color: #ccc transparent;
-       border-style: solid;
-       border-width: 6px 6px 0;
-       position: absolute;
-       top: 25px;
-       right: 20px;
-       z-index: 1;
-}
-
-.cannot-expand .customize-section-title:after {
-       display: none;
-}
-
-.customize-section-title:hover:after,
-.customize-section-title:focus:after {
-       border-color: #aaa transparent;
-}
-
-.control-section .customize-section-title:hover:after,
-.control-section .customize-section-title:focus:after {
-       border-color: #eee transparent;
-}
-
-.control-section .customize-section-title:after {
-       top: 15px;
-}
-
-#customize-info .customize-section-content {
+#customize-info .accordion-section-content {
        background: transparent;
 }
 
@@ -158,7 +41,7 @@ body {
 }
 
 #customize-theme-controls > ul,
-#customize-theme-controls .customize-section-content {
+#customize-theme-controls .accordion-section-content {
        margin: 0;
 }
 
@@ -238,6 +121,36 @@ body {
        height: 100%;
 }
 
+#customize-theme-controls .accordion-section-title:hover:after,
+#customize-theme-controls .accordion-section-title:focus:after {
+       border-color: #eee transparent;
+}
+
+#customize-theme-controls .control-section:hover .accordion-section-title,
+#customize-theme-controls .control-section .accordion-section-title:hover,
+#customize-theme-controls .control-section.open .accordion-section-title,
+#customize-theme-controls .control-section .accordion-section-title:focus {
+       color: #fff;
+       text-shadow: 0 -1px 0 #333;
+       background: #808080;
+       background-image: -webkit-gradient(linear, left bottom, left top, from(#6d6d6d), to(#808080));
+       background-image: -webkit-linear-gradient(bottom, #6d6d6d, #808080);
+       background-image:    -moz-linear-gradient(bottom, #6d6d6d, #808080);
+       background-image:      -o-linear-gradient(bottom, #6d6d6d, #808080);
+       background-image: linear-gradient(to top, #6d6d6d, #808080);
+       border-left: 1px solid #808080;
+       border-right: 1px solid #808080;
+}
+
+#customize-theme-controls .control-section.accordion-section:hover,
+#customize-theme-controls .control-section.accordion-section.open {
+       border-top-color: #808080;
+}
+
+#customize-theme-controls .control-section.open .accordion-section-title {
+       border-bottom: 1px solid #6d6d6d;
+}
+
 /*
  * Style for custom settings
  */
@@ -245,7 +158,7 @@ body {
 /*
  * Dropdowns
  */
-.customize-section .dropdown {
+.accordion-section .dropdown {
        float: left;
        display: block;
        position: relative;
@@ -255,7 +168,7 @@ body {
        border-radius: 3px;
 }
 
-.customize-section .dropdown-content {
+.accordion-section .dropdown-content {
        overflow: hidden;
        float: left;
        min-width: 30px;
@@ -301,12 +214,12 @@ body {
        z-index: 1;
 }
 
-.customize-section .dropdown:hover .dropdown-content,
+.accordion-section .dropdown:hover .dropdown-content,
 .customize-control .dropdown:hover .dropdown-arrow {
        border-color: #aaa;
 }
 
-.customize-section .dropdown:hover .dropdown-arrow:after {
+.accordion-section .dropdown:hover .dropdown-arrow:after {
        border-color: #aaa transparent;
 }
 
@@ -341,7 +254,7 @@ body {
        border-color: rgba( 0, 0, 0, 0.25 );
 }
 
-.customize-section input[type="text"].color-picker-hex {
+.accordion-section input[type="text"].color-picker-hex {
        width: 65px;
        font-family: monospace;
        text-align: center;
@@ -349,10 +262,10 @@ body {
 }
 
 /* The centered cursor overlaps the placeholder in webkit. Hide it when selected. */
-.customize-section input[type="text"].color-picker-hex:focus::-webkit-input-placeholder {
+.accordion-section input[type="text"].color-picker-hex:focus::-webkit-input-placeholder {
        color: transparent;
 }
-.customize-section input[type="text"].color-picker-hex:-moz-placeholder {
+.accordion-section input[type="text"].color-picker-hex:-moz-placeholder {
        color: #999;
 }
 
@@ -371,18 +284,18 @@ body {
        display: block;
 }
 
-.customize-section .customize-control-image .dropdown-content {
+.accordion-section .customize-control-image .dropdown-content {
        height: auto;
        min-height: 24px;
        min-width: 40px;
        padding: 0;
 }
 
-.customize-section .customize-control-image .dropdown-status {
+.accordion-section .customize-control-image .dropdown-status {
        padding: 4px 5px;
 }
 
-.customize-section .customize-control-image .preview-thumbnail img {
+.accordion-section .customize-control-image .preview-thumbnail img {
        display: block;
        width: 100%;
        max-width: 122px;
@@ -390,18 +303,18 @@ body {
        margin: 0 auto;
 }
 
-.customize-section .customize-control-image .actions {
+.accordion-section .customize-control-image .actions {
        text-align: right;
 }
 
-.customize-section .customize-control-image .library ul {
+.accordion-section .customize-control-image .library ul {
        border-bottom: 1px solid #dfdfdf;
        float: left;
        width: 100%;
        margin: 10px 0 0;
 }
 
-.customize-section .customize-control-image .library li {
+.accordion-section .customize-control-image .library li {
        color: #999;
        float: left;
        padding: 3px 5px;
@@ -411,7 +324,7 @@ body {
        border-width: 1px 1px 0 1px;
 }
 
-.customize-section .customize-control-image .library li.library-selected {
+.accordion-section .customize-control-image .library li.library-selected {
        margin-bottom: -1px;
        padding-bottom: 4px;
 
@@ -422,27 +335,27 @@ body {
        border-radius: 3px 3px 0 0 ;
 }
 
-.customize-section .customize-control-image .library-content {
+.accordion-section .customize-control-image .library-content {
        display: none;
        width: 100%;
        float: left;
        padding: 10px 0;
 }
 
-.customize-section .customize-control-image .library-content.library-selected {
+.accordion-section .customize-control-image .library-content.library-selected {
        display: block;
 }
 
-.customize-section .customize-control-image .library .thumbnail {
+.accordion-section .customize-control-image .library .thumbnail {
        display: block;
        width: 100%;
 }
 
-.customize-section .customize-control-image .library .thumbnail:hover img {
+.accordion-section .customize-control-image .library .thumbnail:hover img {
        border-color: #21759b;
 }
 
-.customize-section .customize-control-image .library .thumbnail img {
+.accordion-section .customize-control-image .library .thumbnail img {
        display: block;
        max-width: 90%;
        max-height: 80px;
@@ -453,13 +366,13 @@ body {
        border: 1px solid #dfdfdf;
 }
 
-.customize-section .customize-control-upload .upload-fallback,
-.customize-section .customize-control-image .upload-fallback {
+.accordion-section .customize-control-upload .upload-fallback,
+.accordion-section .customize-control-image .upload-fallback {
        display: none;
 }
 
-.customize-section .customize-control-upload .upload-dropzone,
-.customize-section .customize-control-image .upload-dropzone {
+.accordion-section .customize-control-upload .upload-dropzone,
+.accordion-section .customize-control-image .upload-dropzone {
        display: none;
        padding: 15px 10px;
        border: 3px dashed #dfdfdf;
@@ -470,8 +383,8 @@ body {
        cursor: default;
 }
 
-.customize-section .customize-control-upload .upload-dropzone.supports-drag-drop,
-.customize-section .customize-control-image .upload-dropzone.supports-drag-drop {
+.accordion-section .customize-control-upload .upload-dropzone.supports-drag-drop,
+.accordion-section .customize-control-image .upload-dropzone.supports-drag-drop {
        display: block;
        -webkit-transition: border-color 0.1s;
        -moz-transition:    border-color 0.1s;
@@ -480,13 +393,13 @@ body {
        transition:         border-color 0.1s;
 }
 
-.customize-section .customize-control-upload .library ul li,
-.customize-section .customize-control-image .library ul li {
+.accordion-section .customize-control-upload .library ul li,
+.accordion-section .customize-control-image .library ul li {
        cursor: pointer;
 }
 
-.customize-section .customize-control-upload .upload-dropzone.supports-drag-drop.drag-over,
-.customize-section .customize-control-image .upload-dropzone.supports-drag-drop.drag-over {
+.accordion-section .customize-control-upload .upload-dropzone.supports-drag-drop.drag-over,
+.accordion-section .customize-control-image .upload-dropzone.supports-drag-drop.drag-over {
        border-color: #83b4d8;
 }
 
index d4e432af5611f692d7253896bb3e16d5a01d1412..99e7ea19b3f2c56311fb63e8896e2142439fd05d 100644 (file)
@@ -1 +1 @@
-body{overflow:hidden}#customize-controls a{text-decoration:none}.customize-section{border-top:1px solid #fff;border-bottom:1px solid #dfdfdf;margin:0}.control-section.customize-section:hover,.control-section.customize-section.open{border-top-color:#808080}.control-section.customize-section:hover{border-bottom-color:#6d6d6d}.customize-section.open:hover{border-bottom-color:#dfdfdf}.customize-section:last-child{box-shadow:0 1px 0 0 #fff}.customize-section-title{margin:0;padding:15px 20px;position:relative;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.customize-section-title:focus{outline:0}.cannot-expand .customize-section-title{cursor:auto}.customize-section-content{display:none;padding:10px 20px 15px;overflow:hidden}.control-section .customize-section-title{padding:10px 20px;font-size:15px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-weight:normal;text-shadow:0 1px 0 #fff;background:#f5f5f5;background-image:-webkit-gradient(linear,left bottom,left top,from(#eee),to(#f5f5f5));background-image:-webkit-linear-gradient(bottom,#eee,#f5f5f5);background-image:-moz-linear-gradient(bottom,#eee,#f5f5f5);background-image:-o-linear-gradient(bottom,#eee,#f5f5f5);background-image:linear-gradient(to top,#eee,#f5f5f5)}.control-section:hover .customize-section-title,.control-section .customize-section-title:hover,.control-section.open .customize-section-title,.control-section .customize-section-title:focus{color:#fff;text-shadow:0 -1px 0 #333;background:#808080;background-image:-webkit-gradient(linear,left bottom,left top,from(#6d6d6d),to(#808080));background-image:-webkit-linear-gradient(bottom,#6d6d6d,#808080);background-image:-moz-linear-gradient(bottom,#6d6d6d,#808080);background-image:-o-linear-gradient(bottom,#6d6d6d,#808080);background-image:linear-gradient(to top,#6d6d6d,#808080)}.control-section.open .customize-section-title{border-bottom:1px solid #6d6d6d}.customize-section.open .customize-section-content{display:block;background:#fdfdfd}.customize-section-title:after{content:'';width:0;height:0;border-color:#ccc transparent;border-style:solid;border-width:6px 6px 0;position:absolute;top:25px;right:20px;z-index:1}.cannot-expand .customize-section-title:after{display:none}.customize-section-title:hover:after,.customize-section-title:focus:after{border-color:#aaa transparent}.control-section .customize-section-title:hover:after,.control-section .customize-section-title:focus:after{border-color:#eee transparent}.control-section .customize-section-title:after{top:15px}#customize-info .customize-section-content{background:transparent}#customize-info .preview-notice{font-size:13px;line-height:24px;color:#999}#customize-info .theme-name{font-size:20px;font-weight:200;line-height:24px;color:#333;display:block;text-shadow:0 1px 0 #fff}#customize-info .theme-screenshot{width:258px;border:1px solid #ccc}#customize-info .theme-description{margin-top:1em;color:#777;line-height:20px}#customize-controls .submit{text-align:center}#customize-theme-controls>ul,#customize-theme-controls .customize-section-content{margin:0}#customize-header-actions .button-primary{float:right;margin-top:10px}#customize-header-actions .spinner{margin-top:16px;margin-right:4px}.saving #customize-header-actions .spinner{display:block}.customize-control{width:100%;float:left;clear:both;margin-bottom:8px}.customize-control-title{display:block;line-height:24px;font-weight:bold}.customize-control select,.customize-control input[type="text"],.customize-control input[type="radio"],.customize-control input[type="checkbox"],.customize-control-color .color-picker,.customize-control-checkbox label,.customize-control-upload div{line-height:28px}.customize-control input[type="text"]{width:98%;line-height:18px;margin:0}.customize-control select{min-width:50%;max-width:100%;height:28px;line-height:28px}.customize-control-checkbox input{margin-right:5px}.customize-control-radio{padding:5px 0 10px}.customize-control-radio .customize-control-title{margin-bottom:0;line-height:22px}.customize-control-radio label{line-height:20px}.customize-control-radio input{margin-right:5px}#customize-preview iframe{width:100%;height:100%}.customize-section .dropdown{float:left;display:block;position:relative;cursor:pointer;-webkit-border-radius:3px;border-radius:3px}.customize-section .dropdown-content{overflow:hidden;float:left;min-width:30px;height:16px;line-height:16px;margin-right:16px;padding:4px 5px;background-color:#eee;border:1px solid #ccc;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.customize-control .dropdown-arrow{position:absolute;top:0;bottom:0;right:0;width:15px;border-color:#ccc;border-style:solid;border-width:1px 1px 1px 0;-webkit-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.customize-control .dropdown-arrow:after{content:'';width:0;height:0;border-color:#ccc transparent;border-style:solid;border-width:4px 4px 0 4px;position:absolute;top:50%;margin-top:-1px;right:4px;z-index:1}.customize-section .dropdown:hover .dropdown-content,.customize-control .dropdown:hover .dropdown-arrow{border-color:#aaa}.customize-section .dropdown:hover .dropdown-arrow:after{border-color:#aaa transparent}.customize-control .dropdown-status{display:none;max-width:112px;color:#777}.customize-control-color .color-picker-hex{display:none}.customize-control-color.open .color-picker-hex{display:block}.customize-control-color .dropdown{margin-right:5px;margin-bottom:5px}.customize-control-color .dropdown .dropdown-content{background-color:#fff;border:1px solid rgba(0,0,0,0.15)}.customize-control-color .dropdown:hover .dropdown-content{border-color:rgba(0,0,0,0.25)}.customize-section input[type="text"].color-picker-hex{width:65px;font-family:monospace;text-align:center;line-height:16px}.customize-section input[type="text"].color-picker-hex:focus::-webkit-input-placeholder{color:transparent}.customize-section input[type="text"].color-picker-hex:-moz-placeholder{color:#999}.customize-control-image .library,.customize-control-image .actions{display:none;float:left;width:100%}.customize-control-image.open .library,.customize-control-image.open .actions{display:block}.customize-section .customize-control-image .dropdown-content{height:auto;min-height:24px;min-width:40px;padding:0}.customize-section .customize-control-image .dropdown-status{padding:4px 5px}.customize-section .customize-control-image .preview-thumbnail img{display:block;width:100%;max-width:122px;max-height:98px;margin:0 auto}.customize-section .customize-control-image .actions{text-align:right}.customize-section .customize-control-image .library ul{border-bottom:1px solid #dfdfdf;float:left;width:100%;margin:10px 0 0}.customize-section .customize-control-image .library li{color:#999;float:left;padding:3px 5px;margin:0;border-style:solid;border-color:transparent;border-width:1px 1px 0 1px}.customize-section .customize-control-image .library li.library-selected{margin-bottom:-1px;padding-bottom:4px;color:#777;background:#fdfdfd;border-color:#dfdfdf;-webkit-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0}.customize-section .customize-control-image .library-content{display:none;width:100%;float:left;padding:10px 0}.customize-section .customize-control-image .library-content.library-selected{display:block}.customize-section .customize-control-image .library .thumbnail{display:block;width:100%}.customize-section .customize-control-image .library .thumbnail:hover img{border-color:#21759b}.customize-section .customize-control-image .library .thumbnail img{display:block;max-width:90%;max-height:80px;margin:5px auto;padding:4px;background:#fff;border:1px solid #dfdfdf}.customize-section .customize-control-upload .upload-fallback,.customize-section .customize-control-image .upload-fallback{display:none}.customize-section .customize-control-upload .upload-dropzone,.customize-section .customize-control-image .upload-dropzone{display:none;padding:15px 10px;border:3px dashed #dfdfdf;margin:5px auto;text-align:center;color:#777;position:relative;cursor:default}.customize-section .customize-control-upload .upload-dropzone.supports-drag-drop,.customize-section .customize-control-image .upload-dropzone.supports-drag-drop{display:block;-webkit-transition:border-color .1s;-moz-transition:border-color .1s;-ms-transition:border-color .1s;-o-transition:border-color .1s;transition:border-color .1s}.customize-section .customize-control-upload .library ul li,.customize-section .customize-control-image .library ul li{cursor:pointer}.customize-section .customize-control-upload .upload-dropzone.supports-drag-drop.drag-over,.customize-section .customize-control-image .upload-dropzone.supports-drag-drop.drag-over{border-color:#83b4d8}.ios .wp-full-overlay{position:relative}.ios #customize-preview{position:relative}.ios #customize-controls .wp-full-overlay-sidebar-content{-webkit-overflow-scrolling:touch}body.cheatin{min-width:0;background:#f9f9f9;padding:50px}body.cheatin p{max-width:700px;margin:0 auto;padding:2em;font-size:14px;background:#fff;border:1px solid #dfdfdf;-webkit-border-radius:3px;border-radius:3px}
\ No newline at end of file
+body{overflow:hidden}#customize-controls a{text-decoration:none}#customize-info .accordion-section-content{background:transparent}#customize-info .preview-notice{font-size:13px;line-height:24px;color:#999}#customize-info .theme-name{font-size:20px;font-weight:200;line-height:24px;color:#333;display:block;text-shadow:0 1px 0 #fff}#customize-info .theme-screenshot{width:258px;border:1px solid #ccc}#customize-info .theme-description{margin-top:1em;color:#777;line-height:20px}#customize-controls .submit{text-align:center}#customize-theme-controls>ul,#customize-theme-controls .accordion-section-content{margin:0}#customize-header-actions .button-primary{float:right;margin-top:10px}#customize-header-actions .spinner{margin-top:16px;margin-right:4px}.saving #customize-header-actions .spinner{display:block}.customize-control{width:100%;float:left;clear:both;margin-bottom:8px}.customize-control-title{display:block;line-height:24px;font-weight:bold}.customize-control select,.customize-control input[type="text"],.customize-control input[type="radio"],.customize-control input[type="checkbox"],.customize-control-color .color-picker,.customize-control-checkbox label,.customize-control-upload div{line-height:28px}.customize-control input[type="text"]{width:98%;line-height:18px;margin:0}.customize-control select{min-width:50%;max-width:100%;height:28px;line-height:28px}.customize-control-checkbox input{margin-right:5px}.customize-control-radio{padding:5px 0 10px}.customize-control-radio .customize-control-title{margin-bottom:0;line-height:22px}.customize-control-radio label{line-height:20px}.customize-control-radio input{margin-right:5px}#customize-preview iframe{width:100%;height:100%}#customize-theme-controls .accordion-section-title:hover:after,#customize-theme-controls .accordion-section-title:focus:after{border-color:#eee transparent}#customize-theme-controls .control-section:hover .accordion-section-title,#customize-theme-controls .control-section .accordion-section-title:hover,#customize-theme-controls .control-section.open .accordion-section-title,#customize-theme-controls .control-section .accordion-section-title:focus{color:#fff;text-shadow:0 -1px 0 #333;background:#808080;background-image:-webkit-gradient(linear,left bottom,left top,from(#6d6d6d),to(#808080));background-image:-webkit-linear-gradient(bottom,#6d6d6d,#808080);background-image:-moz-linear-gradient(bottom,#6d6d6d,#808080);background-image:-o-linear-gradient(bottom,#6d6d6d,#808080);background-image:linear-gradient(to top,#6d6d6d,#808080);border-left:1px solid #808080;border-right:1px solid #808080}#customize-theme-controls .control-section.accordion-section:hover,#customize-theme-controls .control-section.accordion-section.open{border-top-color:#808080}#customize-theme-controls .control-section.open .accordion-section-title{border-bottom:1px solid #6d6d6d}.accordion-section .dropdown{float:left;display:block;position:relative;cursor:pointer;-webkit-border-radius:3px;border-radius:3px}.accordion-section .dropdown-content{overflow:hidden;float:left;min-width:30px;height:16px;line-height:16px;margin-right:16px;padding:4px 5px;background-color:#eee;border:1px solid #ccc;-webkit-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;-webkit-user-select:none;-moz-user-select:none;user-select:none}.customize-control .dropdown-arrow{position:absolute;top:0;bottom:0;right:0;width:15px;border-color:#ccc;border-style:solid;border-width:1px 1px 1px 0;-webkit-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.customize-control .dropdown-arrow:after{content:'';width:0;height:0;border-color:#ccc transparent;border-style:solid;border-width:4px 4px 0 4px;position:absolute;top:50%;margin-top:-1px;right:4px;z-index:1}.accordion-section .dropdown:hover .dropdown-content,.customize-control .dropdown:hover .dropdown-arrow{border-color:#aaa}.accordion-section .dropdown:hover .dropdown-arrow:after{border-color:#aaa transparent}.customize-control .dropdown-status{display:none;max-width:112px;color:#777}.customize-control-color .color-picker-hex{display:none}.customize-control-color.open .color-picker-hex{display:block}.customize-control-color .dropdown{margin-right:5px;margin-bottom:5px}.customize-control-color .dropdown .dropdown-content{background-color:#fff;border:1px solid rgba(0,0,0,0.15)}.customize-control-color .dropdown:hover .dropdown-content{border-color:rgba(0,0,0,0.25)}.accordion-section input[type="text"].color-picker-hex{width:65px;font-family:monospace;text-align:center;line-height:16px}.accordion-section input[type="text"].color-picker-hex:focus::-webkit-input-placeholder{color:transparent}.accordion-section input[type="text"].color-picker-hex:-moz-placeholder{color:#999}.customize-control-image .library,.customize-control-image .actions{display:none;float:left;width:100%}.customize-control-image.open .library,.customize-control-image.open .actions{display:block}.accordion-section .customize-control-image .dropdown-content{height:auto;min-height:24px;min-width:40px;padding:0}.accordion-section .customize-control-image .dropdown-status{padding:4px 5px}.accordion-section .customize-control-image .preview-thumbnail img{display:block;width:100%;max-width:122px;max-height:98px;margin:0 auto}.accordion-section .customize-control-image .actions{text-align:right}.accordion-section .customize-control-image .library ul{border-bottom:1px solid #dfdfdf;float:left;width:100%;margin:10px 0 0}.accordion-section .customize-control-image .library li{color:#999;float:left;padding:3px 5px;margin:0;border-style:solid;border-color:transparent;border-width:1px 1px 0 1px}.accordion-section .customize-control-image .library li.library-selected{margin-bottom:-1px;padding-bottom:4px;color:#777;background:#fdfdfd;border-color:#dfdfdf;-webkit-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0}.accordion-section .customize-control-image .library-content{display:none;width:100%;float:left;padding:10px 0}.accordion-section .customize-control-image .library-content.library-selected{display:block}.accordion-section .customize-control-image .library .thumbnail{display:block;width:100%}.accordion-section .customize-control-image .library .thumbnail:hover img{border-color:#21759b}.accordion-section .customize-control-image .library .thumbnail img{display:block;max-width:90%;max-height:80px;margin:5px auto;padding:4px;background:#fff;border:1px solid #dfdfdf}.accordion-section .customize-control-upload .upload-fallback,.accordion-section .customize-control-image .upload-fallback{display:none}.accordion-section .customize-control-upload .upload-dropzone,.accordion-section .customize-control-image .upload-dropzone{display:none;padding:15px 10px;border:3px dashed #dfdfdf;margin:5px auto;text-align:center;color:#777;position:relative;cursor:default}.accordion-section .customize-control-upload .upload-dropzone.supports-drag-drop,.accordion-section .customize-control-image .upload-dropzone.supports-drag-drop{display:block;-webkit-transition:border-color .1s;-moz-transition:border-color .1s;-ms-transition:border-color .1s;-o-transition:border-color .1s;transition:border-color .1s}.accordion-section .customize-control-upload .library ul li,.accordion-section .customize-control-image .library ul li{cursor:pointer}.accordion-section .customize-control-upload .upload-dropzone.supports-drag-drop.drag-over,.accordion-section .customize-control-image .upload-dropzone.supports-drag-drop.drag-over{border-color:#83b4d8}.ios .wp-full-overlay{position:relative}.ios #customize-preview{position:relative}.ios #customize-controls .wp-full-overlay-sidebar-content{-webkit-overflow-scrolling:touch}body.cheatin{min-width:0;background:#f9f9f9;padding:50px}body.cheatin p{max-width:700px;margin:0 auto;padding:2em;font-size:14px;background:#fff;border:1px solid #dfdfdf;-webkit-border-radius:3px;border-radius:3px}
\ No newline at end of file
index 50e2e8d41643b59dfcc340930b15cdb2dcd62c3f..b947f0b200485a0c7d53a947f58be89e7d834114 100644 (file)
@@ -234,7 +234,7 @@ p.button-controls,
        right: 0;
 }
 
-.screen-reader-text { 
+.screen-reader-text {
        right: auto;
-       text-indent: -1000em; 
-} 
\ No newline at end of file
+       text-indent: -1000em;
+}
\ No newline at end of file
index 6730c2e5b662abd7dec0a00c302f4e688127353e..98b7b379b50c352160a1524ae68dcbf998579f28 100644 (file)
@@ -396,6 +396,12 @@ div#dashboard-widgets {
        display: inline;
 }
 
+a.post-state-format {
+       text-indent: 0;
+       line-height: 0;
+       font-size: 0;
+}
+
 table.ie-fixed {
        table-layout: fixed;
 }
@@ -624,3 +630,13 @@ table.ie-fixed {
 * html #adminmenu div.wp-menu-image {
        height: 29px;
 }
+
+.revisions-tickmarks,
+.revisions-tooltip {
+       display: none !important;
+}
+
+.revisions.pinned .revisions-controls {
+    position: relative;
+}
+
index c3833e28a43f8ad15ae86ff3a0b0c8608a3862d8..d5650663e91c4cc4a14a18d9302ca7ddb37de36e 100644 (file)
@@ -1 +1 @@
-#dashboard-widgets form .input-text-wrap input,#dashboard-widgets form .textarea-wrap textarea{width:99%}#dashboard-widgets form #title{width:98%}.wp-editor-wrap .wp-editor-container textarea.wp-editor-area{width:97%}#post-body.columns-2 #postbox-container-1{padding-left:19px}.welcome-panel .wp-badge{position:absolute}.welcome-panel .welcome-panel-column:first-child{width:35%}#wp-fullscreen-title{width:97%}#wp_mce_fullscreen_ifr{background-color:#f9f9f9}#wp-fullscreen-tagline{color:#888;font-size:14px}#adminmenushadow{display:none}#adminmenuback{left:0;background-image:none}#adminmenuwrap{position:static}#adminmenu{position:relative}#adminmenu,#adminmenu a{cursor:pointer}#adminmenu li.wp-menu-separator,#adminmenu li.wp-menu-separator-last{font-size:1px;line-height:1}#adminmenu a.menu-top{border-bottom:0 none;border-top:1px solid #ddd}#adminmenu .separator{font-size:1px;line-height:1px}#adminmenu .wp-submenu ul{margin:0}.folded #adminmenu .wp-submenu{border-top-color:transparent}#adminmenu .wp-submenu .wp-submenu-head{border-top-color:#ddd}.folded #adminmenu .wp-submenu ul{margin-left:5px}#adminmenu li.menu-top{margin-bottom:-2px}#adminmenu .wp-menu-arrow{display:none!important}.js.folded #adminmenu li.menu-top{display:block;zoom:100%}ul#adminmenu{z-index:99}#adminmenu li.menu-top a.menu-top{min-width:auto;width:auto}#wpcontent #adminmenu li.wp-has-current-submenu a.wp-has-submenu{font-style:normal}#wpcontent #adminmenu .wp-submenu li{padding:0}#collapse-menu{line-height:23px}#wpadminbar .ab-comments-icon{padding-top:7px}table.fixed th,table.fixed td{border-top:1px solid #ddd}#wpbody-content input.button,#wpbody-content input.button-primary,#wpbody-content input.button-secondary{overflow:visible}#dashboard-widgets #dashboard_quick_press form p.submit #publish{float:none}#dashboard-widgets h3 a{height:14px;line-height:14px}#dashboard_browser_nag{color:#fff}#dashboard_browser_nag .browser-icon{position:relative}.tablenav-pages .current-page{vertical-align:middle}#wpbody-content .postbox{border:1px solid #dfdfdf}#wpbody-content .postbox h3{margin-bottom:-1px}.major-publishing-actions,.wp-submenu,.wp-submenu li,#template,#template div,#editcat,#addcat{zoom:100%}.wp-menu-arrow{height:28px}.submitbox{margin-top:10px}#wpbody-content .quick-edit-row-post .inline-edit-col-left{width:39%}#wpbody-content .inline-edit-row-post .inline-edit-col-center{width:19%}#wpbody-content .quick-edit-row-page .inline-edit-col-left{width:49%}#wpbody-content .bulk-edit-row .inline-edit-col-left{width:29%}.inline-edit-row p.submit{zoom:100%}.inline-edit-row fieldset label span.title{display:block;float:left;width:5em}.inline-edit-row fieldset label span.input-text-wrap{margin-left:0;zoom:100%}#wpbody-content .inline-edit-row fieldset label span.input-text-wrap input{line-height:130%}#wpbody-content .inline-edit-row .input-text-wrap input{width:95%}#wpbody-content .inline-edit-row .input-text-wrap input.inline-edit-password-input{width:8em}#titlediv #title{width:98%}.button,input[type="reset"],input[type="button"],input[type="submit"]{padding:0 8px;line-height:20px;height:auto}.button.button-large,input[type="reset"].button-large,input[type="button"].button-large,input[type="submit"].button-large{padding:0 10px;line-height:24px;height:auto}.button.button-small,input[type="reset"].button-small,input[type="button"].button-small,input[type="submit"].button-small{padding:0 6px;line-height:16px;height:auto}a.button{margin:1px;padding:1px 9px 2px}a.button.button-large{padding:1px 11px 2px}a.button.button-small{padding:1px 7px 2px}#screen-options-wrap{overflow:hidden}#the-comment-list .comment-item,#post-status-info,#wpwrap,#wrap,#postdivrich,#postdiv,#poststuff,.metabox-holder,#titlediv,#post-body,#editorcontainer,.tablenav,.widget-liquid-left,.widget-liquid-right,#widgets-left,.widgets-sortables,#dragHelper,.widget .widget-top,.widget-control-actions,.tagchecklist,#col-container,#col-left,#col-right,.fileedit-sub{display:block;zoom:100%}p.search-box{position:static;float:right;margin:-3px 0 4px}#widget-list .widget,.feature-filter .feature-group li{display:inline}.feature-filter .feature-group li input{vertical-align:middle}#editorcontainer #content{overflow:auto;margin:auto;width:98%}form#template div{width:100%}.wp-editor-container .quicktags-toolbar input{overflow:visible;padding:0 4px}#poststuff h2{font-size:1.6em}#poststuff .inside #parent_id,#poststuff .inside #page_template,.inline-edit-row #post_parent,.inline-edit-row select[name="page_template"]{width:250px}#submitdiv input,#submitdiv select,#submitdiv a.button{position:relative}#bh{margin:7px 10px 0 0;float:right}div#dashboard-widgets{padding-right:1px}.tagchecklist span,.tagchecklist span a{display:inline-block;display:block}.tagchecklist span a{margin:4px 0 0 -9px}.tablenav .button-secondary,.nav .button-secondary{padding-top:2px;padding-bottom:2px}.tablenav select{font-size:13px;display:inline-block;vertical-align:top;margin-top:2px}.tablenav .actions select{width:155px}.subsubsub li{display:inline}table.ie-fixed{table-layout:fixed}.widefat tr,.widefat th{margin-bottom:0;border-spacing:0}.widefat th input{margin:0 0 0 5px}.widefat thead .check-column,.widefat tfoot .check-column{padding-top:6px}.widefat tbody th.check-column,.media.widefat tbody th.check-column{padding:4px 0 0}.widefat{empty-cells:show;border-collapse:collapse}.tablenav a.button-secondary{display:inline-block;padding:2px 5px}.inactive-sidebar .widgets-sortables{padding-bottom:8px}#available-widgets .widget-holder{padding-bottom:65px}#widgets-left .inactive{padding-bottom:10px}.widget-liquid-right .widget,.inactive-sidebar .widget{position:relative}.inactive-sidebar .widget{display:block;float:left}#wpcontent .button-primary-disabled{color:#9fd0d5;background:#298cba}#the-comment-list .unapproved tr,#the-comment-list .unapproved td{background-color:#ffffe0}.imgedit-submit{width:300px}#nav-menus-frame,#wpbody,.menu li{zoom:100%}#update-nav-menu #post-body{overflow:hidden}.menu li{min-width:100%}.menu li.sortable-placeholder{min-width:400px}.about-wrap img.element-screenshot{padding:2px}.about-wrap .feature-section img,.about-wrap .feature-section .image-mask{border-width:1px;border-style:solid}.about-wrap .feature-section.three-col img{margin-left:0}.available-theme{display:inline}.available-theme ul{margin:0}.available-theme .action-links li{padding-right:7px;margin-right:7px}.about-wrap .three-col-images img{margin:0 .6% 10px}.about-wrap .three-col-images .last-feature,.about-wrap .three-col-images .first-feature{float:none}* html .row-actions{visibility:visible}* html div.widget-liquid-left,* html div.widget-liquid-right{display:block;position:relative}* html #editorcontainer{padding:0}* html #poststuff h2{margin-left:0}* html .stuffbox,* html .stuffbox input,* html .stuffbox textarea{border:1px solid #dfdfdf}* html .feature-filter .feature-group li{width:145px}* html div.widget-liquid-left{width:99%}* html .widgets-sortables{height:50px}* html a#content_resize{right:-2px}* html .widget-title h4{width:205px}* html #removing-widget .in-widget-title{display:none}* html .media-item .pinkynail{height:32px;width:40px}* html .describe .field input.text,* html .describe .field textarea{width:440px}* html input{border:1px solid #dfdfdf}* html .edit-box{display:inline}* html .postbox-container .meta-box-sortables{height:300px}* html #wpbody-content #screen-options-link-wrap{display:inline-block;width:150px;text-align:center}* html #wpbody-content #contextual-help-link-wrap{display:inline-block;width:100px;text-align:center}* html #adminmenu{margin-left:-80px}* html .folded #adminmenu{margin-left:-22px}* html #wpcontent #adminmenu li.menu-top{display:inline;padding:0;margin:0}* html #wpfooter{margin:0}* html #adminmenu div.wp-menu-image{height:29px}
\ No newline at end of file
+#dashboard-widgets form .input-text-wrap input,#dashboard-widgets form .textarea-wrap textarea{width:99%}#dashboard-widgets form #title{width:98%}.wp-editor-wrap .wp-editor-container textarea.wp-editor-area{width:97%}#post-body.columns-2 #postbox-container-1{padding-left:19px}.welcome-panel .wp-badge{position:absolute}.welcome-panel .welcome-panel-column:first-child{width:35%}#wp-fullscreen-title{width:97%}#wp_mce_fullscreen_ifr{background-color:#f9f9f9}#wp-fullscreen-tagline{color:#888;font-size:14px}#adminmenushadow{display:none}#adminmenuback{left:0;background-image:none}#adminmenuwrap{position:static}#adminmenu{position:relative}#adminmenu,#adminmenu a{cursor:pointer}#adminmenu li.wp-menu-separator,#adminmenu li.wp-menu-separator-last{font-size:1px;line-height:1}#adminmenu a.menu-top{border-bottom:0 none;border-top:1px solid #ddd}#adminmenu .separator{font-size:1px;line-height:1px}#adminmenu .wp-submenu ul{margin:0}.folded #adminmenu .wp-submenu{border-top-color:transparent}#adminmenu .wp-submenu .wp-submenu-head{border-top-color:#ddd}.folded #adminmenu .wp-submenu ul{margin-left:5px}#adminmenu li.menu-top{margin-bottom:-2px}#adminmenu .wp-menu-arrow{display:none!important}.js.folded #adminmenu li.menu-top{display:block;zoom:100%}ul#adminmenu{z-index:99}#adminmenu li.menu-top a.menu-top{min-width:auto;width:auto}#wpcontent #adminmenu li.wp-has-current-submenu a.wp-has-submenu{font-style:normal}#wpcontent #adminmenu .wp-submenu li{padding:0}#collapse-menu{line-height:23px}#wpadminbar .ab-comments-icon{padding-top:7px}table.fixed th,table.fixed td{border-top:1px solid #ddd}#wpbody-content input.button,#wpbody-content input.button-primary,#wpbody-content input.button-secondary{overflow:visible}#dashboard-widgets #dashboard_quick_press form p.submit #publish{float:none}#dashboard-widgets h3 a{height:14px;line-height:14px}#dashboard_browser_nag{color:#fff}#dashboard_browser_nag .browser-icon{position:relative}.tablenav-pages .current-page{vertical-align:middle}#wpbody-content .postbox{border:1px solid #dfdfdf}#wpbody-content .postbox h3{margin-bottom:-1px}.major-publishing-actions,.wp-submenu,.wp-submenu li,#template,#template div,#editcat,#addcat{zoom:100%}.wp-menu-arrow{height:28px}.submitbox{margin-top:10px}#wpbody-content .quick-edit-row-post .inline-edit-col-left{width:39%}#wpbody-content .inline-edit-row-post .inline-edit-col-center{width:19%}#wpbody-content .quick-edit-row-page .inline-edit-col-left{width:49%}#wpbody-content .bulk-edit-row .inline-edit-col-left{width:29%}.inline-edit-row p.submit{zoom:100%}.inline-edit-row fieldset label span.title{display:block;float:left;width:5em}.inline-edit-row fieldset label span.input-text-wrap{margin-left:0;zoom:100%}#wpbody-content .inline-edit-row fieldset label span.input-text-wrap input{line-height:130%}#wpbody-content .inline-edit-row .input-text-wrap input{width:95%}#wpbody-content .inline-edit-row .input-text-wrap input.inline-edit-password-input{width:8em}#titlediv #title{width:98%}.button,input[type="reset"],input[type="button"],input[type="submit"]{padding:0 8px;line-height:20px;height:auto}.button.button-large,input[type="reset"].button-large,input[type="button"].button-large,input[type="submit"].button-large{padding:0 10px;line-height:24px;height:auto}.button.button-small,input[type="reset"].button-small,input[type="button"].button-small,input[type="submit"].button-small{padding:0 6px;line-height:16px;height:auto}a.button{margin:1px;padding:1px 9px 2px}a.button.button-large{padding:1px 11px 2px}a.button.button-small{padding:1px 7px 2px}#screen-options-wrap{overflow:hidden}#the-comment-list .comment-item,#post-status-info,#wpwrap,#wrap,#postdivrich,#postdiv,#poststuff,.metabox-holder,#titlediv,#post-body,#editorcontainer,.tablenav,.widget-liquid-left,.widget-liquid-right,#widgets-left,.widgets-sortables,#dragHelper,.widget .widget-top,.widget-control-actions,.tagchecklist,#col-container,#col-left,#col-right,.fileedit-sub{display:block;zoom:100%}p.search-box{position:static;float:right;margin:-3px 0 4px}#widget-list .widget,.feature-filter .feature-group li{display:inline}.feature-filter .feature-group li input{vertical-align:middle}#editorcontainer #content{overflow:auto;margin:auto;width:98%}form#template div{width:100%}.wp-editor-container .quicktags-toolbar input{overflow:visible;padding:0 4px}#poststuff h2{font-size:1.6em}#poststuff .inside #parent_id,#poststuff .inside #page_template,.inline-edit-row #post_parent,.inline-edit-row select[name="page_template"]{width:250px}#submitdiv input,#submitdiv select,#submitdiv a.button{position:relative}#bh{margin:7px 10px 0 0;float:right}div#dashboard-widgets{padding-right:1px}.tagchecklist span,.tagchecklist span a{display:inline-block;display:block}.tagchecklist span a{margin:4px 0 0 -9px}.tablenav .button-secondary,.nav .button-secondary{padding-top:2px;padding-bottom:2px}.tablenav select{font-size:13px;display:inline-block;vertical-align:top;margin-top:2px}.tablenav .actions select{width:155px}.subsubsub li{display:inline}a.post-state-format{text-indent:0;line-height:0;font-size:0}table.ie-fixed{table-layout:fixed}.widefat tr,.widefat th{margin-bottom:0;border-spacing:0}.widefat th input{margin:0 0 0 5px}.widefat thead .check-column,.widefat tfoot .check-column{padding-top:6px}.widefat tbody th.check-column,.media.widefat tbody th.check-column{padding:4px 0 0}.widefat{empty-cells:show;border-collapse:collapse}.tablenav a.button-secondary{display:inline-block;padding:2px 5px}.inactive-sidebar .widgets-sortables{padding-bottom:8px}#available-widgets .widget-holder{padding-bottom:65px}#widgets-left .inactive{padding-bottom:10px}.widget-liquid-right .widget,.inactive-sidebar .widget{position:relative}.inactive-sidebar .widget{display:block;float:left}#wpcontent .button-primary-disabled{color:#9fd0d5;background:#298cba}#the-comment-list .unapproved tr,#the-comment-list .unapproved td{background-color:#ffffe0}.imgedit-submit{width:300px}#nav-menus-frame,#wpbody,.menu li{zoom:100%}#update-nav-menu #post-body{overflow:hidden}.menu li{min-width:100%}.menu li.sortable-placeholder{min-width:400px}.about-wrap img.element-screenshot{padding:2px}.about-wrap .feature-section img,.about-wrap .feature-section .image-mask{border-width:1px;border-style:solid}.about-wrap .feature-section.three-col img{margin-left:0}.available-theme{display:inline}.available-theme ul{margin:0}.available-theme .action-links li{padding-right:7px;margin-right:7px}.about-wrap .three-col-images img{margin:0 .6% 10px}.about-wrap .three-col-images .last-feature,.about-wrap .three-col-images .first-feature{float:none}* html .row-actions{visibility:visible}* html div.widget-liquid-left,* html div.widget-liquid-right{display:block;position:relative}* html #editorcontainer{padding:0}* html #poststuff h2{margin-left:0}* html .stuffbox,* html .stuffbox input,* html .stuffbox textarea{border:1px solid #dfdfdf}* html .feature-filter .feature-group li{width:145px}* html div.widget-liquid-left{width:99%}* html .widgets-sortables{height:50px}* html a#content_resize{right:-2px}* html .widget-title h4{width:205px}* html #removing-widget .in-widget-title{display:none}* html .media-item .pinkynail{height:32px;width:40px}* html .describe .field input.text,* html .describe .field textarea{width:440px}* html input{border:1px solid #dfdfdf}* html .edit-box{display:inline}* html .postbox-container .meta-box-sortables{height:300px}* html #wpbody-content #screen-options-link-wrap{display:inline-block;width:150px;text-align:center}* html #wpbody-content #contextual-help-link-wrap{display:inline-block;width:100px;text-align:center}* html #adminmenu{margin-left:-80px}* html .folded #adminmenu{margin-left:-22px}* html #wpcontent #adminmenu li.menu-top{display:inline;padding:0;margin:0}* html #wpfooter{margin:0}* html #adminmenu div.wp-menu-image{height:29px}.revisions-tickmarks,.revisions-tooltip{display:none!important}.revisions.pinned .revisions-controls{position:relative}
\ No newline at end of file
index 12dbef6236212c661483a83ca6cdcbb062d5de71..3061592a5f51943d33ceda5293896fe5149b4bfc 100644 (file)
@@ -23,6 +23,7 @@ TABLE OF CONTENTS:
        11.1 - Custom Fields
        11.2 - Post Revisions
        11.3 - Featured Images
+       11.4 - Post formats
 12.0 - Categories
 13.0 - Tags
 14.0 - Media Screen
@@ -44,6 +45,8 @@ TABLE OF CONTENTS:
 25.0 - TinyMCE tweaks
 26.0 - Full Overlay w/ Sidebar
 27.0 - Customize Loader
+28.0 - Nav Menus
+29.0 - HiDPI
 
 
 ------------------------------------------------------------------------------*/
@@ -688,17 +691,29 @@ form.upgrade .hint {
 .fixed .column-comments {
        text-align: right;
 }
+
 .fixed .column-comments .vers {
        padding-left: 0;
        padding-right: 3px;
 }
+
 .fixed .column-comments a {
        float: right;
 }
+
+.fixed .column-menus {
+       text-align: right;
+}
+
 .sorting-indicator {
        margin-left: 0;
        margin-right: 7px;
 }
+
+tr.wp-locked .locked-indicator {
+       margin: -2px 6px 0 0;
+}
+
 th.sortable a span,
 th.sorted a span {
        float: right;
@@ -816,8 +831,6 @@ th.sorted a span {
 }
 
 .inline-edit-row fieldset ul.cat-checklist label,
-.inline-edit-row .catshow,
-.inline-edit-row .cathide,
 .inline-edit-row #bulk-titles div {
        font-family: Tahoma, Arial, sans-serif;
 }
@@ -941,6 +954,23 @@ th.sorted a span {
        padding-left: 10px;
 }
 
+#post-lock-dialog .post-locked-message a.button {
+       margin-right: 0;
+       margin-left: 10px;
+}
+
+#post-lock-dialog .post-locked-avatar {
+       float: right;
+       margin: 0 0 20px 20px;
+}
+
+#post-lock-dialog .locked-saving img {
+       float: right;
+       margin-right: 0;
+       margin-left: 3px;
+}
+
+
 /*------------------------------------------------------------------------------
   11.1 - Custom Fields
 ------------------------------------------------------------------------------*/
@@ -950,9 +980,113 @@ th.sorted a span {
 /*------------------------------------------------------------------------------
   11.2 - Post Revisions
 ------------------------------------------------------------------------------*/
+.wp-slider .ui-slider-handle.from-handle:before,
+.wp-slider .ui-slider-handle.to-handle:before {
+       height: 8px;
+       width: 7px;
+}
+
+.wp-slider .ui-slider-handle.from-handle:before {
+       background-position: -5px -10px;
+       left: 6px;
+}
+
+.wp-slider .ui-slider-handle.to-handle:before {
+       background-position: -4px -29px;
+       left: 6px;
+}
+
+.revision-toggle-compare-mode {
+       right: auto;
+       left: 0;
+}
+
+.revisions .loading-indicator {
+       margin-right: -90px;
+}
+
+body.folded .revisions .loading-indicator {
+       margin-right: -32px;
+}
+
+.revisions-next {
+       float: left;
+}
+
+.revisions-previous {
+       float: right;
+}
+
+.diff-title strong {
+       text-align: left;
+       float: right;
+       margin-right: 0;
+       margin-left: 5px;
+}
+
+.revisions-controls .author-card .avatar,
+.revisions-controls .author-card .author-info {
+       float: right;
+}
+
+.diff-meta input.restore-revision {
+       float: left;
+}
+
+.diff-col-title-added,
+.diff-col-title-removed {
+       text-align: right;
+       float: right;
+}
 
-table.diff td, table.diff th {
-       font-family: Consolas, Monaco, monospace;
+.revisions-tooltip {
+       margin-left: 0;
+       margin-right: -69px;
+}
+
+.revisions-tooltip.flipped {
+       margin-right: 0;
+       margin-left: -70px;
+}
+
+.ie8 .revisions-tooltip {
+       margin-right: -75px;
+}
+
+.ie8 .revisions-tooltip.flipped {
+       margin-left: -63px;
+}
+
+.revisions-tooltip-arrow {
+       right: 0;
+       margin-left: 0;
+       margin-right: 35px;
+}
+
+.revisions-tooltip.flipped .revisions-tooltip-arrow {
+       margin-right: 0;
+       margin-left: 35px;
+       right: auto;
+       left: 0;
+}
+
+.revisions-tooltip-arrow > span {
+       left: auto;
+       right: 20px;
+}
+
+.revisions-tooltip.flipped .revisions-tooltip-arrow > span {
+       right: auto;
+       left: 20px;
+}
+
+.ie8 .revisions-tooltip-arrow > span {
+       right: 21px;
+}
+
+.revisions-tickmarks > div {
+       float: right;
+       border-width: 0 0 0 1px;
 }
 
 /*------------------------------------------------------------------------------
@@ -963,6 +1097,62 @@ table.diff td, table.diff th {
        float: right;
 }
 
+/*------------------------------------------------------------------------------
+  11.4 - Post formats
+------------------------------------------------------------------------------*/
+
+a.post-state-format {
+       margin-right: 0;
+       margin-left: 5px;
+}
+
+label.post-format-icon {
+       margin-left: 0;
+       margin-right: 5px;
+       padding-left: 0px;
+       padding-right: 21px;
+}
+
+.post-format-icon.post-format-standard  {
+       background-position: 100% 0;
+}
+
+.post-format-icon.post-format-image  {
+       background-position: 100% -32px;
+}
+
+.post-format-icon.post-format-gallery {
+       background-position: 100% -64px;
+}
+
+.post-format-icon.post-format-audio {
+       background-position: 100% -96px;
+}
+
+.post-format-icon.post-format-video {
+       background-position: 100% -128px;
+}
+
+.post-format-icon.post-format-chat {
+       background-position: 100% -160px;
+}
+
+.post-format-icon.post-format-status {
+       background-position: 100% -192px;
+}
+
+.post-format-icon.post-format-aside {
+       background-position: 100% -224px;
+}
+
+.post-format-icon.post-format-quote {
+       background-position: 100% -256px;
+}
+
+.post-format-icon.post-format-link {
+       background-position: 100% -288px;
+}
+
 /*------------------------------------------------------------------------------
   12.0 - Categories
 ------------------------------------------------------------------------------*/
@@ -1448,6 +1638,18 @@ h2 .nav-tab {
        font-family: Tahoma, Arial, sans-serif;
 }
 
+#permalink_structure {
+       float: right;
+}
+
+.options-permalink-php code {
+       unicode-bidi: embed;
+}
+
+.options-permalink-php #rules {
+       direction: ltr;
+}
+
 /*------------------------------------------------------------------------------
   21.0 - Admin Footer
 ------------------------------------------------------------------------------*/
@@ -1527,7 +1729,8 @@ h2 .nav-tab {
        margin: 0 0 10px 0.7%;
 }
 
-.about-wrap .feature-section.images-stagger-right img {
+.about-wrap .feature-section.images-stagger-right img,
+.about-wrap .feature-section.images-stagger-right .video {
        float: left;
        margin: 0 2em 12px 5px;
 }
@@ -1544,16 +1747,22 @@ h2 .nav-tab {
        margin-left: 10px;
 }
 
+@media only screen and (max-width: 900px) {
+       .about-wrap .feature-section.images-stagger-right .video.image-66 {
+               margin-right: 3px;
+       }
+}
+
 @media only screen and (max-width: 768px) {
-       .about-wrap .feature-section img.image-66 {
+       .about-wrap .feature-section .image-66 {
                float: none;
        }
 
-       .about-wrap .feature-section.images-stagger-right img.image-66 {
+       .about-wrap .feature-section.images-stagger-right .image-66 {
                margin-right: 3px;
        }
 
-       .about-wrap .feature-section.images-stagger-left img.image-66 {
+       .about-wrap .feature-section.images-stagger-left .image-66 {
                margin-left: 3px;
        }
 }
@@ -1717,9 +1926,10 @@ table .column-rating {
 }
 
 /* Collapse Button */
-.wp-full-overlay .collapse-sidebar {
-       right: 0;
+.wp-full-overlay a.collapse-sidebar {
        left: auto;
+       right: 0;
+       margin-left: 0;
        margin-right: 15px;
 }
 
@@ -1730,7 +1940,7 @@ table .column-rating {
 .wp-full-overlay .collapse-sidebar-arrow {
        margin-right: 2px;
        margin-left: 0;
-       background: transparent url('../images/arrows.png') no-repeat 0 -108px;
+       background: transparent url('../images/arrows.png') no-repeat 1px -108px;
 }
 
 .wp-full-overlay.collapsed .collapse-sidebar-arrow {
@@ -2083,6 +2293,27 @@ body.login {
        float: right;
 }
 
+.menu-location-menus select {
+       float: right;
+}
+
+.locations-row-links {
+       float: right;
+       margin: 4px 6px 0 0;
+}
+
+.locations-add-menu-link {
+       direction: rtl;
+}
+
+.locations-edit-menu-link {
+       border-left: 1px solid #CCCCCC;
+       border-right: 0;
+       padding-left: 6px;
+       padding-right: 0;
+       float: right;
+}
+
 /* Menu Container */
 #menu-management-liquid {
        float: right;
@@ -2141,9 +2372,11 @@ body.login {
 }
 
 /* Add Menu Item Boxes */
-.postbox .howto input {
+.postbox .howto input,
+.accordion-container .howto input {
        float: left;
 }
+
 #nav-menu-theme-locations .button-controls {
        text-align: left;
 }
@@ -2202,12 +2435,23 @@ body.login {
 .menu-item-handle .item-title {
        margin-left:13em;
        margin-right:0;
+       overflow: hidden;
 }
 .menu-item-handle .item-edit {
        right: auto;
        left: -20px;
 }
 
+.menu-item-handle .menu-item-title {
+       float: right;
+}
+
+.menu-item-settings .field-move a,
+.menu-item-settings .field-move span {
+       float: right;
+       margin-left: 4px;
+}
+
 /* WARNING: The factor of 30px is hardcoded into the nav-menus javascript. */
 .menu-item-depth-0 { margin-right: 0px; margin-left:0;}
 .menu-item-depth-1 { margin-right: 30px; margin-left:0;}
@@ -2305,10 +2549,6 @@ body.login {
        margin-right:0;
 }
 
-.auto-add-pages {
-       float: right;
-}
-
 /* Star ratings */
 div.star-holder {
        background: url('../images/stars-rtl.png?ver=20121108') repeat-x bottom right;
@@ -2318,27 +2558,17 @@ div.star-holder .star-rating {
        float: right;
 }
 
+#plugin-information .wrap {
+       margin: 4px 15px 0 0;
+}
+
 #plugin-information ul#sidemenu {
        left: auto;
        right: 0;
 }
 
-#plugin-information h2 {
-       margin-right: 0;
-       margin-left: 200px;
-}
-
 #plugin-information .fyi {
-       margin-left: 5px;
-       margin-right: 20px;
-}
-
-#plugin-information .fyi h2 {
-       margin-left: 0;
-}
-
-#plugin-information .fyi ul {
-       padding: 10px 7px 10px 5px;
+       float: right;
 }
 
 #plugin-information #section-screenshots li p {
@@ -2346,13 +2576,6 @@ div.star-holder .star-rating {
        padding-right: 20px;
 }
 
-#plugin-information #section-screenshots ol,
-#plugin-information .updated,
-#plugin-information pre {
-       margin-right: 0;
-       margin-left: 215px;
-}
-
 #plugin-information .updated,
 #plugin-information .error {
        clear: none;
@@ -2441,6 +2664,14 @@ h3.tb {
        left: 25px;
 }
 
+#TB_closeAjaxWindow {
+       float: left;
+}
+
+#TB_ajaxWindowTitle {
+       float: right;
+}
+
 #post_status {
        margin-left: 0;
        margin-right: 10px;
@@ -2536,9 +2767,64 @@ div.sidebar-name h3 {
        direction: ltr;
 }
 
-/**
- * HiDPI Displays
- */
+.control-section .accordion-section-title {
+       font-family: Tahoma, Arial, sans-serif;
+}
+
+.js .accordion-section-title:after {
+       right: auto;
+       left: 20px;
+}
+
+/*------------------------------------------------------------------------------
+  28.0 - Nav Menus
+------------------------------------------------------------------------------*/
+.nav-menus-php .major-publishing-actions .publishing-action {
+       float: left;
+}
+
+.menu-settings dd {
+       float: right;
+}
+
+.manage-menus span {
+       float: right;
+}
+
+.manage-menus select {
+       float: right;
+       margin-right: 0;
+       margin-left: 6px;
+}
+
+.manage-menus .submit-btn {
+       float: right;
+}
+
+.manage-menus .selected-menu {
+       float: right;
+       margin: 5px 0 0 6px;
+}
+
+.nav-menus-php .add-new-menu-action {
+       float: right;
+       margin: 4px 6px 0 0;
+}
+
+.nav-menus-php .meta-sep,
+.nav-menus-php .submitdelete,
+.nav-menus-php .submitcancel {
+       float: right;
+}
+
+.is-submenu {
+       float: right;
+       margin-right: 8px;
+}
+
+/*------------------------------------------------------------------------------
+  29.0 - HiDPI
+------------------------------------------------------------------------------*/
 @media print,
   (-o-min-device-pixel-ratio: 5/4),
   (-webkit-min-device-pixel-ratio: 1.25),
@@ -2572,6 +2858,12 @@ div.sidebar-name h3 {
        #content-resize-handle {
                background: transparent url('../images/resize-rtl-2x.gif') no-repeat scroll left bottom;
        }
+
+       .wp-slider .ui-slider-handle:before {
+               background-image: url(../images/arrows-pr-2x.png);
+               background-size: 16px 102px;
+       }
+
 }
 
 /* =Localized CSS
@@ -2590,8 +2882,6 @@ body.locale-he-il,
 .locale-he-il .inline-edit-row fieldset span.title,
 .locale-he-il .inline-edit-row fieldset span.checkbox-title,
 .locale-he-il .inline-edit-row fieldset ul.cat-checklist label,
-.locale-he-il .inline-edit-row .catshow,
-.locale-he-il .inline-edit-row .cathide,
 .locale-he-il .inline-edit-row #bulk-titles div,
 .locale-he-il p.help,
 .locale-he-il p.description,
index 8bcf2eeeb23dca1d66ebd656c1dbb1aaf0fa50ea..b8b6fe8b01b3a0e1c727db698e25b494c3f623fc 100644 (file)
@@ -1 +1 @@
-ol{margin-left:0;margin-right:2em}.code,code{font-family:monospace;direction:ltr}.quicktags,.search{font:12px Tahoma,Arial,sans-serif}.icon32{float:right;margin-right:0;margin-left:8px}.icon16{float:right;margin-right:-8px;margin-left:0}.howto{font-style:normal;font-family:Tahoma,Arial,sans-serif}p.install-help{font-style:normal}#doaction,#doaction2,#post-query-submit{margin-right:0;margin-left:8px}#timezone_string option{margin-left:0;margin-right:1em}#pass-strength-result{float:right;margin:13px 1px 5px 5px}p.search-box{float:left}.search-box input[name="s"],#search-plugins input[name="s"],.tagsdiv .newtag{float:right;margin-right:0;margin-left:4px}input[type=password]{direction:ltr}input[type="text"].ui-autocomplete-loading{background:transparent url('../images/loading.gif') no-repeat left center}ul#add-to-blog-users{margin:0 14px 0 0}.ui-autocomplete li{text-align:right}#delete-action{float:right}#publishing-action{float:left;text-align:left}#publishing-action .spinner{float:right}#post-body .misc-pub-section{border-right:0;border-left-width:1px;border-left-style:solid}#post-body .misc-pub-section-last{border-left:0}#minor-publishing-actions{padding:10px 8px 2px 10px;text-align:left}#save-post{float:right}.preview{float:left}#sticky-span{margin-left:0;margin-right:18px}.side-info ul{padding-left:0;padding-right:18px}td.action-links,th.action-links{text-align:left}form.upgrade .hint{font-style:normal}#ajax-response.alignleft{margin-left:0;margin-right:2em}#quicktags{background-position:right top}#ed_reply_toolbar input{margin:1px 1px 1px 2px}#wphead{height:32px;margin-left:15px;margin-right:2px}#header-logo{float:right}#wphead h1{float:right}#screen-meta-links{margin-right:0;margin-left:24px}#screen-meta{margin-right:5px;margin-left:15px}#screen-options-link-wrap,#contextual-help-link-wrap{float:left;margin-left:0;margin-right:6px}#screen-meta-links a.show-settings{padding-right:6px;padding-left:16px}.toggle-arrow{background-position:top right}.toggle-arrow-active{background-position:bottom right}.metabox-prefs label{padding-right:0;padding-left:15px}.metabox-prefs label input{margin-right:2px;margin-left:5px}#contextual-help-wrap{margin-left:0;margin-right:-4px}#contextual-help-back{left:170px;right:150px}#contextual-help-wrap.no-sidebar #contextual-help-back{left:0;right:150px;border-right-width:1px;border-left-width:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-webkit-border-bottom-left-radius:2px;border-bottom-left-radius:2px}.contextual-help-tabs{float:right}.contextual-help-tabs a{padding-left:5px;padding-right:12px}.contextual-help-tabs .active{margin-right:0;margin-left:-1px}.contextual-help-tabs .active,.contextual-help-tabs-wrap{border-left:0;border-right-width:1px}.help-tab-content{margin-right:0;margin-left:22px}.help-tab-content li{margin-left:0;margin-right:18px}.contextual-help-sidebar{float:left;padding-right:12px;padding-left:8px}.folded #wpcontent{margin-left:0;margin-right:52px}.folded.wp-admin #wpfooter{margin-left:15px;margin-right:52px}#adminmenuback,#adminmenuwrap{border-width:0 0 0 1px}#adminmenushadow{right:auto;left:0}#adminmenu li .wp-submenu{left:auto;right:146px}.folded #adminmenu .wp-submenu.sub-open,.folded #adminmenu .opensub .wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,.folded #adminmenu .wp-has-current-submenu.opensub .wp-submenu,.folded #adminmenu a.menu-top:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu a.menu-top:focus+.wp-submenu,.no-js.folded #adminmenu .wp-has-submenu:hover .wp-submenu{left:auto;right:32px}#adminmenu div.wp-menu-image,.folded #adminmenu div.wp-menu-image{float:right;width:30px}#adminmenu .wp-submenu a,#adminmenu li li a,.folded #adminmenu .wp-not-current-submenu li a{padding-left:0;padding-right:12px}#adminmenu .wp-not-current-submenu li a{padding-left:0;padding-right:18px}.wp-menu-arrow{right:0;-moz-transform:translate(-139px);-webkit-transform:translate(-139px);-o-transform:translate(-139px);-ms-transform:translate(-139px);transform:translate(-139px)}.ie8 .wp-menu-arrow{right:-20px}#adminmenu .wp-menu-arrow div{left:-8px;width:16px}#adminmenu li.wp-not-current-submenu .wp-menu-arrow{-moz-transform:translate(-138px);-webkit-transform:translate(-138px);-o-transform:translate(-138px);-ms-transform:translate(-138px);transform:translate(-138px)}.folded #adminmenu li .wp-menu-arrow{-moz-transform:translate(-26px);-webkit-transform:translate(-26px);-o-transform:translate(-26px);-ms-transform:translate(-26px);transform:translate(-26px)}#adminmenu .wp-not-current-submenu .wp-menu-arrow div{border-style:solid solid none none;border-width:1px 1px 0 0}#adminmenu .wp-menu-image img{padding:7px 7px 0 0}#adminmenu .wp-submenu .wp-submenu-head{padding:5px 10px 5px 4px;-webkit-border-top-right-radius:0;-webkit-border-top-left-radius:3px;border-top-right-radius:0;border-top-left-radius:3px}.folded #adminmenu li.wp-has-current-submenu .wp-submenu{border-width:1px;border-style:solid;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:3px;-webkit-border-top-right-radius:0;-webkit-border-top-left-radius:3px;border-bottom-right-radius:0;border-bottom-left-radius:3px;border-top-right-radius:0;border-top-left-radius:3px}#adminmenu .awaiting-mod,#adminmenu span.update-plugins,#sidemenu li a span.update-plugins{font-family:Tahoma,Arial,sans-serif;margin-left:0;margin-right:7px}#collapse-button{float:right}@media only screen and (max-width:900px){.auto-fold #wpcontent{margin-left:0;margin-right:52px}.auto-fold.wp-admin #wpfooter{margin-left:15px;margin-right:52px}.auto-fold #adminmenu div.wp-menu-image{float:right;width:30px}.auto-fold #adminmenu .wp-submenu.sub-open,.auto-fold #adminmenu .opensub .wp-submenu,.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,.auto-fold #adminmenu .wp-has-current-submenu.opensub .wp-submenu,.auto-fold #adminmenu a.menu-top:focus+.wp-submenu,.auto-fold #adminmenu .wp-has-current-submenu a.menu-top:focus+.wp-submenu,.no-js.auto-fold #adminmenu .wp-has-submenu:hover .wp-submenu{left:auto;right:32px}.auto-fold #adminmenu .wp-not-current-submenu li a{padding-left:0;padding-right:12px}.auto-fold #adminmenu li .wp-menu-arrow{-moz-transform:translate(-27px);-webkit-transform:translate(-27px);-o-transform:translate(-27px);-ms-transform:translate(-27px);transform:translate(-27px)}.auto-fold #adminmenu li.wp-has-current-submenu .wp-submenu{border-width:1px;border-style:solid;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:3px;-webkit-border-top-right-radius:0;-webkit-border-top-left-radius:3px;border-bottom-right-radius:0;border-bottom-left-radius:3px;border-top-right-radius:0;border-top-left-radius:3px}}.post-com-count-wrapper{font-family:Tahoma,Arial,sans-serif}.post-com-count{background-image:url('../images/bubble_bg-rtl.gif')}.column-response .post-com-count{float:right;margin-right:0;margin-left:5px}.response-links{float:right}.widefat th{font-family:Tahoma,Arial,sans-serif}.postbox-container{float:right}#post-body-content{float:right}#poststuff #post-body.columns-2{margin-left:300px;margin-right:0}#post-body.columns-2 #postbox-container-1{float:left;margin-left:-300px;margin-right:0}@media only screen and (max-width:850px){#wpbody-content #post-body.columns-2 #postbox-container-1{margin-left:0}}.postbox .handlediv{float:left}#the-comment-list p.comment-author img{float:right;margin-right:0;margin-left:8px}#dashboard_browser_nag p.browser-update-nag.has-browser-icon{padding-right:0;padding-left:125px}.welcome-panel .welcome-panel-close{right:auto;left:10px}.welcome-panel .welcome-panel-close:before{left:auto;right:-12px}.welcome-panel-content{margin-left:0;margin-right:13px}.welcome-panel .welcome-panel-column{float:right}.welcome-panel .welcome-panel-column ul{margin-right:0;margin-left:1em}.welcome-panel .welcome-panel-column li{padding-left:0;padding-right:2px}.welcome-panel .welcome-add-page{background-position:right 2px}.welcome-panel .welcome-edit-page{background-position:right -90px}.welcome-panel .welcome-learn-more{background-position:right -136px}.welcome-panel .welcome-comments{background-position:right -182px}.welcome-panel .welcome-view-site{background-position:right -274px}.welcome-panel .welcome-widgets-menus{background-position:right -229px;line-height:14px}.welcome-panel .welcome-write-blog{background-position:right -44px}.welcome-panel .welcome-icon{padding:2px 32px 8px 0}@media screen and (max-width:870px){.welcome-panel .welcome-panel-column li{margin-right:0;margin-left:13px}.welcome-panel .welcome-icon{padding-right:25px;padding-left:0}}.fixed .column-comments{text-align:right}.fixed .column-comments .vers{padding-left:0;padding-right:3px}.fixed .column-comments a{float:right}.sorting-indicator{margin-left:0;margin-right:7px}th.sortable a span,th.sorted a span{float:right}.tablenav-pages a{margin-right:0;margin-left:1px}.tablenav-pages .next-page{margin-left:0;margin-right:2px}.tablenav a.button-secondary{margin:3px 0 0 8px}.tablenav .tablenav-pages{float:left}.tablenav .displaying-num{margin-right:0;margin-left:10px;font-family:Tahoma,Arial,sans-serif;font-style:normal}.tablenav .actions{padding:2px 0 0 8px}.tablenav .actions select{float:right;margin-right:0;margin-left:6px}.tablenav .delete{margin-right:0;margin-left:20px}.view-switch{float:left}.filter{float:right;margin:-5px 10px 0 0}.filter .subsubsub{margin-left:0;margin-right:-10px}#posts-filter fieldset{float:right;margin:0 0 1em 1.5ex}#posts-filter fieldset legend{padding:0 1px .2em 0}#wpbody-content .inline-edit-row fieldset{float:right}#wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inline-edit-col{border-width:0 1px 0 0}#wpbody-content .bulk-edit-row .inline-edit-col-bottom{float:left}.inline-edit-row fieldset label span.title{float:right}.inline-edit-row fieldset label span.input-text-wrap{margin-left:0;margin-right:5em}.quick-edit-row-post fieldset.inline-edit-col-right label span.title{padding-right:0;padding-left:.5em}#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child{margin-right:0;margin-left:.5em}.inline-edit-row fieldset span.title,.inline-edit-row fieldset span.checkbox-title{font-family:Tahoma,Arial,sans-serif;font-style:normal}.inline-edit-row fieldset .inline-edit-date{float:right}.inline-edit-row fieldset ul.cat-checklist label,.inline-edit-row .catshow,.inline-edit-row .cathide,.inline-edit-row #bulk-titles div{font-family:Tahoma,Arial,sans-serif}.quick-edit-row-post fieldset label.inline-edit-status{float:right}#bulk-titles div a{float:right;margin:3px -2px 0 3px;overflow:hidden;text-indent:-9999px}#save-action .spinner,#show-comments a,#show-comments .spinner{float:right}#titlediv #title-prompt-text,#wp-fullscreen-title-prompt-text{right:0}#sample-permalink{direction:ltr}#sample-permalink #editable-post-name{unicode-bidi:embed}#wp-fullscreen-title-prompt-text{left:auto;right:0}#wp-fullscreen-save .spinner,#wp-fullscreen-save .fs-saved{float:left}#edit-slug-box .cancel{margin-right:0;margin-left:10px}.postarea h3 label{float:right}.submitbox .submit{text-align:right}.inside-submitbox #post_status{margin:2px -2px 2px 0}.submitbox .submit input{margin-right:0;margin-left:4px}#normal-sortables .postbox .submit{float:left}.taxonomy div.tabs-panel{margin:0 125px 0 5px}#side-sortables .comments-box thead th,#normal-sortables .comments-box thead th{font-style:normal}#commentsdiv .spinner{padding-left:0;padding-right:5px}#post-body .add-menu-item-tabs li.tabs{border-width:1px 1px 1px 0;margin-right:0;margin-left:-1px}#post-body .tagsdiv #newtag{margin-right:0;margin-left:5px}.autosave-info{padding:2px 2px 2px 15px;text-align:left}#post-body .wp_themeSkin .mceStatusbar a.mceResize{background:transparent url('../images/resize-rtl.gif') no-repeat scroll left bottom;cursor:sw-resize}.curtime #timestamp{background-position:right top;padding-left:0;padding-right:18px}.compat-attachment-fields th{padding-right:0;padding-left:10px}table.diff td,table.diff th{font-family:Consolas,Monaco,monospace}#select-featured-image a{float:right}.category-adder{margin-left:0;margin-right:120px}#post-body ul.add-menu-item-tabs{float:right;text-align:left;margin:0 5px 0 -120px}#post-body ul.add-menu-item-tabs li.tabs{-webkit-border-top-left-radius:0;-webkit-border-top-right-radius:3px;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:3px;border-top-left-radius:0;border-top-right-radius:3px;border-bottom-left-radius:0;border-bottom-right-radius:3px}#front-page-warning,#front-static-pages ul,ul.export-filters,.inline-editor ul.cat-checklist ul,.categorydiv ul.categorychecklist ul,.customlinkdiv ul.categorychecklist ul,.posttypediv ul.categorychecklist ul,.taxonomydiv ul.categorychecklist ul{margin-left:0;margin-right:18px}#post-body .add-menu-item-tabs li.tabs{border-style:solid solid solid none;border-width:1px 1px 1px 0;margin-right:0;margin-left:-1px}p.help,p.description,span.description,.form-wrap p{font-style:normal;font-family:Tahoma,Arial,sans-serif}.taghint{margin:15px 12px -24px 0}#poststuff .tagsdiv .howto{margin:0 8px 6px 0}.ac_results li{text-align:right}.links-table th{text-align:right}#wpbody-content .describe th{text-align:right}.describe .media-item-info .A1B1{padding:0 10px 0 0}.media-upload-form td label{margin-left:6px;margin-right:2px}.media-upload-form .align .field label{padding:0 23px 0 0;margin:0 3px 0 1em}.media-upload-form tr.image-size label{margin:0 5px 0 0}#wpbody-content .describe p.help{padding:0 5px 0 0}.media-item .edit-attachment,.media-item .error-div a.dismiss,.describe-toggle-on,.describe-toggle-off{float:left;margin-right:0;margin-left:15px}.media-item .error-div a.dismiss{padding:0 15px 0 0}.media-item .error-div{padding-left:0;padding-right:10px}.media-item .pinkynail{float:right}.media-item .describe td{padding:0 0 8px 8px}.media-item .progress{float:left;margin:6px 0 0 10px}#find-posts-input{float:right}#find-posts-search{float:right;margin-right:3px;margin-left:4px}.find-box-search .spinner{left:auto;right:115px}#find-posts-response .found-radio{padding:5px 8px 0 0}.find-box-search label{padding-right:0;padding-left:6px}.find-box #resize-se{right:auto;left:1px}form.upgrade .hint{font-style:normal}.wp_attachment_image .button,.A1B1 .button{float:right}.wp_attachment_image .spinner,.A1B1 .spinner{float:right}.imgedit-menu div{float:right}.imgedit-crop{margin:0}.imgedit-rleft,.imgedit-flipv,.imgedit-undo{margin:0 8px 0 3px}.imgedit-rright,.imgedit-fliph,.imgedit-redo{margin:0 3px}.imgedit-applyto img{margin:0 0 0 8px}.imgedit-help{font-style:normal}.imgedit-submit-btn{margin-left:0;margin-right:20px}.form-table th{text-align:right}.form-table input.tog{margin-right:0;margin-left:2px;float:right}.form-table table.color-palette{float:right}#replysubmit .spinner,.inline-edit-save .spinner{float:left}#replysubmit .button{margin-right:0;margin-left:5px}#edithead .inside{float:right;padding:3px 5px 2px 0}.comment-ays th{border-right-style:none;border-left-style:solid;border-right-width:0;border-left-width:1px}.spam-undo-inside .avatar,.trash-undo-inside .avatar{margin-left:8px}#comment-status-radio input{margin:2px 0 5px 3px}h3.available-themes{float:right}.available-theme{margin-right:0;margin-left:10px;padding:20px 0 20px 20px}#current-theme .theme-info li,.theme-options li,.available-theme .action-links li{float:right;padding-right:0;padding-left:10px;margin-right:0;margin-left:10px;border-right:0;border-left:1px solid #dfdfdf}.available-theme .action-links li{padding-left:8px;margin-left:8px}.ie8 .available-theme .action-links li{padding-left:7px;margin-left:7px}#current-theme .theme-info li:last-child,.theme-options li:last-child,.available-theme .action-links li:last-child{padding-left:0;margin-right:0;border-left:0}.available-theme .action-links .delete-theme{float:left;margin-left:0;margin-right:8px}.available-theme .action-links p{float:right}#current-theme.has-screenshot{padding-left:0;padding-right:330px}#current-theme h4 span{margin-left:0;margin-right:20px}#current-theme img{float:right;width:300px;margin-left:0;margin-right:-330px}.theme-options .load-customize{margin-right:0;margin-left:30px;float:right}.theme-options span{float:right;margin-right:0;margin-left:10px}.theme-options ul{float:right}@media only screen and (max-width:1200px){#current-theme.has-screenshot{padding-right:270px}#current-theme img{margin-right:-270px;width:240px}}#broken-themes{text-align:right}.appearance_page_custom-header .available-headers .default-header{float:right;margin:0 0 20px 20px}.appearance_page_custom-header .random-header{margin:0 0 20px 20px}.appearance_page_custom-header .available-headers label input,.appearance_page_custom-header .random-header label input{margin-right:0;margin-left:10px}.nav-tab{margin:0 0 -1px 6px}h2 .nav-tab{font-family:Tahoma,Arial,sans-serif}.plugins .desc ul,.plugins .desc ol{margin:0 2em 0 0}#wpbody-content .plugins .plugin-title,#wpbody-content .plugins .theme-title{padding-right:0;padding-left:12px}#profile-page .form-table #rich_editing{margin-right:0;margin-left:5px}#profile-page #pass1,#profile-page #pass2,#profile-page #user_login{direction:ltr}#your-profile legend{font-family:Tahoma,Arial,sans-serif}.pressthis a span{background-position:right 5px;padding:8px 27px 8px 11px}.pressthis a:after{right:auto;left:10px;background:transparent;transform:skew(-20deg) rotate(-6deg);-webkit-transform:skew(-20deg) rotate(-6deg);-moz-transform:skew(-20deg) rotate(-6deg)}.pressthis a:hover:after{transform:skew(-20deg) rotate(-9deg);-webkit-transform:skew(-20deg) rotate(-9deg);-moz-transform:skew(-20deg) rotate(-9deg)}#utc-time,#local-time{padding-left:0;padding-right:25px;font-style:normal;font-family:Tahoma,Arial,sans-serif}#wpfooter{margin-left:20px}#wpcontent,#wpfooter{margin-right:165px}.wrap.about-wrap{margin-left:40px;margin-right:20px}.about-wrap h1,.about-text{margin-right:0;margin-left:200px}.about-wrap h2.nav-tab-wrapper{padding-left:0;padding-right:6px}.about-wrap .wp-badge{right:auto;left:0}.about-wrap h2 .nav-tab{margin-right:0;margin-left:3px}.about-wrap .changelog li{margin-left:0;margin-right:3em}.about-wrap .three-col-images .last-feature{float:left}.about-wrap .three-col-images .first-feature{float:right}.about-wrap .feature-section.three-col div{margin-right:0;margin-left:4.999999999%;float:right}.about-wrap .feature-section.three-col h4{text-align:right}.about-wrap .feature-section.three-col img{margin-right:5px;margin-left:0}.about-wrap .feature-section.three-col .last-feature{margin-left:0}.about-wrap .feature-section img{margin:0 0 10px .7%}.about-wrap .feature-section.images-stagger-right img{float:left;margin:0 2em 12px 5px}.about-wrap .feature-section.images-stagger-left img{float:right;margin:0 5px 12px 2em}.about-wrap li.wp-person,.about-wrap li.wp-person img.gravatar{float:right;margin-right:0;margin-left:10px}@media only screen and (max-width:768px){.about-wrap .feature-section img.image-66{float:none}.about-wrap .feature-section.images-stagger-right img.image-66{margin-right:3px}.about-wrap .feature-section.images-stagger-left img.image-66{margin-left:3px}}#template div{margin-right:0;margin-left:190px}.column-author img,.column-username img{float:right;margin-right:0;margin-left:10px}.tagchecklist{margin-left:0;margin-right:14px}.tagchecklist strong{margin-left:0;margin-right:-8px}.tagchecklist span{margin-right:0;margin-left:25px;float:right}.tagchecklist span a{margin:6px -9px 0 0;float:right}#poststuff h2{clear:right}#poststuff h3,.metabox-holder h3{font-family:Tahoma,Arial,sans-serif}.tool-box .title{font-family:Tahoma,Arial,sans-serif}#sidemenu{margin:-30px 315px 0 15px;float:left;padding-left:0;padding-right:10px}#sidemenu a{float:right}table .vers,table .column-visible,table .column-rating{text-align:right}.screen-meta-toggle{right:auto;left:15px}.screen-reader-text,.screen-reader-text span,.ui-helper-hidden-accessible{left:auto;right:-1000em}.screen-reader-shortcut:focus{left:auto;right:6px}* html #template div{margin-left:0}#editorcontainer .wp_themeSkin .mceStatusbar{padding-left:0;padding-right:5px}#editorcontainer .wp_themeSkin .mceStatusbar div{float:right}#editorcontainer .wp_themeSkin .mceStatusbar a.mceResize{float:left}#content-resize-handle{background:transparent url('../images/resize-rtl.gif') no-repeat scroll left bottom;right:auto;left:2px;cursor:sw-resize}.wp-full-overlay .wp-full-overlay-sidebar{margin:0;left:auto;right:0;border-right:0;border-left:1px solid rgba(0,0,0,0.2)}.wp-full-overlay-sidebar:after{right:auto;left:0;box-shadow:inset 5px 0 4px -4px rgba(0,0,0,0.1)}.wp-full-overlay.collapsed,.wp-full-overlay.expanded .wp-full-overlay-sidebar{margin-right:0!important}.wp-full-overlay.expanded{margin-right:300px;margin-left:0}.wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-right:-300px;margin-left:0}.wp-full-overlay .collapse-sidebar{right:0;left:auto;margin-right:15px}.wp-full-overlay.collapsed .collapse-sidebar{right:100%}.wp-full-overlay .collapse-sidebar-arrow{margin-right:2px;margin-left:0;background:transparent url('../images/arrows.png') no-repeat 0 -108px}.wp-full-overlay.collapsed .collapse-sidebar-arrow{background-position:0 -72px}.wp-full-overlay .collapse-sidebar-label{right:100%;left:auto;margin-right:10px;margin-left:0}.install-theme-info .theme-install{float:left}#wpcontent{margin-left:0;margin-right:165px}#wpbody-content{float:right}#adminmenuwrap{float:right}#adminmenu{clear:right}.inner-sidebar{float:left;clear:left}.has-right-sidebar #post-body{float:right;clear:right;margin-right:0;margin-left:-340px}.has-right-sidebar #post-body-content{margin-right:0;margin-left:300px}#col-right{float:left;clear:left}.alignleft{float:right}.alignright{float:left}.textleft{text-align:right}.textright{text-align:left}body,td,textarea,input,select{font-family:Tahoma,Arial,sans-serif}ul.ul-disc,ul.ul-square,ol.ol-decimal{margin-left:0;margin-right:1.8em}.subsubsub{float:right}.widefat thead th:first-of-type{-webkit-border-top-left-radius:0;-webkit-border-top-right-radius:3px;border-top-left-radius:0;border-top-right-radius:3px}.widefat thead th:last-of-type{-webkit-border-top-right-radius:0;-webkit-border-top-left-radius:3px;border-top-right-radius:0;border-top-left-radius:3px}.widefat tfoot th:first-of-type{-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:3px;border-bottom-left-radius:0;border-bottom-right-radius:3px}.widefat tfoot th:last-of-type{-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:3px;border-bottom-right-radius:0;border-bottom-left-radius:3px}.widefat th{text-align:right}.widefat th input{margin:0 8px 0 0}.wrap{margin-right:0;margin-left:15px}.wrap h2,.subtitle{font-family:Tahoma,Arial,sans-serif}.wrap h2{padding-right:0;padding-left:15px}.subtitle{padding-left:0;padding-right:25px}.wrap .add-new-h2{font-family:Tahoma,Arial,sans-serif;margin-left:0;margin-right:4px}.wrap h2.long-header{padding-left:0}#dashboard-widgets-wrap .has-sidebar{margin-right:0;margin-left:-51%}#dashboard-widgets-wrap .has-sidebar .has-sidebar-content{margin-right:0;margin-left:51%}.view-all{right:auto;left:0}#dashboard_right_now p.sub,#dashboard-widgets h4,a.rsswidget,#dashboard_plugins h4,#dashboard_plugins h5,#dashboard_recent_comments .comment-meta .approve,#dashboard_right_now td.b,#dashboard_right_now .versions a{font-family:Tahoma,Arial,sans-serif}#dashboard_right_now p.sub{left:auto;right:15px}#dashboard_right_now td.b{padding-right:0;padding-left:6px;text-align:left}#dashboard_right_now .t{padding-right:0;padding-left:12px}#dashboard_right_now .table_content{float:right}#dashboard_right_now .table_discussion{float:left}#dashboard_right_now a.button{float:left;clear:left}#dashboard_plugins .inside span{padding-left:0;padding-right:5px}#dashboard-widgets h3 .postbox-title-action{right:auto;left:10px}.js #dashboard-widgets h3 .postbox-title-action{right:auto;left:30px}#the-comment-list .pingback{padding-left:0!important;padding-right:9px!important}#the-comment-list .comment-item{padding:1em 70px 1em 10px}#the-comment-list .comment-item .avatar{float:right;margin-left:0;margin-right:-60px}.rss-widget cite{text-align:left}.rss-widget span.rss-date{font-family:Tahoma,Arial,sans-serif;margin-left:0;margin-right:3px}#dashboard-widgets #dashboard_quick_press form p.submit input{float:right}#dashboard-widgets #dashboard_quick_press form p.submit #save-post{margin:0 1px 0 .7em}#dashboard-widgets #dashboard_quick_press form p.submit #publish{float:left}#dashboard-widgets #dashboard_quick_press form p.submit .spinner{margin:4px 0 0 6px}#dashboard_recent_drafts h4 abbr{font-family:Tahoma,Arial,sans-serif;margin-left:0;margin-right:3px}body.login{font-family:Tahoma,Arial,sans-serif}.login form{margin-right:8px;margin-left:0}.login form .forgetmenot{float:right}.login form .submit{float:left}#login form .submit input{font-family:Tahoma,Arial,sans-serif}.login #nav,.login #backtoblog{margin:0 16px 0 0}#login_error,.login .message{margin:0 8px 16px 0}.login #user_pass,.login #user_login,.login #user_email{margin-left:6px;margin-right:0;direction:ltr}.login h1 a{text-decoration:none}.login .button-primary{float:left}#nav-menus-frame{margin-right:300px;margin-left:0}#wpbody-content #menu-settings-column{margin-right:-300px;margin-left:0;float:right}#menu-management-liquid{float:right}#menu-management{margin-left:20px;margin-right:0}.post-body-plain{padding:10px 0 0 10px}#menu-management .nav-tabs-arrow-left{right:0;left:auto}#menu-management .nav-tabs-arrow-right{left:0;right:auto;text-align:left;font-family:Tahoma,Arial,sans-serif}#menu-management .nav-tabs{padding-right:20px;padding-left:10px}.js #menu-management .nav-tabs{float:right;margin-right:0;margin-left:-400px}#select-nav-menu-container{text-align:left}#wpbody .open-label{float:right}#wpbody .open-label span{padding-left:10px;padding-right:0}.js .input-with-default-title{font-style:normal;font-weight:bold}.postbox .howto input{float:left}#nav-menu-theme-locations .button-controls{text-align:left}.meta-sep,.submitcancel{float:right}#cancel-save{margin-left:0;margin-right:20px}.button.right,.button-secondary.right,.button-primary.right{float:left}.list-controls{float:right}.add-to-menu{float:left}#add-custom-link label span{float:right;padding-left:5px;padding-right:0}.nav-menus-php .howto span{float:right}.list li .menu-item-title input{margin-left:3px;margin-right:0}.menu-item-handle{padding-right:10px;padding-left:0}.menu-item-edit-active .menu-item-handle{-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.menu-item-handle .item-title{margin-left:13em;margin-right:0}.menu-item-handle .item-edit{right:auto;left:-20px}.menu-item-depth-0{margin-right:0;margin-left:0}.menu-item-depth-1{margin-right:30px;margin-left:0}.menu-item-depth-2{margin-right:60px;margin-left:0}.menu-item-depth-3{margin-right:90px;margin-left:0}.menu-item-depth-4{margin-right:120px;margin-left:0}.menu-item-depth-5{margin-right:150px;margin-left:0}.menu-item-depth-6{margin-right:180px;margin-left:0}.menu-item-depth-7{margin-right:210px;margin-left:0}.menu-item-depth-8{margin-right:240px;margin-left:0}.menu-item-depth-9{margin-right:270px;margin-left:0}.menu-item-depth-10{margin-right:300px;margin-left:0}.menu-item-depth-11{margin-right:330px;margin-left:0}.menu-item-depth-0 .menu-item-transport{margin-right:0;margin-left:0}.menu-item-depth-1 .menu-item-transport{margin-right:-30px;margin-left:0}.menu-item-depth-2 .menu-item-transport{margin-right:-60px;margin-left:0}.menu-item-depth-3 .menu-item-transport{margin-right:-90px;margin-left:0}.menu-item-depth-4 .menu-item-transport{margin-right:-120px;margin-left:0}.menu-item-depth-5 .menu-item-transport{margin-right:-150px;margin-left:0}.menu-item-depth-6 .menu-item-transport{margin-right:-180px;margin-left:0}.menu-item-depth-7 .menu-item-transport{margin-right:-210px;margin-left:0}.menu-item-depth-8 .menu-item-transport{margin-right:-240px;margin-left:0}.menu-item-depth-9 .menu-item-transport{margin-right:-270px;margin-left:0}.menu-item-depth-10 .menu-item-transport{margin-right:-300px;margin-left:0}.menu-item-depth-11 .menu-item-transport{margin-right:-330px;margin-left:0}.item-type{padding-left:10px;padding-right:0}.item-controls{left:20px;right:auto}.item-controls .item-order{padding-left:10px;padding-right:0}.item-edit{left:-20px;right:auto;-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:0;border-bottom-right-radius:3px;border-bottom-left-radius:0}.menu-item-settings{padding:10px 10px 10px 0;border-width:0 1px 1px 1px}#custom-menu-item-url{direction:ltr}.link-to-original{font-style:normal;font-weight:bold}.link-to-original a{padding-right:4px;padding-left:0}.menu-item-settings .description-thin,.menu-item-settings .description-wide{margin-left:10px;margin-right:0;float:right}.major-publishing-actions .publishing-action{text-align:left;float:left}.major-publishing-actions .delete-action{text-align:right;float:right;padding-left:15px;padding-right:0}.menu-name-label{margin-left:15px;margin-right:0}.auto-add-pages{float:right}div.star-holder{background:url('../images/stars-rtl.png?ver=20121108') repeat-x bottom right}div.star-holder .star-rating{background:url('../images/stars-rtl.png?ver=20121108') repeat-x top right;float:right}#plugin-information ul#sidemenu{left:auto;right:0}#plugin-information h2{margin-right:0;margin-left:200px}#plugin-information .fyi{margin-left:5px;margin-right:20px}#plugin-information .fyi h2{margin-left:0}#plugin-information .fyi ul{padding:10px 7px 10px 5px}#plugin-information #section-screenshots li p{padding-left:0;padding-right:20px}#plugin-information #section-screenshots ol,#plugin-information .updated,#plugin-information pre{margin-right:0;margin-left:215px}#plugin-information .updated,#plugin-information .error{clear:none;direction:rtl}#plugin-information #section-holder .section{direction:ltr}.posting{margin-left:212px;margin-right:0;position:relative}h3.tb{margin-left:0;margin-right:5px}#publish{float:left}.postbox .handlediv{float:left}.actions li{float:right;margin-right:0;margin-left:10px}#extra-fields .actions{margin:-23px 0 0 -7px}#img_container a{float:right}#category-add input,#category-add select{font-family:Tahoma,Arial,sans-serif}#tagsdiv #newtag{margin-right:0;margin-left:5px}#tagadd{margin-left:0;margin-right:3px}#tagchecklist span{margin-left:.5em;margin-right:10px;float:right}#tagchecklist span a{margin:6px -9px 0 0;float:right}.submit input,.button,.button-primary,.button-secondary,#postcustomstuff .submit input{font-family:Tahoma,Arial,sans-serif}.ac_results li{text-align:right}#TB_ajaxContent #options{right:auto;left:25px}#post_status{margin-left:0;margin-right:10px}#templateside{float:left}#template textarea,#docs-list{direction:ltr}.theme-details .theme-version{float:right}.theme-details .star-holder{float:left}.feature-filter .feature-group{float:right}.feature-filter .feature-group li{padding-right:0;padding-left:25px}div.widget-liquid-left{float:right;clear:right;margin-right:0;margin-left:-325px}div#widgets-left{margin-right:5px;margin-left:325px}div.widget-liquid-right{float:left;clear:left}.inactive-sidebar .widget{float:right}div.sidebar-name h3{font-family:Tahoma,Arial,sans-serif}#widget-list .widget{float:right}.inactive-sidebar .widget-placeholder{float:right}.widget-top .widget-title-action{float:left}.widget-control-edit{padding:0 0 0 8px}.sidebar-name-arrow{float:left}.press-this-sidebar{float:left}.press-this #header-logo,.press-this #wphead h1{float:right}.ltr{direction:ltr}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.post-com-count{background-image:url('../images/bubble_bg-rtl-2x.gif');background-size:18px 100px}#content-resize-handle,#post-body .wp_themeSkin .mceStatusbar a.mceResize{background:transparent url('../images/resize-rtl-2x.gif') no-repeat scroll right bottom;background-size:11px 11px}.wp-full-overlay .collapse-sidebar-arrow{background-image:url('../images/arrows-2x.png');background-size:15px 123px}div.star-holder{background:url('../images/stars-rtl-2x.png?ver=20121108') repeat-x bottom right;background-size:21px 37px}div.star-holder .star-rating{background:url('../images/stars-rtl-2x.png?ver=20121108') repeat-x top right;background-size:21px 37px}#post-body .wp_themeSkin .mceStatusbar a.mceResize,#content-resize-handle{background:transparent url('../images/resize-rtl-2x.gif') no-repeat scroll left bottom}}body.locale-he-il,.locale-he-il .quicktags,.locale-he-il .search,.locale-he-il .howto,.locale-he-il #adminmenu .awaiting-mod,.locale-he-il #adminmenu span.update-plugins,.locale-he-il #sidemenu li a span.update-plugins,.locale-he-il .post-com-count-wrapper,.locale-he-il .widefat th,.locale-he-il .tablenav .displaying-num,.locale-he-il .inline-edit-row fieldset span.title,.locale-he-il .inline-edit-row fieldset span.checkbox-title,.locale-he-il .inline-edit-row fieldset ul.cat-checklist label,.locale-he-il .inline-edit-row .catshow,.locale-he-il .inline-edit-row .cathide,.locale-he-il .inline-edit-row #bulk-titles div,.locale-he-il p.help,.locale-he-il p.description,.locale-he-il span.description,.locale-he-il .form-wrap p,.locale-he-il h2 .nav-tab,.locale-he-il #your-profile legend,.locale-he-il #utc-time,.locale-he-il #local-time,.locale-he-il #poststuff h3,.locale-he-il .metabox-holder h3,.locale-he-il .tool-box .title,.locale-he-il td,.locale-he-il textarea,.locale-he-il input,.locale-he-il select,.locale-he-il .wrap h2,.locale-he-il .subtitle,.locale-he-il .wrap .add-new-h2,.locale-he-il #dashboard_right_now p.sub,.locale-he-il #dashboard-widgets h4,.locale-he-il a.rsswidget,.locale-he-il #dashboard_plugins h4,.locale-he-il #dashboard_plugins h5,.locale-he-il #dashboard_recent_comments .comment-meta .approve,.locale-he-il #dashboard_right_now td.b,.locale-he-il #dashboard_right_now .versions a,.locale-he-il .rss-widget span.rss-date,.locale-he-il #dashboard_recent_drafts h4 abbr,body.login.locale-he-il,.locale-he-il #login form .submit input,.locale-he-il #menu-management .nav-tabs-arrow-right,.locale-he-il #category-add input,.locale-he-il #category-add select,.locale-he-il .submit input,.locale-he-il .button,.locale-he-il .button-primary,.locale-he-il .button-secondary,.locale-he-il #postcustomstuff .submit input,.locale-he-il div.sidebar-name h3{font-family:Arial,sans-serif}.locale-he-il em{font-style:normal;font-weight:bold}
\ No newline at end of file
+ol{margin-left:0;margin-right:2em}.code,code{font-family:monospace;direction:ltr}.quicktags,.search{font:12px Tahoma,Arial,sans-serif}.icon32{float:right;margin-right:0;margin-left:8px}.icon16{float:right;margin-right:-8px;margin-left:0}.howto{font-style:normal;font-family:Tahoma,Arial,sans-serif}p.install-help{font-style:normal}#doaction,#doaction2,#post-query-submit{margin-right:0;margin-left:8px}#timezone_string option{margin-left:0;margin-right:1em}#pass-strength-result{float:right;margin:13px 1px 5px 5px}p.search-box{float:left}.search-box input[name="s"],#search-plugins input[name="s"],.tagsdiv .newtag{float:right;margin-right:0;margin-left:4px}input[type=password]{direction:ltr}input[type="text"].ui-autocomplete-loading{background:transparent url('../images/loading.gif') no-repeat left center}ul#add-to-blog-users{margin:0 14px 0 0}.ui-autocomplete li{text-align:right}#delete-action{float:right}#publishing-action{float:left;text-align:left}#publishing-action .spinner{float:right}#post-body .misc-pub-section{border-right:0;border-left-width:1px;border-left-style:solid}#post-body .misc-pub-section-last{border-left:0}#minor-publishing-actions{padding:10px 8px 2px 10px;text-align:left}#save-post{float:right}.preview{float:left}#sticky-span{margin-left:0;margin-right:18px}.side-info ul{padding-left:0;padding-right:18px}td.action-links,th.action-links{text-align:left}form.upgrade .hint{font-style:normal}#ajax-response.alignleft{margin-left:0;margin-right:2em}#quicktags{background-position:right top}#ed_reply_toolbar input{margin:1px 1px 1px 2px}#wphead{height:32px;margin-left:15px;margin-right:2px}#header-logo{float:right}#wphead h1{float:right}#screen-meta-links{margin-right:0;margin-left:24px}#screen-meta{margin-right:5px;margin-left:15px}#screen-options-link-wrap,#contextual-help-link-wrap{float:left;margin-left:0;margin-right:6px}#screen-meta-links a.show-settings{padding-right:6px;padding-left:16px}.toggle-arrow{background-position:top right}.toggle-arrow-active{background-position:bottom right}.metabox-prefs label{padding-right:0;padding-left:15px}.metabox-prefs label input{margin-right:2px;margin-left:5px}#contextual-help-wrap{margin-left:0;margin-right:-4px}#contextual-help-back{left:170px;right:150px}#contextual-help-wrap.no-sidebar #contextual-help-back{left:0;right:150px;border-right-width:1px;border-left-width:0;-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-webkit-border-bottom-left-radius:2px;border-bottom-left-radius:2px}.contextual-help-tabs{float:right}.contextual-help-tabs a{padding-left:5px;padding-right:12px}.contextual-help-tabs .active{margin-right:0;margin-left:-1px}.contextual-help-tabs .active,.contextual-help-tabs-wrap{border-left:0;border-right-width:1px}.help-tab-content{margin-right:0;margin-left:22px}.help-tab-content li{margin-left:0;margin-right:18px}.contextual-help-sidebar{float:left;padding-right:12px;padding-left:8px}.folded #wpcontent{margin-left:0;margin-right:52px}.folded.wp-admin #wpfooter{margin-left:15px;margin-right:52px}#adminmenuback,#adminmenuwrap{border-width:0 0 0 1px}#adminmenushadow{right:auto;left:0}#adminmenu li .wp-submenu{left:auto;right:146px}.folded #adminmenu .wp-submenu.sub-open,.folded #adminmenu .opensub .wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,.folded #adminmenu .wp-has-current-submenu.opensub .wp-submenu,.folded #adminmenu a.menu-top:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu a.menu-top:focus+.wp-submenu,.no-js.folded #adminmenu .wp-has-submenu:hover .wp-submenu{left:auto;right:32px}#adminmenu div.wp-menu-image,.folded #adminmenu div.wp-menu-image{float:right;width:30px}#adminmenu .wp-submenu a,#adminmenu li li a,.folded #adminmenu .wp-not-current-submenu li a{padding-left:0;padding-right:12px}#adminmenu .wp-not-current-submenu li a{padding-left:0;padding-right:18px}.wp-menu-arrow{right:0;-moz-transform:translate(-139px);-webkit-transform:translate(-139px);-o-transform:translate(-139px);-ms-transform:translate(-139px);transform:translate(-139px)}.ie8 .wp-menu-arrow{right:-20px}#adminmenu .wp-menu-arrow div{left:-8px;width:16px}#adminmenu li.wp-not-current-submenu .wp-menu-arrow{-moz-transform:translate(-138px);-webkit-transform:translate(-138px);-o-transform:translate(-138px);-ms-transform:translate(-138px);transform:translate(-138px)}.folded #adminmenu li .wp-menu-arrow{-moz-transform:translate(-26px);-webkit-transform:translate(-26px);-o-transform:translate(-26px);-ms-transform:translate(-26px);transform:translate(-26px)}#adminmenu .wp-not-current-submenu .wp-menu-arrow div{border-style:solid solid none none;border-width:1px 1px 0 0}#adminmenu .wp-menu-image img{padding:7px 7px 0 0}#adminmenu .wp-submenu .wp-submenu-head{padding:5px 10px 5px 4px;-webkit-border-top-right-radius:0;-webkit-border-top-left-radius:3px;border-top-right-radius:0;border-top-left-radius:3px}.folded #adminmenu li.wp-has-current-submenu .wp-submenu{border-width:1px;border-style:solid;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:3px;-webkit-border-top-right-radius:0;-webkit-border-top-left-radius:3px;border-bottom-right-radius:0;border-bottom-left-radius:3px;border-top-right-radius:0;border-top-left-radius:3px}#adminmenu .awaiting-mod,#adminmenu span.update-plugins,#sidemenu li a span.update-plugins{font-family:Tahoma,Arial,sans-serif;margin-left:0;margin-right:7px}#collapse-button{float:right}@media only screen and (max-width:900px){.auto-fold #wpcontent{margin-left:0;margin-right:52px}.auto-fold.wp-admin #wpfooter{margin-left:15px;margin-right:52px}.auto-fold #adminmenu div.wp-menu-image{float:right;width:30px}.auto-fold #adminmenu .wp-submenu.sub-open,.auto-fold #adminmenu .opensub .wp-submenu,.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,.auto-fold #adminmenu .wp-has-current-submenu.opensub .wp-submenu,.auto-fold #adminmenu a.menu-top:focus+.wp-submenu,.auto-fold #adminmenu .wp-has-current-submenu a.menu-top:focus+.wp-submenu,.no-js.auto-fold #adminmenu .wp-has-submenu:hover .wp-submenu{left:auto;right:32px}.auto-fold #adminmenu .wp-not-current-submenu li a{padding-left:0;padding-right:12px}.auto-fold #adminmenu li .wp-menu-arrow{-moz-transform:translate(-27px);-webkit-transform:translate(-27px);-o-transform:translate(-27px);-ms-transform:translate(-27px);transform:translate(-27px)}.auto-fold #adminmenu li.wp-has-current-submenu .wp-submenu{border-width:1px;border-style:solid;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:3px;-webkit-border-top-right-radius:0;-webkit-border-top-left-radius:3px;border-bottom-right-radius:0;border-bottom-left-radius:3px;border-top-right-radius:0;border-top-left-radius:3px}}.post-com-count-wrapper{font-family:Tahoma,Arial,sans-serif}.post-com-count{background-image:url('../images/bubble_bg-rtl.gif')}.column-response .post-com-count{float:right;margin-right:0;margin-left:5px}.response-links{float:right}.widefat th{font-family:Tahoma,Arial,sans-serif}.postbox-container{float:right}#post-body-content{float:right}#poststuff #post-body.columns-2{margin-left:300px;margin-right:0}#post-body.columns-2 #postbox-container-1{float:left;margin-left:-300px;margin-right:0}@media only screen and (max-width:850px){#wpbody-content #post-body.columns-2 #postbox-container-1{margin-left:0}}.postbox .handlediv{float:left}#the-comment-list p.comment-author img{float:right;margin-right:0;margin-left:8px}#dashboard_browser_nag p.browser-update-nag.has-browser-icon{padding-right:0;padding-left:125px}.welcome-panel .welcome-panel-close{right:auto;left:10px}.welcome-panel .welcome-panel-close:before{left:auto;right:-12px}.welcome-panel-content{margin-left:0;margin-right:13px}.welcome-panel .welcome-panel-column{float:right}.welcome-panel .welcome-panel-column ul{margin-right:0;margin-left:1em}.welcome-panel .welcome-panel-column li{padding-left:0;padding-right:2px}.welcome-panel .welcome-add-page{background-position:right 2px}.welcome-panel .welcome-edit-page{background-position:right -90px}.welcome-panel .welcome-learn-more{background-position:right -136px}.welcome-panel .welcome-comments{background-position:right -182px}.welcome-panel .welcome-view-site{background-position:right -274px}.welcome-panel .welcome-widgets-menus{background-position:right -229px;line-height:14px}.welcome-panel .welcome-write-blog{background-position:right -44px}.welcome-panel .welcome-icon{padding:2px 32px 8px 0}@media screen and (max-width:870px){.welcome-panel .welcome-panel-column li{margin-right:0;margin-left:13px}.welcome-panel .welcome-icon{padding-right:25px;padding-left:0}}.fixed .column-comments{text-align:right}.fixed .column-comments .vers{padding-left:0;padding-right:3px}.fixed .column-comments a{float:right}.fixed .column-menus{text-align:right}.sorting-indicator{margin-left:0;margin-right:7px}tr.wp-locked .locked-indicator{margin:-2px 6px 0 0}th.sortable a span,th.sorted a span{float:right}.tablenav-pages a{margin-right:0;margin-left:1px}.tablenav-pages .next-page{margin-left:0;margin-right:2px}.tablenav a.button-secondary{margin:3px 0 0 8px}.tablenav .tablenav-pages{float:left}.tablenav .displaying-num{margin-right:0;margin-left:10px;font-family:Tahoma,Arial,sans-serif;font-style:normal}.tablenav .actions{padding:2px 0 0 8px}.tablenav .actions select{float:right;margin-right:0;margin-left:6px}.tablenav .delete{margin-right:0;margin-left:20px}.view-switch{float:left}.filter{float:right;margin:-5px 10px 0 0}.filter .subsubsub{margin-left:0;margin-right:-10px}#posts-filter fieldset{float:right;margin:0 0 1em 1.5ex}#posts-filter fieldset legend{padding:0 1px .2em 0}#wpbody-content .inline-edit-row fieldset{float:right}#wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inline-edit-col{border-width:0 1px 0 0}#wpbody-content .bulk-edit-row .inline-edit-col-bottom{float:left}.inline-edit-row fieldset label span.title{float:right}.inline-edit-row fieldset label span.input-text-wrap{margin-left:0;margin-right:5em}.quick-edit-row-post fieldset.inline-edit-col-right label span.title{padding-right:0;padding-left:.5em}#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child{margin-right:0;margin-left:.5em}.inline-edit-row fieldset span.title,.inline-edit-row fieldset span.checkbox-title{font-family:Tahoma,Arial,sans-serif;font-style:normal}.inline-edit-row fieldset .inline-edit-date{float:right}.inline-edit-row fieldset ul.cat-checklist label,.inline-edit-row #bulk-titles div{font-family:Tahoma,Arial,sans-serif}.quick-edit-row-post fieldset label.inline-edit-status{float:right}#bulk-titles div a{float:right;margin:3px -2px 0 3px;overflow:hidden;text-indent:-9999px}#save-action .spinner,#show-comments a,#show-comments .spinner{float:right}#titlediv #title-prompt-text,#wp-fullscreen-title-prompt-text{right:0}#sample-permalink{direction:ltr}#sample-permalink #editable-post-name{unicode-bidi:embed}#wp-fullscreen-title-prompt-text{left:auto;right:0}#wp-fullscreen-save .spinner,#wp-fullscreen-save .fs-saved{float:left}#edit-slug-box .cancel{margin-right:0;margin-left:10px}.postarea h3 label{float:right}.submitbox .submit{text-align:right}.inside-submitbox #post_status{margin:2px -2px 2px 0}.submitbox .submit input{margin-right:0;margin-left:4px}#normal-sortables .postbox .submit{float:left}.taxonomy div.tabs-panel{margin:0 125px 0 5px}#side-sortables .comments-box thead th,#normal-sortables .comments-box thead th{font-style:normal}#commentsdiv .spinner{padding-left:0;padding-right:5px}#post-body .add-menu-item-tabs li.tabs{border-width:1px 1px 1px 0;margin-right:0;margin-left:-1px}#post-body .tagsdiv #newtag{margin-right:0;margin-left:5px}.autosave-info{padding:2px 2px 2px 15px;text-align:left}#post-body .wp_themeSkin .mceStatusbar a.mceResize{background:transparent url('../images/resize-rtl.gif') no-repeat scroll left bottom;cursor:sw-resize}.curtime #timestamp{background-position:right top;padding-left:0;padding-right:18px}.compat-attachment-fields th{padding-right:0;padding-left:10px}#post-lock-dialog .post-locked-message a.button{margin-right:0;margin-left:10px}#post-lock-dialog .post-locked-avatar{float:right;margin:0 0 20px 20px}#post-lock-dialog .locked-saving img{float:right;margin-right:0;margin-left:3px}.wp-slider .ui-slider-handle.from-handle:before,.wp-slider .ui-slider-handle.to-handle:before{height:8px;width:7px}.wp-slider .ui-slider-handle.from-handle:before{background-position:-5px -10px;left:6px}.wp-slider .ui-slider-handle.to-handle:before{background-position:-4px -29px;left:6px}.revision-toggle-compare-mode{right:auto;left:0}.revisions .loading-indicator{margin-right:-90px}body.folded .revisions .loading-indicator{margin-right:-32px}.revisions-next{float:left}.revisions-previous{float:right}.diff-title strong{text-align:left;float:right;margin-right:0;margin-left:5px}.revisions-controls .author-card .avatar,.revisions-controls .author-card .author-info{float:right}.diff-meta input.restore-revision{float:left}.diff-col-title-added,.diff-col-title-removed{text-align:right;float:right}.revisions-tooltip{margin-left:0;margin-right:-69px}.revisions-tooltip.flipped{margin-right:0;margin-left:-70px}.ie8 .revisions-tooltip{margin-right:-75px}.ie8 .revisions-tooltip.flipped{margin-left:-63px}.revisions-tooltip-arrow{right:0;margin-left:0;margin-right:35px}.revisions-tooltip.flipped .revisions-tooltip-arrow{margin-right:0;margin-left:35px;right:auto;left:0}.revisions-tooltip-arrow>span{left:auto;right:20px}.revisions-tooltip.flipped .revisions-tooltip-arrow>span{right:auto;left:20px}.ie8 .revisions-tooltip-arrow>span{right:21px}.revisions-tickmarks>div{float:right;border-width:0 0 0 1px}#select-featured-image a{float:right}a.post-state-format{margin-right:0;margin-left:5px}label.post-format-icon{margin-left:0;margin-right:5px;padding-left:0;padding-right:21px}.post-format-icon.post-format-standard{background-position:100% 0}.post-format-icon.post-format-image{background-position:100% -32px}.post-format-icon.post-format-gallery{background-position:100% -64px}.post-format-icon.post-format-audio{background-position:100% -96px}.post-format-icon.post-format-video{background-position:100% -128px}.post-format-icon.post-format-chat{background-position:100% -160px}.post-format-icon.post-format-status{background-position:100% -192px}.post-format-icon.post-format-aside{background-position:100% -224px}.post-format-icon.post-format-quote{background-position:100% -256px}.post-format-icon.post-format-link{background-position:100% -288px}.category-adder{margin-left:0;margin-right:120px}#post-body ul.add-menu-item-tabs{float:right;text-align:left;margin:0 5px 0 -120px}#post-body ul.add-menu-item-tabs li.tabs{-webkit-border-top-left-radius:0;-webkit-border-top-right-radius:3px;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:3px;border-top-left-radius:0;border-top-right-radius:3px;border-bottom-left-radius:0;border-bottom-right-radius:3px}#front-page-warning,#front-static-pages ul,ul.export-filters,.inline-editor ul.cat-checklist ul,.categorydiv ul.categorychecklist ul,.customlinkdiv ul.categorychecklist ul,.posttypediv ul.categorychecklist ul,.taxonomydiv ul.categorychecklist ul{margin-left:0;margin-right:18px}#post-body .add-menu-item-tabs li.tabs{border-style:solid solid solid none;border-width:1px 1px 1px 0;margin-right:0;margin-left:-1px}p.help,p.description,span.description,.form-wrap p{font-style:normal;font-family:Tahoma,Arial,sans-serif}.taghint{margin:15px 12px -24px 0}#poststuff .tagsdiv .howto{margin:0 8px 6px 0}.ac_results li{text-align:right}.links-table th{text-align:right}#wpbody-content .describe th{text-align:right}.describe .media-item-info .A1B1{padding:0 10px 0 0}.media-upload-form td label{margin-left:6px;margin-right:2px}.media-upload-form .align .field label{padding:0 23px 0 0;margin:0 3px 0 1em}.media-upload-form tr.image-size label{margin:0 5px 0 0}#wpbody-content .describe p.help{padding:0 5px 0 0}.media-item .edit-attachment,.media-item .error-div a.dismiss,.describe-toggle-on,.describe-toggle-off{float:left;margin-right:0;margin-left:15px}.media-item .error-div a.dismiss{padding:0 15px 0 0}.media-item .error-div{padding-left:0;padding-right:10px}.media-item .pinkynail{float:right}.media-item .describe td{padding:0 0 8px 8px}.media-item .progress{float:left;margin:6px 0 0 10px}#find-posts-input{float:right}#find-posts-search{float:right;margin-right:3px;margin-left:4px}.find-box-search .spinner{left:auto;right:115px}#find-posts-response .found-radio{padding:5px 8px 0 0}.find-box-search label{padding-right:0;padding-left:6px}.find-box #resize-se{right:auto;left:1px}form.upgrade .hint{font-style:normal}.wp_attachment_image .button,.A1B1 .button{float:right}.wp_attachment_image .spinner,.A1B1 .spinner{float:right}.imgedit-menu div{float:right}.imgedit-crop{margin:0}.imgedit-rleft,.imgedit-flipv,.imgedit-undo{margin:0 8px 0 3px}.imgedit-rright,.imgedit-fliph,.imgedit-redo{margin:0 3px}.imgedit-applyto img{margin:0 0 0 8px}.imgedit-help{font-style:normal}.imgedit-submit-btn{margin-left:0;margin-right:20px}.form-table th{text-align:right}.form-table input.tog{margin-right:0;margin-left:2px;float:right}.form-table table.color-palette{float:right}#replysubmit .spinner,.inline-edit-save .spinner{float:left}#replysubmit .button{margin-right:0;margin-left:5px}#edithead .inside{float:right;padding:3px 5px 2px 0}.comment-ays th{border-right-style:none;border-left-style:solid;border-right-width:0;border-left-width:1px}.spam-undo-inside .avatar,.trash-undo-inside .avatar{margin-left:8px}#comment-status-radio input{margin:2px 0 5px 3px}h3.available-themes{float:right}.available-theme{margin-right:0;margin-left:10px;padding:20px 0 20px 20px}#current-theme .theme-info li,.theme-options li,.available-theme .action-links li{float:right;padding-right:0;padding-left:10px;margin-right:0;margin-left:10px;border-right:0;border-left:1px solid #dfdfdf}.available-theme .action-links li{padding-left:8px;margin-left:8px}.ie8 .available-theme .action-links li{padding-left:7px;margin-left:7px}#current-theme .theme-info li:last-child,.theme-options li:last-child,.available-theme .action-links li:last-child{padding-left:0;margin-right:0;border-left:0}.available-theme .action-links .delete-theme{float:left;margin-left:0;margin-right:8px}.available-theme .action-links p{float:right}#current-theme.has-screenshot{padding-left:0;padding-right:330px}#current-theme h4 span{margin-left:0;margin-right:20px}#current-theme img{float:right;width:300px;margin-left:0;margin-right:-330px}.theme-options .load-customize{margin-right:0;margin-left:30px;float:right}.theme-options span{float:right;margin-right:0;margin-left:10px}.theme-options ul{float:right}@media only screen and (max-width:1200px){#current-theme.has-screenshot{padding-right:270px}#current-theme img{margin-right:-270px;width:240px}}#broken-themes{text-align:right}.appearance_page_custom-header .available-headers .default-header{float:right;margin:0 0 20px 20px}.appearance_page_custom-header .random-header{margin:0 0 20px 20px}.appearance_page_custom-header .available-headers label input,.appearance_page_custom-header .random-header label input{margin-right:0;margin-left:10px}.nav-tab{margin:0 0 -1px 6px}h2 .nav-tab{font-family:Tahoma,Arial,sans-serif}.plugins .desc ul,.plugins .desc ol{margin:0 2em 0 0}#wpbody-content .plugins .plugin-title,#wpbody-content .plugins .theme-title{padding-right:0;padding-left:12px}#profile-page .form-table #rich_editing{margin-right:0;margin-left:5px}#profile-page #pass1,#profile-page #pass2,#profile-page #user_login{direction:ltr}#your-profile legend{font-family:Tahoma,Arial,sans-serif}.pressthis a span{background-position:right 5px;padding:8px 27px 8px 11px}.pressthis a:after{right:auto;left:10px;background:transparent;transform:skew(-20deg) rotate(-6deg);-webkit-transform:skew(-20deg) rotate(-6deg);-moz-transform:skew(-20deg) rotate(-6deg)}.pressthis a:hover:after{transform:skew(-20deg) rotate(-9deg);-webkit-transform:skew(-20deg) rotate(-9deg);-moz-transform:skew(-20deg) rotate(-9deg)}#utc-time,#local-time{padding-left:0;padding-right:25px;font-style:normal;font-family:Tahoma,Arial,sans-serif}#permalink_structure{float:right}.options-permalink-php code{unicode-bidi:embed}.options-permalink-php #rules{direction:ltr}#wpfooter{margin-left:20px}#wpcontent,#wpfooter{margin-right:165px}.wrap.about-wrap{margin-left:40px;margin-right:20px}.about-wrap h1,.about-text{margin-right:0;margin-left:200px}.about-wrap h2.nav-tab-wrapper{padding-left:0;padding-right:6px}.about-wrap .wp-badge{right:auto;left:0}.about-wrap h2 .nav-tab{margin-right:0;margin-left:3px}.about-wrap .changelog li{margin-left:0;margin-right:3em}.about-wrap .three-col-images .last-feature{float:left}.about-wrap .three-col-images .first-feature{float:right}.about-wrap .feature-section.three-col div{margin-right:0;margin-left:4.999999999%;float:right}.about-wrap .feature-section.three-col h4{text-align:right}.about-wrap .feature-section.three-col img{margin-right:5px;margin-left:0}.about-wrap .feature-section.three-col .last-feature{margin-left:0}.about-wrap .feature-section img{margin:0 0 10px .7%}.about-wrap .feature-section.images-stagger-right img,.about-wrap .feature-section.images-stagger-right .video{float:left;margin:0 2em 12px 5px}.about-wrap .feature-section.images-stagger-left img{float:right;margin:0 5px 12px 2em}.about-wrap li.wp-person,.about-wrap li.wp-person img.gravatar{float:right;margin-right:0;margin-left:10px}@media only screen and (max-width:900px){.about-wrap .feature-section.images-stagger-right .video.image-66{margin-right:3px}}@media only screen and (max-width:768px){.about-wrap .feature-section .image-66{float:none}.about-wrap .feature-section.images-stagger-right .image-66{margin-right:3px}.about-wrap .feature-section.images-stagger-left .image-66{margin-left:3px}}#template div{margin-right:0;margin-left:190px}.column-author img,.column-username img{float:right;margin-right:0;margin-left:10px}.tagchecklist{margin-left:0;margin-right:14px}.tagchecklist strong{margin-left:0;margin-right:-8px}.tagchecklist span{margin-right:0;margin-left:25px;float:right}.tagchecklist span a{margin:6px -9px 0 0;float:right}#poststuff h2{clear:right}#poststuff h3,.metabox-holder h3{font-family:Tahoma,Arial,sans-serif}.tool-box .title{font-family:Tahoma,Arial,sans-serif}#sidemenu{margin:-30px 315px 0 15px;float:left;padding-left:0;padding-right:10px}#sidemenu a{float:right}table .vers,table .column-visible,table .column-rating{text-align:right}.screen-meta-toggle{right:auto;left:15px}.screen-reader-text,.screen-reader-text span,.ui-helper-hidden-accessible{left:auto;right:-1000em}.screen-reader-shortcut:focus{left:auto;right:6px}* html #template div{margin-left:0}#editorcontainer .wp_themeSkin .mceStatusbar{padding-left:0;padding-right:5px}#editorcontainer .wp_themeSkin .mceStatusbar div{float:right}#editorcontainer .wp_themeSkin .mceStatusbar a.mceResize{float:left}#content-resize-handle{background:transparent url('../images/resize-rtl.gif') no-repeat scroll left bottom;right:auto;left:2px;cursor:sw-resize}.wp-full-overlay .wp-full-overlay-sidebar{margin:0;left:auto;right:0;border-right:0;border-left:1px solid rgba(0,0,0,0.2)}.wp-full-overlay-sidebar:after{right:auto;left:0;box-shadow:inset 5px 0 4px -4px rgba(0,0,0,0.1)}.wp-full-overlay.collapsed,.wp-full-overlay.expanded .wp-full-overlay-sidebar{margin-right:0!important}.wp-full-overlay.expanded{margin-right:300px;margin-left:0}.wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-right:-300px;margin-left:0}.wp-full-overlay a.collapse-sidebar{left:auto;right:0;margin-left:0;margin-right:15px}.wp-full-overlay.collapsed .collapse-sidebar{right:100%}.wp-full-overlay .collapse-sidebar-arrow{margin-right:2px;margin-left:0;background:transparent url('../images/arrows.png') no-repeat 1px -108px}.wp-full-overlay.collapsed .collapse-sidebar-arrow{background-position:0 -72px}.wp-full-overlay .collapse-sidebar-label{right:100%;left:auto;margin-right:10px;margin-left:0}.install-theme-info .theme-install{float:left}#wpcontent{margin-left:0;margin-right:165px}#wpbody-content{float:right}#adminmenuwrap{float:right}#adminmenu{clear:right}.inner-sidebar{float:left;clear:left}.has-right-sidebar #post-body{float:right;clear:right;margin-right:0;margin-left:-340px}.has-right-sidebar #post-body-content{margin-right:0;margin-left:300px}#col-right{float:left;clear:left}.alignleft{float:right}.alignright{float:left}.textleft{text-align:right}.textright{text-align:left}body,td,textarea,input,select{font-family:Tahoma,Arial,sans-serif}ul.ul-disc,ul.ul-square,ol.ol-decimal{margin-left:0;margin-right:1.8em}.subsubsub{float:right}.widefat thead th:first-of-type{-webkit-border-top-left-radius:0;-webkit-border-top-right-radius:3px;border-top-left-radius:0;border-top-right-radius:3px}.widefat thead th:last-of-type{-webkit-border-top-right-radius:0;-webkit-border-top-left-radius:3px;border-top-right-radius:0;border-top-left-radius:3px}.widefat tfoot th:first-of-type{-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:3px;border-bottom-left-radius:0;border-bottom-right-radius:3px}.widefat tfoot th:last-of-type{-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:3px;border-bottom-right-radius:0;border-bottom-left-radius:3px}.widefat th{text-align:right}.widefat th input{margin:0 8px 0 0}.wrap{margin-right:0;margin-left:15px}.wrap h2,.subtitle{font-family:Tahoma,Arial,sans-serif}.wrap h2{padding-right:0;padding-left:15px}.subtitle{padding-left:0;padding-right:25px}.wrap .add-new-h2{font-family:Tahoma,Arial,sans-serif;margin-left:0;margin-right:4px}.wrap h2.long-header{padding-left:0}#dashboard-widgets-wrap .has-sidebar{margin-right:0;margin-left:-51%}#dashboard-widgets-wrap .has-sidebar .has-sidebar-content{margin-right:0;margin-left:51%}.view-all{right:auto;left:0}#dashboard_right_now p.sub,#dashboard-widgets h4,a.rsswidget,#dashboard_plugins h4,#dashboard_plugins h5,#dashboard_recent_comments .comment-meta .approve,#dashboard_right_now td.b,#dashboard_right_now .versions a{font-family:Tahoma,Arial,sans-serif}#dashboard_right_now p.sub{left:auto;right:15px}#dashboard_right_now td.b{padding-right:0;padding-left:6px;text-align:left}#dashboard_right_now .t{padding-right:0;padding-left:12px}#dashboard_right_now .table_content{float:right}#dashboard_right_now .table_discussion{float:left}#dashboard_right_now a.button{float:left;clear:left}#dashboard_plugins .inside span{padding-left:0;padding-right:5px}#dashboard-widgets h3 .postbox-title-action{right:auto;left:10px}.js #dashboard-widgets h3 .postbox-title-action{right:auto;left:30px}#the-comment-list .pingback{padding-left:0!important;padding-right:9px!important}#the-comment-list .comment-item{padding:1em 70px 1em 10px}#the-comment-list .comment-item .avatar{float:right;margin-left:0;margin-right:-60px}.rss-widget cite{text-align:left}.rss-widget span.rss-date{font-family:Tahoma,Arial,sans-serif;margin-left:0;margin-right:3px}#dashboard-widgets #dashboard_quick_press form p.submit input{float:right}#dashboard-widgets #dashboard_quick_press form p.submit #save-post{margin:0 1px 0 .7em}#dashboard-widgets #dashboard_quick_press form p.submit #publish{float:left}#dashboard-widgets #dashboard_quick_press form p.submit .spinner{margin:4px 0 0 6px}#dashboard_recent_drafts h4 abbr{font-family:Tahoma,Arial,sans-serif;margin-left:0;margin-right:3px}body.login{font-family:Tahoma,Arial,sans-serif}.login form{margin-right:8px;margin-left:0}.login form .forgetmenot{float:right}.login form .submit{float:left}#login form .submit input{font-family:Tahoma,Arial,sans-serif}.login #nav,.login #backtoblog{margin:0 16px 0 0}#login_error,.login .message{margin:0 8px 16px 0}.login #user_pass,.login #user_login,.login #user_email{margin-left:6px;margin-right:0;direction:ltr}.login h1 a{text-decoration:none}.login .button-primary{float:left}#nav-menus-frame{margin-right:300px;margin-left:0}#wpbody-content #menu-settings-column{margin-right:-300px;margin-left:0;float:right}.menu-location-menus select{float:right}.locations-row-links{float:right;margin:4px 6px 0 0}.locations-add-menu-link{direction:rtl}.locations-edit-menu-link{border-left:1px solid #ccc;border-right:0;padding-left:6px;padding-right:0;float:right}#menu-management-liquid{float:right}#menu-management{margin-left:20px;margin-right:0}.post-body-plain{padding:10px 0 0 10px}#menu-management .nav-tabs-arrow-left{right:0;left:auto}#menu-management .nav-tabs-arrow-right{left:0;right:auto;text-align:left;font-family:Tahoma,Arial,sans-serif}#menu-management .nav-tabs{padding-right:20px;padding-left:10px}.js #menu-management .nav-tabs{float:right;margin-right:0;margin-left:-400px}#select-nav-menu-container{text-align:left}#wpbody .open-label{float:right}#wpbody .open-label span{padding-left:10px;padding-right:0}.js .input-with-default-title{font-style:normal;font-weight:bold}.postbox .howto input,.accordion-container .howto input{float:left}#nav-menu-theme-locations .button-controls{text-align:left}.meta-sep,.submitcancel{float:right}#cancel-save{margin-left:0;margin-right:20px}.button.right,.button-secondary.right,.button-primary.right{float:left}.list-controls{float:right}.add-to-menu{float:left}#add-custom-link label span{float:right;padding-left:5px;padding-right:0}.nav-menus-php .howto span{float:right}.list li .menu-item-title input{margin-left:3px;margin-right:0}.menu-item-handle{padding-right:10px;padding-left:0}.menu-item-edit-active .menu-item-handle{-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.menu-item-handle .item-title{margin-left:13em;margin-right:0;overflow:hidden}.menu-item-handle .item-edit{right:auto;left:-20px}.menu-item-handle .menu-item-title{float:right}.menu-item-settings .field-move a,.menu-item-settings .field-move span{float:right;margin-left:4px}.menu-item-depth-0{margin-right:0;margin-left:0}.menu-item-depth-1{margin-right:30px;margin-left:0}.menu-item-depth-2{margin-right:60px;margin-left:0}.menu-item-depth-3{margin-right:90px;margin-left:0}.menu-item-depth-4{margin-right:120px;margin-left:0}.menu-item-depth-5{margin-right:150px;margin-left:0}.menu-item-depth-6{margin-right:180px;margin-left:0}.menu-item-depth-7{margin-right:210px;margin-left:0}.menu-item-depth-8{margin-right:240px;margin-left:0}.menu-item-depth-9{margin-right:270px;margin-left:0}.menu-item-depth-10{margin-right:300px;margin-left:0}.menu-item-depth-11{margin-right:330px;margin-left:0}.menu-item-depth-0 .menu-item-transport{margin-right:0;margin-left:0}.menu-item-depth-1 .menu-item-transport{margin-right:-30px;margin-left:0}.menu-item-depth-2 .menu-item-transport{margin-right:-60px;margin-left:0}.menu-item-depth-3 .menu-item-transport{margin-right:-90px;margin-left:0}.menu-item-depth-4 .menu-item-transport{margin-right:-120px;margin-left:0}.menu-item-depth-5 .menu-item-transport{margin-right:-150px;margin-left:0}.menu-item-depth-6 .menu-item-transport{margin-right:-180px;margin-left:0}.menu-item-depth-7 .menu-item-transport{margin-right:-210px;margin-left:0}.menu-item-depth-8 .menu-item-transport{margin-right:-240px;margin-left:0}.menu-item-depth-9 .menu-item-transport{margin-right:-270px;margin-left:0}.menu-item-depth-10 .menu-item-transport{margin-right:-300px;margin-left:0}.menu-item-depth-11 .menu-item-transport{margin-right:-330px;margin-left:0}.item-type{padding-left:10px;padding-right:0}.item-controls{left:20px;right:auto}.item-controls .item-order{padding-left:10px;padding-right:0}.item-edit{left:-20px;right:auto;-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:0;border-bottom-right-radius:3px;border-bottom-left-radius:0}.menu-item-settings{padding:10px 10px 10px 0;border-width:0 1px 1px 1px}#custom-menu-item-url{direction:ltr}.link-to-original{font-style:normal;font-weight:bold}.link-to-original a{padding-right:4px;padding-left:0}.menu-item-settings .description-thin,.menu-item-settings .description-wide{margin-left:10px;margin-right:0;float:right}.major-publishing-actions .publishing-action{text-align:left;float:left}.major-publishing-actions .delete-action{text-align:right;float:right;padding-left:15px;padding-right:0}.menu-name-label{margin-left:15px;margin-right:0}div.star-holder{background:url('../images/stars-rtl.png?ver=20121108') repeat-x bottom right}div.star-holder .star-rating{background:url('../images/stars-rtl.png?ver=20121108') repeat-x top right;float:right}#plugin-information .wrap{margin:4px 15px 0 0}#plugin-information ul#sidemenu{left:auto;right:0}#plugin-information .fyi{float:right}#plugin-information #section-screenshots li p{padding-left:0;padding-right:20px}#plugin-information .updated,#plugin-information .error{clear:none;direction:rtl}#plugin-information #section-holder .section{direction:ltr}.posting{margin-left:212px;margin-right:0;position:relative}h3.tb{margin-left:0;margin-right:5px}#publish{float:left}.postbox .handlediv{float:left}.actions li{float:right;margin-right:0;margin-left:10px}#extra-fields .actions{margin:-23px 0 0 -7px}#img_container a{float:right}#category-add input,#category-add select{font-family:Tahoma,Arial,sans-serif}#tagsdiv #newtag{margin-right:0;margin-left:5px}#tagadd{margin-left:0;margin-right:3px}#tagchecklist span{margin-left:.5em;margin-right:10px;float:right}#tagchecklist span a{margin:6px -9px 0 0;float:right}.submit input,.button,.button-primary,.button-secondary,#postcustomstuff .submit input{font-family:Tahoma,Arial,sans-serif}.ac_results li{text-align:right}#TB_ajaxContent #options{right:auto;left:25px}#TB_closeAjaxWindow{float:left}#TB_ajaxWindowTitle{float:right}#post_status{margin-left:0;margin-right:10px}#templateside{float:left}#template textarea,#docs-list{direction:ltr}.theme-details .theme-version{float:right}.theme-details .star-holder{float:left}.feature-filter .feature-group{float:right}.feature-filter .feature-group li{padding-right:0;padding-left:25px}div.widget-liquid-left{float:right;clear:right;margin-right:0;margin-left:-325px}div#widgets-left{margin-right:5px;margin-left:325px}div.widget-liquid-right{float:left;clear:left}.inactive-sidebar .widget{float:right}div.sidebar-name h3{font-family:Tahoma,Arial,sans-serif}#widget-list .widget{float:right}.inactive-sidebar .widget-placeholder{float:right}.widget-top .widget-title-action{float:left}.widget-control-edit{padding:0 0 0 8px}.sidebar-name-arrow{float:left}.press-this-sidebar{float:left}.press-this #header-logo,.press-this #wphead h1{float:right}.ltr{direction:ltr}.control-section .accordion-section-title{font-family:Tahoma,Arial,sans-serif}.js .accordion-section-title:after{right:auto;left:20px}.nav-menus-php .major-publishing-actions .publishing-action{float:left}.menu-settings dd{float:right}.manage-menus span{float:right}.manage-menus select{float:right;margin-right:0;margin-left:6px}.manage-menus .submit-btn{float:right}.manage-menus .selected-menu{float:right;margin:5px 0 0 6px}.nav-menus-php .add-new-menu-action{float:right;margin:4px 6px 0 0}.nav-menus-php .meta-sep,.nav-menus-php .submitdelete,.nav-menus-php .submitcancel{float:right}.is-submenu{float:right;margin-right:8px}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.post-com-count{background-image:url('../images/bubble_bg-rtl-2x.gif');background-size:18px 100px}#content-resize-handle,#post-body .wp_themeSkin .mceStatusbar a.mceResize{background:transparent url('../images/resize-rtl-2x.gif') no-repeat scroll right bottom;background-size:11px 11px}.wp-full-overlay .collapse-sidebar-arrow{background-image:url('../images/arrows-2x.png');background-size:15px 123px}div.star-holder{background:url('../images/stars-rtl-2x.png?ver=20121108') repeat-x bottom right;background-size:21px 37px}div.star-holder .star-rating{background:url('../images/stars-rtl-2x.png?ver=20121108') repeat-x top right;background-size:21px 37px}#post-body .wp_themeSkin .mceStatusbar a.mceResize,#content-resize-handle{background:transparent url('../images/resize-rtl-2x.gif') no-repeat scroll left bottom}.wp-slider .ui-slider-handle:before{background-image:url(../images/arrows-pr-2x.png);background-size:16px 102px}}body.locale-he-il,.locale-he-il .quicktags,.locale-he-il .search,.locale-he-il .howto,.locale-he-il #adminmenu .awaiting-mod,.locale-he-il #adminmenu span.update-plugins,.locale-he-il #sidemenu li a span.update-plugins,.locale-he-il .post-com-count-wrapper,.locale-he-il .widefat th,.locale-he-il .tablenav .displaying-num,.locale-he-il .inline-edit-row fieldset span.title,.locale-he-il .inline-edit-row fieldset span.checkbox-title,.locale-he-il .inline-edit-row fieldset ul.cat-checklist label,.locale-he-il .inline-edit-row #bulk-titles div,.locale-he-il p.help,.locale-he-il p.description,.locale-he-il span.description,.locale-he-il .form-wrap p,.locale-he-il h2 .nav-tab,.locale-he-il #your-profile legend,.locale-he-il #utc-time,.locale-he-il #local-time,.locale-he-il #poststuff h3,.locale-he-il .metabox-holder h3,.locale-he-il .tool-box .title,.locale-he-il td,.locale-he-il textarea,.locale-he-il input,.locale-he-il select,.locale-he-il .wrap h2,.locale-he-il .subtitle,.locale-he-il .wrap .add-new-h2,.locale-he-il #dashboard_right_now p.sub,.locale-he-il #dashboard-widgets h4,.locale-he-il a.rsswidget,.locale-he-il #dashboard_plugins h4,.locale-he-il #dashboard_plugins h5,.locale-he-il #dashboard_recent_comments .comment-meta .approve,.locale-he-il #dashboard_right_now td.b,.locale-he-il #dashboard_right_now .versions a,.locale-he-il .rss-widget span.rss-date,.locale-he-il #dashboard_recent_drafts h4 abbr,body.login.locale-he-il,.locale-he-il #login form .submit input,.locale-he-il #menu-management .nav-tabs-arrow-right,.locale-he-il #category-add input,.locale-he-il #category-add select,.locale-he-il .submit input,.locale-he-il .button,.locale-he-il .button-primary,.locale-he-il .button-secondary,.locale-he-il #postcustomstuff .submit input,.locale-he-il div.sidebar-name h3{font-family:Arial,sans-serif}.locale-he-il em{font-style:normal;font-weight:bold}
\ No newline at end of file
index f1ca269043603706d009ab6e460af77288b25dc0..b756ef1d252d5161cbc57680cad79772787c58b7 100644 (file)
@@ -24,6 +24,7 @@ TABLE OF CONTENTS:
        11.1 - Custom Fields
        11.2 - Post Revisions
        11.3 - Featured Images
+       11.4 - Post Format Selection
 12.0 - Categories
 13.0 - Tags
 14.0 - Media Screen
@@ -280,6 +281,7 @@ body {
 
 body.iframe {
        min-width: 0;
+       padding-top: 1px;
 }
 
 body.login {
@@ -750,7 +752,8 @@ input[readonly] {
        background-color: #eee;
 }
 
-:-moz-placeholder {
+:-moz-placeholder,
+.wp-core-ui :-moz-placeholder {
    color: #a9a9a9;
 }
 
@@ -1143,6 +1146,11 @@ form.upgrade .hint {
        margin: -0.5em 0 2em 0;
 }
 
+.update-php .spinner {
+       float: none;
+       margin: -4px 0;
+}
+
 #ajax-loading,
 .ajax-loading,
 .ajax-feedback,
@@ -1359,7 +1367,7 @@ form.upgrade .hint {
        display: block;
 }
 
-.help-tab-content li {
+.help-tab-content ul li {
        list-style-type: disc;
        margin-left: 18px;
 }
@@ -1450,7 +1458,7 @@ form.upgrade .hint {
 #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,
 #adminmenu .wp-has-current-submenu.opensub .wp-submenu {
        position: relative;
-       z-index: 2;
+       z-index: 3;
        top: auto;
        left: auto;
        right: auto;
@@ -2417,14 +2425,16 @@ table.fixed {
        width: 8%;
 }
 
+.fixed .column-posts,
 .fixed .column-date,
 .fixed .column-parent,
-.fixed .column-links {
+.fixed .column-links,
+.fixed .column-author,
+.fixed .column-format {
        width: 10%;
 }
 
 .fixed .column-response,
-.fixed .column-author,
 .fixed .column-categories,
 .fixed .column-tags,
 .fixed .column-rel,
@@ -2432,6 +2442,14 @@ table.fixed {
        width: 15%;
 }
 
+.fixed .column-slug {
+       width: 25%;
+}
+
+.fixed .column-locations {
+       width: 35%;
+}
+
 .fixed .column-comments {
        width: 4em;
        padding: 8px 0;
@@ -2446,14 +2464,6 @@ table.fixed {
        float: left;
 }
 
-.fixed .column-slug {
-       width: 25%;
-}
-
-.fixed .column-posts {
-       width: 10%;
-}
-
 .fixed .column-icon {
        width: 80px;
 }
@@ -2522,10 +2532,46 @@ table.fixed {
        background-repeat: no-repeat;
 }
 
+tr.wp-locked .locked-indicator {
+       background: url('../images/lock.png') no-repeat;
+       margin: -2px 0 0 6px;
+       height: 20px;
+       width: 16px;
+}
+
+tr.wp-locked .check-column label,
+tr.wp-locked .check-column input[type="checkbox"],
+tr.wp-locked .row-actions .inline,
+tr.wp-locked .row-actions .trash {
+       display: none;
+}
+
+tr .locked-info {
+       height: 0;
+       opacity: 0;
+}
+
+tr.wp-locked .locked-info {
+       height: auto;
+       opacity: 1;
+}
+
+tr.locked-info, tr.wp-locked .locked-info {
+       -webkit-transition: height 1s, opacity 500ms;
+       -moz-transition:    height 1s, opacity 500ms;
+       -ms-transition:     height 1s, opacity 500ms;
+       -o-transition:      height 1s, opacity 500ms;
+       transition:         height 1s, opacity 500ms;
+}
+
 .fixed .column-comments .sorting-indicator {
        margin-top: 3px;
 }
 
+#menu-locations-wrap .widefat {
+       width: 60%;
+}
+
 .widefat th.sortable,
 .widefat th.sorted {
        padding: 0;
@@ -2664,10 +2710,6 @@ th.asc:hover span.sorting-indicator {
        padding: 0 0 .2em 1px;
 }
 
-span.post-state-format {
-       font-weight: normal;
-}
-
 
 /*------------------------------------------------------------------------------
   10.1 - Inline Editing
@@ -2786,6 +2828,7 @@ tr.inline-edit-row td,
 
 .inline-edit-row fieldset label.inline-edit-tags span.title {
        margin: .2em 0;
+       width: auto;
 }
 
 .inline-edit-row fieldset label span.title {
@@ -2873,11 +2916,6 @@ tr.inline-edit-row td,
        width: 8em;
 }
 
-.inline-edit-row .catshow,
-.inline-edit-row .cathide {
-       cursor: pointer;
-}
-
 ul.cat-checklist {
        height: 12em;
        border-style: solid;
@@ -2903,21 +2941,12 @@ ul.cat-checklist {
 }
 
 .inline-edit-row fieldset ul.cat-checklist label,
-.inline-edit-row .catshow,
-.inline-edit-row .cathide,
 .inline-edit-row #bulk-titles div {
        font-family: sans-serif;
        font-style: normal;
        font-size: 11px;
 }
 
-table .inline-edit-row fieldset ul.cat-hover {
-       height: auto;
-       max-height: 30em;
-       overflow-y: auto;
-       position: absolute;
-}
-
 .inline-edit-row fieldset label input.inline-edit-menu-order-input {
        width: 3em;
 }
@@ -2964,9 +2993,20 @@ table .inline-edit-row fieldset ul.cat-hover {
        float: left;
 }
 
+#lost-connection-notice .spinner {
+       display: block;
+       float: left;
+       margin: 0 5px 0 0;
+}
+
+.rtl #lost-connection-notice .spinner {
+       float: right;
+       margin: 0 0 0 5px;
+}
+
 #titlediv {
        position: relative;
-       margin-bottom: 10px;
+       margin-bottom: 5px;
 }
 
 #titlediv label {
@@ -2986,8 +3026,10 @@ table .inline-edit-row fieldset ul.cat-hover {
        padding: 3px 8px;
        font-size: 1.7em;
        line-height: 100%;
+       height: 1.7em;
        width: 100%;
        outline: none;
+       margin: 1px 0;
 }
 
 #titlediv #title-prompt-text,
@@ -2995,7 +3037,7 @@ table .inline-edit-row fieldset ul.cat-hover {
        color: #bbb;
        position: absolute;
        font-size: 1.7em;
-       padding: 8px 10px;
+       padding: 11px 10px;
 }
 
 #wp-fullscreen-save .fs-saved {
@@ -3028,10 +3070,10 @@ input#link_url {
 }
 
 #edit-slug-box {
-       line-height: 23px;
-       min-height: 23px;
+       line-height: 24px;
+       min-height: 25px; /* Yes, line-height + 1 */
        margin-top: 5px;
-       padding: 0 10px;
+       padding-right: 6px;
 }
 
 #edit-slug-box .cancel {
@@ -3078,7 +3120,7 @@ input#link_url {
        margin: 2px 0 2px -2px;
 }
 
-#post-status-select, #post-format {
+#post-status-select {
        line-height: 2.5em;
        margin-top: 3px;
 }
@@ -3332,6 +3374,56 @@ td.plugin-title p {
        border-style: solid;
 }
 
+.notification-dialog {
+       position: fixed;
+       top: 30%;
+       left: 50%;
+       width: 450px;
+       margin-left: -225px;
+       background: #fff;
+       line-height: 1.5;
+       z-index: 1000005;
+}
+
+.notification-dialog-background {
+       position: fixed;
+       top: 0;
+       left: 0;
+       right: 0;
+       bottom: 0;
+       background: #000;
+       opacity: 0.5;
+       filter: alpha(opacity=50);
+       z-index: 1000000;
+}
+
+#post-lock-dialog .post-locked-message,
+#post-lock-dialog .post-taken-over {
+       margin: 25px;
+}
+
+#post-lock-dialog .post-locked-message a.button {
+       margin-right: 10px;
+}
+
+#post-lock-dialog .post-locked-avatar {
+       float: left;
+       margin: 0 20px 20px 0;
+}
+
+#post-lock-dialog .wp-tab-first {
+       outline: 0;
+}
+
+#post-lock-dialog .locked-saving img {
+       float: left;
+       margin-right: 3px;
+}
+
+#post-lock-dialog.saving .locked-saving,
+#post-lock-dialog.saved .locked-saved {
+       display: inline;
+}
 
 /*------------------------------------------------------------------------------
   11.1 - Custom Fields
@@ -3419,167 +3511,624 @@ td.plugin-title p {
 /*------------------------------------------------------------------------------
   11.2 - Post Revisions
 ------------------------------------------------------------------------------*/
-
-table.diff {
-       width: 100%;
+.revisions-control-frame,
+.revisions-diff-frame {
+       position: relative;
 }
 
-table.diff col.content {
-       width: 50%;
+.revisions-controls {
+       padding-top: 40px;
+       height: 100px;
+       z-index: 1;
 }
 
-table.diff tr {
-       background-color: transparent;
+.revisions-controls input[type="checkbox"] {
+       position: relative;
+       top: -1px;
+       vertical-align: text-bottom;
 }
 
-table.diff td, table.diff th {
-       padding: .5em;
-       font-family: Consolas, Monaco, monospace;
-       border: none;
+.revisions.pinned .revisions-controls {
+       position: fixed;
+       top: 0;
+       padding-bottom: 10px;
 }
 
-table.diff .diff-deletedline del, table.diff .diff-addedline ins {
-       text-decoration: none;
+.revisions-tickmarks {
+       position: relative;
+       margin: 0 auto;
+       height: 0.8em;
+       top: 7px;
+       max-width: 70%;
+       -moz-box-sizing: border-box;
+       -webkit-box-sizing: border-box;
+       box-sizing: border-box;
 }
 
-/*------------------------------------------------------------------------------
-  11.3 - Featured Images
-------------------------------------------------------------------------------*/
-
-#select-featured-image {
-       padding: 4px 0;
-       overflow: hidden;
+.revisions-tickmarks > div {
+       position: absolute;
+       height: 100%;
+       border-style: solid;
+       border-width: 0 1px 0 0;
+       -moz-box-sizing: border-box;
+       -webkit-box-sizing: border-box;
+       box-sizing: border-box;
 }
 
-#select-featured-image img {
-       max-width: 100%;
-       height: auto;
-       margin-bottom: 10px;
+.revisions-tickmarks > div:first-child {
+       border-width: 0;
 }
 
-#select-featured-image a {
-       float: left;
-       clear: both;
+.comparing-two-revisions .revisions-controls {
+       height: 140px;
 }
 
-#select-featured-image .remove {
+.revisions .diff-error {
+       position: absolute;
+       text-align: center;
+       margin: 0 auto;
+       width: 100%;
        display: none;
-       margin-top: 10px;
 }
 
-.js #select-featured-image.has-featured-image .remove {
-       display: inline-block;
+.revisions.diff-error .diff-error {
+       display: block;
 }
 
-.no-js #select-featured-image .choose {
-       display: none;
+.revisions .loading-indicator {
+       position: fixed;
+       vertical-align: middle;
+       opacity: 0;
+       width: 100%;
+       top: 50%;
+       margin-left: -90px;
+       -webkit-transition: opacity 0.5s;
+       -moz-transition:    opacity 0.5s;
+       -ms-transition:     opacity 0.5s;
+       -o-transition:      opacity 0.5s;
+       transition:         opacity 0.5s;
+       filter: alpha(opacity=0); /* ie8 and earlier */
 }
 
-/*------------------------------------------------------------------------------
-  12.0 - Categories
-------------------------------------------------------------------------------*/
-
-.category-adder {
-       margin-left: 120px;
-       padding: 4px 0;
+body.folded .revisions .loading-indicator {
+       margin-left: -32px;
 }
 
-.category-adder h4 {
-       margin: 0 0 8px;
+.revisions .loading-indicator span.spinner {
+       display: block;
+       margin: 0 auto;
+       float: none;
 }
 
-#side-sortables .category-adder {
-       margin: 0;
+.revisions.loading .loading-indicator {
+       opacity: 1;
+       filter: alpha(opacity=100); /* ie8 and earlier */
 }
 
-#post-body ul.add-menu-item-tabs {
-       float: left;
-       width: 120px;
-       text-align: right;
-       /* Negative margin for the sake of those without JS: all tabs display */
-       margin: 0 -120px 0 5px;
-       padding: 0;
+.revisions .diff {
+       -webkit-transition: opacity 0.5s;
+       -moz-transition:    opacity 0.5s;
+       -ms-transition:     opacity 0.5s;
+       -o-transition:      opacity 0.5s;
+       transition:         opacity 0.5s;
 }
 
-#post-body ul.add-menu-item-tabs li {
-       padding: 8px;
+.revisions.loading .diff {
+       opacity: 0.5;
+       filter: alpha(opacity=50); /* ie8 and earlier */
 }
 
-#post-body ul.add-menu-item-tabs li.tabs {
-       -webkit-border-top-left-radius: 3px;
-       -webkit-border-bottom-left-radius: 3px;
-       border-top-left-radius: 3px;
-       border-bottom-left-radius: 3px;
+.revisions.diff-error .diff {
+       visibility: hidden;
 }
 
-.wp-tab-panel,
-.categorydiv div.tabs-panel,
-.customlinkdiv div.tabs-panel,
-.posttypediv div.tabs-panel,
-.taxonomydiv div.tabs-panel {
-       min-height: 42px;
-       max-height: 200px;
-       overflow: auto;
-       padding: 0 0.9em;
-       border-style: solid;
-       border-width: 1px;
+.revisions-meta {
+       margin-top: 15px;
 }
 
-div.tabs-panel-active {
-       display:block;
+.revision-toggle-compare-mode {
+       position: absolute;
+       top: 0;
+       right: 0;
 }
 
-div.tabs-panel-inactive {
-       display:none;
+.comparing-two-revisions .revisions-previous,
+.comparing-two-revisions .revisions-next,
+.revisions-meta .diff-meta-to strong {
+       display: none;
 }
 
-#front-page-warning,
-#front-static-pages ul,
-ul.export-filters,
-.inline-editor ul.cat-checklist ul,
-.categorydiv ul.categorychecklist ul,
-.customlinkdiv ul.categorychecklist ul,
-.posttypediv ul.categorychecklist ul,
-.taxonomydiv ul.categorychecklist ul {
-       margin-left: 18px;
+.revisions-controls .author-card .date {
+       color: #777;
 }
 
-ul.categorychecklist li {
-       margin: 0;
-       padding: 0;
-       line-height: 19px;
-       word-wrap: break-word;
+.revisions-controls .author-card.autosave {
+       color: #d54e21;
 }
 
-.categorydiv .tabs-panel,
-.customlinkdiv .tabs-panel,
-.posttypediv .tabs-panel,
-.taxonomydiv .tabs-panel {
-       border-width: 3px;
-       border-style: solid;
+.revisions-controls .author-card .author-name {
+       font-weight: bold;
 }
 
-.form-wrap p,
-.form-wrap label {
-       font-size: 11px;
+.comparing-two-revisions .diff-meta-to strong {
+       display: block;
 }
 
-.form-wrap label {
-       display: block;
-       padding: 2px;
-       font-size: 12px;
+.revisions-previous,
+.revisions-next {
+       position: relative;
+       z-index: 1;
 }
 
-.form-field input,
-.form-field textarea {
-       border-style: solid;
-       border-width: 1px;
-       width: 95%;
+.revisions-previous {
+       float: left;
 }
 
-p.description,
-.form-wrap p {
-       margin: 2px 0 5px;
+.revisions-next {
+       float: right;
+}
+
+.revisions-controls .wp-slider {
+       max-width: 70%;
+       margin: 0 auto;
+       top: -3px;
+}
+
+/* Revision meta box */
+.post-revisions li img,
+#revisions-meta-restored img {
+       vertical-align: middle;
+}
+
+table.diff {
+       table-layout: fixed;
+       width: 100%;
+       white-space: pre-wrap;
+       word-wrap: break-word;
+}
+
+table.diff col.content {
+       width: auto;
+}
+
+table.diff col.content.diffsplit {
+       width: 48%;
+}
+
+table.diff col.diffsplit.middle {
+       width: auto;
+}
+
+table.diff col.ltype {
+       width: 30px;
+}
+
+table.diff tr {
+       background-color: transparent;
+}
+
+table.diff td,
+table.diff th {
+       padding: .5em;
+       font-family: Consolas, Monaco, monospace;
+}
+
+table.diff .diff-deletedline del,
+table.diff .diff-addedline ins {
+       text-decoration: none;
+}
+
+.diff-meta {
+       -webkit-border-radius: 3px;
+       border-radius: 3px;
+       padding: 5px;
+       clear: both;
+       min-height: 32px;
+}
+
+.diff-title strong {
+       line-height: 32px;
+       min-width: 60px;
+       text-align: right;
+       float: left;
+       margin-right: 5px;
+}
+
+.revisions-controls .author-card .avatar,
+.revisions-controls .author-card .author-info {
+       float: left;
+       margin-left: 6px;
+       margin-right: 6px;
+}
+
+.revisions-controls .author-card .byline {
+       display: block;
+       font-size: 12px;
+}
+
+.revisions-controls .author-card .avatar {
+       vertical-align: middle;
+}
+
+.diff-meta input.restore-revision {
+       float: right;
+       margin-left: 6px;
+       margin-right: 6px;
+       margin-top: 4px;
+}
+
+.diff-meta-from {
+       display: none;
+}
+
+.comparing-two-revisions .diff-meta-from {
+       display: block;
+}
+
+.revisions-tooltip {
+       position: absolute;
+       bottom: 105px;
+       margin-right: 0;
+       margin-left: -69px;
+       z-index: 0;
+       max-width: 350px;
+       min-width: 130px;
+       padding: 8px 4px;
+       display: none;
+       opacity: 0;
+}
+
+.revisions-tooltip.flipped {
+       margin-left: 0;
+       margin-right: -70px;
+}
+
+.revisions.pinned .revisions-tooltip {
+       display: none !important;
+}
+
+.comparing-two-revisions .revisions-tooltip {
+       bottom: 145px;
+}
+
+.revisions-tooltip-arrow {
+       width: 70px;
+       height: 15px;
+       overflow: hidden;
+       position: absolute;
+       left: 0;
+       margin-left: 35px;
+       bottom: -15px;
+}
+
+.revisions-tooltip.flipped .revisions-tooltip-arrow {
+       margin-left: 0;
+       margin-right: 35px;
+       left: auto;
+       right: 0;
+}
+
+.revisions-tooltip-arrow > span {
+       content: "";
+       position: absolute;
+       left: 20px;
+       top: -20px;
+       width: 25px;
+       height: 25px;
+       -webkit-transform: rotate(45deg);
+       -moz-transform: rotate(45deg);
+       -ms-transform: rotate(45deg);
+       -o-transform: rotate(45deg);
+       tranform: rotate(45deg);
+}
+
+.revisions-tooltip.flipped .revisions-tooltip-arrow > span {
+       left: auto;
+       right: 20px;
+}
+
+.ie8 .revisions-tooltip-arrow > span {
+       left: 15px;
+       top: -25px;
+       -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476)";
+}
+
+.ie8 .revisions-tooltip.flipped .revisions-tooltip-arrow > span {
+       right: 25px;
+}
+
+.revisions-tooltip,
+.revisions-tooltip-arrow > span {
+       border-width: 1px;
+       border-style: solid;
+}
+
+div.revisions-controls > .wp-slider > .ui-slider-handle {
+       margin-left: -10px;
+}
+
+ /* jQuery UI Slider */
+.wp-slider.ui-slider {
+       position: relative;
+       border-width: 1px;
+       border-style: solid;
+       border-radius: 3px;
+       text-align: left;
+       cursor: pointer;
+}
+
+.wp-slider .ui-slider-handle {
+       position: absolute;
+       z-index: 2;
+       margin-top: -3px;
+       width: 19px;
+       height: 19px;
+       border-width: 1px;
+       border-style: solid;
+       border-radius: 50%;
+}
+
+.wp-slider .ui-slider-handle:before {
+       content: "";
+       position: absolute;
+       top: 6px;
+       left: 3px;
+       height: 8px;
+       width: 13px;
+       background: url(../images/arrows-pr.png) no-repeat -2px -47px;
+}
+
+.wp-slider .ui-slider-handle.from-handle:before,
+.wp-slider .ui-slider-handle.to-handle:before {
+       height: 8px;
+       width: 7px;
+}
+
+.wp-slider .ui-slider-handle.from-handle:before {
+       background-position: -5px -84px;
+       left: 7px;
+}
+
+.wp-slider .ui-slider-handle.to-handle:before {
+       background-position: -4px -65px;
+       left: 5px;
+}
+
+.wp-slider .ui-slider-range {
+       position: absolute;
+       font-size: .7em;
+       display: block;
+       border: 0;
+       background-color: transparent;
+       background-image: none;
+}
+
+.wp-slider.ui-slider-horizontal {
+       height: .8em;
+}
+
+.wp-slider.ui-slider-horizontal .ui-slider-handle {
+       top: -.25em;
+       margin-left: -.6em;
+}
+
+.wp-slider.ui-slider-horizontal .ui-slider-range {
+       top: 0;
+       height: 100%;
+}
+
+.wp-slider.ui-slider-horizontal .ui-slider-range-min {
+       left: 0;
+}
+
+.wp-slider.ui-slider-horizontal .ui-slider-range-max {
+       right: 0;
+}
+
+
+/*------------------------------------------------------------------------------
+  11.3 - Featured Images
+------------------------------------------------------------------------------*/
+
+#select-featured-image {
+       padding: 4px 0;
+       overflow: hidden;
+}
+
+#select-featured-image img {
+       max-width: 100%;
+       height: auto;
+       margin-bottom: 10px;
+}
+
+#select-featured-image a {
+       float: left;
+       clear: both;
+}
+
+#select-featured-image .remove {
+       display: none;
+       margin-top: 10px;
+}
+
+.js #select-featured-image.has-featured-image .remove {
+       display: inline-block;
+}
+
+.no-js #select-featured-image .choose {
+       display: none;
+}
+
+/*------------------------------------------------------------------------------
+  11.4 - Post formats
+------------------------------------------------------------------------------*/
+
+a.post-state-format {
+       overflow: hidden;
+       display: inline-block;
+       vertical-align: middle;
+       height: 16px;
+       width: 16px;
+       margin-right: 5px;
+       background-repeat: no-repeat;
+       text-indent: -999em;
+}
+
+#post-formats-select {
+       line-height: 2em;
+}
+
+label.post-format-icon {
+       margin-left: 5px;
+       padding: 2px 0 2px 21px;
+}
+
+.post-format-icon.post-format-standard  {
+       background-position: 0 0;
+}
+
+.post-format-icon.post-format-image  {
+       background-position: 0 -32px;
+}
+
+.post-format-icon.post-format-gallery {
+       background-position: 0 -64px;
+}
+
+.post-format-icon.post-format-audio {
+       background-position: 0 -96px;
+}
+
+.post-format-icon.post-format-video {
+       background-position: 0 -128px;
+}
+
+.post-format-icon.post-format-chat {
+       background-position: 0 -160px;
+}
+
+.post-format-icon.post-format-status {
+       background-position: 0 -192px;
+}
+
+.post-format-icon.post-format-aside {
+       background-position: 0 -224px;
+}
+
+.post-format-icon.post-format-quote {
+       background-position: 0 -256px;
+}
+
+.post-format-icon.post-format-link {
+       background-position: 0 -288px;
+}
+
+
+/*------------------------------------------------------------------------------
+  12.0 - Categories
+------------------------------------------------------------------------------*/
+
+.category-adder {
+       margin-left: 120px;
+       padding: 4px 0;
+}
+
+.category-adder h4 {
+       margin: 0 0 8px;
+}
+
+#side-sortables .category-adder {
+       margin: 0;
+}
+
+#post-body ul.add-menu-item-tabs {
+       float: left;
+       width: 120px;
+       text-align: right;
+       /* Negative margin for the sake of those without JS: all tabs display */
+       margin: 0 -120px 0 5px;
+       padding: 0;
+}
+
+#post-body ul.add-menu-item-tabs li {
+       padding: 8px;
+}
+
+#post-body ul.add-menu-item-tabs li.tabs {
+       -webkit-border-top-left-radius: 3px;
+       -webkit-border-bottom-left-radius: 3px;
+       border-top-left-radius: 3px;
+       border-bottom-left-radius: 3px;
+}
+
+.wp-tab-panel,
+.categorydiv div.tabs-panel,
+.customlinkdiv div.tabs-panel,
+.posttypediv div.tabs-panel,
+.taxonomydiv div.tabs-panel {
+       min-height: 42px;
+       max-height: 200px;
+       overflow: auto;
+       padding: 0 0.9em;
+       border-style: solid;
+       border-width: 1px;
+}
+
+div.tabs-panel-active {
+       display:block;
+}
+
+div.tabs-panel-inactive {
+       display:none;
+}
+
+#front-page-warning,
+#front-static-pages ul,
+ul.export-filters,
+.inline-editor ul.cat-checklist ul,
+.categorydiv ul.categorychecklist ul,
+.customlinkdiv ul.categorychecklist ul,
+.posttypediv ul.categorychecklist ul,
+.taxonomydiv ul.categorychecklist ul {
+       margin-left: 18px;
+}
+
+ul.categorychecklist li {
+       margin: 0;
+       padding: 0;
+       line-height: 19px;
+       word-wrap: break-word;
+}
+
+.categorydiv .tabs-panel,
+.customlinkdiv .tabs-panel,
+.posttypediv .tabs-panel,
+.taxonomydiv .tabs-panel {
+       border-width: 3px;
+       border-style: solid;
+}
+
+.form-wrap p,
+.form-wrap label {
+       font-size: 11px;
+}
+
+.form-wrap label {
+       display: block;
+       padding: 2px;
+       font-size: 12px;
+}
+
+.form-field input,
+.form-field textarea {
+       border-style: solid;
+       border-width: 1px;
+       width: 95%;
+}
+
+p.description,
+.form-wrap p {
+       margin: 2px 0 5px;
 }
 
 p.help,
@@ -3596,6 +4145,10 @@ span.description,
        padding: 8px 0;
 }
 
+.form-wrap .form-field #parent {
+       max-width: 100%;
+}
+
 .col-wrap h3 {
        margin: 12px 0;
        font-size: 1.1em;
@@ -4381,10 +4934,6 @@ span.imgedit-scale-warn {
        padding: 2px 10px;
 }
 
-.wp_attachment_details {
-       margin-bottom: 20px;
-}
-
 /*------------------------------------------------------------------------------
   15.0 - Comments Screen
 ------------------------------------------------------------------------------*/
@@ -4596,7 +5145,7 @@ span.imgedit-scale-warn {
 }
 
 h3.available-themes {
-       margin: 0 0 1em;
+       margin: 0.3em 0 1em;
        float: left;
 }
 
@@ -5276,13 +5825,18 @@ h2 .nav-tab {
 
 /* Changelog / Update screen */
 
-.about-wrap .feature-section img {
+.about-wrap .feature-section img,
+.about-wrap .feature-section .video {
        border: none;
        margin: 0 1.94% 10px 0;
        -webkit-border-radius: 3px;
        border-radius: 3px;
 }
 
+.about-wrap .feature-section .video video {
+       max-width: 100%;
+}
+
 .about-wrap .feature-section.three-col img {
        margin: 0.5em 0 0.5em 5px;
        max-width: 100%;
@@ -5293,7 +5847,8 @@ h2 .nav-tab {
        margin-left: 0;
 }
 
-.about-wrap .feature-section.images-stagger-right img {
+.about-wrap .feature-section.images-stagger-right img,
+.about-wrap .feature-section.images-stagger-right .video {
        float: right;
        margin: 0 5px 12px 2em;
 }
@@ -5303,16 +5858,20 @@ h2 .nav-tab {
        margin: 0 2em 12px 5px;
 }
 
-.about-wrap .feature-section img.image-100 {
+.about-wrap .feature-section .image-100 {
        margin: 0 0 2em 0;
        width: 100%;
 }
 
-.about-wrap .feature-section img.image-66 {
+.about-wrap .feature-section .image-66 {
        width: 65%;
 }
 
-.about-wrap .feature-section img.image-50 {
+.about-wrap .feature-section .image-66.video {
+       max-width: 600px;
+}
+
+.about-wrap .feature-section .image-50 {
        max-width: 50%;
 }
 
@@ -5371,7 +5930,6 @@ h2 .nav-tab {
 
 .about-wrap .changelog .feature-section {
        overflow: hidden;
-       padding-bottom: 0;
 }
 
 .about-wrap .changelog li {
@@ -5381,23 +5939,34 @@ h2 .nav-tab {
 
 @media only screen and (max-width: 900px) {
        .about-wrap .feature-section.images-stagger-left img,
-       .about-wrap .feature-section.images-stagger-right img {
+       .about-wrap .feature-section.images-stagger-right img,
+       .about-wrap .feature-section.images-stagger-right .video {
                clear: both;
        }
+
+       .about-wrap .feature-section .video.image-66 {
+               float: none;
+               width: 98%;
+               max-width: 98%;
+       }
+
+       .about-wrap .feature-section.images-stagger-right .video.image-66 {
+               margin-left: 3px;
+       }
 }
 
 @media only screen and (max-width: 768px) {
-       .about-wrap .feature-section img.image-66 {
+       .about-wrap .feature-section .image-66 {
                float: none;
                width: 98%;
                max-width: 98%;
        }
 
-       .about-wrap .feature-section.images-stagger-right img.image-66 {
+       .about-wrap .feature-section.images-stagger-right .image-66 {
                margin-left: 3px;
        }
 
-       .about-wrap .feature-section.images-stagger-left img.image-66 {
+       .about-wrap .feature-section.images-stagger-left .image-66 {
                margin-right: 3px;
        }
 }
@@ -5424,7 +5993,7 @@ h2 .nav-tab {
 
 .about-wrap ul.wp-people-group {
        overflow: hidden;
-       padding: 5px;
+       padding: 5px;
        margin: 0 -15px 0 -5px;
 }
 
@@ -5605,6 +6174,10 @@ body.full-overlay-active {
        overflow: auto;
 }
 
+.wp-full-overlay-sidebar-content .accordion-section:first-child {
+       border-top: 1px solid #fff;
+}
+
 /* Close Link */
 .wp-full-overlay .close-full-overlay {
        text-decoration: none;
@@ -5924,8 +6497,7 @@ table.form-table td .updated {
        width: 250px;
 }
 
-#post-visibility-select,
-#post-formats-select {
+#post-visibility-select {
        line-height: 1.5em;
        margin-top: 3px;
 }
@@ -5935,7 +6507,7 @@ table.form-table td .updated {
        padding: 0;
 }
 
-#post-body-content {
+.edit-form-section {
        margin-bottom: 20px;
 }
 
@@ -6706,6 +7278,27 @@ a.rsswidget {
        width: auto;
 }
 
+body.interim-login {
+       height: auto;
+}
+
+.interim-login #login {
+       padding: 0;
+       margin: 5px auto 20px;
+}
+
+.interim-login.login h1 a {
+       width: auto;
+}
+
+.interim-login #login_error,
+.interim-login.login .message {
+       margin: 0 0 16px;
+}
+
+.interim-login.login form {
+       margin: 0;
+}
 
 /* ms */
 /* Dashboard: MS Specific Data */
@@ -6749,8 +7342,36 @@ a.rsswidget {
 
 /* nav-menu */
 
+.no-js #message {
+       display: block;
+}
+
+#nav-menu-meta ul.outer-border {
+       -webkit-border-radius: 3px;
+       border-radius: 3px;
+}
+
+.accordion-section ul.category-tabs,
+.accordion-section ul.add-menu-item-tabs,
+.accordion-section ul.wp-tab-bar {
+       margin: 0;
+}
+
+.accordion-section .categorychecklist {
+       margin: 13px 0;
+}
+
+#nav-menu-meta .accordion-section-content {
+       padding: 18px 13px;
+}
+
+#nav-menu-meta .button-controls {
+       margin-bottom: 0;
+}
+
 #nav-menus-frame {
        margin-left: 300px;
+       margin-top: 23px;
 }
 
 #wpbody-content #menu-settings-column {
@@ -6759,11 +7380,7 @@ a.rsswidget {
        margin-left: -300px;
        clear: both;
        float: left;
-       padding-top: 24px;
-}
-
-.no-js #wpbody-content #menu-settings-column {
-       padding-top: 31px;
+       padding-top: 0;
 }
 
 #menu-settings-column .inside {
@@ -6771,7 +7388,8 @@ a.rsswidget {
        margin: 10px 0 0;
 }
 
-.metabox-holder-disabled .postbox {
+.metabox-holder-disabled .postbox,
+.metabox-holder-disabled .accordion-section-content  {
        opacity: 0.5;
        filter: alpha(opacity=50);
 }
@@ -6784,10 +7402,84 @@ a.rsswidget {
        position: relative;
 }
 
+.blank-slate .menu-name {
+       height: 2em;
+}
+
+.blank-slate .menu-settings {
+       border: none;
+       margin-top: 0;
+       padding-top: 0;
+       overflow: hidden;
+}
+
+.is-submenu {
+       font-style: italic;
+       font-weight: normal;
+       margin-left: 4px;
+}
+
+.manage-menus {
+       margin-top: 23px;
+       padding: 10px;
+       overflow: hidden;
+       -webkit-border-radius: 3px;
+       border-radius: 3px;
+}
+
+.manage-menus select {
+       float: left;
+       margin-right: 6px;
+}
+
+.manage-menus .selected-menu {
+       float: left;
+       margin: 5px 6px 0 0;
+}
+
+.manage-menus .submit-btn {
+       float: left;
+       margin-top: 1px;
+}
+
+.menu-edit p {
+       margin: .3em 0 .6em;
+}
+
+.menu-edit #post-body-content h3 {
+       margin: 0 0 10px;
+}
+
+.menu-settings {
+       margin-top: 2em;
+       overflow: hidden;
+}
+
+.menu-settings dl {
+       margin: 0 0 10px;
+       overflow: hidden;
+       position: relative;
+}
+
+.menu-settings dd {
+       float: left;
+       margin: 0;
+       width: 60%;
+}
+
+.menu-edit .checkbox-input {
+       margin-top: 4px;
+}
+
+.theme-location-set {
+       font-size: 11px;
+}
+
 /* Menu Container */
 #menu-management-liquid {
        float: left;
        min-width: 100%;
+       margin-top: 3px;
 }
 
 #menu-management {
@@ -6802,7 +7494,7 @@ a.rsswidget {
 }
 
 .nav-menus-php #post-body {
-       padding: 10px;
+       padding: 0 10px 10px;
        border-width: 1px 0;
        border-style: solid;
 }
@@ -6814,6 +7506,11 @@ a.rsswidget {
 
 #nav-menu-header {
        border-bottom: 1px solid;
+       margin-bottom: 13px;
+}
+
+#nav-menu-header .menu-name-label {
+       margin-top: 2px;
 }
 
 #nav-menu-footer {
@@ -6834,68 +7531,52 @@ a.rsswidget {
        font-weight:bold;
 }
 
-/* Menu Tabs */
-
-#menu-management .nav-tabs-nav {
-       margin: 0 20px;
+#select-nav-menu-container {
+       text-align: right;
+       padding: 0 10px 3px 10px;
+       margin-bottom: 5px;
 }
 
-#menu-management .nav-tabs-arrow {
-       width: 10px;
-       padding: 0 5px 4px;
-       cursor: pointer;
-       position: absolute;
-       top: 0;
-       line-height: 22px;
-       font-size: 18px;
-       text-shadow: 0 1px 0 #fff;
+#select-nav-menu {
+       width: 100px;
+       display: inline;
 }
 
-#menu-management .nav-tabs-arrow-left {
-       left: 0;
+#menu-name-label {
+       margin-top: -2px;
 }
 
-#menu-management .nav-tabs-arrow-right {
-       right: 0;
-       text-align: right;
+.widefat td.menu-location-menus {
+       padding-bottom: 5px;
 }
 
-#menu-management .nav-tabs-wrapper {
-       width: 100%;
-       height: 28px;
-       margin-bottom: -1px;
-       overflow: hidden;
+.menu-location-menus select {
+       float: left;
 }
 
-#menu-management .nav-tabs {
-       padding-left: 20px;
-       padding-right: 10px;
+#locations-nav-menu-wrapper {
+       padding: 5px 0;
 }
 
-.js #menu-management .nav-tabs {
+.locations-nav-menu-select select {
        float: left;
-       margin-left: 0px;
-       margin-right: -400px;
-}
-
-#menu-management .nav-tab {
-       margin-bottom: 0;
-       font-size: 14px;
+       width: 160px;
+       margin-right: 5px;
 }
 
-#select-nav-menu-container {
-       text-align: right;
-       padding: 0 10px 3px 10px;
-       margin-bottom: 5px;
+.locations-row-links {
+       float: left;
+       margin: 6px 0 0 6px;
 }
 
-#select-nav-menu {
-       width: 100px;
-       display: inline;
+.locations-edit-menu-link,
+.locations-add-menu-link {
+       margin: 0 3px;
 }
 
-#menu-name-label {
-       margin-top: -2px;
+.locations-edit-menu-link {
+       padding-right: 3px;
+       border-right: 1px solid #ccc;
 }
 
 #wpbody .open-label {
@@ -6916,13 +7597,46 @@ a.rsswidget {
 }
 
 /* Add Menu Item Boxes */
-.postbox .howto input {
+.postbox .howto input,
+.accordion-container .howto input {
        width: 180px;
        float: right;
 }
 
+.accordion-container .outer-border {
+       margin: 0;
+}
+
+#nav-menu-meta .accordion-container .top {
+       border-top: 1px solid #dfdfdf;
+}
+
+#nav-menu-meta .accordion-container .accordion-section:first-child,
+#nav-menu-meta .accordion-container .accordion-section:first-child h3,
+#nav-menu-meta .accordion-container .top,
+#nav-menu-meta .accordion-container .top h3 {
+       -webkit-border-top-right-radius: 3px;
+       -webkit-border-top-left-radius: 3px;
+       border-top-right-radius: 3px;
+       border-top-left-radius: 3px;
+}
+
+#nav-menu-meta .accordion-container .accordion-section:last-child,
+#nav-menu-meta .accordion-container .accordion-section:last-child .accordion-section-content,
+#nav-menu-meta .accordion-container .bottom,
+#nav-menu-meta .accordion-container .bottom:not(.open) h3 {
+       -webkit-border-bottom-right-radius: 3px;
+       -webkit-border-bottom-left-radius: 3px;
+       border-bottom-right-radius: 3px;
+       border-bottom-left-radius: 3px;
+}
+
 .customlinkdiv .howto input {
-       width: 200px;
+       width: 180px;
+}
+
+.customlinkdiv p {
+       margin-top: 0
 }
 
 #nav-menu-theme-locations .howto select {
@@ -6939,8 +7653,14 @@ a.rsswidget {
 
 /* Button Primary Actions */
 #menu-container .submit {
-       margin: 0px 0px 10px;
-       padding: 0px;
+       margin: 0 0 10px;
+       padding: 0;
+}
+
+.nav-menus-php .add-new-menu-action {
+       float: left;
+       margin: 6px 0 0 6px;
+       line-height: 15px;
 }
 
 .nav-menus-php .meta-sep,
@@ -7079,7 +7799,8 @@ a.rsswidget {
 }
 
 #menu-to-edit {
-       padding: 1em 0;
+       margin: 0;
+       padding: 0.1em 0;
 }
 
 .menu ul {
@@ -7095,7 +7816,7 @@ a.rsswidget {
        clear:both;
        line-height:1.5em;
        position:relative;
-       margin: 13px 0 0 0;
+       margin: 9px 0 0;
 }
 
 .menu-item-handle {
@@ -7259,6 +7980,11 @@ body.menu-max-depth-11 { min-width: 1280px !important; }
        border-bottom-right-radius: 3px;
 }
 
+.menu-item-settings .field-move a {
+       display: none;
+       margin: 0 2px;
+}
+
 .menu-item-edit-active .menu-item-settings {
        display: block;
 }
@@ -7322,34 +8048,16 @@ body.menu-max-depth-11 { min-width: 1280px !important; }
        text-align: right;
        float: right;
        line-height: 23px;
-       margin: 5px 0 1px;
+       margin: 2px 0 1px;
 }
 
-.nav-menus-php .major-publishing-actions .delete-action {
-       vertical-align: middle;
-       text-align: left;
-       float: left;
-       padding-right: 15px;
-       margin-top: 5px;
-}
-
-.menu-name-label span,
-.auto-add-pages label {
-       font-size: 12px;
-       font-style: normal;
-}
-
-.menu-name-label {
-       margin-right: 15px;
-}
-
-.auto-add-pages input {
-       margin-top: 0;
+.nav-menus-php .blank-slate .menu-settings {
+       display: none;
 }
 
-.auto-add-pages {
-       margin-top: 4px;
+.nav-menus-php .delete-action {
        float: left;
+       margin-top: 2px;
 }
 
 .nav-menus-php .submitbox .submitcancel {
@@ -8336,6 +9044,122 @@ a.widget-control-edit {
        -ms-touch-action: none;
 }
 
+/* Accordion */
+
+.accordion-section {
+       border-top: 1px solid #fff;
+       border-bottom: 1px solid #dfdfdf;
+       margin: 0;
+}
+
+.accordion-section:first-child {
+       border-top: 1px solid #dfdfdf;
+}
+
+.accordion-section:last-child {
+       box-shadow: 0 1px 0 0px #fff;
+}
+
+.accordion-section.open .accordion-section-content,
+.no-js .accordion-section .accordion-section-content {
+       display: block;
+}
+
+.accordion-section.open:hover {
+       border-bottom-color: #dfdfdf;
+}
+
+.accordion-section-content {
+       display: none;
+       padding: 10px 20px 15px;
+       overflow: hidden;
+       background: #fdfdfd;
+       border-left: 1px solid #dfdfdf;
+       border-right: 1px solid #dfdfdf;
+}
+
+.accordion-section-title {
+       margin: 0;
+       padding: 15px 20px;
+       position: relative;
+       border-left: 1px solid #dfdfdf;
+       border-right: 1px solid #dfdfdf;
+
+       -webkit-user-select: none;
+       -moz-user-select: none;
+       user-select: none;
+}
+
+.js .accordion-section-title {
+       cursor: pointer;
+}
+
+.js .accordion-section-title:after {
+       content: '';
+       width: 0;
+       height: 0;
+       border-color: #ccc transparent;
+       border-style: solid;
+       border-width: 6px 6px 0;
+       position: absolute;
+       top: 25px;
+       right: 20px;
+       z-index: 1;
+}
+
+.accordion-section-title:focus {
+       outline: none;
+}
+
+.accordion-section-title:hover:after,
+.accordion-section-title:focus:after {
+       border-color: #aaa transparent;
+}
+
+.cannot-expand .accordion-section-title {
+       cursor: auto;
+}
+
+.cannot-expand .accordion-section-title:after {
+       display: none;
+}
+
+.control-section .accordion-section-title {
+       padding: 10px 20px;
+       color: #464646;
+       font-size: 15px;
+       font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
+       font-weight: normal;
+       text-shadow: 0 1px 0 #fff;
+       background: #f5f5f5;
+       background-image: -webkit-gradient(linear, left bottom, left top, from(#eee), to(#f5f5f5));
+       background-image: -webkit-linear-gradient(bottom, #eee, #f5f5f5);
+       background-image:    -moz-linear-gradient(bottom, #eee, #f5f5f5);
+       background-image:      -o-linear-gradient(bottom, #eee, #f5f5f5);
+       background-image: linear-gradient(to top, #eee, #f5f5f5);
+}
+
+.control-section .accordion-section-title:after {
+       top: 15px;
+}
+
+.js .control-section:hover .accordion-section-title,
+.js .control-section .accordion-section-title:hover,
+.js .control-section.open .accordion-section-title,
+.js .control-section .accordion-section-title:focus {
+       color: #000;
+       background: #f9f9f9;
+       background-image: -webkit-gradient(linear, left bottom, left top, from(#ececec), to(#f9f9f9));
+       background-image: -webkit-linear-gradient(bottom, #ececec, #f9f9f9);
+       background-image:    -moz-linear-gradient(bottom, #ececec, #f9f9f9);
+       background-image:      -o-linear-gradient(bottom, #ececec, #f9f9f9);
+       background-image: linear-gradient(to top, #ececec, #f9f9f9);
+}
+
+.control-section.open .accordion-section-title {
+       border-bottom: 1px solid #dfdfdf;
+}
+
 /* =Media Queries
 -------------------------------------------------------------- */
 
@@ -8441,6 +9265,11 @@ a.widget-control-edit {
                background-size: 18px 100px;
        }
 
+       tr.wp-locked .locked-indicator  {
+               background-image: url('../images/lock-2x.png');
+               background-size: 16px 16px;
+       }
+
        th .comment-grey-bubble {
                background-image: url('../images/comment-grey-bubble-2x.png');
                background-size: 12px 12px;
@@ -8511,6 +9340,12 @@ a.widget-control-edit {
        .customize-loading #customize-container {
                background-image: url(../images/wpspin_light-2x.gif);
        }
+
+       .wp-slider .ui-slider-handle:before {
+               background-image: url(../images/arrows-pr-2x.png);
+               background-size: 16px 102px;
+       }
+
 }
 
 /* =Localized CSS
@@ -8574,8 +9409,3 @@ a.widget-control-edit {
 .locale-lt-lt .inline-edit-row fieldset label span.input-text-wrap {
        margin-left: 8em;
 }
-
-.update-php .spinner {
-       float: none;
-       margin: -4px 0;
-}
index 9db46c68bb5d697cb376aa3511f9d695fc11daea..9760c6c50b203732b99071ad862d75dfdc34f64a 100644 (file)
@@ -1 +1 @@
-#wpwrap{height:auto;min-height:100%;width:100%;position:relative}#wpcontent{height:100%}#wpcontent,#wpfooter{margin-left:165px}.folded #wpcontent,.folded #wpfooter{margin-left:52px}#wpbody-content{padding-bottom:65px;float:left;width:100%}#adminmenuback,#adminmenuwrap,#adminmenu,#adminmenu .wp-submenu{width:145px}#adminmenuback{position:absolute;top:0;bottom:0;z-index:-1}#adminmenu{clear:left;margin:0;padding:0;list-style:none}.folded #adminmenuback,.folded #adminmenuwrap,.folded #adminmenu,.folded #adminmenu li.menu-top{width:32px}.inner-sidebar{float:right;clear:right;display:none;width:281px;position:relative}.columns-2 .inner-sidebar{margin-right:auto;width:286px;display:block}.inner-sidebar #side-sortables,.columns-2 .inner-sidebar #side-sortables{min-height:300px;width:280px;padding:0}.has-right-sidebar .inner-sidebar{display:block}.has-right-sidebar #post-body{float:left;clear:left;width:100%;margin-right:-2000px}.has-right-sidebar #post-body-content{margin-right:300px;float:none;width:auto}#col-container,#col-left,#col-right{overflow:hidden;padding:0;margin:0}#col-left{width:35%}#col-right{float:right;clear:right;width:65%}.col-wrap{padding:0 7px}.alignleft{float:left}.alignright{float:right}.textleft{text-align:left}.textright{text-align:right}.clear{clear:both}.screen-reader-text,.screen-reader-text span,.ui-helper-hidden-accessible{position:absolute;left:-1000em;top:-1000em;height:1px;width:1px;overflow:hidden}.screen-reader-shortcut{position:absolute;top:-1000em}.screen-reader-shortcut:focus{left:6px;top:-21px;height:auto;width:auto;display:block;font-size:14px;font-weight:bold;padding:15px 23px 14px;background:#f1f1f1;color:#21759b;border-radius:3px;z-index:100000;line-height:normal;-webkit-box-shadow:0 0 2px 2px rgba(0,0,0,.6);box-shadow:0 0 2px 2px rgba(0,0,0,.6);text-decoration:none}.hidden,.js .closed .inside,.js .hide-if-js,.no-js .hide-if-no-js,.js.wp-core-ui .hide-if-js,.js .wp-core-ui .hide-if-js,.no-js.wp-core-ui .hide-if-no-js,.no-js .wp-core-ui .hide-if-no-js{display:none}input[type="text"],input[type="password"],input[type="number"],input[type="search"],input[type="email"],input[type="url"],textarea{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}input[type="checkbox"],input[type="radio"]{vertical-align:text-top;padding:0;margin:1px 0 0}input[type="search"]{-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration{display:none}html,body{height:100%;margin:0;padding:0}body{font-family:sans-serif;font-size:12px;line-height:1.4em;min-width:600px}body.iframe{min-width:0}body.login{background:#fbfbfb;min-width:0}iframe,img{border:0}td,textarea,input,select,button{font-family:inherit;font-size:inherit;font-weight:inherit}td,textarea{line-height:inherit}input,select{line-height:15px}a,input[type="text"],input[type="password"],input[type="number"],input[type="search"],input[type="email"],input[type="url"],select,textarea,div{outline:0}a:focus,a:active{outline:thin dotted}#adminmenu a:focus,#adminmenu a:active,.screen-reader-text:focus{outline:0}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}p{margin:1em 0}blockquote{margin:1em}label{cursor:pointer}li,dd{margin-bottom:6px}textarea,input,select{margin:1px;padding:3px}h1,h2,h3,h4,h5,h6{display:block;font-weight:bold}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em;margin:.83em 0}h3{font-size:1.17em;margin:1em 0}h4{font-size:1em;margin:1.33em 0}h5{font-size:.83em;margin:1.67em 0}h6{font-size:.67em;margin:2.33em 0}ul,ol{padding:0}ul{list-style:none}ol{list-style-type:decimal;margin-left:2em}ul.ul-disc{list-style:disc outside}ul.ul-square{list-style:square outside}ol.ol-decimal{list-style:decimal outside}ul.ul-disc,ul.ul-square,ol.ol-decimal{margin-left:1.8em}ul.ul-disc>li,ul.ul-square>li,ol.ol-decimal>li{margin:0 0 .5em}.code,code{font-family:Consolas,Monaco,monospace}kbd,code{padding:1px 3px;margin:0 1px;font-size:11px}.subsubsub{list-style:none;margin:8px 0 5px;padding:0;font-size:12px;float:left}.subsubsub a{line-height:2;padding:.2em;text-decoration:none}.subsubsub a .count,.subsubsub a.current .count{color:#999;font-weight:normal}.subsubsub a.current{font-weight:bold;border:0}.subsubsub li{display:inline-block;margin:0;padding:0;white-space:nowrap}.widefat,div.updated,div.error,.wrap .add-new-h2,textarea,input[type="text"],input[type="password"],input[type="file"],input[type="email"],input[type="number"],input[type="search"],input[type="tel"],input[type="url"],select,.tablenav .tablenav-pages a,.tablenav-pages span.current,#titlediv #title,.postbox,#postcustomstuff table,#postcustomstuff input,#postcustomstuff textarea,.imgedit-menu div,.plugin-update-tr .update-message,#poststuff .inside .the-tagcloud,.login form,#login_error,.login .message,#menu-management .menu-edit,.nav-menus-php .list-container,.menu-item-handle,.link-to-original,.nav-menus-php .major-publishing-actions .form-invalid,.press-this #message,#TB_window,.tbtitle,.highlight,.feature-filter,#widget-list .widget-top,.editwidget .widget-inside{-webkit-border-radius:3px;border-radius:3px;border-width:1px;border-style:solid}.widefat{border-spacing:0;width:100%;clear:both;margin:0}.widefat *{word-wrap:break-word}.widefat a{text-decoration:none}.widefat thead th:first-of-type{-webkit-border-top-left-radius:3px;border-top-left-radius:3px}.widefat thead th:last-of-type{-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.widefat tfoot th:first-of-type{-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px}.widefat tfoot th:last-of-type{-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.widefat td,.widefat th{border-width:1px 0;border-style:solid}.widefat tfoot th{border-bottom:0}.widefat .no-items td{border-bottom-width:0}.widefat td{font-size:12px;padding:4px 7px 2px;vertical-align:top}.widefat td p,.widefat td ol,.widefat td ul{font-size:12px}.widefat th{padding:7px 7px 8px;text-align:left;line-height:1.3em;font-size:14px}.widefat th input{margin:0 0 0 8px;padding:0;vertical-align:text-top}.widefat .check-column{width:2.2em;padding:6px 0 25px;vertical-align:top}.widefat tbody th.check-column{padding:9px 0 22px}.widefat.media .check-column{padding-top:8px}.widefat thead .check-column,.widefat tfoot .check-column{padding:10px 0 0}.no-js .widefat thead .check-column input,.no-js .widefat tfoot .check-column input{display:none}.widefat .num,.column-comments,.column-links,.column-posts{text-align:center}.widefat th#comments{vertical-align:middle}.wrap{margin:4px 15px 0 0}div.updated,div.error{padding:0 .6em;margin:5px 15px 2px}div.updated p,div.error p{margin:.5em 0;padding:2px}.wrap div.updated,.wrap div.error,.media-upload-form div.error{margin:5px 0 15px}.wrap h2,.subtitle{font-weight:normal;margin:0;text-shadow:#fff 0 1px 0}.wrap h2{font-size:23px;padding:9px 15px 4px 0;line-height:29px}.subtitle{font-size:14px;padding-left:25px}.wrap .add-new-h2{font-family:sans-serif;margin-left:4px;padding:3px 8px;position:relative;top:-3px;text-decoration:none;font-size:12px;border:0 none}.wrap h2.long-header{padding-right:0}html,.wp-dialog{background-color:#fff}textarea,input[type="text"],input[type="password"],input[type="file"],input[type="email"],input[type="number"],input[type="search"],input[type="tel"],input[type="url"],select{background-color:#fff;color:#333}select{color:#000}select[disabled]{color:#7f7f7f}select:focus{border-color:#aaa}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="file"]:focus,input[type="email"]:focus,input[type="number"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="url"]:focus,select:focus{-webkit-box-shadow:1px 1px 2px rgba(0,0,0,0.1);box-shadow:1px 1px 2px rgba(0,0,0,0.1)}input[readonly]{background-color:#eee}:-moz-placeholder{color:#a9a9a9}div.sidebar-name h3,#menu-management .nav-tab,#dashboard_plugins h5,a.rsswidget,#dashboard_right_now td.b,#dashboard-widgets h4,.tool-box .title,#poststuff h3,.metabox-holder h3,.pressthis a,#your-profile legend,.inline-edit-row fieldset span.title,.inline-edit-row fieldset span.checkbox-title,.tablenav .displaying-num,.widefat th,.quicktags,.search{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif}h2 .nav-tab,.wrap h2,.subtitle,.login form .input{font-family:"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif}.quicktags,.search{font-size:12px}.icon32{float:left;height:34px;margin:7px 8px 0 0;width:36px}.icon16{height:18px;width:18px;padding:6px 6px;margin:-6px 0 0 -8px;float:left}.key-labels label{line-height:24px}.pre{white-space:pre-wrap;word-wrap:break-word}.howto{font-style:italic;display:block;font-family:sans-serif}p.install-help{margin:8px 0;font-style:italic}.no-break{white-space:nowrap}.wp-admin select{padding:2px;height:2em}.wp-admin select[multiple]{height:auto}.submit{padding:1.5em 0;margin:5px 0;-webkit-border-bottom-left-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-left-radius:3px;border-bottom-right-radius:3px}form p.submit a.cancel:hover{text-decoration:none}#minor-publishing-actions input,#major-publishing-actions input,#minor-publishing-actions .preview{text-align:center}textarea.all-options,input.all-options{width:250px}input.large-text,textarea.large-text{width:99%}input.regular-text,#adduser .form-field input{width:25em}input.small-text{width:50px}input[type="number"].small-text{width:60px}#doaction,#doaction2,#post-query-submit{margin:1px 8px 0 0}.tablenav #changeit,.tablenav #delete_all,.tablenav #clear-recent-list{margin-top:1px}.tablenav .actions select{float:left;margin-right:6px;max-width:200px}.ie8 .tablenav .actions select{width:155px}.ie8 .tablenav .actions select#cat{width:200px}#timezone_string option{margin-left:1em}label,#your-profile label+a{vertical-align:middle}#misc-publishing-actions label{vertical-align:baseline}#pass-strength-result{border-style:solid;border-width:1px;float:left;margin:13px 5px 5px 1px;padding:3px 5px;text-align:center;width:200px;display:none}.indicator-hint{padding-top:8px}p.search-box{float:right;margin:0}.search-box input[name="s"],#search-plugins input[name="s"],.tagsdiv .newtag{float:left;height:2em;margin:0 4px 0 0}input[type="text"].ui-autocomplete-loading{background:transparent url('../images/loading.gif') no-repeat right center;visibility:visible}ul#add-to-blog-users{margin:0 0 0 14px}.ui-autocomplete-input.open{border-bottom-right-radius:0;border-bottom-left-radius:0}.ui-autocomplete{padding:0;margin:0;list-style:none;position:absolute;z-index:10000;border-bottom-right-radius:3px;border-bottom-left-radius:3px;border-width:1px;border-style:solid}.ui-autocomplete li{margin-bottom:0;white-space:nowrap;text-align:left}.ui-autocomplete li a{display:block;height:100%;padding:4px 10px}.ui-autocomplete li a.ui-state-focus{cursor:pointer}#major-publishing-actions{padding:10px 10px 8px;clear:both;border-top:1px solid #f5f5f5;margin-top:-2px}#delete-action{line-height:25px;vertical-align:middle;text-align:left;float:left}#publishing-action{text-align:right;float:right;line-height:23px}#publishing-action .spinner{float:left}#misc-publishing-actions{padding:6px 0 0}.misc-pub-section{padding:6px 10px 8px;border-width:1px 0;border-style:solid}.misc-pub-section:first-child{border-top-width:0}.misc-pub-section-last{border-bottom-width:0}#minor-publishing-actions{padding:10px 10px 2px 8px;text-align:right}#minor-publishing{border-bottom-width:1px;border-bottom-style:solid;-webkit-box-shadow:0 1px 0 #fff;box-shadow:0 1px 0 #fff}#save-post{float:left}.preview{float:right}#sticky-span{margin-left:18px}.side-info{margin:0;padding:4px;font-size:11px}.side-info h5{padding-bottom:7px;font-size:14px;margin:12px 2px 5px;border-bottom-width:1px;border-bottom-style:solid}.side-info ul{margin:0;padding-left:18px;list-style:square}.approve,.unapproved .unapprove{display:none}.unapproved .approve,.spam .approve,.trash .approve{display:inline}td.action-links,th.action-links{text-align:right}#update-nag,.update-nag{line-height:19px;padding:5px 0;font-size:12px;text-align:center;margin:-1px 15px 0 5px;border-width:1px;border-style:solid;-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.plugins .plugin-update{padding:0}.plugin-update .update-message{margin:0 10px 8px 31px;font-weight:bold}ul#dismissed-updates{display:none}form.upgrade{margin-top:8px}form.upgrade .hint{font-style:italic;font-size:85%;margin:-0.5em 0 2em 0}#ajax-loading,.ajax-loading,.ajax-feedback,.imgedit-wait-spin,.list-ajax-loading{visibility:hidden}#ajax-response.alignleft{margin-left:2em}#adminmenu a,#sidemenu a,#taglist a,#catlist a{text-decoration:none}#screen-options-wrap,#contextual-help-wrap{margin:0;padding:8px 20px 12px;position:relative}#contextual-help-wrap{overflow:auto}#screen-meta .screen-reader-text{visibility:hidden}#screen-meta-links{margin:0 24px 0 0}#screen-meta-links a:focus{-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.4);box-shadow:1px 1px 1px rgba(0,0,0,0.4);outline:0}#screen-meta{display:none;position:relative;margin:0 15px 0 5px;border-width:0 1px 1px;border-style:none solid solid}#screen-options-link-wrap,#contextual-help-link-wrap{float:right;height:23px;padding:0;margin:0 0 0 6px;font-family:sans-serif}#screen-options-link-wrap,#contextual-help-link-wrap,#screen-meta{-webkit-border-bottom-left-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-left-radius:3px;border-bottom-right-radius:3px}#screen-meta-links .screen-meta-toggle{position:relative;top:-1px}#screen-meta-links a.show-settings{text-decoration:none;z-index:1;padding:1px 16px 0 6px;height:22px;line-height:22px;font-size:12px;display:block;text-shadow:rgba(255,255,255,0.7) 0 1px 0}#screen-meta-links a.show-settings:hover{text-decoration:none}.toggle-arrow{background-repeat:no-repeat;background-position:top left;background-color:transparent;height:22px;line-height:22px;display:block}.toggle-arrow-active{background-position:bottom left}#screen-options-wrap h5,#contextual-help-wrap h5{margin:8px 0;font-size:13px}.metabox-prefs label{display:inline-block;padding-right:15px;white-space:nowrap;line-height:30px}.metabox-prefs label input{margin:0 5px 0 2px}.metabox-prefs .columns-prefs label input{margin:0 2px}.metabox-prefs label a{display:none}#contextual-help-wrap{padding:0;margin-left:-4px}#contextual-help-columns{position:relative}#contextual-help-back{position:absolute;top:0;bottom:0;left:150px;right:170px;border-width:0 1px;border-style:solid}#contextual-help-wrap.no-sidebar #contextual-help-back{right:0;border-right-width:0;-webkit-border-bottom-right-radius:2px;border-bottom-right-radius:2px}.contextual-help-tabs{float:left;width:150px;margin:0}.contextual-help-tabs ul{margin:1em 0}.contextual-help-tabs li{margin-bottom:0;list-style-type:none;border-style:solid;border-width:1px 0;border-color:transparent}.contextual-help-tabs a{display:block;padding:5px 5px 5px 12px;line-height:18px;text-decoration:none}.contextual-help-tabs .active{padding:0;margin:0 -1px 0 0;border-width:1px 0 1px 1px;border-style:solid}.contextual-help-tabs-wrap{padding:0 20px;overflow:auto}.help-tab-content{display:none;margin:0 22px 12px 0;line-height:1.6em}.help-tab-content.active{display:block}.help-tab-content li{list-style-type:disc;margin-left:18px}.contextual-help-sidebar{width:150px;float:right;padding:0 8px 0 12px;overflow:auto}#adminmenuback,#adminmenuwrap{border-width:0 1px 0 0;border-style:solid}#adminmenuwrap{position:relative;float:left}#adminmenushadow{position:absolute;top:0;right:0;bottom:0;width:6px;z-index:20}#adminmenu *{-webkit-user-select:none;-moz-user-select:none;user-select:none}#adminmenu li{margin:0;padding:0;cursor:pointer}#adminmenu a{display:block;line-height:18px;padding:2px 5px}#adminmenu li.menu-top{min-height:28px;position:relative}#adminmenu .wp-submenu{list-style:none;padding:4px 0;margin:0;position:absolute;top:-1000em;left:146px;z-index:1000;overflow:visible;border-width:1px;border-style:solid;-webkit-border-bottom-right-radius:3px;-webkit-border-top-right-radius:3px;border-bottom-right-radius:3px;border-top-right-radius:3px}.js #adminmenu .sub-open,.js #adminmenu .opensub .wp-submenu,#adminmenu a.menu-top:focus+.wp-submenu,.no-js li.wp-has-submenu:hover .wp-submenu{top:-1px}#adminmenu .wp-has-current-submenu .wp-submenu,.no-js li.wp-has-current-submenu:hover .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,#adminmenu .wp-has-current-submenu .wp-submenu.sub-open,#adminmenu .wp-has-current-submenu.opensub .wp-submenu{position:relative;z-index:2;top:auto;left:auto;right:auto;bottom:auto;border:0 none;-webkit-box-shadow:none;box-shadow:none}.folded #adminmenu .wp-submenu.sub-open,.folded #adminmenu .opensub .wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,.folded #adminmenu .wp-has-current-submenu.opensub .wp-submenu,.folded #adminmenu a.menu-top:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu a.menu-top:focus+.wp-submenu,.no-js.folded #adminmenu .wp-has-submenu:hover .wp-submenu{top:-1px;left:32px}.folded #adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{border-width:1px;border-style:solid;position:absolute;top:-1000em}#adminmenu .wp-submenu a{font-size:12px;line-height:18px;margin:0;padding-left:12px}#adminmenu .wp-not-current-submenu li>a{padding-left:16px}#adminmenu .wp-has-current-submenu ul>li>a,.folded #adminmenu li.menu-top .wp-submenu>li>a{padding-left:12px}#adminmenu a.menu-top,#adminmenu .wp-submenu-head{font-size:13px;font-weight:bold;line-height:18px;padding:0}#adminmenu .wp-submenu-head,.folded #adminmenu .wp-menu-name{display:none}.folded #adminmenu .wp-submenu-head{display:block}#adminmenu .wp-submenu li{padding:0;margin:0;overflow:hidden}#adminmenu a.menu-top{border-width:1px 0;border-style:solid none}#adminmenu .wp-menu-image img{padding:7px 0 0 7px;opacity:.6;filter:alpha(opacity=60)}#adminmenu div.wp-menu-name{padding:5px}#adminmenu div.wp-menu-image{float:left;width:28px;height:28px}.folded #adminmenu div.wp-menu-image{width:32px;position:absolute;z-index:25}.folded #adminmenu a.menu-top{height:28px}.wp-menu-arrow{z-index:25;position:absolute;right:100%;margin:0;height:30px;width:6px;-moz-transform:translate(146px);-webkit-transform:translate(146px);-o-transform:translate(146px);-ms-transform:translate(146px);transform:translate(146px)}#adminmenu .wp-menu-arrow div{display:none;position:absolute;top:7px;left:-1px;width:14px;height:15px;-moz-transform:matrix(-0.6,1,0.6,1,0,0);-webkit-transform:matrix(-0.6,1,0.6,1,0,0);-o-transform:matrix(-0.6,1,0.6,1,0,0);-ms-transform:matrix(-0.6,1,0.6,1,0,0);transform:matrix(-0.6,1,0.6,1,0,0)}#adminmenu li.wp-not-current-submenu .wp-menu-arrow{-moz-transform:translate(145px);-webkit-transform:translate(145px);-o-transform:translate(145px);-ms-transform:translate(145px);transform:translate(145px);height:28px;border-width:1px 0;border-style:solid;top:0}.folded #adminmenu li .wp-menu-arrow{-moz-transform:translate(32px);-webkit-transform:translate(32px);-o-transform:translate(32px);-ms-transform:translate(32px);transform:translate(32px)}#adminmenu li.current .wp-menu-arrow,#adminmenu li.wp-has-current-submenu .wp-menu-arrow,#adminmenu li.wp-has-current-submenu .wp-menu-arrow div,#adminmenu li.wp-has-submenu .wp-menu-arrow div,#adminmenu li.current .wp-menu-arrow div,.no-js #adminmenu li.wp-has-submenu:hover .wp-menu-arrow,#adminmenu li.wp-has-submenu.opensub .wp-menu-arrow,#adminmenu a.wp-has-submenu:focus .wp-menu-arrow,#adminmenu a:hover .wp-menu-arrow{display:block}#adminmenu li.current .wp-menu-arrow,#adminmenu li.wp-menu-open .wp-menu-arrow{top:0}.no-js #adminmenu li.wp-has-submenu:hover .wp-menu-arrow,#adminmenu li.wp-has-submenu.opensub .wp-menu-arrow,#adminmenu a.wp-has-submenu:focus .wp-menu-arrow{z-index:1001}.ie8 #adminmenu li.menu-top:hover .wp-menu-arrow{display:none}#adminmenu .wp-not-current-submenu .wp-menu-arrow div{width:15px;top:6px;border-width:0 0 1px 1px;border-style:solid}.wp-menu-arrow,.folded #adminmenu li .wp-menu-arrow div,.no-js #adminmenu li.wp-not-current-submenu:hover .wp-menu-arrow{display:none}.folded #adminmenu li.current .wp-menu-arrow,.folded #adminmenu li.current .wp-menu-arrow div,.folded #adminmenu li.wp-has-current-submenu .wp-menu-arrow div,.folded #adminmenu li.wp-menu-open .wp-menu-arrow,.folded #adminmenu li a:focus .wp-menu-arrow{display:block}#adminmenu li.menu-top:hover .wp-menu-image img,#adminmenu li.wp-has-current-submenu .wp-menu-image img{opacity:1;filter:alpha(opacity=100)}#adminmenu li.wp-menu-separator{height:3px;padding:0;margin:0;border-width:1px 0;border-style:solid;cursor:inherit}#adminmenu div.separator{height:1px;padding:0;border-width:1px 0 0 0;border-style:solid}#adminmenu .wp-submenu .wp-submenu-head{padding:5px 4px 5px 10px;margin:-4px -1px 4px;border-width:1px 0;border-style:solid;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}#adminmenu li.wp-menu-open{border-width:0 0 1px;border-style:solid}#adminmenu li.current,.folded #adminmenu li.wp-menu-open{border:0 none}.folded #adminmenu li.wp-has-current-submenu{margin-bottom:1px}.folded #adminmenu .wp-has-current-submenu.menu-top-last{margin-bottom:0}#adminmenu .awaiting-mod,#adminmenu span.update-plugins,#sidemenu li a span.update-plugins{position:absolute;font-family:sans-serif;font-size:9px;line-height:17px;font-weight:bold;margin-top:1px;margin-left:7px;-webkit-border-radius:10px;border-radius:10px;z-index:26}#adminmenu li .awaiting-mod span,#adminmenu li span.update-plugins span,#sidemenu li a span.update-plugins span{display:block;padding:0 6px}#adminmenu li span.count-0,#sidemenu li a .count-0{display:none}#collapse-menu{font-size:12px;line-height:34px;border-width:1px 0 0;border-style:solid}.folded #collapse-menu span{display:none}#collapse-button,#collapse-button div{width:15px;height:15px}#collapse-button{float:left;margin:8px 6px;border-width:1px;border-style:solid;-webkit-border-radius:10px;border-radius:10px}@media only screen and (max-width:900px){.auto-fold #wpcontent,.auto-fold #wpfooter{margin-left:52px}.auto-fold #adminmenuback,.auto-fold #adminmenuwrap,.auto-fold #adminmenu,.auto-fold #adminmenu li.menu-top{width:32px}.auto-fold #adminmenu .wp-submenu.sub-open,.auto-fold #adminmenu .opensub .wp-submenu,.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,.auto-fold #adminmenu .wp-has-current-submenu.opensub .wp-submenu,.auto-fold #adminmenu a.menu-top:focus+.wp-submenu,.auto-fold #adminmenu .wp-has-current-submenu a.menu-top:focus+.wp-submenu{top:-1px;left:32px}.auto-fold #adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu{border-width:1px;border-style:solid;position:absolute;top:-1000em}.auto-fold #adminmenu li.menu-top .wp-submenu>li>a{padding-left:12px}.auto-fold #adminmenu .wp-menu-name{display:none}.auto-fold #adminmenu .wp-submenu-head{display:block}.auto-fold #adminmenu div.wp-menu-image{width:32px;position:absolute;z-index:25}.auto-fold #adminmenu a.menu-top{height:28px}.auto-fold #adminmenu li .wp-menu-arrow{-moz-transform:translate(32px);-webkit-transform:translate(32px);-o-transform:translate(32px);-ms-transform:translate(32px);transform:translate(32px)}.auto-fold #adminmenu li .wp-menu-arrow div{display:none}.auto-fold #adminmenu li.current .wp-menu-arrow,.auto-fold #adminmenu li.current .wp-menu-arrow div,.auto-fold #adminmenu li.wp-has-current-submenu .wp-menu-arrow div,.auto-fold #adminmenu li.wp-menu-open .wp-menu-arrow,.auto-fold #adminmenu li a:focus .wp-menu-arrow{display:block}.auto-fold #adminmenu li.wp-menu-open{border:0 none}.auto-fold #adminmenu li.wp-has-current-submenu{margin-bottom:1px}.auto-fold #adminmenu .wp-has-current-submenu.menu-top-last{margin-bottom:0}.auto-fold #collapse-menu span{display:none}}.post-com-count-wrapper{min-width:22px;font-family:sans-serif}.post-com-count{background-image:url('../images/bubble_bg.gif');height:1.3em;line-height:1.1em;display:block;text-decoration:none;padding:0 0 6px;cursor:pointer;background-position:center -80px;background-repeat:no-repeat}.post-com-count span{font-size:11px;font-weight:bold;height:1.4em;line-height:1.4em;min-width:.7em;padding:0 6px;display:inline-block;-webkit-border-radius:5px;border-radius:5px}strong .post-com-count{background-position:center -55px}.post-com-count:hover{background-position:center -3px}.column-response .post-com-count{float:left;margin-right:5px;text-align:center}.response-links{float:left}#the-comment-list .attachment-80x60{padding:4px 8px}th .comment-grey-bubble{background-image:url('../images/comment-grey-bubble.png');background-repeat:no-repeat;height:12px;width:12px}html.wp-toolbar{padding-top:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.narrow{width:70%;margin-bottom:40px}.narrow p{line-height:150%}.widefat th,.widefat td{overflow:hidden}.widefat th{font-weight:normal}.widefat td p{margin:2px 0 .8em}.widefat .column-comment p{margin:.6em 0}.postbox-container{float:left}#dashboard-widgets.columns-1 .postbox-container{width:100%}#dashboard-widgets.columns-2 .postbox-container{width:49.5%}#dashboard-widgets.columns-2 #postbox-container-2,#dashboard-widgets.columns-2 #postbox-container-3,#dashboard-widgets.columns-2 #postbox-container-4{float:right;width:50.5%}#dashboard-widgets.columns-3 .postbox-container{width:33.5%}#dashboard-widgets.columns-3 #postbox-container-1{width:33%}#dashboard-widgets.columns-3 #postbox-container-3,#dashboard-widgets.columns-3 #postbox-container-4{float:right}#dashboard-widgets.columns-4 .postbox-container{width:25%}.postbox-container .meta-box-sortables{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.metabox-holder .postbox-container .empty-container{border:3px dashed #ccc;height:250px}.metabox-holder.columns-1 .postbox-container .empty-container,.columns-2 #postbox-container-3 .empty-container,.columns-2 #postbox-container-4 .empty-container,.columns-3 #postbox-container-4 .empty-container{border:0 none;height:0;min-height:0}#poststuff{padding-top:10px}#poststuff #post-body{padding:0}#post-body-content{width:100%;float:left}#poststuff .postbox-container{width:100%}#poststuff #post-body.columns-2{margin-right:300px}#post-body.columns-2 #postbox-container-1{float:right;margin-right:-300px;width:280px}#post-body.columns-2 #side-sortables{min-height:250px}@media only screen and (max-width:799px){#wpbody-content #dashboard-widgets .postbox-container{width:100%}#wpbody-content .metabox-holder .postbox-container .empty-container{border:0 none;height:0;min-height:0}}@media only screen and (min-width:800px) and (max-width:1200px){#wpbody-content #dashboard-widgets .postbox-container{width:49.5%}#wpbody-content #dashboard-widgets #postbox-container-2,#wpbody-content #dashboard-widgets #postbox-container-3,#wpbody-content #dashboard-widgets #postbox-container-4{float:right;width:50.5%}#dashboard-widgets #postbox-container-3 .empty-container,#dashboard-widgets #postbox-container-4 .empty-container{border:0 none;height:0;min-height:0}#wpbody #wpbody-content #dashboard-widgets.columns-1 .postbox-container{width:100%}#wpbody #wpbody-content .metabox-holder.columns-1 .postbox-container .empty-container{border:0 none;height:0;min-height:0}.index-php .screen-layout,.index-php .columns-prefs{display:block}.columns-prefs .columns-prefs-3,.columns-prefs .columns-prefs-4{display:none}}@media only screen and (max-width:850px){#wpbody-content #poststuff #post-body{margin:0}#wpbody-content #post-body.columns-2 #postbox-container-1{margin-right:0;width:100%}#poststuff #postbox-container-1 .empty-container,#poststuff #postbox-container-1 #side-sortables:empty{border:0 none;height:0;min-height:0}#poststuff #post-body.columns-2 #side-sortables{min-height:0}.screen-layout,.columns-prefs{display:none}}.postbox .hndle{-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-left-radius:3px;border-top-right-radius:3px}.js .postbox .hndle{cursor:move}.postbox.closed .hndle{-webkit-border-radius:3px;border-radius:3px}.hndle a{font-size:11px;font-weight:normal}.postbox .handlediv{float:right;width:27px;height:30px}.js .postbox .handlediv{cursor:pointer}.sortable-placeholder{border-width:1px;border-style:dashed;margin-bottom:20px}.widget,.postbox,.stuffbox{margin-bottom:20px;padding:0;border-width:1px;border-style:solid;line-height:1}.widget .widget-top,.postbox h3,.stuffbox h3{margin-top:1px;border-bottom-width:1px;border-bottom-style:solid;-webkit-user-select:none;-moz-user-select:none;user-select:none}.js .widget .widget-top,.js .postbox h3{cursor:move}.postbox .inside,.stuffbox .inside{padding:0 12px 0 10px;line-height:1.4em}.postbox .inside{margin:10px 0;position:relative}.postbox.closed h3{border:0;-webkit-box-shadow:none;box-shadow:none}.postbox table.form-table{margin-bottom:0}.temp-border{border:1px dotted #ccc}.columns-prefs label{padding:0 5px}#dashboard-widgets-wrap{margin:0 -8px}#wpbody-content .metabox-holder{padding-top:10px}#dashboard-widgets .meta-box-sortables{margin:0 8px}#dashboard_recent_comments div.undo{border-top-style:solid;border-top-width:1px;margin:0 -10px;padding:3px 8px;font-size:11px}#the-comment-list td.comment p.comment-author{margin-top:0;margin-left:0}#the-comment-list p.comment-author img{float:left;margin-right:8px}#the-comment-list p.comment-author strong a{border:0}#the-comment-list td{vertical-align:top}#the-comment-list td.comment{word-wrap:break-word}.welcome-panel{position:relative;overflow:auto;margin:20px 0;padding:23px 10px 12px;border-width:1px;border-style:solid;border-radius:3px;font-size:13px;line-height:2.1em}.welcome-panel h3{margin:0;font-family:"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;font-size:21px;font-weight:normal;line-height:1.2}.welcome-panel h4{margin:1.33em 0 0;font-size:13px}.welcome-panel .about-description{font-size:16px;margin:0}.welcome-panel .welcome-panel-close{position:absolute;top:5px;right:10px;padding:8px 3px;font-size:13px;text-decoration:none;line-height:1}.welcome-panel .welcome-panel-close:before{content:' ';position:absolute;left:-12px;width:10px;height:100%;background:url('../images/xit.gif') 0 17% no-repeat}.welcome-panel .welcome-panel-close:hover:before{background-position:100% 17%}.wp-core-ui .welcome-panel .button.button-hero{margin:15px 0 3px}.welcome-panel-content{margin-left:13px;max-width:1500px}.welcome-panel .welcome-panel-column-container{clear:both;overflow:hidden;position:relative}.welcome-panel .welcome-panel-column{width:32%;min-width:200px;float:left}.ie8 .welcome-panel .welcome-panel-column{min-width:230px}.welcome-panel .welcome-panel-column:first-child{width:36%}.welcome-panel-column p{margin-top:7px}.welcome-panel .welcome-icon{display:block;padding:2px 0 8px 32px;background-image:url('../images/welcome-icons.png');background-repeat:no-repeat;background-size:16px}.welcome-panel .welcome-add-page{background-position:0 2px}.welcome-panel .welcome-edit-page{background-position:0 -90px}.welcome-panel .welcome-learn-more{background-position:0 -136px}.welcome-panel .welcome-comments{background-position:0 -182px}.welcome-panel .welcome-view-site{background-position:0 -274px}.welcome-panel .welcome-widgets-menus{background-position:1px -229px;line-height:14px}.welcome-panel .welcome-write-blog{background-position:0 -44px}.welcome-panel .welcome-panel-column ul{margin:.8em 1em 1em 0}.welcome-panel .welcome-panel-column li{line-height:16px;list-style-type:none}@media screen and (max-width:870px){.welcome-panel .welcome-panel-column,.welcome-panel .welcome-panel-column:first-child{display:block;float:none;width:100%}.welcome-panel .welcome-panel-column li{display:inline-block;margin-right:13px}.welcome-panel .welcome-panel-column ul{margin:.4em 0 0}.welcome-panel .welcome-icon{padding-left:25px}}table.fixed{table-layout:fixed}.fixed .column-rating,.fixed .column-visible{width:8%}.fixed .column-date,.fixed .column-parent,.fixed .column-links{width:10%}.fixed .column-response,.fixed .column-author,.fixed .column-categories,.fixed .column-tags,.fixed .column-rel,.fixed .column-role{width:15%}.fixed .column-comments{width:4em;padding:8px 0;text-align:left}.fixed .column-comments .vers{padding-left:3px}.fixed .column-comments a{float:left}.fixed .column-slug{width:25%}.fixed .column-posts{width:10%}.fixed .column-icon{width:80px}#comments-form .fixed .column-author{width:20%}#commentsdiv.postbox .inside{margin:0;padding:0}#commentsdiv .inside .row-actions{line-height:18px}#commentsdiv .inside .column-author{width:25%}#commentsdiv .column-comment p{margin:.6em 0;padding:0}#commentsdiv #replyrow td{padding:0}#commentsdiv p{padding:8px 10px;margin:0}#commentsdiv #add-new-comment{border-width:0 0 1px;border-style:none none solid}#commentsdiv .comments-box{border:0 none}#commentsdiv .comments-box thead th{background:transparent;padding:0 7px 4px;font-style:italic}#commentsdiv .comments-box tr:last-child td{border-bottom:0 none}#commentsdiv .spinner{padding-left:5px}.sorting-indicator{display:none;width:7px;height:4px;margin-top:8px;margin-left:7px;background-image:url('../images/sort.gif');background-repeat:no-repeat}.fixed .column-comments .sorting-indicator{margin-top:3px}.widefat th.sortable,.widefat th.sorted{padding:0}th.sortable a,th.sorted a{display:block;overflow:hidden;padding:7px 7px 8px}.fixed .column-comments.sortable a,.fixed .column-comments.sorted a{padding:8px 0}th.sortable a span,th.sorted a span{float:left;cursor:pointer}th.sorted.asc .sorting-indicator,th.desc:hover span.sorting-indicator{display:block;background-position:0 0}th.sorted.desc .sorting-indicator,th.asc:hover span.sorting-indicator{display:block;background-position:-7px 0}.tablenav-pages a{border-bottom-style:solid;border-bottom-width:2px;font-weight:bold;margin-right:1px;padding:0 2px}.tablenav-pages .current-page{text-align:center}.tablenav-pages .next-page{margin-left:2px}.tablenav a.button-secondary{display:block;margin:3px 8px 0 0}.tablenav{clear:both;height:30px;margin:6px 0 4px;vertical-align:middle}.tablenav.themes{max-width:98%}.tablenav .tablenav-pages{float:right;display:block;cursor:default;height:30px;line-height:30px;font-size:12px}.tablenav .no-pages,.tablenav .one-page .pagination-links{display:none}.tablenav .tablenav-pages a,.tablenav-pages span.current{text-decoration:none;padding:3px 6px}.tablenav .tablenav-pages a.disabled:hover,.tablenav .tablenav-pages a.disabled:active{cursor:default}.tablenav .displaying-num{margin-right:10px;font-size:12px;font-style:italic}.tablenav .actions{overflow:hidden;padding:2px 8px 0 0}.tablenav .delete{margin-right:20px}.view-switch{float:right;margin:6px 8px 0}.view-switch a{text-decoration:none}.filter{float:left;margin:-5px 0 0 10px}.filter .subsubsub{margin-left:-10px;margin-top:13px}.screen-per-page{width:4em}#posts-filter fieldset{float:left;margin:0 1.5ex 1em 0;padding:0}#posts-filter fieldset legend{padding:0 0 .2em 1px}span.post-state-format{font-weight:normal}#wpbody-content .inline-edit-row fieldset{font-size:12px;float:left;margin:0;padding:0;width:100%}tr.inline-edit-row td,#wpbody-content .inline-edit-row fieldset .inline-edit-col{padding:0 .5em}#wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inline-edit-col{border-width:0 0 0 1px;border-style:none none none solid}#wpbody-content .quick-edit-row-post .inline-edit-col-left{width:40%}#wpbody-content .quick-edit-row-post .inline-edit-col-right{width:39%}#wpbody-content .inline-edit-row-post .inline-edit-col-center{width:20%}#wpbody-content .quick-edit-row-page .inline-edit-col-left{width:50%}#wpbody-content .quick-edit-row-page .inline-edit-col-right,#wpbody-content .bulk-edit-row-post .inline-edit-col-right{width:49%}#wpbody-content .bulk-edit-row .inline-edit-col-left{width:30%}#wpbody-content .bulk-edit-row-page .inline-edit-col-right{width:69%}#wpbody-content .bulk-edit-row .inline-edit-col-bottom{float:right;width:69%}#wpbody-content .inline-edit-row-page .inline-edit-col-right{margin-top:27px}.inline-edit-row fieldset .inline-edit-group{clear:both}.inline-edit-row fieldset .inline-edit-group:after{content:".";display:block;height:0;clear:both;visibility:hidden}.inline-edit-row p.submit{clear:both;padding:.5em;margin:.5em 0 0}.inline-edit-row span.error{line-height:22px;margin:0 15px;padding:3px 5px}.inline-edit-row h4{margin:.2em 0;padding:0;line-height:23px}.inline-edit-row fieldset span.title,.inline-edit-row fieldset span.checkbox-title{margin:0;padding:0;line-height:27px}.inline-edit-row fieldset label,.inline-edit-row fieldset span.inline-edit-categories-label{display:block;margin:.2em 0}.inline-edit-row fieldset label.inline-edit-tags{margin-top:0}.inline-edit-row fieldset label.inline-edit-tags span.title{margin:.2em 0}.inline-edit-row fieldset label span.title{display:block;float:left;width:5em}.inline-edit-row fieldset label span.input-text-wrap{display:block;margin-left:5em}.quick-edit-row-post fieldset.inline-edit-col-right label span.title{width:auto;padding-right:.5em}.inline-edit-row .input-text-wrap input[type=text]{width:100%}.inline-edit-row fieldset label input[type=checkbox]{vertical-align:text-bottom}.inline-edit-row fieldset label textarea{width:100%;height:4em}#wpbody-content .bulk-edit-row fieldset .inline-edit-group label{max-width:50%}#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child{margin-right:.5em}.inline-edit-col-right .input-text-wrap input.inline-edit-menu-order-input{width:6em}.inline-edit-save .spinner{padding:4px 10px 0;vertical-align:top;float:right}.inline-edit-row h4{text-transform:uppercase}.inline-edit-row fieldset span.title,.inline-edit-row fieldset span.checkbox-title{font-style:italic;line-height:1.8em}.inline-edit-row fieldset input[type="text"],.inline-edit-row fieldset textarea{border-style:solid;border-width:1px}.inline-edit-row fieldset .inline-edit-date{float:left}.inline-edit-row fieldset input[name=jj],.inline-edit-row fieldset input[name=hh],.inline-edit-row fieldset input[name=mn]{font-size:12px;width:2.1em}.inline-edit-row fieldset input[name=aa]{font-size:12px;width:3.5em}.inline-edit-row fieldset label input.inline-edit-password-input{width:8em}.inline-edit-row .catshow,.inline-edit-row .cathide{cursor:pointer}ul.cat-checklist{height:12em;border-style:solid;border-width:1px;overflow-y:scroll;padding:0 5px;margin:0}#bulk-titles{display:block;height:12em;border-style:solid;border-width:1px;overflow-y:scroll;padding:0 5px;margin:0 0 5px}.inline-edit-row fieldset ul.cat-checklist li,.inline-edit-row fieldset ul.cat-checklist input{margin:0}.inline-edit-row fieldset ul.cat-checklist label,.inline-edit-row .catshow,.inline-edit-row .cathide,.inline-edit-row #bulk-titles div{font-family:sans-serif;font-style:normal;font-size:11px}table .inline-edit-row fieldset ul.cat-hover{height:auto;max-height:30em;overflow-y:auto;position:absolute}.inline-edit-row fieldset label input.inline-edit-menu-order-input{width:3em}.inline-edit-row fieldset label input.inline-edit-slug-input{width:75%}.quick-edit-row-post fieldset label.inline-edit-status{float:left}#bulk-titles{line-height:140%}#bulk-titles div{margin:.2em .3em}#bulk-titles div a{cursor:pointer;display:block;float:left;height:10px;margin:3px 3px 0 -2px;overflow:hidden;position:relative;text-indent:-9999px;width:10px}#show-comments{overflow:hidden}#save-action .spinner,#show-comments a,#show-comments .spinner{float:left}#titlediv{position:relative;margin-bottom:10px}#titlediv label{cursor:text}#titlediv div.inside{margin:0}#poststuff #titlewrap{border:0;padding:0}#titlediv #title{padding:3px 8px;font-size:1.7em;line-height:100%;width:100%;outline:0}#titlediv #title-prompt-text,#wp-fullscreen-title-prompt-text{color:#bbb;position:absolute;font-size:1.7em;padding:8px 10px}#wp-fullscreen-save .fs-saved{color:#999;float:right;margin-top:4px}#wp-fullscreen-title-prompt-text{padding:11px}#poststuff .inside-submitbox,#side-sortables .inside-submitbox{margin:0 3px;font-size:11px}input#link_description,input#link_url{width:98%}#pending{background:0 none;border:0 none;padding:0;font-size:11px;margin-top:-1px}#edit-slug-box{line-height:23px;min-height:23px;margin-top:5px;padding:0 10px}#edit-slug-box .cancel{margin-right:10px;font-size:11px}#editable-post-name-full{display:none}#editable-post-name input{width:16em}.postarea h3 label{float:left}.submitbox .submit{text-align:left;padding:12px 10px 10px;font-size:11px}.submitbox .submitdelete{text-decoration:none;padding:1px 2px}.submitbox .submitdelete,.submitbox .submit a:hover{border-bottom-width:1px;border-bottom-style:solid}.submitbox .submit input{margin-bottom:8px;margin-right:4px;padding:6px}.inside-submitbox #post_status{margin:2px 0 2px -2px}#post-status-select,#post-format{line-height:2.5em;margin-top:3px}#post-body #normal-sortables{min-height:50px}.postbox{position:relative;min-width:255px}#trackback_url{width:99%}#normal-sortables .postbox .submit{background:transparent none;border:0 none;float:right;padding:0 12px;margin:0}.category-add input[type="text"],.category-add select{width:100%;max-width:260px}.press-this #side-sortables .category-tabs li,ul.category-tabs li,#side-sortables .add-menu-item-tabs li,.wp-tab-bar li{display:inline;line-height:1.35em}.no-js .category-tabs li.hide-if-no-js{display:none}.category-tabs a,#side-sortables .add-menu-item-tabs a,.wp-tab-bar a{text-decoration:none}.category-tabs{margin:8px 0 3px}#category-adder h4{margin:10px 0}#side-sortables .add-menu-item-tabs,.wp-tab-bar{margin-bottom:3px}#normal-sortables .postbox #replyrow .submit{float:none;margin:0;padding:0 7px 5px}#side-sortables .submitbox .submit input,#side-sortables .submitbox .submit .preview,#side-sortables .submitbox .submit a.preview:hover{border:0 none}#side-sortables .inside-submitbox .insidebox,.stuffbox .insidebox{margin:11px 0}ul.category-tabs,ul.add-menu-item-tabs,ul.wp-tab-bar{margin-top:12px}ul.category-tabs li{border-style:solid;border-width:1px;position:relative}ul.add-menu-item-tabs li.tabs,.wp-tab-active{border-style:solid solid none;border-width:1px 1px 0}#post-body .add-menu-item-tabs li.tabs{border-style:solid none solid solid;border-width:1px 0 1px 1px;margin-right:-1px}ul.category-tabs li,ul.add-menu-item-tabs li,ul.wp-tab-bar li{padding:3px 5px 5px;-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-left-radius:3px;border-top-right-radius:3px}form#tags-filter{position:relative}td.post-title strong,td.plugin-title strong{display:block;margin-bottom:.2em}td.post-title p,td.plugin-title p{margin:6px 0}.wp-hidden-children .wp-hidden-child,.ui-tabs-hide{display:none}.commentlist .avatar{vertical-align:text-top}#post-body .tagsdiv #newtag{margin-right:5px;width:16em}#side-sortables input#post_password{width:94%}#side-sortables .tagsdiv #newtag{width:68%}#post-status-info{border-width:0 1px 1px;border-style:none solid solid;width:100%;-webkit-border-bottom-left-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-left-radius:3px;border-bottom-right-radius:3px}#post-status-info td{font-size:12px}.autosave-info{padding:2px 15px;text-align:right}#editorcontent #post-status-info{border:0}#post-body .wp_themeSkin .mceStatusbar a.mceResize{display:block;background:transparent url('../images/resize.gif') no-repeat scroll right bottom;width:12px;cursor:se-resize;margin:0 1px;position:relative;top:-2px}#post-body .postarea .wp_themeSkin .mceStatusbar a.mceResize{top:20px}#content-resize-handle{background:transparent url('../images/resize.gif') no-repeat scroll right bottom;width:12px;cursor:se-resize;position:absolute;right:2px;height:19px}.press-this #content-resize-handle{bottom:2px}.tmce-active #content-resize-handle{display:none}#wp-word-count{display:block;padding:2px 10px}#timestampdiv select{height:20px;line-height:14px;padding:0;vertical-align:top}#aa,#jj,#hh,#mn{padding:1px;font-size:12px}#jj,#hh,#mn{width:2em}#aa{width:3.4em}.curtime #timestamp{background-repeat:no-repeat;background-position:left center;padding:2px 0 1px 20px}#timestampdiv{padding-top:5px;line-height:23px}#timestampdiv p{margin:8px 0 6px}#timestampdiv input{border-width:1px;border-style:solid}#postcustomstuff thead th{padding:5px 8px 8px}#postcustom #postcustomstuff .submit{border:0 none;float:none;padding:0 8px 8px}#side-sortables #postcustom #postcustomstuff .submit{margin:0;padding:0}#side-sortables #postcustom #postcustomstuff #the-list textarea{height:85px}#side-sortables #postcustom #postcustomstuff td.left input,#side-sortables #postcustom #postcustomstuff td.left select,#side-sortables #postcustomstuff #newmetaleft a{margin:3px 3px 0}#postcustomstuff table{margin:0;width:100%;border-width:1px;border-style:solid;border-spacing:0}#postcustomstuff tr{vertical-align:top}#postcustomstuff table input,#postcustomstuff table select,#postcustomstuff table textarea{width:96%;margin:8px}#side-sortables #postcustomstuff table input,#side-sortables #postcustomstuff table select,#side-sortables #postcustomstuff table textarea{margin:3px}#postcustomstuff th.left,#postcustomstuff td.left{width:38%}#postcustomstuff .submit input{margin:0;width:auto}#postcustomstuff #newmetaleft a{display:inline-block;margin:0 8px 8px;text-decoration:none}.no-js #postcustomstuff #enternew{display:none}#post-body-content .compat-attachment-fields{margin-bottom:20px}.compat-attachment-fields th{padding-top:5px;padding-right:10px}table.diff{width:100%}table.diff col.content{width:50%}table.diff tr{background-color:transparent}table.diff td,table.diff th{padding:.5em;font-family:Consolas,Monaco,monospace;border:0}table.diff .diff-deletedline del,table.diff .diff-addedline ins{text-decoration:none}#select-featured-image{padding:4px 0;overflow:hidden}#select-featured-image img{max-width:100%;height:auto;margin-bottom:10px}#select-featured-image a{float:left;clear:both}#select-featured-image .remove{display:none;margin-top:10px}.js #select-featured-image.has-featured-image .remove{display:inline-block}.no-js #select-featured-image .choose{display:none}.category-adder{margin-left:120px;padding:4px 0}.category-adder h4{margin:0 0 8px}#side-sortables .category-adder{margin:0}#post-body ul.add-menu-item-tabs{float:left;width:120px;text-align:right;margin:0 -120px 0 5px;padding:0}#post-body ul.add-menu-item-tabs li{padding:8px}#post-body ul.add-menu-item-tabs li.tabs{-webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-top-left-radius:3px;border-bottom-left-radius:3px}.wp-tab-panel,.categorydiv div.tabs-panel,.customlinkdiv div.tabs-panel,.posttypediv div.tabs-panel,.taxonomydiv div.tabs-panel{min-height:42px;max-height:200px;overflow:auto;padding:0 .9em;border-style:solid;border-width:1px}div.tabs-panel-active{display:block}div.tabs-panel-inactive{display:none}#front-page-warning,#front-static-pages ul,ul.export-filters,.inline-editor ul.cat-checklist ul,.categorydiv ul.categorychecklist ul,.customlinkdiv ul.categorychecklist ul,.posttypediv ul.categorychecklist ul,.taxonomydiv ul.categorychecklist ul{margin-left:18px}ul.categorychecklist li{margin:0;padding:0;line-height:19px;word-wrap:break-word}.categorydiv .tabs-panel,.customlinkdiv .tabs-panel,.posttypediv .tabs-panel,.taxonomydiv .tabs-panel{border-width:3px;border-style:solid}.form-wrap p,.form-wrap label{font-size:11px}.form-wrap label{display:block;padding:2px;font-size:12px}.form-field input,.form-field textarea{border-style:solid;border-width:1px;width:95%}p.description,.form-wrap p{margin:2px 0 5px}p.help,p.description,span.description,.form-wrap p{font-size:12px;font-style:italic;font-family:sans-serif}.form-wrap .form-field{margin:0 0 10px;padding:8px 0}.col-wrap h3{margin:12px 0;font-size:1.1em}.col-wrap p.submit{margin-top:-10px}#poststuff .taghint{color:#aaa;margin:15px 0 -24px 12px}#poststuff .tagsdiv .howto{margin:0 0 6px 8px}.ajaxtag .newtag{position:relative}.tagsdiv .newtag{width:180px}.tagsdiv .the-tags{display:block;height:60px;margin:0 auto;overflow:auto;width:260px}#post-body-content .tagsdiv .the-tags{margin:0 5px}p.popular-tags{-webkit-border-radius:8px;border-radius:8px;border-width:1px;border-style:solid;line-height:2em;max-width:1000px;padding:8px 12px 12px;text-align:justify}p.popular-tags a{padding:0 3px}.tagcloud{width:97%;margin:0 0 40px;text-align:justify}.tagcloud h3{margin:2px 0 12px}.ac_results{padding:0;margin:0;list-style:none;position:absolute;z-index:10000;display:none;border-width:1px;border-style:solid}.ac_results li{padding:2px 5px;white-space:nowrap;text-align:left}.ac_over{cursor:pointer}.ac_match{text-decoration:underline}table.links-table{width:100%}.links-table th{font-weight:normal;text-align:left;vertical-align:top;min-width:80px;width:20%;word-wrap:break-word}.links-table th,.links-table td{padding:5px 0}.links-table td label{margin-right:8px}.links-table td input[type="text"],.links-table td textarea{width:100%}.links-table #link_rel{max-width:280px}.media-item .describe{border-collapse:collapse;width:100%;border-top-style:solid;border-top-width:1px;clear:both;cursor:default}.media-item.media-blank .describe{border:0}.media-item .describe th{vertical-align:top;text-align:left;padding:5px 10px 10px;width:140px}.media-item .describe .align th{padding-top:0}.media-item .media-item-info tr{background-color:transparent}.media-item .describe td{padding:0 8px 8px 0;vertical-align:top}.media-item thead.media-item-info td{padding:4px 10px 0}.media-item .media-item-info .A1B1{padding:0 0 0 10px}.media-item td.savesend{padding-bottom:15px}.media-item .thumbnail{max-height:128px;max-width:128px}#wpbody-content #async-upload-wrap a{display:none}.media-upload-form{margin-top:20px}.media-upload-form td label{margin-right:6px;margin-left:2px}.media-upload-form .align .field label{display:inline;padding:0 0 0 23px;margin:0 1em 0 3px;font-weight:bold}.media-upload-form tr.image-size label{margin:0 0 0 5px;font-weight:bold}.media-upload-form th.label label{font-weight:bold;margin:.5em;font-size:13px}.media-upload-form th.label label span{padding:0 5px}abbr.required{border:medium none;text-decoration:none}.media-item .describe input[type="text"],.media-item .describe textarea{width:460px}.media-item .describe p.help{margin:0;padding:0 0 0 5px}.media-item .edit-attachment,.describe-toggle-on,.describe-toggle-off{display:block;line-height:36px;float:right;margin-right:15px}.media-item .describe-toggle-off,.media-item.open .describe-toggle-on{display:none}.media-item.open .describe-toggle-off{display:block}#media-items .media-item{border-style:solid;border-width:1px;min-height:36px;position:relative;margin-top:-1px;width:100%}#media-items{width:623px}.media-new-php #media-items{margin:1em 0}#media-items:empty{border:0 none}.media-item .filename{line-height:36px;overflow:hidden;padding:0 10px}.media-item .error-div{padding-left:10px}.media-item .pinkynail{float:left;margin:2px 2px 0;max-width:40px;max-height:32px}.media-item .startopen,.media-item .startclosed{display:none}.media-item .original{position:relative;height:34px}.media-item .progress{float:right;height:22px;margin:6px 10px 0 0;width:200px;line-height:2em;padding:0;overflow:hidden;margin-bottom:2px;border:1px solid #d1d1d1;background:#f7f7f7;background-image:-webkit-gradient(linear,left bottom,left top,from(#fff),to(#f7f7f7));background-image:-webkit-linear-gradient(bottom,#fff,#f7f7f7);background-image:-moz-linear-gradient(bottom,#fff,#f7f7f7);background-image:-o-linear-gradient(bottom,#fff,#f7f7f7);background-image:linear-gradient(to top,#fff,#f7f7f7);-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 0 3px rgba(0,0,0,0.1);box-shadow:inset 0 0 3px rgba(0,0,0,0.1)}.media-item .bar{z-index:9;width:0;height:100%;margin-top:-24px;background-color:#8cc1e9;background-image:-webkit-gradient(linear,left bottom,left top,from(#72a7cf),to(#8cc1e9));background-image:-webkit-linear-gradient(bottom,#72a7cf,#8cc1e9);background-image:-moz-linear-gradient(bottom,#72a7cf,#8cc1e9);background-image:-o-linear-gradient(bottom,#72a7cf,#8cc1e9);background-image:linear-gradient(to top,#72a7cf,#8cc1e9);-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.3);box-shadow:0 0 3px rgba(0,0,0,0.3)}.media-item .progress .percent{z-index:10;position:relative;width:200px;padding:0 8px;text-shadow:0 1px 0 rgba(255,255,255,0.4);color:rgba(0,0,0,0.6)}.upload-php .fixed .column-parent{width:15%}.js .html-uploader #plupload-upload-ui{display:none}.js .html-uploader #html-upload-ui{display:block}.media-upload-form .media-item.error{margin:0;padding:0}.media-upload-form .media-item.error p,.media-item .error-div{line-height:16px;margin:5px 10px;padding:0}.media-item .error-div a.dismiss{display:block;float:right;margin:5px 4px 0 15px}.find-box{width:600px;height:300px;overflow:hidden;padding:33px 0 51px;position:absolute;z-index:1000}.find-box-head{cursor:move;font-weight:bold;height:2em;line-height:2em;padding:1px 12px;position:absolute;top:5px;width:100%}.find-box-inside{overflow:auto;padding:6px;height:100%}.find-box-search{overflow:hidden;padding:9px;position:relative}.find-box-search .spinner{float:none;left:125px;position:absolute;top:9px}#find-posts-input{float:left;width:140px;height:24px}#find-posts-search{float:left;margin:1px 4px 0 3px}#find-posts-response{margin:8px 0;padding:0 1px 6px}#find-posts-response table{width:100%}#find-posts-response .found-radio{padding:3px 0 0 8px;width:15px}.find-box-buttons{padding:8px;overflow:hidden}.find-box #resize-se{position:absolute;right:1px;bottom:1px}.ui-find-overlay{position:absolute;top:0;left:0;background-color:#000;opacity:.6;filter:alpha(opacity=60)}ul#dismissed-updates{display:none}form.upgrade{margin-top:8px}form.upgrade .hint{font-style:italic;font-size:85%;margin:-0.5em 0 2em 0}#poststuff .inside .the-tagcloud{margin:5px 0 10px;padding:8px;border-width:1px;border-style:solid;line-height:1.8em;word-spacing:3px;-webkit-border-radius:6px;border-radius:6px}.drag-drop #drag-drop-area{border:4px dashed #ddd;height:200px}.drag-drop .drag-drop-inside{margin:70px auto 0;width:250px}.drag-drop-inside p{color:#aaa;font-size:14px;margin:5px 0;display:none}.drag-drop .drag-drop-inside p{text-align:center}.drag-drop-inside p.drag-drop-info{font-size:20px}.drag-drop .drag-drop-inside p,.drag-drop-inside p.drag-drop-buttons{display:block}.drag-drop.drag-over #drag-drop-area{border-color:#83b4d8}#plupload-upload-ui{position:relative}.describe .image-editor{vertical-align:top}.imgedit-wrap{position:relative}.imgedit-settings p{margin:8px 0}.post-php .imgedit-wrap table{width:100%}.describe .imgedit-wrap table td,.wp_attachment_holder .imgedit-wrap table td{vertical-align:top;padding-top:0}.describe .imgedit-wrap table td.imgedit-settings{padding:0 5px}.wp_attachment_holder .imgedit-wrap table td.imgedit-settings{width:250px}td.imgedit-settings input{margin-top:0;vertical-align:middle}.imgedit-wait{position:absolute;top:0;background:#fff url(../images/wpspin_light.gif) no-repeat scroll 22px 10px;background-size:16px 16px;opacity:.7;filter:alpha(opacity=70);width:100%;height:500px;display:none}.spinner{background:url(../images/wpspin_light.gif) no-repeat;background-size:16px 16px;display:none;float:right;opacity:.7;filter:alpha(opacity=70);width:16px;height:16px;margin:5px 5px 0}.no-float{float:none}.media-disabled,.imgedit-settings .disabled{color:grey}.wp_attachment_image,.A1B1{overflow:hidden}.wp_attachment_image .button,.A1B1 .button{float:left}.no-js .wp_attachment_image .button{display:none}.wp_attachment_image .spinner,.A1B1 .spinner{float:left;padding:0 4px 4px;vertical-align:bottom}.imgedit-menu{margin:0 0 12px;min-width:300px}.imgedit-menu div{float:left;width:32px;height:32px}.imgedit-crop-wrap{position:relative}.imgedit-crop{background:transparent url('../images/imgedit-icons.png') no-repeat scroll -9px -31px;margin:0 8px 0 0}.imgedit-crop.disabled:hover{background-position:-9px -31px}.imgedit-crop:hover{background-position:-9px -1px}.imgedit-rleft{background:transparent url('../images/imgedit-icons.png') no-repeat scroll -46px -31px;margin:0 3px}.imgedit-rleft.disabled:hover{background-position:-46px -31px}.imgedit-rleft:hover{background-position:-46px -1px}.imgedit-rright{background:transparent url('../images/imgedit-icons.png') no-repeat scroll -77px -31px;margin:0 8px 0 3px}.imgedit-rright.disabled:hover{background-position:-77px -31px}.imgedit-rright:hover{background-position:-77px -1px}.imgedit-flipv{background:transparent url('../images/imgedit-icons.png') no-repeat scroll -115px -31px;margin:0 3px}.imgedit-flipv.disabled:hover{background-position:-115px -31px}.imgedit-flipv:hover{background-position:-115px -1px}.imgedit-fliph{background:transparent url('../images/imgedit-icons.png') no-repeat scroll -147px -31px;margin:0 8px 0 3px}.imgedit-fliph.disabled:hover{background-position:-147px -31px}.imgedit-fliph:hover{background-position:-147px -1px}.imgedit-undo{background:transparent url('../images/imgedit-icons.png') no-repeat scroll -184px -31px;margin:0 3px}.imgedit-undo.disabled:hover{background-position:-184px -31px}.imgedit-undo:hover{background-position:-184px -1px}.imgedit-redo{background:transparent url('../images/imgedit-icons.png') no-repeat scroll -215px -31px;margin:0 8px 0 3px}.imgedit-redo.disabled:hover{background-position:-215px -31px}.imgedit-redo:hover{background-position:-215px -1px}.imgedit-applyto img{margin:0 8px 0 0}.imgedit-group-top{margin:5px 0}.imgedit-applyto .imgedit-label{padding:2px 0 0;display:block}.imgedit-help{display:none;font-style:italic;margin-bottom:8px}a.imgedit-help-toggle{text-decoration:none}.form-table td.imgedit-response{padding:0}.imgedit-submit{margin:8px 0}.imgedit-submit-btn{margin-left:20px}.imgedit-wrap .nowrap{white-space:nowrap}span.imgedit-scale-warn{color:red;font-size:20px;font-style:normal;visibility:hidden;vertical-align:middle}.imgedit-group{border-width:1px;border-style:solid;-webkit-border-radius:3px;border-radius:3px;margin-bottom:8px;padding:2px 10px}.wp_attachment_details{margin-bottom:20px}.form-table{border-collapse:collapse;margin-top:.5em;width:100%;margin-bottom:-8px;clear:both}.form-table td{margin-bottom:9px;padding:8px 10px;line-height:20px;font-size:12px}.form-table th,.form-wrap label{font-weight:normal;text-shadow:#fff 0 1px 0}.form-table th{vertical-align:top;text-align:left;padding:10px;width:200px}.form-table th.th-full{width:auto}.form-table div.color-option{display:block;clear:both;margin-top:12px}.form-table input.tog{margin-top:2px;margin-right:2px;float:left}.form-table td p{margin-top:4px}.form-table table.color-palette{vertical-align:bottom;float:left;margin:-12px 3px 11px}.form-table .color-palette td{border-width:1px 1px 0;border-style:solid solid none;height:10px;line-height:20px;width:10px}.commentlist li{padding:1em 1em .2em;margin:0;border-bottom-width:1px;border-bottom-style:solid}.commentlist li li{border-bottom:0;padding:0}.commentlist p{padding:0;margin:0 0 .8em}#replyrow input{border-width:1px;border-style:solid}#replyrow td{padding:2px}#replysubmit{margin:0;padding:0 5px 3px;text-align:center}#replysubmit .spinner{padding:2px 0 0;vertical-align:top;float:right}#replysubmit .button{margin-right:5px}#replysubmit .error{color:red;line-height:21px;text-align:center}#replyrow h5{margin:.2em 0 0;padding:0 5px;line-height:1.4em;font-size:1em}#edithead .inside{float:left;padding:3px 0 2px 5px;margin:0;text-align:center}#edithead .inside input{width:180px}#edithead label{padding:2px 0}#replycontainer{padding:5px}#replycontent{height:120px;-webkit-box-shadow:none;box-shadow:none}.comment-php .wp-editor-area{height:200px}.comment-ays{margin-bottom:0;border-style:solid;border-width:1px}.comment-ays th{border-right-style:solid;border-right-width:1px}.trash-undo-inside,.spam-undo-inside{margin:1px 8px 1px 0;line-height:16px}.spam-undo-inside .avatar,.trash-undo-inside .avatar{height:20px;width:20px;margin-right:8px;vertical-align:middle}.stuffbox .editcomment{clear:none}#comment-status-radio p{margin:3px 0 5px}#comment-status-radio input{margin:2px 3px 5px 0;vertical-align:middle}#comment-status-radio label{padding:5px 0}.commentlist .avatar{vertical-align:text-top}.theme-install-php .tablenav{height:auto}.theme-install-php .spinner{margin-top:9px}h3.available-themes{margin:0 0 1em;float:left}.available-theme{display:inline-block;margin-right:10px;overflow:hidden;padding:20px 20px 20px 0;vertical-align:top;width:300px}.available-theme .screenshot{width:300px;height:225px;display:block;border-width:1px;border-style:solid;margin-bottom:10px;overflow:hidden}.available-theme img{width:300px}.available-theme h3{margin:15px 0 0}.available-theme .theme-author{line-height:18px}.available-theme .action-links{margin-top:10px;overflow:hidden}.available-theme a.screenshot:focus{border-color:#777}#current-theme .theme-info li,.theme-options li,.available-theme .action-links li{float:left;padding-right:10px;margin-right:10px;border-right:1px solid #dfdfdf}.available-theme .action-links li{padding-right:8px;margin-right:8px}.ie8 .available-theme .action-links li{padding-right:7px;margin-right:7px}#current-theme .theme-info li:last-child,.theme-options li:last-child,.available-theme .action-links li:last-child{padding-right:0;margin-right:0;border-right:0}.available-theme .action-links .delete-theme{float:right;margin-left:8px;margin-right:0}.available-theme .action-links .delete-theme a{color:red;padding:2px}.available-theme .action-links .delete-theme a:hover{background:red;color:#fff;text-decoration:none}.available-theme .action-links p{float:left}#current-theme{margin:20px 0 10px;padding:0 0 20px;border-bottom-width:1px;border-bottom-style:solid;overflow:hidden}#current-theme.has-screenshot{padding-left:330px}#current-theme h3{margin:0;font-size:12px;font-weight:normal;color:#999}#current-theme h4{margin:3px 0 16px;font-size:20px}#current-theme h4 span{margin-left:20px;font-size:12px;font-weight:normal}#current-theme a{border-bottom:0}#current-theme .theme-info{margin:1em 0;overflow:hidden}#current-theme .theme-description{margin-top:5px;max-width:600px;line-height:1.6em}#current-theme img{float:left;width:300px;margin-left:-330px;border-width:1px;border-style:solid}.theme-options{overflow:hidden;font-size:14px;padding-bottom:10px}.theme-options .load-customize{margin-right:30px;float:left}.theme-options span{float:left;margin-right:10px;text-transform:uppercase;font-size:11px;line-height:18px;color:#999}.theme-options ul{float:left;margin:0}@media only screen and (max-width:1200px){.available-theme,.available-theme .screenshot,#current-theme img{width:240px}.available-theme .screenshot{height:180px}.available-theme img{width:100%}#current-theme.has-screenshot{padding-left:270px}#current-theme img{margin-left:-270px}}#post-body ul.add-menu-item-tabs li.tabs a,#TB_window #TB_title a.tb-theme-preview-link,#TB_window #TB_title a.tb-theme-preview-link:visited{font-weight:bold;text-decoration:none}#TB_window #TB_title{background-color:#222;color:#cfcfcf}#broken-themes{text-align:left;width:50%;border-spacing:3px;padding:3px}.theme-install-php h4{margin:2.5em 0 8px}.appearance_page_custom-header #headimg{border:1px solid #dfdfdf;overflow:hidden;width:100%}.appearance_page_custom-header #upload-form p label{font-size:12px}.appearance_page_custom-header .available-headers .default-header{float:left;margin:0 20px 20px 0}.appearance_page_custom-header .random-header{clear:both;margin:0 20px 20px 0;vertical-align:middle}.appearance_page_custom-header .available-headers label input,.appearance_page_custom-header .random-header label input{margin-right:10px}.appearance_page_custom-header .available-headers label img{vertical-align:middle}div#custom-background-image{min-height:100px;border:1px solid #dfdfdf}div#custom-background-image img{max-width:400px;max-height:300px}.nav-tab{border-style:solid;border-width:1px 1px 0;color:#aaa;text-shadow:#fff 0 1px 0;font-size:12px;line-height:16px;display:inline-block;padding:4px 14px 6px;text-decoration:none;margin:0 6px -1px 0;-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-left-radius:3px;border-top-right-radius:3px}.nav-tab-active{border-width:1px;color:#464646}h2.nav-tab-wrapper,h3.nav-tab-wrapper{border-bottom-width:1px;border-bottom-style:solid;padding-bottom:0}h2 .nav-tab{padding:4px 10px 6px;font-weight:200;font-size:20px;line-height:24px}#dashboard_right_now .versions .b,#post-status-display,#post-visibility-display,#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover,.media-item .percent,.plugins .name,#pass-strength-result.strong,#pass-strength-result.short,#ed_reply_toolbar #ed_reply_strong,.item-controls .item-order a,.feature-filter .feature-name{font-weight:bold}.plugins p{margin:0 4px;padding:0}.plugins .desc p{margin:0 0 8px}.plugins td.desc{line-height:1.5em}.plugins .desc ul,.plugins .desc ol{margin:0 0 0 2em}.plugins .desc ul{list-style-type:disc}.plugins .row-actions-visible{padding:0}.plugins tbody th.check-column{padding:7px 0}.plugins .inactive td,.plugins .inactive th,.plugins .active td,.plugins .active th{border-top-style:solid;border-top-width:1px;padding:5px 7px 0}.plugins .update th,.plugins .update td{border-bottom:0}.plugin-update-tr td{border-top:0}#wpbody-content .plugins .plugin-title,#wpbody-content .plugins .theme-title{padding-right:12px;white-space:nowrap}.plugins .second,.plugins .row-actions-visible{padding:0 0 5px}.plugins .update .second,.plugins .update .row-actions-visible{padding-bottom:0}.plugins-php .widefat tfoot th,.plugins-php .widefat tfoot td{border-top-style:solid;border-top-width:1px}.plugin-update-tr .update-message{margin:5px;padding:3px 5px}.plugin-install-php h4{margin:2.5em 0 8px}#profile-page .form-table textarea{width:500px;margin-bottom:6px}#profile-page .form-table #rich_editing{margin-right:5px}#your-profile legend{font-size:22px}#your-profile #rich_editing{border:0}#display_name{width:15em}#createuser .form-field input{width:25em}.pressthis{margin:20px 0}.pressthis a,.pressthis a:hover,.pressthis a:focus,.pressthis a:active{display:inline-block;position:relative;cursor:move;color:#333;background:#e6e6e6;background-image:-webkit-gradient(linear,left bottom,left top,color-stop(7%,#e6e6e6),color-stop(77%,#d8d8d8));background-image:-webkit-linear-gradient(bottom,#e6e6e6 7%,#d8d8d8 77%);background-image:-moz-linear-gradient(bottom,#e6e6e6 7%,#d8d8d8 77%);background-image:-o-linear-gradient(bottom,#e6e6e6 7%,#d8d8d8 77%);background-image:linear-gradient(to top,#e6e6e6 7%,#d8d8d8 77%);-webkit-border-radius:5px;border-radius:5px;border:1px solid #b4b4b4;font-style:normal;line-height:16px;font-size:14px;text-decoration:none;text-shadow:0 1px 0 #fff}.pressthis a:active{outline:0}.pressthis a:hover:after{-webkit-transform:skew(20deg) rotate(9deg);-moz-transform:skew(20deg) rotate(9deg);transform:skew(20deg) rotate(9deg);-webkit-box-shadow:0 10px 8px rgba(0,0,0,0.7);box-shadow:0 10px 8px rgba(0,0,0,0.7)}.pressthis a span{background:url(../images/press-this.png?v=20120502) no-repeat 0 5px;background-size:24px 20px;padding:8px 11px 8px 27px;margin:0 5px;display:inline-block}.pressthis a:after{content:'';width:70%;height:55%;z-index:-1;position:absolute;right:10px;bottom:9px;background:transparent;-webkit-transform:skew(20deg) rotate(6deg);-moz-transform:skew(20deg) rotate(6deg);transform:skew(20deg) rotate(6deg);-webkit-box-shadow:0 10px 8px rgba(0,0,0,0.6);box-shadow:0 10px 8px rgba(0,0,0,0.6)}#utc-time,#local-time{padding-left:25px;font-style:italic;font-family:sans-serif}.defaultavatarpicker .avatar{margin:2px 0;vertical-align:middle}.options-general-php .spinner{float:none;margin:-3px 3px}#wpfooter{position:absolute;bottom:0;left:0;right:0;padding:10px 0;margin-right:20px;border-top-width:1px;border-top-style:solid}#wpfooter p{margin:0;line-height:20px}#wpfooter a{text-decoration:none}#wpfooter a:hover{text-decoration:underline}.about-wrap{position:relative;margin:25px 40px 0 20px;max-width:1050px;font-size:15px}.about-wrap div.updated,.about-wrap div.error{display:none!important}.about-wrap p{line-height:1.6em}.about-wrap h1{margin:.2em 200px 0 0;line-height:1.2em;font-size:2.8em;font-weight:200}.about-text,.about-description,.about-wrap li.wp-person a.web{font-family:"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;font-weight:normal;line-height:1.6em;font-size:20px}.about-description{margin-top:1.4em}.about-text{margin:1em 200px 1.4em 0;min-height:60px;font-size:24px}.about-wrap h3{font-size:24px;margin-bottom:1em;padding-top:20px}.about-wrap .feature-section{padding-bottom:20px}.about-wrap .feature-section h4{margin-bottom:.6em}.about-wrap .feature-section p{margin-top:.6em}.about-wrap code{font-size:14px}.about-wrap .point-releases{margin-top:5px}.about-wrap .changelog.point-releases h3{padding-top:35px}.about-wrap .changelog.point-releases h3:first-child{padding-top:7px}.wp-badge{padding-top:142px;height:50px;width:173px;font-weight:bold;font-size:14px;text-align:center;margin:0 -5px;background:url('../images/wp-badge.png?ver=20111120') no-repeat}.about-wrap .wp-badge{position:absolute;top:0;right:0}.about-wrap h2.nav-tab-wrapper{padding-left:6px}.about-wrap h2 .nav-tab{padding:4px 10px 6px;margin:0 3px -1px 0;font-size:18px;vertical-align:top}.about-wrap h2 .nav-tab-active{font-weight:bold;padding-top:3px}.about-wrap .feature-section img{border:0;margin:0 1.94% 10px 0;-webkit-border-radius:3px;border-radius:3px}.about-wrap .feature-section.three-col img{margin:.5em 0 .5em 5px;max-width:100%;float:none}.ie8 .about-wrap .feature-section.three-col img{margin-left:0}.about-wrap .feature-section.images-stagger-right img{float:right;margin:0 5px 12px 2em}.about-wrap .feature-section.images-stagger-left img{float:left;margin:0 2em 12px 5px}.about-wrap .feature-section img.image-100{margin:0 0 2em 0;width:100%}.about-wrap .feature-section img.image-66{width:65%}.about-wrap .feature-section img.image-50{max-width:50%}.about-wrap .feature-section img.image-30{max-width:31.2381%}.ie8 .about-wrap .feature-section img{border-width:1px;border-style:solid}.about-wrap .images-stagger-right img.image-30:nth-child(2){margin-left:1em}.about-wrap .feature-section.col{margin-bottom:0}.about-wrap .feature-section.col h4{margin:0 0 .6em 0}.about-wrap .feature-section.col .last-feature{margin-right:0}.about-wrap .feature-section.two-col div{width:47%;margin-right:4.999999999%;float:left}.about-wrap .feature-section.three-col div{width:30%;margin-right:4.999999999%;float:left}.about-wrap .three-col-images{text-align:center}.about-wrap .three-col-images img{margin:0 0 10px}.about-wrap .three-col-images .last-feature{float:right}.about-wrap .three-col-images .first-feature{float:left}.about-wrap .changelog .feature-section{overflow:hidden;padding-bottom:0}.about-wrap .changelog li{list-style-type:disc;margin-left:3em}@media only screen and (max-width:900px){.about-wrap .feature-section.images-stagger-left img,.about-wrap .feature-section.images-stagger-right img{clear:both}}@media only screen and (max-width:768px){.about-wrap .feature-section img.image-66{float:none;width:98%;max-width:98%}.about-wrap .feature-section.images-stagger-right img.image-66{margin-left:3px}.about-wrap .feature-section.images-stagger-left img.image-66{margin-right:3px}}.about-wrap .return-to-dashboard{margin:30px 0 0 -5px;font-size:14px;font-weight:bold}.about-wrap .return-to-dashboard a{text-decoration:none;padding:0 5px}.about-wrap h4.wp-people-group{margin-top:2.6em;font-size:16px}.about-wrap ul.wp-people-group{overflow:hidden;padding:5px;margin:0 -15px 0 -5px}.about-wrap ul.compact{margin-bottom:0}.about-wrap li.wp-person{float:left;margin-right:10px}.about-wrap li.wp-person img.gravatar{float:left;margin:0 10px 10px 0;padding:2px;width:60px;height:60px}.about-wrap ul.compact li.wp-person img.gravatar{width:30px;height:30px}.about-wrap li.wp-person{height:70px;width:280px;padding-bottom:15px}.about-wrap ul.compact li.wp-person{height:auto;width:180px;padding-bottom:0;margin-bottom:0}.about-wrap #wp-people-group-validators+p.wp-credits-list{margin-top:0}.about-wrap li.wp-person a.web{display:block;margin:6px 0 2px;font-size:16px;text-decoration:none}.about-wrap p.wp-credits-list a{white-space:nowrap}.freedoms-php .about-wrap ol{margin:40px 60px}.freedoms-php .about-wrap ol li{list-style-type:decimal;font-weight:bold}.freedoms-php .about-wrap ol p{font-weight:normal;margin:.6em 0}body.full-overlay-active{overflow:hidden}.wp-full-overlay{background:#fff;z-index:500000;position:fixed;overflow:visible;top:0;bottom:0;left:0;right:0;height:100%;min-width:0}.wp-full-overlay-sidebar{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:fixed;width:300px;height:100%;top:0;bottom:0;left:0;padding:0;margin:0;z-index:10;overflow:auto;background:#f5f5f5;border-right:1px solid rgba(0,0,0,0.2)}.wp-full-overlay.collapsed .wp-full-overlay-sidebar{overflow:visible}.wp-full-overlay.collapsed,.wp-full-overlay.expanded .wp-full-overlay-sidebar{margin-left:0!important}.wp-full-overlay.expanded{margin-left:300px}.wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-left:-300px}.wp-full-overlay-sidebar:after{content:'';display:block;position:absolute;top:0;bottom:0;right:0;width:3px;box-shadow:-5px 0 4px -4px rgba(0,0,0,0.1) inset;z-index:1000}.wp-full-overlay-main{position:absolute;left:0;right:0;top:0;bottom:0;height:100%}.wp-full-overlay-sidebar .wp-full-overlay-header{position:absolute;left:0;right:0;height:45px;padding:0 20px;line-height:45px;z-index:10;margin:0}.wp-full-overlay-sidebar .wp-full-overlay-header{border-top:0;border-bottom:1px solid #fff;box-shadow:inset 0 -1px 0 0 #dfdfdf}.wp-full-overlay-sidebar .wp-full-overlay-footer{bottom:0;border-bottom:0;border-top:1px solid #dfdfdf;box-shadow:inset 0 1px 0 0 #fff}.wp-full-overlay-sidebar .wp-full-overlay-sidebar-content{position:absolute;top:45px;bottom:45px;left:0;right:0;overflow:auto}.wp-full-overlay .close-full-overlay{text-decoration:none}.wp-full-overlay a.collapse-sidebar{position:absolute;bottom:12px;left:0;z-index:50;display:block;width:19px;height:19px;margin-left:15px;padding:0;border-radius:50%;text-decoration:none}.wp-full-overlay.collapsed .collapse-sidebar{position:absolute;left:100%}.wp-full-overlay .collapse-sidebar-arrow{position:absolute;margin-top:2px;margin-left:2px;display:block;width:15px;height:15px;background:transparent url('../images/arrows.png') no-repeat -1px -73px}.wp-full-overlay.collapsed .collapse-sidebar-arrow{background-position:-1px -109px}.wp-full-overlay .collapse-sidebar-label{position:absolute;left:100%;color:#808080;line-height:20px;margin-left:10px}.wp-full-overlay.collapsed .collapse-sidebar-label{display:none}.wp-full-overlay .collapse-sidebar:hover .collapse-sidebar-label{color:#666}.wp-full-overlay,.wp-full-overlay-sidebar,.wp-full-overlay .collapse-sidebar,.wp-full-overlay-main{-webkit-transition-property:left,right,top,bottom,width,margin;-moz-transition-property:left,right,top,bottom,width,margin;-ms-transition-property:left,right,top,bottom,width,margin;-o-transition-property:left,right,top,bottom,width,margin;transition-property:left,right,top,bottom,width,margin;-webkit-transition-duration:.2s;-moz-transition-duration:.2s;-ms-transition-duration:.2s;-o-transition-duration:.2s;transition-duration:.2s}.no-customize-support .hide-if-no-customize,.customize-support .hide-if-customize,.no-customize-support.wp-core-ui .hide-if-no-customize,.no-customize-support .wp-core-ui .hide-if-no-customize,.customize-support.wp-core-ui .hide-if-customize,.customize-support .wp-core-ui .hide-if-customize{display:none}#customize-container{display:none;background:#fff;z-index:500000;position:fixed;overflow:visible;top:0;bottom:0;left:0;right:0;height:100%}.customize-active #customize-container{display:block}.customize-loading #customize-container iframe{opacity:0}.customize-loading #customize-container{background:#fff url("../images/wpspin_light.gif") no-repeat fixed center center;background-size:16px 16px}#customize-container iframe,#theme-installer iframe{height:100%;width:100%;z-index:20;-webkit-transition:opacity .3s;-moz-transition:opacity .3s;-ms-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}#customize-container .collapse-sidebar{bottom:16px}#theme-installer{display:none}#theme-installer.single-theme{display:block}.install-theme-info{display:none;padding:10px 20px 20px}.single-theme .install-theme-info{padding-top:15px}#theme-installer .install-theme-info{display:block}.install-theme-info .theme-install{float:right;margin-top:18px}.install-theme-info .theme-name{font-size:16px;line-height:24px;margin-bottom:0}.install-theme-info .theme-screenshot{margin-top:15px;width:258px;border:1px solid #ccc}.install-theme-info .theme-details{overflow:hidden}.theme-details .theme-version{margin:15px 0;float:left}.theme-details .star-holder{margin:14px 0;float:right}.theme-details .theme-description{float:left;color:#777;line-height:20px}#excerpt,.attachmentlinks{margin:0;height:4em;width:98%}#template div{margin-right:190px}p.pagenav{margin:0;display:inline}.pagenav span{font-weight:bold;margin:0 6px}.row-title{font-size:13px!important;font-weight:bold}.column-author img,.column-username img{float:left;margin-right:10px;margin-top:1px}.row-actions{visibility:hidden;padding:2px 0 0}.mobile .row-actions{visibility:visible}tr:hover .row-actions,div.comment-item:hover .row-actions{visibility:visible}.row-actions-visible{padding:2px 0 0}.form-table .pre{padding:8px;margin:0}table.form-table td .updated{font-size:13px}.tagchecklist{margin-left:14px;font-size:12px;overflow:auto}.tagchecklist strong{margin-left:-8px;position:absolute}.tagchecklist span{margin-right:25px;display:block;float:left;font-size:11px;line-height:1.8em;white-space:nowrap;cursor:default}.tagchecklist span a{margin:6px 0 0 -9px;cursor:pointer;width:10px;height:10px;display:block;float:left;text-indent:-9999px;overflow:hidden;position:absolute}#poststuff h2{margin-top:20px;font-size:1.5em;margin-bottom:15px;padding:0 0 3px;clear:left}#poststuff h3,.metabox-holder h3{font-size:15px;font-weight:normal;padding:7px 10px;margin:0;line-height:1}#poststuff .inside{margin:6px 0 8px}#poststuff .inside #parent_id,#poststuff .inside #page_template{max-width:100%}.inline-edit-row #post_parent,.inline-edit-row select[name="page_template"]{max-width:80%}.ie8 #poststuff .inside #parent_id,.ie8 #poststuff .inside #page_template,.ie8 .inline-edit-row #post_parent,.ie8 .inline-edit-row select[name="page_template"]{width:250px}#post-visibility-select,#post-formats-select{line-height:1.5em;margin-top:3px}#poststuff #submitdiv .inside{margin:0;padding:0}#post-body-content{margin-bottom:20px}#templateside ul li a{text-decoration:none}.tool-box .title{margin:8px 0;font-size:18px;font-weight:normal;line-height:24px}#sidemenu{margin:-30px 15px 0 315px;list-style:none;position:relative;float:right;padding-left:10px;font-size:12px}#sidemenu a{padding:0 7px;display:block;float:left;line-height:28px;border-top-width:1px;border-top-style:solid;border-bottom-width:1px;border-bottom-style:solid}#sidemenu li{display:inline;line-height:200%;list-style:none;text-align:center;white-space:nowrap;margin:0;padding:0}#sidemenu a.current{font-weight:normal;padding-left:6px;padding-right:6px;-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-left-radius:3px;border-top-right-radius:3px;border-width:1px;border-style:solid}#sidemenu li a .count-0{display:none}.plugin-install #description,.plugin-install-network #description{width:60%}table .vers,table .column-visible,table .column-rating{text-align:left}.error-message{color:red;font-weight:bold}body.iframe{height:98%}td.media-icon{text-align:center;width:80px;padding-top:8px;padding-bottom:8px}td.media-icon img{max-width:80px;max-height:60px}#howto{font-size:11px;margin:0 5px;display:block}.importers td{padding-right:14px}.importers{font-size:16px;width:auto}#namediv table{width:100%}#namediv td.first{width:10px;white-space:nowrap}#namediv input{width:98%}#namediv p{margin:10px 0}#submitdiv h3{margin-bottom:0!important}.zerosize{height:0;width:0;margin:0;border:0;padding:0;overflow:hidden;position:absolute}br.clear{height:2px;line-height:2px}.checkbox{border:0;margin:0;padding:0}fieldset{border:0;padding:0;margin:0}.post-categories{display:inline;margin:0;padding:0}.post-categories li{display:inline}.edit-box{display:none}h3:hover .edit-box{display:inline}#dashboard-widgets form .input-text-wrap input{width:100%}#dashboard-widgets form .textarea-wrap textarea{width:100%}#dashboard-widgets .postbox form .submit{float:none;margin:.5em 0 0;padding:0;border:0}#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish{min-width:0}#dashboard-widgets a{text-decoration:none}#dashboard-widgets h3 a{text-decoration:underline}#dashboard-widgets h3 .postbox-title-action{position:absolute;right:10px;padding:0;top:5px}.js #dashboard-widgets h3 .postbox-title-action{right:30px}#dashboard-widgets h4{font-weight:normal;font-size:13px;margin:0 0 .2em;padding:0}#dashboard_right_now p.sub,#dashboard_right_now .table,#dashboard_right_now .versions{margin:-12px}#dashboard_right_now .inside{font-size:12px;padding-top:20px}#dashboard_right_now p.sub{padding:5px 0 15px;color:#8f8f8f;font-size:14px;position:absolute;top:-17px;left:15px}#dashboard_right_now .table{margin:0;padding:0;position:relative}#dashboard_right_now .table_content{float:left;border-top-width:1px;border-top-style:solid;width:45%}#dashboard_right_now .table_discussion{float:right;border-top-width:1px;border-top-style:solid;width:45%}#dashboard_right_now table td{padding:3px 0;white-space:nowrap}#dashboard_right_now table tr.first td{border-top:0}#dashboard_right_now td.b{padding-right:6px;text-align:right;font-size:14px;width:1%}#dashboard_right_now td.b a{font-size:18px}#dashboard_right_now td.b a:hover{color:#d54e21}#dashboard_right_now .t{font-size:12px;padding-right:12px;padding-top:6px;color:#777}#dashboard_right_now .t a{white-space:nowrap}#dashboard_right_now .spam{color:red}#dashboard_right_now .waiting{color:#e66f00}#dashboard_right_now .approved{color:green}#dashboard_right_now .versions{padding:6px 10px 12px;clear:both}#dashboard_right_now a.button{float:right;clear:right;position:relative;top:-5px}#dashboard_recent_comments h3{margin-bottom:0}#dashboard_recent_comments .inside{margin-top:0}#dashboard_recent_comments .comment-meta .approve{font-style:italic;font-family:sans-serif;font-size:10px}#dashboard_recent_comments .subsubsub{float:none;white-space:normal}#the-comment-list{position:relative}#the-comment-list .comment-item{padding:1em 10px;border-top:1px solid}#the-comment-list .pingback{padding-left:9px!important}#the-comment-list .comment-item,#the-comment-list #replyrow{margin:0 -10px}#the-comment-list .comment-item:first-child{border-top:0}#the-comment-list .comment-item .avatar{float:left;margin:0 10px 5px 0}#the-comment-list .comment-item h4{line-height:1.7em;margin-top:-0.4em;color:#777}#the-comment-list .comment-item h4 cite{font-style:normal;font-weight:normal}#the-comment-list .comment-item blockquote,#the-comment-list .comment-item blockquote p{margin:0;padding:0;display:inline}#dashboard_recent_comments #the-comment-list .trackback blockquote,#dashboard_recent_comments #the-comment-list .pingback blockquote{display:block}#the-comment-list .comment-item p.row-actions{margin:3px 0 0;padding:0;font-size:12px}.no-js #dashboard_quick_press{display:none}#dashboard_quick_press .easy-blogging{padding:0 8px;text-align:left}#dashboard_quick_press .input-text-wrap{position:relative}#dashboard_quick_press .prompt{color:#bbb;position:absolute}#dashboard_quick_press div.updated{padding:0 5px}#title-wrap label,#tags-input-wrap label{cursor:text}#title-wrap #title{padding:2px 6px;font-size:1.3em;line-height:100%;outline:0}#tags-input-wrap #tags-input{outline:0}#title-wrap #title-prompt-text{font-size:1.3em;padding:5px 8px}#tags-input-wrap #tags-input-prompt-text{font-size:1em;padding:4px 8px}#dashboard_quick_press .input-text-wrap,#dashboard_quick_press .textarea-wrap{margin:0 0 1em 0}#dashboard_quick_press .wp-media-buttons{margin:0 0 .2em 1px;padding:0}#dashboard_quick_press .wp-media-buttons a{color:#777}#dashboard-widgets #dashboard_quick_press form p.submit input{float:left}#dashboard-widgets #dashboard_quick_press form p.submit #save-post{margin:0 .7em 0 1px}#dashboard-widgets #dashboard_quick_press form p.submit #publish{float:right}#dashboard-widgets #dashboard_quick_press form p.submit .spinner{vertical-align:middle;margin:4px 6px 0 0}#dashboard_recent_drafts ul,#dashboard_recent_drafts p{margin:0;padding:0;word-wrap:break-word}#dashboard_recent_drafts ul{list-style:none}#dashboard_recent_drafts ul li{margin-bottom:1em}#dashboard_recent_drafts h4{line-height:1.7em;word-wrap:break-word}#dashboard_recent_drafts h4 abbr{font-weight:normal;font-family:sans-serif;font-size:12px;color:#999;margin-left:3px}.rss-widget ul{margin:0;padding:0;list-style:none}a.rsswidget{font-size:13px;line-height:1.7em}.rss-widget ul li{line-height:1.5em;margin-bottom:12px}.rss-widget span.rss-date{color:#999;font-size:12px;margin-left:3px}.rss-widget cite{display:block;text-align:right;margin:0 0 1em;padding:0}.rss-widget cite:before{content:'\2014'}#dashboard_plugins h4{line-height:1.7em}#dashboard_plugins h5{font-weight:normal;font-size:13px;margin:0;display:inline;line-height:1.4em}#dashboard_plugins h5 a{line-height:1.4em}#dashboard_plugins .inside span{font-size:12px;padding-left:5px}#dashboard_plugins p{margin:.3em 0 1.4em;line-height:1.4em}.dashboard-comment-wrap{overflow:hidden;word-wrap:break-word}#dashboard_browser_nag a.update-browser-link{font-size:1.2em;font-weight:bold}#dashboard_browser_nag a{text-decoration:underline}#dashboard_browser_nag p.browser-update-nag.has-browser-icon{padding-right:125px}#dashboard_browser_nag .browser-icon{margin-top:-35px}#dashboard_browser_nag.postbox.browser-insecure{background-color:#ac1b1b;border-color:#ac1b1b}#dashboard_browser_nag.postbox{background-color:#e29808;background-image:none;border-color:#edc048;color:#fff;-webkit-box-shadow:none;box-shadow:none}#dashboard_browser_nag.postbox.browser-insecure h3{border-bottom-color:#cd5a5a;color:#fff}#dashboard_browser_nag.postbox h3{border-bottom-color:#f6e2ac;text-shadow:none;background:transparent none;color:#fff;-webkit-box-shadow:none;box-shadow:none}#dashboard_browser_nag a{color:#fff}#dashboard_browser_nag.browser-insecure a.browse-happy-link,#dashboard_browser_nag.browser-insecure a.update-browser-link{text-shadow:#871b15 0 1px 0}#dashboard_browser_nag a.browse-happy-link,#dashboard_browser_nag a.update-browser-link{text-shadow:#d29a04 0 1px 0}.login *{margin:0;padding:0}.login form{margin-left:8px;padding:26px 24px 46px;font-weight:normal;background:#fff;border:1px solid #e5e5e5;-webkit-box-shadow:rgba(200,200,200,0.7) 0 4px 10px -1px;box-shadow:rgba(200,200,200,0.7) 0 4px 10px -1px}.login form .forgetmenot{font-weight:normal;float:left;margin-bottom:0}.login .button-primary{float:right}#login form p{margin-bottom:0}#login form p.submit{padding:0}.login label{color:#777;font-size:14px}.login form .forgetmenot label{font-size:12px;line-height:19px}.login h1 a{background-image:url('../images/wordpress-logo.png?ver=20120216');background-size:274px 63px;background-position:top center;background-repeat:no-repeat;width:326px;height:67px;text-indent:-9999px;outline:0;overflow:hidden;padding-bottom:15px;display:block}#login{width:320px;padding:114px 0 0;margin:auto}#login_error,.login .message{margin:0 0 16px 8px;padding:12px}.login #nav,.login #backtoblog{text-shadow:#fff 0 1px 0;margin:0 0 0 16px;padding:16px 16px 0}#backtoblog{padding:12px 16px 0}.login form .input,.login input[type="text"]{color:#555;font-weight:200;font-size:24px;line-height:1;width:100%;padding:3px;margin-top:2px;margin-right:6px;margin-bottom:16px;border:1px solid #e5e5e5;background:#fbfbfb;outline:0;-webkit-box-shadow:inset 1px 1px 2px rgba(200,200,200,0.2);box-shadow:inset 1px 1px 2px rgba(200,200,200,0.2)}.login #pass-strength-result{width:250px;font-weight:bold;border-style:solid;border-width:1px;margin:12px 0 6px;padding:6px 5px;text-align:center}.mobile #login{padding:20px 0}.mobile #login form,.mobile #login .message,.mobile #login_error{margin-left:0}.mobile #login #nav,.mobile #login #backtoblog{margin-left:8px}.mobile #login h1 a{width:auto}#dashboard_right_now p.musub{margin-top:12px;border-top:1px solid #ececec;padding-left:16px;position:static}.rtl #dashboard_right_now p.musub{padding-left:0;padding-right:16px}#dashboard_right_now td.b a.musublink{font-size:16px}#dashboard_right_now div.musubtable{border-top:0}#dashboard_right_now div.musubtable .t{white-space:normal}.wp-list-table .site-deleted{background:#ff8573}.wp-list-table .site-spammed{background:#faafaa}.wp-list-table .site-archived{background:#ffebe8}.wp-list-table .site-mature{background:#fecac2}#nav-menus-frame{margin-left:300px}#wpbody-content #menu-settings-column{display:inline;width:281px;margin-left:-300px;clear:both;float:left;padding-top:24px}.no-js #wpbody-content #menu-settings-column{padding-top:31px}#menu-settings-column .inside{clear:both;margin:10px 0 0}.metabox-holder-disabled .postbox{opacity:.5;filter:alpha(opacity=50)}.metabox-holder-disabled .button-controls .select-all{display:none}#wpbody{position:relative}#menu-management-liquid{float:left;min-width:100%}#menu-management{position:relative;margin-right:20px;margin-top:-3px;width:100%}#menu-management .menu-edit{margin-bottom:20px}.nav-menus-php #post-body{padding:10px;border-width:1px 0;border-style:solid}#nav-menu-header,#nav-menu-footer{padding:0 10px}#nav-menu-header{border-bottom:1px solid}#nav-menu-footer{border-top:1px solid}.nav-menus-php #post-body div.updated,.nav-menus-php #post-body div.error{margin:0}.nav-menus-php #post-body-content{position:relative;float:none}#menu-management .menu-add-new abbr{font-weight:bold}#menu-management .nav-tabs-nav{margin:0 20px}#menu-management .nav-tabs-arrow{width:10px;padding:0 5px 4px;cursor:pointer;position:absolute;top:0;line-height:22px;font-size:18px;text-shadow:0 1px 0 #fff}#menu-management .nav-tabs-arrow-left{left:0}#menu-management .nav-tabs-arrow-right{right:0;text-align:right}#menu-management .nav-tabs-wrapper{width:100%;height:28px;margin-bottom:-1px;overflow:hidden}#menu-management .nav-tabs{padding-left:20px;padding-right:10px}.js #menu-management .nav-tabs{float:left;margin-left:0;margin-right:-400px}#menu-management .nav-tab{margin-bottom:0;font-size:14px}#select-nav-menu-container{text-align:right;padding:0 10px 3px 10px;margin-bottom:5px}#select-nav-menu{width:100px;display:inline}#menu-name-label{margin-top:-2px}#wpbody .open-label{display:block;float:left}#wpbody .open-label span{padding-right:10px}.js .input-with-default-title{font-style:italic}#menu-management .inside{padding:0 10px}.postbox .howto input{width:180px;float:right}.customlinkdiv .howto input{width:200px}#nav-menu-theme-locations .howto select{width:100%}#nav-menu-theme-locations .button-controls{text-align:right}.add-menu-item-view-all{height:400px}#menu-container .submit{margin:0 0 10px;padding:0}.nav-menus-php .meta-sep,.nav-menus-php .submitdelete,.nav-menus-php .submitcancel{display:block;float:left;margin:4px 0;line-height:15px}.meta-sep{padding:0 2px}#cancel-save{text-decoration:underline;font-size:12px;margin-left:20px;margin-top:5px}.button.right,.button-secondary.right,.button-primary.right{float:right}.list-controls{float:left;margin-top:5px}.add-to-menu{float:right}.postbox .spinner{display:none;vertical-align:middle}.button-controls{clear:both;margin:10px 0}.show-all,.hide-all{cursor:pointer}.hide-all{display:none}#menu-name{width:270px}#manage-menu .inside{padding:0}#available-links dt{display:block}#add-custom-link .howto{font-size:12px}#add-custom-link label span{display:block;float:left;margin-top:5px;padding-right:5px}.menu-item-textbox{width:180px}.nav-menus-php .howto span{margin-top:4px;display:block;float:left}.quick-search{width:190px}.nav-menus-php .list-wrap{display:none;clear:both;margin-bottom:10px}.nav-menus-php .list-container{max-height:200px;overflow-y:auto;padding:10px 10px 5px}.nav-menus-php .postbox p.submit{margin-bottom:0}.nav-menus-php .list li{display:none;margin:0;margin-bottom:5px}.nav-menus-php .list li .menu-item-title{cursor:pointer;display:block}.nav-menus-php .list li .menu-item-title input{margin-right:3px;margin-top:-3px}#menu-container .inside{padding-bottom:10px}.menu{padding-top:1em}#menu-to-edit{padding:1em 0}.menu ul{width:100%}.menu li{margin-bottom:0;position:relative}.menu-item-bar{clear:both;line-height:1.5em;position:relative;margin:13px 0 0 0}.menu-item-handle{border:1px solid #dfdfdf;position:relative;padding-left:10px;height:auto;width:400px;line-height:35px;text-shadow:0 1px 0 #fff;overflow:hidden;word-wrap:break-word}#menu-to-edit .menu-item-invalid .menu-item-handle{background:#f6c9cc;background-image:-webkit-gradient(linear,left bottom,left top,from(#f6c9cc),to(#fdf8ff));background-image:-webkit-linear-gradient(bottom,#f6c9cc,#fdf8ff);background-image:-moz-linear-gradient(bottom,#f6c9cc,#fdf8ff);background-image:-o-linear-gradient(bottom,#f6c9cc,#fdf8ff);background-image:linear-gradient(to top,#f6c9cc,#fdf8ff)}.menu-item-edit-active .menu-item-handle{-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.no-js .menu-item-edit-active .item-edit{display:none}.js .menu-item-handle{cursor:move}.menu li.deleting .menu-item-handle{background-image:none;text-shadow:0}.menu-item-handle .item-title{font-size:12px;font-weight:bold;padding:7px 0;line-height:20px;display:block;margin-right:13em}li.menu-item.ui-sortable-helper dl{margin-top:0}li.menu-item.ui-sortable-helper .menu-item-transport dl{margin-top:13px}.menu .sortable-placeholder{height:35px;width:410px;margin-top:13px}.menu-item-depth-0{margin-left:0}.menu-item-depth-1{margin-left:30px}.menu-item-depth-2{margin-left:60px}.menu-item-depth-3{margin-left:90px}.menu-item-depth-4{margin-left:120px}.menu-item-depth-5{margin-left:150px}.menu-item-depth-6{margin-left:180px}.menu-item-depth-7{margin-left:210px}.menu-item-depth-8{margin-left:240px}.menu-item-depth-9{margin-left:270px}.menu-item-depth-10{margin-left:300px}.menu-item-depth-11{margin-left:330px}.menu-item-depth-0 .menu-item-transport{margin-left:0}.menu-item-depth-1 .menu-item-transport{margin-left:-30px}.menu-item-depth-2 .menu-item-transport{margin-left:-60px}.menu-item-depth-3 .menu-item-transport{margin-left:-90px}.menu-item-depth-4 .menu-item-transport{margin-left:-120px}.menu-item-depth-5 .menu-item-transport{margin-left:-150px}.menu-item-depth-6 .menu-item-transport{margin-left:-180px}.menu-item-depth-7 .menu-item-transport{margin-left:-210px}.menu-item-depth-8 .menu-item-transport{margin-left:-240px}.menu-item-depth-9 .menu-item-transport{margin-left:-270px}.menu-item-depth-10 .menu-item-transport{margin-left:-300px}.menu-item-depth-11 .menu-item-transport{margin-left:-330px}body.menu-max-depth-0{min-width:950px!important}body.menu-max-depth-1{min-width:980px!important}body.menu-max-depth-2{min-width:1010px!important}body.menu-max-depth-3{min-width:1040px!important}body.menu-max-depth-4{min-width:1070px!important}body.menu-max-depth-5{min-width:1100px!important}body.menu-max-depth-6{min-width:1130px!important}body.menu-max-depth-7{min-width:1160px!important}body.menu-max-depth-8{min-width:1190px!important}body.menu-max-depth-9{min-width:1220px!important}body.menu-max-depth-10{min-width:1250px!important}body.menu-max-depth-11{min-width:1280px!important}.item-type{font-size:12px;padding-right:10px}.item-controls{font-size:12px;position:absolute;right:20px;top:-1px}.item-controls a{text-decoration:none}.item-controls a:hover{cursor:pointer}.item-controls .item-order{padding-right:10px}.nav-menus-php .item-edit{position:absolute;right:-20px;top:0;display:block;width:30px;height:36px;overflow:hidden;text-indent:-999em;border-bottom:1px solid;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px}.menu-instructions-inactive{display:none}.menu-item-settings{display:block;width:400px;padding:10px 0 10px 10px;border:solid;border-width:0 1px 1px 1px;-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.menu-item-edit-active .menu-item-settings{display:block}.menu-item-edit-inactive .menu-item-settings{display:none}.add-menu-item-pagelinks{margin:.5em auto;text-align:center}.link-to-original{display:block;margin:0 0 10px;padding:3px 5px 5px;font-size:12px;font-style:italic}.link-to-original a{padding-left:4px;font-style:normal}.hidden-field{display:none}.menu-item-settings .description-thin,.menu-item-settings .description-wide{margin-right:10px;float:left}.description-thin{width:190px;height:40px}.description-wide{width:390px}.menu-item-actions{padding-top:15px}#cancel-save{cursor:pointer}.nav-menus-php .major-publishing-actions{clear:both;padding:3px 0 5px}.nav-menus-php .major-publishing-actions .publishing-action{text-align:right;float:right;line-height:23px;margin:5px 0 1px}.nav-menus-php .major-publishing-actions .delete-action{vertical-align:middle;text-align:left;float:left;padding-right:15px;margin-top:5px}.menu-name-label span,.auto-add-pages label{font-size:12px;font-style:normal}.menu-name-label{margin-right:15px}.auto-add-pages input{margin-top:0}.auto-add-pages{margin-top:4px;float:left}.nav-menus-php .submitbox .submitcancel{border-bottom:1px solid;padding:1px 2px;text-decoration:none}.nav-menus-php .major-publishing-actions .form-invalid{padding-left:4px;margin-left:-4px;border:0 none}#menu-item-name-wrap:after,#menu-item-url-wrap:after,#menu-name-label:after,#menu-settings-column .inside:after,#nav-menus-frame:after,.nav-menus-php #post-body-content:after,.nav-menus-php .button-controls:after,.nav-menus-php .major-publishing-actions:after,.nav-menus-php .menu-item-settings:after{clear:both;content:".";display:block;height:0;visibility:hidden}#nav-menus-frame,.button-controls,#menu-item-url-wrap,#menu-item-name-wrap{display:block}div.star-holder{position:relative;height:17px;width:100px;background:url('../images/stars.png?ver=20121108') repeat-x bottom left}div.star-holder .star-rating{background:url('../images/stars.png?ver=20121108') repeat-x top left;height:17px;float:left}div.action-links{font-weight:normal;margin:6px 0 0}#plugin-information-header{margin:0;padding:0 5px;font-weight:bold;position:relative;border-bottom-width:1px;border-bottom-style:solid;height:2.5em}#plugin-information ul#sidemenu{font-weight:normal;margin:0 5px;position:absolute;left:0;bottom:-1px}#plugin-information p.action-button{width:100%;padding-bottom:0;margin-bottom:0;margin-top:10px;-webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-top-left-radius:3px;border-bottom-left-radius:3px}#plugin-information .action-button a{text-align:center;font-weight:bold;text-decoration:none;display:block;line-height:2em}#plugin-information h2{clear:none!important;margin-right:200px}#plugin-information .fyi{margin:0 10px 50px;width:210px}#plugin-information .fyi h2{font-size:.9em;margin-bottom:0;margin-right:0}#plugin-information .fyi h2.mainheader{padding:5px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px}#plugin-information .fyi ul{padding:10px 5px 10px 7px;margin:0;list-style:none;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px}#plugin-information .fyi li{margin-right:0}#plugin-information #section-holder{padding:10px}#plugin-information .section ul,#plugin-information .section ol{margin-left:16px;list-style-type:square;list-style-image:none}#plugin-information #section-screenshots ol{list-style:none;margin:0}#plugin-information #section-screenshots li img{vertical-align:text-top;max-width:100%;width:auto;height:auto}#plugin-information #section-screenshots li p{font-style:italic;padding-left:20px;padding-bottom:2em}#plugin-information #section-screenshots ol,#plugin-information .updated,#plugin-information pre{margin-right:215px}#plugin-information pre{padding:7px;overflow:auto}body.press-this{color:#333;margin:0;padding:0;min-width:675px;min-height:400px}img{border:0}.press-this #wphead{height:32px;margin-left:0;margin-right:0;margin-bottom:5px}.press-this #header-logo{float:left;margin:7px 7px 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.press-this #wphead h1{font-weight:normal;font-size:16px;line-height:32px;margin:0;float:left}.press-this #wphead h1 a{text-decoration:none}.press-this #wphead h1 a:hover{text-decoration:underline}.press-this #message{margin:10px 0}.press-this-sidebar{float:right;width:200px;padding-top:10px}.press-this #title{margin-left:0;margin-right:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.press-this .tagchecklist span a{background:transparent url(../images/xit.gif) no-repeat 0 0}.press-this #titlediv{margin:0}.press-this .wp-media-buttons{cursor:default;padding:8px 8px 0}.press-this .howto{margin-top:2px;margin-bottom:3px;font-size:12px;font-style:italic;display:block}.press-this #poststuff{margin:0 10px 10px;padding:0}.press-this #photo-add-url-div input[type="text"]{width:220px}#poststuff #editor-toolbar{height:30px}div.zerosize{border:0 none;height:0;margin:0;overflow:hidden;padding:0;width:0}.posting{margin-right:212px;position:relative}.press-this .inner-sidebar{width:200px}.press-this .inner-sidebar .sleeve{padding-top:5px}.press-this #submitdiv p{margin:0;padding:6px}.press-this #submitdiv #publishing-actions{border-bottom:1px solid #dfdfdf}.press-this #publish{float:right}.press-this #poststuff h2,.press-this #poststuff h3{font-size:14px;line-height:1}.press-this #tagsdiv-post_tag h3,.press-this #categorydiv h3{cursor:pointer}.press-this #submitdiv h3{cursor:default}h3.tb{text-shadow:0 1px 0 #fff;font-weight:bold;font-size:12px;margin-left:5px}#TB_window{border:1px solid #333}.press-this .postbox,.press-this .stuffbox{margin-bottom:10px;min-width:0}.js .postbox:hover .handlediv,.js .stuffbox:hover .handlediv{background:transparent url(../images/arrows.png) no-repeat 6px 7px}.press-this #submitdiv:hover .handlediv{background:0}.tbtitle{font-size:1.7em;outline:0;padding:3px 4px;border-color:#dfdfdf}.press-this .actions{float:right;margin:-19px 0 0}.press-this #extra-fields .actions{margin:-32px -7px 0 0}.press-this .actions li{float:left;list-style:none;margin-right:10px}#extra-fields .button{margin-right:5px}#photo_saving{margin:0 8px 8px;vertical-align:middle}#img_container_container{overflow:auto}#extra-fields{margin-top:10px;position:relative}#extra-fields h2{margin:12px}#waiting{margin-top:10px;overflow:hidden}#waiting span{float:right;margin:0 0 0 5px}#waiting .spinner{display:block}#extra-fields .postbox{margin-bottom:5px}#extra-fields .titlewrap{padding:0;overflow:auto;height:100px}#img_container a{display:block;float:left;overflow:hidden}#img_container img,#img_container a{width:68px;height:68px}#img_container img{border:0;background-color:#f4f4f4;cursor:pointer}#img_container a,#img_container a:link,#img_container a:visited{border:1px solid #ccc;display:block;position:relative}#img_container a:hover,#img_container a:active{border-color:#000;z-index:1000;border-width:2px;margin:-1px}#embed-code{width:100%;height:98px}.press-this .categorydiv div.tabs-panel{height:100px}.press-this .tagsdiv .newtag{width:120px}.press-this #content{margin:5px 0;padding:0 5px;border:0 none;height:345px;font-family:Consolas,Monaco,monospace;font-size:13px;line-height:19px;background:transparent}.press-this #publishing-actions .spinner{display:inline;vertical-align:middle}#TB_ajaxContent #options{position:absolute;top:20px;right:25px;padding:5px}#TB_ajaxContent h3{margin-bottom:.25em}.error a{text-decoration:underline}.updated a{text-decoration:none;padding-bottom:2px}.taghint{color:#aaa;margin:-17px 0 0 7px;visibility:hidden}input.newtag ~ div.taghint{visibility:visible}input.newtag:focus ~ div.taghint{visibility:hidden}#mce_fullscreen_container{background:#fff}#photo-add-url-div input[type="text"]{width:300px}.alignleft h3{margin:0}h3 span{font-weight:normal}#template textarea{font-family:Consolas,Monaco,monospace;font-size:12px;width:97%;background:#f9f9f9;outline:0}#template p{width:97%}#templateside{float:right;width:190px;word-wrap:break-word}#templateside h3,#postcustomstuff p.submit{margin:0}#templateside h4{margin:1em 0 0}#templateside ol,#templateside ul{margin:.5em;padding:0}#templateside li{margin:4px 0}#templateside ul li a span.highlight{display:block}.nonessential{font-size:11px;font-style:italic;padding-left:12px}.highlight{padding:3px 3px 3px 12px;margin-left:-12px;font-weight:bold;border:0 none}#documentation{margin-top:10px}#documentation label{line-height:22px;vertical-align:top;font-weight:bold}.fileedit-sub{padding:10px 0 8px;line-height:180%}#filter-box{clear:both}.feature-filter{padding:8px 12px 0}.feature-filter .feature-group{float:left;margin:5px 10px 10px}.feature-filter .feature-group li{display:inline-block;vertical-align:top;list-style-type:none;padding-right:25px;width:150px}.feature-container{width:100%;overflow:auto;margin-bottom:10px}div.widget-liquid-left{float:left;clear:left;width:100%;margin-right:-325px}div#widgets-left{margin-left:5px;margin-right:325px}div#widgets-right{width:285px;margin:0 auto}div.widget-liquid-right{float:right;clear:right;width:300px}.widget-liquid-right .widget,.inactive-sidebar .widget,.widget-liquid-right .sidebar-description{width:250px;margin:0 auto 20px;overflow:hidden}.widget-liquid-right .sidebar-description{margin-bottom:10px}.inactive-sidebar .widget{margin:0 10px 20px;display:inline-block}div.sidebar-name h3{font-weight:normal;font-size:15px;margin:0;padding:8px 10px;overflow:hidden;white-space:nowrap}div.sidebar-name{font-size:13px;border-width:1px;border-style:solid;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px}.js .sidebar-name{cursor:pointer}.js .closed .sidebar-name{-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.widget-liquid-right .widgets-sortables,#widgets-left .widget-holder{border-width:0 1px 1px;border-style:none solid solid;-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.js .closed .widgets-sortables,.js .closed .widget-holder{display:none}.widget-liquid-right .widgets-sortables{padding:15px 0 0}#available-widgets .widget-holder{padding:7px 5px 0}#available-widgets .widget{-webkit-box-shadow:none;box-shadow:none}.inactive-sidebar{padding:5px 5px 0}#widget-list .widget{width:250px;margin:0 10px 15px;border:0 none;background:transparent;display:inline-block;vertical-align:top}#widget-list .widget-description{padding:5px 8px}.widget-placeholder{border-width:1px;border-style:dashed;margin:0 auto 20px;height:27px;width:250px}.inactive-sidebar .widget-placeholder{margin:0 10px 20px;float:left}div.widgets-holder-wrap{padding:0;margin:10px 0 20px}#widgets-left #available-widgets{background-color:transparent;border:0 none}ul#widget-list{list-style:none;margin:0;padding:0;min-height:100px}.widget .widget-top{margin-bottom:-1px;font-size:12px;font-weight:bold;height:26px;overflow:hidden}.widget-top .widget-title{padding:7px 9px}.widget-top .widget-title-action{float:right}a.widget-action{display:block;width:24px;height:26px}#available-widgets a.widget-action{display:none}.widget-top a.widget-action{background:transparent url(../images/arrows.png) no-repeat 4px 6px}.widget-top a.widget-action:hover{background:transparent url(../images/arrows-dark.png) no-repeat 4px 6px}.widget .widget-inside,.widget .widget-description{padding:12px 12px 10px;font-size:12px;line-height:16px}.widget-inside,.widget-description{display:none}#available-widgets .widget-description{display:block}.widget .widget-inside p{margin:0 0 1em;padding:0}.widget-title h4{margin:0;padding-bottom:.2em;line-height:1;overflow:hidden;white-space:nowrap}.widgets-sortables{min-height:90px}.widget-control-actions{margin-top:8px}.widget-control-actions a{text-decoration:none}.widget-control-actions a:hover{text-decoration:underline}.widget-control-actions div.alignleft{margin-top:6px}div#sidebar-info{padding:0 1em;margin-bottom:1em;font-size:12px}.widget-title a,.widget-title a:hover{text-decoration:none;border-bottom:0}.widget-control-edit{display:block;font-size:12px;font-weight:normal;line-height:26px;padding:0 8px 0 0}a.widget-control-edit{text-decoration:none}.widget-control-edit .add,.widget-control-edit .edit{display:none}#available-widgets .widget-control-edit .add,#widgets-right .widget-control-edit .edit,.inactive-sidebar .widget-control-edit .edit{display:inline}.editwidget{margin:0 auto 15px}.editwidget .widget-inside{display:block;padding:10px}.inactive p.description{margin:5px 15px 10px}#available-widgets p.description{margin:0 12px 12px}.widget-position{margin-top:8px}.inactive{padding-top:2px}.sidebar-name .spinner{float:none;margin:0 3px -3px}.sidebar-name-arrow{float:right;height:29px;width:26px}.widget-title .in-widget-title{font-size:12px;white-space:nowrap}#removing-widget{display:none;font-weight:normal;padding-left:15px;font-size:12px;line-height:1}.widget-control-noform,#access-off,.widgets_access .widget-action,.widgets_access .sidebar-name-arrow,.widgets_access #access-on,.widgets_access .widget-holder .description{display:none}.widgets_access .widget-holder,.widgets_access #widget-list{padding-top:10px}.widgets_access #access-off{display:inline}.widgets_access #wpbody-content .widget-title-action,.widgets_access #wpbody-content .widget-control-edit,.widgets_access .closed .widgets-sortables,.widgets_access .closed .widget-holder{display:block}.widgets_access .closed .sidebar-name{-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.widgets_access .sidebar-name,.widgets_access .widget .widget-top{cursor:default}.ui-sortable,.ui-draggable{-ms-touch-action:none}@media only screen and (max-width:768px){#col-left{width:100%}#col-right{width:100%}}@media only screen and (min-width:769px){#col-left{width:35%}#col-right{width:65%}}@media only screen and (max-width:860px){#col-left{width:35%}#col-right{width:65%}}@media only screen and (min-width:980px){#col-left{width:35%}#col-right{width:65%}}@media only screen and (max-width:768px){#col-left{width:100%}#col-right{width:100%}.form-field input,.form-field textarea{width:99%}.form-wrap .form-field{padding:0}#profile-page .form-table textarea{max-width:400px;width:auto}}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.press-this .tagchecklist span a{background-image:url('../images/xit-2x.gif');background-size:20px auto}.js .postbox:hover .handlediv,.js .stuffbox:hover .handlediv,.widget-top a.widget-action{background-image:url('../images/arrows-2x.png');background-size:15px 123px}.widget-top a.widget-action:hover{background-image:url('../images/arrows-dark-2x.png');background-size:15px 123px}.post-com-count{background-image:url('../images/bubble_bg-2x.gif');background-size:18px 100px}th .comment-grey-bubble{background-image:url('../images/comment-grey-bubble-2x.png');background-size:12px 12px}.sorting-indicator{background-image:url('../images/sort-2x.gif?ver=20130102');background-size:14px 4px}#content-resize-handle,#post-body .wp_themeSkin .mceStatusbar a.mceResize{background:transparent url('../images/resize-2x.gif') no-repeat scroll right bottom;background-size:11px 11px}div.star-holder{background:url('../images/stars-2x.png?ver=20121108') repeat-x bottom left;background-size:21px 37px}div.star-holder .star-rating{background:url('../images/stars-2x.png?ver=20121108') repeat-x top left;background-size:21px 37px}.welcome-panel .welcome-panel-close:before{background-image:url('../images/xit-2x.gif');background-size:20px auto}.welcome-panel .welcome-icon{background-image:url('../images/welcome-icons-2x.png')}.login h1 a{background-image:url('../images/wordpress-logo-2x.png?ver=20120412');background-size:274px 63px}.wp-badge{background-image:url('../images/wp-badge-2x.png?ver=20120516');background-size:173px 194px}.wp-full-overlay .collapse-sidebar-arrow{background-image:url('../images/arrows-2x.png');background-size:15px 123px}.pressthis a span{background-image:url(../images/press-this-2x.png?v=20121105)}.imgedit-crop,.imgedit-rleft,.imgedit-rright,.imgedit-flipv,.imgedit-fliph,.imgedit-undo,.imgedit-redo{background-image:url('../images/imgedit-icons-2x.png');background-size:260px 64px}.spinner,.imgedit-wait,.customize-loading #customize-container{background-image:url(../images/wpspin_light-2x.gif)}}.locale-zh-cn .howto,.locale-zh-cn .tablenav .displaying-num,.locale-zh-cn .js .input-with-default-title,.locale-zh-cn .link-to-original,.locale-zh-cn .inline-edit-row fieldset span.title,.locale-zh-cn .inline-edit-row fieldset span.checkbox-title,.locale-zh-cn #utc-time,.locale-zh-cn #local-time,.locale-zh-cn p.install-help,.locale-zh-cn p.help,.locale-zh-cn p.description,.locale-zh-cn span.description,.locale-zh-cn .form-wrap p{font-style:normal}.locale-zh-cn .hdnle a{font-size:12px}.locale-zh-cn form.upgrade .hint{font-style:normal;font-size:100%}.locale-zh-cn #wp-fullscreen-tagline{font-family:KaiTi,"楷体",sans-serif}.locale-zh-cn #wp-fullscreen-modes a{font-size:12px}.locale-zh-cn #sort-buttons{font-size:1em!important}.locale-ru-ru .inline-edit-row fieldset label span.title{width:auto;min-width:5em}.locale-ru-ru.press-this .posting{margin-right:257px}.locale-ru-ru.press-this #photo-add-url-div input[type="text"]{width:255px}.locale-ru-ru.press-this #side-sortables{width:245px}.locale-ru-ru #customize-header-actions .button{padding:0 8px 1px}.locale-lt-lt .inline-edit-row fieldset label span.title{width:8em}.locale-lt-lt .inline-edit-row fieldset label span.input-text-wrap{margin-left:8em}.update-php .spinner{float:none;margin:-4px 0}
\ No newline at end of file
+#wpwrap{height:auto;min-height:100%;width:100%;position:relative}#wpcontent{height:100%}#wpcontent,#wpfooter{margin-left:165px}.folded #wpcontent,.folded #wpfooter{margin-left:52px}#wpbody-content{padding-bottom:65px;float:left;width:100%}#adminmenuback,#adminmenuwrap,#adminmenu,#adminmenu .wp-submenu{width:145px}#adminmenuback{position:absolute;top:0;bottom:0;z-index:-1}#adminmenu{clear:left;margin:0;padding:0;list-style:none}.folded #adminmenuback,.folded #adminmenuwrap,.folded #adminmenu,.folded #adminmenu li.menu-top{width:32px}.inner-sidebar{float:right;clear:right;display:none;width:281px;position:relative}.columns-2 .inner-sidebar{margin-right:auto;width:286px;display:block}.inner-sidebar #side-sortables,.columns-2 .inner-sidebar #side-sortables{min-height:300px;width:280px;padding:0}.has-right-sidebar .inner-sidebar{display:block}.has-right-sidebar #post-body{float:left;clear:left;width:100%;margin-right:-2000px}.has-right-sidebar #post-body-content{margin-right:300px;float:none;width:auto}#col-container,#col-left,#col-right{overflow:hidden;padding:0;margin:0}#col-left{width:35%}#col-right{float:right;clear:right;width:65%}.col-wrap{padding:0 7px}.alignleft{float:left}.alignright{float:right}.textleft{text-align:left}.textright{text-align:right}.clear{clear:both}.screen-reader-text,.screen-reader-text span,.ui-helper-hidden-accessible{position:absolute;left:-1000em;top:-1000em;height:1px;width:1px;overflow:hidden}.screen-reader-shortcut{position:absolute;top:-1000em}.screen-reader-shortcut:focus{left:6px;top:-21px;height:auto;width:auto;display:block;font-size:14px;font-weight:bold;padding:15px 23px 14px;background:#f1f1f1;color:#21759b;border-radius:3px;z-index:100000;line-height:normal;-webkit-box-shadow:0 0 2px 2px rgba(0,0,0,.6);box-shadow:0 0 2px 2px rgba(0,0,0,.6);text-decoration:none}.hidden,.js .closed .inside,.js .hide-if-js,.no-js .hide-if-no-js,.js.wp-core-ui .hide-if-js,.js .wp-core-ui .hide-if-js,.no-js.wp-core-ui .hide-if-no-js,.no-js .wp-core-ui .hide-if-no-js{display:none}input[type="text"],input[type="password"],input[type="number"],input[type="search"],input[type="email"],input[type="url"],textarea{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}input[type="checkbox"],input[type="radio"]{vertical-align:text-top;padding:0;margin:1px 0 0}input[type="search"]{-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration{display:none}html,body{height:100%;margin:0;padding:0}body{font-family:sans-serif;font-size:12px;line-height:1.4em;min-width:600px}body.iframe{min-width:0;padding-top:1px}body.login{background:#fbfbfb;min-width:0}iframe,img{border:0}td,textarea,input,select,button{font-family:inherit;font-size:inherit;font-weight:inherit}td,textarea{line-height:inherit}input,select{line-height:15px}a,input[type="text"],input[type="password"],input[type="number"],input[type="search"],input[type="email"],input[type="url"],select,textarea,div{outline:0}a:focus,a:active{outline:thin dotted}#adminmenu a:focus,#adminmenu a:active,.screen-reader-text:focus{outline:0}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}p{margin:1em 0}blockquote{margin:1em}label{cursor:pointer}li,dd{margin-bottom:6px}textarea,input,select{margin:1px;padding:3px}h1,h2,h3,h4,h5,h6{display:block;font-weight:bold}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em;margin:.83em 0}h3{font-size:1.17em;margin:1em 0}h4{font-size:1em;margin:1.33em 0}h5{font-size:.83em;margin:1.67em 0}h6{font-size:.67em;margin:2.33em 0}ul,ol{padding:0}ul{list-style:none}ol{list-style-type:decimal;margin-left:2em}ul.ul-disc{list-style:disc outside}ul.ul-square{list-style:square outside}ol.ol-decimal{list-style:decimal outside}ul.ul-disc,ul.ul-square,ol.ol-decimal{margin-left:1.8em}ul.ul-disc>li,ul.ul-square>li,ol.ol-decimal>li{margin:0 0 .5em}.code,code{font-family:Consolas,Monaco,monospace}kbd,code{padding:1px 3px;margin:0 1px;font-size:11px}.subsubsub{list-style:none;margin:8px 0 5px;padding:0;font-size:12px;float:left}.subsubsub a{line-height:2;padding:.2em;text-decoration:none}.subsubsub a .count,.subsubsub a.current .count{color:#999;font-weight:normal}.subsubsub a.current{font-weight:bold;border:0}.subsubsub li{display:inline-block;margin:0;padding:0;white-space:nowrap}.widefat,div.updated,div.error,.wrap .add-new-h2,textarea,input[type="text"],input[type="password"],input[type="file"],input[type="email"],input[type="number"],input[type="search"],input[type="tel"],input[type="url"],select,.tablenav .tablenav-pages a,.tablenav-pages span.current,#titlediv #title,.postbox,#postcustomstuff table,#postcustomstuff input,#postcustomstuff textarea,.imgedit-menu div,.plugin-update-tr .update-message,#poststuff .inside .the-tagcloud,.login form,#login_error,.login .message,#menu-management .menu-edit,.nav-menus-php .list-container,.menu-item-handle,.link-to-original,.nav-menus-php .major-publishing-actions .form-invalid,.press-this #message,#TB_window,.tbtitle,.highlight,.feature-filter,#widget-list .widget-top,.editwidget .widget-inside{-webkit-border-radius:3px;border-radius:3px;border-width:1px;border-style:solid}.widefat{border-spacing:0;width:100%;clear:both;margin:0}.widefat *{word-wrap:break-word}.widefat a{text-decoration:none}.widefat thead th:first-of-type{-webkit-border-top-left-radius:3px;border-top-left-radius:3px}.widefat thead th:last-of-type{-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.widefat tfoot th:first-of-type{-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px}.widefat tfoot th:last-of-type{-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px}.widefat td,.widefat th{border-width:1px 0;border-style:solid}.widefat tfoot th{border-bottom:0}.widefat .no-items td{border-bottom-width:0}.widefat td{font-size:12px;padding:4px 7px 2px;vertical-align:top}.widefat td p,.widefat td ol,.widefat td ul{font-size:12px}.widefat th{padding:7px 7px 8px;text-align:left;line-height:1.3em;font-size:14px}.widefat th input{margin:0 0 0 8px;padding:0;vertical-align:text-top}.widefat .check-column{width:2.2em;padding:6px 0 25px;vertical-align:top}.widefat tbody th.check-column{padding:9px 0 22px}.widefat.media .check-column{padding-top:8px}.widefat thead .check-column,.widefat tfoot .check-column{padding:10px 0 0}.no-js .widefat thead .check-column input,.no-js .widefat tfoot .check-column input{display:none}.widefat .num,.column-comments,.column-links,.column-posts{text-align:center}.widefat th#comments{vertical-align:middle}.wrap{margin:4px 15px 0 0}div.updated,div.error{padding:0 .6em;margin:5px 15px 2px}div.updated p,div.error p{margin:.5em 0;padding:2px}.wrap div.updated,.wrap div.error,.media-upload-form div.error{margin:5px 0 15px}.wrap h2,.subtitle{font-weight:normal;margin:0;text-shadow:#fff 0 1px 0}.wrap h2{font-size:23px;padding:9px 15px 4px 0;line-height:29px}.subtitle{font-size:14px;padding-left:25px}.wrap .add-new-h2{font-family:sans-serif;margin-left:4px;padding:3px 8px;position:relative;top:-3px;text-decoration:none;font-size:12px;border:0 none}.wrap h2.long-header{padding-right:0}html,.wp-dialog{background-color:#fff}textarea,input[type="text"],input[type="password"],input[type="file"],input[type="email"],input[type="number"],input[type="search"],input[type="tel"],input[type="url"],select{background-color:#fff;color:#333}select{color:#000}select[disabled]{color:#7f7f7f}select:focus{border-color:#aaa}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="file"]:focus,input[type="email"]:focus,input[type="number"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="url"]:focus,select:focus{-webkit-box-shadow:1px 1px 2px rgba(0,0,0,0.1);box-shadow:1px 1px 2px rgba(0,0,0,0.1)}input[readonly]{background-color:#eee}:-moz-placeholder,.wp-core-ui :-moz-placeholder{color:#a9a9a9}div.sidebar-name h3,#menu-management .nav-tab,#dashboard_plugins h5,a.rsswidget,#dashboard_right_now td.b,#dashboard-widgets h4,.tool-box .title,#poststuff h3,.metabox-holder h3,.pressthis a,#your-profile legend,.inline-edit-row fieldset span.title,.inline-edit-row fieldset span.checkbox-title,.tablenav .displaying-num,.widefat th,.quicktags,.search{font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif}h2 .nav-tab,.wrap h2,.subtitle,.login form .input{font-family:"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif}.quicktags,.search{font-size:12px}.icon32{float:left;height:34px;margin:7px 8px 0 0;width:36px}.icon16{height:18px;width:18px;padding:6px 6px;margin:-6px 0 0 -8px;float:left}.key-labels label{line-height:24px}.pre{white-space:pre-wrap;word-wrap:break-word}.howto{font-style:italic;display:block;font-family:sans-serif}p.install-help{margin:8px 0;font-style:italic}.no-break{white-space:nowrap}.wp-admin select{padding:2px;height:2em}.wp-admin select[multiple]{height:auto}.submit{padding:1.5em 0;margin:5px 0;-webkit-border-bottom-left-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-left-radius:3px;border-bottom-right-radius:3px}form p.submit a.cancel:hover{text-decoration:none}#minor-publishing-actions input,#major-publishing-actions input,#minor-publishing-actions .preview{text-align:center}textarea.all-options,input.all-options{width:250px}input.large-text,textarea.large-text{width:99%}input.regular-text,#adduser .form-field input{width:25em}input.small-text{width:50px}input[type="number"].small-text{width:60px}#doaction,#doaction2,#post-query-submit{margin:1px 8px 0 0}.tablenav #changeit,.tablenav #delete_all,.tablenav #clear-recent-list{margin-top:1px}.tablenav .actions select{float:left;margin-right:6px;max-width:200px}.ie8 .tablenav .actions select{width:155px}.ie8 .tablenav .actions select#cat{width:200px}#timezone_string option{margin-left:1em}label,#your-profile label+a{vertical-align:middle}#misc-publishing-actions label{vertical-align:baseline}#pass-strength-result{border-style:solid;border-width:1px;float:left;margin:13px 5px 5px 1px;padding:3px 5px;text-align:center;width:200px;display:none}.indicator-hint{padding-top:8px}p.search-box{float:right;margin:0}.search-box input[name="s"],#search-plugins input[name="s"],.tagsdiv .newtag{float:left;height:2em;margin:0 4px 0 0}input[type="text"].ui-autocomplete-loading{background:transparent url('../images/loading.gif') no-repeat right center;visibility:visible}ul#add-to-blog-users{margin:0 0 0 14px}.ui-autocomplete-input.open{border-bottom-right-radius:0;border-bottom-left-radius:0}.ui-autocomplete{padding:0;margin:0;list-style:none;position:absolute;z-index:10000;border-bottom-right-radius:3px;border-bottom-left-radius:3px;border-width:1px;border-style:solid}.ui-autocomplete li{margin-bottom:0;white-space:nowrap;text-align:left}.ui-autocomplete li a{display:block;height:100%;padding:4px 10px}.ui-autocomplete li a.ui-state-focus{cursor:pointer}#major-publishing-actions{padding:10px 10px 8px;clear:both;border-top:1px solid #f5f5f5;margin-top:-2px}#delete-action{line-height:25px;vertical-align:middle;text-align:left;float:left}#publishing-action{text-align:right;float:right;line-height:23px}#publishing-action .spinner{float:left}#misc-publishing-actions{padding:6px 0 0}.misc-pub-section{padding:6px 10px 8px;border-width:1px 0;border-style:solid}.misc-pub-section:first-child{border-top-width:0}.misc-pub-section-last{border-bottom-width:0}#minor-publishing-actions{padding:10px 10px 2px 8px;text-align:right}#minor-publishing{border-bottom-width:1px;border-bottom-style:solid;-webkit-box-shadow:0 1px 0 #fff;box-shadow:0 1px 0 #fff}#save-post{float:left}.preview{float:right}#sticky-span{margin-left:18px}.side-info{margin:0;padding:4px;font-size:11px}.side-info h5{padding-bottom:7px;font-size:14px;margin:12px 2px 5px;border-bottom-width:1px;border-bottom-style:solid}.side-info ul{margin:0;padding-left:18px;list-style:square}.approve,.unapproved .unapprove{display:none}.unapproved .approve,.spam .approve,.trash .approve{display:inline}td.action-links,th.action-links{text-align:right}#update-nag,.update-nag{line-height:19px;padding:5px 0;font-size:12px;text-align:center;margin:-1px 15px 0 5px;border-width:1px;border-style:solid;-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.plugins .plugin-update{padding:0}.plugin-update .update-message{margin:0 10px 8px 31px;font-weight:bold}ul#dismissed-updates{display:none}form.upgrade{margin-top:8px}form.upgrade .hint{font-style:italic;font-size:85%;margin:-0.5em 0 2em 0}.update-php .spinner{float:none;margin:-4px 0}#ajax-loading,.ajax-loading,.ajax-feedback,.imgedit-wait-spin,.list-ajax-loading{visibility:hidden}#ajax-response.alignleft{margin-left:2em}#adminmenu a,#sidemenu a,#taglist a,#catlist a{text-decoration:none}#screen-options-wrap,#contextual-help-wrap{margin:0;padding:8px 20px 12px;position:relative}#contextual-help-wrap{overflow:auto}#screen-meta .screen-reader-text{visibility:hidden}#screen-meta-links{margin:0 24px 0 0}#screen-meta-links a:focus{-webkit-box-shadow:1px 1px 1px rgba(0,0,0,0.4);box-shadow:1px 1px 1px rgba(0,0,0,0.4);outline:0}#screen-meta{display:none;position:relative;margin:0 15px 0 5px;border-width:0 1px 1px;border-style:none solid solid}#screen-options-link-wrap,#contextual-help-link-wrap{float:right;height:23px;padding:0;margin:0 0 0 6px;font-family:sans-serif}#screen-options-link-wrap,#contextual-help-link-wrap,#screen-meta{-webkit-border-bottom-left-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-left-radius:3px;border-bottom-right-radius:3px}#screen-meta-links .screen-meta-toggle{position:relative;top:-1px}#screen-meta-links a.show-settings{text-decoration:none;z-index:1;padding:1px 16px 0 6px;height:22px;line-height:22px;font-size:12px;display:block;text-shadow:rgba(255,255,255,0.7) 0 1px 0}#screen-meta-links a.show-settings:hover{text-decoration:none}.toggle-arrow{background-repeat:no-repeat;background-position:top left;background-color:transparent;height:22px;line-height:22px;display:block}.toggle-arrow-active{background-position:bottom left}#screen-options-wrap h5,#contextual-help-wrap h5{margin:8px 0;font-size:13px}.metabox-prefs label{display:inline-block;padding-right:15px;white-space:nowrap;line-height:30px}.metabox-prefs label input{margin:0 5px 0 2px}.metabox-prefs .columns-prefs label input{margin:0 2px}.metabox-prefs label a{display:none}#contextual-help-wrap{padding:0;margin-left:-4px}#contextual-help-columns{position:relative}#contextual-help-back{position:absolute;top:0;bottom:0;left:150px;right:170px;border-width:0 1px;border-style:solid}#contextual-help-wrap.no-sidebar #contextual-help-back{right:0;border-right-width:0;-webkit-border-bottom-right-radius:2px;border-bottom-right-radius:2px}.contextual-help-tabs{float:left;width:150px;margin:0}.contextual-help-tabs ul{margin:1em 0}.contextual-help-tabs li{margin-bottom:0;list-style-type:none;border-style:solid;border-width:1px 0;border-color:transparent}.contextual-help-tabs a{display:block;padding:5px 5px 5px 12px;line-height:18px;text-decoration:none}.contextual-help-tabs .active{padding:0;margin:0 -1px 0 0;border-width:1px 0 1px 1px;border-style:solid}.contextual-help-tabs-wrap{padding:0 20px;overflow:auto}.help-tab-content{display:none;margin:0 22px 12px 0;line-height:1.6em}.help-tab-content.active{display:block}.help-tab-content ul li{list-style-type:disc;margin-left:18px}.contextual-help-sidebar{width:150px;float:right;padding:0 8px 0 12px;overflow:auto}#adminmenuback,#adminmenuwrap{border-width:0 1px 0 0;border-style:solid}#adminmenuwrap{position:relative;float:left}#adminmenushadow{position:absolute;top:0;right:0;bottom:0;width:6px;z-index:20}#adminmenu *{-webkit-user-select:none;-moz-user-select:none;user-select:none}#adminmenu li{margin:0;padding:0;cursor:pointer}#adminmenu a{display:block;line-height:18px;padding:2px 5px}#adminmenu li.menu-top{min-height:28px;position:relative}#adminmenu .wp-submenu{list-style:none;padding:4px 0;margin:0;position:absolute;top:-1000em;left:146px;z-index:1000;overflow:visible;border-width:1px;border-style:solid;-webkit-border-bottom-right-radius:3px;-webkit-border-top-right-radius:3px;border-bottom-right-radius:3px;border-top-right-radius:3px}.js #adminmenu .sub-open,.js #adminmenu .opensub .wp-submenu,#adminmenu a.menu-top:focus+.wp-submenu,.no-js li.wp-has-submenu:hover .wp-submenu{top:-1px}#adminmenu .wp-has-current-submenu .wp-submenu,.no-js li.wp-has-current-submenu:hover .wp-submenu,#adminmenu a.wp-has-current-submenu:focus+.wp-submenu,#adminmenu .wp-has-current-submenu .wp-submenu.sub-open,#adminmenu .wp-has-current-submenu.opensub .wp-submenu{position:relative;z-index:3;top:auto;left:auto;right:auto;bottom:auto;border:0 none;-webkit-box-shadow:none;box-shadow:none}.folded #adminmenu .wp-submenu.sub-open,.folded #adminmenu .opensub .wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,.folded #adminmenu .wp-has-current-submenu.opensub .wp-submenu,.folded #adminmenu a.menu-top:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu a.menu-top:focus+.wp-submenu,.no-js.folded #adminmenu .wp-has-submenu:hover .wp-submenu{top:-1px;left:32px}.folded #adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.folded #adminmenu .wp-has-current-submenu .wp-submenu{border-width:1px;border-style:solid;position:absolute;top:-1000em}#adminmenu .wp-submenu a{font-size:12px;line-height:18px;margin:0;padding-left:12px}#adminmenu .wp-not-current-submenu li>a{padding-left:16px}#adminmenu .wp-has-current-submenu ul>li>a,.folded #adminmenu li.menu-top .wp-submenu>li>a{padding-left:12px}#adminmenu a.menu-top,#adminmenu .wp-submenu-head{font-size:13px;font-weight:bold;line-height:18px;padding:0}#adminmenu .wp-submenu-head,.folded #adminmenu .wp-menu-name{display:none}.folded #adminmenu .wp-submenu-head{display:block}#adminmenu .wp-submenu li{padding:0;margin:0;overflow:hidden}#adminmenu a.menu-top{border-width:1px 0;border-style:solid none}#adminmenu .wp-menu-image img{padding:7px 0 0 7px;opacity:.6;filter:alpha(opacity=60)}#adminmenu div.wp-menu-name{padding:5px}#adminmenu div.wp-menu-image{float:left;width:28px;height:28px}.folded #adminmenu div.wp-menu-image{width:32px;position:absolute;z-index:25}.folded #adminmenu a.menu-top{height:28px}.wp-menu-arrow{z-index:25;position:absolute;right:100%;margin:0;height:30px;width:6px;-moz-transform:translate(146px);-webkit-transform:translate(146px);-o-transform:translate(146px);-ms-transform:translate(146px);transform:translate(146px)}#adminmenu .wp-menu-arrow div{display:none;position:absolute;top:7px;left:-1px;width:14px;height:15px;-moz-transform:matrix(-0.6,1,0.6,1,0,0);-webkit-transform:matrix(-0.6,1,0.6,1,0,0);-o-transform:matrix(-0.6,1,0.6,1,0,0);-ms-transform:matrix(-0.6,1,0.6,1,0,0);transform:matrix(-0.6,1,0.6,1,0,0)}#adminmenu li.wp-not-current-submenu .wp-menu-arrow{-moz-transform:translate(145px);-webkit-transform:translate(145px);-o-transform:translate(145px);-ms-transform:translate(145px);transform:translate(145px);height:28px;border-width:1px 0;border-style:solid;top:0}.folded #adminmenu li .wp-menu-arrow{-moz-transform:translate(32px);-webkit-transform:translate(32px);-o-transform:translate(32px);-ms-transform:translate(32px);transform:translate(32px)}#adminmenu li.current .wp-menu-arrow,#adminmenu li.wp-has-current-submenu .wp-menu-arrow,#adminmenu li.wp-has-current-submenu .wp-menu-arrow div,#adminmenu li.wp-has-submenu .wp-menu-arrow div,#adminmenu li.current .wp-menu-arrow div,.no-js #adminmenu li.wp-has-submenu:hover .wp-menu-arrow,#adminmenu li.wp-has-submenu.opensub .wp-menu-arrow,#adminmenu a.wp-has-submenu:focus .wp-menu-arrow,#adminmenu a:hover .wp-menu-arrow{display:block}#adminmenu li.current .wp-menu-arrow,#adminmenu li.wp-menu-open .wp-menu-arrow{top:0}.no-js #adminmenu li.wp-has-submenu:hover .wp-menu-arrow,#adminmenu li.wp-has-submenu.opensub .wp-menu-arrow,#adminmenu a.wp-has-submenu:focus .wp-menu-arrow{z-index:1001}.ie8 #adminmenu li.menu-top:hover .wp-menu-arrow{display:none}#adminmenu .wp-not-current-submenu .wp-menu-arrow div{width:15px;top:6px;border-width:0 0 1px 1px;border-style:solid}.wp-menu-arrow,.folded #adminmenu li .wp-menu-arrow div,.no-js #adminmenu li.wp-not-current-submenu:hover .wp-menu-arrow{display:none}.folded #adminmenu li.current .wp-menu-arrow,.folded #adminmenu li.current .wp-menu-arrow div,.folded #adminmenu li.wp-has-current-submenu .wp-menu-arrow div,.folded #adminmenu li.wp-menu-open .wp-menu-arrow,.folded #adminmenu li a:focus .wp-menu-arrow{display:block}#adminmenu li.menu-top:hover .wp-menu-image img,#adminmenu li.wp-has-current-submenu .wp-menu-image img{opacity:1;filter:alpha(opacity=100)}#adminmenu li.wp-menu-separator{height:3px;padding:0;margin:0;border-width:1px 0;border-style:solid;cursor:inherit}#adminmenu div.separator{height:1px;padding:0;border-width:1px 0 0 0;border-style:solid}#adminmenu .wp-submenu .wp-submenu-head{padding:5px 4px 5px 10px;margin:-4px -1px 4px;border-width:1px 0;border-style:solid;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}#adminmenu li.wp-menu-open{border-width:0 0 1px;border-style:solid}#adminmenu li.current,.folded #adminmenu li.wp-menu-open{border:0 none}.folded #adminmenu li.wp-has-current-submenu{margin-bottom:1px}.folded #adminmenu .wp-has-current-submenu.menu-top-last{margin-bottom:0}#adminmenu .awaiting-mod,#adminmenu span.update-plugins,#sidemenu li a span.update-plugins{position:absolute;font-family:sans-serif;font-size:9px;line-height:17px;font-weight:bold;margin-top:1px;margin-left:7px;-webkit-border-radius:10px;border-radius:10px;z-index:26}#adminmenu li .awaiting-mod span,#adminmenu li span.update-plugins span,#sidemenu li a span.update-plugins span{display:block;padding:0 6px}#adminmenu li span.count-0,#sidemenu li a .count-0{display:none}#collapse-menu{font-size:12px;line-height:34px;border-width:1px 0 0;border-style:solid}.folded #collapse-menu span{display:none}#collapse-button,#collapse-button div{width:15px;height:15px}#collapse-button{float:left;margin:8px 6px;border-width:1px;border-style:solid;-webkit-border-radius:10px;border-radius:10px}@media only screen and (max-width:900px){.auto-fold #wpcontent,.auto-fold #wpfooter{margin-left:52px}.auto-fold #adminmenuback,.auto-fold #adminmenuwrap,.auto-fold #adminmenu,.auto-fold #adminmenu li.menu-top{width:32px}.auto-fold #adminmenu .wp-submenu.sub-open,.auto-fold #adminmenu .opensub .wp-submenu,.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu.sub-open,.auto-fold #adminmenu .wp-has-current-submenu.opensub .wp-submenu,.auto-fold #adminmenu a.menu-top:focus+.wp-submenu,.auto-fold #adminmenu .wp-has-current-submenu a.menu-top:focus+.wp-submenu{top:-1px;left:32px}.auto-fold #adminmenu a.wp-has-current-submenu:focus+.wp-submenu,.auto-fold #adminmenu .wp-has-current-submenu .wp-submenu{border-width:1px;border-style:solid;position:absolute;top:-1000em}.auto-fold #adminmenu li.menu-top .wp-submenu>li>a{padding-left:12px}.auto-fold #adminmenu .wp-menu-name{display:none}.auto-fold #adminmenu .wp-submenu-head{display:block}.auto-fold #adminmenu div.wp-menu-image{width:32px;position:absolute;z-index:25}.auto-fold #adminmenu a.menu-top{height:28px}.auto-fold #adminmenu li .wp-menu-arrow{-moz-transform:translate(32px);-webkit-transform:translate(32px);-o-transform:translate(32px);-ms-transform:translate(32px);transform:translate(32px)}.auto-fold #adminmenu li .wp-menu-arrow div{display:none}.auto-fold #adminmenu li.current .wp-menu-arrow,.auto-fold #adminmenu li.current .wp-menu-arrow div,.auto-fold #adminmenu li.wp-has-current-submenu .wp-menu-arrow div,.auto-fold #adminmenu li.wp-menu-open .wp-menu-arrow,.auto-fold #adminmenu li a:focus .wp-menu-arrow{display:block}.auto-fold #adminmenu li.wp-menu-open{border:0 none}.auto-fold #adminmenu li.wp-has-current-submenu{margin-bottom:1px}.auto-fold #adminmenu .wp-has-current-submenu.menu-top-last{margin-bottom:0}.auto-fold #collapse-menu span{display:none}}.post-com-count-wrapper{min-width:22px;font-family:sans-serif}.post-com-count{background-image:url('../images/bubble_bg.gif');height:1.3em;line-height:1.1em;display:block;text-decoration:none;padding:0 0 6px;cursor:pointer;background-position:center -80px;background-repeat:no-repeat}.post-com-count span{font-size:11px;font-weight:bold;height:1.4em;line-height:1.4em;min-width:.7em;padding:0 6px;display:inline-block;-webkit-border-radius:5px;border-radius:5px}strong .post-com-count{background-position:center -55px}.post-com-count:hover{background-position:center -3px}.column-response .post-com-count{float:left;margin-right:5px;text-align:center}.response-links{float:left}#the-comment-list .attachment-80x60{padding:4px 8px}th .comment-grey-bubble{background-image:url('../images/comment-grey-bubble.png');background-repeat:no-repeat;height:12px;width:12px}html.wp-toolbar{padding-top:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.narrow{width:70%;margin-bottom:40px}.narrow p{line-height:150%}.widefat th,.widefat td{overflow:hidden}.widefat th{font-weight:normal}.widefat td p{margin:2px 0 .8em}.widefat .column-comment p{margin:.6em 0}.postbox-container{float:left}#dashboard-widgets.columns-1 .postbox-container{width:100%}#dashboard-widgets.columns-2 .postbox-container{width:49.5%}#dashboard-widgets.columns-2 #postbox-container-2,#dashboard-widgets.columns-2 #postbox-container-3,#dashboard-widgets.columns-2 #postbox-container-4{float:right;width:50.5%}#dashboard-widgets.columns-3 .postbox-container{width:33.5%}#dashboard-widgets.columns-3 #postbox-container-1{width:33%}#dashboard-widgets.columns-3 #postbox-container-3,#dashboard-widgets.columns-3 #postbox-container-4{float:right}#dashboard-widgets.columns-4 .postbox-container{width:25%}.postbox-container .meta-box-sortables{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.metabox-holder .postbox-container .empty-container{border:3px dashed #ccc;height:250px}.metabox-holder.columns-1 .postbox-container .empty-container,.columns-2 #postbox-container-3 .empty-container,.columns-2 #postbox-container-4 .empty-container,.columns-3 #postbox-container-4 .empty-container{border:0 none;height:0;min-height:0}#poststuff{padding-top:10px}#poststuff #post-body{padding:0}#post-body-content{width:100%;float:left}#poststuff .postbox-container{width:100%}#poststuff #post-body.columns-2{margin-right:300px}#post-body.columns-2 #postbox-container-1{float:right;margin-right:-300px;width:280px}#post-body.columns-2 #side-sortables{min-height:250px}@media only screen and (max-width:799px){#wpbody-content #dashboard-widgets .postbox-container{width:100%}#wpbody-content .metabox-holder .postbox-container .empty-container{border:0 none;height:0;min-height:0}}@media only screen and (min-width:800px) and (max-width:1200px){#wpbody-content #dashboard-widgets .postbox-container{width:49.5%}#wpbody-content #dashboard-widgets #postbox-container-2,#wpbody-content #dashboard-widgets #postbox-container-3,#wpbody-content #dashboard-widgets #postbox-container-4{float:right;width:50.5%}#dashboard-widgets #postbox-container-3 .empty-container,#dashboard-widgets #postbox-container-4 .empty-container{border:0 none;height:0;min-height:0}#wpbody #wpbody-content #dashboard-widgets.columns-1 .postbox-container{width:100%}#wpbody #wpbody-content .metabox-holder.columns-1 .postbox-container .empty-container{border:0 none;height:0;min-height:0}.index-php .screen-layout,.index-php .columns-prefs{display:block}.columns-prefs .columns-prefs-3,.columns-prefs .columns-prefs-4{display:none}}@media only screen and (max-width:850px){#wpbody-content #poststuff #post-body{margin:0}#wpbody-content #post-body.columns-2 #postbox-container-1{margin-right:0;width:100%}#poststuff #postbox-container-1 .empty-container,#poststuff #postbox-container-1 #side-sortables:empty{border:0 none;height:0;min-height:0}#poststuff #post-body.columns-2 #side-sortables{min-height:0}.screen-layout,.columns-prefs{display:none}}.postbox .hndle{-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-left-radius:3px;border-top-right-radius:3px}.js .postbox .hndle{cursor:move}.postbox.closed .hndle{-webkit-border-radius:3px;border-radius:3px}.hndle a{font-size:11px;font-weight:normal}.postbox .handlediv{float:right;width:27px;height:30px}.js .postbox .handlediv{cursor:pointer}.sortable-placeholder{border-width:1px;border-style:dashed;margin-bottom:20px}.widget,.postbox,.stuffbox{margin-bottom:20px;padding:0;border-width:1px;border-style:solid;line-height:1}.widget .widget-top,.postbox h3,.stuffbox h3{margin-top:1px;border-bottom-width:1px;border-bottom-style:solid;-webkit-user-select:none;-moz-user-select:none;user-select:none}.js .widget .widget-top,.js .postbox h3{cursor:move}.postbox .inside,.stuffbox .inside{padding:0 12px 0 10px;line-height:1.4em}.postbox .inside{margin:10px 0;position:relative}.postbox.closed h3{border:0;-webkit-box-shadow:none;box-shadow:none}.postbox table.form-table{margin-bottom:0}.temp-border{border:1px dotted #ccc}.columns-prefs label{padding:0 5px}#dashboard-widgets-wrap{margin:0 -8px}#wpbody-content .metabox-holder{padding-top:10px}#dashboard-widgets .meta-box-sortables{margin:0 8px}#dashboard_recent_comments div.undo{border-top-style:solid;border-top-width:1px;margin:0 -10px;padding:3px 8px;font-size:11px}#the-comment-list td.comment p.comment-author{margin-top:0;margin-left:0}#the-comment-list p.comment-author img{float:left;margin-right:8px}#the-comment-list p.comment-author strong a{border:0}#the-comment-list td{vertical-align:top}#the-comment-list td.comment{word-wrap:break-word}.welcome-panel{position:relative;overflow:auto;margin:20px 0;padding:23px 10px 12px;border-width:1px;border-style:solid;border-radius:3px;font-size:13px;line-height:2.1em}.welcome-panel h3{margin:0;font-family:"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;font-size:21px;font-weight:normal;line-height:1.2}.welcome-panel h4{margin:1.33em 0 0;font-size:13px}.welcome-panel .about-description{font-size:16px;margin:0}.welcome-panel .welcome-panel-close{position:absolute;top:5px;right:10px;padding:8px 3px;font-size:13px;text-decoration:none;line-height:1}.welcome-panel .welcome-panel-close:before{content:' ';position:absolute;left:-12px;width:10px;height:100%;background:url('../images/xit.gif') 0 17% no-repeat}.welcome-panel .welcome-panel-close:hover:before{background-position:100% 17%}.wp-core-ui .welcome-panel .button.button-hero{margin:15px 0 3px}.welcome-panel-content{margin-left:13px;max-width:1500px}.welcome-panel .welcome-panel-column-container{clear:both;overflow:hidden;position:relative}.welcome-panel .welcome-panel-column{width:32%;min-width:200px;float:left}.ie8 .welcome-panel .welcome-panel-column{min-width:230px}.welcome-panel .welcome-panel-column:first-child{width:36%}.welcome-panel-column p{margin-top:7px}.welcome-panel .welcome-icon{display:block;padding:2px 0 8px 32px;background-image:url('../images/welcome-icons.png');background-repeat:no-repeat;background-size:16px}.welcome-panel .welcome-add-page{background-position:0 2px}.welcome-panel .welcome-edit-page{background-position:0 -90px}.welcome-panel .welcome-learn-more{background-position:0 -136px}.welcome-panel .welcome-comments{background-position:0 -182px}.welcome-panel .welcome-view-site{background-position:0 -274px}.welcome-panel .welcome-widgets-menus{background-position:1px -229px;line-height:14px}.welcome-panel .welcome-write-blog{background-position:0 -44px}.welcome-panel .welcome-panel-column ul{margin:.8em 1em 1em 0}.welcome-panel .welcome-panel-column li{line-height:16px;list-style-type:none}@media screen and (max-width:870px){.welcome-panel .welcome-panel-column,.welcome-panel .welcome-panel-column:first-child{display:block;float:none;width:100%}.welcome-panel .welcome-panel-column li{display:inline-block;margin-right:13px}.welcome-panel .welcome-panel-column ul{margin:.4em 0 0}.welcome-panel .welcome-icon{padding-left:25px}}table.fixed{table-layout:fixed}.fixed .column-rating,.fixed .column-visible{width:8%}.fixed .column-posts,.fixed .column-date,.fixed .column-parent,.fixed .column-links,.fixed .column-author,.fixed .column-format{width:10%}.fixed .column-response,.fixed .column-categories,.fixed .column-tags,.fixed .column-rel,.fixed .column-role{width:15%}.fixed .column-slug{width:25%}.fixed .column-locations{width:35%}.fixed .column-comments{width:4em;padding:8px 0;text-align:left}.fixed .column-comments .vers{padding-left:3px}.fixed .column-comments a{float:left}.fixed .column-icon{width:80px}#comments-form .fixed .column-author{width:20%}#commentsdiv.postbox .inside{margin:0;padding:0}#commentsdiv .inside .row-actions{line-height:18px}#commentsdiv .inside .column-author{width:25%}#commentsdiv .column-comment p{margin:.6em 0;padding:0}#commentsdiv #replyrow td{padding:0}#commentsdiv p{padding:8px 10px;margin:0}#commentsdiv #add-new-comment{border-width:0 0 1px;border-style:none none solid}#commentsdiv .comments-box{border:0 none}#commentsdiv .comments-box thead th{background:transparent;padding:0 7px 4px;font-style:italic}#commentsdiv .comments-box tr:last-child td{border-bottom:0 none}#commentsdiv .spinner{padding-left:5px}.sorting-indicator{display:none;width:7px;height:4px;margin-top:8px;margin-left:7px;background-image:url('../images/sort.gif');background-repeat:no-repeat}tr.wp-locked .locked-indicator{background:url('../images/lock.png') no-repeat;margin:-2px 0 0 6px;height:20px;width:16px}tr.wp-locked .check-column label,tr.wp-locked .check-column input[type="checkbox"],tr.wp-locked .row-actions .inline,tr.wp-locked .row-actions .trash{display:none}tr .locked-info{height:0;opacity:0}tr.wp-locked .locked-info{height:auto;opacity:1}tr.locked-info,tr.wp-locked .locked-info{-webkit-transition:height 1s,opacity 500ms;-moz-transition:height 1s,opacity 500ms;-ms-transition:height 1s,opacity 500ms;-o-transition:height 1s,opacity 500ms;transition:height 1s,opacity 500ms}.fixed .column-comments .sorting-indicator{margin-top:3px}#menu-locations-wrap .widefat{width:60%}.widefat th.sortable,.widefat th.sorted{padding:0}th.sortable a,th.sorted a{display:block;overflow:hidden;padding:7px 7px 8px}.fixed .column-comments.sortable a,.fixed .column-comments.sorted a{padding:8px 0}th.sortable a span,th.sorted a span{float:left;cursor:pointer}th.sorted.asc .sorting-indicator,th.desc:hover span.sorting-indicator{display:block;background-position:0 0}th.sorted.desc .sorting-indicator,th.asc:hover span.sorting-indicator{display:block;background-position:-7px 0}.tablenav-pages a{border-bottom-style:solid;border-bottom-width:2px;font-weight:bold;margin-right:1px;padding:0 2px}.tablenav-pages .current-page{text-align:center}.tablenav-pages .next-page{margin-left:2px}.tablenav a.button-secondary{display:block;margin:3px 8px 0 0}.tablenav{clear:both;height:30px;margin:6px 0 4px;vertical-align:middle}.tablenav.themes{max-width:98%}.tablenav .tablenav-pages{float:right;display:block;cursor:default;height:30px;line-height:30px;font-size:12px}.tablenav .no-pages,.tablenav .one-page .pagination-links{display:none}.tablenav .tablenav-pages a,.tablenav-pages span.current{text-decoration:none;padding:3px 6px}.tablenav .tablenav-pages a.disabled:hover,.tablenav .tablenav-pages a.disabled:active{cursor:default}.tablenav .displaying-num{margin-right:10px;font-size:12px;font-style:italic}.tablenav .actions{overflow:hidden;padding:2px 8px 0 0}.tablenav .delete{margin-right:20px}.view-switch{float:right;margin:6px 8px 0}.view-switch a{text-decoration:none}.filter{float:left;margin:-5px 0 0 10px}.filter .subsubsub{margin-left:-10px;margin-top:13px}.screen-per-page{width:4em}#posts-filter fieldset{float:left;margin:0 1.5ex 1em 0;padding:0}#posts-filter fieldset legend{padding:0 0 .2em 1px}#wpbody-content .inline-edit-row fieldset{font-size:12px;float:left;margin:0;padding:0;width:100%}tr.inline-edit-row td,#wpbody-content .inline-edit-row fieldset .inline-edit-col{padding:0 .5em}#wpbody-content .quick-edit-row-page fieldset.inline-edit-col-right .inline-edit-col{border-width:0 0 0 1px;border-style:none none none solid}#wpbody-content .quick-edit-row-post .inline-edit-col-left{width:40%}#wpbody-content .quick-edit-row-post .inline-edit-col-right{width:39%}#wpbody-content .inline-edit-row-post .inline-edit-col-center{width:20%}#wpbody-content .quick-edit-row-page .inline-edit-col-left{width:50%}#wpbody-content .quick-edit-row-page .inline-edit-col-right,#wpbody-content .bulk-edit-row-post .inline-edit-col-right{width:49%}#wpbody-content .bulk-edit-row .inline-edit-col-left{width:30%}#wpbody-content .bulk-edit-row-page .inline-edit-col-right{width:69%}#wpbody-content .bulk-edit-row .inline-edit-col-bottom{float:right;width:69%}#wpbody-content .inline-edit-row-page .inline-edit-col-right{margin-top:27px}.inline-edit-row fieldset .inline-edit-group{clear:both}.inline-edit-row fieldset .inline-edit-group:after{content:".";display:block;height:0;clear:both;visibility:hidden}.inline-edit-row p.submit{clear:both;padding:.5em;margin:.5em 0 0}.inline-edit-row span.error{line-height:22px;margin:0 15px;padding:3px 5px}.inline-edit-row h4{margin:.2em 0;padding:0;line-height:23px}.inline-edit-row fieldset span.title,.inline-edit-row fieldset span.checkbox-title{margin:0;padding:0;line-height:27px}.inline-edit-row fieldset label,.inline-edit-row fieldset span.inline-edit-categories-label{display:block;margin:.2em 0}.inline-edit-row fieldset label.inline-edit-tags{margin-top:0}.inline-edit-row fieldset label.inline-edit-tags span.title{margin:.2em 0;width:auto}.inline-edit-row fieldset label span.title{display:block;float:left;width:5em}.inline-edit-row fieldset label span.input-text-wrap{display:block;margin-left:5em}.quick-edit-row-post fieldset.inline-edit-col-right label span.title{width:auto;padding-right:.5em}.inline-edit-row .input-text-wrap input[type=text]{width:100%}.inline-edit-row fieldset label input[type=checkbox]{vertical-align:text-bottom}.inline-edit-row fieldset label textarea{width:100%;height:4em}#wpbody-content .bulk-edit-row fieldset .inline-edit-group label{max-width:50%}#wpbody-content .quick-edit-row fieldset .inline-edit-group label.alignleft:first-child{margin-right:.5em}.inline-edit-col-right .input-text-wrap input.inline-edit-menu-order-input{width:6em}.inline-edit-save .spinner{padding:4px 10px 0;vertical-align:top;float:right}.inline-edit-row h4{text-transform:uppercase}.inline-edit-row fieldset span.title,.inline-edit-row fieldset span.checkbox-title{font-style:italic;line-height:1.8em}.inline-edit-row fieldset input[type="text"],.inline-edit-row fieldset textarea{border-style:solid;border-width:1px}.inline-edit-row fieldset .inline-edit-date{float:left}.inline-edit-row fieldset input[name=jj],.inline-edit-row fieldset input[name=hh],.inline-edit-row fieldset input[name=mn]{font-size:12px;width:2.1em}.inline-edit-row fieldset input[name=aa]{font-size:12px;width:3.5em}.inline-edit-row fieldset label input.inline-edit-password-input{width:8em}ul.cat-checklist{height:12em;border-style:solid;border-width:1px;overflow-y:scroll;padding:0 5px;margin:0}#bulk-titles{display:block;height:12em;border-style:solid;border-width:1px;overflow-y:scroll;padding:0 5px;margin:0 0 5px}.inline-edit-row fieldset ul.cat-checklist li,.inline-edit-row fieldset ul.cat-checklist input{margin:0}.inline-edit-row fieldset ul.cat-checklist label,.inline-edit-row #bulk-titles div{font-family:sans-serif;font-style:normal;font-size:11px}.inline-edit-row fieldset label input.inline-edit-menu-order-input{width:3em}.inline-edit-row fieldset label input.inline-edit-slug-input{width:75%}.quick-edit-row-post fieldset label.inline-edit-status{float:left}#bulk-titles{line-height:140%}#bulk-titles div{margin:.2em .3em}#bulk-titles div a{cursor:pointer;display:block;float:left;height:10px;margin:3px 3px 0 -2px;overflow:hidden;position:relative;text-indent:-9999px;width:10px}#show-comments{overflow:hidden}#save-action .spinner,#show-comments a,#show-comments .spinner{float:left}#lost-connection-notice .spinner{display:block;float:left;margin:0 5px 0 0}.rtl #lost-connection-notice .spinner{float:right;margin:0 0 0 5px}#titlediv{position:relative;margin-bottom:5px}#titlediv label{cursor:text}#titlediv div.inside{margin:0}#poststuff #titlewrap{border:0;padding:0}#titlediv #title{padding:3px 8px;font-size:1.7em;line-height:100%;height:1.7em;width:100%;outline:0;margin:1px 0}#titlediv #title-prompt-text,#wp-fullscreen-title-prompt-text{color:#bbb;position:absolute;font-size:1.7em;padding:11px 10px}#wp-fullscreen-save .fs-saved{color:#999;float:right;margin-top:4px}#wp-fullscreen-title-prompt-text{padding:11px}#poststuff .inside-submitbox,#side-sortables .inside-submitbox{margin:0 3px;font-size:11px}input#link_description,input#link_url{width:98%}#pending{background:0 none;border:0 none;padding:0;font-size:11px;margin-top:-1px}#edit-slug-box{line-height:24px;min-height:25px;margin-top:5px;padding-right:6px}#edit-slug-box .cancel{margin-right:10px;font-size:11px}#editable-post-name-full{display:none}#editable-post-name input{width:16em}.postarea h3 label{float:left}.submitbox .submit{text-align:left;padding:12px 10px 10px;font-size:11px}.submitbox .submitdelete{text-decoration:none;padding:1px 2px}.submitbox .submitdelete,.submitbox .submit a:hover{border-bottom-width:1px;border-bottom-style:solid}.submitbox .submit input{margin-bottom:8px;margin-right:4px;padding:6px}.inside-submitbox #post_status{margin:2px 0 2px -2px}#post-status-select{line-height:2.5em;margin-top:3px}#post-body #normal-sortables{min-height:50px}.postbox{position:relative;min-width:255px}#trackback_url{width:99%}#normal-sortables .postbox .submit{background:transparent none;border:0 none;float:right;padding:0 12px;margin:0}.category-add input[type="text"],.category-add select{width:100%;max-width:260px}.press-this #side-sortables .category-tabs li,ul.category-tabs li,#side-sortables .add-menu-item-tabs li,.wp-tab-bar li{display:inline;line-height:1.35em}.no-js .category-tabs li.hide-if-no-js{display:none}.category-tabs a,#side-sortables .add-menu-item-tabs a,.wp-tab-bar a{text-decoration:none}.category-tabs{margin:8px 0 3px}#category-adder h4{margin:10px 0}#side-sortables .add-menu-item-tabs,.wp-tab-bar{margin-bottom:3px}#normal-sortables .postbox #replyrow .submit{float:none;margin:0;padding:0 7px 5px}#side-sortables .submitbox .submit input,#side-sortables .submitbox .submit .preview,#side-sortables .submitbox .submit a.preview:hover{border:0 none}#side-sortables .inside-submitbox .insidebox,.stuffbox .insidebox{margin:11px 0}ul.category-tabs,ul.add-menu-item-tabs,ul.wp-tab-bar{margin-top:12px}ul.category-tabs li{border-style:solid;border-width:1px;position:relative}ul.add-menu-item-tabs li.tabs,.wp-tab-active{border-style:solid solid none;border-width:1px 1px 0}#post-body .add-menu-item-tabs li.tabs{border-style:solid none solid solid;border-width:1px 0 1px 1px;margin-right:-1px}ul.category-tabs li,ul.add-menu-item-tabs li,ul.wp-tab-bar li{padding:3px 5px 5px;-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-left-radius:3px;border-top-right-radius:3px}form#tags-filter{position:relative}td.post-title strong,td.plugin-title strong{display:block;margin-bottom:.2em}td.post-title p,td.plugin-title p{margin:6px 0}.wp-hidden-children .wp-hidden-child,.ui-tabs-hide{display:none}.commentlist .avatar{vertical-align:text-top}#post-body .tagsdiv #newtag{margin-right:5px;width:16em}#side-sortables input#post_password{width:94%}#side-sortables .tagsdiv #newtag{width:68%}#post-status-info{border-width:0 1px 1px;border-style:none solid solid;width:100%;-webkit-border-bottom-left-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-left-radius:3px;border-bottom-right-radius:3px}#post-status-info td{font-size:12px}.autosave-info{padding:2px 15px;text-align:right}#editorcontent #post-status-info{border:0}#post-body .wp_themeSkin .mceStatusbar a.mceResize{display:block;background:transparent url('../images/resize.gif') no-repeat scroll right bottom;width:12px;cursor:se-resize;margin:0 1px;position:relative;top:-2px}#post-body .postarea .wp_themeSkin .mceStatusbar a.mceResize{top:20px}#content-resize-handle{background:transparent url('../images/resize.gif') no-repeat scroll right bottom;width:12px;cursor:se-resize;position:absolute;right:2px;height:19px}.press-this #content-resize-handle{bottom:2px}.tmce-active #content-resize-handle{display:none}#wp-word-count{display:block;padding:2px 10px}#timestampdiv select{height:20px;line-height:14px;padding:0;vertical-align:top}#aa,#jj,#hh,#mn{padding:1px;font-size:12px}#jj,#hh,#mn{width:2em}#aa{width:3.4em}.curtime #timestamp{background-repeat:no-repeat;background-position:left center;padding:2px 0 1px 20px}#timestampdiv{padding-top:5px;line-height:23px}#timestampdiv p{margin:8px 0 6px}#timestampdiv input{border-width:1px;border-style:solid}.notification-dialog{position:fixed;top:30%;left:50%;width:450px;margin-left:-225px;background:#fff;line-height:1.5;z-index:1000005}.notification-dialog-background{position:fixed;top:0;left:0;right:0;bottom:0;background:#000;opacity:.5;filter:alpha(opacity=50);z-index:1000000}#post-lock-dialog .post-locked-message,#post-lock-dialog .post-taken-over{margin:25px}#post-lock-dialog .post-locked-message a.button{margin-right:10px}#post-lock-dialog .post-locked-avatar{float:left;margin:0 20px 20px 0}#post-lock-dialog .wp-tab-first{outline:0}#post-lock-dialog .locked-saving img{float:left;margin-right:3px}#post-lock-dialog.saving .locked-saving,#post-lock-dialog.saved .locked-saved{display:inline}#postcustomstuff thead th{padding:5px 8px 8px}#postcustom #postcustomstuff .submit{border:0 none;float:none;padding:0 8px 8px}#side-sortables #postcustom #postcustomstuff .submit{margin:0;padding:0}#side-sortables #postcustom #postcustomstuff #the-list textarea{height:85px}#side-sortables #postcustom #postcustomstuff td.left input,#side-sortables #postcustom #postcustomstuff td.left select,#side-sortables #postcustomstuff #newmetaleft a{margin:3px 3px 0}#postcustomstuff table{margin:0;width:100%;border-width:1px;border-style:solid;border-spacing:0}#postcustomstuff tr{vertical-align:top}#postcustomstuff table input,#postcustomstuff table select,#postcustomstuff table textarea{width:96%;margin:8px}#side-sortables #postcustomstuff table input,#side-sortables #postcustomstuff table select,#side-sortables #postcustomstuff table textarea{margin:3px}#postcustomstuff th.left,#postcustomstuff td.left{width:38%}#postcustomstuff .submit input{margin:0;width:auto}#postcustomstuff #newmetaleft a{display:inline-block;margin:0 8px 8px;text-decoration:none}.no-js #postcustomstuff #enternew{display:none}#post-body-content .compat-attachment-fields{margin-bottom:20px}.compat-attachment-fields th{padding-top:5px;padding-right:10px}.revisions-control-frame,.revisions-diff-frame{position:relative}.revisions-controls{padding-top:40px;height:100px;z-index:1}.revisions-controls input[type="checkbox"]{position:relative;top:-1px;vertical-align:text-bottom}.revisions.pinned .revisions-controls{position:fixed;top:0;padding-bottom:10px}.revisions-tickmarks{position:relative;margin:0 auto;height:.8em;top:7px;max-width:70%;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.revisions-tickmarks>div{position:absolute;height:100%;border-style:solid;border-width:0 1px 0 0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.revisions-tickmarks>div:first-child{border-width:0}.comparing-two-revisions .revisions-controls{height:140px}.revisions .diff-error{position:absolute;text-align:center;margin:0 auto;width:100%;display:none}.revisions.diff-error .diff-error{display:block}.revisions .loading-indicator{position:fixed;vertical-align:middle;opacity:0;width:100%;top:50%;margin-left:-90px;-webkit-transition:opacity .5s;-moz-transition:opacity .5s;-ms-transition:opacity .5s;-o-transition:opacity .5s;transition:opacity .5s;filter:alpha(opacity=0)}body.folded .revisions .loading-indicator{margin-left:-32px}.revisions .loading-indicator span.spinner{display:block;margin:0 auto;float:none}.revisions.loading .loading-indicator{opacity:1;filter:alpha(opacity=100)}.revisions .diff{-webkit-transition:opacity .5s;-moz-transition:opacity .5s;-ms-transition:opacity .5s;-o-transition:opacity .5s;transition:opacity .5s}.revisions.loading .diff{opacity:.5;filter:alpha(opacity=50)}.revisions.diff-error .diff{visibility:hidden}.revisions-meta{margin-top:15px}.revision-toggle-compare-mode{position:absolute;top:0;right:0}.comparing-two-revisions .revisions-previous,.comparing-two-revisions .revisions-next,.revisions-meta .diff-meta-to strong{display:none}.revisions-controls .author-card .date{color:#777}.revisions-controls .author-card.autosave{color:#d54e21}.revisions-controls .author-card .author-name{font-weight:bold}.comparing-two-revisions .diff-meta-to strong{display:block}.revisions-previous,.revisions-next{position:relative;z-index:1}.revisions-previous{float:left}.revisions-next{float:right}.revisions-controls .wp-slider{max-width:70%;margin:0 auto;top:-3px}.post-revisions li img,#revisions-meta-restored img{vertical-align:middle}table.diff{table-layout:fixed;width:100%;white-space:pre-wrap;word-wrap:break-word}table.diff col.content{width:auto}table.diff col.content.diffsplit{width:48%}table.diff col.diffsplit.middle{width:auto}table.diff col.ltype{width:30px}table.diff tr{background-color:transparent}table.diff td,table.diff th{padding:.5em;font-family:Consolas,Monaco,monospace}table.diff .diff-deletedline del,table.diff .diff-addedline ins{text-decoration:none}.diff-meta{-webkit-border-radius:3px;border-radius:3px;padding:5px;clear:both;min-height:32px}.diff-title strong{line-height:32px;min-width:60px;text-align:right;float:left;margin-right:5px}.revisions-controls .author-card .avatar,.revisions-controls .author-card .author-info{float:left;margin-left:6px;margin-right:6px}.revisions-controls .author-card .byline{display:block;font-size:12px}.revisions-controls .author-card .avatar{vertical-align:middle}.diff-meta input.restore-revision{float:right;margin-left:6px;margin-right:6px;margin-top:4px}.diff-meta-from{display:none}.comparing-two-revisions .diff-meta-from{display:block}.revisions-tooltip{position:absolute;bottom:105px;margin-right:0;margin-left:-69px;z-index:0;max-width:350px;min-width:130px;padding:8px 4px;display:none;opacity:0}.revisions-tooltip.flipped{margin-left:0;margin-right:-70px}.revisions.pinned .revisions-tooltip{display:none!important}.comparing-two-revisions .revisions-tooltip{bottom:145px}.revisions-tooltip-arrow{width:70px;height:15px;overflow:hidden;position:absolute;left:0;margin-left:35px;bottom:-15px}.revisions-tooltip.flipped .revisions-tooltip-arrow{margin-left:0;margin-right:35px;left:auto;right:0}.revisions-tooltip-arrow>span{content:"";position:absolute;left:20px;top:-20px;width:25px;height:25px;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);tranform:rotate(45deg)}.revisions-tooltip.flipped .revisions-tooltip-arrow>span{left:auto;right:20px}.ie8 .revisions-tooltip-arrow>span{left:15px;top:-25px;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476)"}.ie8 .revisions-tooltip.flipped .revisions-tooltip-arrow>span{right:25px}.revisions-tooltip,.revisions-tooltip-arrow>span{border-width:1px;border-style:solid}div.revisions-controls>.wp-slider>.ui-slider-handle{margin-left:-10px}.wp-slider.ui-slider{position:relative;border-width:1px;border-style:solid;border-radius:3px;text-align:left;cursor:pointer}.wp-slider .ui-slider-handle{position:absolute;z-index:2;margin-top:-3px;width:19px;height:19px;border-width:1px;border-style:solid;border-radius:50%}.wp-slider .ui-slider-handle:before{content:"";position:absolute;top:6px;left:3px;height:8px;width:13px;background:url(../images/arrows-pr.png) no-repeat -2px -47px}.wp-slider .ui-slider-handle.from-handle:before,.wp-slider .ui-slider-handle.to-handle:before{height:8px;width:7px}.wp-slider .ui-slider-handle.from-handle:before{background-position:-5px -84px;left:7px}.wp-slider .ui-slider-handle.to-handle:before{background-position:-4px -65px;left:5px}.wp-slider .ui-slider-range{position:absolute;font-size:.7em;display:block;border:0;background-color:transparent;background-image:none}.wp-slider.ui-slider-horizontal{height:.8em}.wp-slider.ui-slider-horizontal .ui-slider-handle{top:-.25em;margin-left:-.6em}.wp-slider.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.wp-slider.ui-slider-horizontal .ui-slider-range-min{left:0}.wp-slider.ui-slider-horizontal .ui-slider-range-max{right:0}#select-featured-image{padding:4px 0;overflow:hidden}#select-featured-image img{max-width:100%;height:auto;margin-bottom:10px}#select-featured-image a{float:left;clear:both}#select-featured-image .remove{display:none;margin-top:10px}.js #select-featured-image.has-featured-image .remove{display:inline-block}.no-js #select-featured-image .choose{display:none}a.post-state-format{overflow:hidden;display:inline-block;vertical-align:middle;height:16px;width:16px;margin-right:5px;background-repeat:no-repeat;text-indent:-999em}#post-formats-select{line-height:2em}label.post-format-icon{margin-left:5px;padding:2px 0 2px 21px}.post-format-icon.post-format-standard{background-position:0 0}.post-format-icon.post-format-image{background-position:0 -32px}.post-format-icon.post-format-gallery{background-position:0 -64px}.post-format-icon.post-format-audio{background-position:0 -96px}.post-format-icon.post-format-video{background-position:0 -128px}.post-format-icon.post-format-chat{background-position:0 -160px}.post-format-icon.post-format-status{background-position:0 -192px}.post-format-icon.post-format-aside{background-position:0 -224px}.post-format-icon.post-format-quote{background-position:0 -256px}.post-format-icon.post-format-link{background-position:0 -288px}.category-adder{margin-left:120px;padding:4px 0}.category-adder h4{margin:0 0 8px}#side-sortables .category-adder{margin:0}#post-body ul.add-menu-item-tabs{float:left;width:120px;text-align:right;margin:0 -120px 0 5px;padding:0}#post-body ul.add-menu-item-tabs li{padding:8px}#post-body ul.add-menu-item-tabs li.tabs{-webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-top-left-radius:3px;border-bottom-left-radius:3px}.wp-tab-panel,.categorydiv div.tabs-panel,.customlinkdiv div.tabs-panel,.posttypediv div.tabs-panel,.taxonomydiv div.tabs-panel{min-height:42px;max-height:200px;overflow:auto;padding:0 .9em;border-style:solid;border-width:1px}div.tabs-panel-active{display:block}div.tabs-panel-inactive{display:none}#front-page-warning,#front-static-pages ul,ul.export-filters,.inline-editor ul.cat-checklist ul,.categorydiv ul.categorychecklist ul,.customlinkdiv ul.categorychecklist ul,.posttypediv ul.categorychecklist ul,.taxonomydiv ul.categorychecklist ul{margin-left:18px}ul.categorychecklist li{margin:0;padding:0;line-height:19px;word-wrap:break-word}.categorydiv .tabs-panel,.customlinkdiv .tabs-panel,.posttypediv .tabs-panel,.taxonomydiv .tabs-panel{border-width:3px;border-style:solid}.form-wrap p,.form-wrap label{font-size:11px}.form-wrap label{display:block;padding:2px;font-size:12px}.form-field input,.form-field textarea{border-style:solid;border-width:1px;width:95%}p.description,.form-wrap p{margin:2px 0 5px}p.help,p.description,span.description,.form-wrap p{font-size:12px;font-style:italic;font-family:sans-serif}.form-wrap .form-field{margin:0 0 10px;padding:8px 0}.form-wrap .form-field #parent{max-width:100%}.col-wrap h3{margin:12px 0;font-size:1.1em}.col-wrap p.submit{margin-top:-10px}#poststuff .taghint{color:#aaa;margin:15px 0 -24px 12px}#poststuff .tagsdiv .howto{margin:0 0 6px 8px}.ajaxtag .newtag{position:relative}.tagsdiv .newtag{width:180px}.tagsdiv .the-tags{display:block;height:60px;margin:0 auto;overflow:auto;width:260px}#post-body-content .tagsdiv .the-tags{margin:0 5px}p.popular-tags{-webkit-border-radius:8px;border-radius:8px;border-width:1px;border-style:solid;line-height:2em;max-width:1000px;padding:8px 12px 12px;text-align:justify}p.popular-tags a{padding:0 3px}.tagcloud{width:97%;margin:0 0 40px;text-align:justify}.tagcloud h3{margin:2px 0 12px}.ac_results{padding:0;margin:0;list-style:none;position:absolute;z-index:10000;display:none;border-width:1px;border-style:solid}.ac_results li{padding:2px 5px;white-space:nowrap;text-align:left}.ac_over{cursor:pointer}.ac_match{text-decoration:underline}table.links-table{width:100%}.links-table th{font-weight:normal;text-align:left;vertical-align:top;min-width:80px;width:20%;word-wrap:break-word}.links-table th,.links-table td{padding:5px 0}.links-table td label{margin-right:8px}.links-table td input[type="text"],.links-table td textarea{width:100%}.links-table #link_rel{max-width:280px}.media-item .describe{border-collapse:collapse;width:100%;border-top-style:solid;border-top-width:1px;clear:both;cursor:default}.media-item.media-blank .describe{border:0}.media-item .describe th{vertical-align:top;text-align:left;padding:5px 10px 10px;width:140px}.media-item .describe .align th{padding-top:0}.media-item .media-item-info tr{background-color:transparent}.media-item .describe td{padding:0 8px 8px 0;vertical-align:top}.media-item thead.media-item-info td{padding:4px 10px 0}.media-item .media-item-info .A1B1{padding:0 0 0 10px}.media-item td.savesend{padding-bottom:15px}.media-item .thumbnail{max-height:128px;max-width:128px}#wpbody-content #async-upload-wrap a{display:none}.media-upload-form{margin-top:20px}.media-upload-form td label{margin-right:6px;margin-left:2px}.media-upload-form .align .field label{display:inline;padding:0 0 0 23px;margin:0 1em 0 3px;font-weight:bold}.media-upload-form tr.image-size label{margin:0 0 0 5px;font-weight:bold}.media-upload-form th.label label{font-weight:bold;margin:.5em;font-size:13px}.media-upload-form th.label label span{padding:0 5px}abbr.required{border:medium none;text-decoration:none}.media-item .describe input[type="text"],.media-item .describe textarea{width:460px}.media-item .describe p.help{margin:0;padding:0 0 0 5px}.media-item .edit-attachment,.describe-toggle-on,.describe-toggle-off{display:block;line-height:36px;float:right;margin-right:15px}.media-item .describe-toggle-off,.media-item.open .describe-toggle-on{display:none}.media-item.open .describe-toggle-off{display:block}#media-items .media-item{border-style:solid;border-width:1px;min-height:36px;position:relative;margin-top:-1px;width:100%}#media-items{width:623px}.media-new-php #media-items{margin:1em 0}#media-items:empty{border:0 none}.media-item .filename{line-height:36px;overflow:hidden;padding:0 10px}.media-item .error-div{padding-left:10px}.media-item .pinkynail{float:left;margin:2px 2px 0;max-width:40px;max-height:32px}.media-item .startopen,.media-item .startclosed{display:none}.media-item .original{position:relative;height:34px}.media-item .progress{float:right;height:22px;margin:6px 10px 0 0;width:200px;line-height:2em;padding:0;overflow:hidden;margin-bottom:2px;border:1px solid #d1d1d1;background:#f7f7f7;background-image:-webkit-gradient(linear,left bottom,left top,from(#fff),to(#f7f7f7));background-image:-webkit-linear-gradient(bottom,#fff,#f7f7f7);background-image:-moz-linear-gradient(bottom,#fff,#f7f7f7);background-image:-o-linear-gradient(bottom,#fff,#f7f7f7);background-image:linear-gradient(to top,#fff,#f7f7f7);-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 0 3px rgba(0,0,0,0.1);box-shadow:inset 0 0 3px rgba(0,0,0,0.1)}.media-item .bar{z-index:9;width:0;height:100%;margin-top:-24px;background-color:#8cc1e9;background-image:-webkit-gradient(linear,left bottom,left top,from(#72a7cf),to(#8cc1e9));background-image:-webkit-linear-gradient(bottom,#72a7cf,#8cc1e9);background-image:-moz-linear-gradient(bottom,#72a7cf,#8cc1e9);background-image:-o-linear-gradient(bottom,#72a7cf,#8cc1e9);background-image:linear-gradient(to top,#72a7cf,#8cc1e9);-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.3);box-shadow:0 0 3px rgba(0,0,0,0.3)}.media-item .progress .percent{z-index:10;position:relative;width:200px;padding:0 8px;text-shadow:0 1px 0 rgba(255,255,255,0.4);color:rgba(0,0,0,0.6)}.upload-php .fixed .column-parent{width:15%}.js .html-uploader #plupload-upload-ui{display:none}.js .html-uploader #html-upload-ui{display:block}.media-upload-form .media-item.error{margin:0;padding:0}.media-upload-form .media-item.error p,.media-item .error-div{line-height:16px;margin:5px 10px;padding:0}.media-item .error-div a.dismiss{display:block;float:right;margin:5px 4px 0 15px}.find-box{width:600px;height:300px;overflow:hidden;padding:33px 0 51px;position:absolute;z-index:1000}.find-box-head{cursor:move;font-weight:bold;height:2em;line-height:2em;padding:1px 12px;position:absolute;top:5px;width:100%}.find-box-inside{overflow:auto;padding:6px;height:100%}.find-box-search{overflow:hidden;padding:9px;position:relative}.find-box-search .spinner{float:none;left:125px;position:absolute;top:9px}#find-posts-input{float:left;width:140px;height:24px}#find-posts-search{float:left;margin:1px 4px 0 3px}#find-posts-response{margin:8px 0;padding:0 1px 6px}#find-posts-response table{width:100%}#find-posts-response .found-radio{padding:3px 0 0 8px;width:15px}.find-box-buttons{padding:8px;overflow:hidden}.find-box #resize-se{position:absolute;right:1px;bottom:1px}.ui-find-overlay{position:absolute;top:0;left:0;background-color:#000;opacity:.6;filter:alpha(opacity=60)}ul#dismissed-updates{display:none}form.upgrade{margin-top:8px}form.upgrade .hint{font-style:italic;font-size:85%;margin:-0.5em 0 2em 0}#poststuff .inside .the-tagcloud{margin:5px 0 10px;padding:8px;border-width:1px;border-style:solid;line-height:1.8em;word-spacing:3px;-webkit-border-radius:6px;border-radius:6px}.drag-drop #drag-drop-area{border:4px dashed #ddd;height:200px}.drag-drop .drag-drop-inside{margin:70px auto 0;width:250px}.drag-drop-inside p{color:#aaa;font-size:14px;margin:5px 0;display:none}.drag-drop .drag-drop-inside p{text-align:center}.drag-drop-inside p.drag-drop-info{font-size:20px}.drag-drop .drag-drop-inside p,.drag-drop-inside p.drag-drop-buttons{display:block}.drag-drop.drag-over #drag-drop-area{border-color:#83b4d8}#plupload-upload-ui{position:relative}.describe .image-editor{vertical-align:top}.imgedit-wrap{position:relative}.imgedit-settings p{margin:8px 0}.post-php .imgedit-wrap table{width:100%}.describe .imgedit-wrap table td,.wp_attachment_holder .imgedit-wrap table td{vertical-align:top;padding-top:0}.describe .imgedit-wrap table td.imgedit-settings{padding:0 5px}.wp_attachment_holder .imgedit-wrap table td.imgedit-settings{width:250px}td.imgedit-settings input{margin-top:0;vertical-align:middle}.imgedit-wait{position:absolute;top:0;background:#fff url(../images/wpspin_light.gif) no-repeat scroll 22px 10px;background-size:16px 16px;opacity:.7;filter:alpha(opacity=70);width:100%;height:500px;display:none}.spinner{background:url(../images/wpspin_light.gif) no-repeat;background-size:16px 16px;display:none;float:right;opacity:.7;filter:alpha(opacity=70);width:16px;height:16px;margin:5px 5px 0}.no-float{float:none}.media-disabled,.imgedit-settings .disabled{color:grey}.wp_attachment_image,.A1B1{overflow:hidden}.wp_attachment_image .button,.A1B1 .button{float:left}.no-js .wp_attachment_image .button{display:none}.wp_attachment_image .spinner,.A1B1 .spinner{float:left;padding:0 4px 4px;vertical-align:bottom}.imgedit-menu{margin:0 0 12px;min-width:300px}.imgedit-menu div{float:left;width:32px;height:32px}.imgedit-crop-wrap{position:relative}.imgedit-crop{background:transparent url('../images/imgedit-icons.png') no-repeat scroll -9px -31px;margin:0 8px 0 0}.imgedit-crop.disabled:hover{background-position:-9px -31px}.imgedit-crop:hover{background-position:-9px -1px}.imgedit-rleft{background:transparent url('../images/imgedit-icons.png') no-repeat scroll -46px -31px;margin:0 3px}.imgedit-rleft.disabled:hover{background-position:-46px -31px}.imgedit-rleft:hover{background-position:-46px -1px}.imgedit-rright{background:transparent url('../images/imgedit-icons.png') no-repeat scroll -77px -31px;margin:0 8px 0 3px}.imgedit-rright.disabled:hover{background-position:-77px -31px}.imgedit-rright:hover{background-position:-77px -1px}.imgedit-flipv{background:transparent url('../images/imgedit-icons.png') no-repeat scroll -115px -31px;margin:0 3px}.imgedit-flipv.disabled:hover{background-position:-115px -31px}.imgedit-flipv:hover{background-position:-115px -1px}.imgedit-fliph{background:transparent url('../images/imgedit-icons.png') no-repeat scroll -147px -31px;margin:0 8px 0 3px}.imgedit-fliph.disabled:hover{background-position:-147px -31px}.imgedit-fliph:hover{background-position:-147px -1px}.imgedit-undo{background:transparent url('../images/imgedit-icons.png') no-repeat scroll -184px -31px;margin:0 3px}.imgedit-undo.disabled:hover{background-position:-184px -31px}.imgedit-undo:hover{background-position:-184px -1px}.imgedit-redo{background:transparent url('../images/imgedit-icons.png') no-repeat scroll -215px -31px;margin:0 8px 0 3px}.imgedit-redo.disabled:hover{background-position:-215px -31px}.imgedit-redo:hover{background-position:-215px -1px}.imgedit-applyto img{margin:0 8px 0 0}.imgedit-group-top{margin:5px 0}.imgedit-applyto .imgedit-label{padding:2px 0 0;display:block}.imgedit-help{display:none;font-style:italic;margin-bottom:8px}a.imgedit-help-toggle{text-decoration:none}.form-table td.imgedit-response{padding:0}.imgedit-submit{margin:8px 0}.imgedit-submit-btn{margin-left:20px}.imgedit-wrap .nowrap{white-space:nowrap}span.imgedit-scale-warn{color:red;font-size:20px;font-style:normal;visibility:hidden;vertical-align:middle}.imgedit-group{border-width:1px;border-style:solid;-webkit-border-radius:3px;border-radius:3px;margin-bottom:8px;padding:2px 10px}.form-table{border-collapse:collapse;margin-top:.5em;width:100%;margin-bottom:-8px;clear:both}.form-table td{margin-bottom:9px;padding:8px 10px;line-height:20px;font-size:12px}.form-table th,.form-wrap label{font-weight:normal;text-shadow:#fff 0 1px 0}.form-table th{vertical-align:top;text-align:left;padding:10px;width:200px}.form-table th.th-full{width:auto}.form-table div.color-option{display:block;clear:both;margin-top:12px}.form-table input.tog{margin-top:2px;margin-right:2px;float:left}.form-table td p{margin-top:4px}.form-table table.color-palette{vertical-align:bottom;float:left;margin:-12px 3px 11px}.form-table .color-palette td{border-width:1px 1px 0;border-style:solid solid none;height:10px;line-height:20px;width:10px}.commentlist li{padding:1em 1em .2em;margin:0;border-bottom-width:1px;border-bottom-style:solid}.commentlist li li{border-bottom:0;padding:0}.commentlist p{padding:0;margin:0 0 .8em}#replyrow input{border-width:1px;border-style:solid}#replyrow td{padding:2px}#replysubmit{margin:0;padding:0 5px 3px;text-align:center}#replysubmit .spinner{padding:2px 0 0;vertical-align:top;float:right}#replysubmit .button{margin-right:5px}#replysubmit .error{color:red;line-height:21px;text-align:center}#replyrow h5{margin:.2em 0 0;padding:0 5px;line-height:1.4em;font-size:1em}#edithead .inside{float:left;padding:3px 0 2px 5px;margin:0;text-align:center}#edithead .inside input{width:180px}#edithead label{padding:2px 0}#replycontainer{padding:5px}#replycontent{height:120px;-webkit-box-shadow:none;box-shadow:none}.comment-php .wp-editor-area{height:200px}.comment-ays{margin-bottom:0;border-style:solid;border-width:1px}.comment-ays th{border-right-style:solid;border-right-width:1px}.trash-undo-inside,.spam-undo-inside{margin:1px 8px 1px 0;line-height:16px}.spam-undo-inside .avatar,.trash-undo-inside .avatar{height:20px;width:20px;margin-right:8px;vertical-align:middle}.stuffbox .editcomment{clear:none}#comment-status-radio p{margin:3px 0 5px}#comment-status-radio input{margin:2px 3px 5px 0;vertical-align:middle}#comment-status-radio label{padding:5px 0}.commentlist .avatar{vertical-align:text-top}.theme-install-php .tablenav{height:auto}.theme-install-php .spinner{margin-top:9px}h3.available-themes{margin:.3em 0 1em;float:left}.available-theme{display:inline-block;margin-right:10px;overflow:hidden;padding:20px 20px 20px 0;vertical-align:top;width:300px}.available-theme .screenshot{width:300px;height:225px;display:block;border-width:1px;border-style:solid;margin-bottom:10px;overflow:hidden}.available-theme img{width:300px}.available-theme h3{margin:15px 0 0}.available-theme .theme-author{line-height:18px}.available-theme .action-links{margin-top:10px;overflow:hidden}.available-theme a.screenshot:focus{border-color:#777}#current-theme .theme-info li,.theme-options li,.available-theme .action-links li{float:left;padding-right:10px;margin-right:10px;border-right:1px solid #dfdfdf}.available-theme .action-links li{padding-right:8px;margin-right:8px}.ie8 .available-theme .action-links li{padding-right:7px;margin-right:7px}#current-theme .theme-info li:last-child,.theme-options li:last-child,.available-theme .action-links li:last-child{padding-right:0;margin-right:0;border-right:0}.available-theme .action-links .delete-theme{float:right;margin-left:8px;margin-right:0}.available-theme .action-links .delete-theme a{color:red;padding:2px}.available-theme .action-links .delete-theme a:hover{background:red;color:#fff;text-decoration:none}.available-theme .action-links p{float:left}#current-theme{margin:20px 0 10px;padding:0 0 20px;border-bottom-width:1px;border-bottom-style:solid;overflow:hidden}#current-theme.has-screenshot{padding-left:330px}#current-theme h3{margin:0;font-size:12px;font-weight:normal;color:#999}#current-theme h4{margin:3px 0 16px;font-size:20px}#current-theme h4 span{margin-left:20px;font-size:12px;font-weight:normal}#current-theme a{border-bottom:0}#current-theme .theme-info{margin:1em 0;overflow:hidden}#current-theme .theme-description{margin-top:5px;max-width:600px;line-height:1.6em}#current-theme img{float:left;width:300px;margin-left:-330px;border-width:1px;border-style:solid}.theme-options{overflow:hidden;font-size:14px;padding-bottom:10px}.theme-options .load-customize{margin-right:30px;float:left}.theme-options span{float:left;margin-right:10px;text-transform:uppercase;font-size:11px;line-height:18px;color:#999}.theme-options ul{float:left;margin:0}@media only screen and (max-width:1200px){.available-theme,.available-theme .screenshot,#current-theme img{width:240px}.available-theme .screenshot{height:180px}.available-theme img{width:100%}#current-theme.has-screenshot{padding-left:270px}#current-theme img{margin-left:-270px}}#post-body ul.add-menu-item-tabs li.tabs a,#TB_window #TB_title a.tb-theme-preview-link,#TB_window #TB_title a.tb-theme-preview-link:visited{font-weight:bold;text-decoration:none}#TB_window #TB_title{background-color:#222;color:#cfcfcf}#broken-themes{text-align:left;width:50%;border-spacing:3px;padding:3px}.theme-install-php h4{margin:2.5em 0 8px}.appearance_page_custom-header #headimg{border:1px solid #dfdfdf;overflow:hidden;width:100%}.appearance_page_custom-header #upload-form p label{font-size:12px}.appearance_page_custom-header .available-headers .default-header{float:left;margin:0 20px 20px 0}.appearance_page_custom-header .random-header{clear:both;margin:0 20px 20px 0;vertical-align:middle}.appearance_page_custom-header .available-headers label input,.appearance_page_custom-header .random-header label input{margin-right:10px}.appearance_page_custom-header .available-headers label img{vertical-align:middle}div#custom-background-image{min-height:100px;border:1px solid #dfdfdf}div#custom-background-image img{max-width:400px;max-height:300px}.nav-tab{border-style:solid;border-width:1px 1px 0;color:#aaa;text-shadow:#fff 0 1px 0;font-size:12px;line-height:16px;display:inline-block;padding:4px 14px 6px;text-decoration:none;margin:0 6px -1px 0;-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-left-radius:3px;border-top-right-radius:3px}.nav-tab-active{border-width:1px;color:#464646}h2.nav-tab-wrapper,h3.nav-tab-wrapper{border-bottom-width:1px;border-bottom-style:solid;padding-bottom:0}h2 .nav-tab{padding:4px 10px 6px;font-weight:200;font-size:20px;line-height:24px}#dashboard_right_now .versions .b,#post-status-display,#post-visibility-display,#adminmenu .wp-submenu li.current,#adminmenu .wp-submenu li.current a,#adminmenu .wp-submenu li.current a:hover,.media-item .percent,.plugins .name,#pass-strength-result.strong,#pass-strength-result.short,#ed_reply_toolbar #ed_reply_strong,.item-controls .item-order a,.feature-filter .feature-name{font-weight:bold}.plugins p{margin:0 4px;padding:0}.plugins .desc p{margin:0 0 8px}.plugins td.desc{line-height:1.5em}.plugins .desc ul,.plugins .desc ol{margin:0 0 0 2em}.plugins .desc ul{list-style-type:disc}.plugins .row-actions-visible{padding:0}.plugins tbody th.check-column{padding:7px 0}.plugins .inactive td,.plugins .inactive th,.plugins .active td,.plugins .active th{border-top-style:solid;border-top-width:1px;padding:5px 7px 0}.plugins .update th,.plugins .update td{border-bottom:0}.plugin-update-tr td{border-top:0}#wpbody-content .plugins .plugin-title,#wpbody-content .plugins .theme-title{padding-right:12px;white-space:nowrap}.plugins .second,.plugins .row-actions-visible{padding:0 0 5px}.plugins .update .second,.plugins .update .row-actions-visible{padding-bottom:0}.plugins-php .widefat tfoot th,.plugins-php .widefat tfoot td{border-top-style:solid;border-top-width:1px}.plugin-update-tr .update-message{margin:5px;padding:3px 5px}.plugin-install-php h4{margin:2.5em 0 8px}#profile-page .form-table textarea{width:500px;margin-bottom:6px}#profile-page .form-table #rich_editing{margin-right:5px}#your-profile legend{font-size:22px}#your-profile #rich_editing{border:0}#display_name{width:15em}#createuser .form-field input{width:25em}.pressthis{margin:20px 0}.pressthis a,.pressthis a:hover,.pressthis a:focus,.pressthis a:active{display:inline-block;position:relative;cursor:move;color:#333;background:#e6e6e6;background-image:-webkit-gradient(linear,left bottom,left top,color-stop(7%,#e6e6e6),color-stop(77%,#d8d8d8));background-image:-webkit-linear-gradient(bottom,#e6e6e6 7%,#d8d8d8 77%);background-image:-moz-linear-gradient(bottom,#e6e6e6 7%,#d8d8d8 77%);background-image:-o-linear-gradient(bottom,#e6e6e6 7%,#d8d8d8 77%);background-image:linear-gradient(to top,#e6e6e6 7%,#d8d8d8 77%);-webkit-border-radius:5px;border-radius:5px;border:1px solid #b4b4b4;font-style:normal;line-height:16px;font-size:14px;text-decoration:none;text-shadow:0 1px 0 #fff}.pressthis a:active{outline:0}.pressthis a:hover:after{-webkit-transform:skew(20deg) rotate(9deg);-moz-transform:skew(20deg) rotate(9deg);transform:skew(20deg) rotate(9deg);-webkit-box-shadow:0 10px 8px rgba(0,0,0,0.7);box-shadow:0 10px 8px rgba(0,0,0,0.7)}.pressthis a span{background:url(../images/press-this.png?v=20120502) no-repeat 0 5px;background-size:24px 20px;padding:8px 11px 8px 27px;margin:0 5px;display:inline-block}.pressthis a:after{content:'';width:70%;height:55%;z-index:-1;position:absolute;right:10px;bottom:9px;background:transparent;-webkit-transform:skew(20deg) rotate(6deg);-moz-transform:skew(20deg) rotate(6deg);transform:skew(20deg) rotate(6deg);-webkit-box-shadow:0 10px 8px rgba(0,0,0,0.6);box-shadow:0 10px 8px rgba(0,0,0,0.6)}#utc-time,#local-time{padding-left:25px;font-style:italic;font-family:sans-serif}.defaultavatarpicker .avatar{margin:2px 0;vertical-align:middle}.options-general-php .spinner{float:none;margin:-3px 3px}#wpfooter{position:absolute;bottom:0;left:0;right:0;padding:10px 0;margin-right:20px;border-top-width:1px;border-top-style:solid}#wpfooter p{margin:0;line-height:20px}#wpfooter a{text-decoration:none}#wpfooter a:hover{text-decoration:underline}.about-wrap{position:relative;margin:25px 40px 0 20px;max-width:1050px;font-size:15px}.about-wrap div.updated,.about-wrap div.error{display:none!important}.about-wrap p{line-height:1.6em}.about-wrap h1{margin:.2em 200px 0 0;line-height:1.2em;font-size:2.8em;font-weight:200}.about-text,.about-description,.about-wrap li.wp-person a.web{font-family:"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;font-weight:normal;line-height:1.6em;font-size:20px}.about-description{margin-top:1.4em}.about-text{margin:1em 200px 1.4em 0;min-height:60px;font-size:24px}.about-wrap h3{font-size:24px;margin-bottom:1em;padding-top:20px}.about-wrap .feature-section{padding-bottom:20px}.about-wrap .feature-section h4{margin-bottom:.6em}.about-wrap .feature-section p{margin-top:.6em}.about-wrap code{font-size:14px}.about-wrap .point-releases{margin-top:5px}.about-wrap .changelog.point-releases h3{padding-top:35px}.about-wrap .changelog.point-releases h3:first-child{padding-top:7px}.wp-badge{padding-top:142px;height:50px;width:173px;font-weight:bold;font-size:14px;text-align:center;margin:0 -5px;background:url('../images/wp-badge.png?ver=20111120') no-repeat}.about-wrap .wp-badge{position:absolute;top:0;right:0}.about-wrap h2.nav-tab-wrapper{padding-left:6px}.about-wrap h2 .nav-tab{padding:4px 10px 6px;margin:0 3px -1px 0;font-size:18px;vertical-align:top}.about-wrap h2 .nav-tab-active{font-weight:bold;padding-top:3px}.about-wrap .feature-section img,.about-wrap .feature-section .video{border:0;margin:0 1.94% 10px 0;-webkit-border-radius:3px;border-radius:3px}.about-wrap .feature-section .video video{max-width:100%}.about-wrap .feature-section.three-col img{margin:.5em 0 .5em 5px;max-width:100%;float:none}.ie8 .about-wrap .feature-section.three-col img{margin-left:0}.about-wrap .feature-section.images-stagger-right img,.about-wrap .feature-section.images-stagger-right .video{float:right;margin:0 5px 12px 2em}.about-wrap .feature-section.images-stagger-left img{float:left;margin:0 2em 12px 5px}.about-wrap .feature-section .image-100{margin:0 0 2em 0;width:100%}.about-wrap .feature-section .image-66{width:65%}.about-wrap .feature-section .image-66.video{max-width:600px}.about-wrap .feature-section .image-50{max-width:50%}.about-wrap .feature-section img.image-30{max-width:31.2381%}.ie8 .about-wrap .feature-section img{border-width:1px;border-style:solid}.about-wrap .images-stagger-right img.image-30:nth-child(2){margin-left:1em}.about-wrap .feature-section.col{margin-bottom:0}.about-wrap .feature-section.col h4{margin:0 0 .6em 0}.about-wrap .feature-section.col .last-feature{margin-right:0}.about-wrap .feature-section.two-col div{width:47%;margin-right:4.999999999%;float:left}.about-wrap .feature-section.three-col div{width:30%;margin-right:4.999999999%;float:left}.about-wrap .three-col-images{text-align:center}.about-wrap .three-col-images img{margin:0 0 10px}.about-wrap .three-col-images .last-feature{float:right}.about-wrap .three-col-images .first-feature{float:left}.about-wrap .changelog .feature-section{overflow:hidden}.about-wrap .changelog li{list-style-type:disc;margin-left:3em}@media only screen and (max-width:900px){.about-wrap .feature-section.images-stagger-left img,.about-wrap .feature-section.images-stagger-right img,.about-wrap .feature-section.images-stagger-right .video{clear:both}.about-wrap .feature-section .video.image-66{float:none;width:98%;max-width:98%}.about-wrap .feature-section.images-stagger-right .video.image-66{margin-left:3px}}@media only screen and (max-width:768px){.about-wrap .feature-section .image-66{float:none;width:98%;max-width:98%}.about-wrap .feature-section.images-stagger-right .image-66{margin-left:3px}.about-wrap .feature-section.images-stagger-left .image-66{margin-right:3px}}.about-wrap .return-to-dashboard{margin:30px 0 0 -5px;font-size:14px;font-weight:bold}.about-wrap .return-to-dashboard a{text-decoration:none;padding:0 5px}.about-wrap h4.wp-people-group{margin-top:2.6em;font-size:16px}.about-wrap ul.wp-people-group{overflow:hidden;padding:0 5px;margin:0 -15px 0 -5px}.about-wrap ul.compact{margin-bottom:0}.about-wrap li.wp-person{float:left;margin-right:10px}.about-wrap li.wp-person img.gravatar{float:left;margin:0 10px 10px 0;padding:2px;width:60px;height:60px}.about-wrap ul.compact li.wp-person img.gravatar{width:30px;height:30px}.about-wrap li.wp-person{height:70px;width:280px;padding-bottom:15px}.about-wrap ul.compact li.wp-person{height:auto;width:180px;padding-bottom:0;margin-bottom:0}.about-wrap #wp-people-group-validators+p.wp-credits-list{margin-top:0}.about-wrap li.wp-person a.web{display:block;margin:6px 0 2px;font-size:16px;text-decoration:none}.about-wrap p.wp-credits-list a{white-space:nowrap}.freedoms-php .about-wrap ol{margin:40px 60px}.freedoms-php .about-wrap ol li{list-style-type:decimal;font-weight:bold}.freedoms-php .about-wrap ol p{font-weight:normal;margin:.6em 0}body.full-overlay-active{overflow:hidden}.wp-full-overlay{background:#fff;z-index:500000;position:fixed;overflow:visible;top:0;bottom:0;left:0;right:0;height:100%;min-width:0}.wp-full-overlay-sidebar{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:fixed;width:300px;height:100%;top:0;bottom:0;left:0;padding:0;margin:0;z-index:10;overflow:auto;background:#f5f5f5;border-right:1px solid rgba(0,0,0,0.2)}.wp-full-overlay.collapsed .wp-full-overlay-sidebar{overflow:visible}.wp-full-overlay.collapsed,.wp-full-overlay.expanded .wp-full-overlay-sidebar{margin-left:0!important}.wp-full-overlay.expanded{margin-left:300px}.wp-full-overlay.collapsed .wp-full-overlay-sidebar{margin-left:-300px}.wp-full-overlay-sidebar:after{content:'';display:block;position:absolute;top:0;bottom:0;right:0;width:3px;box-shadow:-5px 0 4px -4px rgba(0,0,0,0.1) inset;z-index:1000}.wp-full-overlay-main{position:absolute;left:0;right:0;top:0;bottom:0;height:100%}.wp-full-overlay-sidebar .wp-full-overlay-header{position:absolute;left:0;right:0;height:45px;padding:0 20px;line-height:45px;z-index:10;margin:0}.wp-full-overlay-sidebar .wp-full-overlay-header{border-top:0;border-bottom:1px solid #fff;box-shadow:inset 0 -1px 0 0 #dfdfdf}.wp-full-overlay-sidebar .wp-full-overlay-footer{bottom:0;border-bottom:0;border-top:1px solid #dfdfdf;box-shadow:inset 0 1px 0 0 #fff}.wp-full-overlay-sidebar .wp-full-overlay-sidebar-content{position:absolute;top:45px;bottom:45px;left:0;right:0;overflow:auto}.wp-full-overlay-sidebar-content .accordion-section:first-child{border-top:1px solid #fff}.wp-full-overlay .close-full-overlay{text-decoration:none}.wp-full-overlay a.collapse-sidebar{position:absolute;bottom:12px;left:0;z-index:50;display:block;width:19px;height:19px;margin-left:15px;padding:0;border-radius:50%;text-decoration:none}.wp-full-overlay.collapsed .collapse-sidebar{position:absolute;left:100%}.wp-full-overlay .collapse-sidebar-arrow{position:absolute;margin-top:2px;margin-left:2px;display:block;width:15px;height:15px;background:transparent url('../images/arrows.png') no-repeat -1px -73px}.wp-full-overlay.collapsed .collapse-sidebar-arrow{background-position:-1px -109px}.wp-full-overlay .collapse-sidebar-label{position:absolute;left:100%;color:#808080;line-height:20px;margin-left:10px}.wp-full-overlay.collapsed .collapse-sidebar-label{display:none}.wp-full-overlay .collapse-sidebar:hover .collapse-sidebar-label{color:#666}.wp-full-overlay,.wp-full-overlay-sidebar,.wp-full-overlay .collapse-sidebar,.wp-full-overlay-main{-webkit-transition-property:left,right,top,bottom,width,margin;-moz-transition-property:left,right,top,bottom,width,margin;-ms-transition-property:left,right,top,bottom,width,margin;-o-transition-property:left,right,top,bottom,width,margin;transition-property:left,right,top,bottom,width,margin;-webkit-transition-duration:.2s;-moz-transition-duration:.2s;-ms-transition-duration:.2s;-o-transition-duration:.2s;transition-duration:.2s}.no-customize-support .hide-if-no-customize,.customize-support .hide-if-customize,.no-customize-support.wp-core-ui .hide-if-no-customize,.no-customize-support .wp-core-ui .hide-if-no-customize,.customize-support.wp-core-ui .hide-if-customize,.customize-support .wp-core-ui .hide-if-customize{display:none}#customize-container{display:none;background:#fff;z-index:500000;position:fixed;overflow:visible;top:0;bottom:0;left:0;right:0;height:100%}.customize-active #customize-container{display:block}.customize-loading #customize-container iframe{opacity:0}.customize-loading #customize-container{background:#fff url("../images/wpspin_light.gif") no-repeat fixed center center;background-size:16px 16px}#customize-container iframe,#theme-installer iframe{height:100%;width:100%;z-index:20;-webkit-transition:opacity .3s;-moz-transition:opacity .3s;-ms-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}#customize-container .collapse-sidebar{bottom:16px}#theme-installer{display:none}#theme-installer.single-theme{display:block}.install-theme-info{display:none;padding:10px 20px 20px}.single-theme .install-theme-info{padding-top:15px}#theme-installer .install-theme-info{display:block}.install-theme-info .theme-install{float:right;margin-top:18px}.install-theme-info .theme-name{font-size:16px;line-height:24px;margin-bottom:0}.install-theme-info .theme-screenshot{margin-top:15px;width:258px;border:1px solid #ccc}.install-theme-info .theme-details{overflow:hidden}.theme-details .theme-version{margin:15px 0;float:left}.theme-details .star-holder{margin:14px 0;float:right}.theme-details .theme-description{float:left;color:#777;line-height:20px}#excerpt,.attachmentlinks{margin:0;height:4em;width:98%}#template div{margin-right:190px}p.pagenav{margin:0;display:inline}.pagenav span{font-weight:bold;margin:0 6px}.row-title{font-size:13px!important;font-weight:bold}.column-author img,.column-username img{float:left;margin-right:10px;margin-top:1px}.row-actions{visibility:hidden;padding:2px 0 0}.mobile .row-actions{visibility:visible}tr:hover .row-actions,div.comment-item:hover .row-actions{visibility:visible}.row-actions-visible{padding:2px 0 0}.form-table .pre{padding:8px;margin:0}table.form-table td .updated{font-size:13px}.tagchecklist{margin-left:14px;font-size:12px;overflow:auto}.tagchecklist strong{margin-left:-8px;position:absolute}.tagchecklist span{margin-right:25px;display:block;float:left;font-size:11px;line-height:1.8em;white-space:nowrap;cursor:default}.tagchecklist span a{margin:6px 0 0 -9px;cursor:pointer;width:10px;height:10px;display:block;float:left;text-indent:-9999px;overflow:hidden;position:absolute}#poststuff h2{margin-top:20px;font-size:1.5em;margin-bottom:15px;padding:0 0 3px;clear:left}#poststuff h3,.metabox-holder h3{font-size:15px;font-weight:normal;padding:7px 10px;margin:0;line-height:1}#poststuff .inside{margin:6px 0 8px}#poststuff .inside #parent_id,#poststuff .inside #page_template{max-width:100%}.inline-edit-row #post_parent,.inline-edit-row select[name="page_template"]{max-width:80%}.ie8 #poststuff .inside #parent_id,.ie8 #poststuff .inside #page_template,.ie8 .inline-edit-row #post_parent,.ie8 .inline-edit-row select[name="page_template"]{width:250px}#post-visibility-select{line-height:1.5em;margin-top:3px}#poststuff #submitdiv .inside{margin:0;padding:0}.edit-form-section{margin-bottom:20px}#templateside ul li a{text-decoration:none}.tool-box .title{margin:8px 0;font-size:18px;font-weight:normal;line-height:24px}#sidemenu{margin:-30px 15px 0 315px;list-style:none;position:relative;float:right;padding-left:10px;font-size:12px}#sidemenu a{padding:0 7px;display:block;float:left;line-height:28px;border-top-width:1px;border-top-style:solid;border-bottom-width:1px;border-bottom-style:solid}#sidemenu li{display:inline;line-height:200%;list-style:none;text-align:center;white-space:nowrap;margin:0;padding:0}#sidemenu a.current{font-weight:normal;padding-left:6px;padding-right:6px;-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-left-radius:3px;border-top-right-radius:3px;border-width:1px;border-style:solid}#sidemenu li a .count-0{display:none}.plugin-install #description,.plugin-install-network #description{width:60%}table .vers,table .column-visible,table .column-rating{text-align:left}.error-message{color:red;font-weight:bold}body.iframe{height:98%}td.media-icon{text-align:center;width:80px;padding-top:8px;padding-bottom:8px}td.media-icon img{max-width:80px;max-height:60px}#howto{font-size:11px;margin:0 5px;display:block}.importers td{padding-right:14px}.importers{font-size:16px;width:auto}#namediv table{width:100%}#namediv td.first{width:10px;white-space:nowrap}#namediv input{width:98%}#namediv p{margin:10px 0}#submitdiv h3{margin-bottom:0!important}.zerosize{height:0;width:0;margin:0;border:0;padding:0;overflow:hidden;position:absolute}br.clear{height:2px;line-height:2px}.checkbox{border:0;margin:0;padding:0}fieldset{border:0;padding:0;margin:0}.post-categories{display:inline;margin:0;padding:0}.post-categories li{display:inline}.edit-box{display:none}h3:hover .edit-box{display:inline}#dashboard-widgets form .input-text-wrap input{width:100%}#dashboard-widgets form .textarea-wrap textarea{width:100%}#dashboard-widgets .postbox form .submit{float:none;margin:.5em 0 0;padding:0;border:0}#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish{min-width:0}#dashboard-widgets a{text-decoration:none}#dashboard-widgets h3 a{text-decoration:underline}#dashboard-widgets h3 .postbox-title-action{position:absolute;right:10px;padding:0;top:5px}.js #dashboard-widgets h3 .postbox-title-action{right:30px}#dashboard-widgets h4{font-weight:normal;font-size:13px;margin:0 0 .2em;padding:0}#dashboard_right_now p.sub,#dashboard_right_now .table,#dashboard_right_now .versions{margin:-12px}#dashboard_right_now .inside{font-size:12px;padding-top:20px}#dashboard_right_now p.sub{padding:5px 0 15px;color:#8f8f8f;font-size:14px;position:absolute;top:-17px;left:15px}#dashboard_right_now .table{margin:0;padding:0;position:relative}#dashboard_right_now .table_content{float:left;border-top-width:1px;border-top-style:solid;width:45%}#dashboard_right_now .table_discussion{float:right;border-top-width:1px;border-top-style:solid;width:45%}#dashboard_right_now table td{padding:3px 0;white-space:nowrap}#dashboard_right_now table tr.first td{border-top:0}#dashboard_right_now td.b{padding-right:6px;text-align:right;font-size:14px;width:1%}#dashboard_right_now td.b a{font-size:18px}#dashboard_right_now td.b a:hover{color:#d54e21}#dashboard_right_now .t{font-size:12px;padding-right:12px;padding-top:6px;color:#777}#dashboard_right_now .t a{white-space:nowrap}#dashboard_right_now .spam{color:red}#dashboard_right_now .waiting{color:#e66f00}#dashboard_right_now .approved{color:green}#dashboard_right_now .versions{padding:6px 10px 12px;clear:both}#dashboard_right_now a.button{float:right;clear:right;position:relative;top:-5px}#dashboard_recent_comments h3{margin-bottom:0}#dashboard_recent_comments .inside{margin-top:0}#dashboard_recent_comments .comment-meta .approve{font-style:italic;font-family:sans-serif;font-size:10px}#dashboard_recent_comments .subsubsub{float:none;white-space:normal}#the-comment-list{position:relative}#the-comment-list .comment-item{padding:1em 10px;border-top:1px solid}#the-comment-list .pingback{padding-left:9px!important}#the-comment-list .comment-item,#the-comment-list #replyrow{margin:0 -10px}#the-comment-list .comment-item:first-child{border-top:0}#the-comment-list .comment-item .avatar{float:left;margin:0 10px 5px 0}#the-comment-list .comment-item h4{line-height:1.7em;margin-top:-0.4em;color:#777}#the-comment-list .comment-item h4 cite{font-style:normal;font-weight:normal}#the-comment-list .comment-item blockquote,#the-comment-list .comment-item blockquote p{margin:0;padding:0;display:inline}#dashboard_recent_comments #the-comment-list .trackback blockquote,#dashboard_recent_comments #the-comment-list .pingback blockquote{display:block}#the-comment-list .comment-item p.row-actions{margin:3px 0 0;padding:0;font-size:12px}.no-js #dashboard_quick_press{display:none}#dashboard_quick_press .easy-blogging{padding:0 8px;text-align:left}#dashboard_quick_press .input-text-wrap{position:relative}#dashboard_quick_press .prompt{color:#bbb;position:absolute}#dashboard_quick_press div.updated{padding:0 5px}#title-wrap label,#tags-input-wrap label{cursor:text}#title-wrap #title{padding:2px 6px;font-size:1.3em;line-height:100%;outline:0}#tags-input-wrap #tags-input{outline:0}#title-wrap #title-prompt-text{font-size:1.3em;padding:5px 8px}#tags-input-wrap #tags-input-prompt-text{font-size:1em;padding:4px 8px}#dashboard_quick_press .input-text-wrap,#dashboard_quick_press .textarea-wrap{margin:0 0 1em 0}#dashboard_quick_press .wp-media-buttons{margin:0 0 .2em 1px;padding:0}#dashboard_quick_press .wp-media-buttons a{color:#777}#dashboard-widgets #dashboard_quick_press form p.submit input{float:left}#dashboard-widgets #dashboard_quick_press form p.submit #save-post{margin:0 .7em 0 1px}#dashboard-widgets #dashboard_quick_press form p.submit #publish{float:right}#dashboard-widgets #dashboard_quick_press form p.submit .spinner{vertical-align:middle;margin:4px 6px 0 0}#dashboard_recent_drafts ul,#dashboard_recent_drafts p{margin:0;padding:0;word-wrap:break-word}#dashboard_recent_drafts ul{list-style:none}#dashboard_recent_drafts ul li{margin-bottom:1em}#dashboard_recent_drafts h4{line-height:1.7em;word-wrap:break-word}#dashboard_recent_drafts h4 abbr{font-weight:normal;font-family:sans-serif;font-size:12px;color:#999;margin-left:3px}.rss-widget ul{margin:0;padding:0;list-style:none}a.rsswidget{font-size:13px;line-height:1.7em}.rss-widget ul li{line-height:1.5em;margin-bottom:12px}.rss-widget span.rss-date{color:#999;font-size:12px;margin-left:3px}.rss-widget cite{display:block;text-align:right;margin:0 0 1em;padding:0}.rss-widget cite:before{content:'\2014'}#dashboard_plugins h4{line-height:1.7em}#dashboard_plugins h5{font-weight:normal;font-size:13px;margin:0;display:inline;line-height:1.4em}#dashboard_plugins h5 a{line-height:1.4em}#dashboard_plugins .inside span{font-size:12px;padding-left:5px}#dashboard_plugins p{margin:.3em 0 1.4em;line-height:1.4em}.dashboard-comment-wrap{overflow:hidden;word-wrap:break-word}#dashboard_browser_nag a.update-browser-link{font-size:1.2em;font-weight:bold}#dashboard_browser_nag a{text-decoration:underline}#dashboard_browser_nag p.browser-update-nag.has-browser-icon{padding-right:125px}#dashboard_browser_nag .browser-icon{margin-top:-35px}#dashboard_browser_nag.postbox.browser-insecure{background-color:#ac1b1b;border-color:#ac1b1b}#dashboard_browser_nag.postbox{background-color:#e29808;background-image:none;border-color:#edc048;color:#fff;-webkit-box-shadow:none;box-shadow:none}#dashboard_browser_nag.postbox.browser-insecure h3{border-bottom-color:#cd5a5a;color:#fff}#dashboard_browser_nag.postbox h3{border-bottom-color:#f6e2ac;text-shadow:none;background:transparent none;color:#fff;-webkit-box-shadow:none;box-shadow:none}#dashboard_browser_nag a{color:#fff}#dashboard_browser_nag.browser-insecure a.browse-happy-link,#dashboard_browser_nag.browser-insecure a.update-browser-link{text-shadow:#871b15 0 1px 0}#dashboard_browser_nag a.browse-happy-link,#dashboard_browser_nag a.update-browser-link{text-shadow:#d29a04 0 1px 0}.login *{margin:0;padding:0}.login form{margin-left:8px;padding:26px 24px 46px;font-weight:normal;background:#fff;border:1px solid #e5e5e5;-webkit-box-shadow:rgba(200,200,200,0.7) 0 4px 10px -1px;box-shadow:rgba(200,200,200,0.7) 0 4px 10px -1px}.login form .forgetmenot{font-weight:normal;float:left;margin-bottom:0}.login .button-primary{float:right}#login form p{margin-bottom:0}#login form p.submit{padding:0}.login label{color:#777;font-size:14px}.login form .forgetmenot label{font-size:12px;line-height:19px}.login h1 a{background-image:url('../images/wordpress-logo.png?ver=20120216');background-size:274px 63px;background-position:top center;background-repeat:no-repeat;width:326px;height:67px;text-indent:-9999px;outline:0;overflow:hidden;padding-bottom:15px;display:block}#login{width:320px;padding:114px 0 0;margin:auto}#login_error,.login .message{margin:0 0 16px 8px;padding:12px}.login #nav,.login #backtoblog{text-shadow:#fff 0 1px 0;margin:0 0 0 16px;padding:16px 16px 0}#backtoblog{padding:12px 16px 0}.login form .input,.login input[type="text"]{color:#555;font-weight:200;font-size:24px;line-height:1;width:100%;padding:3px;margin-top:2px;margin-right:6px;margin-bottom:16px;border:1px solid #e5e5e5;background:#fbfbfb;outline:0;-webkit-box-shadow:inset 1px 1px 2px rgba(200,200,200,0.2);box-shadow:inset 1px 1px 2px rgba(200,200,200,0.2)}.login #pass-strength-result{width:250px;font-weight:bold;border-style:solid;border-width:1px;margin:12px 0 6px;padding:6px 5px;text-align:center}.mobile #login{padding:20px 0}.mobile #login form,.mobile #login .message,.mobile #login_error{margin-left:0}.mobile #login #nav,.mobile #login #backtoblog{margin-left:8px}.mobile #login h1 a{width:auto}body.interim-login{height:auto}.interim-login #login{padding:0;margin:5px auto 20px}.interim-login.login h1 a{width:auto}.interim-login #login_error,.interim-login.login .message{margin:0 0 16px}.interim-login.login form{margin:0}#dashboard_right_now p.musub{margin-top:12px;border-top:1px solid #ececec;padding-left:16px;position:static}.rtl #dashboard_right_now p.musub{padding-left:0;padding-right:16px}#dashboard_right_now td.b a.musublink{font-size:16px}#dashboard_right_now div.musubtable{border-top:0}#dashboard_right_now div.musubtable .t{white-space:normal}.wp-list-table .site-deleted{background:#ff8573}.wp-list-table .site-spammed{background:#faafaa}.wp-list-table .site-archived{background:#ffebe8}.wp-list-table .site-mature{background:#fecac2}.no-js #message{display:block}#nav-menu-meta ul.outer-border{-webkit-border-radius:3px;border-radius:3px}.accordion-section ul.category-tabs,.accordion-section ul.add-menu-item-tabs,.accordion-section ul.wp-tab-bar{margin:0}.accordion-section .categorychecklist{margin:13px 0}#nav-menu-meta .accordion-section-content{padding:18px 13px}#nav-menu-meta .button-controls{margin-bottom:0}#nav-menus-frame{margin-left:300px;margin-top:23px}#wpbody-content #menu-settings-column{display:inline;width:281px;margin-left:-300px;clear:both;float:left;padding-top:0}#menu-settings-column .inside{clear:both;margin:10px 0 0}.metabox-holder-disabled .postbox,.metabox-holder-disabled .accordion-section-content{opacity:.5;filter:alpha(opacity=50)}.metabox-holder-disabled .button-controls .select-all{display:none}#wpbody{position:relative}.blank-slate .menu-name{height:2em}.blank-slate .menu-settings{border:0;margin-top:0;padding-top:0;overflow:hidden}.is-submenu{font-style:italic;font-weight:normal;margin-left:4px}.manage-menus{margin-top:23px;padding:10px;overflow:hidden;-webkit-border-radius:3px;border-radius:3px}.manage-menus select{float:left;margin-right:6px}.manage-menus .selected-menu{float:left;margin:5px 6px 0 0}.manage-menus .submit-btn{float:left;margin-top:1px}.menu-edit p{margin:.3em 0 .6em}.menu-edit #post-body-content h3{margin:0 0 10px}.menu-settings{margin-top:2em;overflow:hidden}.menu-settings dl{margin:0 0 10px;overflow:hidden;position:relative}.menu-settings dd{float:left;margin:0;width:60%}.menu-edit .checkbox-input{margin-top:4px}.theme-location-set{font-size:11px}#menu-management-liquid{float:left;min-width:100%;margin-top:3px}#menu-management{position:relative;margin-right:20px;margin-top:-3px;width:100%}#menu-management .menu-edit{margin-bottom:20px}.nav-menus-php #post-body{padding:0 10px 10px;border-width:1px 0;border-style:solid}#nav-menu-header,#nav-menu-footer{padding:0 10px}#nav-menu-header{border-bottom:1px solid;margin-bottom:13px}#nav-menu-header .menu-name-label{margin-top:2px}#nav-menu-footer{border-top:1px solid}.nav-menus-php #post-body div.updated,.nav-menus-php #post-body div.error{margin:0}.nav-menus-php #post-body-content{position:relative;float:none}#menu-management .menu-add-new abbr{font-weight:bold}#select-nav-menu-container{text-align:right;padding:0 10px 3px 10px;margin-bottom:5px}#select-nav-menu{width:100px;display:inline}#menu-name-label{margin-top:-2px}.widefat td.menu-location-menus{padding-bottom:5px}.menu-location-menus select{float:left}#locations-nav-menu-wrapper{padding:5px 0}.locations-nav-menu-select select{float:left;width:160px;margin-right:5px}.locations-row-links{float:left;margin:6px 0 0 6px}.locations-edit-menu-link,.locations-add-menu-link{margin:0 3px}.locations-edit-menu-link{padding-right:3px;border-right:1px solid #ccc}#wpbody .open-label{display:block;float:left}#wpbody .open-label span{padding-right:10px}.js .input-with-default-title{font-style:italic}#menu-management .inside{padding:0 10px}.postbox .howto input,.accordion-container .howto input{width:180px;float:right}.accordion-container .outer-border{margin:0}#nav-menu-meta .accordion-container .top{border-top:1px solid #dfdfdf}#nav-menu-meta .accordion-container .accordion-section:first-child,#nav-menu-meta .accordion-container .accordion-section:first-child h3,#nav-menu-meta .accordion-container .top,#nav-menu-meta .accordion-container .top h3{-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px}#nav-menu-meta .accordion-container .accordion-section:last-child,#nav-menu-meta .accordion-container .accordion-section:last-child .accordion-section-content,#nav-menu-meta .accordion-container .bottom,#nav-menu-meta .accordion-container .bottom:not(.open) h3{-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.customlinkdiv .howto input{width:180px}.customlinkdiv p{margin-top:0}#nav-menu-theme-locations .howto select{width:100%}#nav-menu-theme-locations .button-controls{text-align:right}.add-menu-item-view-all{height:400px}#menu-container .submit{margin:0 0 10px;padding:0}.nav-menus-php .add-new-menu-action{float:left;margin:6px 0 0 6px;line-height:15px}.nav-menus-php .meta-sep,.nav-menus-php .submitdelete,.nav-menus-php .submitcancel{display:block;float:left;margin:4px 0;line-height:15px}.meta-sep{padding:0 2px}#cancel-save{text-decoration:underline;font-size:12px;margin-left:20px;margin-top:5px}.button.right,.button-secondary.right,.button-primary.right{float:right}.list-controls{float:left;margin-top:5px}.add-to-menu{float:right}.postbox .spinner{display:none;vertical-align:middle}.button-controls{clear:both;margin:10px 0}.show-all,.hide-all{cursor:pointer}.hide-all{display:none}#menu-name{width:270px}#manage-menu .inside{padding:0}#available-links dt{display:block}#add-custom-link .howto{font-size:12px}#add-custom-link label span{display:block;float:left;margin-top:5px;padding-right:5px}.menu-item-textbox{width:180px}.nav-menus-php .howto span{margin-top:4px;display:block;float:left}.quick-search{width:190px}.nav-menus-php .list-wrap{display:none;clear:both;margin-bottom:10px}.nav-menus-php .list-container{max-height:200px;overflow-y:auto;padding:10px 10px 5px}.nav-menus-php .postbox p.submit{margin-bottom:0}.nav-menus-php .list li{display:none;margin:0;margin-bottom:5px}.nav-menus-php .list li .menu-item-title{cursor:pointer;display:block}.nav-menus-php .list li .menu-item-title input{margin-right:3px;margin-top:-3px}#menu-container .inside{padding-bottom:10px}.menu{padding-top:1em}#menu-to-edit{margin:0;padding:.1em 0}.menu ul{width:100%}.menu li{margin-bottom:0;position:relative}.menu-item-bar{clear:both;line-height:1.5em;position:relative;margin:9px 0 0}.menu-item-handle{border:1px solid #dfdfdf;position:relative;padding-left:10px;height:auto;width:400px;line-height:35px;text-shadow:0 1px 0 #fff;overflow:hidden;word-wrap:break-word}#menu-to-edit .menu-item-invalid .menu-item-handle{background:#f6c9cc;background-image:-webkit-gradient(linear,left bottom,left top,from(#f6c9cc),to(#fdf8ff));background-image:-webkit-linear-gradient(bottom,#f6c9cc,#fdf8ff);background-image:-moz-linear-gradient(bottom,#f6c9cc,#fdf8ff);background-image:-o-linear-gradient(bottom,#f6c9cc,#fdf8ff);background-image:linear-gradient(to top,#f6c9cc,#fdf8ff)}.menu-item-edit-active .menu-item-handle{-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.no-js .menu-item-edit-active .item-edit{display:none}.js .menu-item-handle{cursor:move}.menu li.deleting .menu-item-handle{background-image:none;text-shadow:0}.menu-item-handle .item-title{font-size:12px;font-weight:bold;padding:7px 0;line-height:20px;display:block;margin-right:13em}li.menu-item.ui-sortable-helper dl{margin-top:0}li.menu-item.ui-sortable-helper .menu-item-transport dl{margin-top:13px}.menu .sortable-placeholder{height:35px;width:410px;margin-top:13px}.menu-item-depth-0{margin-left:0}.menu-item-depth-1{margin-left:30px}.menu-item-depth-2{margin-left:60px}.menu-item-depth-3{margin-left:90px}.menu-item-depth-4{margin-left:120px}.menu-item-depth-5{margin-left:150px}.menu-item-depth-6{margin-left:180px}.menu-item-depth-7{margin-left:210px}.menu-item-depth-8{margin-left:240px}.menu-item-depth-9{margin-left:270px}.menu-item-depth-10{margin-left:300px}.menu-item-depth-11{margin-left:330px}.menu-item-depth-0 .menu-item-transport{margin-left:0}.menu-item-depth-1 .menu-item-transport{margin-left:-30px}.menu-item-depth-2 .menu-item-transport{margin-left:-60px}.menu-item-depth-3 .menu-item-transport{margin-left:-90px}.menu-item-depth-4 .menu-item-transport{margin-left:-120px}.menu-item-depth-5 .menu-item-transport{margin-left:-150px}.menu-item-depth-6 .menu-item-transport{margin-left:-180px}.menu-item-depth-7 .menu-item-transport{margin-left:-210px}.menu-item-depth-8 .menu-item-transport{margin-left:-240px}.menu-item-depth-9 .menu-item-transport{margin-left:-270px}.menu-item-depth-10 .menu-item-transport{margin-left:-300px}.menu-item-depth-11 .menu-item-transport{margin-left:-330px}body.menu-max-depth-0{min-width:950px!important}body.menu-max-depth-1{min-width:980px!important}body.menu-max-depth-2{min-width:1010px!important}body.menu-max-depth-3{min-width:1040px!important}body.menu-max-depth-4{min-width:1070px!important}body.menu-max-depth-5{min-width:1100px!important}body.menu-max-depth-6{min-width:1130px!important}body.menu-max-depth-7{min-width:1160px!important}body.menu-max-depth-8{min-width:1190px!important}body.menu-max-depth-9{min-width:1220px!important}body.menu-max-depth-10{min-width:1250px!important}body.menu-max-depth-11{min-width:1280px!important}.item-type{font-size:12px;padding-right:10px}.item-controls{font-size:12px;position:absolute;right:20px;top:-1px}.item-controls a{text-decoration:none}.item-controls a:hover{cursor:pointer}.item-controls .item-order{padding-right:10px}.nav-menus-php .item-edit{position:absolute;right:-20px;top:0;display:block;width:30px;height:36px;overflow:hidden;text-indent:-999em;border-bottom:1px solid;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px}.menu-instructions-inactive{display:none}.menu-item-settings{display:block;width:400px;padding:10px 0 10px 10px;border:solid;border-width:0 1px 1px 1px;-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.menu-item-settings .field-move a{display:none;margin:0 2px}.menu-item-edit-active .menu-item-settings{display:block}.menu-item-edit-inactive .menu-item-settings{display:none}.add-menu-item-pagelinks{margin:.5em auto;text-align:center}.link-to-original{display:block;margin:0 0 10px;padding:3px 5px 5px;font-size:12px;font-style:italic}.link-to-original a{padding-left:4px;font-style:normal}.hidden-field{display:none}.menu-item-settings .description-thin,.menu-item-settings .description-wide{margin-right:10px;float:left}.description-thin{width:190px;height:40px}.description-wide{width:390px}.menu-item-actions{padding-top:15px}#cancel-save{cursor:pointer}.nav-menus-php .major-publishing-actions{clear:both;padding:3px 0 5px}.nav-menus-php .major-publishing-actions .publishing-action{text-align:right;float:right;line-height:23px;margin:2px 0 1px}.nav-menus-php .blank-slate .menu-settings{display:none}.nav-menus-php .delete-action{float:left;margin-top:2px}.nav-menus-php .submitbox .submitcancel{border-bottom:1px solid;padding:1px 2px;text-decoration:none}.nav-menus-php .major-publishing-actions .form-invalid{padding-left:4px;margin-left:-4px;border:0 none}#menu-item-name-wrap:after,#menu-item-url-wrap:after,#menu-name-label:after,#menu-settings-column .inside:after,#nav-menus-frame:after,.nav-menus-php #post-body-content:after,.nav-menus-php .button-controls:after,.nav-menus-php .major-publishing-actions:after,.nav-menus-php .menu-item-settings:after{clear:both;content:".";display:block;height:0;visibility:hidden}#nav-menus-frame,.button-controls,#menu-item-url-wrap,#menu-item-name-wrap{display:block}div.star-holder{position:relative;height:17px;width:100px;background:url('../images/stars.png?ver=20121108') repeat-x bottom left}div.star-holder .star-rating{background:url('../images/stars.png?ver=20121108') repeat-x top left;height:17px;float:left}div.action-links{font-weight:normal;margin:6px 0 0}#plugin-information-header{margin:0;padding:0 5px;font-weight:bold;position:relative;border-bottom-width:1px;border-bottom-style:solid;height:2.5em}#plugin-information ul#sidemenu{font-weight:normal;margin:0 5px;position:absolute;left:0;bottom:-1px}#plugin-information p.action-button{width:100%;padding-bottom:0;margin-bottom:0;margin-top:10px;-webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-top-left-radius:3px;border-bottom-left-radius:3px}#plugin-information .action-button a{text-align:center;font-weight:bold;text-decoration:none;display:block;line-height:2em}#plugin-information h2{clear:none!important;margin-right:200px}#plugin-information .fyi{margin:0 10px 50px;width:210px}#plugin-information .fyi h2{font-size:.9em;margin-bottom:0;margin-right:0}#plugin-information .fyi h2.mainheader{padding:5px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px}#plugin-information .fyi ul{padding:10px 5px 10px 7px;margin:0;list-style:none;-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px}#plugin-information .fyi li{margin-right:0}#plugin-information #section-holder{padding:10px}#plugin-information .section ul,#plugin-information .section ol{margin-left:16px;list-style-type:square;list-style-image:none}#plugin-information #section-screenshots ol{list-style:none;margin:0}#plugin-information #section-screenshots li img{vertical-align:text-top;max-width:100%;width:auto;height:auto}#plugin-information #section-screenshots li p{font-style:italic;padding-left:20px;padding-bottom:2em}#plugin-information #section-screenshots ol,#plugin-information .updated,#plugin-information pre{margin-right:215px}#plugin-information pre{padding:7px;overflow:auto}body.press-this{color:#333;margin:0;padding:0;min-width:675px;min-height:400px}img{border:0}.press-this #wphead{height:32px;margin-left:0;margin-right:0;margin-bottom:5px}.press-this #header-logo{float:left;margin:7px 7px 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.press-this #wphead h1{font-weight:normal;font-size:16px;line-height:32px;margin:0;float:left}.press-this #wphead h1 a{text-decoration:none}.press-this #wphead h1 a:hover{text-decoration:underline}.press-this #message{margin:10px 0}.press-this-sidebar{float:right;width:200px;padding-top:10px}.press-this #title{margin-left:0;margin-right:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box}.press-this .tagchecklist span a{background:transparent url(../images/xit.gif) no-repeat 0 0}.press-this #titlediv{margin:0}.press-this .wp-media-buttons{cursor:default;padding:8px 8px 0}.press-this .howto{margin-top:2px;margin-bottom:3px;font-size:12px;font-style:italic;display:block}.press-this #poststuff{margin:0 10px 10px;padding:0}.press-this #photo-add-url-div input[type="text"]{width:220px}#poststuff #editor-toolbar{height:30px}div.zerosize{border:0 none;height:0;margin:0;overflow:hidden;padding:0;width:0}.posting{margin-right:212px;position:relative}.press-this .inner-sidebar{width:200px}.press-this .inner-sidebar .sleeve{padding-top:5px}.press-this #submitdiv p{margin:0;padding:6px}.press-this #submitdiv #publishing-actions{border-bottom:1px solid #dfdfdf}.press-this #publish{float:right}.press-this #poststuff h2,.press-this #poststuff h3{font-size:14px;line-height:1}.press-this #tagsdiv-post_tag h3,.press-this #categorydiv h3{cursor:pointer}.press-this #submitdiv h3{cursor:default}h3.tb{text-shadow:0 1px 0 #fff;font-weight:bold;font-size:12px;margin-left:5px}#TB_window{border:1px solid #333}.press-this .postbox,.press-this .stuffbox{margin-bottom:10px;min-width:0}.js .postbox:hover .handlediv,.js .stuffbox:hover .handlediv{background:transparent url(../images/arrows.png) no-repeat 6px 7px}.press-this #submitdiv:hover .handlediv{background:0}.tbtitle{font-size:1.7em;outline:0;padding:3px 4px;border-color:#dfdfdf}.press-this .actions{float:right;margin:-19px 0 0}.press-this #extra-fields .actions{margin:-32px -7px 0 0}.press-this .actions li{float:left;list-style:none;margin-right:10px}#extra-fields .button{margin-right:5px}#photo_saving{margin:0 8px 8px;vertical-align:middle}#img_container_container{overflow:auto}#extra-fields{margin-top:10px;position:relative}#extra-fields h2{margin:12px}#waiting{margin-top:10px;overflow:hidden}#waiting span{float:right;margin:0 0 0 5px}#waiting .spinner{display:block}#extra-fields .postbox{margin-bottom:5px}#extra-fields .titlewrap{padding:0;overflow:auto;height:100px}#img_container a{display:block;float:left;overflow:hidden}#img_container img,#img_container a{width:68px;height:68px}#img_container img{border:0;background-color:#f4f4f4;cursor:pointer}#img_container a,#img_container a:link,#img_container a:visited{border:1px solid #ccc;display:block;position:relative}#img_container a:hover,#img_container a:active{border-color:#000;z-index:1000;border-width:2px;margin:-1px}#embed-code{width:100%;height:98px}.press-this .categorydiv div.tabs-panel{height:100px}.press-this .tagsdiv .newtag{width:120px}.press-this #content{margin:5px 0;padding:0 5px;border:0 none;height:345px;font-family:Consolas,Monaco,monospace;font-size:13px;line-height:19px;background:transparent}.press-this #publishing-actions .spinner{display:inline;vertical-align:middle}#TB_ajaxContent #options{position:absolute;top:20px;right:25px;padding:5px}#TB_ajaxContent h3{margin-bottom:.25em}.error a{text-decoration:underline}.updated a{text-decoration:none;padding-bottom:2px}.taghint{color:#aaa;margin:-17px 0 0 7px;visibility:hidden}input.newtag ~ div.taghint{visibility:visible}input.newtag:focus ~ div.taghint{visibility:hidden}#mce_fullscreen_container{background:#fff}#photo-add-url-div input[type="text"]{width:300px}.alignleft h3{margin:0}h3 span{font-weight:normal}#template textarea{font-family:Consolas,Monaco,monospace;font-size:12px;width:97%;background:#f9f9f9;outline:0}#template p{width:97%}#templateside{float:right;width:190px;word-wrap:break-word}#templateside h3,#postcustomstuff p.submit{margin:0}#templateside h4{margin:1em 0 0}#templateside ol,#templateside ul{margin:.5em;padding:0}#templateside li{margin:4px 0}#templateside ul li a span.highlight{display:block}.nonessential{font-size:11px;font-style:italic;padding-left:12px}.highlight{padding:3px 3px 3px 12px;margin-left:-12px;font-weight:bold;border:0 none}#documentation{margin-top:10px}#documentation label{line-height:22px;vertical-align:top;font-weight:bold}.fileedit-sub{padding:10px 0 8px;line-height:180%}#filter-box{clear:both}.feature-filter{padding:8px 12px 0}.feature-filter .feature-group{float:left;margin:5px 10px 10px}.feature-filter .feature-group li{display:inline-block;vertical-align:top;list-style-type:none;padding-right:25px;width:150px}.feature-container{width:100%;overflow:auto;margin-bottom:10px}div.widget-liquid-left{float:left;clear:left;width:100%;margin-right:-325px}div#widgets-left{margin-left:5px;margin-right:325px}div#widgets-right{width:285px;margin:0 auto}div.widget-liquid-right{float:right;clear:right;width:300px}.widget-liquid-right .widget,.inactive-sidebar .widget,.widget-liquid-right .sidebar-description{width:250px;margin:0 auto 20px;overflow:hidden}.widget-liquid-right .sidebar-description{margin-bottom:10px}.inactive-sidebar .widget{margin:0 10px 20px;display:inline-block}div.sidebar-name h3{font-weight:normal;font-size:15px;margin:0;padding:8px 10px;overflow:hidden;white-space:nowrap}div.sidebar-name{font-size:13px;border-width:1px;border-style:solid;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px}.js .sidebar-name{cursor:pointer}.js .closed .sidebar-name{-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.widget-liquid-right .widgets-sortables,#widgets-left .widget-holder{border-width:0 1px 1px;border-style:none solid solid;-webkit-border-bottom-right-radius:3px;-webkit-border-bottom-left-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.js .closed .widgets-sortables,.js .closed .widget-holder{display:none}.widget-liquid-right .widgets-sortables{padding:15px 0 0}#available-widgets .widget-holder{padding:7px 5px 0}#available-widgets .widget{-webkit-box-shadow:none;box-shadow:none}.inactive-sidebar{padding:5px 5px 0}#widget-list .widget{width:250px;margin:0 10px 15px;border:0 none;background:transparent;display:inline-block;vertical-align:top}#widget-list .widget-description{padding:5px 8px}.widget-placeholder{border-width:1px;border-style:dashed;margin:0 auto 20px;height:27px;width:250px}.inactive-sidebar .widget-placeholder{margin:0 10px 20px;float:left}div.widgets-holder-wrap{padding:0;margin:10px 0 20px}#widgets-left #available-widgets{background-color:transparent;border:0 none}ul#widget-list{list-style:none;margin:0;padding:0;min-height:100px}.widget .widget-top{margin-bottom:-1px;font-size:12px;font-weight:bold;height:26px;overflow:hidden}.widget-top .widget-title{padding:7px 9px}.widget-top .widget-title-action{float:right}a.widget-action{display:block;width:24px;height:26px}#available-widgets a.widget-action{display:none}.widget-top a.widget-action{background:transparent url(../images/arrows.png) no-repeat 4px 6px}.widget-top a.widget-action:hover{background:transparent url(../images/arrows-dark.png) no-repeat 4px 6px}.widget .widget-inside,.widget .widget-description{padding:12px 12px 10px;font-size:12px;line-height:16px}.widget-inside,.widget-description{display:none}#available-widgets .widget-description{display:block}.widget .widget-inside p{margin:0 0 1em;padding:0}.widget-title h4{margin:0;padding-bottom:.2em;line-height:1;overflow:hidden;white-space:nowrap}.widgets-sortables{min-height:90px}.widget-control-actions{margin-top:8px}.widget-control-actions a{text-decoration:none}.widget-control-actions a:hover{text-decoration:underline}.widget-control-actions div.alignleft{margin-top:6px}div#sidebar-info{padding:0 1em;margin-bottom:1em;font-size:12px}.widget-title a,.widget-title a:hover{text-decoration:none;border-bottom:0}.widget-control-edit{display:block;font-size:12px;font-weight:normal;line-height:26px;padding:0 8px 0 0}a.widget-control-edit{text-decoration:none}.widget-control-edit .add,.widget-control-edit .edit{display:none}#available-widgets .widget-control-edit .add,#widgets-right .widget-control-edit .edit,.inactive-sidebar .widget-control-edit .edit{display:inline}.editwidget{margin:0 auto 15px}.editwidget .widget-inside{display:block;padding:10px}.inactive p.description{margin:5px 15px 10px}#available-widgets p.description{margin:0 12px 12px}.widget-position{margin-top:8px}.inactive{padding-top:2px}.sidebar-name .spinner{float:none;margin:0 3px -3px}.sidebar-name-arrow{float:right;height:29px;width:26px}.widget-title .in-widget-title{font-size:12px;white-space:nowrap}#removing-widget{display:none;font-weight:normal;padding-left:15px;font-size:12px;line-height:1}.widget-control-noform,#access-off,.widgets_access .widget-action,.widgets_access .sidebar-name-arrow,.widgets_access #access-on,.widgets_access .widget-holder .description{display:none}.widgets_access .widget-holder,.widgets_access #widget-list{padding-top:10px}.widgets_access #access-off{display:inline}.widgets_access #wpbody-content .widget-title-action,.widgets_access #wpbody-content .widget-control-edit,.widgets_access .closed .widgets-sortables,.widgets_access .closed .widget-holder{display:block}.widgets_access .closed .sidebar-name{-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.widgets_access .sidebar-name,.widgets_access .widget .widget-top{cursor:default}.ui-sortable,.ui-draggable{-ms-touch-action:none}.accordion-section{border-top:1px solid #fff;border-bottom:1px solid #dfdfdf;margin:0}.accordion-section:first-child{border-top:1px solid #dfdfdf}.accordion-section:last-child{box-shadow:0 1px 0 0 #fff}.accordion-section.open .accordion-section-content,.no-js .accordion-section .accordion-section-content{display:block}.accordion-section.open:hover{border-bottom-color:#dfdfdf}.accordion-section-content{display:none;padding:10px 20px 15px;overflow:hidden;background:#fdfdfd;border-left:1px solid #dfdfdf;border-right:1px solid #dfdfdf}.accordion-section-title{margin:0;padding:15px 20px;position:relative;border-left:1px solid #dfdfdf;border-right:1px solid #dfdfdf;-webkit-user-select:none;-moz-user-select:none;user-select:none}.js .accordion-section-title{cursor:pointer}.js .accordion-section-title:after{content:'';width:0;height:0;border-color:#ccc transparent;border-style:solid;border-width:6px 6px 0;position:absolute;top:25px;right:20px;z-index:1}.accordion-section-title:focus{outline:0}.accordion-section-title:hover:after,.accordion-section-title:focus:after{border-color:#aaa transparent}.cannot-expand .accordion-section-title{cursor:auto}.cannot-expand .accordion-section-title:after{display:none}.control-section .accordion-section-title{padding:10px 20px;color:#464646;font-size:15px;font-family:Georgia,"Times New Roman","Bitstream Charter",Times,serif;font-weight:normal;text-shadow:0 1px 0 #fff;background:#f5f5f5;background-image:-webkit-gradient(linear,left bottom,left top,from(#eee),to(#f5f5f5));background-image:-webkit-linear-gradient(bottom,#eee,#f5f5f5);background-image:-moz-linear-gradient(bottom,#eee,#f5f5f5);background-image:-o-linear-gradient(bottom,#eee,#f5f5f5);background-image:linear-gradient(to top,#eee,#f5f5f5)}.control-section .accordion-section-title:after{top:15px}.js .control-section:hover .accordion-section-title,.js .control-section .accordion-section-title:hover,.js .control-section.open .accordion-section-title,.js .control-section .accordion-section-title:focus{color:#000;background:#f9f9f9;background-image:-webkit-gradient(linear,left bottom,left top,from(#ececec),to(#f9f9f9));background-image:-webkit-linear-gradient(bottom,#ececec,#f9f9f9);background-image:-moz-linear-gradient(bottom,#ececec,#f9f9f9);background-image:-o-linear-gradient(bottom,#ececec,#f9f9f9);background-image:linear-gradient(to top,#ececec,#f9f9f9)}.control-section.open .accordion-section-title{border-bottom:1px solid #dfdfdf}@media only screen and (max-width:768px){#col-left{width:100%}#col-right{width:100%}}@media only screen and (min-width:769px){#col-left{width:35%}#col-right{width:65%}}@media only screen and (max-width:860px){#col-left{width:35%}#col-right{width:65%}}@media only screen and (min-width:980px){#col-left{width:35%}#col-right{width:65%}}@media only screen and (max-width:768px){#col-left{width:100%}#col-right{width:100%}.form-field input,.form-field textarea{width:99%}.form-wrap .form-field{padding:0}#profile-page .form-table textarea{max-width:400px;width:auto}}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.press-this .tagchecklist span a{background-image:url('../images/xit-2x.gif');background-size:20px auto}.js .postbox:hover .handlediv,.js .stuffbox:hover .handlediv,.widget-top a.widget-action{background-image:url('../images/arrows-2x.png');background-size:15px 123px}.widget-top a.widget-action:hover{background-image:url('../images/arrows-dark-2x.png');background-size:15px 123px}.post-com-count{background-image:url('../images/bubble_bg-2x.gif');background-size:18px 100px}tr.wp-locked .locked-indicator{background-image:url('../images/lock-2x.png');background-size:16px 16px}th .comment-grey-bubble{background-image:url('../images/comment-grey-bubble-2x.png');background-size:12px 12px}.sorting-indicator{background-image:url('../images/sort-2x.gif?ver=20130102');background-size:14px 4px}#content-resize-handle,#post-body .wp_themeSkin .mceStatusbar a.mceResize{background:transparent url('../images/resize-2x.gif') no-repeat scroll right bottom;background-size:11px 11px}div.star-holder{background:url('../images/stars-2x.png?ver=20121108') repeat-x bottom left;background-size:21px 37px}div.star-holder .star-rating{background:url('../images/stars-2x.png?ver=20121108') repeat-x top left;background-size:21px 37px}.welcome-panel .welcome-panel-close:before{background-image:url('../images/xit-2x.gif');background-size:20px auto}.welcome-panel .welcome-icon{background-image:url('../images/welcome-icons-2x.png')}.login h1 a{background-image:url('../images/wordpress-logo-2x.png?ver=20120412');background-size:274px 63px}.wp-badge{background-image:url('../images/wp-badge-2x.png?ver=20120516');background-size:173px 194px}.wp-full-overlay .collapse-sidebar-arrow{background-image:url('../images/arrows-2x.png');background-size:15px 123px}.pressthis a span{background-image:url(../images/press-this-2x.png?v=20121105)}.imgedit-crop,.imgedit-rleft,.imgedit-rright,.imgedit-flipv,.imgedit-fliph,.imgedit-undo,.imgedit-redo{background-image:url('../images/imgedit-icons-2x.png');background-size:260px 64px}.spinner,.imgedit-wait,.customize-loading #customize-container{background-image:url(../images/wpspin_light-2x.gif)}.wp-slider .ui-slider-handle:before{background-image:url(../images/arrows-pr-2x.png);background-size:16px 102px}}.locale-zh-cn .howto,.locale-zh-cn .tablenav .displaying-num,.locale-zh-cn .js .input-with-default-title,.locale-zh-cn .link-to-original,.locale-zh-cn .inline-edit-row fieldset span.title,.locale-zh-cn .inline-edit-row fieldset span.checkbox-title,.locale-zh-cn #utc-time,.locale-zh-cn #local-time,.locale-zh-cn p.install-help,.locale-zh-cn p.help,.locale-zh-cn p.description,.locale-zh-cn span.description,.locale-zh-cn .form-wrap p{font-style:normal}.locale-zh-cn .hdnle a{font-size:12px}.locale-zh-cn form.upgrade .hint{font-style:normal;font-size:100%}.locale-zh-cn #wp-fullscreen-tagline{font-family:KaiTi,"楷体",sans-serif}.locale-zh-cn #wp-fullscreen-modes a{font-size:12px}.locale-zh-cn #sort-buttons{font-size:1em!important}.locale-ru-ru .inline-edit-row fieldset label span.title{width:auto;min-width:5em}.locale-ru-ru.press-this .posting{margin-right:257px}.locale-ru-ru.press-this #photo-add-url-div input[type="text"]{width:255px}.locale-ru-ru.press-this #side-sortables{width:245px}.locale-ru-ru #customize-header-actions .button{padding:0 8px 1px}.locale-lt-lt .inline-edit-row fieldset label span.title{width:8em}.locale-lt-lt .inline-edit-row fieldset label span.input-text-wrap{margin-left:8em}
\ No newline at end of file
index a924ecaf797c0fc866db83139068fdb7f8bd8a4d..ac2941f28a555646b1201003a16e06a9000b6f3d 100644 (file)
@@ -203,16 +203,17 @@ if ( $bgcolor = get_background_color() )
        $background_styles .= 'background-color: #' . $bgcolor . ';';
 
 if ( get_background_image() ) {
+       $background_image_thumb = esc_url( set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', get_background_image() ) ) ) );
        // background-image URL must be single quote, see below
-       $background_styles .= ' background-image: url(\'' . set_url_scheme( get_theme_mod( 'background_image_thumb', get_background_image() ) ) . '\');'
+       $background_styles .= ' background-image: url(\'' . $background_image_thumb . '\');'
                . ' background-repeat: ' . get_theme_mod('background_repeat', 'repeat') . ';'
                . ' background-position: top ' . get_theme_mod('background_position_x', 'left');
 }
 ?>
 <div id="custom-background-image" style="<?php echo $background_styles; ?>"><?php // must be double quote, see above ?>
 <?php if ( get_background_image() ) { ?>
-<img class="custom-background-image" src="<?php echo set_url_scheme( get_theme_mod( 'background_image_thumb', get_background_image() ) ); ?>" style="visibility:hidden;" alt="" /><br />
-<img class="custom-background-image" src="<?php echo set_url_scheme( get_theme_mod( 'background_image_thumb', get_background_image() ) ); ?>" style="visibility:hidden;" alt="" />
+<img class="custom-background-image" src="<?php echo $background_image_thumb; ?>" style="visibility:hidden;" alt="" /><br />
+<img class="custom-background-image" src="<?php echo $background_image_thumb; ?>" style="visibility:hidden;" alt="" />
 <?php } ?>
 </div>
 <?php } ?>
@@ -301,7 +302,7 @@ if ( get_background_image() ) {
 </tr>
 
 <tr valign="top">
-<th scope="row"><?php _e( 'Attachment' ); ?></th>
+<th scope="row"><?php _ex( 'Attachment', 'Background Attachment' ); ?></th>
 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Attachment' ); ?></span></legend>
 <label>
 <input name="background-attachment" type="radio" value="scroll" <?php checked('scroll', get_theme_mod('background_attachment', 'scroll')); ?> />
index 14f01dfb587a6f77cb6e2f118a8406ed8029925f..12288430cdaed074a7740da2a62dad182e706c65 100644 (file)
@@ -663,8 +663,8 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
                        list( $width, $height, $type, $attr ) = getimagesize( $file );
                } else {
                        $data = wp_get_attachment_metadata( $attachment_id );
-                       $height = $data[ 'height' ];
-                       $width = $data[ 'width' ];
+                       $height = isset( $data[ 'height' ] ) ? $data[ 'height' ] : 0;
+                       $width = isset( $data[ 'width' ] ) ? $data[ 'width' ] : 0;
                        unset( $data );
                }
 
@@ -1001,6 +1001,7 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?>
 
                $default = sprintf( $default, get_template_directory_uri(), get_stylesheet_directory_uri() );
 
+               $default_data = array();
                foreach ( $this->default_headers as $header => $details ) {
                        if ( $details['url'] == $default ) {
                                $default_data = $details;
index 093f9987b34104fbd9c08ed72771033b5537a7d2..a9e05c2fd5a41f6fd05ea30fcac2a06452130f92 100644 (file)
@@ -36,6 +36,8 @@ do_action( 'customize_controls_init' );
 wp_enqueue_script( 'customize-controls' );
 wp_enqueue_style( 'customize-controls' );
 
+wp_enqueue_script( 'accordion' );
+
 do_action( 'customize_controls_enqueue_scripts' );
 
 // Let's roll.
@@ -44,7 +46,7 @@ do_action( 'customize_controls_enqueue_scripts' );
 wp_user_settings();
 _wp_admin_html_begin();
 
-$body_class = 'wp-core-ui';
+$body_class = 'wp-core-ui js';
 
 if ( wp_is_mobile() ) :
        $body_class .= ' mobile';
@@ -88,16 +90,16 @@ do_action( 'customize_controls_print_scripts' );
                        $cannot_expand = ! ( $screenshot || $wp_customize->theme()->get('Description') );
                ?>
 
-               <div class="wp-full-overlay-sidebar-content" tabindex="-1">
-                       <div id="customize-info" class="customize-section<?php if ( $cannot_expand ) echo ' cannot-expand'; ?>">
-                               <div class="customize-section-title" aria-label="<?php esc_attr_e( 'Theme Customizer Options' ); ?>" tabindex="0">
+               <div class="wp-full-overlay-sidebar-content accordion-container" tabindex="-1">
+                       <div id="customize-info" class="accordion-section <?php if ( $cannot_expand ) echo ' cannot-expand'; ?>">
+                               <div class="accordion-section-title" aria-label="<?php esc_attr_e( 'Theme Customizer Options' ); ?>" tabindex="0">
                                        <span class="preview-notice"><?php
                                                /* translators: %s is the theme name in the Customize/Live Preview pane */
                                                echo sprintf( __( 'You are previewing %s' ), '<strong class="theme-name">' . $wp_customize->theme()->display('Name') . '</strong>' );
                                        ?></span>
                                </div>
                                <?php if ( ! $cannot_expand ) : ?>
-                               <div class="customize-section-content">
+                               <div class="accordion-section-content">
                                        <?php if ( $screenshot ) : ?>
                                                <img class="theme-screenshot" src="<?php echo esc_url( $screenshot ); ?>" />
                                        <?php endif; ?>
index 174cd9af114be3389f69a6872342fcf362b093e2..889270938b2c1668dc8351e5fe91115d07f357a4 100644 (file)
@@ -20,9 +20,9 @@ if ( $doaction ) {
        check_admin_referer( 'bulk-comments' );
 
        if ( 'delete_all' == $doaction && !empty( $_REQUEST['pagegen_timestamp'] ) ) {
-               $comment_status = $wpdb->escape( $_REQUEST['comment_status'] );
-               $delete_time = $wpdb->escape( $_REQUEST['pagegen_timestamp'] );
-               $comment_ids = $wpdb->get_col( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = '$comment_status' AND '$delete_time' > comment_date_gmt" );
+               $comment_status = wp_unslash( $_REQUEST['comment_status'] );
+               $delete_time = wp_unslash( $_REQUEST['pagegen_timestamp'] );
+               $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = %s AND %s > comment_date_gmt", $comment_status, $delete_time ) );
                $doaction = 'delete';
        } elseif ( isset( $_REQUEST['delete_comments'] ) ) {
                $comment_ids = $_REQUEST['delete_comments'];
@@ -95,7 +95,7 @@ if ( $doaction ) {
        wp_safe_redirect( $redirect_to );
        exit;
 } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
-        wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) );
+        wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
         exit;
 }
 
@@ -105,7 +105,7 @@ wp_enqueue_script('admin-comments');
 enqueue_comment_hotkeys_js();
 
 if ( $post_id )
-       $title = sprintf(__('Comments on &#8220;%s&#8221;'), wp_html_excerpt(_draft_or_post_title($post_id), 50));
+       $title = sprintf( __( 'Comments on &#8220;%s&#8221;' ), wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '&hellip;' ) );
 else
        $title = __('Comments');
 
@@ -143,17 +143,17 @@ require_once('./admin-header.php');
 <?php screen_icon(); ?>
 <h2><?php
 if ( $post_id )
-       echo sprintf(__('Comments on &#8220;%s&#8221;'),
-               sprintf('<a href="%s">%s</a>',
-                       get_edit_post_link($post_id),
-                       wp_html_excerpt(_draft_or_post_title($post_id), 50)
+       echo sprintf( __( 'Comments on &#8220;%s&#8221;' ),
+               sprintf( '<a href="%s">%s</a>',
+                       get_edit_post_link( $post_id ),
+                       wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '&hellip;' )
                )
        );
 else
        echo __('Comments');
 
 if ( isset($_REQUEST['s']) && $_REQUEST['s'] )
-       printf( '<span class="subtitle">' . sprintf( __( 'Search results for &#8220;%s&#8221;' ), wp_html_excerpt( esc_html( stripslashes( $_REQUEST['s'] ) ), 50 ) ) . '</span>' ); ?>
+       printf( '<span class="subtitle">' . sprintf( __( 'Search results for &#8220;%s&#8221;' ), wp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50, '&hellip;' ) ) . '</span>' ); ?>
 </h2>
 
 <?php
index fdf21139e520997abe16b7dac110e3923e408f99..f3a65e52cc1f56508c27e71e59bd90815b2d1f5b 100644 (file)
@@ -29,6 +29,9 @@ if ( post_type_supports($post_type, 'editor') || post_type_supports($post_type,
        wp_enqueue_media( array( 'post' => $post_ID ) );
 }
 
+// Add the local autosave notice HTML
+add_action( 'admin_footer', '_local_storage_notice' );
+
 $messages = array();
 $messages['post'] = array(
         0 => '', // Unused. Messages start at index 1.
@@ -95,6 +98,9 @@ if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql
                        break;
                }
        }
+       // If this autosave isn't different from the current post, begone.
+       if ( ! $notice )
+               wp_delete_post_revision( $autosave->ID );
        unset($autosave_field, $_autosave_field);
 }
 
@@ -103,13 +109,30 @@ $post_type_object = get_post_type_object($post_type);
 // All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).
 require_once('./includes/meta-boxes.php');
 
+
+$publish_callback_args = null;
+if ( post_type_supports($post_type, 'revisions') && 'auto-draft' != $post->post_status ) {
+       $revisions = wp_get_post_revisions( $post_ID );
+
+       // Check if the revisions have been upgraded
+       if ( ! empty( $revisions ) && _wp_get_post_revision_version( end( $revisions ) ) < 1 )
+               _wp_upgrade_revisions_of_post( $post, $revisions );
+
+       // We should aim to show the revisions metabox only when there are revisions.
+       if ( count( $revisions ) > 1 ) {
+               reset( $revisions ); // Reset pointer for key()
+               $publish_callback_args = array( 'revisions_count' => count( $revisions ), 'revision_id' => key( $revisions ) );
+               add_meta_box('revisionsdiv', __('Revisions'), 'post_revisions_meta_box', null, 'normal', 'core');
+       }
+}
+
 if ( 'attachment' == $post_type ) {
        wp_enqueue_script( 'image-edit' );
        wp_enqueue_style( 'imgareaselect' );
        add_meta_box( 'submitdiv', __('Save'), 'attachment_submit_meta_box', null, 'side', 'core' );
        add_action( 'edit_form_after_title', 'edit_form_image_editor' );
 } else {
-       add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', null, 'side', 'core' );
+       add_meta_box( 'submitdiv', __( 'Publish' ), 'post_submit_meta_box', null, 'side', 'core', $publish_callback_args );
 }
 
 if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post_type, 'post-formats' ) )
@@ -132,8 +155,15 @@ foreach ( get_object_taxonomies( $post ) as $tax_name ) {
 if ( post_type_supports($post_type, 'page-attributes') )
        add_meta_box('pageparentdiv', 'page' == $post_type ? __('Page Attributes') : __('Attributes'), 'page_attributes_meta_box', null, 'side', 'core');
 
-if ( current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' ) )
-               add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', null, 'side', 'low');
+$audio_post_support = $video_post_support = false;
+$theme_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' );
+if ( 'attachment' === $post_type && ! empty( $post->post_mime_type ) ) {
+       $audio_post_support = 0 === strpos( $post->post_mime_type, 'audio/' ) && current_theme_supports( 'post-thumbnails', 'attachment:audio' ) && post_type_supports( 'attachment:audio', 'thumbnail' );
+       $video_post_support = 0 === strpos( $post->post_mime_type, 'video/' ) && current_theme_supports( 'post-thumbnails', 'attachment:video' ) && post_type_supports( 'attachment:video', 'thumbnail' );
+}
+
+if ( $theme_support || $audio_post_support || $video_post_support )
+       add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', null, 'side', 'low');
 
 if ( post_type_supports($post_type, 'excerpt') )
        add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', null, 'normal', 'core');
@@ -159,9 +189,6 @@ if ( post_type_supports($post_type, 'author') ) {
                add_meta_box('authordiv', __('Author'), 'post_author_meta_box', null, 'normal', 'core');
 }
 
-if ( post_type_supports($post_type, 'revisions') && 0 < $post_ID && wp_get_post_revisions( $post_ID ) )
-       add_meta_box('revisionsdiv', __('Revisions'), 'post_revisions_meta_box', null, 'normal', 'core');
-
 do_action('add_meta_boxes', $post_type, $post);
 do_action('add_meta_boxes_' . $post_type, $post);
 
@@ -291,11 +318,17 @@ if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create
        echo ' <a href="' . esc_url( $post_new_file ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
 ?></h2>
 <?php if ( $notice ) : ?>
-<div id="notice" class="error"><p><?php echo $notice ?></p></div>
+<div id="notice" class="error"><p id="has-newer-autosave"><?php echo $notice ?></p></div>
 <?php endif; ?>
 <?php if ( $message ) : ?>
 <div id="message" class="updated"><p><?php echo $message; ?></p></div>
 <?php endif; ?>
+<div id="lost-connection-notice" class="error hidden">
+       <p><span class="spinner"></span> <?php _e( '<strong>Connection lost.</strong> Saving has been disabled until you&#8217;re reconnected.' ); ?>
+       <span class="hide-if-no-sessionstorage"><?php _e( 'We&#8217;re backing up this post in your browser, just in case.' ); ?></span>
+       </p>
+</div>
+
 <form name="post" action="post.php" method="post" id="post"<?php do_action('post_edit_form_tag', $post); ?>>
 <?php wp_nonce_field($nonce_action); ?>
 <input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID ?>" />
@@ -304,7 +337,7 @@ if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create
 <input type="hidden" id="post_author" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" />
 <input type="hidden" id="post_type" name="post_type" value="<?php echo esc_attr( $post_type ) ?>" />
 <input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo esc_attr( $post->post_status) ?>" />
-<input type="hidden" id="referredby" name="referredby" value="<?php echo esc_url(stripslashes(wp_get_referer())); ?>" />
+<input type="hidden" id="referredby" name="referredby" value="<?php echo esc_url(wp_get_referer()); ?>" />
 <?php if ( ! empty( $active_post_lock ) ) { ?>
 <input type="hidden" id="active_post_lock" value="<?php echo esc_attr( implode( ':', $active_post_lock ) ); ?>" />
 <?php
@@ -320,9 +353,9 @@ wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
 ?>
 
 <div id="poststuff">
-
 <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
 <div id="post-body-content">
+
 <?php if ( post_type_supports($post_type, 'title') ) { ?>
 <div id="titlediv">
 <div id="titlewrap">
@@ -336,10 +369,12 @@ $shortlink = wp_get_shortlink($post->ID, 'post');
 if ( !empty($shortlink) )
     $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button button-small" onclick="prompt(&#39;URL:&#39;, jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>';
 
-if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?>
+if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) {
+       $has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status;
+?>
        <div id="edit-slug-box" class="hide-if-no-js">
        <?php
-               if ( $sample_permalink_html && 'auto-draft' != $post->post_status )
+               if ( $has_sample_permalink )
                        echo $sample_permalink_html;
        ?>
        </div>
@@ -358,10 +393,13 @@ do_action( 'edit_form_after_title', $post );
 
 if ( post_type_supports($post_type, 'editor') ) {
 ?>
-<div id="postdivrich" class="postarea">
-
-<?php wp_editor($post->post_content, 'content', array('dfw' => true, 'tabfocus_elements' => 'sample-permalink,post-preview', 'editor_height' => 360) ); ?>
+<div id="postdivrich" class="postarea edit-form-section">
 
+<?php wp_editor( $post->post_content, 'content', array(
+       'dfw' => true,
+       'tabfocus_elements' => 'insert-media-button,save-post',
+       'editor_height' => 360,
+) ); ?>
 <table id="post-status-info" cellspacing="0"><tbody><tr>
        <td id="wp-word-count"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td>
        <td class="autosave-info">
@@ -381,9 +419,10 @@ if ( post_type_supports($post_type, 'editor') ) {
 </tr></tbody></table>
 
 </div>
-<?php } ?>
+<?php }
 
-<?php do_action( 'edit_form_after_editor', $post ); ?>
+do_action( 'edit_form_after_editor', $post );
+?>
 </div><!-- /post-body-content -->
 
 <div id="postbox-container-1" class="postbox-container">
index 14a2966804d00b003c73dd09d0057a011269ab55..d9a0523edfe4f92cf4aa14fbe65b142f71744fa6 100644 (file)
@@ -23,7 +23,7 @@ if ( !defined('ABSPATH') )
 <input type="hidden" name="comment_post_ID" value="<?php echo esc_attr( $comment->comment_post_ID ); ?>" />
 
 <div id="post-body" class="metabox-holder columns-2">
-<div id="post-body-content">
+<div id="post-body-content" class="edit-form-section">
 <div id="namediv" class="stuffbox">
 <h3><label for="name"><?php _e( 'Author' ) ?></label></h3>
 <div class="inside">
@@ -63,7 +63,7 @@ if ( !defined('ABSPATH') )
 
 <div id="postdiv" class="postarea">
 <?php
-       $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' );
+       $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );
        wp_editor( $comment->comment_content, 'content', array( 'media_buttons' => false, 'tinymce' => false, 'quicktags' => $quicktags_settings ) );
        wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
 </div>
@@ -132,7 +132,7 @@ do_meta_boxes(null, 'normal', $comment);
 
 <input type="hidden" name="c" value="<?php echo esc_attr($comment->comment_ID) ?>" />
 <input type="hidden" name="p" value="<?php echo esc_attr($comment->comment_post_ID) ?>" />
-<input name="referredby" type="hidden" id="referredby" value="<?php echo esc_url(stripslashes(wp_get_referer())); ?>" />
+<input name="referredby" type="hidden" id="referredby" value="<?php echo esc_url( wp_get_referer() ); ?>" />
 <?php wp_original_referer_field(true, 'previous'); ?>
 <input type="hidden" name="noredir" value="1" />
 
index 6d81ec01440d637424ed54280be53b5528f9cd3b..0aca6e7bc12511d1dfe9edc2b4c1d0341cadc1a8 100644 (file)
@@ -126,7 +126,6 @@ do_meta_boxes(null, 'advanced', $link);
 if ( $link_id ) : ?>
 <input type="hidden" name="action" value="save" />
 <input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
-<input type="hidden" name="order_by" value="<?php echo esc_attr($order_by); ?>" />
 <input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" />
 <?php else: ?>
 <input type="hidden" name="action" value="add" />
index 7250a66984db7a723f3e574f4d0750db5ffdb84f..8375202df25bd367f3d05cffe8b3e8a1b3bd8ccd 100644 (file)
@@ -164,7 +164,7 @@ break;
 
 default:
 if ( ! empty($_REQUEST['_wp_http_referer']) ) {
-       $location = remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) );
+       $location = remove_query_arg( array('_wp_http_referer', '_wpnonce'), wp_unslash($_SERVER['REQUEST_URI']) );
 
        if ( ! empty( $_REQUEST['paged'] ) )
                $location = add_query_arg( 'paged', (int) $_REQUEST['paged'] );
@@ -265,7 +265,7 @@ $messages[6] = __('Items deleted.');
 <?php screen_icon(); ?>
 <h2><?php echo esc_html( $title );
 if ( !empty($_REQUEST['s']) )
-       printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( stripslashes($_REQUEST['s']) ) ); ?>
+       printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( wp_unslash($_REQUEST['s']) ) ); ?>
 </h2>
 
 <?php if ( isset($_REQUEST['message']) && ( $msg = (int) $_REQUEST['message'] ) ) : ?>
index 9eae3cf395fd1158114c83aa9d6d12ba60b45c66..65fd03426aa4b5fbbf8c23c5a393008df7701fdf 100644 (file)
@@ -48,7 +48,7 @@ $doaction = $wp_list_table->current_action();
 if ( $doaction ) {
        check_admin_referer('bulk-posts');
 
-       $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() );
+       $sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'locked', 'ids'), wp_get_referer() );
        if ( ! $sendback )
                $sendback = admin_url( $parent_file );
        $sendback = add_query_arg( 'paged', $pagenum, $sendback );
@@ -75,22 +75,29 @@ if ( $doaction ) {
 
        switch ( $doaction ) {
                case 'trash':
-                       $trashed = 0;
+                       $trashed = $locked = 0;
+
                        foreach( (array) $post_ids as $post_id ) {
-                               if ( !current_user_can($post_type_object->cap->delete_post, $post_id) )
+                               if ( !current_user_can( 'delete_post', $post_id) )
                                        wp_die( __('You are not allowed to move this item to the Trash.') );
 
+                               if ( wp_check_post_lock( $post_id ) ) {
+                                       $locked++;
+                                       continue;
+                               }
+
                                if ( !wp_trash_post($post_id) )
                                        wp_die( __('Error in moving to Trash.') );
 
                                $trashed++;
                        }
-                       $sendback = add_query_arg( array('trashed' => $trashed, 'ids' => join(',', $post_ids) ), $sendback );
+
+                       $sendback = add_query_arg( array('trashed' => $trashed, 'ids' => join(',', $post_ids), 'locked' => $locked ), $sendback );
                        break;
                case 'untrash':
                        $untrashed = 0;
                        foreach( (array) $post_ids as $post_id ) {
-                               if ( !current_user_can($post_type_object->cap->delete_post, $post_id) )
+                               if ( !current_user_can( 'delete_post', $post_id) )
                                        wp_die( __('You are not allowed to restore this item from the Trash.') );
 
                                if ( !wp_untrash_post($post_id) )
@@ -105,15 +112,15 @@ if ( $doaction ) {
                        foreach( (array) $post_ids as $post_id ) {
                                $post_del = get_post($post_id);
 
-                               if ( !current_user_can($post_type_object->cap->delete_post, $post_id) )
+                               if ( !current_user_can( 'delete_post', $post_id ) )
                                        wp_die( __('You are not allowed to delete this item.') );
 
                                if ( $post_del->post_type == 'attachment' ) {
                                        if ( ! wp_delete_attachment($post_id) )
-                                               wp_die( __('Error in deleting...') );
+                                               wp_die( __('Error in deleting.') );
                                } else {
                                        if ( !wp_delete_post($post_id) )
-                                               wp_die( __('Error in deleting...') );
+                                               wp_die( __('Error in deleting.') );
                                }
                                $deleted++;
                        }
@@ -138,7 +145,7 @@ if ( $doaction ) {
        wp_redirect($sendback);
        exit();
 } elseif ( ! empty($_REQUEST['_wp_http_referer']) ) {
-        wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
+        wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), wp_unslash($_SERVER['REQUEST_URI']) ) );
         exit;
 }
 
index 1b462adcfe23450bdd72e591d3821b8553d8985a..d7accd1b5ad4ef65aa4d6c69787e4ec51a122b28 100644 (file)
@@ -19,7 +19,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
 
 <h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
 
-<div class="about-text"><?php printf( __( 'Thank you for updating to the latest version! WordPress %s is more polished and enjoyable than ever before. We hope you like it.' ), $display_version ); ?></div>
+<div class="about-text"><?php printf( __( 'Thank you for updating to the latest version. WordPress %s makes your writing experience even better.' ), $display_version ); ?></div>
 
 <div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
 
@@ -46,8 +46,8 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
 
 <p><?php
 
-$plugins_url = current_user_can( 'activate_plugins' ) ? admin_url( 'plugins.php' ) : 'http://wordpress.org/extend/plugins/';
-$themes_url = current_user_can( 'switch_themes' ) ? admin_url( 'themes.php' ) : 'http://wordpress.org/extend/themes/';
+$plugins_url = current_user_can( 'activate_plugins' ) ? admin_url( 'plugins.php' ) : 'http://wordpress.org/plugins/';
+$themes_url = current_user_can( 'switch_themes' ) ? admin_url( 'themes.php' ) : 'http://wordpress.org/themes/';
 
 printf( __( 'Every plugin and theme in WordPress.org&#8217;s directory is 100%% GPL or a similarly free and compatible license, so you can feel safe finding <a href="%1$s">plugins</a> and <a href="%2$s">themes</a> there. If you get a plugin or theme from another source, make sure to <a href="%3$s">ask them if it&#8217;s GPL</a> first. If they don&#8217;t respect the WordPress license, we don&#8217;t recommend them.' ), $plugins_url, $themes_url, 'http://wordpress.org/about/license/' ); ?></p>
 
diff --git a/wp-admin/images/arrows-pr-2x.png b/wp-admin/images/arrows-pr-2x.png
new file mode 100644 (file)
index 0000000..a384c40
Binary files /dev/null and b/wp-admin/images/arrows-pr-2x.png differ
diff --git a/wp-admin/images/arrows-pr.png b/wp-admin/images/arrows-pr.png
new file mode 100644 (file)
index 0000000..b2b909b
Binary files /dev/null and b/wp-admin/images/arrows-pr.png differ
diff --git a/wp-admin/images/lock-2x.png b/wp-admin/images/lock-2x.png
new file mode 100644 (file)
index 0000000..46c5a48
Binary files /dev/null and b/wp-admin/images/lock-2x.png differ
diff --git a/wp-admin/images/lock.png b/wp-admin/images/lock.png
new file mode 100644 (file)
index 0000000..e17cc7d
Binary files /dev/null and b/wp-admin/images/lock.png differ
diff --git a/wp-admin/images/post-formats-vs.png b/wp-admin/images/post-formats-vs.png
new file mode 100644 (file)
index 0000000..c8e7e8d
Binary files /dev/null and b/wp-admin/images/post-formats-vs.png differ
diff --git a/wp-admin/images/post-formats.png b/wp-admin/images/post-formats.png
new file mode 100644 (file)
index 0000000..2d749be
Binary files /dev/null and b/wp-admin/images/post-formats.png differ
diff --git a/wp-admin/images/post-formats32-vs.png b/wp-admin/images/post-formats32-vs.png
new file mode 100644 (file)
index 0000000..af2c59f
Binary files /dev/null and b/wp-admin/images/post-formats32-vs.png differ
diff --git a/wp-admin/images/post-formats32.png b/wp-admin/images/post-formats32.png
new file mode 100644 (file)
index 0000000..ccafc80
Binary files /dev/null and b/wp-admin/images/post-formats32.png differ
diff --git a/wp-admin/images/screenshots/about-color-picker.png b/wp-admin/images/screenshots/about-color-picker.png
deleted file mode 100644 (file)
index 86e8e95..0000000
Binary files a/wp-admin/images/screenshots/about-color-picker.png and /dev/null differ
diff --git a/wp-admin/images/screenshots/about-media.png b/wp-admin/images/screenshots/about-media.png
deleted file mode 100644 (file)
index f147cce..0000000
Binary files a/wp-admin/images/screenshots/about-media.png and /dev/null differ
diff --git a/wp-admin/images/screenshots/about-retina.png b/wp-admin/images/screenshots/about-retina.png
deleted file mode 100644 (file)
index 9d634bb..0000000
Binary files a/wp-admin/images/screenshots/about-retina.png and /dev/null differ
diff --git a/wp-admin/images/screenshots/about-twenty-twelve.png b/wp-admin/images/screenshots/about-twenty-twelve.png
deleted file mode 100644 (file)
index a950254..0000000
Binary files a/wp-admin/images/screenshots/about-twenty-twelve.png and /dev/null differ
index c39effe75ef42f4fb58b0bb94f5cc00d59630be9..734409fe1f1bac0f8bbb2ce48d2aec3e1f7cd4ad 100644 (file)
  * No-privilege Ajax handlers.
  */
 
-function wp_ajax_nopriv_autosave() {
-       $id = isset( $_POST['post_ID'] ) ? (int) $_POST['post_ID'] : 0;
+/**
+ * Heartbeat API (experimental)
+ *
+ * Runs when the user is not logged in.
+ */
+function wp_ajax_nopriv_heartbeat() {
+       $response = array();
 
-       if ( ! $id )
-               wp_die( -1 );
+       // screen_id is the same as $current_screen->id and the JS global 'pagenow'
+       if ( ! empty($_POST['screen_id']) )
+               $screen_id = sanitize_key($_POST['screen_id']);
+       else
+               $screen_id = 'front';
 
-       $message = sprintf( __('<strong>ALERT: You are logged out!</strong> Could not save draft. <a href="%s" target="_blank">Please log in again.</a>'), wp_login_url() );
-       $x = new WP_Ajax_Response( array(
-               'what' => 'autosave',
-               'id' => $id,
-               'data' => $message
-       ) );
-       $x->send();
+       if ( ! empty($_POST['data']) ) {
+               $data = wp_unslash( (array) $_POST['data'] );
+               $response = apply_filters( 'heartbeat_nopriv_received', $response, $data, $screen_id );
+       }
+
+       $response = apply_filters( 'heartbeat_nopriv_send', $response, $screen_id );
+
+       // Allow the transport to be replaced with long-polling easily
+       do_action( 'heartbeat_nopriv_tick', $response, $screen_id );
+
+       // send the current time according to the server
+       $response['server_time'] = time();
+
+       wp_send_json($response);
 }
 
 /*
@@ -59,7 +74,7 @@ function wp_ajax_ajax_tag_search() {
                wp_die( 0 );
        }
 
-       $s = stripslashes( $_GET['q'] );
+       $s = wp_unslash( $_GET['q'] );
 
        $comma = _x( ',', 'tag delimiter' );
        if ( ',' !== $comma )
@@ -559,7 +574,7 @@ function wp_ajax_add_link_category( $action ) {
        check_ajax_referer( $action );
        if ( !current_user_can( 'manage_categories' ) )
                wp_die( -1 );
-       $names = explode(',', $_POST['newcat']);
+       $names = explode(',', wp_unslash( $_POST['newcat'] ) );
        $x = new WP_Ajax_Response();
        foreach ( $names as $cat_name ) {
                $cat_name = trim($cat_name);
@@ -572,7 +587,7 @@ function wp_ajax_add_link_category( $action ) {
                        continue;
                else if ( is_array( $cat_id ) )
                        $cat_id = $cat_id['term_id'];
-               $cat_name = esc_html(stripslashes($cat_name));
+               $cat_name = esc_html( $cat_name );
                $x->add( array(
                        'what' => 'link-category',
                        'id' => $cat_id,
@@ -651,7 +666,7 @@ function wp_ajax_get_tagcloud() {
        $tags = get_terms( $taxonomy, array( 'number' => 45, 'orderby' => 'count', 'order' => 'DESC' ) );
 
        if ( empty( $tags ) )
-               wp_die( isset( $tax->no_tagcloud ) ? $tax->no_tagcloud : __('No tags found!') );
+               wp_die( $tax->labels->not_found );
 
        if ( is_wp_error( $tags ) )
                wp_die( $tags->get_error_message() );
@@ -715,22 +730,24 @@ function wp_ajax_replyto_comment( $action ) {
        check_ajax_referer( $action, '_ajax_nonce-replyto-comment' );
 
        $comment_post_ID = (int) $_POST['comment_post_ID'];
-       if ( !current_user_can( 'edit_post', $comment_post_ID ) )
+       $post = get_post( $comment_post_ID );
+       if ( ! $post )
                wp_die( -1 );
 
-       $status = $wpdb->get_var( $wpdb->prepare("SELECT post_status FROM $wpdb->posts WHERE ID = %d", $comment_post_ID) );
+       if ( !current_user_can( 'edit_post', $comment_post_ID ) )
+               wp_die( -1 );
 
-       if ( empty($status) )
+       if ( empty( $post->post_status ) )
                wp_die( 1 );
-       elseif ( in_array($status, array('draft', 'pending', 'trash') ) )
+       elseif ( in_array($post->post_status, array('draft', 'pending', 'trash') ) )
                wp_die( __('ERROR: you are replying to a comment on a draft post.') );
 
        $user = wp_get_current_user();
        if ( $user->exists() ) {
                $user_ID = $user->ID;
-               $comment_author       = $wpdb->escape($user->display_name);
-               $comment_author_email = $wpdb->escape($user->user_email);
-               $comment_author_url   = $wpdb->escape($user->user_url);
+               $comment_author       = wp_slash( $user->display_name );
+               $comment_author_email = wp_slash( $user->user_email );
+               $comment_author_url   = wp_slash( $user->user_url );
                $comment_content      = trim($_POST['content']);
                if ( current_user_can( 'unfiltered_html' ) ) {
                        if ( wp_create_nonce( 'unfiltered-html-comment' ) != $_POST['_wp_unfiltered_html_comment'] ) {
@@ -903,6 +920,7 @@ function wp_ajax_add_menu_item() {
                );
                echo walk_nav_menu_tree( $menu_items, 0, (object) $args );
        }
+       wp_die();
 }
 
 function wp_ajax_add_meta() {
@@ -924,7 +942,7 @@ function wp_ajax_add_meta() {
                        $_POST['post_type'] = $post->post_type;
                        $_POST['post_status'] = 'draft';
                        $now = current_time('timestamp', 1);
-                       $_POST['post_title'] = sprintf('Draft created on %s at %s', date(get_option('date_format'), $now), date(get_option('time_format'), $now));
+                       $_POST['post_title'] = sprintf( __( 'Draft created on %1$s at %2$s' ), date( get_option( 'date_format' ), $now ), date( get_option( 'time_format' ), $now ) );
 
                        if ( $pid = edit_post() ) {
                                if ( is_wp_error( $pid ) ) {
@@ -956,8 +974,8 @@ function wp_ajax_add_meta() {
                ) );
        } else { // Update?
                $mid = (int) key( $_POST['meta'] );
-               $key = stripslashes( $_POST['meta'][$mid]['key'] );
-               $value = stripslashes( $_POST['meta'][$mid]['value'] );
+               $key = wp_unslash( $_POST['meta'][$mid]['key'] );
+               $value = wp_unslash( $_POST['meta'][$mid]['value'] );
                if ( '' == trim($key) )
                        wp_die( __( 'Please provide a custom field name.' ) );
                if ( '' == trim($value) )
@@ -1024,68 +1042,51 @@ function wp_ajax_add_user( $action ) {
 }
 
 function wp_ajax_autosave() {
-       global $login_grace_period;
-
        define( 'DOING_AUTOSAVE', true );
 
-       $nonce_age = check_ajax_referer( 'autosave', 'autosavenonce' );
+       check_ajax_referer( 'autosave', 'autosavenonce' );
 
        $_POST['post_category'] = explode(",", $_POST['catslist']);
        if ( $_POST['post_type'] == 'page' || empty($_POST['post_category']) )
                unset($_POST['post_category']);
 
-       $do_autosave = (bool) $_POST['autosave'];
-       $do_lock = true;
-
-       $data = $alert = '';
-       /* translators: draft saved date format, see http://php.net/date */
-       $draft_saved_date_format = __('g:i:s a');
-       /* translators: %s: date and time */
-       $message = sprintf( __('Draft saved at %s.'), date_i18n( $draft_saved_date_format ) );
-
+       $data = '';
        $supplemental = array();
-       if ( isset($login_grace_period) )
-               $alert .= sprintf( __('Your login has expired. Please open a new browser window and <a href="%s" target="_blank">log in again</a>. '), add_query_arg( 'interim-login', 1, wp_login_url() ) );
-
        $id = $revision_id = 0;
 
-       $post_ID = (int) $_POST['post_ID'];
-       $_POST['ID'] = $post_ID;
-       $post = get_post($post_ID);
+       $post_id = (int) $_POST['post_id'];
+       $_POST['ID'] = $_POST['post_ID'] = $post_id;
+       $post = get_post($post_id);
        if ( 'auto-draft' == $post->post_status )
                $_POST['post_status'] = 'draft';
 
-       if ( $last = wp_check_post_lock( $post->ID ) ) {
-               $do_autosave = $do_lock = false;
-
-               $last_user = get_userdata( $last );
-               $last_user_name = $last_user ? $last_user->display_name : __( 'Someone' );
-               $data = __( 'Autosave disabled.' );
-
-               $supplemental['disable_autosave'] = 'disable';
-               $alert .= sprintf( __( '%s is currently editing this article. If you update it, you will overwrite the changes.' ), esc_html( $last_user_name ) );
-       }
-
        if ( 'page' == $post->post_type ) {
-               if ( !current_user_can('edit_page', $post_ID) )
+               if ( !current_user_can('edit_page', $post->ID) )
                        wp_die( __( 'You are not allowed to edit this page.' ) );
        } else {
-               if ( !current_user_can('edit_post', $post_ID) )
+               if ( !current_user_can('edit_post', $post->ID) )
                        wp_die( __( 'You are not allowed to edit this post.' ) );
        }
 
-       if ( $do_autosave ) {
-               // Drafts and auto-drafts are just overwritten by autosave
-               if ( 'auto-draft' == $post->post_status || 'draft' == $post->post_status ) {
+       if ( ! empty( $_POST['autosave'] ) ) {
+               if ( ! wp_check_post_lock( $post->ID ) && get_current_user_id() == $post->post_author && ( 'auto-draft' == $post->post_status || 'draft' == $post->post_status ) ) {
+                       // Drafts and auto-drafts are just overwritten by autosave for the same user if the post is not locked
                        $id = edit_post();
-               } else { // Non drafts are not overwritten. The autosave is stored in a special post revision.
+               } else {
+                       // Non drafts or other users drafts are not overwritten. The autosave is stored in a special post revision for each user.
                        $revision_id = wp_create_post_autosave( $post->ID );
                        if ( is_wp_error($revision_id) )
                                $id = $revision_id;
                        else
                                $id = $post->ID;
                }
-               $data = $message;
+
+               if ( ! is_wp_error($id) ) {
+                       /* translators: draft saved date format, see http://php.net/date */
+                       $draft_saved_date_format = __('g:i:s a');
+                       /* translators: %s: date and time */
+                       $data = sprintf( __('Draft saved at %s.'), date_i18n( $draft_saved_date_format ) );
+               }
        } else {
                if ( ! empty( $_POST['auto_draft'] ) )
                        $id = 0; // This tells us it didn't actually save
@@ -1093,32 +1094,11 @@ function wp_ajax_autosave() {
                        $id = $post->ID;
        }
 
-       if ( $do_lock && empty( $_POST['auto_draft'] ) && $id && is_numeric( $id ) ) {
-               $lock_result = wp_set_post_lock( $id );
-               $supplemental['active-post-lock'] = implode( ':', $lock_result );
-       }
-
-       if ( $nonce_age == 2 ) {
-               $supplemental['replace-autosavenonce'] = wp_create_nonce('autosave');
-               $supplemental['replace-getpermalinknonce'] = wp_create_nonce('getpermalink');
-               $supplemental['replace-samplepermalinknonce'] = wp_create_nonce('samplepermalink');
-               $supplemental['replace-closedpostboxesnonce'] = wp_create_nonce('closedpostboxes');
-               $supplemental['replace-_ajax_linking_nonce'] = wp_create_nonce( 'internal-linking' );
-               if ( $id ) {
-                       if ( $_POST['post_type'] == 'post' )
-                               $supplemental['replace-_wpnonce'] = wp_create_nonce('update-post_' . $id);
-                       elseif ( $_POST['post_type'] == 'page' )
-                               $supplemental['replace-_wpnonce'] = wp_create_nonce('update-page_' . $id);
-               }
-       }
-
-       if ( ! empty($alert) )
-               $supplemental['alert'] = $alert;
-
+       // @todo Consider exposing any errors, rather than having 'Saving draft...'
        $x = new WP_Ajax_Response( array(
                'what' => 'autosave',
                'id' => $id,
-               'data' => $id ? $data : '',
+               'data' => $data,
                'supplemental' => $supplemental
        ) );
        $x->send();
@@ -1226,7 +1206,7 @@ function wp_ajax_wp_link_ajax() {
        $args = array();
 
        if ( isset( $_POST['search'] ) )
-               $args['s'] = stripslashes( $_POST['search'] );
+               $args['s'] = wp_unslash( $_POST['search'] );
        $args['pagenum'] = ! empty( $_POST['page'] ) ? absint( $_POST['page'] ) : 1;
 
        require(ABSPATH . WPINC . '/class-wp-editor.php');
@@ -1327,7 +1307,7 @@ function wp_ajax_inline_save() {
        $data = &$_POST;
 
        $post = get_post( $post_ID, ARRAY_A );
-       $post = add_magic_quotes($post); //since it is from db
+       $post = wp_slash($post); //since it is from db
 
        $data['content'] = $post['post_content'];
        $data['excerpt'] = $post['post_excerpt'];
@@ -1349,6 +1329,12 @@ function wp_ajax_inline_save() {
        if ( empty($data['ping_status']) )
                $data['ping_status'] = 'closed';
 
+       // Hack: wp_unique_post_slug() doesn't work for drafts, so we will fake that our post is published.
+       if ( ! empty( $data['post_name'] ) && in_array( $post['post_status'], array( 'draft', 'pending' ) ) ) {
+               $post['post_status'] = 'publish';
+               $data['post_name'] = wp_unique_post_slug( $data['post_name'], $post['ID'], $post['post_status'], $post['post_type'], $post['post_parent'] );
+       }
+
        // update the post
        edit_post();
 
@@ -1412,7 +1398,7 @@ function wp_ajax_inline_save_tax() {
                $parent = $parent_tag->parent;
                $level++;
        }
-       echo $wp_list_table->single_row( $tag, $level );
+       $wp_list_table->single_row( $tag, $level );
        wp_die();
 }
 
@@ -1424,7 +1410,7 @@ function wp_ajax_find_posts() {
        $post_types = get_post_types( array( 'public' => true ), 'objects' );
        unset( $post_types['attachment'] );
 
-       $s = stripslashes( $_POST['ps'] );
+       $s = wp_unslash( $_POST['ps'] );
        $searchand = $search = '';
        $args = array(
                'post_type' => array_keys( $post_types ),
@@ -1776,7 +1762,7 @@ function wp_ajax_wp_remove_post_lock() {
        if ( $active_lock[1] != get_current_user_id() )
                wp_die( 0 );
 
-       $new_lock = ( time() - apply_filters( 'wp_check_post_lock_window', AUTOSAVE_INTERVAL * 2 ) + 5 ) . ':' . $active_lock[1];
+       $new_lock = ( time() - apply_filters( 'wp_check_post_lock_window', 120 ) + 5 ) . ':' . $active_lock[1];
        update_post_meta( $post_id, '_edit_lock', $new_lock, implode( ':', $active_lock ) );
        wp_die( 1 );
 }
@@ -1888,11 +1874,10 @@ function wp_ajax_save_attachment() {
                $post['post_content'] = $changes['description'];
 
        if ( isset( $changes['alt'] ) ) {
-               $alt = get_post_meta( $id, '_wp_attachment_image_alt', true );
-               $new_alt = stripslashes( $changes['alt'] );
-               if ( $alt != $new_alt ) {
-                       $new_alt = wp_strip_all_tags( $new_alt, true );
-                       update_post_meta( $id, '_wp_attachment_image_alt', addslashes( $new_alt ) );
+               $alt = wp_unslash( $changes['alt'] );
+               if ( $alt != get_post_meta( $id, '_wp_attachment_image_alt', true ) ) {
+                       $alt = wp_strip_all_tags( $alt, true );
+                       update_post_meta( $id, '_wp_attachment_image_alt', wp_slash( $alt ) );
                }
        }
 
@@ -1989,7 +1974,7 @@ function wp_ajax_save_attachment_order() {
 function wp_ajax_send_attachment_to_editor() {
        check_ajax_referer( 'media-send-to-editor', 'nonce' );
 
-       $attachment = stripslashes_deep( $_POST['attachment'] );
+       $attachment = wp_unslash( $_POST['attachment'] );
 
        $id = intval( $attachment['id'] );
 
@@ -2015,7 +2000,7 @@ function wp_ajax_send_attachment_to_editor() {
                $html = '<a href="' . esc_url( $url ) . '"' . $rel . '>' . $html . '</a>';
        }
 
-       remove_filter( 'media_send_to_editor', 'image_media_send_to_editor', 10, 3 );
+       remove_filter( 'media_send_to_editor', 'image_media_send_to_editor' );
 
        if ( 'image' === substr( $post->post_mime_type, 0, 5 ) ) {
                $align = isset( $attachment['align'] ) ? $attachment['align'] : 'none';
@@ -2024,6 +2009,8 @@ function wp_ajax_send_attachment_to_editor() {
                $caption = isset( $attachment['post_excerpt'] ) ? $attachment['post_excerpt'] : '';
                $title = ''; // We no longer insert title tags into <img> tags, as they are redundant.
                $html = get_image_send_to_editor( $id, $caption, $title, $align, $url, (bool) $rel, $size, $alt );
+       } elseif ( 'video' === substr( $post->post_mime_type, 0, 5 ) || 'audio' === substr( $post->post_mime_type, 0, 5 )  ) {
+               $html = stripslashes_deep( $_POST['html'] );
        }
 
        $html = apply_filters( 'media_send_to_editor', $html, $id, $attachment );
@@ -2044,7 +2031,7 @@ function wp_ajax_send_attachment_to_editor() {
 function wp_ajax_send_link_to_editor() {
        check_ajax_referer( 'media-send-to-editor', 'nonce' );
 
-       if ( ! $src = stripslashes( $_POST['src'] ) )
+       if ( ! $src = wp_unslash( $_POST['src'] ) )
                wp_send_json_error();
 
        if ( ! strpos( $src, '://' ) )
@@ -2053,7 +2040,7 @@ function wp_ajax_send_link_to_editor() {
        if ( ! $src = esc_url_raw( $src ) )
                wp_send_json_error();
 
-       if ( ! $title = trim( stripslashes( $_POST['title'] ) ) )
+       if ( ! $title = trim( wp_unslash( $_POST['title'] ) ) )
                $title = wp_basename( $src );
 
        $html = '';
@@ -2070,3 +2057,69 @@ function wp_ajax_send_link_to_editor() {
 
        wp_send_json_success( $html );
 }
+
+/**
+ * Heartbeat API (experimental)
+ *
+ * Runs when the user is logged in.
+ */
+function wp_ajax_heartbeat() {
+       if ( empty( $_POST['_nonce'] ) )
+               wp_send_json_error();
+
+       $response = array();
+
+       if ( false === wp_verify_nonce( $_POST['_nonce'], 'heartbeat-nonce' ) ) {
+               // User is logged in but nonces have expired.
+               $response['nonces_expired'] = true;
+               wp_send_json($response);
+       }
+
+       // screen_id is the same as $current_screen->id and the JS global 'pagenow'
+       if ( ! empty($_POST['screen_id']) )
+               $screen_id = sanitize_key($_POST['screen_id']);
+       else
+               $screen_id = 'front';
+
+       if ( ! empty($_POST['data']) ) {
+               $data = (array) $_POST['data'];
+               $response = apply_filters( 'heartbeat_received', $response, $data, $screen_id );
+       }
+
+       $response = apply_filters( 'heartbeat_send', $response, $screen_id );
+
+       // Allow the transport to be replaced with long-polling easily
+       do_action( 'heartbeat_tick', $response, $screen_id );
+
+       // Send the current time according to the server
+       $response['server_time'] = time();
+
+       wp_send_json($response);
+}
+
+function wp_ajax_get_revision_diffs() {
+       require ABSPATH . 'wp-admin/includes/revision.php';
+
+       if ( ! $post = get_post( (int) $_REQUEST['post_id'] ) )
+               wp_send_json_error();
+
+       if ( ! current_user_can( 'read_post', $post->ID ) )
+               wp_send_json_error();
+
+       // Really just pre-loading the cache here.
+       if ( ! $revisions = wp_get_post_revisions( $post->ID, array( 'check_enabled' => false ) ) )
+               wp_send_json_error();
+
+       $return = array();
+       @set_time_limit( 0 );
+
+       foreach ( $_REQUEST['compare'] as $compare_key ) {
+               list( $compare_from, $compare_to ) = explode( ':', $compare_key ); // from:to
+
+               $return[] = array(
+                       'id' => $compare_key,
+                       'fields' => wp_get_revision_ui_diff( $post, $compare_from, $compare_to ),
+               );
+       }
+       wp_send_json_success( $return );
+}
index 4d240b775c13f791de2deff3ea6a052c9db0cc96..0897fdc5a42230a728091bfbaa73c0b15d32cd5d 100644 (file)
@@ -55,12 +55,12 @@ function edit_link( $link_id = 0 ) {
 function get_default_link_to_edit() {
        $link = new stdClass;
        if ( isset( $_GET['linkurl'] ) )
-               $link->link_url = esc_url( $_GET['linkurl'] );
+               $link->link_url = esc_url( wp_unslash( $_GET['linkurl'] ) );
        else
                $link->link_url = '';
 
        if ( isset( $_GET['name'] ) )
-               $link->link_name = esc_attr( $_GET['name'] );
+               $link->link_name = esc_attr( wp_unslash( $_GET['name'] ) );
        else
                $link->link_name = '';
 
@@ -137,7 +137,7 @@ function wp_insert_link( $linkdata, $wp_error = false ) {
        $linkdata = wp_parse_args( $linkdata, $defaults );
        $linkdata = sanitize_bookmark( $linkdata, 'db' );
 
-       extract( stripslashes_deep( $linkdata ), EXTR_SKIP );
+       extract( wp_unslash( $linkdata ), EXTR_SKIP );
 
        $update = false;
 
@@ -251,7 +251,7 @@ function wp_update_link( $linkdata ) {
        $link = get_bookmark( $link_id, ARRAY_A );
 
        // Escape data pulled from DB.
-       $link = add_magic_quotes( $link );
+       $link = wp_slash( $link );
 
        // Passed link category list overwrites existing category list if not empty.
        if ( isset( $linkdata['link_category'] ) && is_array( $linkdata['link_category'] )
index c947f4484d47b86e4348adf845a4a3b2e8bc892c..c765d553eb7b0cb5f9319656f1e794b5850c2945 100644 (file)
@@ -9,7 +9,7 @@
  * @copyright Alexey Dotsenko
  * @author Alexey Dotsenko
  * @link http://www.phpclasses.org/browse/package/1743.html Site
- * @license LGPL License http://www.opensource.org/licenses/lgpl-license.html
+ * @license LGPL http://www.opensource.org/licenses/lgpl-license.html
  */
 
 /**
@@ -23,7 +23,7 @@
  * @copyright Alexey Dotsenko
  * @author Alexey Dotsenko
  * @link http://www.phpclasses.org/browse/package/1743.html Site
- * @license LGPL License http://www.opensource.org/licenses/lgpl-license.html
+ * @license LGPL http://www.opensource.org/licenses/lgpl-license.html
  */
 class ftp extends ftp_base {
 
index 4026dd0bb18ba8a391f9cfdf7c0c43f5e6171718..abdf0db682cbab2aa127bf133c952968d1ec1bf2 100644 (file)
@@ -9,7 +9,7 @@
  * @copyright Alexey Dotsenko
  * @author Alexey Dotsenko
  * @link http://www.phpclasses.org/browse/package/1743.html Site
- * @license LGPL License http://www.opensource.org/licenses/lgpl-license.html
+ * @license LGPL http://www.opensource.org/licenses/lgpl-license.html
  */
 
 /**
@@ -23,7 +23,7 @@
  * @copyright Alexey Dotsenko
  * @author Alexey Dotsenko
  * @link http://www.phpclasses.org/browse/package/1743.html Site
- * @license LGPL License http://www.opensource.org/licenses/lgpl-license.html
+ * @license LGPL http://www.opensource.org/licenses/lgpl-license.html
  */
 class ftp extends ftp_base {
 
index 1ae3e870ebf4243745d12235373d27ff311b07c7..f068f157bd8224e073d02b8948e24e4aa88ae892 100644 (file)
@@ -9,7 +9,7 @@
  * @copyright Alexey Dotsenko
  * @author Alexey Dotsenko
  * @link http://www.phpclasses.org/browse/package/1743.html Site
- * @license LGPL License http://www.opensource.org/licenses/lgpl-license.html
+ * @license LGPL http://www.opensource.org/licenses/lgpl-license.html
  */
 
 /**
index cf0ab88a82691d5c65af06313596ba770b0b234c..23f3169d04a47d5916703220f9d44d04b6952536 100644 (file)
@@ -170,7 +170,7 @@ class WP_Comments_List_Table extends WP_List_Table {
                        /*
                        // I toyed with this, but decided against it. Leaving it in here in case anyone thinks it is a good idea. ~ Mark
                        if ( !empty( $_REQUEST['s'] ) )
-                               $link = add_query_arg( 's', esc_attr( stripslashes( $_REQUEST['s'] ) ), $link );
+                               $link = add_query_arg( 's', esc_attr( wp_unslash( $_REQUEST['s'] ) ), $link );
                        */
                        $status_links[$status] = "<a href='$link'$class>" . sprintf(
                                translate_nooped_plural( $label, $num_comments->$status ),
@@ -315,7 +315,7 @@ class WP_Comments_List_Table extends WP_List_Table {
                $this->user_can = current_user_can( 'edit_comment', $comment->comment_ID );
 
                echo "<tr id='comment-$comment->comment_ID' class='$the_comment_class'>";
-               echo $this->single_row_columns( $comment );
+               $this->single_row_columns( $comment );
                echo "</tr>\n";
        }
 
@@ -336,12 +336,6 @@ class WP_Comments_List_Table extends WP_List_Table {
                $comment_url = esc_url( get_comment_link( $comment->comment_ID ) );
                $the_comment_status = wp_get_comment_status( $comment->comment_ID );
 
-               $ptime = date( 'G', strtotime( $comment->comment_date ) );
-               if ( ( abs( time() - $ptime ) ) < DAY_IN_SECONDS )
-                       $ptime = sprintf( __( '%s ago' ), human_time_diff( $ptime ) );
-               else
-                       $ptime = mysql2date( __( 'Y/m/d \a\t g:i A' ), $comment->comment_date );
-
                if ( $user_can ) {
                        $del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) );
                        $approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) );
@@ -360,8 +354,10 @@ class WP_Comments_List_Table extends WP_List_Table {
                echo '<div class="submitted-on">';
                /* translators: 2: comment date, 3: comment time */
                printf( __( 'Submitted on <a href="%1$s">%2$s at %3$s</a>' ), $comment_url,
-                       /* translators: comment date format. See http://php.net/date */ get_comment_date( __( 'Y/m/d' ) ),
-                       /* translators: comment time format. See http://php.net/date */ get_comment_date( get_option( 'time_format' ) ) );
+                       /* translators: comment date format. See http://php.net/date */
+                       get_comment_date( __( 'Y/m/d' ) ),
+                       get_comment_date( get_option( 'time_format' ) )
+               );
 
                if ( $comment->comment_parent ) {
                        $parent = get_comment( $comment->comment_parent );
@@ -456,7 +452,7 @@ class WP_Comments_List_Table extends WP_List_Table {
                        $author_url = '';
                $author_url_display = preg_replace( '|http://(www\.)?|i', '', $author_url );
                if ( strlen( $author_url_display ) > 50 )
-                       $author_url_display = substr( $author_url_display, 0, 49 ) . '...';
+                       $author_url_display = substr( $author_url_display, 0, 49 ) . '&hellip;';
 
                echo "<strong>"; comment_author(); echo '</strong><br />';
                if ( !empty( $author_url ) )
index 75808df8a35c1029019b0ac42b0d824ed4933fd5..d64fe4bba410bbc13ad8749cf0786b713e3398f1 100644 (file)
@@ -203,7 +203,7 @@ class WP_Filesystem_Base {
                                continue; //We want this to be caught by the next code block.
 
                        //Working from /home/ to /user/ to /wordpress/ see if that file exists within the current folder,
-                       // If its found, change into it and follow through looking for it.
+                       // If it's found, change into it and follow through looking for it.
                        // If it cant find WordPress down that route, it'll continue onto the next folder level, and see if that matches, and so on.
                        // If it reaches the end, and still cant find it, it'll return false for the entire function.
                        if ( isset($files[ $key ]) ){
@@ -241,7 +241,7 @@ class WP_Filesystem_Base {
         * @access public
         *
         * @param string $file string filename
-        * @return int octal representation of permissions
+        * @return string *nix style representation of permissions
         */
        function gethchmod($file){
                $perms = $this->getchmod($file);
index 457f199c3db445e2323585de93a0313e75b6d1e0..e25c9ef8d78d61c3b60156d089263c6b433ac0c4 100644 (file)
@@ -229,7 +229,7 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
                if ( ! $recursive && $this->is_dir($file) )
                        return @rmdir($file);
 
-               //At this point its a folder, and we're in recursive mode
+               //At this point it's a folder, and we're in recursive mode
                $file = trailingslashit($file);
                $filelist = $this->dirlist($file, true);
 
index 1c931e19281c5a600c63e294d9b0cf524f3f9da7..728385b70bff4c00fedeea3e510996a251051ada 100644 (file)
@@ -97,7 +97,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
                if ( ! $this->ftp->fget($temphandle, $file) ) {
                        fclose($temphandle);
                        unlink($temp);
-                       return ''; //Blank document, File does exist, Its just blank.
+                       return ''; //Blank document, File does exist, It's just blank.
                }
 
                fseek($temphandle, 0); //Skip back to the start of the file being written to
index 3114456e097d4da0331f93c02be86d8ca761dae7..8ff3cb18e79f458b4dc800b45737a9924a9e9f6e 100644 (file)
@@ -184,8 +184,8 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
                if ( ! $this->exists($file) )
                        return false;
                if ( ! $recursive || ! $this->is_dir($file) )
-                       return $this->run_command(sprintf('chgrp %o %s', $mode, escapeshellarg($file)), true);
-               return $this->run_command(sprintf('chgrp -R %o %s', $mode, escapeshellarg($file)), true);
+                       return $this->run_command(sprintf('chgrp %s %s', escapeshellarg($group), escapeshellarg($file)), true);
+               return $this->run_command(sprintf('chgrp -R %s %s', escapeshellarg($group), escapeshellarg($file)), true);
        }
 
        function chmod($file, $mode = false, $recursive = false) {
@@ -210,8 +210,8 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
                if ( ! $this->exists($file) )
                        return false;
                if ( ! $recursive || ! $this->is_dir($file) )
-                       return $this->run_command(sprintf('chown %o %s', $mode, escapeshellarg($file)), true);
-               return $this->run_command(sprintf('chown -R %o %s', $mode, escapeshellarg($file)), true);
+                       return $this->run_command(sprintf('chown %s %s', escapeshellarg($owner), escapeshellarg($file)), true);
+               return $this->run_command(sprintf('chown -R %s %s', escapeshellarg($owner), escapeshellarg($file)), true);
        }
 
        function owner($file) {
index 0268e7e6ee39835349edcf2a21d768a3091818ba..b017c84fcd3a0842ffdc6ff0942fee424a005c8f 100644 (file)
@@ -183,7 +183,6 @@ class WP_Importer {
 
                $headers = array();
                $args = array();
-               $args['reject_unsafe_urls'] = true;
                if ( true === $head )
                        $args['method'] = 'HEAD';
                if ( !empty( $username ) && !empty( $password ) )
@@ -191,7 +190,7 @@ class WP_Importer {
 
                $args['headers'] = $headers;
 
-               return wp_remote_request( $url, $args );
+               return wp_safe_remote_request( $url, $args );
        }
 
        /**
index b5cbc5560954ab6c42ee094022d02d0fa5db6e4a..e1c5f18b1b20821c6ed6935bdbc3209e6502f1b1 100644 (file)
@@ -23,7 +23,7 @@ class WP_Links_List_Table extends WP_List_Table {
        function prepare_items() {
                global $cat_id, $s, $orderby, $order;
 
-               wp_reset_vars( array( 'action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'orderby', 'order', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]', 's' ) );
+               wp_reset_vars( array( 'action', 'cat_id', 'link_id', 'orderby', 'order', 's' ) );
 
                $args = array( 'hide_invisible' => 0, 'hide_empty' => 0 );
 
index 8a22bd4e0dd886b1b876db0f62d925d96851ac67..22c35f5edcba29c84b29b9794f1db8af9f10f901 100644 (file)
@@ -72,7 +72,7 @@ class WP_List_Table {
        var $_pagination;
 
        /**
-        * Constructor. The child class should call this constructor from it's own constructor
+        * Constructor. The child class should call this constructor from its own constructor
         *
         * @param array $args An associative array with information about the current table
         * @access protected
@@ -826,7 +826,7 @@ class WP_List_Table {
                $row_class = ( $row_class == '' ? ' class="alternate"' : '' );
 
                echo '<tr' . $row_class . '>';
-               echo $this->single_row_columns( $item );
+               $this->single_row_columns( $item );
                echo '</tr>';
        }
 
index 2c2bf7c39b4b5186674414207fb70db74fc35a50..67fd187cf6d8956ab609d0574239d966a8d46e9e 100644 (file)
@@ -47,8 +47,7 @@ class WP_Media_List_Table extends WP_List_Table {
                $type_links = array();
                $_num_posts = (array) wp_count_attachments();
                $_total_posts = array_sum($_num_posts) - $_num_posts['trash'];
-               if ( !isset( $total_orphans ) )
-                               $total_orphans = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1" );
+               $total_orphans = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' AND post_parent < 1" );
                $matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts));
                foreach ( $matches as $type => $reals )
                        foreach ( $reals as $real )
@@ -176,7 +175,7 @@ class WP_Media_List_Table extends WP_List_Table {
        }
 
        function display_rows() {
-               global $post, $id;
+               global $post;
 
                add_filter( 'the_title','esc_html' );
                $alt = '';
@@ -192,7 +191,7 @@ class WP_Media_List_Table extends WP_List_Table {
                        $post_owner = ( get_current_user_id() == $post->post_author ) ? 'self' : 'other';
                        $att_title = _draft_or_post_title();
 ?>
-       <tr id='post-<?php echo $id; ?>' class='<?php echo trim( $alt . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top">
+       <tr id='post-<?php echo $post->ID; ?>' class='<?php echo trim( $alt . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top">
 <?php
 
 list( $columns, $hidden ) = $this->get_column_info();
@@ -266,7 +265,12 @@ foreach ( $columns as $column_name => $column_display_name ) {
 
        case 'author':
 ?>
-               <td <?php echo $attributes ?>><?php the_author() ?></td>
+               <td <?php echo $attributes ?>><?php
+                       printf( '<a href="%s">%s</a>',
+                               esc_url( add_query_arg( array( 'author' => get_the_author_meta('ID') ), 'upload.php' ) ),
+                               get_the_author()
+                       );
+               ?></td>
 <?php
                break;
 
@@ -297,13 +301,11 @@ foreach ( $columns as $column_name => $column_display_name ) {
                break;
 
        case 'parent':
-               if ( $post->post_parent > 0 ) {
-                       if ( get_post( $post->post_parent ) ) {
-                               $title =_draft_or_post_title( $post->post_parent );
-                       }
+               if ( $post->post_parent > 0 && get_post( $post->post_parent ) ) {
+                       $title = _draft_or_post_title( $post->post_parent );
 ?>
                        <td <?php echo $attributes ?>><strong>
-                               <?php if( current_user_can( 'edit_post', $post->post_parent ) ) { ?>
+                               <?php if ( current_user_can( 'edit_post', $post->post_parent ) ) { ?>
                                        <a href="<?php echo get_edit_post_link( $post->post_parent ); ?>">
                                                <?php echo $title ?></a><?php
                                } else {
@@ -315,7 +317,7 @@ foreach ( $columns as $column_name => $column_display_name ) {
                } else {
 ?>
                        <td <?php echo $attributes ?>><?php _e( '(Unattached)' ); ?><br />
-                       <?php if( $user_can_edit ) {?>
+                       <?php if ( $user_can_edit ) { ?>
                                <a class="hide-if-no-js"
                                        onclick="findPosts.open( 'media[]','<?php echo $post->ID ?>' ); return false;"
                                        href="#the-list">
@@ -375,7 +377,7 @@ foreach ( $columns as $column_name => $column_display_name ) {
                }
 ?>
                <td <?php echo $attributes ?>>
-                       <?php do_action( 'manage_media_custom_column', $column_name, $id ); ?>
+                       <?php do_action( 'manage_media_custom_column', $column_name, $post->ID ); ?>
                </td>
 <?php
                break;
index 371901a63801a8ad331106a5a0127777f60db8ce..b9d68a1f35e321bb0af768139f8d95cc00be6937 100644 (file)
@@ -29,7 +29,7 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
 
                $pagenum = $this->get_pagenum();
 
-               $s = isset( $_REQUEST['s'] ) ? stripslashes( trim( $_REQUEST[ 's' ] ) ) : '';
+               $s = isset( $_REQUEST['s'] ) ? wp_unslash( trim( $_REQUEST[ 's' ] ) ) : '';
                $wild = '';
                if ( false !== strpos($s, '*') ) {
                        $wild = '%';
index 2461b1d1db35b536cff466a74a9b3fb8e970a743..1d61af9f82ac061413f0022eb4aa8cec0194053a 100644 (file)
@@ -126,7 +126,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
        function _search_callback( $theme ) {
                static $term;
                if ( is_null( $term ) )
-                       $term = stripslashes( $_REQUEST['s'] );
+                       $term = wp_unslash( $_REQUEST['s'] );
 
                foreach ( array( 'Name', 'Description', 'Author', 'Author', 'AuthorURI' ) as $field ) {
                        // Don't mark up; Do translate.
@@ -243,11 +243,11 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
        }
 
        function display_rows() {
-               foreach ( $this->items as $key => $theme )
-                       $this->single_row( $key, $theme );
+               foreach ( $this->items as $theme )
+                       $this->single_row( $theme );
        }
 
-       function single_row( $key, $theme ) {
+       function single_row( $theme ) {
                global $status, $page, $s, $totals;
 
                $context = $status;
index 6a4268f6ae80a8fe48a164c2e720a8b2dfbc4f85..ab1ee3620e3000d2b3dd21b6d39a0c166ad08f4c 100644 (file)
@@ -173,10 +173,10 @@ class WP_MS_Users_List_Table extends WP_List_Table {
 
                                        case 'username':
                                                $avatar = get_avatar( $user->user_email, 32 );
-                                               $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) );
+                                               $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user->ID ) ) );
 
                                                echo "<td $attributes>"; ?>
-                                                       <?php echo $avatar; ?><strong><a href="<?php echo $edit_link; ?>" class="edit"><?php echo stripslashes( $user->user_login ); ?></a><?php
+                                                       <?php echo $avatar; ?><strong><a href="<?php echo $edit_link; ?>" class="edit"><?php echo $user->user_login; ?></a><?php
                                                        if ( in_array( $user->user_login, $super_admins ) )
                                                                echo ' - ' . __( 'Super Admin' );
                                                        ?></strong>
@@ -186,7 +186,7 @@ class WP_MS_Users_List_Table extends WP_List_Table {
                                                                $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>';
 
                                                                if ( current_user_can( 'delete_user', $user->ID ) && ! in_array( $user->user_login, $super_admins ) ) {
-                                                                       $actions['delete'] = '<a href="' . $delete = esc_url( network_admin_url( add_query_arg( '_wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'users.php', 'deleteuser' ) . '&amp;action=deleteuser&amp;id=' . $user->ID ) ) ) . '" class="delete">' . __( 'Delete' ) . '</a>';
+                                                                       $actions['delete'] = '<a href="' . $delete = esc_url( network_admin_url( add_query_arg( '_wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), wp_nonce_url( 'users.php', 'deleteuser' ) . '&amp;action=deleteuser&amp;id=' . $user->ID ) ) ) . '" class="delete">' . __( 'Delete' ) . '</a>';
                                                                }
 
                                                                $actions = apply_filters( 'ms_user_row_actions', $actions, $user );
index ca06dbedf9f078890546a4113b5b7d953ac9a4b4..76ef2ce2c1ff42218ca3f70f0211c3f4532ee704 100644 (file)
@@ -40,7 +40,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
                $tabs = apply_filters( 'install_plugins_tabs', $tabs );
                $nonmenu_tabs = apply_filters( 'install_plugins_nonmenu_tabs', $nonmenu_tabs );
 
-               // If a non-valid menu tab has been selected, And its not a non-menu action.
+               // If a non-valid menu tab has been selected, And it's not a non-menu action.
                if ( empty( $tab ) || ( !isset( $tabs[ $tab ] ) && !in_array( $tab, (array) $nonmenu_tabs ) ) )
                        $tab = key( $tabs );
 
@@ -48,8 +48,8 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
 
                switch ( $tab ) {
                        case 'search':
-                               $type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : 'term';
-                               $term = isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '';
+                               $type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term';
+                               $term = isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : '';
 
                                switch ( $type ) {
                                        case 'tag':
@@ -73,7 +73,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
                                break;
 
                        case 'favorites':
-                               $user = isset( $_GET['user'] ) ? stripslashes( $_GET['user'] ) : get_user_option( 'wporg_favorites' );
+                               $user = isset( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' );
                                update_user_meta( get_current_user_id(), 'wporg_favorites', $user );
                                if ( $user )
                                        $args['user'] = $user;
index a1cbeec681fcfa0dff2fa7b66de391a3034756f4..ae1d1b8d8dedbe0b203632af2ea8c9e064a53b77 100644 (file)
@@ -22,7 +22,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
                        $status = $_REQUEST['plugin_status'];
 
                if ( isset($_REQUEST['s']) )
-                       $_SERVER['REQUEST_URI'] = add_query_arg('s', stripslashes($_REQUEST['s']) );
+                       $_SERVER['REQUEST_URI'] = add_query_arg('s', wp_unslash($_REQUEST['s']) );
 
                $page = $this->get_pagenum();
        }
@@ -53,7 +53,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
 
                $screen = $this->screen;
 
-               if ( ! is_multisite() || ( $screen->is_network && current_user_can('manage_network_plugins') ) ) {
+               if ( ! is_multisite() || ( $screen->in_admin( 'network' ) && current_user_can( 'manage_network_plugins' ) ) ) {
                        if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) )
                                $plugins['mustuse'] = get_mu_plugins();
                        if ( apply_filters( 'show_advanced_plugins', true, 'dropins' ) )
@@ -72,7 +72,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
 
                set_transient( 'plugin_slugs', array_keys( $plugins['all'] ), DAY_IN_SECONDS );
 
-               if ( ! $screen->is_network ) {
+               if ( ! $screen->in_admin( 'network' ) ) {
                        $recently_activated = get_option( 'recently_activated', array() );
 
                        foreach ( $recently_activated as $key => $time )
@@ -83,15 +83,15 @@ class WP_Plugins_List_Table extends WP_List_Table {
 
                foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {
                        // Filter into individual sections
-                       if ( is_multisite() && ! $screen->is_network && is_network_only_plugin( $plugin_file ) ) {
+                       if ( is_multisite() && ! $screen->in_admin( 'network' ) && is_network_only_plugin( $plugin_file ) ) {
                                unset( $plugins['all'][ $plugin_file ] );
-                       } elseif ( ! $screen->is_network && is_plugin_active_for_network( $plugin_file ) ) {
+                       } elseif ( ! $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) {
                                unset( $plugins['all'][ $plugin_file ] );
-                       } elseif ( ( ! $screen->is_network && is_plugin_active( $plugin_file ) )
-                               || ( $screen->is_network && is_plugin_active_for_network( $plugin_file ) ) ) {
+                       } elseif ( ( ! $screen->in_admin( 'network' ) && is_plugin_active( $plugin_file ) )
+                               || ( $screen->in_admin( 'network' ) && is_plugin_active_for_network( $plugin_file ) ) ) {
                                $plugins['active'][ $plugin_file ] = $plugin_data;
                        } else {
-                               if ( ! $screen->is_network && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?
+                               if ( ! $screen->in_admin( 'network' ) && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?
                                        $plugins['recently_activated'][ $plugin_file ] = $plugin_data;
                                $plugins['inactive'][ $plugin_file ] = $plugin_data;
                        }
@@ -140,7 +140,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
        function _search_callback( $plugin ) {
                static $term;
                if ( is_null( $term ) )
-                       $term = stripslashes( $_REQUEST['s'] );
+                       $term = wp_unslash( $_REQUEST['s'] );
 
                foreach ( $plugin as $value )
                        if ( stripos( $value, $term ) !== false )
@@ -237,12 +237,12 @@ class WP_Plugins_List_Table extends WP_List_Table {
                $actions = array();
 
                if ( 'active' != $status )
-                       $actions['activate-selected'] = $this->screen->is_network ? __( 'Network Activate' ) : __( 'Activate' );
+                       $actions['activate-selected'] = $this->screen->in_admin( 'network' ) ? __( 'Network Activate' ) : __( 'Activate' );
 
                if ( 'inactive' != $status && 'recent' != $status )
-                       $actions['deactivate-selected'] = $this->screen->is_network ? __( 'Network Deactivate' ) : __( 'Deactivate' );
+                       $actions['deactivate-selected'] = $this->screen->in_admin( 'network' ) ? __( 'Network Deactivate' ) : __( 'Deactivate' );
 
-               if ( !is_multisite() || $this->screen->is_network ) {
+               if ( !is_multisite() || $this->screen->in_admin( 'network' ) ) {
                        if ( current_user_can( 'update_plugins' ) )
                                $actions['update-selected'] = __( 'Update' );
                        if ( current_user_can( 'delete_plugins' ) && ( 'active' != $status ) )
@@ -269,7 +269,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
 
                echo '<div class="alignleft actions">';
 
-               if ( ! $this->screen->is_network && 'recently_activated' == $status )
+               if ( ! $this->screen->in_admin( 'network' ) && 'recently_activated' == $status )
                        submit_button( __( 'Clear List' ), 'button', 'clear-recent-list', false );
                elseif ( 'top' == $which && 'mustuse' == $status )
                        echo '<p>' . sprintf( __( 'Files in the <code>%s</code> directory are executed automatically.' ), str_replace( ABSPATH, '/', WPMU_PLUGIN_DIR ) ) . '</p>';
@@ -289,7 +289,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
        function display_rows() {
                global $status;
 
-               if ( is_multisite() && ! $this->screen->is_network && in_array( $status, array( 'mustuse', 'dropins' ) ) )
+               if ( is_multisite() && ! $this->screen->in_admin( 'network' ) && in_array( $status, array( 'mustuse', 'dropins' ) ) )
                        return;
 
                foreach ( $this->items as $plugin_file => $plugin_data )
@@ -331,12 +331,12 @@ class WP_Plugins_List_Table extends WP_List_Table {
                        if ( $plugin_data['Description'] )
                                $description .= '<p>' . $plugin_data['Description'] . '</p>';
                } else {
-                       if ( $screen->is_network )
+                       if ( $screen->in_admin( 'network' ) )
                                $is_active = is_plugin_active_for_network( $plugin_file );
                        else
                                $is_active = is_plugin_active( $plugin_file );
 
-                       if ( $screen->is_network ) {
+                       if ( $screen->in_admin( 'network' ) ) {
                                if ( $is_active ) {
                                        if ( current_user_can( 'manage_network_plugins' ) )
                                                $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&amp;plugin=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>';
@@ -355,13 +355,13 @@ class WP_Plugins_List_Table extends WP_List_Table {
                                        if ( ! is_multisite() && current_user_can('delete_plugins') )
                                                $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&amp;checked[]=' . $plugin_file . '&amp;plugin_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-plugins') . '" title="' . esc_attr__('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>';
                                } // end if $is_active
-                        } // end if $screen->is_network
+                        } // end if $screen->in_admin( 'network' )
 
-                       if ( ( ! is_multisite() || $screen->is_network ) && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
+                       if ( ( ! is_multisite() || $screen->in_admin( 'network' ) ) && current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
                                $actions['edit'] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . esc_attr__('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
                } // end if $context
 
-               $prefix = $screen->is_network ? 'network_admin_' : '';
+               $prefix = $screen->in_admin( 'network' ) ? 'network_admin_' : '';
                $actions = apply_filters( $prefix . 'plugin_action_links', array_filter( $actions ), $plugin_file, $plugin_data, $context );
                $actions = apply_filters( $prefix . "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context );
 
index c772fa63c977a9c7d9866011c50193323e7802ef..a798a2c2b9ae866978308cd85361528a2462723d 100644 (file)
@@ -382,8 +382,10 @@ class WP_Posts_List_Table extends WP_List_Table {
                        if ( $count >= $end )
                                break;
 
-                       if ( $count >= $start )
-                               echo "\t" . $this->single_row( $page, $level );
+                       if ( $count >= $start ) {
+                               echo "\t";
+                               $this->single_row( $page, $level );
+                       }
 
                        $count++;
 
@@ -397,8 +399,12 @@ class WP_Posts_List_Table extends WP_List_Table {
                                foreach ( $orphans as $op ) {
                                        if ( $count >= $end )
                                                break;
-                                       if ( $count >= $start )
-                                               echo "\t" . $this->single_row( $op, 0 );
+
+                                       if ( $count >= $start ) {
+                                               echo "\t";
+                                               $this->single_row( $op, 0 );
+                                       }
+
                                        $count++;
                                }
                        }
@@ -444,13 +450,16 @@ class WP_Posts_List_Table extends WP_List_Table {
                                }
                                $num_parents = count( $my_parents );
                                while ( $my_parent = array_pop( $my_parents ) ) {
-                                       echo "\t" . $this->single_row( $my_parent, $level - $num_parents );
+                                       echo "\t";
+                                       $this->single_row( $my_parent, $level - $num_parents );
                                        $num_parents--;
                                }
                        }
 
-                       if ( $count >= $start )
-                               echo "\t" . $this->single_row( $page, $level );
+                       if ( $count >= $start ) {
+                               echo "\t";
+                               $this->single_row( $page, $level );
+                       }
 
                        $count++;
 
@@ -471,10 +480,16 @@ class WP_Posts_List_Table extends WP_List_Table {
                $edit_link = get_edit_post_link( $post->ID );
                $title = _draft_or_post_title();
                $post_type_object = get_post_type_object( $post->post_type );
-               $can_edit_post = current_user_can( $post_type_object->cap->edit_post, $post->ID );
+               $can_edit_post = current_user_can( 'edit_post', $post->ID );
 
                $alternate = 'alternate' == $alternate ? '' : 'alternate';
                $classes = $alternate . ' iedit author-' . ( get_current_user_id() == $post->post_author ? 'self' : 'other' );
+
+               $lock_holder = wp_check_post_lock( $post->ID );
+               if ( $lock_holder ) {
+                       $classes .= ' wp-locked';
+                       $lock_holder = get_userdata( $lock_holder );
+               }
        ?>
                <tr id="post-<?php echo $post->ID; ?>" class="<?php echo implode( ' ', get_post_class( $classes, $post->ID ) ); ?>" valign="top">
        <?php
@@ -495,18 +510,23 @@ class WP_Posts_List_Table extends WP_List_Table {
                        case 'cb':
                        ?>
                        <th scope="row" class="check-column">
-                               <?php if ( $can_edit_post ) { ?>
+                               <?php
+                               if ( $can_edit_post ) {
+
+                               ?>
                                <label class="screen-reader-text" for="cb-select-<?php the_ID(); ?>"><?php printf( __( 'Select %s' ), $title ); ?></label>
                                <input id="cb-select-<?php the_ID(); ?>" type="checkbox" name="post[]" value="<?php the_ID(); ?>" />
-                               <?php } ?>
+                               <div class="locked-indicator"></div>
+                               <?php
+                               }
+                               ?>
                        </th>
                        <?php
                        break;
 
                        case 'title':
+                               $attributes = 'class="post-title page-title column-title"' . $style;
                                if ( $this->hierarchical_display ) {
-                                       $attributes = 'class="post-title page-title column-title"' . $style;
-
                                        if ( 0 == $level && (int) $post->post_parent > 0 ) {
                                                //sent level 0 by accident, by default, or because we don't know the actual level
                                                $find_main_page = (int) $post->post_parent;
@@ -523,29 +543,49 @@ class WP_Posts_List_Table extends WP_List_Table {
                                                                $parent_name = apply_filters( 'the_title', $parent->post_title, $parent->ID );
                                                }
                                        }
+                               }
 
-                                       $pad = str_repeat( '&#8212; ', $level );
-?>
-                       <td <?php echo $attributes ?>><strong><?php if ( $can_edit_post && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states( $post ); echo isset( $parent_name ) ? ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html( $parent_name ) : ''; ?></strong>
-<?php
+                               $pad = str_repeat( '&#8212; ', $level );
+                               echo "<td $attributes><strong>";
+
+                               if ( $format = get_post_format( $post->ID ) ) {
+                                       $label = get_post_format_string( $format );
+
+                                       echo '<a href="' . esc_url( add_query_arg( array( 'post_format' => $format, 'post_type' => $post->post_type ), 'edit.php' ) ) . '" class="post-state-format post-format-icon post-format-' . $format . '" title="' . $label . '">' . $label . ":</a> ";
                                }
-                               else {
-                                       $attributes = 'class="post-title page-title column-title"' . $style;
 
-                                       $pad = str_repeat( '&#8212; ', $level );
-?>
-                       <td <?php echo $attributes ?>><strong><?php if ( $can_edit_post && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states( $post ); ?></strong>
-<?php
-                                       if ( 'excerpt' == $mode && current_user_can( 'read_post', $post->ID ) )
-                                               the_excerpt();
+                               if ( $can_edit_post && $post->post_status != 'trash' ) {
+                                       echo '<a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;' ), $title ) ) . '">' . $pad . $title . '</a>';
+                               } else {
+                                       echo $pad . $title;
+                               }
+                               _post_states( $post );
+
+                               if ( isset( $parent_name ) )
+                                       echo ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html( $parent_name );
+
+                               echo "</strong>\n";
+
+                               if ( $can_edit_post && $post->post_status != 'trash' ) {
+                                       if ( $lock_holder ) {
+                                               $locked_avatar = get_avatar( $lock_holder->ID, 18 );
+                                               $locked_text = esc_html( sprintf( __( '%s is currently editing' ), $lock_holder->display_name ) );
+                                       } else {
+                                               $locked_avatar = $locked_text = '';
+                                       }
+
+                                       echo '<div class="locked-info"><span class="locked-avatar">' . $locked_avatar . '</span> <span class="locked-text">' . $locked_text . "</span></div>\n";
                                }
 
+                               if ( ! $this->hierarchical_display && 'excerpt' == $mode && current_user_can( 'read_post', $post->ID ) )
+                                               the_excerpt();
+
                                $actions = array();
                                if ( $can_edit_post && 'trash' != $post->post_status ) {
                                        $actions['edit'] = '<a href="' . get_edit_post_link( $post->ID, true ) . '" title="' . esc_attr( __( 'Edit this item' ) ) . '">' . __( 'Edit' ) . '</a>';
                                        $actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick&nbsp;Edit' ) . '</a>';
                                }
-                               if ( current_user_can( $post_type_object->cap->delete_post, $post->ID ) ) {
+                               if ( current_user_can( 'delete_post', $post->ID ) ) {
                                        if ( 'trash' == $post->post_status )
                                                $actions['untrash'] = "<a title='" . esc_attr( __( 'Restore this item from the Trash' ) ) . "' href='" . wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ) . "'>" . __( 'Restore' ) . "</a>";
                                        elseif ( EMPTY_TRASH_DAYS )
@@ -556,7 +596,7 @@ class WP_Posts_List_Table extends WP_List_Table {
                                if ( $post_type_object->public ) {
                                        if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) {
                                                if ( $can_edit_post )
-                                                       $actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
+                                                       $actions['view'] = '<a href="' . esc_url( apply_filters( 'preview_post_link', set_url_scheme( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
                                        } elseif ( 'trash' != $post->post_status ) {
                                                $actions['view'] = '<a href="' . get_permalink( $post->ID ) . '" title="' . esc_attr( sprintf( __( 'View &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'View' ) . '</a>';
                                        }
@@ -820,10 +860,7 @@ class WP_Posts_List_Table extends WP_List_Table {
 
        <?php foreach ( $hierarchical_taxonomies as $taxonomy ) : ?>
 
-                       <span class="title inline-edit-categories-label"><?php echo esc_html( $taxonomy->labels->name ) ?>
-                               <span class="catshow"><?php _e( '[more]' ); ?></span>
-                               <span class="cathide" style="display:none;"><?php _e( '[less]' ); ?></span>
-                       </span>
+                       <span class="title inline-edit-categories-label"><?php echo esc_html( $taxonomy->labels->name ) ?></span>
                        <input type="hidden" name="<?php echo ( $taxonomy->name == 'category' ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy->name ) . '][]'; ?>" value="0" />
                        <ul class="cat-checklist <?php echo esc_attr( $taxonomy->name )?>-checklist">
                                <?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ) ?>
@@ -997,32 +1034,6 @@ class WP_Posts_List_Table extends WP_List_Table {
        <?php endif; // 'post' && $can_publish && current_user_can( 'edit_others_cap' ) ?>
 
                        </div>
-
-       <?php if ( post_type_supports( $screen->post_type, 'post-formats' ) && current_theme_supports( 'post-formats' ) ) :
-               $post_formats = get_theme_support( 'post-formats' );
-               if ( isset( $post_formats[0] ) && is_array( $post_formats[0] ) ) :
-                       $all_post_formats = get_post_format_strings();
-                       unset( $all_post_formats['standard'] ); ?>
-                       <div class="inline-edit-group">
-                               <label class="alignleft" for="post_format">
-                               <span class="title"><?php _ex( 'Format', 'post format' ); ?></span>
-                               <select name="post_format">
-                               <?php if ( $bulk ) : ?>
-                                       <option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
-                               <?php endif; ?>
-                                       <option value="0"><?php _ex( 'Standard', 'Post format' ); ?></option>
-                               <?php foreach ( $all_post_formats as $slug => $format ) :
-                                       $unsupported = ! in_array( $slug, $post_formats[0] );
-                                       if ( $bulk && $unsupported )
-                                               continue;
-                                       ?>
-                                       <option value="<?php echo esc_attr( $slug ); ?>"<?php if ( $unsupported ) echo ' class="unsupported"'; ?>><?php echo esc_html( $format ); ?></option>
-                               <?php endforeach; ?>
-                               </select></label>
-                       </div>
-               <?php endif; ?>
-       <?php endif; // post-formats ?>
-
                </div></fieldset>
 
        <?php
@@ -1035,12 +1046,11 @@ class WP_Posts_List_Table extends WP_List_Table {
                }
        ?>
                <p class="submit inline-edit-save">
-                       <a accesskey="c" href="#inline-edit" title="<?php esc_attr_e( 'Cancel' ); ?>" class="button-secondary cancel alignleft"><?php _e( 'Cancel' ); ?></a>
+                       <a accesskey="c" href="#inline-edit" class="button-secondary cancel alignleft"><?php _e( 'Cancel' ); ?></a>
                        <?php if ( ! $bulk ) {
                                wp_nonce_field( 'inlineeditnonce', '_inline_edit', false );
-                               $update_text = __( 'Update' );
                                ?>
-                               <a accesskey="s" href="#inline-edit" title="<?php esc_attr_e( 'Update' ); ?>" class="button-primary save alignright"><?php echo esc_attr( $update_text ); ?></a>
+                               <a accesskey="s" href="#inline-edit" class="button-primary save alignright"><?php _e( 'Update' ); ?></a>
                                <span class="spinner"></span>
                        <?php } else {
                                submit_button( __( 'Update' ), 'button-primary alignright', 'bulk_edit', false, array( 'accesskey' => 's' ) );
index 85010105cdcc83e256927b7e178997b5d03ced35..eef7ccfdbc31d332494fcfdb8eddd983c3bf8789 100644 (file)
@@ -52,7 +52,7 @@ class WP_Terms_List_Table extends WP_List_Table {
                        $tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page ); // Old filter
                }
 
-               $search = !empty( $_REQUEST['s'] ) ? trim( stripslashes( $_REQUEST['s'] ) ) : '';
+               $search = !empty( $_REQUEST['s'] ) ? trim( wp_unslash( $_REQUEST['s'] ) ) : '';
 
                $args = array(
                        'search' => $search,
@@ -61,10 +61,10 @@ class WP_Terms_List_Table extends WP_List_Table {
                );
 
                if ( !empty( $_REQUEST['orderby'] ) )
-                       $args['orderby'] = trim( stripslashes( $_REQUEST['orderby'] ) );
+                       $args['orderby'] = trim( wp_unslash( $_REQUEST['orderby'] ) );
 
                if ( !empty( $_REQUEST['order'] ) )
-                       $args['order'] = trim( stripslashes( $_REQUEST['order'] ) );
+                       $args['order'] = trim( wp_unslash( $_REQUEST['order'] ) );
 
                $this->callback_args = $args;
 
@@ -136,7 +136,6 @@ class WP_Terms_List_Table extends WP_List_Table {
                $args['offset'] = $offset = ( $page - 1 ) * $number;
 
                // convert it to table rows
-               $out = '';
                $count = 0;
 
                $terms = array();
@@ -144,37 +143,37 @@ class WP_Terms_List_Table extends WP_List_Table {
                if ( is_taxonomy_hierarchical( $taxonomy ) && !isset( $orderby ) ) {
                        // We'll need the full set of terms then.
                        $args['number'] = $args['offset'] = 0;
+               }
+               $terms = get_terms( $taxonomy, $args );
 
-                       $terms = get_terms( $taxonomy, $args );
+               if ( empty( $terms ) ) {
+                       list( $columns, $hidden ) = $this->get_column_info();
+                       echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
+                       $this->no_items();
+                       echo '</td></tr>';
+                       return;
+               }
+
+               if ( is_taxonomy_hierarchical( $taxonomy ) && !isset( $orderby ) ) {
                        if ( !empty( $search ) ) // Ignore children on searches.
                                $children = array();
                        else
                                $children = _get_term_hierarchy( $taxonomy );
 
                        // Some funky recursion to get the job done( Paging & parents mainly ) is contained within, Skip it for non-hierarchical taxonomies for performance sake
-                       $out .= $this->_rows( $taxonomy, $terms, $children, $offset, $number, $count );
+                       $this->_rows( $taxonomy, $terms, $children, $offset, $number, $count );
                } else {
                        $terms = get_terms( $taxonomy, $args );
                        foreach ( $terms as $term )
-                               $out .= $this->single_row( $term, 0, $taxonomy );
+                               $this->single_row( $term );
                        $count = $number; // Only displaying a single page.
                }
-
-               if ( empty( $terms ) ) {
-                       list( $columns, $hidden ) = $this->get_column_info();
-                       echo '<tr class="no-items"><td class="colspanchange" colspan="' . $this->get_column_count() . '">';
-                       $this->no_items();
-                       echo '</td></tr>';
-               } else {
-                       echo $out;
-               }
        }
 
-       function _rows( $taxonomy, $terms, &$children, $start = 0, $per_page = 20, &$count, $parent = 0, $level = 0 ) {
+       function _rows( $taxonomy, $terms, &$children, $start, $per_page, &$count, $parent = 0, $level = 0 ) {
 
                $end = $start + $per_page;
 
-               $output = '';
                foreach ( $terms as $key => $term ) {
 
                        if ( $count >= $end )
@@ -199,23 +198,24 @@ class WP_Terms_List_Table extends WP_List_Table {
 
                                $num_parents = count( $my_parents );
                                while ( $my_parent = array_pop( $my_parents ) ) {
-                                       $output .=  "\t" . $this->single_row( $my_parent, $level - $num_parents, $taxonomy );
+                                       echo "\t";
+                                       $this->single_row( $my_parent, $level - $num_parents );
                                        $num_parents--;
                                }
                        }
 
-                       if ( $count >= $start )
-                               $output .= "\t" . $this->single_row( $term, $level, $taxonomy );
+                       if ( $count >= $start ) {
+                               echo "\t";
+                               $this->single_row( $term, $level );
+                       }
 
                        ++$count;
 
                        unset( $terms[$key] );
 
                        if ( isset( $children[$term->term_id] ) && empty( $_REQUEST['s'] ) )
-                               $output .= $this->_rows( $taxonomy, $terms, $children, $start, $per_page, $count, $term->term_id, $level + 1 );
+                               $this->_rows( $taxonomy, $terms, $children, $start, $per_page, $count, $term->term_id, $level + 1 );
                }
-
-               return $output;
        }
 
        function single_row( $tag, $level = 0 ) {
@@ -225,7 +225,7 @@ class WP_Terms_List_Table extends WP_List_Table {
                $this->level = $level;
 
                echo '<tr id="tag-' . $tag->term_id . '"' . $row_class . '>';
-               echo $this->single_row_columns( $tag );
+               $this->single_row_columns( $tag );
                echo '</tr>';
        }
 
@@ -361,9 +361,8 @@ class WP_Terms_List_Table extends WP_List_Table {
        ?>
 
                <p class="inline-edit-save submit">
-                       <a accesskey="c" href="#inline-edit" title="<?php esc_attr_e( 'Cancel' ); ?>" class="cancel button-secondary alignleft"><?php _e( 'Cancel' ); ?></a>
-                       <?php $update_text = $tax->labels->update_item; ?>
-                       <a accesskey="s" href="#inline-edit" title="<?php echo esc_attr( $update_text ); ?>" class="save button-primary alignright"><?php echo $update_text; ?></a>
+                       <a accesskey="c" href="#inline-edit" class="cancel button-secondary alignleft"><?php _e( 'Cancel' ); ?></a>
+                       <a accesskey="s" href="#inline-edit" class="save button-primary alignright"><?php echo $tax->labels->update_item; ?></a>
                        <span class="spinner"></span>
                        <span class="error" style="display:none;"></span>
                        <?php wp_nonce_field( 'taxinlineeditnonce', '_inline_edit', false ); ?>
index 319a9989f12d1142153f4cb9c0fbc3ad8ce06877..8a46199f160082ba2677b6d5e13258eb9d484cea 100644 (file)
@@ -24,7 +24,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
                $search_terms = array();
                $search_string = '';
                if ( ! empty( $_REQUEST['s'] ) ){
-                       $search_string = strtolower( stripslashes( $_REQUEST['s'] ) );
+                       $search_string = strtolower( wp_unslash( $_REQUEST['s'] ) );
                        $search_terms = array_unique( array_filter( array_map( 'trim', explode( ',', $search_string ) ) ) );
                }
 
@@ -51,7 +51,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
                $tabs = apply_filters( 'install_themes_tabs', $tabs );
                $nonmenu_tabs = apply_filters( 'install_themes_nonmenu_tabs', $nonmenu_tabs );
 
-               // If a non-valid menu tab has been selected, And its not a non-menu action.
+               // If a non-valid menu tab has been selected, And it's not a non-menu action.
                if ( empty( $tab ) || ( ! isset( $tabs[ $tab ] ) && ! in_array( $tab, (array) $nonmenu_tabs ) ) )
                        $tab = key( $tabs );
 
@@ -59,7 +59,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
 
                switch ( $tab ) {
                        case 'search':
-                               $type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : 'term';
+                               $type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term';
                                switch ( $type ) {
                                        case 'tag':
                                                $args['tag'] = array_map( 'sanitize_key', $search_terms );
@@ -164,17 +164,17 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
         *
         * Example theme data:
         *   object(stdClass)[59]
-        *     public 'name' => string 'Magazine Basic' (length=14)
-        *     public 'slug' => string 'magazine-basic' (length=14)
-        *     public 'version' => string '1.1' (length=3)
-        *     public 'author' => string 'tinkerpriest' (length=12)
-        *     public 'preview_url' => string 'http://wp-themes.com/?magazine-basic' (length=36)
-        *     public 'screenshot_url' => string 'http://wp-themes.com/wp-content/themes/magazine-basic/screenshot.png' (length=68)
+        *     public 'name' => string 'Magazine Basic'
+        *     public 'slug' => string 'magazine-basic'
+        *     public 'version' => string '1.1'
+        *     public 'author' => string 'tinkerpriest'
+        *     public 'preview_url' => string 'http://wp-themes.com/?magazine-basic'
+        *     public 'screenshot_url' => string 'http://wp-themes.com/wp-content/themes/magazine-basic/screenshot.png'
         *     public 'rating' => float 80
         *     public 'num_ratings' => int 1
-        *     public 'homepage' => string 'http://wordpress.org/extend/themes/magazine-basic' (length=49)
-        *     public 'description' => string 'A basic magazine style layout with a fully customizable layout through a backend interface. Designed by <a href="http://bavotasan.com">c.bavota</a> of <a href="http://tinkerpriestmedia.com">Tinker Priest Media</a>.' (length=214)
-        *     public 'download_link' => string 'http://wordpress.org/extend/themes/download/magazine-basic.1.1.zip' (length=66)
+        *     public 'homepage' => string 'http://wordpress.org/themes/magazine-basic'
+        *     public 'description' => string 'A basic magazine style layout with a fully customizable layout through a backend interface. Designed by <a href="http://bavotasan.com">c.bavota</a> of <a href="http://tinkerpriestmedia.com">Tinker Priest Media</a>.'
+        *     public 'download_link' => string 'http://wordpress.org/themes/download/magazine-basic.1.1.zip'
         */
        function single_row( $theme ) {
                global $themes_allowedtags;
@@ -362,7 +362,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
         * @uses $tab Global; current tab within Themes->Install screen
         * @uses $type Global; type of search.
         */
-       function _js_vars() {
+       function _js_vars( $extra_args = array() ) {
                global $tab, $type;
                parent::_js_vars( compact( 'tab', 'type' ) );
        }
index 420495efe3fa5e7f3057ec66ec2c0c222cacc9cc..684bd8be00d0a8b836a878304595b5695fc46ca9 100644 (file)
@@ -28,7 +28,7 @@ class WP_Themes_List_Table extends WP_List_Table {
                $themes = wp_get_themes( array( 'allowed' => true ) );
 
                if ( ! empty( $_REQUEST['s'] ) )
-                       $this->search_terms = array_unique( array_filter( array_map( 'trim', explode( ',', strtolower( stripslashes( $_REQUEST['s'] ) ) ) ) ) );
+                       $this->search_terms = array_unique( array_filter( array_map( 'trim', explode( ',', strtolower( wp_unslash( $_REQUEST['s'] ) ) ) ) ) );
 
                if ( ! empty( $_REQUEST['features'] ) )
                        $this->features = $_REQUEST['features'];
@@ -235,7 +235,7 @@ class WP_Themes_List_Table extends WP_List_Table {
         * @uses _pagination_args['total_pages']
         */
         function _js_vars( $extra_args = array() ) {
-               $search_string = isset( $_REQUEST['s'] ) ? esc_attr( stripslashes( $_REQUEST['s'] ) ) : '';
+               $search_string = isset( $_REQUEST['s'] ) ? esc_attr( wp_unslash( $_REQUEST['s'] ) ) : '';
 
                $args = array(
                        'search' => $search_string,
index 63155927df75c8c5b631c7c408f68b030eda3c32..6c399c7ec00a1e0b518102724a7eeffdd9ec72b2 100644 (file)
@@ -50,6 +50,7 @@ class WP_Upgrader {
 
                $this->strings['download_failed'] = __('Download failed.');
                $this->strings['installing_package'] = __('Installing the latest version&#8230;');
+               $this->strings['no_files'] = __('The package contains no files.');
                $this->strings['folder_exists'] = __('Destination folder already exists.');
                $this->strings['mkdir_failed'] = __('Could not create directory.');
                $this->strings['incompatible_archive'] = __('The package could not be installed.');
@@ -166,6 +167,7 @@ class WP_Upgrader {
                global $wp_filesystem;
                $defaults = array( 'source' => '', 'destination' => '', //Please always pass these
                                                'clear_destination' => false, 'clear_working' => false,
+                                               'abort_if_destination_exists' => true,
                                                'hook_extra' => array());
 
                $args = wp_parse_args($args, $defaults);
@@ -193,8 +195,8 @@ class WP_Upgrader {
                if ( 1 == count($source_files) && $wp_filesystem->is_dir( trailingslashit($source) . $source_files[0] . '/') ) //Only one folder? Then we want its contents.
                        $source = trailingslashit($source) . trailingslashit($source_files[0]);
                elseif ( count($source_files) == 0 )
-                       return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], __( 'The plugin contains no files.' ) ); //There are no files?
-               else //Its only a single file, The upgrader will use the foldername of this file as the destination folder. foldername is based on zip filename.
+                       return new WP_Error( 'incompatible_archive', $this->strings['incompatible_archive'], $this->strings['no_files'] ); //There are no files?
+               else //It's only a single file, the upgrader will use the foldername of this file as the destination folder. foldername is based on zip filename.
                        $source = trailingslashit($source);
 
                //Hook ability to change the source file location..
@@ -224,7 +226,7 @@ class WP_Upgrader {
                                return $removed;
                        else if ( ! $removed )
                                return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']);
-               } elseif ( $wp_filesystem->exists($remote_destination) ) {
+               } elseif ( $abort_if_destination_exists && $wp_filesystem->exists($remote_destination) ) {
                        //If we're not clearing the destination folder and something exists there already, Bail.
                        //But first check to see if there are actually any files in the folder.
                        $_files = $wp_filesystem->dirlist($remote_destination);
@@ -272,6 +274,7 @@ class WP_Upgrader {
                $defaults = array(      'package' => '', //Please always pass this.
                                                        'destination' => '', //And this
                                                        'clear_destination' => false,
+                                                       'abort_if_destination_exists' => true, // Abort if the Destination directory exists, Pass clear_destination as false please
                                                        'clear_working' => true,
                                                        'is_multi' => false,
                                                        'hook_extra' => array() //Pass any extra $hook_extra args here, this will be passed to any hooked filters.
@@ -318,6 +321,7 @@ class WP_Upgrader {
                                                                                        'source' => $working_dir,
                                                                                        'destination' => $destination,
                                                                                        'clear_destination' => $clear_destination,
+                                                                                       'abort_if_destination_exists' => $abort_if_destination_exists,
                                                                                        'clear_working' => $clear_working,
                                                                                        'hook_extra' => $hook_extra
                                                                                ) );
@@ -385,6 +389,7 @@ class Plugin_Upgrader extends WP_Upgrader {
                $this->strings['downloading_package'] = __('Downloading install package from <span class="code">%s</span>&#8230;');
                $this->strings['unpack_package'] = __('Unpacking the package&#8230;');
                $this->strings['installing_package'] = __('Installing the plugin&#8230;');
+               $this->strings['no_files'] = __('The plugin contains no files.');
                $this->strings['process_failed'] = __('Plugin install failed.');
                $this->strings['process_success'] = __('Plugin installed successfully.');
        }
@@ -412,6 +417,7 @@ class Plugin_Upgrader extends WP_Upgrader {
                // Force refresh of plugin update information
                delete_site_transient('update_plugins');
                wp_cache_delete( 'plugins', 'plugins' );
+               do_action( 'upgrader_process_complete', $this, array( 'action' => 'install', 'type' => 'plugin' ), $package );
 
                return true;
        }
@@ -457,6 +463,7 @@ class Plugin_Upgrader extends WP_Upgrader {
                // Force refresh of plugin update information
                delete_site_transient('update_plugins');
                wp_cache_delete( 'plugins', 'plugins' );
+               do_action( 'upgrader_process_complete', $this, array( 'action' => 'update', 'type' => 'plugin' ), $plugin );
        }
 
        function bulk_upgrade($plugins) {
@@ -539,6 +546,7 @@ class Plugin_Upgrader extends WP_Upgrader {
                // Force refresh of plugin update information
                delete_site_transient('update_plugins');
                wp_cache_delete( 'plugins', 'plugins' );
+               do_action( 'upgrader_process_complete', $this, array( 'action' => 'update', 'type' => 'plugin', 'bulk' => true ), $plugins );
 
                return $results;
        }
@@ -615,11 +623,11 @@ class Plugin_Upgrader extends WP_Upgrader {
                $plugins_dir = $wp_filesystem->wp_plugins_dir();
                $this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin) );
 
-               if ( ! $wp_filesystem->exists($this_plugin_dir) ) //If its already vanished.
+               if ( ! $wp_filesystem->exists($this_plugin_dir) ) //If it's already vanished.
                        return $removed;
 
                // If plugin is in its own directory, recursively delete the directory.
-               if ( strpos($plugin, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory separator AND that its not the root plugin folder
+               if ( strpos($plugin, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory separator AND that it's not the root plugin folder
                        $deleted = $wp_filesystem->delete($this_plugin_dir, true);
                else
                        $deleted = $wp_filesystem->delete($plugins_dir . $plugin);
@@ -661,6 +669,7 @@ class Theme_Upgrader extends WP_Upgrader {
                $this->strings['downloading_package'] = __('Downloading install package from <span class="code">%s</span>&#8230;');
                $this->strings['unpack_package'] = __('Unpacking the package&#8230;');
                $this->strings['installing_package'] = __('Installing the theme&#8230;');
+               $this->strings['no_files'] = __('The theme contains no files.');
                $this->strings['process_failed'] = __('Theme install failed.');
                $this->strings['process_success'] = __('Theme installed successfully.');
                /* translators: 1: theme name, 2: version */
@@ -757,13 +766,14 @@ class Theme_Upgrader extends WP_Upgrader {
                $this->run($options);
 
                remove_filter('upgrader_source_selection', array(&$this, 'check_package') );
-               remove_filter('upgrader_post_install', array(&$this, 'check_parent_theme_filter'), 10, 3);
+               remove_filter('upgrader_post_install', array(&$this, 'check_parent_theme_filter'));
 
                if ( ! $this->result || is_wp_error($this->result) )
                        return $this->result;
 
                // Force refresh of theme update information
                wp_clean_themes_cache();
+               do_action( 'upgrader_process_complete', $this, array( 'action' => 'install', 'type' => 'theme' ), $package );
 
                return true;
        }
@@ -801,15 +811,16 @@ class Theme_Upgrader extends WP_Upgrader {
 
                $this->run($options);
 
-               remove_filter('upgrader_pre_install', array(&$this, 'current_before'), 10, 2);
-               remove_filter('upgrader_post_install', array(&$this, 'current_after'), 10, 2);
-               remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'), 10, 4);
+               remove_filter('upgrader_pre_install', array(&$this, 'current_before'));
+               remove_filter('upgrader_post_install', array(&$this, 'current_after'));
+               remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'));
 
                if ( ! $this->result || is_wp_error($this->result) )
                        return $this->result;
 
                // Force refresh of theme update information
                wp_clean_themes_cache();
+               do_action( 'upgrader_process_complete', $this, array( 'action' => 'update', 'type' => 'theme' ), $theme );
 
                return true;
        }
@@ -891,12 +902,13 @@ class Theme_Upgrader extends WP_Upgrader {
                $this->skin->footer();
 
                // Cleanup our hooks, in case something else does a upgrade on this connection.
-               remove_filter('upgrader_pre_install', array(&$this, 'current_before'), 10, 2);
-               remove_filter('upgrader_post_install', array(&$this, 'current_after'), 10, 2);
-               remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'), 10, 4);
+               remove_filter('upgrader_pre_install', array(&$this, 'current_before'));
+               remove_filter('upgrader_post_install', array(&$this, 'current_after'));
+               remove_filter('upgrader_clear_destination', array(&$this, 'delete_old_theme'));
 
                // Force refresh of theme update information
                wp_clean_themes_cache();
+               do_action( 'upgrader_process_complete', $this, array( 'action' => 'update', 'type' => 'theme', 'bulk' => true ), $themes );
 
                return $results;
        }
@@ -1020,9 +1032,6 @@ class Core_Upgrader extends WP_Upgrader {
                $this->init();
                $this->upgrade_strings();
 
-               if ( !empty($feedback) )
-                       add_filter('update_feedback', $feedback);
-
                // Is an update available?
                if ( !isset( $current->response ) || $current->response == 'latest' )
                        return new WP_Error('up_to_date', $this->strings['up_to_date']);
@@ -1067,7 +1076,9 @@ class Core_Upgrader extends WP_Upgrader {
                if ( ! function_exists( 'update_core' ) )
                        return new WP_Error( 'copy_failed_space', $this->strings['copy_failed_space'] );
 
-               return update_core($working_dir, $wp_dir);
+               $result = update_core( $working_dir, $wp_dir );
+               do_action( 'upgrader_process_complete', $this, array( 'action' => 'update', 'type' => 'core' ), $result );
+               return $result;
        }
 
 }
@@ -1118,7 +1129,7 @@ class WP_Upgrader_Skin {
                        return;
                $this->done_header = true;
                echo '<div class="wrap">';
-               echo screen_icon();
+               screen_icon();
                echo '<h2>' . $this->options['title'] . '</h2>';
        }
        function footer() {
@@ -1234,7 +1245,7 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
 
        function add_strings() {
                $this->upgrader->strings['skin_upgrade_start'] = __('The update process is starting. This process may take a while on some hosts, so please be patient.');
-               $this->upgrader->strings['skin_update_failed_error'] = __('An error occurred while updating %1$s: <strong>%2$s</strong>.');
+               $this->upgrader->strings['skin_update_failed_error'] = __('An error occurred while updating %1$s: <strong>%2$s</strong>');
                $this->upgrader->strings['skin_update_failed'] = __('The update of %1$s failed.');
                $this->upgrader->strings['skin_update_successful'] = __('%1$s updated successfully.').' <a onclick="%2$s" href="#" class="hide-if-no-js"><span>'.__('Show Details').'</span><span class="hidden">'.__('Hide Details').'</span>.</a>';
                $this->upgrader->strings['skin_upgrade_end'] = __('All updates have been completed.');
@@ -1310,8 +1321,9 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
 
                        echo '<script type="text/javascript">jQuery(\'#progress-' . esc_js($this->upgrader->update_current) . '\').show();</script>';
                }
-               if ( !empty($this->result) && !is_wp_error($this->result) ) {
-                       echo '<div class="updated"><p>' . sprintf($this->upgrader->strings['skin_update_successful'], $title, 'jQuery(\'#progress-' . esc_js($this->upgrader->update_current) . '\').toggle();jQuery(\'span\', this).toggle(); return false;') . '</p></div>';
+               if ( $this->result && ! is_wp_error( $this->result ) ) {
+                       if ( ! $this->error )
+                               echo '<div class="updated"><p>' . sprintf($this->upgrader->strings['skin_update_successful'], $title, 'jQuery(\'#progress-' . esc_js($this->upgrader->update_current) . '\').toggle();jQuery(\'span\', this).toggle(); return false;') . '</p></div>';
                        echo '<script type="text/javascript">jQuery(\'.waiting-' . esc_js($this->upgrader->update_current) . '\').hide();</script>';
                }
 
@@ -1342,11 +1354,11 @@ class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
                $this->upgrader->strings['skin_before_update_header'] = __('Updating Plugin %1$s (%2$d/%3$d)');
        }
 
-       function before() {
+       function before($title = '') {
                parent::before($this->plugin_info['Title']);
        }
 
-       function after() {
+       function after($title = '') {
                parent::after($this->plugin_info['Title']);
        }
        function bulk_footer() {
@@ -1376,11 +1388,11 @@ class Bulk_Theme_Upgrader_Skin extends Bulk_Upgrader_Skin {
                $this->upgrader->strings['skin_before_update_header'] = __('Updating Theme %1$s (%2$d/%3$d)');
        }
 
-       function before() {
+       function before($title = '') {
                parent::before( $this->theme_info->display('Name') );
        }
 
-       function after() {
+       function after($title = '') {
                parent::after( $this->theme_info->display('Name') );
        }
 
@@ -1433,7 +1445,7 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
 
                $install_actions = array();
 
-               $from = isset($_GET['from']) ? stripslashes($_GET['from']) : 'plugins';
+               $from = isset($_GET['from']) ? wp_unslash( $_GET['from'] ) : 'plugins';
 
                if ( 'import' == $from )
                        $install_actions['activate_plugin'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&amp;from=import&amp;plugin=' . urlencode( $plugin_file ), 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin') . '" target="_parent">' . __('Activate Plugin &amp; Run Importer') . '</a>';
@@ -1603,7 +1615,7 @@ class Theme_Upgrader_Skin extends WP_Upgrader_Skin {
 }
 
 /**
- * Upgrade Skin helper for File uploads. This class handles the upload process and passes it as if its a local file to the Upgrade/Installer functions.
+ * Upgrade Skin helper for File uploads. This class handles the upload process and passes it as if it's a local file to the Upgrade/Installer functions.
  *
  * @TODO More Detailed docs, for methods as well.
  *
@@ -1621,7 +1633,7 @@ class File_Upload_Upgrader {
                if ( empty($_FILES[$form]['name']) && empty($_GET[$urlholder]) )
                        wp_die(__('Please select a file'));
 
-               //Handle a newly uploaded file, Else assume its already been uploaded
+               //Handle a newly uploaded file, Else assume it's already been uploaded
                if ( ! empty($_FILES) ) {
                        $overrides = array( 'test_form' => false, 'test_type' => false );
                        $file = wp_handle_upload( $_FILES[$form], $overrides );
index 9ad3c13aeda2481edb59e52c1ce1cfaade816d9f..48c9c0c2568955b3168488e47d984f420b4f2ac6 100644 (file)
@@ -209,7 +209,7 @@ class WP_Users_List_Table extends WP_List_Table {
                                continue;
 
                        $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
-                       echo "\n\t", $this->single_row( $user_object, $style, $role, isset( $post_counts ) ? $post_counts[ $userid ] : 0 );
+                       echo "\n\t" . $this->single_row( $user_object, $style, $role, isset( $post_counts ) ? $post_counts[ $userid ] : 0 );
                }
        }
 
@@ -241,7 +241,7 @@ class WP_Users_List_Table extends WP_List_Table {
                // Check if the user for this row is editable
                if ( current_user_can( 'list_users' ) ) {
                        // Set up the user editing link
-                       $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user_object->ID ) ) );
+                       $edit_link = esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ), get_edit_user_link( $user_object->ID ) ) );
 
                        // Set up the hover actions for this user
                        $actions = array();
@@ -260,7 +260,7 @@ class WP_Users_List_Table extends WP_List_Table {
                        $actions = apply_filters( 'user_row_actions', $actions, $user_object );
                        $edit .= $this->row_actions( $actions );
 
-                       // Set up the checkbox ( because the user is editable, otherwise its empty )
+                       // Set up the checkbox ( because the user is editable, otherwise it's empty )
                        $checkbox = '<label class="screen-reader-text" for="cb-select-' . $user_object->ID . '">' . sprintf( __( 'Select %s' ), $user_object->user_login ) . '</label>'
                                                . "<input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='$role' value='{$user_object->ID}' />";
 
index 8458911575e1a8e68dffcdcd702e29d3e6872e46..1620755b68a98c8b5512b8dfcff355c63d1341f3 100644 (file)
@@ -7,14 +7,14 @@
  */
 
 /**
- * {@internal Missing Short Description}}
+ * Determine if a comment exists based on author and date.
  *
  * @since 2.0.0
  * @uses $wpdb
  *
  * @param string $comment_author Author of the comment
  * @param string $comment_date Date of the comment
- * @return mixed Comment ID on success.
+ * @return mixed Comment post ID on success.
  */
 function comment_exists($comment_author, $comment_date) {
        global $wpdb;
@@ -68,11 +68,11 @@ function edit_comment() {
 }
 
 /**
- * {@internal Missing Short Description}}
+ * Returns a comment object based on comment ID.
  *
  * @since 2.0.0
  *
- * @param int $id ID of comment to retrieve
+ * @param int $id ID of comment to retrieve.
  * @return bool|object Comment if found. False on failure.
  */
 function get_comment_to_edit( $id ) {
index 0df8109f58b55415545c69a23804501b74b38627..657402f9422ec9f035e669982a3cf180fd7095cf 100644 (file)
@@ -232,7 +232,7 @@ function wp_dashboard_right_now() {
 
        $num_tags = wp_count_terms('post_tag');
 
-       $num_comm = wp_count_comments( );
+       $num_comm = wp_count_comments();
 
        echo "\n\t".'<div class="table table_content">';
        echo "\n\t".'<p class="sub">' . __('Content') . '</p>'."\n\t".'<table>';
@@ -589,8 +589,8 @@ function wp_dashboard_recent_drafts( $drafts = false ) {
                        $url = get_edit_post_link( $draft->ID );
                        $title = _draft_or_post_title( $draft->ID );
                        $item = "<h4><a href='$url' title='" . sprintf( __( 'Edit &#8220;%s&#8221;' ), esc_attr( $title ) ) . "'>" . esc_html($title) . "</a> <abbr title='" . get_the_time(__('Y/m/d g:i:s A'), $draft) . "'>" . get_the_time( get_option( 'date_format' ), $draft ) . '</abbr></h4>';
-                       if ( $the_content = preg_split( '#[\r\n\t ]#', strip_tags( $draft->post_content ), 11, PREG_SPLIT_NO_EMPTY ) )
-                               $item .= '<p>' . join( ' ', array_slice( $the_content, 0, 10 ) ) . ( 10 < count( $the_content ) ? '&hellip;' : '' ) . '</p>';
+                       if ( $the_content = wp_trim_words( $draft->post_content, 10 ) )
+                               $item .= '<p>' . $the_content . '</p>';
                        $list[] = $item;
                }
 ?>
@@ -827,7 +827,7 @@ function wp_dashboard_incoming_links_output() {
                        $publisher = "<strong>$publisher</strong>";
 
                $content = $item->get_content();
-               $content = wp_html_excerpt($content, 50) . ' ...';
+               $content = wp_html_excerpt( $content, 50, ' &hellip;' );
 
                if ( $link )
                        /* translators: incoming links feed, %1$s is other person, %3$s is content */
@@ -869,7 +869,7 @@ function wp_dashboard_primary_control() {
 }
 
 /**
- * {@internal Missing Short Description}}
+ * Display primary dashboard RSS widget feed.
  *
  * @since 2.5.0
  *
@@ -923,8 +923,8 @@ function wp_dashboard_secondary_output() {
 
 function wp_dashboard_plugins() {
        wp_dashboard_cached_rss_widget( 'dashboard_plugins', 'wp_dashboard_plugins_output', array(
-               'http://wordpress.org/extend/plugins/rss/browse/popular/',
-               'http://wordpress.org/extend/plugins/rss/browse/new/'
+               'http://wordpress.org/plugins/rss/browse/popular/',
+               'http://wordpress.org/plugins/rss/browse/new/'
        ) );
 }
 
@@ -934,8 +934,8 @@ function wp_dashboard_plugins() {
  * @since 2.5.0
  */
 function wp_dashboard_plugins_output() {
-       $popular = fetch_feed( 'http://wordpress.org/extend/plugins/rss/browse/popular/' );
-       $new     = fetch_feed( 'http://wordpress.org/extend/plugins/rss/browse/new/' );
+       $popular = fetch_feed( 'http://wordpress.org/plugins/rss/browse/popular/' );
+       $new     = fetch_feed( 'http://wordpress.org/plugins/rss/browse/new/' );
 
        if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) {
                $plugin_slugs = array_keys( get_plugins() );
@@ -1093,7 +1093,7 @@ function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) {
        $widget_options[$widget_id]['number'] = $number;
 
        if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget-rss'][$number]) ) {
-               $_POST['widget-rss'][$number] = stripslashes_deep( $_POST['widget-rss'][$number] );
+               $_POST['widget-rss'][$number] = wp_unslash( $_POST['widget-rss'][$number] );
                $widget_options[$widget_id] = wp_widget_rss_process( $_POST['widget-rss'][$number] );
                // title is optional. If black, fill it if possible
                if ( !$widget_options[$widget_id]['title'] && isset($_POST['widget-rss'][$number]['title']) ) {
@@ -1114,7 +1114,15 @@ function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) {
        wp_widget_rss_form( $widget_options[$widget_id], $form_inputs );
 }
 
-// Display File upload quota on dashboard
+/**
+ * Display file upload quota on dashboard.
+ *
+ * Runs on the activity_box_end hook in wp_dashboard_right_now().
+ *
+ * @since 3.0.0
+ *
+ * @return bool True if not multisite, user can't upload files, or the space check option is disabled.
+*/
 function wp_dashboard_quota() {
        if ( !is_multisite() || !current_user_can('upload_files') || get_site_option( 'upload_space_check_disabled' ) )
                return true;
index 5d88b3a1ec76012939c695c4295533e5eb526f06..399577ed4b75f437f01e28d69f3ce73a9aeed2e3 100644 (file)
@@ -472,14 +472,13 @@ class WP_User_Search {
        function WP_User_Search ($search_term = '', $page = '', $role = '') {
                _deprecated_function( __FUNCTION__, '3.1', 'WP_User_Query' );
 
-               $this->search_term = stripslashes( $search_term );
+               $this->search_term = wp_unslash( $search_term );
                $this->raw_page = ( '' == $page ) ? false : (int) $page;
                $this->page = (int) ( '' == $page ) ? 1 : $page;
                $this->role = $role;
 
                $this->prepare_query();
                $this->query();
-               $this->prepare_vars_for_template_usage();
                $this->do_paging();
        }
 
@@ -550,9 +549,7 @@ class WP_User_Search {
         * @since 2.1.0
         * @access public
         */
-       function prepare_vars_for_template_usage() {
-               $this->search_term = stripslashes($this->search_term); // done with DB, from now on we want slashes gone
-       }
+       function prepare_vars_for_template_usage() {}
 
        /**
         * {@internal Missing Short Description}}
@@ -1015,7 +1012,7 @@ function get_default_page_to_edit() {
  * @since 1.2.0
  * @deprecated 3.5.0
  * @deprecated Use image_resize()
- * @see  image_resize()
+ * @see image_resize()
  *
  * @param mixed $file Filename of the original image, Or attachment id.
  * @param int $max_side Maximum length of a single side for the thumbnail.
@@ -1023,6 +1020,6 @@ function get_default_page_to_edit() {
  * @return string Thumbnail path on success, Error string on failure.
  */
 function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {
-       _deprecated_function( __FUNCTION__, '3.5', 'image_resize' );
+       _deprecated_function( __FUNCTION__, '3.5', 'image_resize()' );
        return apply_filters( 'wp_create_thumbnail', image_resize( $file, $max_side, $max_side ) );
 }
index c66b7f36309dea5b9114db8df1bf61afaa7df291..ae08c3c17d3190abaa40e2beffab9b856a6cd9dd 100644 (file)
@@ -371,7 +371,7 @@ function export_wp( $args = array() ) {
                <link><?php the_permalink_rss() ?></link>
                <pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
                <dc:creator><?php echo get_the_author_meta( 'login' ); ?></dc:creator>
-               <guid isPermaLink="false"><?php esc_url( the_guid() ); ?></guid>
+               <guid isPermaLink="false"><?php the_guid(); ?></guid>
                <description></description>
                <content:encoded><?php echo wxr_cdata( apply_filters( 'the_content_export', $post->post_content ) ); ?></content:encoded>
                <excerpt:encoded><?php echo wxr_cdata( apply_filters( 'the_excerpt_export', $post->post_excerpt ) ); ?></excerpt:encoded>
index 96b6db45c032c70559bdffc601eec01cb907d90c..ca424264bc0a2da81a169576a8cc976ecdeef33e 100644 (file)
@@ -90,7 +90,7 @@ function get_home_path() {
                $home_path = ABSPATH;
        }
 
-       return $home_path;
+       return str_replace( '\\', '/', $home_path );
 }
 
 /**
@@ -497,7 +497,7 @@ function download_url( $url, $timeout = 300 ) {
        if ( ! $tmpfname )
                return new WP_Error('http_no_file', __('Could not create Temporary file.'));
 
-       $response = wp_remote_get( $url, array( 'timeout' => $timeout, 'stream' => true, 'filename' => $tmpfname, 'reject_unsafe_urls' => true ) );
+       $response = wp_safe_remote_get( $url, array( 'timeout' => $timeout, 'stream' => true, 'filename' => $tmpfname ) );
 
        if ( is_wp_error( $response ) ) {
                unlink( $tmpfname );
@@ -911,13 +911,13 @@ function request_filesystem_credentials($form_post, $type = '', $error = false,
        $credentials = get_option('ftp_credentials', array( 'hostname' => '', 'username' => ''));
 
        // If defined, set it to that, Else, If POST'd, set it to that, If not, Set it to whatever it previously was(saved details in option)
-       $credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($_POST['hostname']) ? stripslashes($_POST['hostname']) : $credentials['hostname']);
-       $credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? stripslashes($_POST['username']) : $credentials['username']);
-       $credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? stripslashes($_POST['password']) : '');
+       $credentials['hostname'] = defined('FTP_HOST') ? FTP_HOST : (!empty($_POST['hostname']) ? wp_unslash( $_POST['hostname'] ) : $credentials['hostname']);
+       $credentials['username'] = defined('FTP_USER') ? FTP_USER : (!empty($_POST['username']) ? wp_unslash( $_POST['username'] ) : $credentials['username']);
+       $credentials['password'] = defined('FTP_PASS') ? FTP_PASS : (!empty($_POST['password']) ? wp_unslash( $_POST['password'] ) : '');
 
        // Check to see if we are setting the public/private keys for ssh
-       $credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : (!empty($_POST['public_key']) ? stripslashes($_POST['public_key']) : '');
-       $credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($_POST['private_key']) ? stripslashes($_POST['private_key']) : '');
+       $credentials['public_key'] = defined('FTP_PUBKEY') ? FTP_PUBKEY : (!empty($_POST['public_key']) ? wp_unslash( $_POST['public_key'] ) : '');
+       $credentials['private_key'] = defined('FTP_PRIKEY') ? FTP_PRIKEY : (!empty($_POST['private_key']) ? wp_unslash( $_POST['private_key'] ) : '');
 
        //sanitize the hostname, Some people might pass in odd-data:
        $credentials['hostname'] = preg_replace('|\w+://|', '', $credentials['hostname']); //Strip any schemes off
@@ -935,8 +935,8 @@ function request_filesystem_credentials($form_post, $type = '', $error = false,
        else if ( (defined('FTP_SSL') && FTP_SSL) && 'ftpext' == $type ) //Only the FTP Extension understands SSL
                $credentials['connection_type'] = 'ftps';
        else if ( !empty($_POST['connection_type']) )
-               $credentials['connection_type'] = stripslashes($_POST['connection_type']);
-       else if ( !isset($credentials['connection_type']) ) //All else fails (And its not defaulted to something else saved), Default to FTP
+               $credentials['connection_type'] = wp_unslash( $_POST['connection_type'] );
+       else if ( !isset($credentials['connection_type']) ) //All else fails (And it's not defaulted to something else saved), Default to FTP
                $credentials['connection_type'] = 'ftp';
 
        if ( ! $error &&
@@ -989,7 +989,7 @@ jQuery(function($){
 });
 -->
 </script>
-<form action="<?php echo $form_post ?>" method="post">
+<form action="<?php echo esc_url( $form_post ) ?>" method="post">
 <div class="wrap">
 <?php screen_icon(); ?>
 <h2><?php _e('Connection Information') ?></h2>
@@ -1060,7 +1060,7 @@ jQuery(function($){
 <?php
 foreach ( (array) $extra_fields as $field ) {
        if ( isset( $_POST[ $field ] ) )
-               echo '<input type="hidden" name="' . esc_attr( $field ) . '" value="' . esc_attr( stripslashes( $_POST[ $field ] ) ) . '" />';
+               echo '<input type="hidden" name="' . esc_attr( $field ) . '" value="' . esc_attr( wp_unslash( $_POST[ $field ] ) ) . '" />';
 }
 submit_button( __( 'Proceed' ), 'button', 'upgrade' );
 ?>
index 01bce7bd97208134a9b0ad121d3d362f24f054e6..9d717d7ea4ac0b74698ac3c92ac12e67c6342cd6 100644 (file)
@@ -13,7 +13,7 @@ function wp_image_editor($post_id, $msg = false) {
        $sub_sizes = isset($meta['sizes']) && is_array($meta['sizes']);
        $note = '';
 
-       if ( is_array($meta) && isset($meta['width']) )
+       if ( isset( $meta['width'], $meta['height'] ) )
                $big = max( $meta['width'], $meta['height'] );
        else
                die( __('Image data does not exist. Please re-upload the image.') );
@@ -21,8 +21,9 @@ function wp_image_editor($post_id, $msg = false) {
        $sizer = $big > 400 ? 400 / $big : 1;
 
        $backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true );
-       $can_restore = !empty($backup_sizes) && isset($backup_sizes['full-orig'])
-               && $backup_sizes['full-orig']['file'] != basename($meta['file']);
+       $can_restore = false;
+       if ( ! empty( $backup_sizes ) && isset( $backup_sizes['full-orig'], $meta['file'] ) )
+               $can_restore = $backup_sizes['full-orig']['file'] != basename( $meta['file'] );
 
        if ( $msg ) {
                if ( isset($msg->error) )
@@ -63,8 +64,8 @@ function wp_image_editor($post_id, $msg = false) {
        <input type="hidden" id="imgedit-history-<?php echo $post_id; ?>" value="" />
        <input type="hidden" id="imgedit-undone-<?php echo $post_id; ?>" value="0" />
        <input type="hidden" id="imgedit-selection-<?php echo $post_id; ?>" value="" />
-       <input type="hidden" id="imgedit-x-<?php echo $post_id; ?>" value="<?php echo $meta['width']; ?>" />
-       <input type="hidden" id="imgedit-y-<?php echo $post_id; ?>" value="<?php echo $meta['height']; ?>" />
+       <input type="hidden" id="imgedit-x-<?php echo $post_id; ?>" value="<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>" />
+       <input type="hidden" id="imgedit-y-<?php echo $post_id; ?>" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" />
 
        <div id="imgedit-crop-<?php echo $post_id; ?>" class="imgedit-crop-wrap">
        <img id="image-preview-<?php echo $post_id; ?>" onload="imageEdit.imgLoaded('<?php echo $post_id; ?>')" src="<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>?action=imgedit-preview&amp;_ajax_nonce=<?php echo $nonce; ?>&amp;postid=<?php echo $post_id; ?>&amp;rand=<?php echo rand(1, 99999); ?>" />
@@ -81,10 +82,12 @@ function wp_image_editor($post_id, $msg = false) {
        <div class="imgedit-group-top">
                <a class="imgedit-help-toggle" onclick="imageEdit.toggleHelp(this);return false;" href="#"><strong><?php _e('Scale Image'); ?></strong></a>
                <div class="imgedit-help">
-               <p><?php _e('You can proportionally scale the original image. For best results the scaling should be done before performing any other operations on it like crop, rotate, etc. Note that if you make the image larger it may become fuzzy.'); ?></p>
+               <p><?php _e('You can proportionally scale the original image. For best results the scaling should be done before performing any other operations on it like crop, rotate, etc. Note that images can only be scaled down, not up.'); ?></p>
+               <?php if ( isset( $meta['width'], $meta['height'] ) ): ?>
                <p><?php printf( __('Original dimensions %s'), $meta['width'] . '&times;' . $meta['height'] ); ?></p>
+               <?php endif ?>
                <div class="imgedit-submit">
-               <span class="nowrap"><input type="text" id="imgedit-scale-width-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1)" style="width:4em;" value="<?php echo $meta['width']; ?>" />&times;<input type="text" id="imgedit-scale-height-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0)" style="width:4em;" value="<?php echo $meta['height']; ?>" />
+               <span class="nowrap"><input type="text" id="imgedit-scale-width-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 1)" style="width:4em;" value="<?php echo isset( $meta['width'] ) ? $meta['width'] : 0; ?>" />&times;<input type="text" id="imgedit-scale-height-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0)" style="width:4em;" value="<?php echo isset( $meta['height'] ) ? $meta['height'] : 0; ?>" />
                <span class="imgedit-scale-warn" id="imgedit-scale-warn-<?php echo $post_id; ?>">!</span></span>
                <input type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'scale')" class="button-primary" value="<?php esc_attr_e( 'Scale' ); ?>" />
                </div>
@@ -454,7 +457,7 @@ function stream_preview_image( $post_id ) {
     if ( is_wp_error( $img ) )
         return false;
 
-       $changes = !empty($_REQUEST['history']) ? json_decode( stripslashes($_REQUEST['history']) ) : null;
+       $changes = !empty($_REQUEST['history']) ? json_decode( wp_unslash($_REQUEST['history']) ) : null;
        if ( $changes )
                $img = image_edit_apply_changes( $img, $changes );
 
@@ -499,7 +502,7 @@ function wp_restore_image($post_id) {
                                        $delpath = apply_filters('wp_delete_file', $file);
                                        @unlink($delpath);
                                }
-                       } else {
+                       } elseif ( isset( $meta['width'], $meta['height'] ) ) {
                                $backup_sizes["full-$suffix"] = array('width' => $meta['width'], 'height' => $meta['height'], 'file' => $parts['basename']);
                        }
                }
@@ -587,7 +590,7 @@ function wp_save_image( $post_id ) {
                        return $return;
                }
        } elseif ( !empty($_REQUEST['history']) ) {
-               $changes = json_decode( stripslashes($_REQUEST['history']) );
+               $changes = json_decode( wp_unslash($_REQUEST['history']) );
                if ( $changes )
                        $img = image_edit_apply_changes($img, $changes);
        } else {
index c0fdfd9c231af8ea6f136f199c8119356a4dd283..f2e636bbb868ba787313551830240053c8b7ff88 100644 (file)
@@ -20,7 +20,7 @@
  * @param int $dst_h The destination height.
  * @param int $src_abs Optional. If the source crop points are absolute.
  * @param string $dst_file Optional. The destination file to write to.
- * @return string|WP_Error|false New filepath on success, WP_Error or false on failure.
+ * @return string|WP_Error New filepath on success, WP_Error on failure.
  */
 function wp_crop_image( $src, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs = false, $dst_file = false ) {
        $src_file = $src;
@@ -54,6 +54,9 @@ function wp_crop_image( $src, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $s
        $dst_file = dirname( $dst_file ) . '/' . wp_unique_filename( dirname( $dst_file ), basename( $dst_file ) );
 
        $result = $editor->save( $dst_file );
+       if ( is_wp_error( $result ) )
+               return $result;
+
        return $dst_file;
 }
 
@@ -70,6 +73,7 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
        $attachment = get_post( $attachment_id );
 
        $metadata = array();
+       $support = false;
        if ( preg_match('!^image/!', get_post_mime_type( $attachment )) && file_is_displayable_image($file) ) {
                $imagesize = getimagesize( $file );
                $metadata['width'] = $imagesize[0];
@@ -81,6 +85,7 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
                // make thumbnails and other intermediate sizes
                global $_wp_additional_image_sizes;
 
+               $sizes = array();
                foreach ( get_intermediate_image_sizes() as $s ) {
                        $sizes[$s] = array( 'width' => '', 'height' => '', 'crop' => false );
                        if ( isset( $_wp_additional_image_sizes[$s]['width'] ) )
@@ -113,7 +118,40 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
                if ( $image_meta )
                        $metadata['image_meta'] = $image_meta;
 
+       } elseif ( preg_match( '#^video/#', get_post_mime_type( $attachment ) ) ) {
+               $metadata = wp_read_video_metadata( $file );
+               $support = current_theme_supports( 'post-thumbnails', 'attachment:video' ) && post_type_supports( 'attachment:video', 'thumbnail' );
+       } elseif ( preg_match( '#^audio/#', get_post_mime_type( $attachment ) ) ) {
+               $metadata = wp_read_audio_metadata( $file );
+               $support = current_theme_supports( 'post-thumbnails', 'attachment:audio' ) && post_type_supports( 'attachment:audio', 'thumbnail' );
+       }
+
+       if ( $support && ! empty( $metadata['image']['data'] ) ) {
+               $ext = '.jpg';
+               switch ( $metadata['image']['mime'] ) {
+               case 'image/gif':
+                       $ext = '.gif';
+                       break;
+               case 'image/png':
+                       $ext = '.png';
+                       break;
+               }
+               $basename = str_replace( '.', '-', basename( $file ) ) . '-image' . $ext;
+               $uploaded = wp_upload_bits( $basename, '', $metadata['image']['data'] );
+               if ( false === $uploaded['error'] ) {
+                       $attachment = array(
+                               'post_mime_type' => $metadata['image']['mime'],
+                               'post_type' => 'attachment',
+                               'post_content' => '',
+                       );
+                       $sub_attachment_id = wp_insert_attachment( $attachment, $uploaded['file'] );
+                       $attach_data = wp_generate_attachment_metadata( $sub_attachment_id, $uploaded['file'] );
+                       wp_update_attachment_metadata( $sub_attachment_id, $attach_data );
+                       update_post_meta( $attachment_id, '_thumbnail_id', $sub_attachment_id );
+               }
        }
+       // remove the blob of binary data from the array
+       unset( $metadata['image']['data'] );
 
        return apply_filters( 'wp_generate_attachment_metadata', $metadata, $attachment_id );
 }
index 907bbb92fc7181672487043922f126fb294ed100..69f7ebe6a31a2ca84d403e62c54787ea54e392f2 100644 (file)
@@ -110,7 +110,8 @@ function wp_get_popular_importers() {
        if ( ! $popular_importers ) {
                $url = add_query_arg( 'locale', get_locale(), 'http://api.wordpress.org/core/importers/1.0/' );
                $options = array( 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url() );
-               $popular_importers = maybe_unserialize( wp_remote_retrieve_body( wp_remote_get( $url, $options ) ) );
+               $response = wp_remote_get( $url, $options );
+               $popular_importers = maybe_unserialize( wp_remote_retrieve_body( $response ) );
 
                if ( is_array( $popular_importers ) )
                        set_site_transient( 'popular_importers_' . $locale, $popular_importers, 2 * DAY_IN_SECONDS );
index 3938943a1e75a1d7adf83a7e561f828869bb5fbd..b8cc09817948f908aba17158487aef8d470166d3 100644 (file)
@@ -224,8 +224,60 @@ function media_handle_upload($file_id, $post_id, $post_data = array(), $override
        $title = $name;
        $content = '';
 
+       if ( preg_match( '#^audio#', $type ) ) {
+               $meta = wp_read_audio_metadata( $file );
+
+               if ( ! empty( $meta['title'] ) )
+                       $title = $meta['title'];
+
+               $content = '';
+
+               if ( ! empty( $title ) ) {
+
+                       if ( ! empty( $meta['album'] ) && ! empty( $meta['artist'] ) ) {
+                               /* translators: 1: audio track title, 2: album title, 3: artist name */
+                               $content .= sprintf( __( '"%1$s" from %2$s by %3$s.' ), $title, $meta['album'], $meta['artist'] );
+                       } else if ( ! empty( $meta['album'] ) ) {
+                               /* translators: 1: audio track title, 2: album title */
+                               $content .= sprintf( __( '"%1$s" from %2$s.' ), $title, $meta['album'] );
+                       } else if ( ! empty( $meta['artist'] ) ) {
+                               /* translators: 1: audio track title, 2: artist name */
+                               $content .= sprintf( __( '"%1$s" by %2$s.' ), $title, $meta['artist'] );
+                       } else {
+                               $content .= sprintf( __( '"%s".' ), $title );
+                       }
+
+               } else if ( ! empty( $meta['album'] ) ) {
+
+                       if ( ! empty( $meta['artist'] ) ) {
+                               /* translators: 1: audio album title, 2: artist name */
+                               $content .= sprintf( __( '%1$s by %2$s.' ), $meta['album'], $meta['artist'] );
+                       } else {
+                               $content .= $meta['album'] . '.';
+                       }
+
+               } else if ( ! empty( $meta['artist'] ) ) {
+
+                       $content .= $meta['artist'] . '.';
+
+               }
+
+               if ( ! empty( $meta['year'] ) )
+                       $content .= ' ' . sprintf( __( 'Released: %d.' ), $meta['year'] );
+
+               if ( ! empty( $meta['track_number'] ) ) {
+                       $track_number = explode( '/', $meta['track_number'] );
+                       if ( isset( $track_number[1] ) )
+                               $content .= ' ' . sprintf( __( 'Track %1$s of %2$s.' ), number_format_i18n( $track_number[0] ), number_format_i18n( $track_number[1] ) );
+                       else
+                               $content .= ' ' . sprintf( __( 'Track %1$s.' ), number_format_i18n( $track_number[0] ) );
+               }
+
+               if ( ! empty( $meta['genre'] ) )
+                       $content .= ' ' . sprintf( __( 'Genre: %s.' ), $meta['genre'] );
+
        // use image exif/iptc data for title and caption defaults if possible
-       if ( $image_meta = @wp_read_image_metadata($file) ) {
+       } elseif ( $image_meta = @wp_read_image_metadata( $file ) ) {
                if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) )
                        $title = $image_meta['title'];
                if ( trim( $image_meta['caption'] ) )
@@ -340,7 +392,6 @@ wp_enqueue_style( 'ie' );
 <script type="text/javascript">
 //<![CDATA[
 addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
-var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time(); ?>'};
 var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup',
 isRtl = <?php echo (int) is_rtl(); ?>;
 //]]>
@@ -393,7 +444,7 @@ function media_buttons($editor_id = 'content') {
 
        $img = '<span class="wp-media-buttons-icon"></span> ';
 
-       echo '<a href="#" class="button insert-media add_media" data-editor="' . esc_attr( $editor_id ) . '" title="' . esc_attr__( 'Add Media' ) . '">' . $img . __( 'Add Media' ) . '</a>';
+       echo '<a href="#" id="insert-media-button" class="button insert-media add_media" data-editor="' . esc_attr( $editor_id ) . '" title="' . esc_attr__( 'Add Media' ) . '">' . $img . __( 'Add Media' ) . '</a>';
 
        // Don't use this filter. Want to add a button? Use the media_buttons action.
        $legacy_filter = apply_filters('media_buttons_context', ''); // deprecated
@@ -445,9 +496,8 @@ function media_upload_form_handler() {
 
        if ( !empty($_POST['attachments']) ) foreach ( $_POST['attachments'] as $attachment_id => $attachment ) {
                $post = $_post = get_post($attachment_id, ARRAY_A);
-               $post_type_object = get_post_type_object( $post[ 'post_type' ] );
 
-               if ( !current_user_can( $post_type_object->cap->edit_post, $attachment_id ) )
+               if ( !current_user_can( 'edit_post', $attachment_id ) )
                        continue;
 
                if ( isset($attachment['post_content']) )
@@ -467,11 +517,11 @@ function media_upload_form_handler() {
                $post = apply_filters('attachment_fields_to_save', $post, $attachment);
 
                if ( isset($attachment['image_alt']) ) {
-                       $image_alt = get_post_meta($attachment_id, '_wp_attachment_image_alt', true);
-                       if ( $image_alt != stripslashes($attachment['image_alt']) ) {
-                               $image_alt = wp_strip_all_tags( stripslashes($attachment['image_alt']), true );
+                       $image_alt = wp_unslash( $attachment['image_alt'] );
+                       if ( $image_alt != get_post_meta($attachment_id, '_wp_attachment_image_alt', true) ) {
+                               $image_alt = wp_strip_all_tags( $image_alt, true );
                                // update_meta expects slashed
-                               update_post_meta( $attachment_id, '_wp_attachment_image_alt', addslashes($image_alt) );
+                               update_post_meta( $attachment_id, '_wp_attachment_image_alt', wp_slash( $image_alt ) );
                        }
                }
 
@@ -501,7 +551,7 @@ function media_upload_form_handler() {
        }
 
        if ( isset($send_id) ) {
-               $attachment = stripslashes_deep( $_POST['attachments'][$send_id] );
+               $attachment = wp_unslash( $_POST['attachments'][$send_id] );
 
                $html = isset( $attachment['post_title'] ) ? $attachment['post_title'] : '';
                if ( !empty($attachment['url']) ) {
@@ -546,7 +596,7 @@ function wp_media_upload_handler() {
                        $src = "http://$src";
 
                if ( isset( $_POST['media_type'] ) && 'image' != $_POST['media_type'] ) {
-                       $title = esc_html( stripslashes( $_POST['title'] ) );
+                       $title = esc_html( wp_unslash( $_POST['title'] ) );
                        if ( empty( $title ) )
                                $title = esc_html( basename( $src ) );
 
@@ -561,9 +611,9 @@ function wp_media_upload_handler() {
                        $html = apply_filters( $type . '_send_to_editor_url', $html, esc_url_raw( $src ), $title );
                } else {
                        $align = '';
-                       $alt = esc_attr( stripslashes( $_POST['alt'] ) );
+                       $alt = esc_attr( wp_unslash( $_POST['alt'] ) );
                        if ( isset($_POST['align']) ) {
-                               $align = esc_attr( stripslashes( $_POST['align'] ) );
+                               $align = esc_attr( wp_unslash( $_POST['align'] ) );
                                $class = " class='align$align'";
                        }
                        if ( !empty($src) )
@@ -1108,7 +1158,7 @@ function get_media_item( $attachment_id, $args = null ) {
        }
 
        $display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case
-       $display_title = $show_title ? "<div class='filename new'><span class='title'>" . wp_html_excerpt( $display_title, 60 ) . "</span></div>" : '';
+       $display_title = $show_title ? "<div class='filename new'><span class='title'>" . wp_html_excerpt( $display_title, 60, '&hellip;' ) . "</span></div>" : '';
 
        $gallery = ( ( isset( $_REQUEST['tab'] ) && 'gallery' == $_REQUEST['tab'] ) || ( isset( $redir_tab ) && 'gallery' == $redir_tab ) );
        $order = '';
@@ -1127,7 +1177,7 @@ function get_media_item( $attachment_id, $args = null ) {
 
        $media_dims = '';
        $meta = wp_get_attachment_metadata( $post->ID );
-       if ( is_array( $meta ) && array_key_exists( 'width', $meta ) && array_key_exists( 'height', $meta ) )
+       if ( isset( $meta['width'], $meta['height'] ) )
                $media_dims .= "<span id='media-dims-$post->ID'>{$meta['width']}&nbsp;&times;&nbsp;{$meta['height']}</span> ";
        $media_dims = apply_filters( 'media_meta', $media_dims, $post );
 
@@ -1452,7 +1502,7 @@ function media_upload_form( $errors = null ) {
        global $type, $tab, $pagenow, $is_IE, $is_opera;
 
        if ( ! _device_can_upload() ) {
-               echo '<p>' . __('The web browser on your device cannot be used to upload files. You may be able to use the <a href="http://wordpress.org/extend/mobile/">native app for your device</a> instead.') . '</p>';
+               echo '<p>' . sprintf( __('The web browser on your device cannot be used to upload files. You may be able to use the <a href="%s">native app for your device</a> instead.'), 'http://wordpress.org/mobile/' ) . '</p>';
                return;
        }
 
@@ -1602,7 +1652,7 @@ function media_upload_type_form($type = 'file', $errors = null, $id = null) {
                $form_class .= ' html-uploader';
 ?>
 
-<form enctype="multipart/form-data" method="post" action="<?php echo esc_attr($form_action_url); ?>" class="<?php echo $form_class; ?>" id="<?php echo $type; ?>-form">
+<form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="<?php echo $type; ?>-form">
 <?php submit_button( '', 'hidden', 'save', false ); ?>
 <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
 <?php wp_nonce_field('media-form'); ?>
@@ -1667,7 +1717,7 @@ function media_upload_type_url_form($type = null, $errors = null, $id = null) {
                $form_class .= ' html-uploader';
 ?>
 
-<form enctype="multipart/form-data" method="post" action="<?php echo esc_attr($form_action_url); ?>" class="<?php echo $form_class; ?>" id="<?php echo $type; ?>-form">
+<form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="<?php echo $type; ?>-form">
 <input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
 <?php wp_nonce_field('media-form'); ?>
 
@@ -1818,7 +1868,7 @@ jQuery(function($){
 <a href="#" id="desc"><?php _e('Descending'); ?></a> |
 <a href="#" id="clear"><?php _ex('Clear', 'verb'); ?></a>
 </div>
-<form enctype="multipart/form-data" method="post" action="<?php echo esc_attr($form_action_url); ?>" class="<?php echo $form_class; ?>" id="gallery-form">
+<form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="gallery-form">
 <?php wp_nonce_field('media-form'); ?>
 <?php //media_upload_form( $errors ); ?>
 <table class="widefat" cellspacing="0">
@@ -2058,7 +2108,7 @@ foreach ($arc_result as $arc_row) {
 </div>
 </form>
 
-<form enctype="multipart/form-data" method="post" action="<?php echo esc_attr($form_action_url); ?>" class="<?php echo $form_class; ?>" id="library-form">
+<form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="library-form">
 
 <?php wp_nonce_field('media-form'); ?>
 <?php //media_upload_form( $errors ); ?>
@@ -2283,8 +2333,9 @@ function edit_form_image_editor( $post ) {
        $title = esc_attr( $post->post_title );
        $alt_text = get_post_meta( $post->ID, '_wp_attachment_image_alt', true );
 
-       $att_url = wp_get_attachment_url( $post->ID );
-
+       $att_url = wp_get_attachment_url( $post->ID ); ?>
+       <div class="wp_attachment_holder">
+       <?php
        if ( wp_attachment_is_image( $post->ID ) ) :
                $image_edit_button = '';
                if ( wp_image_editor_supports( array( 'mime_type' => $post->post_mime_type ) ) ) {
@@ -2292,7 +2343,7 @@ function edit_form_image_editor( $post ) {
                        $image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> <span class='spinner'></span>";
                }
        ?>
-       <div class="wp_attachment_holder">
+
                <div class="imgedit-response" id="imgedit-response-<?php echo $attachment_id; ?>"></div>
 
                <div<?php if ( $open ) echo ' style="display:none"'; ?> class="wp_attachment_image" id="media-head-<?php echo $attachment_id; ?>">
@@ -2302,10 +2353,34 @@ function edit_form_image_editor( $post ) {
                <div<?php if ( ! $open ) echo ' style="display:none"'; ?> class="image-editor" id="image-editor-<?php echo $attachment_id; ?>">
                        <?php if ( $open ) wp_image_editor( $attachment_id ); ?>
                </div>
-       </div>
-       <?php endif; ?>
+       <?php
+       elseif ( $attachment_id && 0 === strpos( $post->post_mime_type, 'audio/' ) ):
+
+               echo wp_audio_shortcode( array( 'src' => $att_url ) );
+
+       elseif ( $attachment_id && 0 === strpos( $post->post_mime_type, 'video/' ) ):
+
+               $meta = wp_get_attachment_metadata( $attachment_id );
+               $w = ! empty( $meta['width'] ) ? min( $meta['width'], 600 ) : 0;
+               $h = 0;
+               if ( ! empty( $meta['height'] ) )
+                       $h = $meta['height'];
+               if ( $h && $w < $meta['width'] )
+                       $h = round( ( $meta['height'] * $w ) / $meta['width'] );
+
+               $attr = array( 'src' => $att_url );
+
+               if ( ! empty( $meta['width' ] ) )
+                       $attr['width'] = $w;
 
-       <div class="wp_attachment_details">
+               if ( ! empty( $meta['height'] ) )
+                       $attr['height'] = $h;
+
+               echo wp_video_shortcode( $attr );
+
+       endif; ?>
+       </div>
+       <div class="wp_attachment_details edit-form-section">
                <p>
                        <label for="attachment_caption"><strong><?php _e( 'Caption' ); ?></strong></label><br />
                        <textarea class="widefat" name="excerpt" id="attachment_caption"><?php echo $post->post_excerpt; ?></textarea>
@@ -2319,7 +2394,7 @@ function edit_form_image_editor( $post ) {
        <?php endif; ?>
 
        <?php
-               $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' );
+               $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );
                $editor_args = array(
                        'textarea_name' => 'content',
                        'textarea_rows' => 5,
@@ -2347,11 +2422,11 @@ function edit_form_image_editor( $post ) {
 function attachment_submitbox_metadata() {
        $post = get_post();
 
-       $filename = esc_html( basename( $post->guid ) );
+       $filename = esc_html( wp_basename( $post->guid ) );
 
        $media_dims = '';
        $meta = wp_get_attachment_metadata( $post->ID );
-       if ( is_array( $meta ) && array_key_exists( 'width', $meta ) && array_key_exists( 'height', $meta ) )
+       if ( isset( $meta['width'], $meta['height'] ) )
                $media_dims .= "<span id='media-dims-$post->ID'>{$meta['width']}&nbsp;&times;&nbsp;{$meta['height']}</span> ";
        $media_dims = apply_filters( 'media_meta', $media_dims, $post );
 
@@ -2373,7 +2448,55 @@ function attachment_submitbox_metadata() {
                ?></strong>
        </div>
 
-<?php if ( $media_dims ) : ?>
+<?php
+       if ( preg_match( '#^audio|video#', $post->post_mime_type ) ):
+
+               $fields = array(
+                       'mime_type' => __( 'Mime-type:' ),
+                       'year' => __( 'Year:' ),
+                       'genre' => __( 'Genre:' ),
+                       'length_formatted' => __( 'Length:' ),
+               );
+
+               foreach ( $fields as $key => $label ):
+                       if ( ! empty( $meta[$key] ) ) : ?>
+               <div class="misc-pub-section">
+                       <?php echo $label ?> <strong><?php echo esc_html( $meta[$key] ); ?></strong>
+               </div>
+       <?php
+                       endif;
+               endforeach;
+
+               if ( ! empty( $meta['bitrate'] ) ) : ?>
+               <div class="misc-pub-section">
+                       <?php _e( 'Bitrate:' ); ?> <strong><?php
+                               echo round( $meta['bitrate'] / 1000 ), 'kb/s';
+
+                               if ( ! empty( $meta['bitrate_mode'] ) )
+                                       echo ' ', strtoupper( $meta['bitrate_mode'] );
+
+                       ?></strong>
+               </div>
+       <?php
+               endif;
+
+               $audio_fields = array(
+                       'dataformat' => __( 'Audio Format:' ),
+                       'codec' => __( 'Audio Codec:' )
+               );
+
+               foreach ( $audio_fields as $key => $label ):
+                       if ( ! empty( $meta['audio'][$key] ) ) : ?>
+               <div class="misc-pub-section">
+                       <?php echo $label; ?> <strong><?php echo esc_html( $meta['audio'][$key] ); ?></strong>
+               </div>
+       <?php
+                       endif;
+               endforeach;
+
+       endif;
+
+       if ( $media_dims ) : ?>
        <div class="misc-pub-section">
                <?php _e( 'Dimensions:' ); ?> <strong><?php echo $media_dims; ?></strong>
        </div>
@@ -2395,3 +2518,142 @@ add_filter( 'media_upload_gallery', 'media_upload_gallery' );
 add_filter( 'media_upload_library', 'media_upload_library' );
 
 add_action( 'attachment_submitbox_misc_actions', 'attachment_submitbox_metadata' );
+
+/**
+ * Parse ID3v2, ID3v1, and getID3 comments to extract usable data
+ *
+ * @since 3.6.0
+ *
+ * @param array $metadata An existing array with data
+ * @param array $data Data supplied by ID3 tags
+ */
+function wp_add_id3_tag_data( &$metadata, $data ) {
+       foreach ( array( 'id3v2', 'id3v1' ) as $version ) {
+               if ( ! empty( $data[$version]['comments'] ) ) {
+                       foreach ( $data[$version]['comments'] as $key => $list ) {
+                               if ( ! empty( $list ) ) {
+                                       $metadata[$key] = reset( $list );
+                                       // fix bug in byte stream analysis
+                                       if ( 'terms_of_use' === $key && 0 === strpos( $metadata[$key], 'yright notice.' ) )
+                                               $metadata[$key] = 'Cop' . $metadata[$key];
+                               }
+                       }
+                       break;
+               }
+       }
+
+       if ( ! empty( $data['id3v2']['APIC'] ) ) {
+               $image = reset( $data['id3v2']['APIC']);
+               if ( ! empty( $image['data'] ) ) {
+                       $metadata['image'] = array(
+                               'data' => $image['data'],
+                               'mime' => $image['image_mime'],
+                               'width' => $image['image_width'],
+                               'height' => $image['image_height']
+                       );
+               }
+       } elseif ( ! empty( $data['comments']['picture'] ) ) {
+               $image = reset( $data['comments']['picture'] );
+               if ( ! empty( $image['data'] ) ) {
+                       $metadata['image'] = array(
+                               'data' => $image['data'],
+                               'mime' => $image['image_mime']
+                       );
+               }
+       }
+}
+
+/**
+ * Retrieve metadata from a video file's ID3 tags
+ *
+ * @since 3.6.0
+ *
+ * @param string $file Path to file.
+ * @return array|boolean Returns array of metadata, if found.
+ */
+function wp_read_video_metadata( $file ) {
+       if ( ! file_exists( $file ) )
+               return false;
+
+       $metadata = array();
+
+       if ( ! class_exists( 'getID3' ) )
+               require( ABSPATH . WPINC . '/ID3/getid3.php' );
+       $id3 = new getID3();
+       $data = $id3->analyze( $file );
+
+       if ( isset( $data['video']['lossless'] ) )
+               $metadata['lossless'] = $data['video']['lossless'];
+       if ( ! empty( $data['video']['bitrate'] ) )
+               $metadata['bitrate'] = (int) $data['video']['bitrate'];
+       if ( ! empty( $data['video']['bitrate_mode'] ) )
+               $metadata['bitrate_mode'] = $data['video']['bitrate_mode'];
+       if ( ! empty( $data['filesize'] ) )
+               $metadata['filesize'] = (int) $data['filesize'];
+       if ( ! empty( $data['mime_type'] ) )
+               $metadata['mime_type'] = $data['mime_type'];
+       if ( ! empty( $data['playtime_seconds'] ) )
+               $metadata['length'] = (int) ceil( $data['playtime_seconds'] );
+       if ( ! empty( $data['playtime_string'] ) )
+               $metadata['length_formatted'] = $data['playtime_string'];
+       if ( ! empty( $data['video']['resolution_x'] ) )
+               $metadata['width'] = (int) $data['video']['resolution_x'];
+       if ( ! empty( $data['video']['resolution_y'] ) )
+               $metadata['height'] = (int) $data['video']['resolution_y'];
+       if ( ! empty( $data['fileformat'] ) )
+               $metadata['fileformat'] = $data['fileformat'];
+       if ( ! empty( $data['video']['dataformat'] ) )
+               $metadata['dataformat'] = $data['video']['dataformat'];
+       if ( ! empty( $data['video']['encoder'] ) )
+               $metadata['encoder'] = $data['video']['encoder'];
+       if ( ! empty( $data['video']['codec'] ) )
+               $metadata['codec'] = $data['video']['codec'];
+
+       if ( ! empty( $data['audio'] ) ) {
+               unset( $data['audio']['streams'] );
+               $metadata['audio'] = $data['audio'];
+       }
+
+       wp_add_id3_tag_data( $metadata, $data );
+
+       return $metadata;
+}
+
+/**
+ * Retrieve metadata from a audio file's ID3 tags
+ *
+ * @since 3.6.0
+ *
+ * @param string $file Path to file.
+ * @return array|boolean Returns array of metadata, if found.
+ */
+function wp_read_audio_metadata( $file ) {
+       if ( ! file_exists( $file ) )
+               return false;
+       $metadata = array();
+
+       if ( ! class_exists( 'getID3' ) )
+               require( ABSPATH . WPINC . '/ID3/getid3.php' );
+       $id3 = new getID3();
+       $data = $id3->analyze( $file );
+
+       if ( ! empty( $data['audio'] ) ) {
+               unset( $data['audio']['streams'] );
+               $metadata = $data['audio'];
+       }
+
+       if ( ! empty( $data['fileformat'] ) )
+               $metadata['fileformat'] = $data['fileformat'];
+       if ( ! empty( $data['filesize'] ) )
+               $metadata['filesize'] = (int) $data['filesize'];
+       if ( ! empty( $data['mime_type'] ) )
+               $metadata['mime_type'] = $data['mime_type'];
+       if ( ! empty( $data['playtime_seconds'] ) )
+               $metadata['length'] = (int) ceil( $data['playtime_seconds'] );
+       if ( ! empty( $data['playtime_string'] ) )
+               $metadata['length_formatted'] = $data['playtime_string'];
+
+       wp_add_id3_tag_data( $metadata, $data );
+
+       return $metadata;
+}
index 14cadfa6f7afe8064537be69a3fdf0fb640a4cfe..e315c7666bf8d5402980307c1db22a03ddc38be6 100644 (file)
@@ -156,7 +156,7 @@ function add_menu_classes($menu) {
                        continue;
                }
 
-               if ( 0 === strpos($top[2], 'separator') ) { // if separator
+               if ( 0 === strpos($top[2], 'separator') && false !== $lastorder ) { // if separator
                        $first = true;
                        $c = $menu[$lastorder][4];
                        $menu[$lastorder][4] = add_cssclass('menu-top-last', $c);
index 2b0b2864fcfd1d69679508b48e6ffc7272766749..cefa5a96ba7afd3c607e96cc878eed8105dd2b9f 100644 (file)
@@ -9,7 +9,7 @@
  *
  * @param object $post
  */
-function post_submit_meta_box($post) {
+function post_submit_meta_box($post, $args = array() ) {
        global $action;
 
        $post_type = $post->post_type;
@@ -171,6 +171,24 @@ if ( 0 != $post->ID ) {
        $date = date_i18n( $datef, strtotime( current_time('mysql') ) );
 }
 
+if ( ! empty( $args['args']['revisions_count'] ) ) :
+       $revisions_to_keep = wp_revisions_to_keep( $post );
+?>
+<div class="misc-pub-section num-revisions">
+<?php
+       if ( $revisions_to_keep > 0 && $revisions_to_keep <= $args['args']['revisions_count'] ) {
+               echo '<span title="' . esc_attr( sprintf( __( 'Your site is configured to keep only the last %s revisions.' ),
+                       number_format_i18n( $revisions_to_keep ) ) ) . '">';
+               printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '+</b>' );
+               echo '</span>';
+       } else {
+               printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' );
+       }
+?>
+       <a class="hide-if-no-js" href="<?php echo esc_url( get_edit_post_link( $args['args']['revision_id'] ) ); ?>"><?php _ex( 'Browse', 'revisions' ); ?></a>
+</div>
+<?php endif;
+
 if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
 <div class="misc-pub-section curtime">
        <span id="timestamp">
@@ -315,9 +333,9 @@ function post_format_meta_box( $post, $box ) {
                        $post_formats[0][] = $post_format;
        ?>
        <div id="post-formats-select">
-               <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0"><?php _e('Standard'); ?></label>
+               <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0" class="post-format-icon post-format-standard"><?php echo get_post_format_string( 'standard' ); ?></label>
                <?php foreach ( $post_formats[0] as $format ) : ?>
-               <br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label>
+               <br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>" class="post-format-icon post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label>
                <?php endforeach; ?><br />
        </div>
        <?php endif; endif;
@@ -339,27 +357,27 @@ function post_tags_meta_box($post, $box) {
        extract( wp_parse_args($args, $defaults), EXTR_SKIP );
        $tax_name = esc_attr($taxonomy);
        $taxonomy = get_taxonomy($taxonomy);
-       $disabled = !current_user_can($taxonomy->cap->assign_terms) ? 'disabled="disabled"' : '';
+       $user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms );
        $comma = _x( ',', 'tag delimiter' );
 ?>
 <div class="tagsdiv" id="<?php echo $tax_name; ?>">
        <div class="jaxtag">
        <div class="nojs-tags hide-if-js">
        <p><?php echo $taxonomy->labels->add_or_remove_items; ?></p>
-       <textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php echo $disabled; ?>><?php echo str_replace( ',', $comma . ' ', get_terms_to_edit( $post->ID, $tax_name ) ); // textarea_escaped by esc_attr() ?></textarea></div>
-       <?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?>
+       <textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php disabled( ! $user_can_assign_terms ); ?>><?php echo str_replace( ',', $comma . ' ', get_terms_to_edit( $post->ID, $tax_name ) ); // textarea_escaped by esc_attr() ?></textarea></div>
+       <?php if ( $user_can_assign_terms ) : ?>
        <div class="ajaxtag hide-if-no-js">
                <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label>
                <div class="taghint"><?php echo $taxonomy->labels->add_new_item; ?></div>
                <p><input type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
                <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" /></p>
        </div>
-       <p class="howto"><?php echo esc_attr( $taxonomy->labels->separate_items_with_commas ); ?></p>
+       <p class="howto"><?php echo $taxonomy->labels->separate_items_with_commas; ?></p>
        <?php endif; ?>
        </div>
        <div class="tagchecklist"></div>
 </div>
-<?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?>
+<?php if ( $user_can_assign_terms ) : ?>
 <p class="hide-if-no-js"><a href="#titlediv" class="tagcloud-link" id="link-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->choose_from_most_used; ?></a></p>
 <?php endif; ?>
 <?php
@@ -602,8 +620,8 @@ function post_author_meta_box($post) {
  *
  * @param object $post
  */
-function post_revisions_meta_box($post) {
-       wp_list_post_revisions();
+function post_revisions_meta_box( $post ) {
+       wp_list_post_revisions( $post );
 }
 
 // -- Page related Meta Boxes
@@ -979,4 +997,4 @@ function link_advanced_meta_box($link) {
 function post_thumbnail_meta_box( $post ) {
        $thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true );
        echo _wp_post_thumbnail_html( $thumbnail_id, $post->ID );
-}
\ No newline at end of file
+}
index f09ef4528909908670ba644c3867afd7d7e9ee8c..5b609e45ba1f39dbedd82a37ae3a83ac545448f1 100644 (file)
@@ -220,11 +220,10 @@ add_action( 'update_option_page_on_front', 'update_home_siteurl', 10, 2 );
  * @return string
  */
 function url_shorten( $url ) {
-       $short_url = str_replace( 'http://', '', stripslashes( $url ));
-       $short_url = str_replace( 'www.', '', $short_url );
+       $short_url = str_replace( array( 'http://', 'www.' ), '', $url );
        $short_url = untrailingslashit( $short_url );
        if ( strlen( $short_url ) > 35 )
-               $short_url = substr( $short_url, 0, 32 ) . '...';
+               $short_url = substr( $short_url, 0, 32 ) . '&hellip;';
        return $short_url;
 }
 
@@ -371,7 +370,7 @@ function set_screen_options() {
 }
 
 /**
- * Check if rewrite rule for WordPress already exists in the IIS 7 configuration file
+ * Check if rewrite rule for WordPress already exists in the IIS 7+ configuration file
  *
  * @since 2.8.0
  *
@@ -429,7 +428,7 @@ function iis7_delete_rewrite_rule($filename) {
 }
 
 /**
- * Add WordPress rewrite rule to the IIS 7 configuration file.
+ * Add WordPress rewrite rule to the IIS 7+ configuration file.
  *
  * @since 2.8.0
  *
@@ -561,3 +560,108 @@ function _ipad_meta() {
        }
 }
 add_action('admin_head', '_ipad_meta');
+
+/**
+ * Check lock status for posts displayed on the Posts screen
+ *
+ * @since 3.6
+ */
+function wp_check_locked_posts( $response, $data, $screen_id ) {
+       $checked = array();
+
+       if ( array_key_exists( 'wp-check-locked-posts', $data ) && is_array( $data['wp-check-locked-posts'] ) ) {
+               foreach ( $data['wp-check-locked-posts'] as $key ) {
+                       if ( ! $post_id = absint( substr( $key, 5 ) ) )
+                               continue;
+
+                       if ( ( $user_id = wp_check_post_lock( $post_id ) ) && ( $user = get_userdata( $user_id ) ) && current_user_can( 'edit_post', $post_id ) ) {
+                               $send = array( 'text' => sprintf( __( '%s is currently editing' ), $user->display_name ) );
+
+                               if ( ( $avatar = get_avatar( $user->ID, 18 ) ) && preg_match( "|src='([^']+)'|", $avatar, $matches ) )
+                                       $send['avatar_src'] = $matches[1];
+
+                               $checked[$key] = $send;
+                       }
+               }
+       }
+
+       if ( ! empty( $checked ) )
+               $response['wp-check-locked-posts'] = $checked;
+
+       return $response;
+}
+add_filter( 'heartbeat_received', 'wp_check_locked_posts', 10, 3 );
+
+/**
+ * Check lock status on the New/Edit Post screen and refresh the lock
+ *
+ * @since 3.6
+ */
+function wp_refresh_post_lock( $response, $data, $screen_id ) {
+       if ( array_key_exists( 'wp-refresh-post-lock', $data ) ) {
+               $received = $data['wp-refresh-post-lock'];
+               $send = array();
+
+               if ( ! $post_id = absint( $received['post_id'] ) )
+                       return $response;
+
+               if ( ! current_user_can('edit_post', $post_id) )
+                       return $response;
+
+               if ( ( $user_id = wp_check_post_lock( $post_id ) ) && ( $user = get_userdata( $user_id ) ) ) {
+                       $error = array(
+                               'text' => sprintf( __( '%s has taken over and is currently editing.' ), $user->display_name )
+                       );
+
+                       if ( $avatar = get_avatar( $user->ID, 64 ) ) {
+                               if ( preg_match( "|src='([^']+)'|", $avatar, $matches ) )
+                                       $error['avatar_src'] = $matches[1];
+                       }
+
+                       $send['lock_error'] = $error;
+               } else {
+                       if ( $new_lock = wp_set_post_lock( $post_id ) )
+                               $send['new_lock'] = implode( ':', $new_lock );
+               }
+
+               $response['wp-refresh-post-lock'] = $send;
+       }
+
+       return $response;
+}
+add_filter( 'heartbeat_received', 'wp_refresh_post_lock', 10, 3 );
+
+/**
+ * Check nonce expiration on the New/Edit Post screen and refresh if needed
+ *
+ * @since 3.6
+ */
+function wp_refresh_post_nonces( $response, $data, $screen_id ) {
+       if ( array_key_exists( 'wp-refresh-post-nonces', $data ) ) {
+               $received = $data['wp-refresh-post-nonces'];
+               $response['wp-refresh-post-nonces'] = array( 'check' => 1 );
+
+               if ( ! $post_id = absint( $received['post_id'] ) )
+                       return $response;
+
+               if ( ! current_user_can( 'edit_post', $post_id ) || empty( $received['post_nonce'] ) )
+                       return $response;
+
+               if ( 2 === wp_verify_nonce( $received['post_nonce'], 'update-post_' . $post_id ) ) {
+                       $response['wp-refresh-post-nonces'] = array(
+                               'replace' => array(
+                                       'autosavenonce' => wp_create_nonce('autosave'),
+                                       'getpermalinknonce' => wp_create_nonce('getpermalink'),
+                                       'samplepermalinknonce' => wp_create_nonce('samplepermalink'),
+                                       'closedpostboxesnonce' => wp_create_nonce('closedpostboxes'),
+                                       '_ajax_linking_nonce' => wp_create_nonce( 'internal-linking' ),
+                                       '_wpnonce' => wp_create_nonce( 'update-post_' . $post_id ),
+                               ),
+                               'heartbeatNonce' => wp_create_nonce( 'heartbeat-nonce' ),
+                       );
+               }
+       }
+
+       return $response;
+}
+add_filter( 'heartbeat_received', 'wp_refresh_post_nonces', 10, 3 );
index b62e1d0b2d86cbefe9dacaf908f779e0dde7e5f6..bba4adbe267bdd0defb3b7c34c644086ae9fb48f 100644 (file)
@@ -80,7 +80,7 @@ function wpmu_delete_blog( $blog_id, $drop = false ) {
                $drop = false;
 
        if ( $drop ) {
-               $drop_tables = apply_filters( 'wpmu_drop_tables', $wpdb->tables( 'blog' ) );
+               $drop_tables = apply_filters( 'wpmu_drop_tables', $wpdb->tables( 'blog' ), $blog_id );
 
                foreach ( (array) $drop_tables as $table ) {
                        $wpdb->query( "DROP TABLE IF EXISTS `$table`" );
@@ -135,6 +135,9 @@ function wpmu_delete_user( $id ) {
        $id = (int) $id;
        $user = new WP_User( $id );
 
+       if ( !$user->exists() )
+               return false;
+
        do_action( 'wpmu_delete_user', $id );
 
        $blogs = get_blogs_of_user( $id );
@@ -368,7 +371,7 @@ function update_user_status( $id, $pref, $value, $deprecated = null ) {
        if ( null !== $deprecated )
                _deprecated_argument( __FUNCTION__, '3.1' );
 
-       $wpdb->update( $wpdb->users, array( $pref => $value ), array( 'ID' => $id ) );
+       $wpdb->update( $wpdb->users, array( sanitize_key( $pref ) => $value ), array( 'ID' => $id ) );
 
        $user = new WP_User( $id );
        clean_user_cache( $user );
@@ -525,7 +528,7 @@ function site_admin_notice() {
        if ( !is_super_admin() )
                return false;
        if ( get_site_option( 'wpmu_upgrade_site' ) != $wp_db_version )
-               echo "<div class='update-nag'>" . sprintf( __( 'Thank you for Updating! Please visit the <a href="%s">Update Network</a> page to update all your sites.' ), esc_url( network_admin_url( 'upgrade.php' ) ) ) . "</div>";
+               echo "<div class='update-nag'>" . sprintf( __( 'Thank you for Updating! Please visit the <a href="%s">Upgrade Network</a> page to update all your sites.' ), esc_url( network_admin_url( 'upgrade.php' ) ) ) . "</div>";
 }
 add_action( 'admin_notices', 'site_admin_notice' );
 add_action( 'network_admin_notices', 'site_admin_notice' );
@@ -692,23 +695,3 @@ var tb_pathToImage = "../../wp-includes/js/thickbox/loadingAnimation.gif";
 </script>
 <?php
 }
-
-/**
- * Whether or not we have a large network.
- *
- * The default criteria for a large network is either more than 10,000 users or more than 10,000 sites.
- * Plugins can alter this criteria using the 'wp_is_large_network' filter.
- *
- * @since 3.3.0
- * @param string $using 'sites or 'users'. Default is 'sites'.
- * @return bool True if the network meets the criteria for large. False otherwise.
- */
-function wp_is_large_network( $using = 'sites' ) {
-       if ( 'users' == $using ) {
-               $count = get_user_count();
-               return apply_filters( 'wp_is_large_network', $count > 10000, 'users', $count );
-       }
-
-       $count = get_blog_count();
-       return apply_filters( 'wp_is_large_network', $count > 10000, 'sites', $count );
-}
index 60644628d95a62765b8b130db1f259dc3e0a628f..7e9fe6ad6425c7f6aff9bdc0ffbf166928ebbc19 100644 (file)
@@ -14,7 +14,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
         *
         * @param string $output Passed by reference.
         */
-       function start_lvl(&$output) {}
+       function start_lvl( &$output, $depth = 0, $args = array() ) {}
 
        /**
         * @see Walker_Nav_Menu::end_lvl()
@@ -22,8 +22,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
         *
         * @param string $output Passed by reference.
         */
-       function end_lvl(&$output) {
-       }
+       function end_lvl( &$output, $depth = 0, $args = array() ) {}
 
        /**
         * @see Walker::start_el()
@@ -34,7 +33,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
         * @param int $depth Depth of menu item. Used for padding.
         * @param object $args
         */
-       function start_el(&$output, $item, $depth, $args) {
+       function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
                global $_wp_nav_menu_max_depth;
                $_wp_nav_menu_max_depth = $depth > $_wp_nav_menu_max_depth ? $depth : $_wp_nav_menu_max_depth;
 
@@ -79,13 +78,17 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
                        $title = sprintf( __('%s (Pending)'), $item->title );
                }
 
-               $title = empty( $item->label ) ? $title : $item->label;
+               $title = ( ! isset( $item->label ) || '' == $item->label ) ? $title : $item->label;
+
+               $submenu_text = '';
+               if ( 0 == $depth )
+                       $submenu_text = 'style="display: none;"';
 
                ?>
                <li id="menu-item-<?php echo $item_id; ?>" class="<?php echo implode(' ', $classes ); ?>">
                        <dl class="menu-item-bar">
                                <dt class="menu-item-handle">
-                                       <span class="item-title"><?php echo esc_html( $title ); ?></span>
+                                       <span class="item-title"><span class="menu-item-title"><?php echo esc_html( $title ); ?></span> <span class="is-submenu" <?php echo $submenu_text; ?>><?php _e( 'sub item' ); ?></span></span>
                                        <span class="item-controls">
                                                <span class="item-type"><?php echo esc_html( $item->type_label ); ?></span>
                                                <span class="item-order hide-if-js">
@@ -169,6 +172,17 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
                                        </label>
                                </p>
 
+                               <p class="field-move hide-if-no-js description description-wide">
+                                       <label>
+                                               <span><?php _e( 'Move' ); ?></span>
+                                               <a href="#" class="menus-move-up"><?php _e( 'Up one' ); ?></a>
+                                               <a href="#" class="menus-move-down"><?php _e( 'Down one' ); ?></a>
+                                               <a href="#" class="menus-move-left"></a>
+                                               <a href="#" class="menus-move-right"></a>
+                                               <a href="#" class="menus-move-top"><?php _e( 'To the top' ); ?></a>
+                                       </label>
+                               </p>
+
                                <div class="menu-item-actions description-wide submitbox">
                                        <?php if( 'custom' != $item->type && $original_title !== false ) : ?>
                                                <p class="link-to-original">
@@ -182,10 +196,10 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
                                                                'action' => 'delete-menu-item',
                                                                'menu-item' => $item_id,
                                                        ),
-                                                       remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) )
+                                                       admin_url( 'nav-menus.php' )
                                                ),
                                                'delete-menu_item_' . $item_id
-                                       ); ?>"><?php _e('Remove'); ?></a> <span class="meta-sep"> | </span> <a class="item-cancel submitcancel" id="cancel-<?php echo $item_id; ?>" href="<?php echo esc_url( add_query_arg( array('edit-menu-item' => $item_id, 'cancel' => time()), remove_query_arg( $removed_args, admin_url( 'nav-menus.php' ) ) ) );
+                                       ); ?>"><?php _e( 'Remove' ); ?></a> <span class="meta-sep hide-if-no-js"> | </span> <a class="item-cancel submitcancel hide-if-no-js" id="cancel-<?php echo $item_id; ?>" href="<?php echo esc_url( add_query_arg( array( 'edit-menu-item' => $item_id, 'cancel' => time() ), admin_url( 'nav-menus.php' ) ) );
                                                ?>#menu-item-settings-<?php echo $item_id; ?>"><?php _e('Cancel'); ?></a>
                                </div>
 
@@ -216,12 +230,12 @@ class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
                }
        }
 
-       function start_lvl( &$output, $depth ) {
+       function start_lvl( &$output, $depth = 0, $args = array() ) {
                $indent = str_repeat( "\t", $depth );
                $output .= "\n$indent<ul class='children'>\n";
        }
 
-       function end_lvl( &$output, $depth ) {
+       function end_lvl( &$output, $depth = 0, $args = array() ) {
                $indent = str_repeat( "\t", $depth );
                $output .= "\n$indent</ul>";
        }
@@ -235,7 +249,7 @@ class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
         * @param int $depth Depth of menu item. Used for padding.
         * @param object $args
         */
-       function start_el(&$output, $item, $depth, $args) {
+       function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
                global $_nav_menu_placeholder;
 
                $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1;
@@ -250,6 +264,8 @@ class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
                if ( property_exists( $item, 'front_or_home' ) && $item->front_or_home ) {
                        $title = sprintf( _x( 'Home: %s', 'nav menu front page title' ), $item->post_title );
                        $output .= ' add-to-top';
+               } elseif ( property_exists( $item, 'label' ) ) {
+                       $title = $item->label;
                }
                $output .= '" name="menu-item[' . $possible_object_id . '][menu-item-object-id]" value="'. esc_attr( $item->object_id ) .'" /> ';
                $output .= isset( $title ) ? esc_html( $title ) : esc_html( $item->title );
@@ -382,14 +398,12 @@ function _wp_ajax_menu_quick_search( $request = array() ) {
  **/
 function wp_nav_menu_setup() {
        // Register meta boxes
-       if ( wp_get_nav_menus() )
-               add_meta_box( 'nav-menu-theme-locations', __( 'Theme Locations' ), 'wp_nav_menu_locations_meta_box' , 'nav-menus', 'side', 'default' );
-       add_meta_box( 'add-custom-links', __('Custom Links'), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' );
        wp_nav_menu_post_type_meta_boxes();
+       add_meta_box( 'add-custom-links', __( 'Links' ), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' );
        wp_nav_menu_taxonomy_meta_boxes();
 
        // Register advanced menu items (columns)
-       add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns');
+       add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns' );
 
        // If first time editing, disable advanced items by default.
        if( false === get_user_option( 'managenav-menuscolumnshidden' ) ) {
@@ -411,7 +425,7 @@ function wp_initial_nav_menu_meta_boxes() {
        if ( get_user_option( 'metaboxhidden_nav-menus' ) !== false || ! is_array($wp_meta_boxes) )
                return;
 
-       $initial_meta_boxes = array( 'nav-menu-theme-locations', 'add-custom-links', 'add-page', 'add-category' );
+       $initial_meta_boxes = array( 'nav-menu-theme-locations', 'add-page', 'add-custom-links', 'add-category' );
        $hidden_meta_boxes = array();
 
        foreach ( array_keys($wp_meta_boxes['nav-menus']) as $context ) {
@@ -445,7 +459,9 @@ function wp_nav_menu_post_type_meta_boxes() {
                $post_type = apply_filters( 'nav_menu_meta_box_object', $post_type );
                if ( $post_type ) {
                        $id = $post_type->name;
-                       add_meta_box( "add-{$id}", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', 'default', $post_type );
+                       // give pages a higher priority
+                       $priority = ( 'page' == $post_type->name ? 'core' : 'default' );
+                       add_meta_box( "add-{$id}", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', $priority, $post_type );
                }
        }
 }
@@ -489,7 +505,7 @@ function wp_nav_menu_locations_meta_box() {
        $menu_locations = get_nav_menu_locations();
        $num_locations = count( array_keys($locations) );
 
-       echo '<p class="howto">' . sprintf( _n('Your theme supports %s menu. Select which menu you would like to use.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations ), number_format_i18n($num_locations) ) . '</p>';
+       echo '<p class="howto">' . _n( 'Select a menu to use within your theme.', 'Select the menus you will use in your theme.', $num_locations ) . '</p>';
 
        foreach ( $locations as $location => $description ) {
                ?>
@@ -500,10 +516,7 @@ function wp_nav_menu_locations_meta_box() {
                                        <option value="0"></option>
                                        <?php foreach ( $menus as $menu ) : ?>
                                        <option<?php selected( isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] == $menu->term_id ); ?>
-                                               value="<?php echo $menu->term_id; ?>"><?php
-                                               $truncated_name = wp_html_excerpt( $menu->name, 40 );
-                                               echo $truncated_name == $menu->name ? $menu->name : trim( $truncated_name ) . '&hellip;';
-                                       ?></option>
+                                               value="<?php echo $menu->term_id; ?>"><?php echo wp_html_excerpt( $menu->name, 40, '&hellip;' ); ?></option>
                                        <?php endforeach; ?>
                                </select>
                        </label>
@@ -512,12 +525,32 @@ function wp_nav_menu_locations_meta_box() {
        }
        ?>
        <p class="button-controls">
-               <?php submit_button( __( 'Save' ), 'primary right', 'nav-menu-locations', false, disabled( $nav_menu_selected_id, 0, false ) ); ?>
+               <?php submit_button( __( 'Save' ), 'primary right', 'nav-menu-locations', false, wp_nav_menu_disabled_check( $nav_menu_selected_id ) ); ?>
                <span class="spinner"></span>
        </p>
        <?php
 }
 
+/**
+ * Check whether to disable the Menu Locations meta box submit button
+ *
+ * @since 3.6.0
+ *
+ * @uses global $one_theme_location_no_menus to determine if no menus exist
+ * @uses disabled() to output the disabled attribute in $other_attributes param in submit_button()
+ *
+ * @param int|string $nav_menu_selected_id (id, name or slug) of the currently-selected menu
+ * @return string Disabled attribute if at least one menu exists, false if not
+*/
+function wp_nav_menu_disabled_check( $nav_menu_selected_id ) {
+       global $one_theme_location_no_menus;
+
+       if ( $one_theme_location_no_menus )
+               return false;
+
+       return disabled( $nav_menu_selected_id, 0 );
+}
+
 /**
  * Displays a metabox for the custom links menu item.
  *
@@ -525,43 +558,29 @@ function wp_nav_menu_locations_meta_box() {
  */
 function wp_nav_menu_item_link_meta_box() {
        global $_nav_menu_placeholder, $nav_menu_selected_id;
-       $_nav_menu_placeholder = 0 > $_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1;
-
-       $current_tab = 'create';
-       if ( isset( $_REQUEST['customlink-tab'] ) && in_array( $_REQUEST['customlink-tab'], array('create', 'all') ) ) {
-               $current_tab = $_REQUEST['customlink-tab'];
-       }
 
-       $removed_args = array(
-               'action',
-               'customlink-tab',
-               'edit-menu-item',
-               'menu-item',
-               'page-tab',
-               '_wpnonce',
-       );
+       $_nav_menu_placeholder = 0 > $_nav_menu_placeholder ? $_nav_menu_placeholder - 1 : -1;
 
        ?>
        <div class="customlinkdiv" id="customlinkdiv">
+               <input type="hidden" value="custom" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-type]" />
+               <p id="menu-item-url-wrap">
+                       <label class="howto" for="custom-menu-item-url">
+                               <span><?php _e('URL'); ?></span>
+                               <input id="custom-menu-item-url" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-url]" type="text" class="code menu-item-textbox" value="http://" />
+                       </label>
+               </p>
 
-                       <input type="hidden" value="custom" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-type]" />
-                       <p id="menu-item-url-wrap">
-                               <label class="howto" for="custom-menu-item-url">
-                                       <span><?php _e('URL'); ?></span>
-                                       <input id="custom-menu-item-url" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-url]" type="text" class="code menu-item-textbox" value="http://" />
-                               </label>
-                       </p>
-
-                       <p id="menu-item-name-wrap">
-                               <label class="howto" for="custom-menu-item-name">
-                                       <span><?php _e('Label'); ?></span>
-                                       <input id="custom-menu-item-name" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-title]" type="text" class="regular-text menu-item-textbox input-with-default-title" title="<?php esc_attr_e('Menu Item'); ?>" />
-                               </label>
-                       </p>
+               <p id="menu-item-name-wrap">
+                       <label class="howto" for="custom-menu-item-name">
+                               <span><?php _e( 'Link Text' ); ?></span>
+                               <input id="custom-menu-item-name" name="menu-item[<?php echo $_nav_menu_placeholder; ?>][menu-item-title]" type="text" class="regular-text menu-item-textbox input-with-default-title" title="<?php esc_attr_e('Menu Item'); ?>" />
+                       </label>
+               </p>
 
                <p class="button-controls">
                        <span class="add-to-menu">
-                               <input type="submit"<?php disabled( $nav_menu_selected_id, 0 ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e('Add to Menu'); ?>" name="add-custom-menu-item" id="submit-customlinkdiv" />
+                               <input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e('Add to Menu'); ?>" name="add-custom-menu-item" id="submit-customlinkdiv" />
                                <span class="spinner"></span>
                        </span>
                </p>
@@ -661,10 +680,22 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
        ?>
        <div id="posttype-<?php echo $post_type_name; ?>" class="posttypediv">
                <ul id="posttype-<?php echo $post_type_name; ?>-tabs" class="posttype-tabs add-menu-item-tabs">
-                       <li <?php echo ( 'most-recent' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'most-recent', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent"><?php _e('Most Recent'); ?></a></li>
-                       <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'all', remove_query_arg($removed_args))); ?>#<?php echo $post_type_name; ?>-all"><?php _e('View All'); ?></a></li>
-                       <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'search', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-search"><?php _e('Search'); ?></a></li>
-               </ul>
+                       <li <?php echo ( 'most-recent' == $current_tab ? ' class="tabs"' : '' ); ?>>
+                               <a class="nav-tab-link" data-type="tabs-panel-posttype-<?php echo esc_attr( $post_type_name ); ?>-most-recent" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'most-recent', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent">
+                                       <?php _e( 'Most Recent' ); ?>
+                               </a>
+                       </li>
+                       <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>>
+                               <a class="nav-tab-link" data-type="<?php echo esc_attr( $post_type_name ); ?>-all" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'all', remove_query_arg($removed_args))); ?>#<?php echo $post_type_name; ?>-all">
+                                       <?php _e( 'View All' ); ?>
+                               </a>
+                       </li>
+                       <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>>
+                               <a class="nav-tab-link" data-type="tabs-panel-posttype-<?php echo esc_attr( $post_type_name ); ?>-search" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'search', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-search">
+                                       <?php _e( 'Search'); ?>
+                               </a>
+                       </li>
+               </ul><!-- .posttype-tabs -->
 
                <div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent" class="tabs-panel <?php
                        echo ( 'most-recent' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
@@ -768,18 +799,18 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
                <p class="button-controls">
                        <span class="list-controls">
                                <a href="<?php
-                                       echo esc_url(add_query_arg(
+                                       echo esc_url( add_query_arg(
                                                array(
                                                        $post_type_name . '-tab' => 'all',
                                                        'selectall' => 1,
                                                ),
-                                               remove_query_arg($removed_args)
+                                               remove_query_arg( $removed_args )
                                        ));
                                ?>#posttype-<?php echo $post_type_name; ?>" class="select-all"><?php _e('Select All'); ?></a>
                        </span>
 
                        <span class="add-to-menu">
-                               <input type="submit"<?php disabled( $nav_menu_selected_id, 0 ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e('Add to Menu'); ?>" name="add-post-type-menu-item" id="submit-posttype-<?php echo $post_type_name; ?>" />
+                               <input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( __( 'Add to Menu' ) ); ?>" name="add-post-type-menu-item" id="<?php esc_attr_e( 'submit-posttype-' . $post_type_name ); ?>" />
                                <span class="spinner"></span>
                        </span>
                </p>
@@ -871,10 +902,22 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) {
        ?>
        <div id="taxonomy-<?php echo $taxonomy_name; ?>" class="taxonomydiv">
                <ul id="taxonomy-<?php echo $taxonomy_name; ?>-tabs" class="taxonomy-tabs add-menu-item-tabs">
-                       <li <?php echo ( 'most-used' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'most-used', remove_query_arg($removed_args))); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-pop"><?php _e('Most Used'); ?></a></li>
-                       <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'all', remove_query_arg($removed_args))); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-all"><?php _e('View All'); ?></a></li>
-                       <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="nav-tab-link" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'search', remove_query_arg($removed_args))); ?>#tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>"><?php _e('Search'); ?></a></li>
-               </ul>
+                       <li <?php echo ( 'most-used' == $current_tab ? ' class="tabs"' : '' ); ?>>
+                               <a class="nav-tab-link" data-type="tabs-panel-<?php echo esc_attr( $taxonomy_name ); ?>-pop" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'most-used', remove_query_arg($removed_args))); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-pop">
+                                       <?php _e( 'Most Used' ); ?>
+                               </a>
+                       </li>
+                       <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>>
+                               <a class="nav-tab-link" data-type="tabs-panel-<?php echo esc_attr( $taxonomy_name ); ?>-all" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'all', remove_query_arg($removed_args))); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-all">
+                                       <?php _e( 'View All' ); ?>
+                               </a>
+                       </li>
+                       <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>>
+                               <a class="nav-tab-link" data-type="tabs-panel-search-taxonomy-<?php echo esc_attr( $taxonomy_name ); ?>" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'search', remove_query_arg($removed_args))); ?>#tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>">
+                                       <?php _e( 'Search' ); ?>
+                               </a>
+                       </li>
+               </ul><!-- .taxonomy-tabs -->
 
                <div id="tabs-panel-<?php echo $taxonomy_name; ?>-pop" class="tabs-panel <?php
                        echo ( 'most-used' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
@@ -955,7 +998,7 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $taxonomy ) {
                        </span>
 
                        <span class="add-to-menu">
-                               <input type="submit"<?php disabled( $nav_menu_selected_id, 0 ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e('Add to Menu'); ?>" name="add-taxonomy-menu-item" id="submit-taxonomy-<?php echo $taxonomy_name; ?>" />
+                               <input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( __( 'Add to Menu' ) ); ?>" name="add-taxonomy-menu-item" id="<?php esc_attr_e( 'submit-taxonomy-' . $taxonomy_name ); ?>" />
                                <span class="spinner"></span>
                        </span>
                </p>
@@ -1086,7 +1129,7 @@ function wp_get_nav_menu_to_edit( $menu_id = 0 ) {
                $menu_items = wp_get_nav_menu_items( $menu->term_id, array('post_status' => 'any') );
                $result = '<div id="menu-instructions" class="post-body-plain';
                $result .= ( ! empty($menu_items) ) ? ' menu-instructions-inactive">' : '">';
-               $result .= '<p>' . __('Select menu items (pages, categories, links) from the boxes at left to begin building your custom menu.') . '</p>';
+               $result .= '<p>' . __( 'Add menu items from the column on the left.' ) . '</p>';
                $result .= '</div>';
 
                if( empty($menu_items) )
@@ -1158,5 +1201,88 @@ function _wp_delete_orphaned_draft_menu_items() {
        foreach( (array) $menu_items_to_delete as $menu_item_id )
                wp_delete_post( $menu_item_id, true );
 }
-
 add_action('admin_head-nav-menus.php', '_wp_delete_orphaned_draft_menu_items');
+
+/**
+ * Saves nav menu items
+ *
+ * @since 3.6.0
+ *
+ * @uses wp_get_nav_menu_items() to retrieve the nav menu's menu items
+ * @uses wp_defer_term_counter() to enable then disable term counting
+ *
+ * @param int|string $nav_menu_selected_id (id, slug, or name ) of the currently-selected menu
+ * @param string $nav_menu_selected_title Title of the currently-selected menu
+ * @return array $messages The menu updated message
+ */
+function wp_nav_menu_update_menu_items ( $nav_menu_selected_id, $nav_menu_selected_title ) {
+       $unsorted_menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array( 'orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID', 'post_status' => 'draft,publish' ) );
+
+       $menu_items = array();
+       // Index menu items by db ID
+       foreach ( $unsorted_menu_items as $_item )
+               $menu_items[$_item->db_id] = $_item;
+
+       $post_fields = array(
+               'menu-item-db-id', 'menu-item-object-id', 'menu-item-object',
+               'menu-item-parent-id', 'menu-item-position', 'menu-item-type',
+               'menu-item-title', 'menu-item-url', 'menu-item-description',
+               'menu-item-attr-title', 'menu-item-target', 'menu-item-classes', 'menu-item-xfn'
+       );
+
+       wp_defer_term_counting( true );
+       // Loop through all the menu items' POST variables
+       if ( ! empty( $_POST['menu-item-db-id'] ) ) {
+               foreach( (array) $_POST['menu-item-db-id'] as $_key => $k ) {
+
+                       // Menu item title can't be blank
+                       if ( ! isset( $_POST['menu-item-title'][ $_key ] ) || '' == $_POST['menu-item-title'][ $_key ] )
+                               continue;
+
+                       $args = array();
+                       foreach ( $post_fields as $field )
+                               $args[$field] = isset( $_POST[$field][$_key] ) ? $_POST[$field][$_key] : '';
+
+                       $menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][$_key] != $_key ? 0 : $_key ), $args );
+
+                       if ( is_wp_error( $menu_item_db_id ) )
+                               $messages[] = '<div id="message" class="error"><p>' . $menu_item_db_id->get_error_message() . '</p></div>';
+                       elseif ( isset( $menu_items[$menu_item_db_id] ) )
+                               unset( $menu_items[$menu_item_db_id] );
+               }
+       }
+
+       // Remove menu items from the menu that weren't in $_POST
+       if ( ! empty( $menu_items ) ) {
+               foreach ( array_keys( $menu_items ) as $menu_item_id ) {
+                       if ( is_nav_menu_item( $menu_item_id ) ) {
+                               wp_delete_post( $menu_item_id );
+                       }
+               }
+       }
+
+       // Store 'auto-add' pages.
+       $auto_add = ! empty( $_POST['auto-add-pages'] );
+       $nav_menu_option = (array) get_option( 'nav_menu_options' );
+       if ( ! isset( $nav_menu_option['auto_add'] ) )
+               $nav_menu_option['auto_add'] = array();
+       if ( $auto_add ) {
+               if ( ! in_array( $nav_menu_selected_id, $nav_menu_option['auto_add'] ) )
+                       $nav_menu_option['auto_add'][] = $nav_menu_selected_id;
+       } else {
+               if ( false !== ( $key = array_search( $nav_menu_selected_id, $nav_menu_option['auto_add'] ) ) )
+                       unset( $nav_menu_option['auto_add'][$key] );
+       }
+       // Remove nonexistent/deleted menus
+       $nav_menu_option['auto_add'] = array_intersect( $nav_menu_option['auto_add'], wp_get_nav_menus( array( 'fields' => 'ids' ) ) );
+       update_option( 'nav_menu_options', $nav_menu_option );
+
+       wp_defer_term_counting( false );
+
+       do_action( 'wp_update_nav_menu', $nav_menu_selected_id );
+
+       $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( '<strong>%1$s</strong> has been updated.' ), $nav_menu_selected_title ) . '</p></div>';
+       unset( $menu_items, $unsorted_menu_items );
+
+       return $messages;
+}
index 63a5f711f2bae08ddea250cf1f588f757d9c16c3..1c07b6856c10b609ee959c4104d6a14799949368 100644 (file)
@@ -81,7 +81,7 @@ function install_popular_tags( $args = array() ) {
 
 function install_dashboard() {
        ?>
-       <p><?php printf( __( 'Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="http://wordpress.org/extend/plugins/">WordPress Plugin Directory</a> or upload a plugin in .zip format via <a href="%s">this page</a>.' ), self_admin_url( 'plugin-install.php?tab=upload' ) ); ?></p>
+       <p><?php printf( __( 'Plugins extend and expand the functionality of WordPress. You may automatically install plugins from the <a href="%1$s">WordPress Plugin Directory</a> or upload a plugin in .zip format via <a href="%2$s">this page</a>.' ), 'http://wordpress.org/plugins/', self_admin_url( 'plugin-install.php?tab=upload' ) ); ?></p>
 
        <h4><?php _e('Search') ?></h4>
        <?php install_search_form( false ); ?>
@@ -116,8 +116,8 @@ add_action('install_plugins_dashboard', 'install_dashboard');
  * @since 2.7.0
  */
 function install_search_form( $type_selector = true ) {
-       $type = isset($_REQUEST['type']) ? stripslashes( $_REQUEST['type'] ) : 'term';
-       $term = isset($_REQUEST['s']) ? stripslashes( $_REQUEST['s'] ) : '';
+       $type = isset($_REQUEST['type']) ? wp_unslash( $_REQUEST['type'] ) : 'term';
+       $term = isset($_REQUEST['s']) ? wp_unslash( $_REQUEST['s'] ) : '';
 
        ?><form id="search-plugins" method="get" action="">
                <input type="hidden" name="tab" value="search" />
@@ -160,7 +160,7 @@ add_action('install_plugins_upload', 'install_plugins_upload', 10, 1);
  *
  */
 function install_plugins_favorites_form() {
-       $user = ! empty( $_GET['user'] ) ? stripslashes( $_GET['user'] ) : get_user_option( 'wporg_favorites' );
+       $user = ! empty( $_GET['user'] ) ? wp_unslash( $_GET['user'] ) : get_user_option( 'wporg_favorites' );
        ?>
        <p class="install-help"><?php _e( 'If you have marked plugins as favorites on WordPress.org, you can browse them here.' ); ?></p>
        <form method="get" action="">
@@ -229,7 +229,8 @@ function install_plugin_install_status($api, $loop = false) {
                                if ( current_user_can('install_plugins') )
                                        $url = wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=' . $api->slug), 'install-plugin_' . $api->slug);
                        } else {
-                               $key = array_shift( $key = array_keys($installed_plugin) ); //Use the first plugin regardless of the name, Could have issues for multiple-plugins in one directory if they share different version numbers
+                               $key = array_keys( $installed_plugin );
+                               $key = array_shift( $key ); //Use the first plugin regardless of the name, Could have issues for multiple-plugins in one directory if they share different version numbers
                                if ( version_compare($api->version, $installed_plugin[ $key ]['Version'], '=') ){
                                        $status = 'latest_installed';
                                } elseif ( version_compare($api->version, $installed_plugin[ $key ]['Version'], '<') ) {
@@ -251,7 +252,7 @@ function install_plugin_install_status($api, $loop = false) {
                }
        }
        if ( isset($_GET['from']) )
-               $url .= '&amp;from=' . urlencode(stripslashes($_GET['from']));
+               $url .= '&amp;from=' . urlencode( wp_unslash( $_GET['from'] ) );
 
        return compact('status', 'url', 'version');
 }
@@ -264,7 +265,7 @@ function install_plugin_install_status($api, $loop = false) {
 function install_plugin_information() {
        global $tab;
 
-       $api = plugins_api('plugin_information', array('slug' => stripslashes( $_REQUEST['plugin'] ) ));
+       $api = plugins_api('plugin_information', array('slug' => wp_unslash( $_REQUEST['plugin'] ) ));
 
        if ( is_wp_error($api) )
                wp_die($api);
@@ -295,7 +296,7 @@ function install_plugin_information() {
                        $api->$key = wp_kses( $api->$key, $plugins_allowedtags );
        }
 
-       $section = isset($_REQUEST['section']) ? stripslashes( $_REQUEST['section'] ) : 'description'; //Default to the Description tab, Do not translate, API returns English.
+       $section = isset($_REQUEST['section']) ? wp_unslash( $_REQUEST['section'] ) : 'description'; //Default to the Description tab, Do not translate, API returns English.
        if ( empty($section) || ! isset($api->sections[ $section ]) )
                $section = array_shift( $section_titles = array_keys((array)$api->sections) );
 
@@ -358,7 +359,7 @@ function install_plugin_information() {
 <?php endif; if ( ! empty($api->downloaded) ) : ?>
                        <li><strong><?php _e('Downloaded:') ?></strong> <?php printf(_n('%s time', '%s times', $api->downloaded), number_format_i18n($api->downloaded)) ?></li>
 <?php endif; if ( ! empty($api->slug) && empty($api->external) ) : ?>
-                       <li><a target="_blank" href="http://wordpress.org/extend/plugins/<?php echo $api->slug ?>/"><?php _e('WordPress.org Plugin Page &#187;') ?></a></li>
+                       <li><a target="_blank" href="http://wordpress.org/plugins/<?php echo $api->slug ?>/"><?php _e('WordPress.org Plugin Page &#187;') ?></a></li>
 <?php endif; if ( ! empty($api->homepage) ) : ?>
                        <li><a target="_blank" href="<?php echo $api->homepage ?>"><?php _e('Plugin Homepage &#187;') ?></a></li>
 <?php endif; ?>
@@ -386,7 +387,7 @@ function install_plugin_information() {
                        else
                                $title = ucwords( str_replace( '_', ' ', $section_name ) );
 
-                       $content = links_add_base_url($content, 'http://wordpress.org/extend/plugins/' . $api->slug . '/');
+                       $content = links_add_base_url($content, 'http://wordpress.org/plugins/' . $api->slug . '/');
                        $content = links_add_target($content, '_blank');
 
                        $san_section = esc_attr( $section_name );
index f305ef9bc6111c7f2b4c9d82d7d84a8fbf8eaa13..109e66d8b752e967b87f71b4deb81c5561450a7e 100644 (file)
@@ -728,7 +728,7 @@ function delete_plugins($plugins, $redirect = '' ) {
 
                $this_plugin_dir = trailingslashit( dirname($plugins_dir . $plugin_file) );
                // If plugin is in its own directory, recursively delete the directory.
-               if ( strpos($plugin_file, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory separator AND that its not the root plugin folder
+               if ( strpos($plugin_file, '/') && $this_plugin_dir != $plugins_dir ) //base check on if plugin includes directory separator AND that it's not the root plugin folder
                        $deleted = $wp_filesystem->delete($this_plugin_dir, true);
                else
                        $deleted = $wp_filesystem->delete($plugins_dir . $plugin_file);
index f3ba5691786751f930cfe2c227608d1b661e3104..aecc433ce1f88c33d7cc01551642f47631be9c49 100644 (file)
@@ -28,7 +28,7 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
 
        $ptype = get_post_type_object( $post_data['post_type'] );
 
-       if ( $update && ! current_user_can( $ptype->cap->edit_post, $post_data['ID'] ) ) {
+       if ( $update && ! current_user_can( 'edit_post', $post_data['ID'] ) ) {
                if ( 'page' == $post_data['post_type'] )
                        return new WP_Error( 'edit_others_pages', __( 'You are not allowed to edit pages as this user.' ) );
                else
@@ -172,7 +172,7 @@ function edit_post( $post_data = null ) {
        $post_data['post_mime_type'] = $post->post_mime_type;
 
        $ptype = get_post_type_object($post_data['post_type']);
-       if ( !current_user_can( $ptype->cap->edit_post, $post_ID ) ) {
+       if ( !current_user_can( 'edit_post', $post_ID ) ) {
                if ( 'page' == $post_data['post_type'] )
                        wp_die( __('You are not allowed to edit this page.' ));
                else
@@ -203,11 +203,26 @@ function edit_post( $post_data = null ) {
        }
 
        // Post Formats
-       if ( isset( $post_data['post_format'] ) ) {
-               if ( current_theme_supports( 'post-formats', $post_data['post_format'] ) )
-                       set_post_format( $post_ID, $post_data['post_format'] );
-               elseif ( '0' == $post_data['post_format'] )
-                       set_post_format( $post_ID, false );
+       if ( isset( $post_data['post_format'] ) )
+               set_post_format( $post_ID, $post_data['post_format'] );
+
+       $format_meta_urls = array( 'url', 'link_url', 'quote_source_url' );
+       foreach ( $format_meta_urls as $format_meta_url ) {
+               $keyed = '_format_' . $format_meta_url;
+               if ( isset( $post_data[ $keyed ] ) )
+                       update_post_meta( $post_ID, $keyed, wp_slash( esc_url_raw( wp_unslash( $post_data[ $keyed ] ) ) ) );
+       }
+
+       $format_keys = array( 'quote', 'quote_source_name', 'image', 'gallery', 'audio_embed', 'video_embed' );
+
+       foreach ( $format_keys as $key ) {
+               $keyed = '_format_' . $key;
+               if ( isset( $post_data[ $keyed ] ) ) {
+                       if ( current_user_can( 'unfiltered_html' ) )
+                               update_post_meta( $post_ID, $keyed, $post_data[ $keyed ] );
+                       else
+                               update_post_meta( $post_ID, $keyed, wp_filter_post_kses( $post_data[ $keyed ] ) );
+               }
        }
 
        // Meta Stuff
@@ -238,11 +253,11 @@ function edit_post( $post_data = null ) {
        // Attachment stuff
        if ( 'attachment' == $post_data['post_type'] ) {
                if ( isset( $post_data[ '_wp_attachment_image_alt' ] ) ) {
-                       $image_alt = get_post_meta( $post_ID, '_wp_attachment_image_alt', true );
-                       if ( $image_alt != stripslashes( $post_data['_wp_attachment_image_alt'] ) ) {
-                               $image_alt = wp_strip_all_tags( stripslashes( $post_data['_wp_attachment_image_alt'] ), true );
+                       $image_alt = wp_unslash( $post_data['_wp_attachment_image_alt'] );
+                       if ( $image_alt != get_post_meta( $post_ID, '_wp_attachment_image_alt', true ) ) {
+                               $image_alt = wp_strip_all_tags( $image_alt, true );
                                // update_meta expects slashed
-                               update_post_meta( $post_ID, '_wp_attachment_image_alt', addslashes( $image_alt ) );
+                               update_post_meta( $post_ID, '_wp_attachment_image_alt', wp_slash( $image_alt ) );
                        }
                }
 
@@ -355,19 +370,11 @@ function bulk_edit_posts( $post_data = null ) {
                }
        }
 
-       if ( isset( $post_data['post_format'] ) ) {
-               if ( '0' == $post_data['post_format'] )
-                       $post_data['post_format'] = false;
-               // don't change the post format if it's not supported or not '0' (standard)
-               elseif ( ! current_theme_supports( 'post-formats', $post_data['post_format'] ) )
-                       unset( $post_data['post_format'] );
-       }
-
        $updated = $skipped = $locked = array();
        foreach ( $post_IDs as $post_ID ) {
                $post_type_object = get_post_type_object( get_post_type( $post_ID ) );
 
-               if ( !isset( $post_type_object ) || ( isset($children) && in_array($post_ID, $children) ) || !current_user_can( $post_type_object->cap->edit_post, $post_ID ) ) {
+               if ( !isset( $post_type_object ) || ( isset($children) && in_array($post_ID, $children) ) || !current_user_can( 'edit_post', $post_ID ) ) {
                        $skipped[] = $post_ID;
                        continue;
                }
@@ -412,9 +419,6 @@ function bulk_edit_posts( $post_data = null ) {
                        else
                                unstick_post( $post_ID );
                }
-
-               if ( isset( $post_data['post_format'] ) )
-                       set_post_format( $post_ID, $post_data['post_format'] );
        }
 
        return array( 'updated' => $updated, 'skipped' => $skipped, 'locked' => $locked );
@@ -433,15 +437,15 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false )
 
        $post_title = '';
        if ( !empty( $_REQUEST['post_title'] ) )
-               $post_title = esc_html( stripslashes( $_REQUEST['post_title'] ));
+               $post_title = esc_html( wp_unslash( $_REQUEST['post_title'] ));
 
        $post_content = '';
        if ( !empty( $_REQUEST['content'] ) )
-               $post_content = esc_html( stripslashes( $_REQUEST['content'] ));
+               $post_content = esc_html( wp_unslash( $_REQUEST['content'] ));
 
        $post_excerpt = '';
        if ( !empty( $_REQUEST['excerpt'] ) )
-               $post_excerpt = esc_html( stripslashes( $_REQUEST['excerpt'] ));
+               $post_excerpt = esc_html( wp_unslash( $_REQUEST['excerpt'] ));
 
        if ( $create_in_db ) {
                $post_id = wp_insert_post( array( 'post_title' => __( 'Auto Draft' ), 'post_type' => $post_type, 'post_status' => 'auto-draft' ) );
@@ -490,9 +494,9 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false )
 function post_exists($title, $content = '', $date = '') {
        global $wpdb;
 
-       $post_title = stripslashes( sanitize_post_field( 'post_title', $title, 0, 'db' ) );
-       $post_content = stripslashes( sanitize_post_field( 'post_content', $content, 0, 'db' ) );
-       $post_date = stripslashes( sanitize_post_field( 'post_date', $date, 0, 'db' ) );
+       $post_title = wp_unslash( sanitize_post_field( 'post_title', $title, 0, 'db' ) );
+       $post_content = wp_unslash( sanitize_post_field( 'post_content', $content, 0, 'db' ) );
+       $post_date = wp_unslash( sanitize_post_field( 'post_date', $date, 0, 'db' ) );
 
        $query = "SELECT ID FROM $wpdb->posts WHERE 1=1";
        $args = array();
@@ -623,8 +627,8 @@ function add_meta( $post_ID ) {
        global $wpdb;
        $post_ID = (int) $post_ID;
 
-       $metakeyselect = isset($_POST['metakeyselect']) ? stripslashes( trim( $_POST['metakeyselect'] ) ) : '';
-       $metakeyinput = isset($_POST['metakeyinput']) ? stripslashes( trim( $_POST['metakeyinput'] ) ) : '';
+       $metakeyselect = isset($_POST['metakeyselect']) ? wp_unslash( trim( $_POST['metakeyselect'] ) ) : '';
+       $metakeyinput = isset($_POST['metakeyinput']) ? wp_unslash( trim( $_POST['metakeyinput'] ) ) : '';
        $metavalue = isset($_POST['metavalue']) ? $_POST['metavalue'] : '';
        if ( is_string( $metavalue ) )
                $metavalue = trim( $metavalue );
@@ -642,7 +646,7 @@ function add_meta( $post_ID ) {
                if ( is_protected_meta( $metakey, 'post' ) || ! current_user_can( 'add_post_meta', $post_ID, $metakey ) )
                        return false;
 
-               $metakey = esc_sql( $metakey );
+               $metakey = wp_slash( $metakey );
 
                return add_post_meta( $post_ID, $metakey, $metavalue );
        }
@@ -722,8 +726,8 @@ function has_meta( $postid ) {
  * @return unknown
  */
 function update_meta( $meta_id, $meta_key, $meta_value ) {
-       $meta_key = stripslashes( $meta_key );
-       $meta_value = stripslashes_deep( $meta_value );
+       $meta_key = wp_unslash( $meta_key );
+       $meta_value = wp_unslash( $meta_value );
 
        return update_metadata_by_mid( 'post', $meta_id, $meta_value, $meta_key );
 }
@@ -1002,9 +1006,8 @@ function get_sample_permalink($id, $title = null, $name = null) {
        $original_date = $post->post_date;
        $original_name = $post->post_name;
 
-       // Hack: get_permalink would return ugly permalink for
-       // drafts, so we will fake, that our post is published
-       if ( in_array($post->post_status, array('draft', 'pending')) ) {
+       // Hack: get_permalink() would return ugly permalink for drafts, so we will fake that our post is published.
+       if ( in_array( $post->post_status, array( 'draft', 'pending' ) ) ) {
                $post->post_status = 'publish';
                $post->post_name = sanitize_title($post->post_name ? $post->post_name : $post->post_title, $post->ID);
        }
@@ -1165,7 +1168,7 @@ function wp_check_post_lock( $post_id ) {
        $time = $lock[0];
        $user = isset( $lock[1] ) ? $lock[1] : get_post_meta( $post->ID, '_edit_last', true );
 
-       $time_window = apply_filters( 'wp_check_post_lock_window', AUTOSAVE_INTERVAL * 2 );
+       $time_window = apply_filters( 'wp_check_post_lock_window', 120 );
 
        if ( $time && $time > time() - $time_window && $user != get_current_user_id() )
                return $user;
@@ -1195,31 +1198,108 @@ function wp_set_post_lock( $post_id ) {
 }
 
 /**
- * Outputs the notice message to say that someone else is editing this post at the moment.
+ * Outputs the HTML for the notice to say that someone else is editing or has taken over editing of this post.
  *
  * @since 2.8.5
  * @return none
  */
 function _admin_notice_post_locked() {
-       $post = get_post();
-       $lock = explode( ':', get_post_meta( $post->ID, '_edit_lock', true ) );
-       $user = isset( $lock[1] ) ? $lock[1] : get_post_meta( $post->ID, '_edit_last', true );
-       $last_user = get_userdata( $user );
-       $last_user_name = $last_user ? $last_user->display_name : __('Somebody');
+       if ( ! $post = get_post() )
+               return;
 
-       switch ($post->post_type) {
-               case 'post':
-                       $message = __( 'Warning: %s is currently editing this post' );
-                       break;
-               case 'page':
-                       $message = __( 'Warning: %s is currently editing this page' );
-                       break;
-               default:
-                       $message = __( 'Warning: %s is currently editing this.' );
+       $user = null;
+       if (  $user_id = wp_check_post_lock( $post->ID ) )
+               $user = get_userdata( $user_id );
+
+       if ( $user ) {
+               if ( ! apply_filters( 'show_post_locked_dialog', true, $post, $user ) )
+                       return;
+
+               $locked = true;
+       } else {
+               $locked = false;
+       }
+
+       if ( $locked && ( $sendback = wp_get_referer() ) &&
+               false === strpos( $sendback, 'post.php' ) && false === strpos( $sendback, 'post-new.php' ) ) {
+
+               $sendback_text = __('Go back');
+       } else {
+               $sendback = admin_url( 'edit.php' );
+
+               if ( 'post' != $post->post_type )
+                       $sendback = add_query_arg( 'post_type', $post->post_type, $sendback );
+
+               $sendback_text = get_post_type_object( $post->post_type )->labels->all_items;
+       }
+
+       $hidden = $locked ? '' : ' hidden';
+
+       ?>
+       <div id="post-lock-dialog" class="notification-dialog-wrap<?php echo $hidden; ?>">
+       <div class="notification-dialog-background"></div>
+       <div class="notification-dialog">
+       <?php
+
+       if ( $locked ) {
+               if ( get_post_type_object( $post->post_type )->public ) {
+                       $preview_link = set_url_scheme( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) );
+
+                       if ( 'publish' == $post->post_status || $user->ID != $post->post_author ) {
+                               // Latest content is in autosave
+                               $nonce = wp_create_nonce( 'post_preview_' . $post->ID );
+                               $preview_link = add_query_arg( array( 'preview_id' => $post->ID, 'preview_nonce' => $nonce ), $preview_link );
+                       }
+               } else {
+                       $preview_link = '';
+               }
+
+               $preview_link = apply_filters( 'preview_post_link', $preview_link );
+               $override = apply_filters( 'override_post_lock', true, $post, $user );
+               $tab_last = $override ? '' : ' wp-tab-last';
+
+               ?>
+               <div class="post-locked-message">
+               <div class="post-locked-avatar"><?php echo get_avatar( $user->ID, 64 ); ?></div>
+               <p class="currently-editing wp-tab-first" tabindex="0"><?php echo esc_html( sprintf( __( 'This content is currently locked. If you take over, %s will be blocked from continuing to edit.' ), $user->display_name ) ); ?></p>
+               <?php do_action( 'post_locked_dialog', $post ); ?>
+               <p>
+               <a class="button" href="<?php echo esc_url( $sendback ); ?>"><?php echo $sendback_text; ?></a>
+               <?php if ( $preview_link ) { ?>
+               <a class="button<?php echo $tab_last; ?>" href="<?php echo esc_url( $preview_link ); ?>"><?php _e('Preview'); ?></a>
+               <?php
+               }
+
+               // Allow plugins to prevent some users overriding the post lock
+               if ( $override ) {
+                       ?>
+                       <a class="button button-primary wp-tab-last" href="<?php echo esc_url( add_query_arg( 'get-post-lock', '1', get_edit_post_link( $post->ID, 'url' ) ) ); ?>"><?php _e('Take over'); ?></a>
+                       <?php
+               }
+
+               ?>
+               </p>
+               </div>
+               <?php
+       } else {
+               ?>
+               <div class="post-taken-over">
+                       <div class="post-locked-avatar"></div>
+                       <p class="wp-tab-first" tabindex="0">
+                       <span class="currently-editing"></span><br>
+                       <span class="locked-saving hidden"><img src="images/wpspin_light-2x.gif" width="16" height="16" /> <?php _e('Saving revision...'); ?></span>
+                       <span class="locked-saved hidden"><?php _e('Your latest changes were saved as a revision.'); ?></span>
+                       </p>
+                       <?php do_action( 'post_lock_lost_dialog', $post ); ?>
+                       <p><a class="button button-primary wp-tab-last" href="<?php echo esc_url( $sendback ); ?>"><?php echo $sendback_text; ?></a></p>
+               </div>
+               <?php
        }
 
-       $message = sprintf( $message, esc_html( $last_user_name ) );
-       echo "<div class='error'><p>$message</p></div>";
+       ?>
+       </div>
+       </div>
+       <?php
 }
 
 /**
@@ -1239,19 +1319,37 @@ function wp_create_post_autosave( $post_id ) {
        if ( is_wp_error( $translated ) )
                return $translated;
 
-       // Only store one autosave. If there is already an autosave, overwrite it.
-       if ( $old_autosave = wp_get_post_autosave( $post_id ) ) {
+       $post_author = get_current_user_id();
+
+       // Store one autosave per author. If there is already an autosave, overwrite it.
+       if ( $old_autosave = wp_get_post_autosave( $post_id, $post_author ) ) {
                $new_autosave = _wp_post_revision_fields( $_POST, true );
                $new_autosave['ID'] = $old_autosave->ID;
-               $new_autosave['post_author'] = get_current_user_id();
+               $new_autosave['post_author'] = $post_author;
+
+               // If the new autosave is the same content as the post, delete the old autosave.
+               $post = get_post( $post_id );
+               $autosave_is_different = false;
+               foreach ( array_keys( _wp_post_revision_fields() ) as $field ) {
+                       if ( normalize_whitespace( $new_autosave[ $field ] ) != normalize_whitespace( $post->$field ) ) {
+                               $autosave_is_different = true;
+                               break;
+                       }
+               }
+
+               if ( ! $autosave_is_different ) {
+                       wp_delete_post_revision( $old_autosave->ID );
+                       return;
+               }
+
                return wp_update_post( $new_autosave );
        }
 
        // _wp_put_post_revision() expects unescaped.
-       $_POST = stripslashes_deep($_POST);
+       $post_data = wp_unslash( $_POST );
 
        // Otherwise create the new autosave as a special post revision
-       return _wp_put_post_revision( $_POST, true );
+       return _wp_put_post_revision( $post_data, true );
 }
 
 /**
@@ -1291,14 +1389,16 @@ function post_preview() {
        $post = get_post($post_ID);
 
        if ( 'page' == $post->post_type ) {
-               if ( !current_user_can('edit_page', $post_ID) )
-                       wp_die(__('You are not allowed to edit this page.'));
+               if ( ! current_user_can('edit_page', $post_ID) )
+                       wp_die( __('You are not allowed to edit this page.') );
        } else {
-               if ( !current_user_can('edit_post', $post_ID) )
-                       wp_die(__('You are not allowed to edit this post.'));
+               if ( ! current_user_can('edit_post', $post_ID) )
+                       wp_die( __('You are not allowed to edit this post.') );
        }
 
-       if ( 'draft' == $post->post_status ) {
+       $user_id = get_current_user_id();
+       $locked = wp_check_post_lock( $post->ID );
+       if ( ! $locked && 'draft' == $post->post_status && $user_id == $post->post_author ) {
                $id = edit_post();
        } else { // Non drafts are not overwritten. The autosave is stored in a special post revision.
                $id = wp_create_post_autosave( $post->ID );
@@ -1309,12 +1409,21 @@ function post_preview() {
        if ( is_wp_error($id) )
                wp_die( $id->get_error_message() );
 
-       if ( $_POST['post_status'] == 'draft'  ) {
+       if ( ! $locked && $_POST['post_status'] == 'draft' && $user_id == $post->post_author ) {
                $url = add_query_arg( 'preview', 'true', get_permalink($id) );
        } else {
                $nonce = wp_create_nonce('post_preview_' . $id);
-               $url = add_query_arg( array( 'preview' => 'true', 'preview_id' => $id, 'preview_nonce' => $nonce ), get_permalink($id) );
+               $args = array(
+                       'preview' => 'true',
+                       'preview_id' => $id,
+                       'preview_nonce' => $nonce,
+               );
+
+               if ( isset( $_POST['post_format'] ) )
+                       $args['post_format'] = empty( $_POST['post_format'] ) ? 'standard' : sanitize_key( $_POST['post_format'] );
+
+               $url = add_query_arg( $args, get_permalink($id) );
        }
 
-       return $url;
+       return apply_filters( 'preview_post_link', $url );
 }
diff --git a/wp-admin/includes/revision.php b/wp-admin/includes/revision.php
new file mode 100644 (file)
index 0000000..597ec1f
--- /dev/null
@@ -0,0 +1,209 @@
+<?php
+/**
+ * WordPress Administration Revisions API.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/**
+ * Get the revision UI diff.
+ *
+ * @since 3.6.0
+ *
+ * @param object $post The post object.
+ * @param int $compare_from The revision id to compare from.
+ * @param int $compare_to The revision id to come to.
+ *
+ * @return array|bool Associative array of a post's revisioned fields and their diffs.
+ *     Or, false on failure.
+ */
+function wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) {
+       if ( ! $post = get_post( $post ) )
+               return false;
+
+       if ( $compare_from ) {
+               if ( ! $compare_from = get_post( $compare_from ) )
+                       return false;
+       } else {
+               // If we're dealing with the first revision...
+               $compare_from = false;
+       }
+
+       if ( ! $compare_to = get_post( $compare_to ) )
+               return false;
+
+       // If comparing revisions, make sure we're dealing with the right post parent.
+       // The parent post may be a 'revision' when revisions are disabled and we're looking at autosaves.
+       if ( $compare_from && $compare_from->post_parent !== $post->ID && $compare_from->ID !== $post->ID )
+               return false;
+       if ( $compare_to->post_parent !== $post->ID && $compare_to->ID !== $post->ID )
+               return false;
+
+       if ( $compare_from && strtotime( $compare_from->post_date_gmt ) > strtotime( $compare_to->post_date_gmt ) ) {
+               $temp = $compare_from;
+               $compare_from = $compare_to;
+               $compare_to = $temp;
+       }
+
+       // Add default title if title field is empty
+       if ( $compare_from && empty( $compare_from->post_title ) )
+               $compare_from->post_title = __( '(no title)' );
+       if ( empty( $compare_to->post_title ) )
+               $compare_to->post_title = __( '(no title)' );
+
+       $return = array();
+
+       foreach ( _wp_post_revision_fields() as $field => $name ) {
+               $content_from = $compare_from ? apply_filters( "_wp_post_revision_field_$field", $compare_from->$field, $field, $compare_from, 'from' ) : '';
+               $content_to = apply_filters( "_wp_post_revision_field_$field", $compare_to->$field, $field, $compare_to, 'to' );
+
+               $diff = wp_text_diff( $content_from, $content_to, array( 'show_split_view' => true ) );
+
+               if ( ! $diff && 'post_title' === $field ) {
+                       // It's a better user experience to still show the Title, even if it didn't change.
+                       // No, you didn't see this.
+                       $diff = '<table class="diff"><colgroup><col class="content diffsplit left"><col class="content diffsplit middle"><col class="content diffsplit right"></colgroup><tbody><tr>';
+                       $diff .= '<td>' . esc_html( $compare_from->post_title ) . '</td><td></td><td>' . esc_html( $compare_to->post_title ) . '</td>';
+                       $diff .= '</tr></tbody>';
+                       $diff .= '</table>';
+               }
+
+               if ( $diff ) {
+                       $return[] = array(
+                               'id' => $field,
+                               'name' => $name,
+                               'diff' => $diff,
+                       );
+               }
+       }
+       return $return;
+}
+
+/**
+ * Prepare revisions for JavaScript.
+ *
+ * @since 3.6.0
+ *
+ * @param object $post The post object.
+ * @param int $selected_revision_id The selected revision id.
+ * @param int $from (optional) The revision id to compare from.
+ *
+ * @return array An associative array of revision data and related settings.
+ */
+function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null ) {
+       $post = get_post( $post );
+       $revisions = $authors = array();
+       $now_gmt = time();
+
+       $revisions = wp_get_post_revisions( $post->ID, array( 'order' => 'ASC', 'check_enabled' => false ) );
+       // If revisions are disabled, we only want autosaves and the current post.
+       if ( ! wp_revisions_enabled( $post ) ) {
+               foreach ( $revisions as $revision_id => $revision ) {
+                       if ( ! wp_is_post_autosave( $revision ) )
+                               unset( $revisions[ $revision_id ] );
+               }
+               $revisions = array( $post->ID => $post ) + $revisions;
+       }
+
+       $show_avatars = get_option( 'show_avatars' );
+
+       cache_users( wp_list_pluck( $revisions, 'post_author' ) );
+
+       $can_restore = current_user_can( 'edit_post', $post->ID );
+
+       foreach ( $revisions as $revision ) {
+               $modified = strtotime( $revision->post_modified );
+               $modified_gmt = strtotime( $revision->post_modified_gmt );
+               if ( $can_restore ) {
+                       $restore_link = str_replace( '&amp;', '&', wp_nonce_url(
+                               add_query_arg(
+                                       array( 'revision' => $revision->ID,
+                                               'action' => 'restore' ),
+                                               admin_url( 'revision.php' )
+                               ),
+                               "restore-post_{$revision->ID}"
+                       ) );
+               }
+
+               if ( ! isset( $authors[ $revision->post_author ] ) ) {
+                       $authors[ $revision->post_author ] = array(
+                               'id' => (int) $revision->post_author,
+                               'avatar' => $show_avatars ? get_avatar( $revision->post_author, 32 ) : '',
+                               'name' => get_the_author_meta( 'display_name', $revision->post_author ),
+                       );
+               }
+
+               $autosave = (bool) wp_is_post_autosave( $revision );
+               $current = ! $autosave && $revision->post_modified_gmt === $post->post_modified_gmt;
+               if ( $current && ! empty( $current_id ) ) {
+                       // If multiple revisions have the same post_modified_gmt, highest ID is current.
+                       if ( $current_id < $revision->ID ) {
+                               $revisions[ $current_id ]['current'] = false;
+                               $current_id = $revision->ID;
+                       } else {
+                               $current = false;
+                       }
+               } elseif ( $current ) {
+                       $current_id = $revision->ID;
+               }
+
+               $revisions[ $revision->ID ] = array(
+                       'id'         => $revision->ID,
+                       'title'      => get_the_title( $post->ID ),
+                       'author'     => $authors[ $revision->post_author ],
+                       'date'       => date_i18n( __( 'M j, Y @ G:i' ), $modified ),
+                       'dateShort'  => date_i18n( _x( 'j M @ G:i', 'revision date short format' ), $modified ),
+                       'timeAgo'    => sprintf( __( '%s ago' ), human_time_diff( $modified_gmt, $now_gmt ) ),
+                       'autosave'   => $autosave,
+                       'current'    => $current,
+                       'restoreUrl' => $can_restore ? $restore_link : false,
+               );
+       }
+
+       // If a post has been saved since the last revision (no revisioned fields were changed)
+       // we may not have a "current" revision. Mark the latest revision as "current".
+       if ( empty( $current_id ) ) {
+               if ( $revisions[ $revision->ID ]['autosave'] ) {
+                       $revision = end( $revisions );
+                       while ( $revision['autosave'] ) {
+                               $revision = prev( $revisions );
+                       }
+                       $current_id = $revision['id'];
+               } else {
+                       $current_id = $revision->ID;
+               }
+               $revisions[ $current_id ]['current'] = true;
+       }
+
+       // Now, grab the initial diff
+       $compare_two_mode = is_numeric( $from );
+       if ( ! $compare_two_mode ) {
+               $found = array_search( $selected_revision_id, array_keys( $revisions ) );
+               if ( $found ) {
+                       $from = array_keys( array_slice( $revisions, $found - 1, 1, true ) );
+                       $from = reset( $from );
+               } else {
+                       $from = 0;
+               }
+       }
+
+       $from = absint( $from );
+
+       $diffs = array( array(
+               'id' => $from . ':' . $selected_revision_id,
+               'fields' => wp_get_revision_ui_diff( $post->ID, $from, $selected_revision_id ),
+       ));
+
+       return array(
+               'postId'           => $post->ID,
+               'nonce'            => wp_create_nonce( 'revisions-ajax-nonce' ),
+               'revisionData'     => array_values( $revisions ),
+               'to'               => $selected_revision_id,
+               'from'             => $from,
+               'diffData'         => $diffs,
+               'baseUrl'          => parse_url( admin_url( 'revision.php' ), PHP_URL_PATH ),
+               'compareTwoMode'   => absint( $compare_two_mode ), // Apparently booleans are not allowed
+               'revisionIds'      => array_keys( $revisions ),
+       );
+}
index f042fdd4066071a368f74c4b970023760efb1681..162651a418cc60fabaeb3017434cf856f359cdf8 100644 (file)
@@ -494,7 +494,8 @@ function populate_options() {
        // Set autoload to no for these options
        $fat_options = array( 'moderation_keys', 'recently_edited', 'blacklist_keys', 'uninstall_plugins' );
 
-       $existing_options = $wpdb->get_col("SELECT option_name FROM $wpdb->options");
+       $keys = "'" . implode( "', '", array_keys( $options ) ) . "'";
+       $existing_options = $wpdb->get_col( "SELECT option_name FROM $wpdb->options WHERE option_name in ( $keys )" );
 
        $insert = '';
        foreach ( $options as $option => $value ) {
@@ -505,13 +506,11 @@ function populate_options() {
                else
                        $autoload = 'yes';
 
-               $option = $wpdb->escape($option);
                if ( is_array($value) )
                        $value = serialize($value);
-               $value = $wpdb->escape($value);
                if ( !empty($insert) )
                        $insert .= ', ';
-               $insert .= "('$option', '$value', '$autoload')";
+               $insert .= $wpdb->prepare( "(%s, %s, %s)", $option, $value, $autoload );
        }
 
        if ( !empty($insert) )
@@ -588,7 +587,7 @@ function populate_roles_160() {
        add_role('subscriber', 'Subscriber');
 
        // Add caps for Administrator role
-       $role =& get_role('administrator');
+       $role = get_role('administrator');
        $role->add_cap('switch_themes');
        $role->add_cap('edit_themes');
        $role->add_cap('activate_plugins');
@@ -621,7 +620,7 @@ function populate_roles_160() {
        $role->add_cap('level_0');
 
        // Add caps for Editor role
-       $role =& get_role('editor');
+       $role = get_role('editor');
        $role->add_cap('moderate_comments');
        $role->add_cap('manage_categories');
        $role->add_cap('manage_links');
@@ -643,7 +642,7 @@ function populate_roles_160() {
        $role->add_cap('level_0');
 
        // Add caps for Author role
-       $role =& get_role('author');
+       $role = get_role('author');
        $role->add_cap('upload_files');
        $role->add_cap('edit_posts');
        $role->add_cap('edit_published_posts');
@@ -654,14 +653,14 @@ function populate_roles_160() {
        $role->add_cap('level_0');
 
        // Add caps for Contributor role
-       $role =& get_role('contributor');
+       $role = get_role('contributor');
        $role->add_cap('edit_posts');
        $role->add_cap('read');
        $role->add_cap('level_1');
        $role->add_cap('level_0');
 
        // Add caps for Subscriber role
-       $role =& get_role('subscriber');
+       $role = get_role('subscriber');
        $role->add_cap('read');
        $role->add_cap('level_0');
 }
@@ -674,7 +673,7 @@ function populate_roles_160() {
 function populate_roles_210() {
        $roles = array('administrator', 'editor');
        foreach ($roles as $role) {
-               $role =& get_role($role);
+               $role = get_role($role);
                if ( empty($role) )
                        continue;
 
@@ -695,19 +694,19 @@ function populate_roles_210() {
                $role->add_cap('read_private_pages');
        }
 
-       $role =& get_role('administrator');
+       $role = get_role('administrator');
        if ( ! empty($role) ) {
                $role->add_cap('delete_users');
                $role->add_cap('create_users');
        }
 
-       $role =& get_role('author');
+       $role = get_role('author');
        if ( ! empty($role) ) {
                $role->add_cap('delete_posts');
                $role->add_cap('delete_published_posts');
        }
 
-       $role =& get_role('contributor');
+       $role = get_role('contributor');
        if ( ! empty($role) ) {
                $role->add_cap('delete_posts');
        }
@@ -719,7 +718,7 @@ function populate_roles_210() {
  * @since 2.3.0
  */
 function populate_roles_230() {
-       $role =& get_role( 'administrator' );
+       $role = get_role( 'administrator' );
 
        if ( !empty( $role ) ) {
                $role->add_cap( 'unfiltered_upload' );
@@ -732,7 +731,7 @@ function populate_roles_230() {
  * @since 2.5.0
  */
 function populate_roles_250() {
-       $role =& get_role( 'administrator' );
+       $role = get_role( 'administrator' );
 
        if ( !empty( $role ) ) {
                $role->add_cap( 'edit_dashboard' );
@@ -745,7 +744,7 @@ function populate_roles_250() {
  * @since 2.6.0
  */
 function populate_roles_260() {
-       $role =& get_role( 'administrator' );
+       $role = get_role( 'administrator' );
 
        if ( !empty( $role ) ) {
                $role->add_cap( 'update_plugins' );
@@ -759,7 +758,7 @@ function populate_roles_260() {
  * @since 2.7.0
  */
 function populate_roles_270() {
-       $role =& get_role( 'administrator' );
+       $role = get_role( 'administrator' );
 
        if ( !empty( $role ) ) {
                $role->add_cap( 'install_plugins' );
@@ -773,7 +772,7 @@ function populate_roles_270() {
  * @since 2.8.0
  */
 function populate_roles_280() {
-       $role =& get_role( 'administrator' );
+       $role = get_role( 'administrator' );
 
        if ( !empty( $role ) ) {
                $role->add_cap( 'install_themes' );
@@ -786,7 +785,7 @@ function populate_roles_280() {
  * @since 3.0.0
  */
 function populate_roles_300() {
-       $role =& get_role( 'administrator' );
+       $role = get_role( 'administrator' );
 
        if ( !empty( $role ) ) {
                $role->add_cap( 'update_core' );
@@ -921,13 +920,11 @@ We hope you enjoy your new site. Thanks!
 
        $insert = '';
        foreach ( $sitemeta as $meta_key => $meta_value ) {
-               $meta_key = $wpdb->escape( $meta_key );
                if ( is_array( $meta_value ) )
                        $meta_value = serialize( $meta_value );
-               $meta_value = $wpdb->escape( $meta_value );
                if ( !empty( $insert ) )
                        $insert .= ', ';
-               $insert .= "( $network_id, '$meta_key', '$meta_value')";
+               $insert .= $wpdb->prepare( "( %d, %s, %s)", $network_id, $meta_key, $meta_value );
        }
        $wpdb->query( "INSERT INTO $wpdb->sitemeta ( site_id, meta_key, meta_value ) VALUES " . $insert );
 
index 4a409e8c68b4297b831469ccf2c43801708cd0a4..2ab5161bff08601df3e8d407ac79e9c827438374 100644 (file)
@@ -142,6 +142,7 @@ function screen_icon( $screen = '' ) {
  *
  * @since 3.2.0
  *
+ * @global $post_ID
  * @param string|WP_Screen $screen Optional. Accepts a screen object (and defaults to the current screen object)
  *     which it uses to determine an icon HTML ID. Or, if a string is provided, it is used to form the icon HTML ID.
  * @return string HTML for the screen icon.
@@ -319,20 +320,20 @@ final class WP_Screen {
 
        /**
         * The help tab data associated with the screen, if any.
-        *
-        * @since 3.3.0
-        * @var array
-        * @access private
-        */
+        *
+        * @since 3.3.0
+        * @var array
+        * @access private
+        */
        private $_help_tabs = array();
 
-       /**
+       /**
         * The help sidebar data associated with screen, if any.
         *
         * @since 3.3.0
         * @var string
         * @access private
-        */
+        */
        private $_help_sidebar = '';
 
        /**
@@ -376,16 +377,16 @@ final class WP_Screen {
         */
        private $_screen_settings;
 
-       /**
+       /**
         * Fetches a screen object.
-        *
-        * @since 3.3.0
+        *
+        * @since 3.3.0
         * @access public
-        *
+        *
         * @param string $hook_name Optional. The hook name (also known as the hook suffix) used to determine the screen.
         *      Defaults to the current $hook_suffix global.
         * @return WP_Screen Screen object.
-        */
+        */
        public static function get( $hook_name = '' ) {
 
                if ( is_a( $hook_name, 'WP_Screen' ) )
@@ -427,13 +428,13 @@ final class WP_Screen {
                        if ( 'edit-comments' != $id && 'edit-tags' != $id && 'edit-' == substr( $id, 0, 5 ) ) {
                                $maybe = substr( $id, 5 );
                                if ( taxonomy_exists( $maybe ) ) {
-                                       $id = 'edit-tags';
+                                       $id = 'edit-tags';
                                        $taxonomy = $maybe;
                                } elseif ( post_type_exists( $maybe ) ) {
                                        $id = 'edit';
                                        $post_type = $maybe;
                                }
-                       }
+                       }
 
                        if ( ! $in_admin )
                                $in_admin = 'site';
@@ -480,7 +481,7 @@ final class WP_Screen {
                                                $post_type = 'post';
                                        break;
                        }
-               }
+               }
 
                switch ( $base ) {
                        case 'post' :
@@ -513,7 +514,7 @@ final class WP_Screen {
                } elseif ( 'user' == $in_admin ) {
                        $id   .= '-user';
                        $base .= '-user';
-               }
+               }
 
                if ( isset( self::$_registry[ $id ] ) ) {
                        $screen = self::$_registry[ $id ];
@@ -535,7 +536,7 @@ final class WP_Screen {
                self::$_registry[ $id ] = $screen;
 
                return $screen;
-       }
+       }
 
        /**
         * Makes the screen object the current screen.
@@ -898,14 +899,17 @@ final class WP_Screen {
 
                $show_screen = ! empty( $wp_meta_boxes[ $this->id ] ) || $columns || $this->get_option( 'per_page' );
 
-               $this->_screen_settings = apply_filters( 'screen_settings', '', $this );
-
                switch ( $this->id ) {
                        case 'widgets':
                                $this->_screen_settings = '<p><a id="access-on" href="widgets.php?widgets-access=on">' . __('Enable accessibility mode') . '</a><a id="access-off" href="widgets.php?widgets-access=off">' . __('Disable accessibility mode') . "</a></p>\n";
                                break;
+                       default:
+                               $this->_screen_settings = '';
+                               break;
                }
 
+               $this->_screen_settings = apply_filters( 'screen_settings', $this->_screen_settings, $this );
+
                if ( $this->_screen_settings || $this->_options )
                        $show_screen = true;
 
@@ -923,6 +927,7 @@ final class WP_Screen {
 
                $columns = get_column_headers( $this );
                $hidden  = get_hidden_columns( $this );
+               $post    = get_post();
 
                ?>
                <div id="screen-options-wrap" class="hidden" tabindex="-1" aria-label="<?php esc_attr_e('Screen Options Tab'); ?>">
index 7423cf9214919c186fba6b08634ef701a2c80118..fdc6d64d554439de4a6da39d4a1ee1e0aeef7abf 100644 (file)
@@ -158,7 +158,7 @@ function wp_update_category($catarr) {
        $category = get_category($cat_ID, ARRAY_A);
 
        // Escape data pulled from DB.
-       $category = add_magic_quotes($category);
+       $category = wp_slash($category);
 
        // Merge old and new fields with new fields overwriting old ones.
        $catarr = array_merge($category, $catarr);
index 788a4bd55f3c22a67e7ec99defb6948481b02c89..d8d82a0c98f3cafd4956523298acaf2e01067bd7 100644 (file)
@@ -34,7 +34,7 @@ class Walker_Category_Checklist extends Walker {
                $output .= "$indent</ul>\n";
        }
 
-       function start_el( &$output, $category, $depth, $args, $id = 0 ) {
+       function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
                extract($args);
                if ( empty($taxonomy) )
                        $taxonomy = 'category';
@@ -176,10 +176,6 @@ function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $ech
        $terms = get_terms( $taxonomy, array( 'orderby' => 'count', 'order' => 'DESC', 'number' => $number, 'hierarchical' => false ) );
 
        $tax = get_taxonomy($taxonomy);
-       if ( ! current_user_can($tax->cap->assign_terms) )
-               $disabled = 'disabled="disabled"';
-       else
-               $disabled = '';
 
        $popular_ids = array();
        foreach ( (array) $terms as $term ) {
@@ -192,7 +188,7 @@ function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $ech
 
                <li id="<?php echo $id; ?>" class="popular-category">
                        <label class="selectit">
-                       <input id="in-<?php echo $id; ?>" type="checkbox" <?php echo $checked; ?> value="<?php echo (int) $term->term_id; ?>" <?php echo $disabled ?>/>
+                       <input id="in-<?php echo $id; ?>" type="checkbox" <?php echo $checked; ?> value="<?php echo (int) $term->term_id; ?>" <?php disabled( ! current_user_can( $tax->cap->assign_terms ) ); ?> />
                                <?php echo esc_html( apply_filters( 'the_category', $term->name ) ); ?>
                        </label>
                </li>
@@ -244,7 +240,7 @@ function wp_link_category_checklist( $link_id = 0 ) {
  */
 function get_inline_data($post) {
        $post_type_object = get_post_type_object($post->post_type);
-       if ( ! current_user_can($post_type_object->cap->edit_post, $post->ID) )
+       if ( ! current_user_can( 'edit_post', $post->ID ) )
                return;
 
        $title = esc_textarea( trim( $post->post_title ) );
@@ -349,7 +345,7 @@ function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single',
 
        <div id="replycontainer">
        <?php
-       $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,spell,close' );
+       $quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );
        wp_editor( '', 'replycontent', array( 'media_buttons' => false, 'tinymce' => false, 'quicktags' => $quicktags_settings ) );
        ?>
        </div>
@@ -539,6 +535,8 @@ function meta_form() {
 <?php
 
        foreach ( $keys as $key ) {
+               if ( is_protected_meta( $key, 'post' ) )
+                       continue;
                echo "\n<option value='" . esc_attr($key) . "'>" . esc_html($key) . "</option>";
        }
 ?>
@@ -621,8 +619,8 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
        $minute = '<input type="text" ' . ( $multi ? '' : 'id="mn" ' ) . 'name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />';
 
        echo '<div class="timestamp-wrap">';
-       /* translators: 1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input */
-       printf(__('%1$s%2$s, %3$s @ %4$s : %5$s'), $month, $day, $year, $hour, $minute);
+       /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
+       printf( __( '%1$s %2$s, %3$s @ %4$s : %5$s' ), $month, $day, $year, $hour, $minute );
 
        echo '</div><input type="hidden" id="ss" name="ss" value="' . $ss . '" />';
 
@@ -680,7 +678,7 @@ function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
        if ( $items ) {
                foreach ( $items as $item ) {
                        // A page cannot be its own parent.
-                       if ( $post->ID && $item->ID == $post->ID )
+                       if ( $post && $post->ID && $item->ID == $post->ID )
                                continue;
 
                        $pad = str_repeat( '&nbsp;', $level * 3 );
@@ -780,14 +778,14 @@ function wp_dropdown_roles( $selected = false ) {
  */
 function wp_import_upload_form( $action ) {
        $bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
-       $size = wp_convert_bytes_to_hr( $bytes );
+       $size = size_format( $bytes );
        $upload_dir = wp_upload_dir();
        if ( ! empty( $upload_dir['error'] ) ) :
                ?><div class="error"><p><?php _e('Before you can upload your import file, you will need to fix the following error:'); ?></p>
                <p><strong><?php echo $upload_dir['error']; ?></strong></p></div><?php
        else :
 ?>
-<form enctype="multipart/form-data" id="import-upload-form" method="post" class="wp-upload-form" action="<?php echo esc_attr(wp_nonce_url($action, 'import-upload')); ?>">
+<form enctype="multipart/form-data" id="import-upload-form" method="post" class="wp-upload-form" action="<?php echo esc_url( wp_nonce_url( $action, 'import-upload' ) ); ?>">
 <p>
 <label for="upload"><?php _e( 'Choose a file from your computer:' ); ?></label> (<?php printf( __('Maximum size: %s' ), $size ); ?>)
 <input type="file" id="upload" name="import" size="25" />
@@ -811,6 +809,7 @@ function wp_import_upload_form( $action ) {
  * @param string|object $screen Optional. The screen on which to show the box (post, page, link). Defaults to current screen.
  * @param string $context Optional. The context within the page where the boxes should show ('normal', 'advanced').
  * @param string $priority Optional. The priority within the context where the boxes should show ('high', 'low').
+ * @param array $callback_args Optional. Data that should be set as the "args" property of the box array (which is the second parameter passed to your callback).
  */
 function add_meta_box( $id, $title, $callback, $screen = null, $context = 'advanced', $priority = 'default', $callback_args = null ) {
        global $wp_meta_boxes;
@@ -917,7 +916,6 @@ function do_meta_boxes( $screen, $context, $object ) {
                                        if ( false == $box || ! $box['title'] )
                                                continue;
                                        $i++;
-                                       $style = '';
                                        $hidden_class = in_array($box['id'], $hidden) ? ' hide-if-js' : '';
                                        echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . $hidden_class . '" ' . '>' . "\n";
                                        if ( 'dashboard_browser_nag' != $box['id'] )
@@ -968,6 +966,79 @@ function remove_meta_box($id, $screen, $context) {
                $wp_meta_boxes[$page][$context][$priority][$id] = false;
 }
 
+/**
+ * Meta Box Accordion Template Function
+ *
+ * Largely made up of abstracted code from {@link do_meta_boxes()}, this
+ * function serves to build meta boxes as list items for display as
+ * a collapsible accordion.
+ *
+ * @since 3.6.0
+ *
+ * @uses global $wp_meta_boxes Used to retrieve registered meta boxes.
+ *
+ * @param string|object $screen The screen identifier.
+ * @param string $context The meta box context.
+ * @param mixed $object gets passed to the section callback function as first parameter.
+ * @return int number of meta boxes as accordion sections.
+ */
+function do_accordion_sections( $screen, $context, $object ) {
+       global $wp_meta_boxes;
+
+       wp_enqueue_script( 'accordion' );
+
+       if ( empty( $screen ) )
+               $screen = get_current_screen();
+       elseif ( is_string( $screen ) )
+               $screen = convert_to_screen( $screen );
+
+       $page = $screen->id;
+
+       $hidden = get_hidden_meta_boxes( $screen );
+       ?>
+       <div id="side-sortables" class="accordion-container">
+               <ul class="outer-border">
+       <?php
+       $i = 0;
+       $first_open = false;
+       do {
+               if ( ! isset( $wp_meta_boxes ) || ! isset( $wp_meta_boxes[$page] ) || ! isset( $wp_meta_boxes[$page][$context] ) )
+                       break;
+
+               foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) {
+                       if ( isset( $wp_meta_boxes[$page][$context][$priority] ) ) {
+                               foreach ( $wp_meta_boxes[$page][$context][$priority] as $box ) {
+                                       if ( false == $box || ! $box['title'] )
+                                               continue;
+                                       $i++;
+                                       $hidden_class = in_array( $box['id'], $hidden ) ? 'hide-if-js' : '';
+
+                                       $open_class = '';
+                                       if ( ! $first_open && empty( $hidden_class ) ) {
+                                               $first_open = true;
+                                               $open_class = 'open';
+                                       }
+                                       ?>
+                                       <li class="control-section accordion-section <?php echo $hidden_class; ?> <?php echo $open_class; ?> <?php echo esc_attr( $box['id'] ); ?>" id="<?php echo esc_attr( $box['id'] ); ?>">
+                                               <h3 class="accordion-section-title hndle" tabindex="0" title="<?php echo esc_attr( $box['title'] ); ?>"><?php echo esc_html( $box['title'] ); ?></h3>
+                                               <div class="accordion-section-content <?php postbox_classes( $box['id'], $page ); ?>">
+                                                       <div class="inside">
+                                                               <?php call_user_func( $box['callback'], $object, $box ); ?>
+                                                       </div><!-- .inside -->
+                                               </div><!-- .accordion-section-content -->
+                                       </li><!-- .accordion-section -->
+                                       <?php
+                               }
+                       }
+               }
+       } while(0);
+       ?>
+               </ul><!-- .outer-border -->
+       </div><!-- .accordion-container -->
+       <?php
+       return $i;
+}
+
 /**
  * Add a new section to a settings page.
  *
@@ -1334,7 +1405,7 @@ function _draft_or_post_title( $post = 0 ) {
  *
  */
 function _admin_search_query() {
-       echo isset($_REQUEST['s']) ? esc_attr( stripslashes( $_REQUEST['s'] ) ) : '';
+       echo isset($_REQUEST['s']) ? esc_attr( wp_unslash( $_REQUEST['s'] ) ) : '';
 }
 
 /**
@@ -1363,12 +1434,7 @@ wp_enqueue_style( 'colors' );
 //<![CDATA[
 addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
 function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_remove();}
-var userSettings = {
-               'url': '<?php echo SITECOOKIEPATH; ?>',
-               'uid': '<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>',
-               'time':'<?php echo time() ?>'
-       },
-       ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
+var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
        pagenow = '<?php echo $current_screen->id; ?>',
        typenow = '<?php echo $current_screen->post_type; ?>',
        adminpage = '<?php echo $admin_body_class; ?>',
@@ -1440,7 +1506,7 @@ function _post_states($post) {
        if ( is_sticky($post->ID) )
                $post_states['sticky'] = __('Sticky');
 
-       $post_states = apply_filters( 'display_post_states', $post_states );
+       $post_states = apply_filters( 'display_post_states', $post_states, $post );
 
        if ( ! empty($post_states) ) {
                $state_count = count($post_states);
@@ -1453,8 +1519,6 @@ function _post_states($post) {
                }
        }
 
-       if ( get_post_format( $post->ID ) )
-               echo ' - <span class="post-state-format">' . get_post_format_string( get_post_format( $post->ID ) ) . '</span>';
 }
 
 function _media_states( $post ) {
@@ -1670,7 +1734,8 @@ final class WP_Internal_Pointers {
                $registered_pointers = array(
                        'index.php'    => 'wp330_toolbar',
                        'post-new.php' => 'wp350_media',
-                       'post.php'     => 'wp350_media',
+                       'post.php'     => array( 'wp350_media', 'wp360_revisions' ),
+                       'edit.php'     => 'wp360_locks',
                        'themes.php'   => array( 'wp330_saving_widgets', 'wp340_customize_current_theme_link' ),
                        'appearance_page_custom-header' => 'wp340_choose_image_from_library',
                        'appearance_page_custom-background' => 'wp340_choose_image_from_library',
@@ -1836,13 +1901,36 @@ final class WP_Internal_Pointers {
                ) );
        }
 
+       public static function pointer_wp360_revisions() {
+               $content  = '<h3>' . __( 'Compare Revisions' ) . '</h3>';
+               $content .= '<p>' . __( 'View, compare, and restore other versions of this content on the improved revisions screen.' ) . '</p>';
+
+               self::print_js( 'wp360_revisions', '.misc-pub-section.num-revisions', array(
+                       'content' => $content,
+                       'position' => array( 'edge' => is_rtl() ? 'left' : 'right', 'align' => 'center', 'my' => is_rtl() ? 'left' : 'right-14px' ),
+               ) );
+       }
+
+       public static function pointer_wp360_locks() {
+               $content  = '<h3>' . __( 'Edit Lock' ) . '</h3>';
+               $content .= '<p>' . __( 'Someone else is editing this. No need to refresh; the lock will disappear when they&#8217;re done.' ) . '</p>';
+
+               if ( ! is_multi_author() )
+                       return;
+
+               self::print_js( 'wp360_locks', 'tr.wp-locked .locked-indicator', array(
+                       'content' => $content,
+                       'position' => array( 'edge' => 'left', 'align' => 'left' ),
+               ) );
+       }
+
        /**
         * Prevents new users from seeing existing 'new feature' pointers.
         *
         * @since 3.3.0
         */
        public static function dismiss_pointers_for_new_users( $user_id ) {
-               add_user_meta( $user_id, 'dismissed_wp_pointers', 'wp330_toolbar,wp330_saving_widgets,wp340_choose_image_from_library,wp340_customize_current_theme_link,wp350_media' );
+               add_user_meta( $user_id, 'dismissed_wp_pointers', 'wp330_toolbar,wp330_saving_widgets,wp340_choose_image_from_library,wp340_customize_current_theme_link,wp350_media,wp360_revisions,wp360_locks' );
        }
 }
 
@@ -1865,3 +1953,24 @@ function convert_to_screen( $hook_name ) {
 
        return WP_Screen::get( $hook_name );
 }
+
+/**
+ * Output the HTML for restoring the post data from DOM storage
+ *
+ * @since 3.6
+ * @access private
+ */
+function _local_storage_notice() {
+       ?>
+       <div id="local-storage-notice" class="hidden">
+       <p class="local-restore">
+               <?php _e('The backup of this post in your browser is different from the version below.'); ?>
+               <a class="restore-backup" href="#"><?php _e('Restore the backup.'); ?></a>
+       </p>
+       <p class="undo-restore hidden">
+               <?php _e('Post restored successfully.'); ?>
+               <a class="undo-restore-backup" href="#"><?php _e('Undo.'); ?></a>
+       </p>
+       </div>
+       <?php
+}
index 5c135aa10aa826b64f43b4c31da4aa245f7b8161..63be1d7e0152033cfd5061cc1eead93c34b1aed9 100644 (file)
@@ -28,18 +28,20 @@ $theme_field_defaults = array( 'description' => true, 'sections' => false, 'test
  *
  * @return array
  */
-function install_themes_feature_list( ) {
+function install_themes_feature_list() {
+       _deprecated_function( __FUNCTION__, '3.1', 'get_theme_feature_list()' );
+
        if ( !$cache = get_transient( 'wporg_theme_feature_list' ) )
-               set_transient( 'wporg_theme_feature_list', array( ), 10800);
+               set_transient( 'wporg_theme_feature_list', array(), 3 * HOUR_IN_SECONDS );
 
        if ( $cache )
                return $cache;
 
-       $feature_list = themes_api( 'feature_list', array( ) );
+       $feature_list = themes_api( 'feature_list', array() );
        if ( is_wp_error( $feature_list ) )
-               return $features;
+               return array();
 
-       set_transient( 'wporg_theme_feature_list', $feature_list, 10800 );
+       set_transient( 'wporg_theme_feature_list', $feature_list, 3 * HOUR_IN_SECONDS );
 
        return $feature_list;
 }
@@ -50,8 +52,8 @@ function install_themes_feature_list( ) {
  * @since 2.8.0
  */
 function install_theme_search_form( $type_selector = true ) {
-       $type = isset( $_REQUEST['type'] ) ? stripslashes( $_REQUEST['type'] ) : 'term';
-       $term = isset( $_REQUEST['s'] ) ? stripslashes( $_REQUEST['s'] ) : '';
+       $type = isset( $_REQUEST['type'] ) ? wp_unslash( $_REQUEST['type'] ) : 'term';
+       $term = isset( $_REQUEST['s'] ) ? wp_unslash( $_REQUEST['s'] ) : '';
        if ( ! $type_selector )
                echo '<p class="install-help">' . __( 'Search for themes by keyword.' ) . '</p>';
        ?>
@@ -100,7 +102,7 @@ function install_themes_dashboard() {
 <form method="get" action="">
        <input type="hidden" name="tab" value="search" />
        <?php
-       $feature_list = get_theme_feature_list( );
+       $feature_list = get_theme_feature_list();
        echo '<div class="feature-filter">';
 
        foreach ( (array) $feature_list as $feature_name => $features ) {
@@ -153,7 +155,7 @@ add_action('install_themes_upload', 'install_themes_upload', 10, 1);
 function display_theme( $theme ) {
        _deprecated_function( __FUNCTION__, '3.4' );
        global $wp_list_table;
-       return $wp_list_table->single_row( $theme );
+       $wp_list_table->single_row( $theme );
 }
 
 /**
@@ -179,7 +181,7 @@ add_action('install_themes_updated', 'display_themes');
 function install_theme_information() {
        global $tab, $themes_allowedtags, $wp_list_table;
 
-       $theme = themes_api( 'theme_information', array( 'slug' => stripslashes( $_REQUEST['theme'] ) ) );
+       $theme = themes_api( 'theme_information', array( 'slug' => wp_unslash( $_REQUEST['theme'] ) ) );
 
        if ( is_wp_error( $theme ) )
                wp_die( $theme );
index 1e26c0bac9b90cdfe8ced08497998908f3d1cd85..315f021386982a01cd9cc089a69825534a1c7586 100644 (file)
@@ -37,7 +37,7 @@ function delete_theme($stylesheet, $redirect = '') {
        }
 
        if ( ! WP_Filesystem($credentials) ) {
-               request_filesystem_credentials($url, '', true); // Failed to connect, Error and request again
+               request_filesystem_credentials($redirect, '', true); // Failed to connect, Error and request again
                $data = ob_get_contents();
                ob_end_clean();
                if ( ! empty($data) ) {
@@ -216,10 +216,10 @@ function get_theme_feature_list( $api = true ) {
                return $features;
 
        if ( !$feature_list = get_site_transient( 'wporg_theme_feature_list' ) )
-               set_site_transient( 'wporg_theme_feature_list', array( ), 10800);
+               set_site_transient( 'wporg_theme_feature_list', array(), 10800);
 
        if ( !$feature_list ) {
-               $feature_list = themes_api( 'feature_list', array( ) );
+               $feature_list = themes_api( 'feature_list', array() );
                if ( is_wp_error( $feature_list ) )
                        return $features;
        }
index daf7734990523ce47dcb2ab59e17603deda7ae98..85eb84062ad91bec4118c5f4fd952f6fc8811b88 100644 (file)
@@ -535,9 +535,25 @@ $_old_files = array(
 'wp-includes/js/jquery/ui/jquery.effects.pulsate.min.js',
 'wp-includes/js/jquery/ui/jquery.effects.transfer.min.js',
 'wp-includes/js/jquery/ui/jquery.effects.fold.min.js',
+'wp-admin/images/screenshots/captions-1.png',
+'wp-admin/images/screenshots/captions-2.png',
+'wp-admin/images/screenshots/flex-header-1.png',
+'wp-admin/images/screenshots/flex-header-2.png',
+'wp-admin/images/screenshots/flex-header-3.png',
+'wp-admin/images/screenshots/flex-header-media-library.png',
+'wp-admin/images/screenshots/theme-customizer.png',
+'wp-admin/images/screenshots/twitter-embed-1.png',
+'wp-admin/images/screenshots/twitter-embed-2.png',
+'wp-admin/js/utils.js',
 'wp-admin/options-privacy.php',
+'wp-app.php',
+'wp-includes/class-wp-atom-server.php',
+'wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css',
 // 3.5.2
 'wp-includes/js/swfupload/swfupload-all.js',
+// 3.6
+'wp-admin/js/revisions-js.php',
+'wp-admin/images/screenshots',
 );
 
 /**
@@ -560,10 +576,11 @@ $_old_files = array(
 global $_new_bundled_files;
 
 $_new_bundled_files = array(
-'plugins/akismet/' => '2.0',
-'themes/twentyten/' => '3.0',
-'themes/twentyeleven/' => '3.2',
-'themes/twentytwelve/' => '3.5',
+       'plugins/akismet/'       => '2.0',
+       'themes/twentyten/'      => '3.0',
+       'themes/twentyeleven/'   => '3.2',
+       'themes/twentytwelve/'   => '3.5',
+       'themes/twentythirteen/' => '3.6',
 );
 
 /**
@@ -698,9 +715,7 @@ function update_core($from, $to) {
        // 3.5 -> 3.5+ - an empty twentytwelve directory was created upon upgrade to 3.5 for some users, preventing installation of Twenty Twelve.
        if ( '3.5' == $old_wp_version ) {
                if ( is_dir( WP_CONTENT_DIR . '/themes/twentytwelve' ) && ! file_exists( WP_CONTENT_DIR . '/themes/twentytwelve/style.css' )  ) {
-                       // Bumping the introduced version to 3.5.1 for the affected users causes Twenty Twelve to be installed for the first time
-                       if ( $wp_filesystem->delete( $wp_filesystem->wp_themes_dir() . 'twentytwelve/' ) )
-                               $_new_bundled_files[ 'themes/twentytwelve/' ] = '3.5.1';
+                       $wp_filesystem->delete( $wp_filesystem->wp_themes_dir() . 'twentytwelve/' );
                }
        }
 
index d22922ed781480a96357a6ca04d540a73fd2ec3b..0d17d8fce4d4ac1060364c54a380ae97a6e871cf 100644 (file)
@@ -132,7 +132,7 @@ function wp_install_defaults($user_id) {
                $first_post = get_site_option( 'first_post' );
 
                if ( empty($first_post) )
-                       $first_post = stripslashes( __( 'Welcome to <a href="SITE_URL">SITE_NAME</a>. This is your first post. Edit or delete it, then start blogging!' ) );
+                       $first_post = __( 'Welcome to <a href="SITE_URL">SITE_NAME</a>. This is your first post. Edit or delete it, then start blogging!' );
 
                $first_post = str_replace( "SITE_URL", esc_url( network_home_url() ), $first_post );
                $first_post = str_replace( "SITE_NAME", $current_site->site_name, $first_post );
@@ -218,7 +218,7 @@ As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to d
        update_option( 'widget_archives', array ( 2 => array ( 'title' => '', 'count' => 0, 'dropdown' => 0 ), '_multiwidget' => 1 ) );
        update_option( 'widget_categories', array ( 2 => array ( 'title' => '', 'count' => 0, 'hierarchical' => 0, 'dropdown' => 0 ), '_multiwidget' => 1 ) );
        update_option( 'widget_meta', array ( 2 => array ( 'title' => '' ), '_multiwidget' => 1 ) );
-       update_option( 'sidebars_widgets', array ( 'wp_inactive_widgets' => array ( ), 'sidebar-1' => array ( 0 => 'search-2', 1 => 'recent-posts-2', 2 => 'recent-comments-2', 3 => 'archives-2', 4 => 'categories-2', 5 => 'meta-2', ), 'sidebar-2' => array ( ), 'sidebar-3' => array ( ), 'array_version' => 3 ) );
+       update_option( 'sidebars_widgets', array ( 'wp_inactive_widgets' => array (), 'sidebar-1' => array ( 0 => 'search-2', 1 => 'recent-posts-2', 2 => 'recent-comments-2', 3 => 'archives-2', 4 => 'categories-2', 5 => 'meta-2', ), 'sidebar-2' => array (),'array_version' => 3 ) );
 
        if ( ! is_multisite() )
                update_user_meta( $user_id, 'show_welcome_panel', 1 );
@@ -433,7 +433,7 @@ function upgrade_100() {
        foreach ($categories as $category) {
                if ('' == $category->category_nicename) {
                        $newtitle = sanitize_title($category->cat_name);
-                       $wpdb>update( $wpdb->categories, array('category_nicename' => $newtitle), array('cat_ID' => $category->cat_ID) );
+                       $wpdb->update( $wpdb->categories, array('category_nicename' => $newtitle), array('cat_ID' => $category->cat_ID) );
                }
        }
 
@@ -636,23 +636,23 @@ function upgrade_160() {
        $users = $wpdb->get_results("SELECT * FROM $wpdb->users");
        foreach ( $users as $user ) :
                if ( !empty( $user->user_firstname ) )
-                       update_user_meta( $user->ID, 'first_name', $wpdb->escape($user->user_firstname) );
+                       update_user_meta( $user->ID, 'first_name', wp_slash($user->user_firstname) );
                if ( !empty( $user->user_lastname ) )
-                       update_user_meta( $user->ID, 'last_name', $wpdb->escape($user->user_lastname) );
+                       update_user_meta( $user->ID, 'last_name', wp_slash($user->user_lastname) );
                if ( !empty( $user->user_nickname ) )
-                       update_user_meta( $user->ID, 'nickname', $wpdb->escape($user->user_nickname) );
+                       update_user_meta( $user->ID, 'nickname', wp_slash($user->user_nickname) );
                if ( !empty( $user->user_level ) )
                        update_user_meta( $user->ID, $wpdb->prefix . 'user_level', $user->user_level );
                if ( !empty( $user->user_icq ) )
-                       update_user_meta( $user->ID, 'icq', $wpdb->escape($user->user_icq) );
+                       update_user_meta( $user->ID, 'icq', wp_slash($user->user_icq) );
                if ( !empty( $user->user_aim ) )
-                       update_user_meta( $user->ID, 'aim', $wpdb->escape($user->user_aim) );
+                       update_user_meta( $user->ID, 'aim', wp_slash($user->user_aim) );
                if ( !empty( $user->user_msn ) )
-                       update_user_meta( $user->ID, 'msn', $wpdb->escape($user->user_msn) );
+                       update_user_meta( $user->ID, 'msn', wp_slash($user->user_msn) );
                if ( !empty( $user->user_yim ) )
-                       update_user_meta( $user->ID, 'yim', $wpdb->escape($user->user_icq) );
+                       update_user_meta( $user->ID, 'yim', wp_slash($user->user_icq) );
                if ( !empty( $user->user_description ) )
-                       update_user_meta( $user->ID, 'description', $wpdb->escape($user->user_description) );
+                       update_user_meta( $user->ID, 'description', wp_slash($user->user_description) );
 
                if ( isset( $user->user_idmode ) ):
                        $idmode = $user->user_idmode;
@@ -854,7 +854,7 @@ function upgrade_230() {
                foreach ( $link_cats as $category) {
                        $cat_id = (int) $category->cat_id;
                        $term_id = 0;
-                       $name = $wpdb->escape($category->cat_name);
+                       $name = wp_slash($category->cat_name);
                        $slug = sanitize_title($name);
                        $term_group = 0;
 
@@ -1279,7 +1279,7 @@ function upgrade_network() {
                update_site_option( 'ms_files_rewriting', '1' );
 
        // 3.5.2
-       if ( $wp_current_db_version < 22442 ) {
+       if ( $wp_current_db_version < 24448 ) {
                $illegal_names = get_site_option( 'illegal_names' );
                if ( is_array( $illegal_names ) && count( $illegal_names ) === 1 ) {
                        $illegal_name = reset( $illegal_names );
@@ -1427,11 +1427,7 @@ function __get_option($setting) {
        if ( 'siteurl' == $setting || 'home' == $setting || 'category_base' == $setting || 'tag_base' == $setting )
                $option = untrailingslashit( $option );
 
-       @ $kellogs = unserialize( $option );
-       if ( $kellogs !== false )
-               return $kellogs;
-       else
-               return $option;
+       return maybe_unserialize( $option );
 }
 
 /**
@@ -1576,7 +1572,7 @@ function dbDelta( $queries = '', $execute = true ) {
 
                                // Get the default value from the array
                                        //echo "{$cfields[strtolower($tablefield->Field)]}<br>";
-                               if (preg_match("| DEFAULT '(.*)'|i", $cfields[strtolower($tablefield->Field)], $matches)) {
+                               if (preg_match("| DEFAULT '(.*?)'|i", $cfields[strtolower($tablefield->Field)], $matches)) {
                                        $default_value = $matches[1];
                                        if ($tablefield->Default != $default_value) {
                                                // Add a query to change the column's default value
@@ -1652,7 +1648,7 @@ function dbDelta( $queries = '', $execute = true ) {
                foreach ( (array) $indices as $index ) {
                        // Push a query line into $cqueries that adds the index to that table
                        $cqueries[] = "ALTER TABLE {$table} ADD $index";
-                       $for_update[$table.'.'.$fieldname] = 'Added index '.$table.' '.$index;
+                       $for_update[] = 'Added index ' . $table . ' ' . $index;
                }
 
                // Remove the original table creation query from processing
index 1d60aa57e3da90f1965ce345dc50b2d3134113be..9e9d94494c396c3df8f226d19a7c7fff83692b5e 100644 (file)
@@ -34,7 +34,7 @@ function edit_user( $user_id = 0 ) {
                $update = true;
                $user->ID = (int) $user_id;
                $userdata = get_userdata( $user_id );
-               $user->user_login = $wpdb->escape( $userdata->user_login );
+               $user->user_login = wp_slash( $userdata->user_login );
        } else {
                $update = false;
        }
@@ -43,9 +43,9 @@ function edit_user( $user_id = 0 ) {
                $user->user_login = sanitize_user($_POST['user_login'], true);
 
        $pass1 = $pass2 = '';
-       if ( isset( $_POST['pass1'] ))
+       if ( isset( $_POST['pass1'] ) )
                $pass1 = $_POST['pass1'];
-       if ( isset( $_POST['pass2'] ))
+       if ( isset( $_POST['pass2'] ) )
                $pass2 = $_POST['pass2'];
 
        if ( isset( $_POST['role'] ) && current_user_can( 'edit_users' ) ) {
@@ -106,10 +106,10 @@ function edit_user( $user_id = 0 ) {
 
        /* checking that username has been typed */
        if ( $user->user_login == '' )
-               $errors->add( 'user_login', __( '<strong>ERROR</strong>: Please enter a username.' ));
+               $errors->add( 'user_login', __( '<strong>ERROR</strong>: Please enter a username.' ) );
 
        /* checking the password has been typed twice */
-       do_action_ref_array( 'check_passwords', array ( $user->user_login, & $pass1, & $pass2 ));
+       do_action_ref_array( 'check_passwords', array( $user->user_login, &$pass1, &$pass2 ) );
 
        if ( $update ) {
                if ( empty($pass1) && !empty($pass2) )
@@ -124,7 +124,7 @@ function edit_user( $user_id = 0 ) {
        }
 
        /* Check for "\" in password */
-       if ( false !== strpos( stripslashes($pass1), "\\" ) )
+       if ( false !== strpos( wp_unslash( $pass1 ), "\\" ) )
                $errors->add( 'pass', __( '<strong>ERROR</strong>: Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) );
 
        /* checking the password has been typed twice the same */
@@ -150,7 +150,7 @@ function edit_user( $user_id = 0 ) {
        }
 
        // Allow plugins to return their own errors.
-       do_action_ref_array('user_profile_update_errors', array ( &$errors, $update, &$user ) );
+       do_action_ref_array( 'user_profile_update_errors', array( &$errors, $update, &$user ) );
 
        if ( $errors->get_error_codes() )
                return $errors;
@@ -159,7 +159,7 @@ function edit_user( $user_id = 0 ) {
                $user_id = wp_update_user( $user );
        } else {
                $user_id = wp_insert_user( $user );
-               wp_new_user_notification( $user_id, isset($_POST['send_password']) ? $pass1 : '' );
+               wp_new_user_notification( $user_id, isset( $_POST['send_password'] ) ? wp_unslash( $pass1 ) : '' );
        }
        return $user_id;
 }
@@ -240,6 +240,9 @@ function wp_delete_user( $id, $reassign = 'novalue' ) {
        $id = (int) $id;
        $user = new WP_User( $id );
 
+       if ( !$user->exists() )
+               return false;
+
        // allow for transaction statement
        do_action('delete_user', $id);
 
@@ -344,7 +347,7 @@ function default_password_nag_edit_user($user_ID, $old_data) {
        $new_data = get_userdata($user_ID);
 
        if ( $new_data->user_pass != $old_data->user_pass ) { //Remove the nag if the password has been changed.
-               delete_user_setting('default_password_nag', $user_ID);
+               delete_user_setting('default_password_nag');
                update_user_option($user_ID, 'default_password_nag', false, true);
        }
 }
index e0c58a7277d784d04364b58b278236c62844468c..dae95509aabe376ed3c682761dc5a1199ff8a9cd 100644 (file)
@@ -58,7 +58,7 @@ function _sort_name_callback( $a, $b ) {
 
 /**
  * Show the widgets and their settings for a sidebar.
- * Used in the the admin widget config screen.
+ * Used in the admin widget config screen.
  *
  * @since 2.5.0
  *
index dd429e7fa7e9c5dae930531cb6944ec5deee1702..b476267cb84ebb04a0009eec4d3743998272a3e0 100644 (file)
@@ -2,8 +2,6 @@
 /**
  * Dashboard Administration Screen
  *
- * @internal This file should be parseable by PHP4.
- *
  * @package WordPress
  * @subpackage Administration
  */
index 2ff4f172c07153d6f19d9ea488463684c95a1948..71d59a9c49b96a448a518988f02fff461761edae 100644 (file)
@@ -63,7 +63,7 @@ function display_header() {
        ?>
 </head>
 <body class="wp-core-ui<?php if ( is_rtl() ) echo ' rtl'; ?>">
-<h1 id="logo"><a href="<?php esc_attr_e( 'http://wordpress.org/' ); ?>"><?php _e( 'WordPress' ); ?></a></h1>
+<h1 id="logo"><a href="<?php echo esc_url( __( 'http://wordpress.org/' ) ); ?>"><?php _e( 'WordPress' ); ?></a></h1>
 
 <?php
 } // end display_header()
@@ -84,10 +84,10 @@ function display_setup_form( $error = null ) {
        if ( ! empty( $_POST ) )
                $blog_public = isset( $_POST['blog_public'] );
 
-       $weblog_title = isset( $_POST['weblog_title'] ) ? trim( stripslashes( $_POST['weblog_title'] ) ) : '';
-       $user_name = isset($_POST['user_name']) ? trim( stripslashes( $_POST['user_name'] ) ) : 'admin';
-       $admin_password = isset($_POST['admin_password']) ? trim( stripslashes( $_POST['admin_password'] ) ) : '';
-       $admin_email  = isset( $_POST['admin_email']  ) ? trim( stripslashes( $_POST['admin_email'] ) ) : '';
+       $weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : '';
+       $user_name = isset($_POST['user_name']) ? trim( wp_unslash( $_POST['user_name'] ) ) : 'admin';
+       $admin_password = isset($_POST['admin_password']) ? trim( wp_unslash( $_POST['admin_password'] ) ) : '';
+       $admin_email  = isset( $_POST['admin_email']  ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : '';
 
        if ( ! is_null( $error ) ) {
 ?>
@@ -100,7 +100,7 @@ function display_setup_form( $error = null ) {
                        <td><input name="weblog_title" type="text" id="weblog_title" size="25" value="<?php echo esc_attr( $weblog_title ); ?>" /></td>
                </tr>
                <tr>
-                       <th scope="row"><label for="user_name"><?php _e('Username'); ?></label></th>
+                       <th scope="row"><label for="user_login"><?php _e('Username'); ?></label></th>
                        <td>
                        <?php
                        if ( $user_table ) {
@@ -189,11 +189,11 @@ switch($step) {
 
                display_header();
                // Fill in the data we gathered
-               $weblog_title = isset( $_POST['weblog_title'] ) ? trim( stripslashes( $_POST['weblog_title'] ) ) : '';
-               $user_name = isset($_POST['user_name']) ? trim( stripslashes( $_POST['user_name'] ) ) : 'admin';
-               $admin_password = isset($_POST['admin_password']) ? $_POST['admin_password'] : '';
-               $admin_password_check = isset($_POST['admin_password2']) ? $_POST['admin_password2'] : '';
-               $admin_email  = isset( $_POST['admin_email']  ) ?trim( stripslashes( $_POST['admin_email'] ) ) : '';
+               $weblog_title = isset( $_POST['weblog_title'] ) ? trim( wp_unslash( $_POST['weblog_title'] ) ) : '';
+               $user_name = isset($_POST['user_name']) ? trim( wp_unslash( $_POST['user_name'] ) ) : 'admin';
+               $admin_password = isset($_POST['admin_password']) ? wp_unslash( $_POST['admin_password'] ) : '';
+               $admin_password_check = isset($_POST['admin_password2']) ? wp_unslash( $_POST['admin_password2'] ) : '';
+               $admin_email  = isset( $_POST['admin_email']  ) ?trim( wp_unslash( $_POST['admin_email'] ) ) : '';
                $public       = isset( $_POST['blog_public']  ) ? (int) $_POST['blog_public'] : 0;
                // check e-mail address
                $error = false;
diff --git a/wp-admin/js/accordion.js b/wp-admin/js/accordion.js
new file mode 100644 (file)
index 0000000..7bc99cc
--- /dev/null
@@ -0,0 +1,55 @@
+( function( $ ){
+
+       $( document ).ready( function () {
+
+               // Expand/Collapse on click
+               $( '.accordion-container' ).on( 'click keydown', '.accordion-section-title', function( e ) {
+                       if ( e.type === 'keydown' && 13 !== e.which ) // "return" key
+                                       return;
+                       e.preventDefault(); // Keep this AFTER the key filter above
+
+                       accordionSwitch( $( this ) );
+               });
+
+               // Re-initialize accordion when screen options are toggled
+               $( '.hide-postbox-tog' ).click( function () {
+                       accordionInit();
+               });
+
+       });
+
+       var accordionOptions = $( '.accordion-container li.accordion-section' ),
+               sectionContent   = $( '.accordion-section-content' );
+
+       function accordionInit () {
+               // Rounded corners
+               accordionOptions.removeClass( 'top bottom' );
+               accordionOptions.filter( ':visible' ).first().addClass( 'top' );
+               accordionOptions.filter( ':visible' ).last().addClass( 'bottom' ).find( sectionContent ).addClass( 'bottom' );
+       }
+
+       function accordionSwitch ( el ) {
+               var section = el.closest( '.accordion-section' ),
+                       siblings = section.closest( '.accordion-container' ).find( '.open' ),
+                       content = section.find( sectionContent );
+
+               if ( section.hasClass( 'cannot-expand' ) )
+                       return;
+
+               if ( section.hasClass( 'open' ) ) {
+                       section.toggleClass( 'open' );
+                       content.toggle( true ).slideToggle( 150 );
+               } else {
+                       siblings.removeClass( 'open' );
+                       siblings.find( sectionContent ).show().slideUp( 150 );
+                       content.toggle( false ).slideToggle( 150 );
+                       section.toggleClass( 'open' );
+               }
+
+               accordionInit();
+       }
+
+       // Initialize the accordion (currently just corner fixes)
+       accordionInit();
+
+})(jQuery);
diff --git a/wp-admin/js/accordion.min.js b/wp-admin/js/accordion.min.js
new file mode 100644 (file)
index 0000000..9a9355a
--- /dev/null
@@ -0,0 +1 @@
+(function(e){e(document).ready(function(){e(".accordion-container").on("click keydown",".accordion-section-title",function(f){if(f.type==="keydown"&&13!==f.which){return}f.preventDefault();a(e(this))});e(".hide-postbox-tog").click(function(){d()})});var b=e(".accordion-container li.accordion-section"),c=e(".accordion-section-content");function d(){b.removeClass("top bottom");b.filter(":visible").first().addClass("top");b.filter(":visible").last().addClass("bottom").find(c).addClass("bottom")}function a(f){var h=f.closest(".accordion-section"),i=h.closest(".accordion-container").find(".open"),g=h.find(c);if(h.hasClass("cannot-expand")){return}if(h.hasClass("open")){h.toggleClass("open");g.toggle(true).slideToggle(150)}else{i.removeClass("open");i.find(c).show().slideUp(150);g.toggle(false).slideToggle(150);h.toggleClass("open")}d()}d()})(jQuery);
\ No newline at end of file
index cc58eb4a307437a0e994b677c5620360ddbf8ede..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,34 +0,0 @@
-jQuery(document).ready(function($) {
-       var options = false, addAfter, delBefore, delAfter;
-       if ( document.forms['addcat'].category_parent )
-               options = document.forms['addcat'].category_parent.options;
-
-       addAfter = function( r, settings ) {
-               var name, id;
-
-               name = $("<span>" + $('name', r).text() + "</span>").text();
-               id = $('cat', r).attr('id');
-               options[options.length] = new Option(name, id);
-       }
-
-       delAfter = function( r, settings ) {
-               var id = $('cat', r).attr('id'), o;
-               for ( o = 0; o < options.length; o++ )
-                       if ( id == options[o].value )
-                               options[o] = null;
-       }
-
-       delBefore = function(s) {
-               if ( 'undefined' != showNotice )
-                       return showNotice.warn() ? s : false;
-
-               return s;
-       }
-
-       if ( options )
-               $('#the-list').wpList( { addAfter: addAfter, delBefore: delBefore, delAfter: delAfter } );
-       else
-               $('#the-list').wpList({ delBefore: delBefore });
-
-       $('.delete a[class^="delete"]').live('click', function(){return false;});
-});
index 45c2358a48141603c27d77992228f0b68f1ed807..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-jQuery(document).ready(function(d){var b=false,e,c,a;if(document.forms.addcat.category_parent){b=document.forms.addcat.category_parent.options}e=function(h,g){var f,i;f=d("<span>"+d("name",h).text()+"</span>").text();i=d("cat",h).attr("id");b[b.length]=new Option(f,i)};a=function(g,f){var i=d("cat",g).attr("id"),h;for(h=0;h<b.length;h++){if(i==b[h].value){b[h]=null}}};c=function(f){if("undefined"!=showNotice){return showNotice.warn()?f:false}return f};if(b){d("#the-list").wpList({addAfter:e,delBefore:c,delAfter:a})}else{d("#the-list").wpList({delBefore:c})}d('.delete a[class^="delete"]').live("click",function(){return false})});
\ No newline at end of file
index 393f2ff9c8493cbc7ea5ae58b581c68bb398b6fa..d564754787cf9c76f61ff726c5690d4344e69bc6 100644 (file)
                        palettes: true
                },
                _create: function() {
-                       // bail early for IE < 8
-                       if ( $.browser.msie && parseInt( $.browser.version, 10 ) < 8 )
+                       // bail early for unsupported Iris.
+                       if ( ! $.support.iris )
                                return;
                        var self = this;
                        var el = self.element;
+
                        $.extend( self.options, el.data() );
 
                        self.initialValue = el.val();
index 75b6ede3515a854dfd6f84d3ca44a53f43e21c5e..178ab37821bf8611e3720891ae8ec9e35f25a316 100644 (file)
@@ -1 +1 @@
-(function(f,e){var a='<a tabindex="0" class="wp-color-result" />',c='<div class="wp-picker-holder" />',b='<div class="wp-picker-container" />',g='<input type="button" class="button button-small hidden" />';var d={options:{defaultColor:false,change:false,clear:false,hide:true,palettes:true},_create:function(){if(f.browser.msie&&parseInt(f.browser.version,10)<8){return}var h=this;var i=h.element;f.extend(h.options,i.data());h.initialValue=i.val();i.addClass("wp-color-picker").hide().wrap(b);h.wrap=i.parent();h.toggler=f(a).insertBefore(i).css({backgroundColor:h.initialValue}).attr("title",wpColorPickerL10n.pick).attr("data-current",wpColorPickerL10n.current);h.pickerContainer=f(c).insertAfter(i);h.button=f(g);if(h.options.defaultColor){h.button.addClass("wp-picker-default").val(wpColorPickerL10n.defaultString)}else{h.button.addClass("wp-picker-clear").val(wpColorPickerL10n.clear)}i.wrap('<span class="wp-picker-input-wrap" />').after(h.button);i.iris({target:h.pickerContainer,hide:true,width:255,mode:"hsv",palettes:h.options.palettes,change:function(j,k){h.toggler.css({backgroundColor:k.color.toString()});if(f.isFunction(h.options.change)){h.options.change.call(this,j,k)}}});i.val(h.initialValue);h._addListeners();if(!h.options.hide){h.toggler.click()}},_addListeners:function(){var h=this;h.toggler.click(function(i){i.stopPropagation();h.element.toggle().iris("toggle");h.button.toggleClass("hidden");h.toggler.toggleClass("wp-picker-open");if(h.toggler.hasClass("wp-picker-open")){f("body").on("click",{wrap:h.wrap,toggler:h.toggler},h._bodyListener)}else{f("body").off("click",h._bodyListener)}});h.element.change(function(j){var i=f(this),k=i.val();if(k===""||k==="#"){h.toggler.css("backgroundColor","");if(f.isFunction(h.options.clear)){h.options.clear.call(this,j)}}});h.toggler.on("keyup",function(i){if(i.keyCode===13||i.keyCode===32){i.preventDefault();h.toggler.trigger("click").next().focus()}});h.button.click(function(j){var i=f(this);if(i.hasClass("wp-picker-clear")){h.element.val("");h.toggler.css("backgroundColor","");if(f.isFunction(h.options.clear)){h.options.clear.call(this,j)}}else{if(i.hasClass("wp-picker-default")){h.element.val(h.options.defaultColor).change()}}})},_bodyListener:function(h){if(!h.data.wrap.find(h.target).length){h.data.toggler.click()}},color:function(h){if(h===e){return this.element.iris("option","color")}this.element.iris("option","color",h)},defaultColor:function(h){if(h===e){return this.options.defaultColor}this.options.defaultColor=h}};f.widget("wp.wpColorPicker",d)}(jQuery));
\ No newline at end of file
+(function(f,e){var a='<a tabindex="0" class="wp-color-result" />',c='<div class="wp-picker-holder" />',b='<div class="wp-picker-container" />',g='<input type="button" class="button button-small hidden" />';var d={options:{defaultColor:false,change:false,clear:false,hide:true,palettes:true},_create:function(){if(!f.support.iris){return}var h=this;var i=h.element;f.extend(h.options,i.data());h.initialValue=i.val();i.addClass("wp-color-picker").hide().wrap(b);h.wrap=i.parent();h.toggler=f(a).insertBefore(i).css({backgroundColor:h.initialValue}).attr("title",wpColorPickerL10n.pick).attr("data-current",wpColorPickerL10n.current);h.pickerContainer=f(c).insertAfter(i);h.button=f(g);if(h.options.defaultColor){h.button.addClass("wp-picker-default").val(wpColorPickerL10n.defaultString)}else{h.button.addClass("wp-picker-clear").val(wpColorPickerL10n.clear)}i.wrap('<span class="wp-picker-input-wrap" />').after(h.button);i.iris({target:h.pickerContainer,hide:true,width:255,mode:"hsv",palettes:h.options.palettes,change:function(j,k){h.toggler.css({backgroundColor:k.color.toString()});if(f.isFunction(h.options.change)){h.options.change.call(this,j,k)}}});i.val(h.initialValue);h._addListeners();if(!h.options.hide){h.toggler.click()}},_addListeners:function(){var h=this;h.toggler.click(function(i){i.stopPropagation();h.element.toggle().iris("toggle");h.button.toggleClass("hidden");h.toggler.toggleClass("wp-picker-open");if(h.toggler.hasClass("wp-picker-open")){f("body").on("click",{wrap:h.wrap,toggler:h.toggler},h._bodyListener)}else{f("body").off("click",h._bodyListener)}});h.element.change(function(j){var i=f(this),k=i.val();if(k===""||k==="#"){h.toggler.css("backgroundColor","");if(f.isFunction(h.options.clear)){h.options.clear.call(this,j)}}});h.toggler.on("keyup",function(i){if(i.keyCode===13||i.keyCode===32){i.preventDefault();h.toggler.trigger("click").next().focus()}});h.button.click(function(j){var i=f(this);if(i.hasClass("wp-picker-clear")){h.element.val("");h.toggler.css("backgroundColor","");if(f.isFunction(h.options.clear)){h.options.clear.call(this,j)}}else{if(i.hasClass("wp-picker-default")){h.element.val(h.options.defaultColor).change()}}})},_bodyListener:function(h){if(!h.data.wrap.find(h.target).length){h.data.toggler.click()}},color:function(h){if(h===e){return this.element.iris("option","color")}this.element.iris("option","color",h)},defaultColor:function(h){if(h===e){return this.options.defaultColor}this.options.defaultColor=h}};f.widget("wp.wpColorPicker",d)}(jQuery));
\ No newline at end of file
index 0f6b84d08a4b82cf6658d566943e0125dda6d403..b1327f9973dd2fad6f41cb5d8dadb7b8e90b764e 100644 (file)
@@ -169,16 +169,22 @@ $(document).ready( function() {
        });
 
        $('#collapse-menu').on('click.collapse-menu', function(e){
-               var body = $(document.body);
+               var body = $( document.body ), respWidth;
 
                // reset any compensation for submenus near the bottom of the screen
                $('#adminmenu div.wp-submenu').css('margin-top', '');
 
-               if ( $(window).width() < 900 ) {
+               // WebKit excludes the width of the vertical scrollbar when applying the CSS "@media screen and (max-width: ...)"
+               // and matches $(window).width().
+               // Firefox and IE > 8 include the scrollbar width, so after the jQuery normalization
+               // $(window).width() is 884px but window.innerWidth is 900px.
+               // (using window.innerWidth also excludes IE < 9)
+               respWidth = navigator.userAgent.indexOf('AppleWebKit/') > -1 ? $(window).width() : window.innerWidth;
+
+               if ( respWidth && respWidth < 900 ) {
                        if ( body.hasClass('auto-fold') ) {
-                               body.removeClass('auto-fold');
+                               body.removeClass('auto-fold').removeClass('folded');
                                setUserSetting('unfold', 1);
-                               body.removeClass('folded');
                                deleteUserSetting('mfold');
                        } else {
                                body.addClass('auto-fold');
@@ -307,7 +313,7 @@ $(document).ready( function() {
                $(this).closest( 'table' ).children( 'tbody' ).filter(':visible')
                .children().children('.check-column').find(':checkbox')
                .prop('checked', function() {
-                       if ( $(this).closest('tr').is(':hidden') )
+                       if ( $(this).is(':hidden') )
                                return false;
                        if ( toggle )
                                return $(this).prop( 'checked' );
index df6ada9da56f21aac94cbb53f6b9f4a7ffe2df97..0575552c0e53ea94daf09c0ea4e26094fef65aab 100644 (file)
@@ -1 +1 @@
-var showNotice,adminMenu,columns,validateForm,screenMeta;(function(a){adminMenu={init:function(){},fold:function(){},restoreMenuState:function(){},toggle:function(){},favorites:function(){}};columns={init:function(){var b=this;a(".hide-column-tog","#adv-settings").click(function(){var d=a(this),c=d.val();if(d.prop("checked")){b.checked(c)}else{b.unchecked(c)}columns.saveManageColumnsState()})},saveManageColumnsState:function(){var b=this.hidden();a.post(ajaxurl,{action:"hidden-columns",hidden:b,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})},checked:function(b){a(".column-"+b).show();this.colSpanChange(+1)},unchecked:function(b){a(".column-"+b).hide();this.colSpanChange(-1)},hidden:function(){return a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return a(".hide-column-tog").not(":checked").map(function(){var b=this.id;return b.substring(b,b.length-5)}).get().join(",")}},colSpanChange:function(b){var d=a("table").find(".colspanchange"),c;if(!d.length){return}c=parseInt(d.attr("colspan"),10)+b;d.attr("colspan",c.toString())}};a(document).ready(function(){columns.init()});validateForm=function(b){return !a(b).find(".form-required").filter(function(){return a("input:visible",this).val()==""}).addClass("form-invalid").find("input:visible").change(function(){a(this).closest(".form-invalid").removeClass("form-invalid")}).size()};showNotice={warn:function(){var b=commonL10n.warnDelete||"";if(confirm(b)){return true}return false},note:function(b){alert(b)}};screenMeta={element:null,toggles:null,page:null,init:function(){this.element=a("#screen-meta");this.toggles=a(".screen-meta-toggle a");this.page=a("#wpcontent");this.toggles.click(this.toggleEvent)},toggleEvent:function(c){var b=a(this.href.replace(/.+#/,"#"));c.preventDefault();if(!b.length){return}if(b.is(":visible")){screenMeta.close(b,a(this))}else{screenMeta.open(b,a(this))}},open:function(b,c){a(".screen-meta-toggle").not(c.parent()).css("visibility","hidden");b.parent().show();b.slideDown("fast",function(){b.focus();c.addClass("screen-meta-active").attr("aria-expanded",true)})},close:function(b,c){b.slideUp("fast",function(){c.removeClass("screen-meta-active").attr("aria-expanded",false);a(".screen-meta-toggle").css("visibility","");b.parent().hide()})}};a(".contextual-help-tabs").delegate("a","click focus",function(d){var c=a(this),b;d.preventDefault();if(c.is(".active a")){return false}a(".contextual-help-tabs .active").removeClass("active");c.parent("li").addClass("active");b=a(c.attr("href"));a(".help-tab-content").not(b).removeClass("active").hide();b.addClass("active").show()});a(document).ready(function(){var i=false,d,f,j,h,c=a("#adminmenu"),b,e=a("input.current-page"),g=e.val();c.on("click.wp-submenu-head",".wp-submenu-head",function(k){a(k.target).parent().siblings("a").get(0).click()});a("#collapse-menu").on("click.collapse-menu",function(l){var k=a(document.body);a("#adminmenu div.wp-submenu").css("margin-top","");if(a(window).width()<900){if(k.hasClass("auto-fold")){k.removeClass("auto-fold");setUserSetting("unfold",1);k.removeClass("folded");deleteUserSetting("mfold")}else{k.addClass("auto-fold");deleteUserSetting("unfold")}}else{if(k.hasClass("folded")){k.removeClass("folded");deleteUserSetting("mfold")}else{k.addClass("folded");setUserSetting("mfold","f")}}});if("ontouchstart" in window||/IEMobile\/[1-9]/.test(navigator.userAgent)){b=/Mobile\/.+Safari/.test(navigator.userAgent)?"touchstart":"click";a(document.body).on(b+".wp-mobile-hover",function(k){if(!a(k.target).closest("#adminmenu").length){c.find("li.wp-has-submenu.opensub").removeClass("opensub")}});c.find("a.wp-has-submenu").on(b+".wp-mobile-hover",function(m){var l=a(this),k=l.parent();if(!k.hasClass("opensub")&&(!k.hasClass("wp-menu-open")||k.width()<40)){m.preventDefault();c.find("li.opensub").removeClass("opensub");k.addClass("opensub")}})}c.find("li.wp-has-submenu").hoverIntent({over:function(s){var u,q,k,r,l=a(this).find(".wp-submenu"),v,n,p,t=parseInt(l.css("top"),10);if(isNaN(t)||t>-5){return}v=a(this).offset().top;n=a(window).scrollTop();p=v-n-30;u=v+l.height()+1;q=a("#wpwrap").height();k=60+u-q;r=a(window).height()+n-15;if(r<(u-k)){k=u-r}if(k>p){k=p}if(k>1){l.css("margin-top","-"+k+"px")}else{l.css("margin-top","")}c.find("li.menu-top").removeClass("opensub");a(this).addClass("opensub")},out:function(){a(this).removeClass("opensub").find(".wp-submenu").css("margin-top","")},timeout:200,sensitivity:7,interval:90});c.on("focus.adminmenu",".wp-submenu a",function(k){a(k.target).closest("li.menu-top").addClass("opensub")}).on("blur.adminmenu",".wp-submenu a",function(k){a(k.target).closest("li.menu-top").removeClass("opensub")});a("div.wrap h2:first").nextAll("div.updated, div.error").addClass("below-h2");a("div.updated, div.error").not(".below-h2, .inline").insertAfter(a("div.wrap h2:first"));screenMeta.init();a("tbody").children().children(".check-column").find(":checkbox").click(function(l){if("undefined"==l.shiftKey){return true}if(l.shiftKey){if(!i){return true}d=a(i).closest("form").find(":checkbox");f=d.index(i);j=d.index(this);h=a(this).prop("checked");if(0<f&&0<j&&f!=j){d.slice(f,j).prop("checked",function(){if(a(this).closest("tr").is(":visible")){return h}return false})}}i=this;var k=a(this).closest("tbody").find(":checkbox").filter(":visible").not(":checked");a(this).closest("table").children("thead, tfoot").find(":checkbox").prop("checked",function(){return(0==k.length)});return true});a("thead, tfoot").find(".check-column :checkbox").click(function(m){var n=a(this).prop("checked"),l="undefined"==typeof toggleWithKeyboard?false:toggleWithKeyboard,k=m.shiftKey||l;a(this).closest("table").children("tbody").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){if(a(this).closest("tr").is(":hidden")){return false}if(k){return a(this).prop("checked")}else{if(n){return true}}return false});a(this).closest("table").children("thead,  tfoot").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){if(k){return false}else{if(n){return true}}return false})});a("#default-password-nag-no").click(function(){setUserSetting("default_password_nag","hide");a("div.default-password-nag").hide();return false});a("#newcontent").bind("keydown.wpevent_InsertTab",function(p){var m=p.target,r,l,q,k,o;if(p.keyCode==27){a(m).data("tab-out",true);return}if(p.keyCode!=9||p.ctrlKey||p.altKey||p.shiftKey){return}if(a(m).data("tab-out")){a(m).data("tab-out",false);return}r=m.selectionStart;l=m.selectionEnd;q=m.value;try{this.lastKey=9}catch(n){}if(document.selection){m.focus();o=document.selection.createRange();o.text="\t"}else{if(r>=0){k=this.scrollTop;m.value=q.substring(0,r).concat("\t",q.substring(l));m.selectionStart=m.selectionEnd=r+1;this.scrollTop=k}}if(p.stopPropagation){p.stopPropagation()}if(p.preventDefault){p.preventDefault()}});a("#newcontent").bind("blur.wpevent_InsertTab",function(k){if(this.lastKey&&9==this.lastKey){this.focus()}});if(e.length){e.closest("form").submit(function(k){if(a('select[name="action"]').val()==-1&&a('select[name="action2"]').val()==-1&&e.val()==g){e.val("1")}})}a("#contextual-help-link, #show-settings-link").on("focus.scroll-into-view",function(k){if(k.target.scrollIntoView){k.target.scrollIntoView(false)}});(function(){var l,k,m=a("form.wp-upload-form");if(!m.length){return}l=m.find('input[type="submit"]');k=m.find('input[type="file"]');function n(){l.prop("disabled",""===k.map(function(){return a(this).val()}).get().join(""))}n();k.on("change",n)})()});a(document).bind("wp_CloseOnEscape",function(c,b){if(typeof(b.cb)!="function"){return}if(typeof(b.condition)!="function"||b.condition()){b.cb()}return true})})(jQuery);
\ No newline at end of file
+var showNotice,adminMenu,columns,validateForm,screenMeta;(function(a){adminMenu={init:function(){},fold:function(){},restoreMenuState:function(){},toggle:function(){},favorites:function(){}};columns={init:function(){var b=this;a(".hide-column-tog","#adv-settings").click(function(){var d=a(this),c=d.val();if(d.prop("checked")){b.checked(c)}else{b.unchecked(c)}columns.saveManageColumnsState()})},saveManageColumnsState:function(){var b=this.hidden();a.post(ajaxurl,{action:"hidden-columns",hidden:b,screenoptionnonce:a("#screenoptionnonce").val(),page:pagenow})},checked:function(b){a(".column-"+b).show();this.colSpanChange(+1)},unchecked:function(b){a(".column-"+b).hide();this.colSpanChange(-1)},hidden:function(){return a(".manage-column").filter(":hidden").map(function(){return this.id}).get().join(",")},useCheckboxesForHidden:function(){this.hidden=function(){return a(".hide-column-tog").not(":checked").map(function(){var b=this.id;return b.substring(b,b.length-5)}).get().join(",")}},colSpanChange:function(b){var d=a("table").find(".colspanchange"),c;if(!d.length){return}c=parseInt(d.attr("colspan"),10)+b;d.attr("colspan",c.toString())}};a(document).ready(function(){columns.init()});validateForm=function(b){return !a(b).find(".form-required").filter(function(){return a("input:visible",this).val()==""}).addClass("form-invalid").find("input:visible").change(function(){a(this).closest(".form-invalid").removeClass("form-invalid")}).size()};showNotice={warn:function(){var b=commonL10n.warnDelete||"";if(confirm(b)){return true}return false},note:function(b){alert(b)}};screenMeta={element:null,toggles:null,page:null,init:function(){this.element=a("#screen-meta");this.toggles=a(".screen-meta-toggle a");this.page=a("#wpcontent");this.toggles.click(this.toggleEvent)},toggleEvent:function(c){var b=a(this.href.replace(/.+#/,"#"));c.preventDefault();if(!b.length){return}if(b.is(":visible")){screenMeta.close(b,a(this))}else{screenMeta.open(b,a(this))}},open:function(b,c){a(".screen-meta-toggle").not(c.parent()).css("visibility","hidden");b.parent().show();b.slideDown("fast",function(){b.focus();c.addClass("screen-meta-active").attr("aria-expanded",true)})},close:function(b,c){b.slideUp("fast",function(){c.removeClass("screen-meta-active").attr("aria-expanded",false);a(".screen-meta-toggle").css("visibility","");b.parent().hide()})}};a(".contextual-help-tabs").delegate("a","click focus",function(d){var c=a(this),b;d.preventDefault();if(c.is(".active a")){return false}a(".contextual-help-tabs .active").removeClass("active");c.parent("li").addClass("active");b=a(c.attr("href"));a(".help-tab-content").not(b).removeClass("active").hide();b.addClass("active").show()});a(document).ready(function(){var i=false,d,f,j,h,c=a("#adminmenu"),b,e=a("input.current-page"),g=e.val();c.on("click.wp-submenu-head",".wp-submenu-head",function(k){a(k.target).parent().siblings("a").get(0).click()});a("#collapse-menu").on("click.collapse-menu",function(m){var k=a(document.body),l;a("#adminmenu div.wp-submenu").css("margin-top","");l=navigator.userAgent.indexOf("AppleWebKit/")>-1?a(window).width():window.innerWidth;if(l&&l<900){if(k.hasClass("auto-fold")){k.removeClass("auto-fold").removeClass("folded");setUserSetting("unfold",1);deleteUserSetting("mfold")}else{k.addClass("auto-fold");deleteUserSetting("unfold")}}else{if(k.hasClass("folded")){k.removeClass("folded");deleteUserSetting("mfold")}else{k.addClass("folded");setUserSetting("mfold","f")}}});if("ontouchstart" in window||/IEMobile\/[1-9]/.test(navigator.userAgent)){b=/Mobile\/.+Safari/.test(navigator.userAgent)?"touchstart":"click";a(document.body).on(b+".wp-mobile-hover",function(k){if(!a(k.target).closest("#adminmenu").length){c.find("li.wp-has-submenu.opensub").removeClass("opensub")}});c.find("a.wp-has-submenu").on(b+".wp-mobile-hover",function(m){var l=a(this),k=l.parent();if(!k.hasClass("opensub")&&(!k.hasClass("wp-menu-open")||k.width()<40)){m.preventDefault();c.find("li.opensub").removeClass("opensub");k.addClass("opensub")}})}c.find("li.wp-has-submenu").hoverIntent({over:function(s){var u,q,k,r,l=a(this).find(".wp-submenu"),v,n,p,t=parseInt(l.css("top"),10);if(isNaN(t)||t>-5){return}v=a(this).offset().top;n=a(window).scrollTop();p=v-n-30;u=v+l.height()+1;q=a("#wpwrap").height();k=60+u-q;r=a(window).height()+n-15;if(r<(u-k)){k=u-r}if(k>p){k=p}if(k>1){l.css("margin-top","-"+k+"px")}else{l.css("margin-top","")}c.find("li.menu-top").removeClass("opensub");a(this).addClass("opensub")},out:function(){a(this).removeClass("opensub").find(".wp-submenu").css("margin-top","")},timeout:200,sensitivity:7,interval:90});c.on("focus.adminmenu",".wp-submenu a",function(k){a(k.target).closest("li.menu-top").addClass("opensub")}).on("blur.adminmenu",".wp-submenu a",function(k){a(k.target).closest("li.menu-top").removeClass("opensub")});a("div.wrap h2:first").nextAll("div.updated, div.error").addClass("below-h2");a("div.updated, div.error").not(".below-h2, .inline").insertAfter(a("div.wrap h2:first"));screenMeta.init();a("tbody").children().children(".check-column").find(":checkbox").click(function(l){if("undefined"==l.shiftKey){return true}if(l.shiftKey){if(!i){return true}d=a(i).closest("form").find(":checkbox");f=d.index(i);j=d.index(this);h=a(this).prop("checked");if(0<f&&0<j&&f!=j){d.slice(f,j).prop("checked",function(){if(a(this).closest("tr").is(":visible")){return h}return false})}}i=this;var k=a(this).closest("tbody").find(":checkbox").filter(":visible").not(":checked");a(this).closest("table").children("thead, tfoot").find(":checkbox").prop("checked",function(){return(0==k.length)});return true});a("thead, tfoot").find(".check-column :checkbox").click(function(m){var n=a(this).prop("checked"),l="undefined"==typeof toggleWithKeyboard?false:toggleWithKeyboard,k=m.shiftKey||l;a(this).closest("table").children("tbody").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){if(a(this).is(":hidden")){return false}if(k){return a(this).prop("checked")}else{if(n){return true}}return false});a(this).closest("table").children("thead,  tfoot").filter(":visible").children().children(".check-column").find(":checkbox").prop("checked",function(){if(k){return false}else{if(n){return true}}return false})});a("#default-password-nag-no").click(function(){setUserSetting("default_password_nag","hide");a("div.default-password-nag").hide();return false});a("#newcontent").bind("keydown.wpevent_InsertTab",function(p){var m=p.target,r,l,q,k,o;if(p.keyCode==27){a(m).data("tab-out",true);return}if(p.keyCode!=9||p.ctrlKey||p.altKey||p.shiftKey){return}if(a(m).data("tab-out")){a(m).data("tab-out",false);return}r=m.selectionStart;l=m.selectionEnd;q=m.value;try{this.lastKey=9}catch(n){}if(document.selection){m.focus();o=document.selection.createRange();o.text="\t"}else{if(r>=0){k=this.scrollTop;m.value=q.substring(0,r).concat("\t",q.substring(l));m.selectionStart=m.selectionEnd=r+1;this.scrollTop=k}}if(p.stopPropagation){p.stopPropagation()}if(p.preventDefault){p.preventDefault()}});a("#newcontent").bind("blur.wpevent_InsertTab",function(k){if(this.lastKey&&9==this.lastKey){this.focus()}});if(e.length){e.closest("form").submit(function(k){if(a('select[name="action"]').val()==-1&&a('select[name="action2"]').val()==-1&&e.val()==g){e.val("1")}})}a("#contextual-help-link, #show-settings-link").on("focus.scroll-into-view",function(k){if(k.target.scrollIntoView){k.target.scrollIntoView(false)}});(function(){var l,k,m=a("form.wp-upload-form");if(!m.length){return}l=m.find('input[type="submit"]');k=m.find('input[type="file"]');function n(){l.prop("disabled",""===k.map(function(){return a(this).val()}).get().join(""))}n();k.on("change",n)})()});a(document).bind("wp_CloseOnEscape",function(c,b){if(typeof(b.cb)!="function"){return}if(typeof(b.condition)!="function"||b.condition()){b.cb()}return true})})(jQuery);
\ No newline at end of file
index 9eab214553ddacb770d4465c02a4273b19810da9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1,34 +0,0 @@
-jQuery(document).ready( function($) {
-       var before, addBefore, addAfter, delBefore;
-
-       before = function() {
-               var nonce = $('#newmeta [name="_ajax_nonce"]').val(), postId = $('#post_ID').val();
-               if ( !nonce || !postId ) { return false; }
-               return [nonce,postId];
-       }
-
-       addBefore = function( s ) {
-               var b = before();
-               if ( !b ) { return false; }
-               s.data = s.data.replace(/_ajax_nonce=[a-f0-9]+/, '_ajax_nonce=' + b[0]) + '&post_id=' + b[1];
-               return s;
-       };
-
-       addAfter = function( r, s ) {
-               var postId = $('postid', r).text(), h;
-               if ( !postId ) { return; }
-               $('#post_ID').attr( 'name', 'post_ID' ).val( postId );
-               h = $('#hiddenaction');
-               if ( 'post' == h.val() ) { h.val( 'postajaxpost' ); }
-       };
-
-       delBefore = function( s ) {
-               var b = before(); if ( !b ) return false;
-               s.data._ajax_nonce = b[0]; s.data.post_id = b[1];
-               return s;
-       }
-
-       $('#the-list')
-               .wpList( { addBefore: addBefore, addAfter: addAfter, delBefore: delBefore } )
-               .find('.updatemeta, .deletemeta').attr( 'type', 'button' );
-} );
index dbe2f4816e0f8c60ac87a4b45876435c719fc661..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-jQuery(document).ready(function(d){var c,b,e,a;c=function(){var g=d('#newmeta [name="_ajax_nonce"]').val(),f=d("#post_ID").val();if(!g||!f){return false}return[g,f]};b=function(g){var f=c();if(!f){return false}g.data=g.data.replace(/_ajax_nonce=[a-f0-9]+/,"_ajax_nonce="+f[0])+"&post_id="+f[1];return g};e=function(j,i){var f=d("postid",j).text(),g;if(!f){return}d("#post_ID").attr("name","post_ID").val(f);g=d("#hiddenaction");if("post"==g.val()){g.val("postajaxpost")}};a=function(g){var f=c();if(!f){return false}g.data._ajax_nonce=f[0];g.data.post_id=f[1];return g};d("#the-list").wpList({addBefore:b,addAfter:e,delBefore:a}).find(".updatemeta, .deletemeta").attr("type","button")});
\ No newline at end of file
index 96f776744fe76732b7990b8b974f9b23a5af78c3..01fffbac171346482d35c2c9177dde439b2112cc 100644 (file)
                        api.state = state;
                }());
 
-               // Temporary accordion code.
-               $('.customize-section-title').bind('click keydown', function( event ) {
-
-                       if ( event.type === 'keydown' &&  13 !== event.which ) // enter
-                                       return;
-
-                       var clicked = $( this ).parents( '.customize-section' );
-
-                       if ( clicked.hasClass('cannot-expand') )
-                               return;
-
-                       // Scroll up if on #customize-section-title_tagline
-                       if ('customize-section-title_tagline' === clicked.attr('id'))
-                               $('.wp-full-overlay-sidebar-content').scrollTop(0);
-
-                       $( '.customize-section' ).not( clicked ).removeClass( 'open' );
-                       clicked.toggleClass( 'open' );
-                       event.preventDefault();
-               });
-
                // Button bindings.
                $('#save').click( function( event ) {
                        previewer.save();
                        event.preventDefault();
                });
 
+               $('.upload-dropzone a.upload').keydown( function( event ) {
+                       if ( 13 === event.which ) // enter
+                               this.click();
+               });
+
                $('.collapse-sidebar').on( 'click keydown', function( event ) {
                        if ( event.type === 'keydown' &&  13 !== event.which ) // enter
                                return;
index b3543ee00eb5b058695da95ad22ca97416f5bb47..82050c464c3826b9d016e7afabfb6b7af65b76d1 100644 (file)
@@ -1 +1 @@
-(function(a,c){var b=wp.customize;b.Setting=b.Value.extend({initialize:function(g,f,d){var e;b.Value.prototype.initialize.call(this,f,d);this.id=g;this.transport=this.transport||"refresh";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()])}}});b.Control=b.Class.extend({initialize:function(i,e){var g=this,d,h,f;this.params={};c.extend(this,e||{});this.id=i;this.selector="#customize-control-"+i.replace("]","").replace("[","-");this.container=c(this.selector);f=c.map(this.params.settings,function(j){return j});b.apply(b,f.concat(function(){var j;g.settings={};for(j in g.params.settings){g.settings[j]=b(g.params.settings[j])}g.setting=g.settings["default"]||null;g.ready()}));g.elements=[];d=this.container.find("[data-customize-setting-link]");h={};d.each(function(){var k=c(this),j;if(k.is(":radio")){j=k.prop("name");if(h[j]){return}h[j]=true;k=d.filter('[name="'+j+'"]')}b(k.data("customizeSettingLink"),function(m){var l=new b.Element(k);g.elements.push(l);l.sync(m);l.set(m())})})},ready:function(){},dropdownInit:function(){var f=this,e=this.container.find(".dropdown-status"),g=this.params,h=function(i){if(typeof i==="string"&&g.statuses&&g.statuses[i]){e.html(g.statuses[i]).show()}else{e.hide()}};var d=false;this.container.on("click keydown",".dropdown",function(i){if(i.type==="keydown"&&13!==i.which){return}i.preventDefault();if(!d){f.container.toggleClass("open")}if(f.container.hasClass("open")){f.container.parent().parent().find("li.library-selected").focus()}d=true;setTimeout(function(){d=false},400)});this.setting.bind(h);h(this.setting())}});b.ColorControl=b.Control.extend({ready:function(){var e=this,d=this.container.find(".color-picker-hex");d.val(e.setting()).wpColorPicker({change:function(g,f){e.setting.set(d.wpColorPicker("color"))},clear:function(){e.setting.set(false)}})}});b.UploadControl=b.Control.extend({ready:function(){var d=this;this.params.removed=this.params.removed||"";this.success=c.proxy(this.success,this);this.uploader=c.extend({container:this.container,browser:this.container.find(".upload"),dropzone:this.container.find(".upload-dropzone"),success:this.success,plupload:{},params:{}},this.uploader||{});if(d.params.extensions){d.uploader.plupload.filters=[{title:b.l10n.allowedFiles,extensions:d.params.extensions}]}if(d.params.context){d.uploader.params["post_data[context]"]=this.params.context}if(b.settings.theme.stylesheet){d.uploader.params["post_data[theme]"]=b.settings.theme.stylesheet}this.uploader=new wp.Uploader(this.uploader);this.remover=this.container.find(".remove");this.remover.on("click keydown",function(e){if(e.type==="keydown"&&13!==e.which){return}d.setting.set(d.params.removed);e.preventDefault()});this.removerVisibility=c.proxy(this.removerVisibility,this);this.setting.bind(this.removerVisibility);this.removerVisibility(this.setting.get())},success:function(d){this.setting.set(d.get("url"))},removerVisibility:function(d){this.remover.toggle(d!=this.params.removed)}});b.ImageControl=b.UploadControl.extend({ready:function(){var e=this,d;this.uploader={init:function(f){var h,g;if(this.supports.dragdrop){return}h=e.container.find(".upload-fallback");g=h.children().detach();this.browser.detach().empty().append(g);h.append(this.browser).show()}};b.UploadControl.prototype.ready.call(this);this.thumbnail=this.container.find(".preview-thumbnail img");this.thumbnailSrc=c.proxy(this.thumbnailSrc,this);this.setting.bind(this.thumbnailSrc);this.library=this.container.find(".library");this.tabs={};d=this.library.find(".library-content");this.library.children("ul").children("li").each(function(){var g=c(this),h=g.data("customizeTab"),f=d.filter('[data-customize-tab="'+h+'"]');e.tabs[h]={both:g.add(f),link:g,panel:f}});this.library.children("ul").on("click keydown","li",function(g){if(g.type==="keydown"&&13!==g.which){return}var h=c(this).data("customizeTab"),f=e.tabs[h];g.preventDefault();if(f.link.hasClass("library-selected")){return}e.selected.both.removeClass("library-selected");e.selected=f;e.selected.both.addClass("library-selected")});this.library.on("click keydown","a",function(f){if(f.type==="keydown"&&13!==f.which){return}var g=c(this).data("customizeImageValue");if(g){e.setting.set(g);f.preventDefault()}});if(this.tabs.uploaded){this.tabs.uploaded.target=this.library.find(".uploaded-target");if(!this.tabs.uploaded.panel.find(".thumbnail").length){this.tabs.uploaded.both.addClass("hidden")}}d.each(function(){var f=e.tabs[c(this).data("customizeTab")];if(!f.link.hasClass("hidden")){e.selected=f;f.both.addClass("library-selected");return false}});this.dropdownInit()},success:function(d){b.UploadControl.prototype.success.call(this,d);if(this.tabs.uploaded&&this.tabs.uploaded.target.length){this.tabs.uploaded.both.removeClass("hidden");d.element=c('<a href="#" class="thumbnail"></a>').data("customizeImageValue",d.get("url")).append('<img src="'+d.get("url")+'" />').appendTo(this.tabs.uploaded.target)}},thumbnailSrc:function(d){if(/^(https?:)?\/\//.test(d)){this.thumbnail.prop("src",d).show()}else{this.thumbnail.hide()}}});b.defaultConstructor=b.Setting;b.control=new b.Values({defaultConstructor:b.Control});b.PreviewFrame=b.Messenger.extend({sensitivity:2000,initialize:function(g,f){var e=c.Deferred(),d=this;e.promise(this);this.container=g.container;this.signature=g.signature;c.extend(g,{channel:b.PreviewFrame.uuid()});b.Messenger.prototype.initialize.call(this,g,f);this.add("previewUrl",g.previewUrl);this.query=c.extend(g.query||{},{customize_messenger_channel:this.channel()});this.run(e)},run:function(e){var d=this,f=false,g=false;if(this._ready){this.unbind("ready",this._ready)}this._ready=function(){g=true;if(f){e.resolveWith(d)}};this.bind("ready",this._ready);this.request=c.ajax(this.previewUrl(),{type:"POST",data:this.query,xhrFields:{withCredentials:true}});this.request.fail(function(){e.rejectWith(d,["request failure"])});this.request.done(function(j){var i=d.request.getResponseHeader("Location"),h=d.signature,k;if(i&&i!=d.previewUrl()){e.rejectWith(d,["redirect",i]);return}if("0"===j){d.login(e);return}if("-1"===j){e.rejectWith(d,["cheatin"]);return}k=j.lastIndexOf(h);if(-1===k||k<j.lastIndexOf("</html>")){e.rejectWith(d,["unsigned"]);return}j=j.slice(0,k)+j.slice(k+h.length);d.iframe=c("<iframe />").appendTo(d.container);d.iframe.one("load",function(){f=true;if(g){e.resolveWith(d)}else{setTimeout(function(){e.rejectWith(d,["ready timeout"])},d.sensitivity)}});d.targetWindow(d.iframe[0].contentWindow);d.targetWindow().document.open();d.targetWindow().document.write(j);d.targetWindow().document.close()})},login:function(e){var d=this,f;f=function(){e.rejectWith(d,["logged out"])};if(this.triedLogin){return f()}c.get(b.settings.url.ajax,{action:"logged-in"}).fail(f).done(function(g){var h;if("1"!==g){f()}h=c('<iframe src="'+d.previewUrl()+'" />').hide();h.appendTo(d.container);h.load(function(){d.triedLogin=true;h.remove();d.run(e)})})},destroy:function(){b.Messenger.prototype.destroy.call(this);this.request.abort();if(this.iframe){this.iframe.remove()}delete this.request;delete this.iframe;delete this.targetWindow}});(function(){var d=0;b.PreviewFrame.uuid=function(){return"preview-"+d++}}());b.Previewer=b.Messenger.extend({refreshBuffer:250,initialize:function(h,f){var d=this,g=/^https?/,e;c.extend(this,f||{});this.refresh=(function(i){var j=i.refresh,l=function(){k=null;j.call(i)},k;return function(){if(typeof k!=="number"){if(i.loading){i.abort()}else{return l()}}clearTimeout(k);k=setTimeout(l,i.refreshBuffer)}})(this);this.container=b.ensure(h.container);this.allowedUrls=h.allowedUrls;this.signature=h.signature;h.url=window.location.href;b.Messenger.prototype.initialize.call(this,h);this.add("scheme",this.origin()).link(this.origin).setter(function(j){var i=j.match(g);return i?i[0]:""});this.add("previewUrl",h.previewUrl).setter(function(j){var i;if(/\/wp-admin(\/|$)/.test(j.replace(/[#?].*$/,""))){return null}c.each([j.replace(g,d.scheme()),j],function(l,k){c.each(d.allowedUrls,function(m,n){if(0===k.indexOf(n)){i=k;return false}});if(i){return false}});return i?i:null});this.previewUrl.bind(this.refresh);this.scroll=0;this.bind("scroll",function(i){this.scroll=i});this.bind("url",this.previewUrl)},query:function(){},abort:function(){if(this.loading){this.loading.destroy();delete this.loading}},refresh:function(){var d=this;this.abort();this.loading=new b.PreviewFrame({url:this.url(),previewUrl:this.previewUrl(),query:this.query()||{},container:this.container,signature:this.signature});this.loading.done(function(){this.bind("synced",function(){if(d.preview){d.preview.destroy()}d.preview=this;delete d.loading;d.targetWindow(this.targetWindow());d.channel(this.channel());d.send("active")});this.send("sync",{scroll:d.scroll,settings:b.get()})});this.loading.fail(function(f,e){if("redirect"===f&&e){d.previewUrl(e)}if("logged out"===f){if(d.preview){d.preview.destroy();delete d.preview}d.login().done(d.refresh)}if("cheatin"===f){d.cheatin()}})},login:function(){var g=this,d,f,e;if(this._login){return this._login}d=c.Deferred();this._login=d.promise();f=new b.Messenger({channel:"login",url:b.settings.url.login});e=c('<iframe src="'+b.settings.url.login+'" />').appendTo(this.container);f.targetWindow(e[0].contentWindow);f.bind("login",function(){e.remove();f.destroy();delete g._login;d.resolve()});return this._login},cheatin:function(){c(document.body).empty().addClass("cheatin").append("<p>"+b.l10n.cheatin+"</p>")}});b.controlConstructor={color:b.ColorControl,upload:b.UploadControl,image:b.ImageControl};c(function(){b.settings=window._wpCustomizeSettings;b.l10n=window._wpCustomizeControlsL10n;if(!b.settings){return}if(!c.support.postMessage||(!c.support.cors&&b.settings.isCrossDomain)){return window.location=b.settings.url.fallback}var d=c(document.body),f=d.children(".wp-full-overlay"),h,i,g;c("#customize-controls").on("keydown",function(j){if(c(j.target).is("textarea")){return}if(13===j.which){j.preventDefault()}});i=new b.Previewer({container:"#customize-preview",form:"#customize-controls",previewUrl:b.settings.url.preview,allowedUrls:b.settings.url.allowed,signature:"WP_CUSTOMIZER_SIGNATURE"},{nonce:b.settings.nonce,query:function(){return{wp_customize:"on",theme:b.settings.theme.stylesheet,customized:JSON.stringify(b.get()),nonce:this.nonce.preview}},save:function(){var j=this,l=c.extend(this.query(),{action:"customize_save",nonce:this.nonce.save}),k=c.post(b.settings.url.ajax,l);b.trigger("save",k);d.addClass("saving");k.always(function(){d.removeClass("saving")});k.done(function(m){if("0"===m){j.preview.iframe.hide();j.login().done(function(){j.save();j.preview.iframe.show()});return}if("-1"===m){j.cheatin();return}b.trigger("saved")})}});i.bind("nonce",function(j){c.extend(this.nonce,j)});c.each(b.settings.settings,function(k,j){b.create(k,k,j.value,{transport:j.transport,previewer:i})});c.each(b.settings.controls,function(m,k){var j=b.controlConstructor[k.type]||b.Control,l;l=b.control.add(m,new j(m,{params:k,previewer:i}))});if(i.previewUrl()){i.refresh()}else{i.previewUrl(b.settings.url.home)}(function(){var l=new b.Values(),k=l.create("saved"),j=l.create("activated");l.bind("change",function(){var n=c("#save"),m=c(".back");if(!j()){n.val(b.l10n.activate).prop("disabled",false);m.text(b.l10n.cancel)}else{if(k()){n.val(b.l10n.saved).prop("disabled",true);m.text(b.l10n.close)}else{n.val(b.l10n.save).prop("disabled",false);m.text(b.l10n.cancel)}}});k(true);j(b.settings.theme.active);b.bind("change",function(){l("saved").set(false)});b.bind("saved",function(){l("saved").set(true);l("activated").set(true)});j.bind(function(m){if(m){b.trigger("activated")}});b.state=l}());c(".customize-section-title").bind("click keydown",function(k){if(k.type==="keydown"&&13!==k.which){return}var j=c(this).parents(".customize-section");if(j.hasClass("cannot-expand")){return}if("customize-section-title_tagline"===j.attr("id")){c(".wp-full-overlay-sidebar-content").scrollTop(0)}c(".customize-section").not(j).removeClass("open");j.toggleClass("open");k.preventDefault()});c("#save").click(function(j){i.save();j.preventDefault()}).keydown(function(j){if(9===j.which){return}if(13===j.which){i.save()}j.preventDefault()});c(".back").keydown(function(j){if(9===j.which){return}if(13===j.which){g.send("close")}j.preventDefault()});c(".collapse-sidebar").on("click keydown",function(j){if(j.type==="keydown"&&13!==j.which){return}f.toggleClass("collapsed").toggleClass("expanded");j.preventDefault()});g=new b.Messenger({url:b.settings.url.parent,channel:"loader"});g.bind("back",function(){c(".back").on("click.back",function(j){j.preventDefault();g.send("close")})});b.bind("saved",function(){g.send("saved")});b.bind("activated",function(){if(g.targetWindow()){g.send("activated",b.settings.url.activated)}else{if(b.settings.url.activated){window.location=b.settings.url.activated}}});g.send("ready");c.each({background_image:{controls:["background_repeat","background_position_x","background_attachment"],callback:function(j){return !!j}},show_on_front:{controls:["page_on_front","page_for_posts"],callback:function(j){return"page"===j}},header_textcolor:{controls:["header_textcolor"],callback:function(j){return"blank"!==j}}},function(j,k){b(j,function(l){c.each(k.controls,function(m,n){b.control(n,function(p){var o=function(q){p.container.toggle(k.callback(q))};o(l.get());l.bind(o)})})})});b.control("display_header_text",function(k){var j="";k.elements[0].unsync(b("header_textcolor"));k.element=new b.Element(k.container.find("input"));k.element.set("blank"!==k.setting());k.element.bind(function(l){if(!l){j=b("header_textcolor").get()}k.setting.set(l?j:"blank")});k.setting.bind(function(l){k.element.set("blank"!==l)})});b.control("header_image",function(j){j.setting.bind(function(k){if(k===j.params.removed){j.settings.data.set(false)}});j.library.on("click","a",function(k){j.settings.data.set(c(this).data("customizeHeaderImageData"))});j.uploader.success=function(l){var k;b.ImageControl.prototype.success.call(j,l);k={attachment_id:l.get("id"),url:l.get("url"),thumbnail_url:l.get("url"),height:l.get("height"),width:l.get("width")};l.element.data("customizeHeaderImageData",k);j.settings.data.set(k)}});b.trigger("ready");var e=c(".back");e.focus();setTimeout(function(){e.focus()},200)})})(wp,jQuery);
\ No newline at end of file
+(function(a,c){var b=wp.customize;b.Setting=b.Value.extend({initialize:function(g,f,d){var e;b.Value.prototype.initialize.call(this,f,d);this.id=g;this.transport=this.transport||"refresh";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()])}}});b.Control=b.Class.extend({initialize:function(i,e){var g=this,d,h,f;this.params={};c.extend(this,e||{});this.id=i;this.selector="#customize-control-"+i.replace("]","").replace("[","-");this.container=c(this.selector);f=c.map(this.params.settings,function(j){return j});b.apply(b,f.concat(function(){var j;g.settings={};for(j in g.params.settings){g.settings[j]=b(g.params.settings[j])}g.setting=g.settings["default"]||null;g.ready()}));g.elements=[];d=this.container.find("[data-customize-setting-link]");h={};d.each(function(){var k=c(this),j;if(k.is(":radio")){j=k.prop("name");if(h[j]){return}h[j]=true;k=d.filter('[name="'+j+'"]')}b(k.data("customizeSettingLink"),function(m){var l=new b.Element(k);g.elements.push(l);l.sync(m);l.set(m())})})},ready:function(){},dropdownInit:function(){var f=this,e=this.container.find(".dropdown-status"),g=this.params,h=function(i){if(typeof i==="string"&&g.statuses&&g.statuses[i]){e.html(g.statuses[i]).show()}else{e.hide()}};var d=false;this.container.on("click keydown",".dropdown",function(i){if(i.type==="keydown"&&13!==i.which){return}i.preventDefault();if(!d){f.container.toggleClass("open")}if(f.container.hasClass("open")){f.container.parent().parent().find("li.library-selected").focus()}d=true;setTimeout(function(){d=false},400)});this.setting.bind(h);h(this.setting())}});b.ColorControl=b.Control.extend({ready:function(){var e=this,d=this.container.find(".color-picker-hex");d.val(e.setting()).wpColorPicker({change:function(g,f){e.setting.set(d.wpColorPicker("color"))},clear:function(){e.setting.set(false)}})}});b.UploadControl=b.Control.extend({ready:function(){var d=this;this.params.removed=this.params.removed||"";this.success=c.proxy(this.success,this);this.uploader=c.extend({container:this.container,browser:this.container.find(".upload"),dropzone:this.container.find(".upload-dropzone"),success:this.success,plupload:{},params:{}},this.uploader||{});if(d.params.extensions){d.uploader.plupload.filters=[{title:b.l10n.allowedFiles,extensions:d.params.extensions}]}if(d.params.context){d.uploader.params["post_data[context]"]=this.params.context}if(b.settings.theme.stylesheet){d.uploader.params["post_data[theme]"]=b.settings.theme.stylesheet}this.uploader=new wp.Uploader(this.uploader);this.remover=this.container.find(".remove");this.remover.on("click keydown",function(e){if(e.type==="keydown"&&13!==e.which){return}d.setting.set(d.params.removed);e.preventDefault()});this.removerVisibility=c.proxy(this.removerVisibility,this);this.setting.bind(this.removerVisibility);this.removerVisibility(this.setting.get())},success:function(d){this.setting.set(d.get("url"))},removerVisibility:function(d){this.remover.toggle(d!=this.params.removed)}});b.ImageControl=b.UploadControl.extend({ready:function(){var e=this,d;this.uploader={init:function(f){var h,g;if(this.supports.dragdrop){return}h=e.container.find(".upload-fallback");g=h.children().detach();this.browser.detach().empty().append(g);h.append(this.browser).show()}};b.UploadControl.prototype.ready.call(this);this.thumbnail=this.container.find(".preview-thumbnail img");this.thumbnailSrc=c.proxy(this.thumbnailSrc,this);this.setting.bind(this.thumbnailSrc);this.library=this.container.find(".library");this.tabs={};d=this.library.find(".library-content");this.library.children("ul").children("li").each(function(){var g=c(this),h=g.data("customizeTab"),f=d.filter('[data-customize-tab="'+h+'"]');e.tabs[h]={both:g.add(f),link:g,panel:f}});this.library.children("ul").on("click keydown","li",function(g){if(g.type==="keydown"&&13!==g.which){return}var h=c(this).data("customizeTab"),f=e.tabs[h];g.preventDefault();if(f.link.hasClass("library-selected")){return}e.selected.both.removeClass("library-selected");e.selected=f;e.selected.both.addClass("library-selected")});this.library.on("click keydown","a",function(f){if(f.type==="keydown"&&13!==f.which){return}var g=c(this).data("customizeImageValue");if(g){e.setting.set(g);f.preventDefault()}});if(this.tabs.uploaded){this.tabs.uploaded.target=this.library.find(".uploaded-target");if(!this.tabs.uploaded.panel.find(".thumbnail").length){this.tabs.uploaded.both.addClass("hidden")}}d.each(function(){var f=e.tabs[c(this).data("customizeTab")];if(!f.link.hasClass("hidden")){e.selected=f;f.both.addClass("library-selected");return false}});this.dropdownInit()},success:function(d){b.UploadControl.prototype.success.call(this,d);if(this.tabs.uploaded&&this.tabs.uploaded.target.length){this.tabs.uploaded.both.removeClass("hidden");d.element=c('<a href="#" class="thumbnail"></a>').data("customizeImageValue",d.get("url")).append('<img src="'+d.get("url")+'" />').appendTo(this.tabs.uploaded.target)}},thumbnailSrc:function(d){if(/^(https?:)?\/\//.test(d)){this.thumbnail.prop("src",d).show()}else{this.thumbnail.hide()}}});b.defaultConstructor=b.Setting;b.control=new b.Values({defaultConstructor:b.Control});b.PreviewFrame=b.Messenger.extend({sensitivity:2000,initialize:function(g,f){var e=c.Deferred(),d=this;e.promise(this);this.container=g.container;this.signature=g.signature;c.extend(g,{channel:b.PreviewFrame.uuid()});b.Messenger.prototype.initialize.call(this,g,f);this.add("previewUrl",g.previewUrl);this.query=c.extend(g.query||{},{customize_messenger_channel:this.channel()});this.run(e)},run:function(e){var d=this,f=false,g=false;if(this._ready){this.unbind("ready",this._ready)}this._ready=function(){g=true;if(f){e.resolveWith(d)}};this.bind("ready",this._ready);this.request=c.ajax(this.previewUrl(),{type:"POST",data:this.query,xhrFields:{withCredentials:true}});this.request.fail(function(){e.rejectWith(d,["request failure"])});this.request.done(function(j){var i=d.request.getResponseHeader("Location"),h=d.signature,k;if(i&&i!=d.previewUrl()){e.rejectWith(d,["redirect",i]);return}if("0"===j){d.login(e);return}if("-1"===j){e.rejectWith(d,["cheatin"]);return}k=j.lastIndexOf(h);if(-1===k||k<j.lastIndexOf("</html>")){e.rejectWith(d,["unsigned"]);return}j=j.slice(0,k)+j.slice(k+h.length);d.iframe=c("<iframe />").appendTo(d.container);d.iframe.one("load",function(){f=true;if(g){e.resolveWith(d)}else{setTimeout(function(){e.rejectWith(d,["ready timeout"])},d.sensitivity)}});d.targetWindow(d.iframe[0].contentWindow);d.targetWindow().document.open();d.targetWindow().document.write(j);d.targetWindow().document.close()})},login:function(e){var d=this,f;f=function(){e.rejectWith(d,["logged out"])};if(this.triedLogin){return f()}c.get(b.settings.url.ajax,{action:"logged-in"}).fail(f).done(function(g){var h;if("1"!==g){f()}h=c('<iframe src="'+d.previewUrl()+'" />').hide();h.appendTo(d.container);h.load(function(){d.triedLogin=true;h.remove();d.run(e)})})},destroy:function(){b.Messenger.prototype.destroy.call(this);this.request.abort();if(this.iframe){this.iframe.remove()}delete this.request;delete this.iframe;delete this.targetWindow}});(function(){var d=0;b.PreviewFrame.uuid=function(){return"preview-"+d++}}());b.Previewer=b.Messenger.extend({refreshBuffer:250,initialize:function(h,f){var d=this,g=/^https?/,e;c.extend(this,f||{});this.refresh=(function(i){var j=i.refresh,l=function(){k=null;j.call(i)},k;return function(){if(typeof k!=="number"){if(i.loading){i.abort()}else{return l()}}clearTimeout(k);k=setTimeout(l,i.refreshBuffer)}})(this);this.container=b.ensure(h.container);this.allowedUrls=h.allowedUrls;this.signature=h.signature;h.url=window.location.href;b.Messenger.prototype.initialize.call(this,h);this.add("scheme",this.origin()).link(this.origin).setter(function(j){var i=j.match(g);return i?i[0]:""});this.add("previewUrl",h.previewUrl).setter(function(j){var i;if(/\/wp-admin(\/|$)/.test(j.replace(/[#?].*$/,""))){return null}c.each([j.replace(g,d.scheme()),j],function(l,k){c.each(d.allowedUrls,function(m,n){if(0===k.indexOf(n)){i=k;return false}});if(i){return false}});return i?i:null});this.previewUrl.bind(this.refresh);this.scroll=0;this.bind("scroll",function(i){this.scroll=i});this.bind("url",this.previewUrl)},query:function(){},abort:function(){if(this.loading){this.loading.destroy();delete this.loading}},refresh:function(){var d=this;this.abort();this.loading=new b.PreviewFrame({url:this.url(),previewUrl:this.previewUrl(),query:this.query()||{},container:this.container,signature:this.signature});this.loading.done(function(){this.bind("synced",function(){if(d.preview){d.preview.destroy()}d.preview=this;delete d.loading;d.targetWindow(this.targetWindow());d.channel(this.channel());d.send("active")});this.send("sync",{scroll:d.scroll,settings:b.get()})});this.loading.fail(function(f,e){if("redirect"===f&&e){d.previewUrl(e)}if("logged out"===f){if(d.preview){d.preview.destroy();delete d.preview}d.login().done(d.refresh)}if("cheatin"===f){d.cheatin()}})},login:function(){var g=this,d,f,e;if(this._login){return this._login}d=c.Deferred();this._login=d.promise();f=new b.Messenger({channel:"login",url:b.settings.url.login});e=c('<iframe src="'+b.settings.url.login+'" />').appendTo(this.container);f.targetWindow(e[0].contentWindow);f.bind("login",function(){e.remove();f.destroy();delete g._login;d.resolve()});return this._login},cheatin:function(){c(document.body).empty().addClass("cheatin").append("<p>"+b.l10n.cheatin+"</p>")}});b.controlConstructor={color:b.ColorControl,upload:b.UploadControl,image:b.ImageControl};c(function(){b.settings=window._wpCustomizeSettings;b.l10n=window._wpCustomizeControlsL10n;if(!b.settings){return}if(!c.support.postMessage||(!c.support.cors&&b.settings.isCrossDomain)){return window.location=b.settings.url.fallback}var d=c(document.body),f=d.children(".wp-full-overlay"),h,i,g;c("#customize-controls").on("keydown",function(j){if(c(j.target).is("textarea")){return}if(13===j.which){j.preventDefault()}});i=new b.Previewer({container:"#customize-preview",form:"#customize-controls",previewUrl:b.settings.url.preview,allowedUrls:b.settings.url.allowed,signature:"WP_CUSTOMIZER_SIGNATURE"},{nonce:b.settings.nonce,query:function(){return{wp_customize:"on",theme:b.settings.theme.stylesheet,customized:JSON.stringify(b.get()),nonce:this.nonce.preview}},save:function(){var j=this,l=c.extend(this.query(),{action:"customize_save",nonce:this.nonce.save}),k=c.post(b.settings.url.ajax,l);b.trigger("save",k);d.addClass("saving");k.always(function(){d.removeClass("saving")});k.done(function(m){if("0"===m){j.preview.iframe.hide();j.login().done(function(){j.save();j.preview.iframe.show()});return}if("-1"===m){j.cheatin();return}b.trigger("saved")})}});i.bind("nonce",function(j){c.extend(this.nonce,j)});c.each(b.settings.settings,function(k,j){b.create(k,k,j.value,{transport:j.transport,previewer:i})});c.each(b.settings.controls,function(m,k){var j=b.controlConstructor[k.type]||b.Control,l;l=b.control.add(m,new j(m,{params:k,previewer:i}))});if(i.previewUrl()){i.refresh()}else{i.previewUrl(b.settings.url.home)}(function(){var l=new b.Values(),k=l.create("saved"),j=l.create("activated");l.bind("change",function(){var n=c("#save"),m=c(".back");if(!j()){n.val(b.l10n.activate).prop("disabled",false);m.text(b.l10n.cancel)}else{if(k()){n.val(b.l10n.saved).prop("disabled",true);m.text(b.l10n.close)}else{n.val(b.l10n.save).prop("disabled",false);m.text(b.l10n.cancel)}}});k(true);j(b.settings.theme.active);b.bind("change",function(){l("saved").set(false)});b.bind("saved",function(){l("saved").set(true);l("activated").set(true)});j.bind(function(m){if(m){b.trigger("activated")}});b.state=l}());c("#save").click(function(j){i.save();j.preventDefault()}).keydown(function(j){if(9===j.which){return}if(13===j.which){i.save()}j.preventDefault()});c(".back").keydown(function(j){if(9===j.which){return}if(13===j.which){g.send("close")}j.preventDefault()});c(".upload-dropzone a.upload").keydown(function(j){if(13===j.which){this.click()}});c(".collapse-sidebar").on("click keydown",function(j){if(j.type==="keydown"&&13!==j.which){return}f.toggleClass("collapsed").toggleClass("expanded");j.preventDefault()});g=new b.Messenger({url:b.settings.url.parent,channel:"loader"});g.bind("back",function(){c(".back").on("click.back",function(j){j.preventDefault();g.send("close")})});b.bind("saved",function(){g.send("saved")});b.bind("activated",function(){if(g.targetWindow()){g.send("activated",b.settings.url.activated)}else{if(b.settings.url.activated){window.location=b.settings.url.activated}}});g.send("ready");c.each({background_image:{controls:["background_repeat","background_position_x","background_attachment"],callback:function(j){return !!j}},show_on_front:{controls:["page_on_front","page_for_posts"],callback:function(j){return"page"===j}},header_textcolor:{controls:["header_textcolor"],callback:function(j){return"blank"!==j}}},function(j,k){b(j,function(l){c.each(k.controls,function(m,n){b.control(n,function(p){var o=function(q){p.container.toggle(k.callback(q))};o(l.get());l.bind(o)})})})});b.control("display_header_text",function(k){var j="";k.elements[0].unsync(b("header_textcolor"));k.element=new b.Element(k.container.find("input"));k.element.set("blank"!==k.setting());k.element.bind(function(l){if(!l){j=b("header_textcolor").get()}k.setting.set(l?j:"blank")});k.setting.bind(function(l){k.element.set("blank"!==l)})});b.control("header_image",function(j){j.setting.bind(function(k){if(k===j.params.removed){j.settings.data.set(false)}});j.library.on("click","a",function(k){j.settings.data.set(c(this).data("customizeHeaderImageData"))});j.uploader.success=function(l){var k;b.ImageControl.prototype.success.call(j,l);k={attachment_id:l.get("id"),url:l.get("url"),thumbnail_url:l.get("url"),height:l.get("height"),width:l.get("width")};l.element.data("customizeHeaderImageData",k);j.settings.data.set(k)}});b.trigger("ready");var e=c(".back");e.focus();setTimeout(function(){e.focus()},200)})})(wp,jQuery);
\ No newline at end of file
index 675ffd94b0eb66da55ffd1b8d497bff70e2c46c2..e54e836cc20fda35790f732022bd534ac35eeef6 100644 (file)
@@ -49,8 +49,15 @@ var switchEditors = {
                        if ( ed && ed.isHidden() )
                                return false;
 
-                       if ( ed )
+                       if ( ed ) {
                                ed.hide();
+                       } else {
+                               // The TinyMCE instance doesn't exist, run the content through "pre_wpautop()" and show the textarea
+                               if ( tinyMCEPreInit.mceInit[id] && tinyMCEPreInit.mceInit[id].wpautop )
+                                       txtarea_el.value = t.pre_wpautop( txtarea_el.value );
+
+                               dom.setStyles(txtarea_el, {'display': '', 'visibility': ''});
+                       }
 
                        dom.removeClass(wrap_id, 'tmce-active');
                        dom.addClass(wrap_id, 'html-active');
@@ -138,7 +145,7 @@ var switchEditors = {
 
        _wp_Autop : function(pee) {
                var preserve_linebreaks = false, preserve_br = false,
-                       blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|noscript|samp|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary';
+                       blocklist = 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|noscript|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary';
 
                if ( pee.indexOf('<object') != -1 ) {
                        pee = pee.replace(/<object[\s\S]+?<\/object>/g, function(a){
index 70cca04b328729fe4824727c1ceb384db1e7613b..4a7e79937cadad1d7ea198184224f7b1e8150e2e 100644 (file)
@@ -1 +1 @@
-var switchEditors={switchto:function(b){var c=b.id,a=c.length,e=c.substr(0,a-5),d=c.substr(a-4);this.go(e,d)},go:function(g,f){g=g||"content";f=f||"toggle";var c=this,b=tinyMCE.get(g),a,d,e=tinymce.DOM;a="wp-"+g+"-wrap";d=e.get(g);if("toggle"==f){if(b&&!b.isHidden()){f="html"}else{f="tmce"}}if("tmce"==f||"tinymce"==f){if(b&&!b.isHidden()){return false}if(typeof(QTags)!="undefined"){QTags.closeAllTags(g)}if(tinyMCEPreInit.mceInit[g]&&tinyMCEPreInit.mceInit[g].wpautop){d.value=c.wpautop(d.value)}if(b){b.show()}else{b=new tinymce.Editor(g,tinyMCEPreInit.mceInit[g]);b.render()}e.removeClass(a,"html-active");e.addClass(a,"tmce-active");setUserSetting("editor","tinymce")}else{if("html"==f){if(b&&b.isHidden()){return false}if(b){b.hide()}e.removeClass(a,"tmce-active");e.addClass(a,"html-active");setUserSetting("editor","html")}}return false},_wp_Nop:function(c){var d,b,e=false,a=false;if(c.indexOf("<pre")!=-1||c.indexOf("<script")!=-1){e=true;c=c.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(f){f=f.replace(/<br ?\/?>(\r\n|\n)?/g,"<wp-temp-lb>");return f.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"<wp-temp-lb>")})}if(c.indexOf("[caption")!=-1){a=true;c=c.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(f){return f.replace(/<br([^>]*)>/g,"<wp-temp-br$1>").replace(/[\r\n\t]+/,"")})}d="blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p|fieldset";c=c.replace(new RegExp("\\s*</("+d+")>\\s*","g"),"</$1>\n");c=c.replace(new RegExp("\\s*<((?:"+d+")(?: [^>]*)?)>","g"),"\n<$1>");c=c.replace(/(<p [^>]+>.*?)<\/p>/g,"$1</p#>");c=c.replace(/<div( [^>]*)?>\s*<p>/gi,"<div$1>\n\n");c=c.replace(/\s*<p>/gi,"");c=c.replace(/\s*<\/p>\s*/gi,"\n\n");c=c.replace(/\n[\s\u00a0]+\n/g,"\n\n");c=c.replace(/\s*<br ?\/?>\s*/gi,"\n");c=c.replace(/\s*<div/g,"\n<div");c=c.replace(/<\/div>\s*/g,"</div>\n");c=c.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n");c=c.replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption");b="blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|pre|fieldset";c=c.replace(new RegExp("\\s*<((?:"+b+")(?: [^>]*)?)\\s*>","g"),"\n<$1>");c=c.replace(new RegExp("\\s*</("+b+")>\\s*","g"),"</$1>\n");c=c.replace(/<li([^>]*)>/g,"\t<li$1>");if(c.indexOf("<hr")!=-1){c=c.replace(/\s*<hr( [^>]*)?>\s*/g,"\n\n<hr$1>\n\n")}if(c.indexOf("<object")!=-1){c=c.replace(/<object[\s\S]+?<\/object>/g,function(f){return f.replace(/[\r\n]+/g,"")})}c=c.replace(/<\/p#>/g,"</p>\n");c=c.replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g,"\n$1");c=c.replace(/^\s+/,"");c=c.replace(/[\s\u00a0]+$/,"");if(e){c=c.replace(/<wp-temp-lb>/g,"\n")}if(a){c=c.replace(/<wp-temp-br([^>]*)>/g,"<br$1>")}return c},_wp_Autop:function(a){var c=false,b=false,d="table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|noscript|samp|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary";if(a.indexOf("<object")!=-1){a=a.replace(/<object[\s\S]+?<\/object>/g,function(e){return e.replace(/[\r\n]+/g,"")})}a=a.replace(/<[^<>]+>/g,function(e){return e.replace(/[\r\n]+/g," ")});if(a.indexOf("<pre")!=-1||a.indexOf("<script")!=-1){c=true;a=a.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(e){return e.replace(/(\r\n|\n)/g,"<wp-temp-lb>")})}if(a.indexOf("[caption")!=-1){b=true;a=a.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(e){e=e.replace(/<br([^>]*)>/g,"<wp-temp-br$1>");e=e.replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g,function(f){return f.replace(/[\r\n\t]+/," ")});return e.replace(/\s*\n\s*/g,"<wp-temp-br />")})}a=a+"\n\n";a=a.replace(/<br \/>\s*<br \/>/gi,"\n\n");a=a.replace(new RegExp("(<(?:"+d+")(?: [^>]*)?>)","gi"),"\n$1");a=a.replace(new RegExp("(</(?:"+d+")>)","gi"),"$1\n\n");a=a.replace(/<hr( [^>]*)?>/gi,"<hr$1>\n\n");a=a.replace(/\r\n|\r/g,"\n");a=a.replace(/\n\s*\n+/g,"\n\n");a=a.replace(/([\s\S]+?)\n\n/g,"<p>$1</p>\n");a=a.replace(/<p>\s*?<\/p>/gi,"");a=a.replace(new RegExp("<p>\\s*(</?(?:"+d+")(?: [^>]*)?>)\\s*</p>","gi"),"$1");a=a.replace(/<p>(<li.+?)<\/p>/gi,"$1");a=a.replace(/<p>\s*<blockquote([^>]*)>/gi,"<blockquote$1><p>");a=a.replace(/<\/blockquote>\s*<\/p>/gi,"</p></blockquote>");a=a.replace(new RegExp("<p>\\s*(</?(?:"+d+")(?: [^>]*)?>)","gi"),"$1");a=a.replace(new RegExp("(</?(?:"+d+")(?: [^>]*)?>)\\s*</p>","gi"),"$1");a=a.replace(/\s*\n/gi,"<br />\n");a=a.replace(new RegExp("(</?(?:"+d+")[^>]*>)\\s*<br />","gi"),"$1");a=a.replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi,"$1");a=a.replace(/(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi,"[caption$1[/caption]");a=a.replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g,function(f,e,g){if(g.match(/<p( [^>]*)?>/)){return f}return e+"<p>"+g+"</p>"});if(c){a=a.replace(/<wp-temp-lb>/g,"\n")}if(b){a=a.replace(/<wp-temp-br([^>]*)>/g,"<br$1>")}return a},pre_wpautop:function(b){var a=this,d={o:a,data:b,unfiltered:b},c=typeof(jQuery)!="undefined";if(c){jQuery("body").trigger("beforePreWpautop",[d])}d.data=a._wp_Nop(d.data);if(c){jQuery("body").trigger("afterPreWpautop",[d])}return d.data},wpautop:function(b){var a=this,d={o:a,data:b,unfiltered:b},c=typeof(jQuery)!="undefined";if(c){jQuery("body").trigger("beforeWpautop",[d])}d.data=a._wp_Autop(d.data);if(c){jQuery("body").trigger("afterWpautop",[d])}return d.data}};
\ No newline at end of file
+var switchEditors={switchto:function(b){var c=b.id,a=c.length,e=c.substr(0,a-5),d=c.substr(a-4);this.go(e,d)},go:function(g,f){g=g||"content";f=f||"toggle";var c=this,b=tinyMCE.get(g),a,d,e=tinymce.DOM;a="wp-"+g+"-wrap";d=e.get(g);if("toggle"==f){if(b&&!b.isHidden()){f="html"}else{f="tmce"}}if("tmce"==f||"tinymce"==f){if(b&&!b.isHidden()){return false}if(typeof(QTags)!="undefined"){QTags.closeAllTags(g)}if(tinyMCEPreInit.mceInit[g]&&tinyMCEPreInit.mceInit[g].wpautop){d.value=c.wpautop(d.value)}if(b){b.show()}else{b=new tinymce.Editor(g,tinyMCEPreInit.mceInit[g]);b.render()}e.removeClass(a,"html-active");e.addClass(a,"tmce-active");setUserSetting("editor","tinymce")}else{if("html"==f){if(b&&b.isHidden()){return false}if(b){b.hide()}else{if(tinyMCEPreInit.mceInit[g]&&tinyMCEPreInit.mceInit[g].wpautop){d.value=c.pre_wpautop(d.value)}e.setStyles(d,{display:"",visibility:""})}e.removeClass(a,"tmce-active");e.addClass(a,"html-active");setUserSetting("editor","html")}}return false},_wp_Nop:function(c){var d,b,e=false,a=false;if(c.indexOf("<pre")!=-1||c.indexOf("<script")!=-1){e=true;c=c.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(f){f=f.replace(/<br ?\/?>(\r\n|\n)?/g,"<wp-temp-lb>");return f.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g,"<wp-temp-lb>")})}if(c.indexOf("[caption")!=-1){a=true;c=c.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(f){return f.replace(/<br([^>]*)>/g,"<wp-temp-br$1>").replace(/[\r\n\t]+/,"")})}d="blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|div|h[1-6]|p|fieldset";c=c.replace(new RegExp("\\s*</("+d+")>\\s*","g"),"</$1>\n");c=c.replace(new RegExp("\\s*<((?:"+d+")(?: [^>]*)?)>","g"),"\n<$1>");c=c.replace(/(<p [^>]+>.*?)<\/p>/g,"$1</p#>");c=c.replace(/<div( [^>]*)?>\s*<p>/gi,"<div$1>\n\n");c=c.replace(/\s*<p>/gi,"");c=c.replace(/\s*<\/p>\s*/gi,"\n\n");c=c.replace(/\n[\s\u00a0]+\n/g,"\n\n");c=c.replace(/\s*<br ?\/?>\s*/gi,"\n");c=c.replace(/\s*<div/g,"\n<div");c=c.replace(/<\/div>\s*/g,"</div>\n");c=c.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi,"\n\n[caption$1[/caption]\n\n");c=c.replace(/caption\]\n\n+\[caption/g,"caption]\n\n[caption");b="blockquote|ul|ol|li|table|thead|tbody|tfoot|tr|th|td|h[1-6]|pre|fieldset";c=c.replace(new RegExp("\\s*<((?:"+b+")(?: [^>]*)?)\\s*>","g"),"\n<$1>");c=c.replace(new RegExp("\\s*</("+b+")>\\s*","g"),"</$1>\n");c=c.replace(/<li([^>]*)>/g,"\t<li$1>");if(c.indexOf("<hr")!=-1){c=c.replace(/\s*<hr( [^>]*)?>\s*/g,"\n\n<hr$1>\n\n")}if(c.indexOf("<object")!=-1){c=c.replace(/<object[\s\S]+?<\/object>/g,function(f){return f.replace(/[\r\n]+/g,"")})}c=c.replace(/<\/p#>/g,"</p>\n");c=c.replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g,"\n$1");c=c.replace(/^\s+/,"");c=c.replace(/[\s\u00a0]+$/,"");if(e){c=c.replace(/<wp-temp-lb>/g,"\n")}if(a){c=c.replace(/<wp-temp-br([^>]*)>/g,"<br$1>")}return c},_wp_Autop:function(a){var c=false,b=false,d="table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|noscript|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary";if(a.indexOf("<object")!=-1){a=a.replace(/<object[\s\S]+?<\/object>/g,function(e){return e.replace(/[\r\n]+/g,"")})}a=a.replace(/<[^<>]+>/g,function(e){return e.replace(/[\r\n]+/g," ")});if(a.indexOf("<pre")!=-1||a.indexOf("<script")!=-1){c=true;a=a.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g,function(e){return e.replace(/(\r\n|\n)/g,"<wp-temp-lb>")})}if(a.indexOf("[caption")!=-1){b=true;a=a.replace(/\[caption[\s\S]+?\[\/caption\]/g,function(e){e=e.replace(/<br([^>]*)>/g,"<wp-temp-br$1>");e=e.replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g,function(f){return f.replace(/[\r\n\t]+/," ")});return e.replace(/\s*\n\s*/g,"<wp-temp-br />")})}a=a+"\n\n";a=a.replace(/<br \/>\s*<br \/>/gi,"\n\n");a=a.replace(new RegExp("(<(?:"+d+")(?: [^>]*)?>)","gi"),"\n$1");a=a.replace(new RegExp("(</(?:"+d+")>)","gi"),"$1\n\n");a=a.replace(/<hr( [^>]*)?>/gi,"<hr$1>\n\n");a=a.replace(/\r\n|\r/g,"\n");a=a.replace(/\n\s*\n+/g,"\n\n");a=a.replace(/([\s\S]+?)\n\n/g,"<p>$1</p>\n");a=a.replace(/<p>\s*?<\/p>/gi,"");a=a.replace(new RegExp("<p>\\s*(</?(?:"+d+")(?: [^>]*)?>)\\s*</p>","gi"),"$1");a=a.replace(/<p>(<li.+?)<\/p>/gi,"$1");a=a.replace(/<p>\s*<blockquote([^>]*)>/gi,"<blockquote$1><p>");a=a.replace(/<\/blockquote>\s*<\/p>/gi,"</p></blockquote>");a=a.replace(new RegExp("<p>\\s*(</?(?:"+d+")(?: [^>]*)?>)","gi"),"$1");a=a.replace(new RegExp("(</?(?:"+d+")(?: [^>]*)?>)\\s*</p>","gi"),"$1");a=a.replace(/\s*\n/gi,"<br />\n");a=a.replace(new RegExp("(</?(?:"+d+")[^>]*>)\\s*<br />","gi"),"$1");a=a.replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)/gi,"$1");a=a.replace(/(?:<p>|<br ?\/?>)*\s*\[caption([^\[]+)\[\/caption\]\s*(?:<\/p>|<br ?\/?>)*/gi,"[caption$1[/caption]");a=a.replace(/(<(?:div|th|td|form|fieldset|dd)[^>]*>)(.*?)<\/p>/g,function(f,e,g){if(g.match(/<p( [^>]*)?>/)){return f}return e+"<p>"+g+"</p>"});if(c){a=a.replace(/<wp-temp-lb>/g,"\n")}if(b){a=a.replace(/<wp-temp-br([^>]*)>/g,"<br$1>")}return a},pre_wpautop:function(b){var a=this,d={o:a,data:b,unfiltered:b},c=typeof(jQuery)!="undefined";if(c){jQuery("body").trigger("beforePreWpautop",[d])}d.data=a._wp_Nop(d.data);if(c){jQuery("body").trigger("afterPreWpautop",[d])}return d.data},wpautop:function(b){var a=this,d={o:a,data:b,unfiltered:b},c=typeof(jQuery)!="undefined";if(c){jQuery("body").trigger("beforeWpautop",[d])}d.data=a._wp_Autop(d.data);if(c){jQuery("body").trigger("afterWpautop",[d])}return d.data}};
\ No newline at end of file
index 9abf478ada6fcf9db21d78e796c386c282e45ff3..8076c31e09ae10f88e3fc5af1899eb9d59407d00 100644 (file)
@@ -42,7 +42,7 @@ inlineEditPost = {
                });
 
                // add events
-               $('a.editinline').live('click', function(){
+               $('#the-list').on('click', 'a.editinline', function(){
                        inlineEditPost.edit(this);
                        return false;
                });
@@ -53,15 +53,6 @@ inlineEditPost = {
                        $('#inline-edit label.inline-edit-tags').clone()
                );
 
-               // hiearchical taxonomies expandable?
-               $('span.catshow').click(function(){
-                       $(this).hide().next().show().parent().next().addClass("cat-hover");
-               });
-
-               $('span.cathide').click(function(){
-                       $(this).hide().prev().show().parent().next().removeClass("cat-hover");
-               });
-
                $('select[name="_status"] option[value="future"]', bulkRow).remove();
 
                $('#doaction, #doaction2').click(function(e){
@@ -299,5 +290,42 @@ inlineEditPost = {
        }
 };
 
-$(document).ready(function(){inlineEditPost.init();});
-})(jQuery);
+$( document ).ready( function(){ inlineEditPost.init(); } );
+
+// Show/hide locks on posts
+$( document ).on( 'heartbeat-tick.wp-check-locked-posts', function( e, data ) {
+       var locked = data['wp-check-locked-posts'] || {};
+
+       $('#the-list tr').each( function(i, el) {
+               var key = el.id, row = $(el), lock_data, avatar;
+
+               if ( locked.hasOwnProperty( key ) ) {
+                       if ( ! row.hasClass('wp-locked') ) {
+                               lock_data = locked[key];
+                               row.find('.column-title .locked-text').text( lock_data.text );
+                               row.find('.check-column checkbox').prop('checked', false);
+
+                               if ( lock_data.avatar_src ) {
+                                       avatar = $('<img class="avatar avatar-18 photo" width="18" height="18" />').attr( 'src', lock_data.avatar_src.replace(/&amp;/g, '&') );
+                                       row.find('.column-title .locked-avatar').empty().append( avatar );
+                               }
+                               row.addClass('wp-locked');
+                       }
+               } else if ( row.hasClass('wp-locked') ) {
+                       // Make room for the CSS animation
+                       row.removeClass('wp-locked').delay(1000).find('.locked-info span').empty();
+               }
+       });
+}).on( 'heartbeat-send.wp-check-locked-posts', function( e, data ) {
+       var check = [];
+
+       $('#the-list tr').each( function(i, el) {
+               if ( el.id )
+                       check.push( el.id );
+       });
+
+       if ( check.length )
+               data['wp-check-locked-posts'] = check;
+});
+
+}(jQuery));
index 6f1cc3f6eb798584868bcd0993447682b7a271ed..6bdb41454baf8760ec5df68875a63bc82019ad30 100644 (file)
@@ -1 +1 @@
-(function(a){inlineEditPost={init:function(){var c=this,d=a("#inline-edit"),b=a("#bulk-edit");c.type=a("table.widefat").hasClass("pages")?"page":"post";c.what="#post-";d.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});b.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});a("a.cancel",d).click(function(){return inlineEditPost.revert()});a("a.save",d).click(function(){return inlineEditPost.save(this)});a("td",d).keydown(function(f){if(f.which==13){return inlineEditPost.save(this)}});a("a.cancel",b).click(function(){return inlineEditPost.revert()});a('#inline-edit .inline-edit-private input[value="private"]').click(function(){var e=a("input.inline-edit-password-input");if(a(this).prop("checked")){e.val("").prop("disabled",true)}else{e.prop("disabled",false)}});a("a.editinline").live("click",function(){inlineEditPost.edit(this);return false});a("#bulk-title-div").parents("fieldset").after(a("#inline-edit fieldset.inline-edit-categories").clone()).siblings("fieldset:last").prepend(a("#inline-edit label.inline-edit-tags").clone());a("span.catshow").click(function(){a(this).hide().next().show().parent().next().addClass("cat-hover")});a("span.cathide").click(function(){a(this).hide().prev().show().parent().next().removeClass("cat-hover")});a('select[name="_status"] option[value="future"]',b).remove();a("#doaction, #doaction2").click(function(f){var g=a(this).attr("id").substr(2);if(a('select[name="'+g+'"]').val()=="edit"){f.preventDefault();c.setBulk()}else{if(a("form#posts-filter tr.inline-editor").length>0){c.revert()}}});a("#post-query-submit").mousedown(function(f){c.revert();a('select[name^="action"]').val("-1")})},toggle:function(c){var b=this;a(b.what+b.getId(c)).css("display")=="none"?b.revert():b.edit(c)},setBulk:function(){var e="",d=this.type,b,f=true;this.revert();a("#bulk-edit td").attr("colspan",a(".widefat:first thead th:visible").length);a("table.widefat tbody").prepend(a("#bulk-edit"));a("#bulk-edit").addClass("inline-editor").show();a('tbody th.check-column input[type="checkbox"]').each(function(g){if(a(this).prop("checked")){f=false;var h=a(this).val(),c;c=a("#inline_"+h+" .post_title").html()||inlineEditL10n.notitle;e+='<div id="ttle'+h+'"><a id="_'+h+'" class="ntdelbutton" title="'+inlineEditL10n.ntdeltitle+'">X</a>'+c+"</div>"}});if(f){return this.revert()}a("#bulk-titles").html(e);a("#bulk-titles a").click(function(){var c=a(this).attr("id").substr(1);a('table.widefat input[value="'+c+'"]').prop("checked",false);a("#ttle"+c).remove()});if("post"==d){b="post_tag";a('tr.inline-editor textarea[name="tax_input['+b+']"]').suggest(ajaxurl+"?action=ajax-tag-search&tax="+b,{delay:500,minchars:2,multiple:true,multipleSep:inlineEditL10n.comma+" "})}a("html, body").animate({scrollTop:0},"fast")},edit:function(c){var n=this,j,e,g,i,h,m,l,d=true,o,b,k;n.revert();if(typeof(c)=="object"){c=n.getId(c)}j=["post_title","post_name","post_author","_status","jj","mm","aa","hh","mn","ss","post_password","post_format","menu_order"];if(n.type=="page"){j.push("post_parent","page_template")}e=a("#inline-edit").clone(true);a("td",e).attr("colspan",a(".widefat:first thead th:visible").length);if(a(n.what+c).hasClass("alternate")){a(e).addClass("alternate")}a(n.what+c).hide().after(e);g=a("#inline_"+c);if(!a(':input[name="post_author"] option[value="'+a(".post_author",g).text()+'"]',e).val()){a(':input[name="post_author"]',e).prepend('<option value="'+a(".post_author",g).text()+'">'+a("#"+n.type+"-"+c+" .author").text()+"</option>")}if(a(':input[name="post_author"] option',e).length==1){a("label.inline-edit-author",e).hide()}b=a(".post_format",g).text();a("option.unsupported",e).each(function(){var f=a(this);if(f.val()!=b){f.remove()}});for(k=0;k<j.length;k++){a(':input[name="'+j[k]+'"]',e).val(a("."+j[k],g).text())}if(a(".comment_status",g).text()=="open"){a('input[name="comment_status"]',e).prop("checked",true)}if(a(".ping_status",g).text()=="open"){a('input[name="ping_status"]',e).prop("checked",true)}if(a(".sticky",g).text()=="sticky"){a('input[name="sticky"]',e).prop("checked",true)}a(".post_category",g).each(function(){var f=a(this).text();if(f){taxname=a(this).attr("id").replace("_"+c,"");a("ul."+taxname+"-checklist :checkbox",e).val(f.split(","))}});a(".tags_input",g).each(function(){var q=a(this).text(),r=a(this).attr("id").replace("_"+c,""),p=a("textarea.tax_input_"+r,e),f=inlineEditL10n.comma;if(q){if(","!==f){q=q.replace(/,/g,f)}p.val(q)}p.suggest(ajaxurl+"?action=ajax-tag-search&tax="+r,{delay:500,minchars:2,multiple:true,multipleSep:inlineEditL10n.comma+" "})});i=a("._status",g).text();if("future"!=i){a('select[name="_status"] option[value="future"]',e).remove()}if("private"==i){a('input[name="keep_private"]',e).prop("checked",true);a("input.inline-edit-password-input").val("").prop("disabled",true)}h=a('select[name="post_parent"] option[value="'+c+'"]',e);if(h.length>0){m=h[0].className.split("-")[1];l=h;while(d){l=l.next("option");if(l.length==0){break}o=l[0].className.split("-")[1];if(o<=m){d=false}else{l.remove();l=h}}h.remove()}a(e).attr("id","edit-"+c).addClass("inline-editor").show();a(".ptitle",e).focus();return false},save:function(e){var d,b,c=a(".post_status_page").val()||"";if(typeof(e)=="object"){e=this.getId(e)}a("table.widefat .spinner").show();d={action:"inline-save",post_type:typenow,post_ID:e,edit_date:"true",post_status:c};b=a("#edit-"+e+" :input").serialize();d=b+"&"+a.param(d);a.post(ajaxurl,d,function(f){a("table.widefat .spinner").hide();if(f){if(-1!=f.indexOf("<tr")){a(inlineEditPost.what+e).remove();a("#edit-"+e).before(f).remove();a(inlineEditPost.what+e).hide().fadeIn()}else{f=f.replace(/<.[^<>]*?>/g,"");a("#edit-"+e+" .inline-edit-save .error").html(f).show()}}else{a("#edit-"+e+" .inline-edit-save .error").html(inlineEditL10n.error).show()}},"html");return false},revert:function(){var b=a("table.widefat tr.inline-editor").attr("id");if(b){a("table.widefat .spinner").hide();if("bulk-edit"==b){a("table.widefat #bulk-edit").removeClass("inline-editor").hide();a("#bulk-titles").html("");a("#inlineedit").append(a("#bulk-edit"))}else{a("#"+b).remove();b=b.substr(b.lastIndexOf("-")+1);a(this.what+b).show()}}return false},getId:function(c){var d=a(c).closest("tr").attr("id"),b=d.split("-");return b[b.length-1]}};a(document).ready(function(){inlineEditPost.init()})})(jQuery);
\ No newline at end of file
+(function(a){inlineEditPost={init:function(){var c=this,d=a("#inline-edit"),b=a("#bulk-edit");c.type=a("table.widefat").hasClass("pages")?"page":"post";c.what="#post-";d.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});b.keyup(function(f){if(f.which==27){return inlineEditPost.revert()}});a("a.cancel",d).click(function(){return inlineEditPost.revert()});a("a.save",d).click(function(){return inlineEditPost.save(this)});a("td",d).keydown(function(f){if(f.which==13){return inlineEditPost.save(this)}});a("a.cancel",b).click(function(){return inlineEditPost.revert()});a('#inline-edit .inline-edit-private input[value="private"]').click(function(){var e=a("input.inline-edit-password-input");if(a(this).prop("checked")){e.val("").prop("disabled",true)}else{e.prop("disabled",false)}});a("#the-list").on("click","a.editinline",function(){inlineEditPost.edit(this);return false});a("#bulk-title-div").parents("fieldset").after(a("#inline-edit fieldset.inline-edit-categories").clone()).siblings("fieldset:last").prepend(a("#inline-edit label.inline-edit-tags").clone());a('select[name="_status"] option[value="future"]',b).remove();a("#doaction, #doaction2").click(function(f){var g=a(this).attr("id").substr(2);if(a('select[name="'+g+'"]').val()=="edit"){f.preventDefault();c.setBulk()}else{if(a("form#posts-filter tr.inline-editor").length>0){c.revert()}}});a("#post-query-submit").mousedown(function(f){c.revert();a('select[name^="action"]').val("-1")})},toggle:function(c){var b=this;a(b.what+b.getId(c)).css("display")=="none"?b.revert():b.edit(c)},setBulk:function(){var e="",d=this.type,b,f=true;this.revert();a("#bulk-edit td").attr("colspan",a(".widefat:first thead th:visible").length);a("table.widefat tbody").prepend(a("#bulk-edit"));a("#bulk-edit").addClass("inline-editor").show();a('tbody th.check-column input[type="checkbox"]').each(function(g){if(a(this).prop("checked")){f=false;var h=a(this).val(),c;c=a("#inline_"+h+" .post_title").html()||inlineEditL10n.notitle;e+='<div id="ttle'+h+'"><a id="_'+h+'" class="ntdelbutton" title="'+inlineEditL10n.ntdeltitle+'">X</a>'+c+"</div>"}});if(f){return this.revert()}a("#bulk-titles").html(e);a("#bulk-titles a").click(function(){var c=a(this).attr("id").substr(1);a('table.widefat input[value="'+c+'"]').prop("checked",false);a("#ttle"+c).remove()});if("post"==d){b="post_tag";a('tr.inline-editor textarea[name="tax_input['+b+']"]').suggest(ajaxurl+"?action=ajax-tag-search&tax="+b,{delay:500,minchars:2,multiple:true,multipleSep:inlineEditL10n.comma+" "})}a("html, body").animate({scrollTop:0},"fast")},edit:function(c){var n=this,j,e,g,i,h,m,l,d=true,o,b,k;n.revert();if(typeof(c)=="object"){c=n.getId(c)}j=["post_title","post_name","post_author","_status","jj","mm","aa","hh","mn","ss","post_password","post_format","menu_order"];if(n.type=="page"){j.push("post_parent","page_template")}e=a("#inline-edit").clone(true);a("td",e).attr("colspan",a(".widefat:first thead th:visible").length);if(a(n.what+c).hasClass("alternate")){a(e).addClass("alternate")}a(n.what+c).hide().after(e);g=a("#inline_"+c);if(!a(':input[name="post_author"] option[value="'+a(".post_author",g).text()+'"]',e).val()){a(':input[name="post_author"]',e).prepend('<option value="'+a(".post_author",g).text()+'">'+a("#"+n.type+"-"+c+" .author").text()+"</option>")}if(a(':input[name="post_author"] option',e).length==1){a("label.inline-edit-author",e).hide()}b=a(".post_format",g).text();a("option.unsupported",e).each(function(){var f=a(this);if(f.val()!=b){f.remove()}});for(k=0;k<j.length;k++){a(':input[name="'+j[k]+'"]',e).val(a("."+j[k],g).text())}if(a(".comment_status",g).text()=="open"){a('input[name="comment_status"]',e).prop("checked",true)}if(a(".ping_status",g).text()=="open"){a('input[name="ping_status"]',e).prop("checked",true)}if(a(".sticky",g).text()=="sticky"){a('input[name="sticky"]',e).prop("checked",true)}a(".post_category",g).each(function(){var f=a(this).text();if(f){taxname=a(this).attr("id").replace("_"+c,"");a("ul."+taxname+"-checklist :checkbox",e).val(f.split(","))}});a(".tags_input",g).each(function(){var q=a(this).text(),r=a(this).attr("id").replace("_"+c,""),p=a("textarea.tax_input_"+r,e),f=inlineEditL10n.comma;if(q){if(","!==f){q=q.replace(/,/g,f)}p.val(q)}p.suggest(ajaxurl+"?action=ajax-tag-search&tax="+r,{delay:500,minchars:2,multiple:true,multipleSep:inlineEditL10n.comma+" "})});i=a("._status",g).text();if("future"!=i){a('select[name="_status"] option[value="future"]',e).remove()}if("private"==i){a('input[name="keep_private"]',e).prop("checked",true);a("input.inline-edit-password-input").val("").prop("disabled",true)}h=a('select[name="post_parent"] option[value="'+c+'"]',e);if(h.length>0){m=h[0].className.split("-")[1];l=h;while(d){l=l.next("option");if(l.length==0){break}o=l[0].className.split("-")[1];if(o<=m){d=false}else{l.remove();l=h}}h.remove()}a(e).attr("id","edit-"+c).addClass("inline-editor").show();a(".ptitle",e).focus();return false},save:function(e){var d,b,c=a(".post_status_page").val()||"";if(typeof(e)=="object"){e=this.getId(e)}a("table.widefat .spinner").show();d={action:"inline-save",post_type:typenow,post_ID:e,edit_date:"true",post_status:c};b=a("#edit-"+e+" :input").serialize();d=b+"&"+a.param(d);a.post(ajaxurl,d,function(f){a("table.widefat .spinner").hide();if(f){if(-1!=f.indexOf("<tr")){a(inlineEditPost.what+e).remove();a("#edit-"+e).before(f).remove();a(inlineEditPost.what+e).hide().fadeIn()}else{f=f.replace(/<.[^<>]*?>/g,"");a("#edit-"+e+" .inline-edit-save .error").html(f).show()}}else{a("#edit-"+e+" .inline-edit-save .error").html(inlineEditL10n.error).show()}},"html");return false},revert:function(){var b=a("table.widefat tr.inline-editor").attr("id");if(b){a("table.widefat .spinner").hide();if("bulk-edit"==b){a("table.widefat #bulk-edit").removeClass("inline-editor").hide();a("#bulk-titles").html("");a("#inlineedit").append(a("#bulk-edit"))}else{a("#"+b).remove();b=b.substr(b.lastIndexOf("-")+1);a(this.what+b).show()}}return false},getId:function(c){var d=a(c).closest("tr").attr("id"),b=d.split("-");return b[b.length-1]}};a(document).ready(function(){inlineEditPost.init()});a(document).on("heartbeat-tick.wp-check-locked-posts",function(d,c){var b=c["wp-check-locked-posts"]||{};a("#the-list tr").each(function(g,h){var f=h.id,k=a(h),j,e;if(b.hasOwnProperty(f)){if(!k.hasClass("wp-locked")){j=b[f];k.find(".column-title .locked-text").text(j.text);k.find(".check-column checkbox").prop("checked",false);if(j.avatar_src){e=a('<img class="avatar avatar-18 photo" width="18" height="18" />').attr("src",j.avatar_src.replace(/&amp;/g,"&"));k.find(".column-title .locked-avatar").empty().append(e)}k.addClass("wp-locked")}}else{if(k.hasClass("wp-locked")){k.removeClass("wp-locked").delay(1000).find(".locked-info span").empty()}}})}).on("heartbeat-send.wp-check-locked-posts",function(d,c){var b=[];a("#the-list tr").each(function(e,f){if(f.id){b.push(f.id)}});if(b.length){c["wp-check-locked-posts"]=b}})}(jQuery));
\ No newline at end of file
index 76adab4f648eb260eb822f995b75922f96d29393..6d5293ac3cc7a37efdc9e046823a16101781d5ff 100644 (file)
@@ -8,7 +8,7 @@ inlineEditTax = {
                t.type = $('#the-list').attr('data-wp-lists').substr(5);
                t.what = '#'+t.type+'-';
 
-               $('.editinline').live('click', function(){
+               $('#the-list').on('click', 'a.editinline', function(){
                        inlineEditTax.edit(this);
                        return false;
                });
index 649abdbe98e5a1d724d3089451e01a1e12cb21e2..f7a9e4c931602c1e409f0563853cbd32bce6cfb6 100644 (file)
@@ -1 +1 @@
-(function(a){inlineEditTax={init:function(){var b=this,c=a("#inline-edit");b.type=a("#the-list").attr("data-wp-lists").substr(5);b.what="#"+b.type+"-";a(".editinline").live("click",function(){inlineEditTax.edit(this);return false});c.keyup(function(d){if(d.which==27){return inlineEditTax.revert()}});a("a.cancel",c).click(function(){return inlineEditTax.revert()});a("a.save",c).click(function(){return inlineEditTax.save(this)});a("input, select",c).keydown(function(d){if(d.which==13){return inlineEditTax.save(this)}});a('#posts-filter input[type="submit"]').mousedown(function(d){b.revert()})},toggle:function(c){var b=this;a(b.what+b.getId(c)).css("display")=="none"?b.revert():b.edit(c)},edit:function(d){var c=this,b;c.revert();if(typeof(d)=="object"){d=c.getId(d)}b=a("#inline-edit").clone(true),rowData=a("#inline_"+d);a("td",b).attr("colspan",a(".widefat:first thead th:visible").length);if(a(c.what+d).hasClass("alternate")){a(b).addClass("alternate")}a(c.what+d).hide().after(b);a(':input[name="name"]',b).val(a(".name",rowData).text());a(':input[name="slug"]',b).val(a(".slug",rowData).text());a(b).attr("id","edit-"+d).addClass("inline-editor").show();a(".ptitle",b).eq(0).focus();return false},save:function(e){var d,b,c=a('input[name="taxonomy"]').val()||"";if(typeof(e)=="object"){e=this.getId(e)}a("table.widefat .spinner").show();d={action:"inline-save-tax",tax_type:this.type,tax_ID:e,taxonomy:c};b=a("#edit-"+e+" :input").serialize();d=b+"&"+a.param(d);a.post(ajaxurl,d,function(g){var h,f;a("table.widefat .spinner").hide();if(g){if(-1!=g.indexOf("<tr")){a(inlineEditTax.what+e).remove();f=a(g).attr("id");a("#edit-"+e).before(g).remove();h=f?a("#"+f):a(inlineEditTax.what+e);h.hide().fadeIn()}else{a("#edit-"+e+" .inline-edit-save .error").html(g).show()}}else{a("#edit-"+e+" .inline-edit-save .error").html(inlineEditL10n.error).show()}});return false},revert:function(){var b=a("table.widefat tr.inline-editor").attr("id");if(b){a("table.widefat .spinner").hide();a("#"+b).remove();b=b.substr(b.lastIndexOf("-")+1);a(this.what+b).show()}return false},getId:function(c){var d=c.tagName=="TR"?c.id:a(c).parents("tr").attr("id"),b=d.split("-");return b[b.length-1]}};a(document).ready(function(){inlineEditTax.init()})})(jQuery);
\ No newline at end of file
+(function(a){inlineEditTax={init:function(){var b=this,c=a("#inline-edit");b.type=a("#the-list").attr("data-wp-lists").substr(5);b.what="#"+b.type+"-";a("#the-list").on("click","a.editinline",function(){inlineEditTax.edit(this);return false});c.keyup(function(d){if(d.which==27){return inlineEditTax.revert()}});a("a.cancel",c).click(function(){return inlineEditTax.revert()});a("a.save",c).click(function(){return inlineEditTax.save(this)});a("input, select",c).keydown(function(d){if(d.which==13){return inlineEditTax.save(this)}});a('#posts-filter input[type="submit"]').mousedown(function(d){b.revert()})},toggle:function(c){var b=this;a(b.what+b.getId(c)).css("display")=="none"?b.revert():b.edit(c)},edit:function(d){var c=this,b;c.revert();if(typeof(d)=="object"){d=c.getId(d)}b=a("#inline-edit").clone(true),rowData=a("#inline_"+d);a("td",b).attr("colspan",a(".widefat:first thead th:visible").length);if(a(c.what+d).hasClass("alternate")){a(b).addClass("alternate")}a(c.what+d).hide().after(b);a(':input[name="name"]',b).val(a(".name",rowData).text());a(':input[name="slug"]',b).val(a(".slug",rowData).text());a(b).attr("id","edit-"+d).addClass("inline-editor").show();a(".ptitle",b).eq(0).focus();return false},save:function(e){var d,b,c=a('input[name="taxonomy"]').val()||"";if(typeof(e)=="object"){e=this.getId(e)}a("table.widefat .spinner").show();d={action:"inline-save-tax",tax_type:this.type,tax_ID:e,taxonomy:c};b=a("#edit-"+e+" :input").serialize();d=b+"&"+a.param(d);a.post(ajaxurl,d,function(g){var h,f;a("table.widefat .spinner").hide();if(g){if(-1!=g.indexOf("<tr")){a(inlineEditTax.what+e).remove();f=a(g).attr("id");a("#edit-"+e).before(g).remove();h=f?a("#"+f):a(inlineEditTax.what+e);h.hide().fadeIn()}else{a("#edit-"+e+" .inline-edit-save .error").html(g).show()}}else{a("#edit-"+e+" .inline-edit-save .error").html(inlineEditL10n.error).show()}});return false},revert:function(){var b=a("table.widefat tr.inline-editor").attr("id");if(b){a("table.widefat .spinner").hide();a("#"+b).remove();b=b.substr(b.lastIndexOf("-")+1);a(this.what+b).show()}return false},getId:function(c){var d=c.tagName=="TR"?c.id:a(c).parents("tr").attr("id"),b=d.split("-");return b[b.length-1]}};a(document).ready(function(){inlineEditTax.init()})})(jQuery);
\ No newline at end of file
index a8043b5d014b26c122f21ba1295918a286237f76..9e7d7eace3eb2e4fad1a3ed46811b2981798c7e4 100644 (file)
@@ -1,4 +1,4 @@
-/*! Iris - v0.9.14 - 2012-11-20
+/*! Iris Color Picker - v1.0.3 - 2013-02-15
 * https://github.com/Automattic/Iris
-* Copyright (c) 2012 Matt Wiebe; Licensed GPL */
-(function(e,t){function u(){if(r)i="filter";else{var t=e('<div id="iris-gradtest" />'),n="linear-gradient(top,#fff,#000)";e.each(s,function(e,r){t.css("backgroundImage",r+n);if(t.css("backgroundImage").match("gradient"))return i=e,!1}),e.browser.webkit&&i===!1&&(t.css("background","-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))"),t.css("backgroundImage").match("gradient")&&(i="webkit")),t.remove()}}function a(t,n){return t=t==="top"?"top":"left",n=e.isArray(n)?n:Array.prototype.slice.call(arguments,1),i==="webkit"?l(t,n):s[i]+"linear-gradient("+t+", "+n.join(", ")+")"}function f(t,n){t=t==="top"?"top":"left",n=e.isArray(n)?n:Array.prototype.slice.call(arguments,1);var r=t==="top"?0:1,i=e(this),s=n.length-1,o=parseInt(e.browser.version,10)>=8?"-ms-filter":"filter";o="filter";var u=r===1?"left":"top",a=r===1?"right":"bottom",f=r===1?"height":"width",l='<div class="iris-ie-gradient-shim" style="position:absolute;'+f+":100%;"+u+":%start%;"+a+":%end%;"+o+':%filter%;" data-color:"%color%"></div>',h="";i.css("position")==="static"&&i.css({position:"relative"}),n=c(n),e.each(n,function(e,t){if(e===s)return!1;var i=n[e+1];if(t.stop===i.stop)return;var o=100-parseFloat(i.stop)+"%";t.octoHex=(new Color(t.color)).toIEOctoHex(),i.octoHex=(new Color(i.color)).toIEOctoHex();var u="progid:DXImageTransform.Microsoft.Gradient(GradientType="+r+", StartColorStr='"+t.octoHex+"', EndColorStr='"+i.octoHex+"')";h+=l.replace("%start%",t.stop).replace("%end%",o).replace("%filter%",u)}),i.find(".iris-ie-gradient-shim").remove(),e(h).prependTo(i)}function l(t,n){var r=[];return t=t==="top"?"0% 0%,0% 100%,":"0% 100%,100% 100%,",n=c(n),e.each(n,function(e,t){r.push("color-stop("+parseFloat(t.stop)/100+", "+t.color+")")}),"-webkit-gradient(linear,"+t+r.join(",")+")"}function c(t){var n=[],r=[],i=[],s=t.length-1;return e.each(t,function(e,t){var i=t,s=!1,o=t.match(/1?[0-9]{1,2}%$/);o&&(i=t.replace(/\s?1?[0-9]{1,2}%$/,""),s=o.shift()),n.push(i),r.push(s)}),r[0]===!1&&(r[0]="0%"),r[s]===!1&&(r[s]="100%"),r=h(r),e.each(r,function(e){i[e]={color:n[e],stop:r[e]}}),i}function h(t){var n=0,r=t.length-1,i=0,s=!1,o,u,a,f;if(t.length<=2||e.inArray(!1,t)<0)return t;while(i<t.length-1)!s&&t[i]===!1?(n=i-1,s=!0):s&&t[i]!==!1&&(r=i,i=t.length),i++;u=r-n,f=parseInt(t[n].replace("%"),10),o=(parseFloat(t[r].replace("%"))-f)/u,i=n+1,a=1;while(i<r)t[i]=f+a*o+"%",a++,i++;return h(t)}var n='<div class="iris-picker"><div class="iris-picker-inner"><div class="iris-square"><a class="iris-square-value" href="#"><span class="iris-square-handle ui-slider-handle"></span></a><div class="iris-square-inner iris-square-horiz"></div><div class="iris-square-inner iris-square-vert"></div></div><div class="iris-slider iris-strip"><div class="iris-slider-offset"></div></div></div></div>',r=!!(e.browser.msie&&parseInt(e.browser.version,10)<10),i=!1,s=["-moz-","-webkit-","-o-","-ms-"],o='.iris-picker{display:block;position:relative}.iris-error{background-color:#ffafaf}.iris-border{border-radius:3px;border:1px solid #aaa;width:200px;background-color:#fff}.iris-picker-inner{position:absolute;top:0;right:0;left:0;bottom:0}.iris-border .iris-picker-inner{top:10px;right:10px;left:10px;bottom:10px}.iris-picker .iris-square-inner{position:absolute;left:0;right:0;top:0;bottom:0}.iris-picker .iris-square,.iris-picker .iris-slider,.iris-picker .iris-square-inner,.iris-picker .iris-palette{border-radius:3px;box-shadow:inset 0 0 5px rgba(0,0,0,0.4);height:100%;width:12.5%;float:left;margin-right:5%}.iris-picker .iris-square{width:76%;margin-right:10%;position:relative}.iris-picker .iris-square-inner{width:auto;margin:0}.iris-ie-9 .iris-square,.iris-ie-9 .iris-slider,.iris-ie-9 .iris-square-inner,.iris-ie-9 .iris-palette{box-shadow:none;border-radius:0}.iris-ie-9 .iris-square,.iris-ie-9 .iris-slider,.iris-ie-9 .iris-palette{outline:1px solid rgba(0,0,0,.1)}.iris-ie-lt9 .iris-square,.iris-ie-lt9 .iris-slider,.iris-ie-lt9 .iris-square-inner,.iris-ie-lt9 .iris-palette{outline:1px solid #aaa}.iris-ie-lt9 .iris-square .ui-slider-handle{outline:1px solid #aaa;background-color:#fff;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"}.iris-ie-lt9 .iris-square .iris-square-handle{background:none;border:3px solid #fff;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"}.iris-picker .iris-strip{margin-right:0;position:relative}.iris-picker .iris-strip .ui-slider-handle{position:absolute;background:none;right:-3px;left:-3px;border:4px solid #aaa;border-width:4px 3px;width:auto;height:6px;border-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.2);opacity:.9;z-index:5;cursor:ns-resize}.iris-strip .ui-slider-handle:before{content:" ";position:absolute;left:-2px;right:-2px;top:-3px;bottom:-3px;border:2px solid #fff;border-radius:3px}.iris-picker .iris-slider-offset{position:absolute;top:11px;left:0;right:0;bottom:-3px}.iris-picker .iris-square-handle{background:transparent;border:5px solid #aaa;border-radius:50%;border-color:rgba(128,128,128,.5);box-shadow:none;width:12px;height:12px;position:absolute;left:-10px;top:-10px;cursor:move;opacity:1;z-index:10}.iris-picker .ui-state-focus .iris-square-handle{opacity:.8}.iris-picker .iris-square-handle:hover{border-color:#999}.iris-picker .iris-square-value:focus .iris-square-handle{box-shadow:0 0 2px rgba(0,0,0,.75);opacity:.8}.iris-picker .iris-square-handle:hover::after{border-color:#fff}.iris-picker .iris-square-handle::after{position:absolute;bottom:-4px;right:-4px;left:-4px;top:-4px;border:3px solid #f9f9f9;border-color:rgba(255,255,255,.8);border-radius:50%;content:" "}.iris-picker .iris-square-value{width:8px;height:8px;position:absolute}.iris-ie-lt9 .iris-square-value,.iris-mozilla .iris-square-value{width:1px;height:1px}.iris-palette-container{position:absolute;bottom:0;left:0;margin:0;padding:0}.iris-border .iris-palette-container{left:10px;bottom:10px}.iris-picker .iris-palette{margin:0;cursor:pointer}';if(r&&parseInt(e.browser.version,10)<=7)return e.fn.iris=e.noop;e.fn.gradient=function(t){var n=arguments;return this.each(function(){r?f.apply(this,n):e(this).css("backgroundImage",a.apply(this,n))})},e.fn.raninbowGradient=function(t,n){t=t||"top";var r=e.extend({},{s:100,l:50},n),i="hsl(%h%,"+r.s+"%,"+r.l+"%)",s=0,o=[];while(s<=360)o.push(i.replace("%h%",s)),s+=30;return this.each(function(){e(this).gradient(t,o)})};var p={options:{color:!1,mode:"hsl",controls:{horiz:"s",vert:"l",strip:"h"},hide:!0,border:!0,target:!1,width:200,palettes:!1},_palettes:["#000","#fff","#d33","#d93","#ee2","#81d742","#1e73be","#8224e3"],_inited:!1,_scale:{h:360,s:100,l:100,v:100},_create:function(){var t=this,r=t.element,s=t.options.color||r.val(),o;i===!1&&u(),r.is("input")?(t.options.target?t.picker=e(n).appendTo(t.options.target):t.picker=e(n).insertAfter(r),t._addInputListeners(r)):(r.append(n),t.picker=r.find(".iris-picker"));if(e.browser.mozilla)t.picker.addClass("iris-mozilla");else if(e.browser.msie){var a=parseInt(e.browser.version,10);a===9?t.picker.addClass("iris-ie-9"):a<=8&&t.picker.addClass("iris-ie-lt9")}t.options.palettes&&t._addPalettes(),t.color=(new Color(s)).setHSpace(t.options.mode),t.options.color=t.color.toString(),t.controls={square:t.picker.find(".iris-square"),squareDrag:t.picker.find(".iris-square-value"),horiz:t.picker.find(".iris-square-horiz"),vert:t.picker.find(".iris-square-vert"),strip:t.picker.find(".iris-strip"),stripSlider:t.picker.find(".iris-strip .iris-slider-offset")},t.options.mode==="hsv"&&t.options.controls.vert==="l"&&(t.options.controls={horiz:"h",vert:"v",strip:"s"}),t.hue=t.color.h(),t.options.hide&&t.picker.hide(),t.options.border&&t.picker.addClass("iris-border"),t._initControls(),t.active="external",t._dimensions(),t._change()},_addPalettes:function(){var t=e("<div class='iris-palette-container' />"),n=e("<a class='iris-palette' tabindex='0' />"),r=e.isArray(this.options.palettes)?this.options.palettes:this._palettes;e.each(r,function(e,r){n.clone().data("color",r).css("backgroundColor",r).appendTo(t).height(10).width(10)}),this.picker.append(t)},_paint:function(){var e=this;e._paintDimension("top","strip"),e._paintDimension("top","vert"),e._paintDimension("left","horiz")},_paintDimension:function(e,t){var n=this,r=n.color,i=n.options.mode,s=n._getHSpaceColor(),o=n.controls[t],u=n.options.controls,a;if(t===n.active||n.active==="square"&&t!=="strip")return;switch(u[t]){case"h":if(i==="hsv"){s=r.clone();switch(t){case"horiz":s[u.vert](100);break;case"vert":s[u.horiz](100);break;case"strip":s.setHSpace("hsl")}a=s.toHsl()}else t==="strip"?a={s:s.s,l:s.l}:a={s:100,l:s.l};o.raninbowGradient(e,a);break;case"s":i==="hsv"?t==="vert"?a=[r.clone().a(0).s(0).toCSS("rgba"),r.clone().a(1).s(0).toCSS("rgba")]:t==="strip"?a=[r.clone().s(100).toCSS("hsl"),r.clone().s(0).toCSS("hsl")]:t==="horiz"&&(a=["#fff","hsl("+s.h+",100%,50%)"]):t==="vert"&&n.options.controls.horiz==="h"?a=["hsla(0, 0%, "+s.l+"%, 0)","hsla(0, 0%, "+s.l+"%, 1)"]:a=["hsl("+s.h+",0%,50%)","hsl("+s.h+",100%,50%)"],o.gradient(e,a);break;case"l":t==="strip"?a=["hsl("+s.h+",100%,100%)","hsl("+s.h+", "+s.s+"%,50%)","hsl("+s.h+",100%,0%)"]:a=["#fff","rgba(255,255,255,0) 50%","rgba(0,0,0,0) 50%","rgba(0,0,0,1)"],o.gradient(e,a);break;case"v":t==="strip"?a=[r.clone().v(100).toCSS(),r.clone().v(0).toCSS()]:a=["rgba(0,0,0,0)","#000"],o.gradient(e,a);break;default:}},_getHSpaceColor:function(){return this.options.mode==="hsv"?this.color.toHsv():this.color.toHsl()},_dimensions:function(t){var n=this,r=n.options,i=n.picker.find(".iris-picker-inner"),s=n.controls,o=s.square,u=n.picker.find(".iris-strip"),a="77.5%",f="12%",l=20,c=r.border?r.width-l:r.width,h,p=e.isArray(r.palettes)?r.palettes.length:n._palettes.length,d,v,m;t&&(o.css("width",""),u.css("width",""),n.picker.removeAttr("style")),a=c*(parseFloat(a)/100),f=c*(parseFloat(f)/100),h=r.border?a+l:a,o.width(a).height(a),u.height(a).width(f),n.picker.css({width:r.width,height:h});if(!r.palettes)return;d=a*2/100,m=a-(p-1)*d,v=m/p,n.picker.find(".iris-palette").each(function(t,n){var r=t===0?0:d;e(this).css({width:v,height:v,marginLeft:r})}),n.picker.css("paddingBottom",v+d),u.height(v+d+a)},_addInputListeners:function(e){var t=this,n=100,r=function(n){var r=new Color(e.val()),i=e.val().replace(/^#/,"");e.removeClass("iris-error"),r.error?i!==""&&e.addClass("iris-error"):r.toString()!==t.color.toString()&&(n.type!=="keyup"||!i.match(/^[0-9a-fA-F]{3}$/))&&t._setOption("color",r.toString())};e.on("change",r).on("keyup",t._debounce(r,n))},_initControls:function(){var t=this,n=t.controls,r=n.square,i=t.options.controls,s=t._scale[i.strip];n.stripSlider.slider({orientation:"vertical",max:s,slide:function(e,n){t.active="strip",i.strip==="h"&&(n.value=s-n.value),t.color[i.strip](n.value),t._change.apply(t,arguments)}}),n.squareDrag.draggable({containment:"parent",zIndex:1e3,cursor:"move",drag:function(e,n){t._squareDrag(e,n)},start:function(){r.addClass("iris-dragging"),e(this).addClass("ui-state-focus")},stop:function(){r.removeClass("iris-dragging"),e(this).removeClass("ui-state-focus")}}).on("mousedown mouseup",function(n){n.preventDefault();var r="ui-state-focus";n.type==="mousedown"?(t.picker.find("."+r).removeClass(r).blur(),e(this).addClass(r).focus()):e(this).removeClass(r)}).on("keydown",function(e){var r=n.square,i=n.squareDrag,s=i.position(),o=t.options.width/100;e.altKey&&(o*=10);switch(e.keyCode){case 37:s.left-=o;break;case 38:s.top-=o;break;case 39:s.left+=o;break;case 40:s.top+=o;break;default:return!0}s.left=Math.max(0,Math.min(s.left,r.width())),s.top=Math.max(0,Math.min(s.top,r.height())),i.css(s),t._squareDrag(e,{position:s}),e.preventDefault()}),r.mousedown(function(n){if(n.which!==1)return;if(!e(n.target).is("div"))return;var r=t.controls.square.offset(),i={top:n.pageY-r.top,left:n.pageX-r.left};n.preventDefault(),t._squareDrag(n,{position:i}),n.target=t.controls.squareDrag.get(0),t.controls.squareDrag.css(i).trigger(n)}),t.options.palettes&&t.picker.find(".iris-palette-container").on("click",".iris-palette",function(n){t.color.fromCSS(e(this).data("color")),t.active="external",t._change()}).on("keydown",".iris-palette",function(t){if(t.keyCode!==13&&t.keyCode!==32)return!0;t.stopPropagation(),e(this).click()})},_squareDrag:function(e,t){var n=this,r=n.options.controls,i=n._squareDimensions(),s=Math.round((i.h-t.position.top)/i.h*n._scale[r.vert]),o=n._scale[r.horiz]-Math.round((i.w-t.position.left)/i.w*n._scale[r.horiz]);n.color[r.horiz](o)[r.vert](s),n.active="square",n._change.apply(n,arguments)},_setOption:function(e,t){var n=this.options[e];if(e==="color"){t=""+t;var r=t.replace(/^#/,""),i=(new Color(t)).setHSpace(this.options.mode);i.error||(this.color=i,this.options.color=this.options[e]=this.color.toString(),this.active="external",this._change())}},_squareDimensions:function(e){var n=this.controls.square,r,i;return e!==t&&n.data("dimensions")?n.data("dimensions"):(i=this.controls.squareDrag,r={w:n.width(),h:n.height()},n.data("dimensions",r),r)},_isNonHueControl:function(e,t){return e==="square"&&this.options.controls.strip==="h"?!0:t==="external"||t==="h"&&e==="strip"?!1:!0},_change:function(t,n){var r=this,i=r.controls,s=r._getHSpaceColor(),o=r.color.toString(),u=["square","strip"],a=r.options.controls,f=a[r.active]||"external",l=r.hue;r.active==="strip"?u=[]:r.active!=="external"&&u.pop(),e.each(u,function(e,t){var n;if(t!==r.active)switch(t){case"strip":n=a.strip==="h"?r._scale[a.strip]-s[a.strip]:s[a.strip],i.stripSlider.slider("value",n);break;case"square":var o=r._squareDimensions(),u={left:s[a.horiz]/r._scale[a.horiz]*o.w,top:o.h-s[a.vert]/r._scale[a.vert]*o.h};r.controls.squareDrag.css(u)}}),s.h!==l&&r._isNonHueControl(r.active,f)&&r.color.h(l),r.hue=r.color.h(),r.options.color=r.color.toString(),r._inited&&r._trigger("change",{type:r.active},{color:r.color}),r.element.is(":input")&&!r.color.error&&(r.element.removeClass("iris-error"),r.element.val()!==r.color.toString()&&r.element.val(r.color.toString())),r._paint(),r._inited=!0,r.active=!1},_debounce:function(e,t,n){var r,i;return function(){var s=this,o=arguments,u=function(){r=null,n||(i=e.apply(s,o))},a=n&&!r;return clearTimeout(r),r=setTimeout(u,t),a&&(i=e.apply(s,o)),i}},show:function(){this.picker.show()},hide:function(){this.picker.hide()},toggle:function(){this.picker.toggle()}};e.widget("a8c.iris",p),e('<style id="iris-css">'+o+"</style>").appendTo("head")})(jQuery),function(e,t){var n=function(e,t){return this instanceof n?this._init(e,t):new n(e,t)};n.fn=n.prototype={_color:0,_alpha:1,error:!1,_hsl:{h:0,s:0,l:0},_hsv:{h:0,s:0,v:0},_hSpace:"hsl",_init:function(e){var n="noop";switch(typeof e){case"object":return e.a!==t&&this.a(e.a),n=e.r!==t?"fromRgb":e.l!==t?"fromHsl":e.v!==t?"fromHsv":n,this[n](e);case"string":return this.fromCSS(e);case"number":return this.fromInt(parseInt(e,10))}return this},_error:function(){return this.error=!0,this},clone:function(){var e=new n(this.toInt()),t=["_alpha","_hSpace","_hsl","_hsv","error"];for(var r=t.length-1;r>=0;r--)e[t[r]]=this[t[r]];return e},setHSpace:function(e){return this._hSpace=e==="hsv"?e:"hsl",this},noop:function(){return this},fromCSS:function(e){var t,n,r=/^(rgb|hs(l|v))a?\(/;this.error=!1,e=e.replace(/^\s+/,"").replace(/\s+$/,"").replace(/;$/,"");if(e.match(r)&&e.match(/\)$/)){n=e.replace(/(\s|%)/g,"").replace(r,"").replace(/,?\);?$/,"").split(",");if(n.length<3)return this._error();if(n.length===4){this.a(parseFloat(n.pop()));if(this.error)return this}for(var i=n.length-1;i>=0;i--){n[i]=parseInt(n[i],10);if(isNaN(n[i]))return this._error()}return e.match(/^rgb/)?this.fromRgb({r:n[0],g:n[1],b:n[2]}):e.match(/^hsv/)?this.fromHsv({h:n[0],s:n[1],v:n[2]}):this.fromHsl({h:n[0],s:n[1],l:n[2]})}return this.fromHex(e)},fromRgb:function(e,n){return typeof e!="object"||e.r===t||e.g===t||e.b===t?this._error():(this.error=!1,this.fromInt(parseInt((e.r<<16)+(e.g<<8)+e.b,10),n))},fromHex:function(e){return e=e.replace(/^#/,"").replace(/^0x/,""),e.length===3&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),this.error=!/^[0-9A-F]{6}$/i.test(e),this.fromInt(parseInt(e,16))},fromHsl:function(e){var n,r,i,s,o,u,a,f;return typeof e!="object"||e.h===t||e.s===t||e.l===t?this._error():(this._hsl=e,this._hSpace="hsl",u=e.h/360,a=e.s/100,f=e.l/100,a===0?n=r=i=f:(s=f<.5?f*(1+a):f+a-f*a,o=2*f-s,n=this.hue2rgb(o,s,u+1/3),r=this.hue2rgb(o,s,u),i=this.hue2rgb(o,s,u-1/3)),this.fromRgb({r:n*255,g:r*255,b:i*255},!0))},fromHsv:function(e){var n,r,i,s,o,u,a,f,l,c,h;if(typeof e!="object"||e.h===t||e.s===t||e.v===t)return this._error();this._hsv=e,this._hSpace="hsv",n=e.h/360,r=e.s/100,i=e.v/100,a=Math.floor(n*6),f=n*6-a,l=i*(1-r),c=i*(1-f*r),h=i*(1-(1-f)*r);switch(a%6){case 0:s=i,o=h,u=l;break;case 1:s=c,o=i,u=l;break;case 2:s=l,o=i,u=h;break;case 3:s=l,o=c,u=i;break;case 4:s=h,o=l,u=i;break;case 5:s=i,o=l,u=c}return this.fromRgb({r:s*255,g:o*255,b:u*255},!0)},fromInt:function(e,n){return this._color=parseInt(e,10),isNaN(this._color)&&(this._color=0),this._color>16777215?this._color=16777215:this._color<0&&(this._color=0),n===t&&(this._hsv.h=this._hsv.s=this._hsl.h=this._hsl.s=0),this},hue2rgb:function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},toString:function(){var e=parseInt(this._color,10).toString(16);if(this.error)return"";if(e.length<6)for(var t=6-e.length-1;t>=0;t--)e="0"+e;return"#"+e},toCSS:function(e,t){e=e||"hex",t=parseFloat(t||this._alpha);switch(e){case"rgb":case"rgba":var n=this.toRgb();return t<1?"rgba( "+n.r+", "+n.g+", "+n.b+", "+t+" )":"rgb( "+n.r+", "+n.g+", "+n.b+" )";case"hsl":case"hsla":var r=this.toHsl();return t<1?"hsla( "+r.h+", "+r.s+"%, "+r.l+"%, "+t+" )":"hsl( "+r.h+", "+r.s+"%, "+r.l+"% )";default:return this.toString()}},toRgb:function(){return{r:255&this._color>>16,g:255&this._color>>8,b:255&this._color}},toHsl:function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,r=e.b/255,i=Math.max(t,n,r),s=Math.min(t,n,r),o,u,a=(i+s)/2;if(i===s)o=u=0;else{var f=i-s;u=a>.5?f/(2-i-s):f/(i+s);switch(i){case t:o=(n-r)/f+(n<r?6:0);break;case n:o=(r-t)/f+2;break;case r:o=(t-n)/f+4}o/=6}return o=Math.round(o*360),o===0&&this._hsl.h!==o&&(o=this._hsl.h),u=Math.round(u*100),u===0&&this._hsl.s&&(u=this._hsl.s),{h:o,s:u,l:Math.round(a*100)}},toHsv:function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,r=e.b/255,i=Math.max(t,n,r),s=Math.min(t,n,r),o,u,a=i,f=i-s;u=i===0?0:f/i;if(i===s)o=u=0;else{switch(i){case t:o=(n-r)/f+(n<r?6:0);break;case n:o=(r-t)/f+2;break;case r:o=(t-n)/f+4}o/=6}return o=Math.round(o*360),o===0&&this._hsv.h!==o&&(o=this._hsv.h),u=Math.round(u*100),u===0&&this._hsv.s&&(u=this._hsv.s),{h:o,s:u,v:Math.round(a*100)}},toInt:function(){return this._color},toIEOctoHex:function(){var e=this.toString(),t=parseInt(255*this._alpha,10).toString(16);return t.length===1&&(t="0"+t),"#"+t+e.replace(/^#/,"")},toLuminosity:function(){var e=this.toRgb();return.2126*Math.pow(e.r/255,2.2)+.7152*Math.pow(e.g/255,2.2)+.0722*Math.pow(e.b/255,2.2)},getDistanceLuminosityFrom:function(e){if(e instanceof n){var t=this.toLuminosity(),r=e.toLuminosity();return t>r?(t+.05)/(r+.05):(r+.05)/(t+.05)}throw"getDistanceLuminosityFrom requires a Color object"},getMaxContrastColor:function(){var e=this.toLuminosity(),t=e>=.5?"000000":"ffffff";return new n(t)},getGrayscaleContrastingColor:function(e){if(!e)return this.getMaxContrastColor();var t=e<5?5:e,n=this.getMaxContrastColor();e=n.getDistanceLuminosityFrom(this);if(e<=t)return n;var r=0===n.toInt()?1:-1;while(e>t)n=n.incrementLightness(r),e=n.getDistanceLuminosityFrom(this);return n},getReadableContrastingColor:function(e,r){if(!e instanceof n)return this;var i=r===t?5:r,s=e.getDistanceLuminosityFrom(this),o=e.getMaxContrastColor(),u=o.getDistanceLuminosityFrom(e);if(u<=i)return o;if(s>=i)return this;var a=0===o.toInt()?-1:1;while(s<i){this.incrementLightness(a),s=this.getDistanceLuminosityFrom(e);if(this._color===0||this._color===16777215)break}return this},a:function(e){if(e===t)return this._alpha;var n=parseFloat(e);return isNaN(n)?this._error():(this._alpha=n,this)},darken:function(e){return e=e||5,this.l(-e,!0)},lighten:function(e){return e=e||5,this.l(e,!0)},saturate:function(e){return e=e||15,this.s(e,!0)},desaturate:function(e){return e=e||15,this.s(-e,!0)},toGrayscale:function(){return this.setHSpace("hsl").s(0)},getComplement:function(){return this.h(180,!0)},getSplitComplement:function(e){e=e||1;var t=180+e*30;return this.h(t,!0)},getAnalog:function(e){e=e||1;var t=e*30;return this.h(t,!0)},getTetrad:function(e){e=e||1;var t=e*60;return this.h(t,!0)},getTriad:function(e){e=e||1;var t=e*120;return this.h(t,!0)},_partial:function(e){var n=r[e];return function(r,i){var s=this._spaceFunc("to",n.space);return r===t?s[e]:(i===!0&&(r=s[e]+r),n.mod&&(r%=n.mod),n.range&&(r=r<n.range[0]?n.range[0]:r>n.range[1]?n.range[1]:r),s[e]=r,this._spaceFunc("from",n.space,s))}},_spaceFunc:function(e,t,n){var r=t||this._hSpace,i=e+r.charAt(0).toUpperCase()+r.substr(1);return this[i](n)}};var r={h:{mod:360},s:{range:[0,100]},l:{space:"hsl",range:[0,100]},v:{space:"hsv",range:[0,100]},r:{space:"rgb",range:[0,255]},g:{space:"rgb",range:[0,255]},b:{space:"rgb",range:[0,255]}};for(var i in r)r.hasOwnProperty(i)&&(n.fn[i]=n.fn._partial(i));e.Color=n}(typeof exports=="object"&&exports||this);
\ No newline at end of file
+* Copyright (c) 2013 Matt Wiebe; Licensed GPLv2 */
+(function(e,t){function c(){var t,n;r?i="filter":(t=e('<div id="iris-gradtest" />'),n="linear-gradient(top,#fff,#000)",e.each(s,function(e,r){t.css("backgroundImage",r+n);if(t.css("backgroundImage").match("gradient"))return i=e,!1}),i===!1&&(t.css("background","-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))"),t.css("backgroundImage").match("gradient")&&(i="webkit")),t.remove())}function h(t,n){return t=t==="top"?"top":"left",n=e.isArray(n)?n:Array.prototype.slice.call(arguments,1),i==="webkit"?d(t,n):s[i]+"linear-gradient("+t+", "+n.join(", ")+")"}function p(t,n){var r,i,s,o,u,a,f,l,c;t=t==="top"?"top":"left",n=e.isArray(n)?n:Array.prototype.slice.call(arguments,1),r=t==="top"?0:1,i=e(this),s=n.length-1,o="filter",u=r===1?"left":"top",a=r===1?"right":"bottom",f=r===1?"height":"width",l='<div class="iris-ie-gradient-shim" style="position:absolute;'+f+":100%;"+u+":%start%;"+a+":%end%;"+o+':%filter%;" data-color:"%color%"></div>',c="",i.css("position")==="static"&&i.css({position:"relative"}),n=v(n),e.each(n,function(e,t){var i,o,u;if(e===s)return!1;i=n[e+1];if(t.stop===i.stop)return;o=100-parseFloat(i.stop)+"%",t.octoHex=(new Color(t.color)).toIEOctoHex(),i.octoHex=(new Color(i.color)).toIEOctoHex(),u="progid:DXImageTransform.Microsoft.Gradient(GradientType="+r+", StartColorStr='"+t.octoHex+"', EndColorStr='"+i.octoHex+"')",c+=l.replace("%start%",t.stop).replace("%end%",o).replace("%filter%",u)}),i.find(".iris-ie-gradient-shim").remove(),e(c).prependTo(i)}function d(t,n){var r=[];return t=t==="top"?"0% 0%,0% 100%,":"0% 100%,100% 100%,",n=v(n),e.each(n,function(e,t){r.push("color-stop("+parseFloat(t.stop)/100+", "+t.color+")")}),"-webkit-gradient(linear,"+t+r.join(",")+")"}function v(t){var n=[],r=[],i=[],s=t.length-1;return e.each(t,function(e,t){var i=t,s=!1,o=t.match(/1?[0-9]{1,2}%$/);o&&(i=t.replace(/\s?1?[0-9]{1,2}%$/,""),s=o.shift()),n.push(i),r.push(s)}),r[0]===!1&&(r[0]="0%"),r[s]===!1&&(r[s]="100%"),r=m(r),e.each(r,function(e){i[e]={color:n[e],stop:r[e]}}),i}function m(t){var n=0,r=t.length-1,i=0,s=!1,o,u,a,f;if(t.length<=2||e.inArray(!1,t)<0)return t;while(i<t.length-1)!s&&t[i]===!1?(n=i-1,s=!0):s&&t[i]!==!1&&(r=i,i=t.length),i++;u=r-n,f=parseInt(t[n].replace("%"),10),o=(parseFloat(t[r].replace("%"))-f)/u,i=n+1,a=1;while(i<r)t[i]=f+a*o+"%",a++,i++;return m(t)}var n,r,i,s,o,u,a,f,l;n='<div class="iris-picker"><div class="iris-picker-inner"><div class="iris-square"><a class="iris-square-value" href="#"><span class="iris-square-handle ui-slider-handle"></span></a><div class="iris-square-inner iris-square-horiz"></div><div class="iris-square-inner iris-square-vert"></div></div><div class="iris-slider iris-strip"><div class="iris-slider-offset"></div></div></div></div>',a=navigator.userAgent.toLowerCase(),f=navigator.appName==="Microsoft Internet Explorer",l=f?parseFloat(a.match(/msie ([0-9]{1,}[\.0-9]{0,})/)[1]):0,r=f&&l<10,i=!1,s=["-moz-","-webkit-","-o-","-ms-"],o='.iris-picker{display:block;position:relative}.iris-picker,.iris-picker *{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input + .iris-picker{margin-top:4px}.iris-error{background-color:#ffafaf}.iris-border{border-radius:3px;border:1px solid #aaa;width:200px;background-color:#fff}.iris-picker-inner{position:absolute;top:0;right:0;left:0;bottom:0}.iris-border .iris-picker-inner{top:10px;right:10px;left:10px;bottom:10px}.iris-picker .iris-square-inner{position:absolute;left:0;right:0;top:0;bottom:0}.iris-picker .iris-square,.iris-picker .iris-slider,.iris-picker .iris-square-inner,.iris-picker .iris-palette{border-radius:3px;box-shadow:inset 0 0 5px rgba(0,0,0,0.4);height:100%;width:12.5%;float:left;margin-right:5%}.iris-picker .iris-square{width:76%;margin-right:10%;position:relative}.iris-picker .iris-square-inner{width:auto;margin:0}.iris-ie-9 .iris-square,.iris-ie-9 .iris-slider,.iris-ie-9 .iris-square-inner,.iris-ie-9 .iris-palette{box-shadow:none;border-radius:0}.iris-ie-9 .iris-square,.iris-ie-9 .iris-slider,.iris-ie-9 .iris-palette{outline:1px solid rgba(0,0,0,.1)}.iris-ie-lt9 .iris-square,.iris-ie-lt9 .iris-slider,.iris-ie-lt9 .iris-square-inner,.iris-ie-lt9 .iris-palette{outline:1px solid #aaa}.iris-ie-lt9 .iris-square .ui-slider-handle{outline:1px solid #aaa;background-color:#fff;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"}.iris-ie-lt9 .iris-square .iris-square-handle{background:none;border:3px solid #fff;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"}.iris-picker .iris-strip{margin-right:0;position:relative}.iris-picker .iris-strip .ui-slider-handle{position:absolute;background:none;right:-3px;left:-3px;border:4px solid #aaa;border-width:4px 3px;width:auto;height:6px;border-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.2);opacity:.9;z-index:5;cursor:ns-resize}.iris-strip .ui-slider-handle:before{content:" ";position:absolute;left:-2px;right:-2px;top:-3px;bottom:-3px;border:2px solid #fff;border-radius:3px}.iris-picker .iris-slider-offset{position:absolute;top:11px;left:0;right:0;bottom:-3px}.iris-picker .iris-square-handle{background:transparent;border:5px solid #aaa;border-radius:50%;border-color:rgba(128,128,128,.5);box-shadow:none;width:12px;height:12px;position:absolute;left:-10px;top:-10px;cursor:move;opacity:1;z-index:10}.iris-picker .ui-state-focus .iris-square-handle{opacity:.8}.iris-picker .iris-square-handle:hover{border-color:#999}.iris-picker .iris-square-value:focus .iris-square-handle{box-shadow:0 0 2px rgba(0,0,0,.75);opacity:.8}.iris-picker .iris-square-handle:hover::after{border-color:#fff}.iris-picker .iris-square-handle::after{position:absolute;bottom:-4px;right:-4px;left:-4px;top:-4px;border:3px solid #f9f9f9;border-color:rgba(255,255,255,.8);border-radius:50%;content:" "}.iris-picker .iris-square-value{width:8px;height:8px;position:absolute}.iris-ie-lt9 .iris-square-value,.iris-mozilla .iris-square-value{width:1px;height:1px}.iris-palette-container{position:absolute;bottom:0;left:0;margin:0;padding:0}.iris-border .iris-palette-container{left:10px;bottom:10px}.iris-picker .iris-palette{margin:0;cursor:pointer}';if(r&&l<=7){e.fn.iris=e.noop,e.support.iris=!1;return}e.support.iris=!0,e.fn.gradient=function(t){var n=arguments;return this.each(function(){r?p.apply(this,n):e(this).css("backgroundImage",h.apply(this,n))})},e.fn.raninbowGradient=function(t,n){var r,i,s,o;t=t||"top",r=e.extend({},{s:100,l:50},n),i="hsl(%h%,"+r.s+"%,"+r.l+"%)",s=0,o=[];while(s<=360)o.push(i.replace("%h%",s)),s+=30;return this.each(function(){e(this).gradient(t,o)})},u={options:{color:!1,mode:"hsl",controls:{horiz:"s",vert:"l",strip:"h"},hide:!0,border:!0,target:!1,width:200,palettes:!1},_color:"",_palettes:["#000","#fff","#d33","#d93","#ee2","#81d742","#1e73be","#8224e3"],_inited:!1,_defaultHSLControls:{horiz:"s",vert:"l",strip:"h"},_defaultHSVControls:{horiz:"h",vert:"v",strip:"s"},_scale:{h:360,s:100,l:100,v:100},_create:function(){var t=this,r=t.element,s=t.options.color||r.val(),o;i===!1&&c(),r.is("input")?(t.options.target?t.picker=e(n).appendTo(t.options.target):t.picker=e(n).insertAfter(r),t._addInputListeners(r)):(r.append(n),t.picker=r.find(".iris-picker")),f?l===9?t.picker.addClass("iris-ie-9"):l<=8&&t.picker.addClass("iris-ie-lt9"):a.indexOf("compatible")<0&&a.indexOf("khtml")<0&&a.match(/mozilla/)&&t.picker.addClass("iris-mozilla"),t.options.palettes&&t._addPalettes(),t._color=(new Color(s)).setHSpace(t.options.mode),t.options.color=t._color.toString(),t.controls={square:t.picker.find(".iris-square"),squareDrag:t.picker.find(".iris-square-value"),horiz:t.picker.find(".iris-square-horiz"),vert:t.picker.find(".iris-square-vert"),strip:t.picker.find(".iris-strip"),stripSlider:t.picker.find(".iris-strip .iris-slider-offset")},t.options.mode==="hsv"&&t._has("l",t.options.controls)?t.options.controls=t._defaultHSVControls:t.options.mode==="hsl"&&t._has("v",t.options.controls)&&(t.options.controls=t._defaultHSLControls),t.hue=t._color.h(),t.options.hide&&t.picker.hide(),t.options.border&&t.picker.addClass("iris-border"),t._initControls(),t.active="external",t._dimensions(),t._change()},_has:function(t,n){var r=!1;return e.each(n,function(e,n){if(t===n)return r=!0,!1}),r},_addPalettes:function(){var t=e("<div class='iris-palette-container' />"),n=e("<a class='iris-palette' tabindex='0' />"),r=e.isArray(this.options.palettes)?this.options.palettes:this._palettes;this.picker.find(".iris-palette-container").length&&(t=this.picker.find(".iris-palette-container").detach().html("")),e.each(r,function(e,r){n.clone().data("color",r).css("backgroundColor",r).appendTo(t).height(10).width(10)}),this.picker.append(t)},_paint:function(){var e=this;e._paintDimension("top","strip"),e._paintDimension("top","vert"),e._paintDimension("left","horiz")},_paintDimension:function(e,t){var n=this,r=n._color,i=n.options.mode,s=n._getHSpaceColor(),o=n.controls[t],u=n.options.controls,a;if(t===n.active||n.active==="square"&&t!=="strip")return;switch(u[t]){case"h":if(i==="hsv"){s=r.clone();switch(t){case"horiz":s[u.vert](100);break;case"vert":s[u.horiz](100);break;case"strip":s.setHSpace("hsl")}a=s.toHsl()}else t==="strip"?a={s:s.s,l:s.l}:a={s:100,l:s.l};o.raninbowGradient(e,a);break;case"s":i==="hsv"?t==="vert"?a=[r.clone().a(0).s(0).toCSS("rgba"),r.clone().a(1).s(0).toCSS("rgba")]:t==="strip"?a=[r.clone().s(100).toCSS("hsl"),r.clone().s(0).toCSS("hsl")]:t==="horiz"&&(a=["#fff","hsl("+s.h+",100%,50%)"]):t==="vert"&&n.options.controls.horiz==="h"?a=["hsla(0, 0%, "+s.l+"%, 0)","hsla(0, 0%, "+s.l+"%, 1)"]:a=["hsl("+s.h+",0%,50%)","hsl("+s.h+",100%,50%)"],o.gradient(e,a);break;case"l":t==="strip"?a=["hsl("+s.h+",100%,100%)","hsl("+s.h+", "+s.s+"%,50%)","hsl("+s.h+",100%,0%)"]:a=["#fff","rgba(255,255,255,0) 50%","rgba(0,0,0,0) 50%","rgba(0,0,0,1)"],o.gradient(e,a);break;case"v":t==="strip"?a=[r.clone().v(100).toCSS(),r.clone().v(0).toCSS()]:a=["rgba(0,0,0,0)","#000"],o.gradient(e,a);break;default:}},_getHSpaceColor:function(){return this.options.mode==="hsv"?this._color.toHsv():this._color.toHsl()},_dimensions:function(t){var n=this,r=n.options,i=n.picker.find(".iris-picker-inner"),s=n.controls,o=s.square,u=n.picker.find(".iris-strip"),a="77.5%",f="12%",l=20,c=r.border?r.width-l:r.width,h,p=e.isArray(r.palettes)?r.palettes.length:n._palettes.length,d,v,m;t&&(o.css("width",""),u.css("width",""),n.picker.css({width:"",height:""})),a=c*(parseFloat(a)/100),f=c*(parseFloat(f)/100),h=r.border?a+l:a,o.width(a).height(a),u.height(a).width(f),n.picker.css({width:r.width,height:h});if(!r.palettes)return;d=a*2/100,m=a-(p-1)*d,v=m/p,n.picker.find(".iris-palette").each(function(t,n){var r=t===0?0:d;e(this).css({width:v,height:v,marginLeft:r})}),n.picker.css("paddingBottom",v+d),u.height(v+d+a)},_addInputListeners:function(e){var t=this,n=100,r=function(n){var r=new Color(e.val()),i=e.val().replace(/^#/,"");e.removeClass("iris-error"),r.error?i!==""&&e.addClass("iris-error"):r.toString()!==t._color.toString()&&(n.type!=="keyup"||!i.match(/^[0-9a-fA-F]{3}$/))&&t._setOption("color",r.toString())};e.on("change",r).on("keyup",t._debounce(r,n)),t.options.hide&&e.one("focus",function(){t.show()})},_initControls:function(){var t=this,n=t.controls,r=n.square,i=t.options.controls,s=t._scale[i.strip];n.stripSlider.slider({orientation:"vertical",max:s,slide:function(e,n){t.active="strip",i.strip==="h"&&(n.value=s-n.value),t._color[i.strip](n.value),t._change.apply(t,arguments)}}),n.squareDrag.draggable({containment:"parent",zIndex:1e3,cursor:"move",drag:function(e,n){t._squareDrag(e,n)},start:function(){r.addClass("iris-dragging"),e(this).addClass("ui-state-focus")},stop:function(){r.removeClass("iris-dragging"),e(this).removeClass("ui-state-focus")}}).on("mousedown mouseup",function(n){var r="ui-state-focus";n.preventDefault(),n.type==="mousedown"?(t.picker.find("."+r).removeClass(r).blur(),e(this).addClass(r).focus()):e(this).removeClass(r)}).on("keydown",function(e){var r=n.square,i=n.squareDrag,s=i.position(),o=t.options.width/100;e.altKey&&(o*=10);switch(e.keyCode){case 37:s.left-=o;break;case 38:s.top-=o;break;case 39:s.left+=o;break;case 40:s.top+=o;break;default:return!0}s.left=Math.max(0,Math.min(s.left,r.width())),s.top=Math.max(0,Math.min(s.top,r.height())),i.css(s),t._squareDrag(e,{position:s}),e.preventDefault()}),r.mousedown(function(n){var r,i;if(n.which!==1)return;if(!e(n.target).is("div"))return;r=t.controls.square.offset(),i={top:n.pageY-r.top,left:n.pageX-r.left},n.preventDefault(),t._squareDrag(n,{position:i}),n.target=t.controls.squareDrag.get(0),t.controls.squareDrag.css(i).trigger(n)}),t.options.palettes&&t._paletteListeners()},_paletteListeners:function(){var t=this;t.picker.find(".iris-palette-container").on("click.palette",".iris-palette",function(n){t._color.fromCSS(e(this).data("color")),t.active="external",t._change()}).on("keydown.palette",".iris-palette",function(t){if(t.keyCode!==13&&t.keyCode!==32)return!0;t.stopPropagation(),e(this).click()})},_squareDrag:function(e,t){var n=this,r=n.options.controls,i=n._squareDimensions(),s=Math.round((i.h-t.position.top)/i.h*n._scale[r.vert]),o=n._scale[r.horiz]-Math.round((i.w-t.position.left)/i.w*n._scale[r.horiz]);n._color[r.horiz](o)[r.vert](s),n.active="square",n._change.apply(n,arguments)},_setOption:function(t,n){var r=this,i=r.options[t],s=!1,o,u,a;r.options[t]=n;switch(t){case"color":n=""+n,o=n.replace(/^#/,""),u=(new Color(n)).setHSpace(r.options.mode),u.error?r.options[t]=i:(r._color=u,r.options.color=r.options[t]=r._color.toString(),r.active="external",r._change());break;case"palettes":s=!0,n?r._addPalettes():r.picker.find(".iris-palette-container").remove(),i||r._paletteListeners();break;case"width":s=!0;break;case"border":s=!0,a=n?"addClass":"removeClass",r.picker[a]("iris-border");break;case"mode":case"controls":if(i===n)return;return a=r.element,i=r.options,i.hide=!r.picker.is(":visible"),r.destroy(),r.picker.remove(),e(r.element).iris(i)}s&&r._dimensions(!0)},_squareDimensions:function(e){var n=this.controls.square,r,i;return e!==t&&n.data("dimensions")?n.data("dimensions"):(i=this.controls.squareDrag,r={w:n.width(),h:n.height()},n.data("dimensions",r),r)},_isNonHueControl:function(e,t){return e==="square"&&this.options.controls.strip==="h"?!0:t==="external"||t==="h"&&e==="strip"?!1:!0},_change:function(t,n){var r=this,i=r.controls,s=r._getHSpaceColor(),o=r._color.toString(),u=["square","strip"],a=r.options.controls,f=a[r.active]||"external",l=r.hue;r.active==="strip"?u=[]:r.active!=="external"&&u.pop(),e.each(u,function(e,t){var n,o,u;if(t!==r.active)switch(t){case"strip":n=a.strip==="h"?r._scale[a.strip]-s[a.strip]:s[a.strip],i.stripSlider.slider("value",n);break;case"square":o=r._squareDimensions(),u={left:s[a.horiz]/r._scale[a.horiz]*o.w,top:o.h-s[a.vert]/r._scale[a.vert]*o.h},r.controls.squareDrag.css(u)}}),s.h!==l&&r._isNonHueControl(r.active,f)&&r._color.h(l),r.hue=r._color.h(),r.options.color=r._color.toString(),r._inited&&r._trigger("change",{type:r.active},{color:r._color}),r.element.is(":input")&&!r._color.error&&(r.element.removeClass("iris-error"),r.element.val()!==r._color.toString()&&r.element.val(r._color.toString())),r._paint(),r._inited=!0,r.active=!1},_debounce:function(e,t,n){var r,i;return function(){var s=this,o=arguments,u,a;return u=function(){r=null,n||(i=e.apply(s,o))},a=n&&!r,clearTimeout(r),r=setTimeout(u,t),a&&(i=e.apply(s,o)),i}},show:function(){this.picker.show()},hide:function(){this.picker.hide()},toggle:function(){this.picker.toggle()},color:function(e){if(e===!0)return this._color.clone();if(e===t)return this._color.toString();this.option("color",e)}},e.widget("a8c.iris",u),e('<style id="iris-css">'+o+"</style>").appendTo("head")})(jQuery),function(e,t){var n=function(e,t){return this instanceof n?this._init(e,t):new n(e,t)};n.fn=n.prototype={_color:0,_alpha:1,error:!1,_hsl:{h:0,s:0,l:0},_hsv:{h:0,s:0,v:0},_hSpace:"hsl",_init:function(e){var n="noop";switch(typeof e){case"object":return e.a!==t&&this.a(e.a),n=e.r!==t?"fromRgb":e.l!==t?"fromHsl":e.v!==t?"fromHsv":n,this[n](e);case"string":return this.fromCSS(e);case"number":return this.fromInt(parseInt(e,10))}return this},_error:function(){return this.error=!0,this},clone:function(){var e=new n(this.toInt()),t=["_alpha","_hSpace","_hsl","_hsv","error"];for(var r=t.length-1;r>=0;r--)e[t[r]]=this[t[r]];return e},setHSpace:function(e){return this._hSpace=e==="hsv"?e:"hsl",this},noop:function(){return this},fromCSS:function(e){var t,n,r=/^(rgb|hs(l|v))a?\(/;this.error=!1,e=e.replace(/^\s+/,"").replace(/\s+$/,"").replace(/;$/,"");if(e.match(r)&&e.match(/\)$/)){n=e.replace(/(\s|%)/g,"").replace(r,"").replace(/,?\);?$/,"").split(",");if(n.length<3)return this._error();if(n.length===4){this.a(parseFloat(n.pop()));if(this.error)return this}for(var i=n.length-1;i>=0;i--){n[i]=parseInt(n[i],10);if(isNaN(n[i]))return this._error()}return e.match(/^rgb/)?this.fromRgb({r:n[0],g:n[1],b:n[2]}):e.match(/^hsv/)?this.fromHsv({h:n[0],s:n[1],v:n[2]}):this.fromHsl({h:n[0],s:n[1],l:n[2]})}return this.fromHex(e)},fromRgb:function(e,n){return typeof e!="object"||e.r===t||e.g===t||e.b===t?this._error():(this.error=!1,this.fromInt(parseInt((e.r<<16)+(e.g<<8)+e.b,10),n))},fromHex:function(e){return e=e.replace(/^#/,"").replace(/^0x/,""),e.length===3&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),this.error=!/^[0-9A-F]{6}$/i.test(e),this.fromInt(parseInt(e,16))},fromHsl:function(e){var n,r,i,s,o,u,a,f;return typeof e!="object"||e.h===t||e.s===t||e.l===t?this._error():(this._hsl=e,this._hSpace="hsl",u=e.h/360,a=e.s/100,f=e.l/100,a===0?n=r=i=f:(s=f<.5?f*(1+a):f+a-f*a,o=2*f-s,n=this.hue2rgb(o,s,u+1/3),r=this.hue2rgb(o,s,u),i=this.hue2rgb(o,s,u-1/3)),this.fromRgb({r:n*255,g:r*255,b:i*255},!0))},fromHsv:function(e){var n,r,i,s,o,u,a,f,l,c,h;if(typeof e!="object"||e.h===t||e.s===t||e.v===t)return this._error();this._hsv=e,this._hSpace="hsv",n=e.h/360,r=e.s/100,i=e.v/100,a=Math.floor(n*6),f=n*6-a,l=i*(1-r),c=i*(1-f*r),h=i*(1-(1-f)*r);switch(a%6){case 0:s=i,o=h,u=l;break;case 1:s=c,o=i,u=l;break;case 2:s=l,o=i,u=h;break;case 3:s=l,o=c,u=i;break;case 4:s=h,o=l,u=i;break;case 5:s=i,o=l,u=c}return this.fromRgb({r:s*255,g:o*255,b:u*255},!0)},fromInt:function(e,n){return this._color=parseInt(e,10),isNaN(this._color)&&(this._color=0),this._color>16777215?this._color=16777215:this._color<0&&(this._color=0),n===t&&(this._hsv.h=this._hsv.s=this._hsl.h=this._hsl.s=0),this},hue2rgb:function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},toString:function(){var e=parseInt(this._color,10).toString(16);if(this.error)return"";if(e.length<6)for(var t=6-e.length-1;t>=0;t--)e="0"+e;return"#"+e},toCSS:function(e,t){e=e||"hex",t=parseFloat(t||this._alpha);switch(e){case"rgb":case"rgba":var n=this.toRgb();return t<1?"rgba( "+n.r+", "+n.g+", "+n.b+", "+t+" )":"rgb( "+n.r+", "+n.g+", "+n.b+" )";case"hsl":case"hsla":var r=this.toHsl();return t<1?"hsla( "+r.h+", "+r.s+"%, "+r.l+"%, "+t+" )":"hsl( "+r.h+", "+r.s+"%, "+r.l+"% )";default:return this.toString()}},toRgb:function(){return{r:255&this._color>>16,g:255&this._color>>8,b:255&this._color}},toHsl:function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,r=e.b/255,i=Math.max(t,n,r),s=Math.min(t,n,r),o,u,a=(i+s)/2;if(i===s)o=u=0;else{var f=i-s;u=a>.5?f/(2-i-s):f/(i+s);switch(i){case t:o=(n-r)/f+(n<r?6:0);break;case n:o=(r-t)/f+2;break;case r:o=(t-n)/f+4}o/=6}return o=Math.round(o*360),o===0&&this._hsl.h!==o&&(o=this._hsl.h),u=Math.round(u*100),u===0&&this._hsl.s&&(u=this._hsl.s),{h:o,s:u,l:Math.round(a*100)}},toHsv:function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,r=e.b/255,i=Math.max(t,n,r),s=Math.min(t,n,r),o,u,a=i,f=i-s;u=i===0?0:f/i;if(i===s)o=u=0;else{switch(i){case t:o=(n-r)/f+(n<r?6:0);break;case n:o=(r-t)/f+2;break;case r:o=(t-n)/f+4}o/=6}return o=Math.round(o*360),o===0&&this._hsv.h!==o&&(o=this._hsv.h),u=Math.round(u*100),u===0&&this._hsv.s&&(u=this._hsv.s),{h:o,s:u,v:Math.round(a*100)}},toInt:function(){return this._color},toIEOctoHex:function(){var e=this.toString(),t=parseInt(255*this._alpha,10).toString(16);return t.length===1&&(t="0"+t),"#"+t+e.replace(/^#/,"")},toLuminosity:function(){var e=this.toRgb();return.2126*Math.pow(e.r/255,2.2)+.7152*Math.pow(e.g/255,2.2)+.0722*Math.pow(e.b/255,2.2)},getDistanceLuminosityFrom:function(e){if(e instanceof n){var t=this.toLuminosity(),r=e.toLuminosity();return t>r?(t+.05)/(r+.05):(r+.05)/(t+.05)}throw"getDistanceLuminosityFrom requires a Color object"},getMaxContrastColor:function(){var e=this.toLuminosity(),t=e>=.5?"000000":"ffffff";return new n(t)},getGrayscaleContrastingColor:function(e){if(!e)return this.getMaxContrastColor();var t=e<5?5:e,n=this.getMaxContrastColor();e=n.getDistanceLuminosityFrom(this);if(e<=t)return n;var r=0===n.toInt()?1:-1;while(e>t)n=n.incrementLightness(r),e=n.getDistanceLuminosityFrom(this);return n},getReadableContrastingColor:function(e,r){if(!e instanceof n)return this;var i=r===t?5:r,s=e.getDistanceLuminosityFrom(this),o=e.getMaxContrastColor(),u=o.getDistanceLuminosityFrom(e);if(u<=i)return o;if(s>=i)return this;var a=0===o.toInt()?-1:1;while(s<i){this.incrementLightness(a),s=this.getDistanceLuminosityFrom(e);if(this._color===0||this._color===16777215)break}return this},a:function(e){if(e===t)return this._alpha;var n=parseFloat(e);return isNaN(n)?this._error():(this._alpha=n,this)},darken:function(e){return e=e||5,this.l(-e,!0)},lighten:function(e){return e=e||5,this.l(e,!0)},saturate:function(e){return e=e||15,this.s(e,!0)},desaturate:function(e){return e=e||15,this.s(-e,!0)},toGrayscale:function(){return this.setHSpace("hsl").s(0)},getComplement:function(){return this.h(180,!0)},getSplitComplement:function(e){e=e||1;var t=180+e*30;return this.h(t,!0)},getAnalog:function(e){e=e||1;var t=e*30;return this.h(t,!0)},getTetrad:function(e){e=e||1;var t=e*60;return this.h(t,!0)},getTriad:function(e){e=e||1;var t=e*120;return this.h(t,!0)},_partial:function(e){var n=r[e];return function(r,i){var s=this._spaceFunc("to",n.space);return r===t?s[e]:(i===!0&&(r=s[e]+r),n.mod&&(r%=n.mod),n.range&&(r=r<n.range[0]?n.range[0]:r>n.range[1]?n.range[1]:r),s[e]=r,this._spaceFunc("from",n.space,s))}},_spaceFunc:function(e,t,n){var r=t||this._hSpace,i=e+r.charAt(0).toUpperCase()+r.substr(1);return this[i](n)}};var r={h:{mod:360},s:{range:[0,100]},l:{space:"hsl",range:[0,100]},v:{space:"hsv",range:[0,100]},r:{space:"rgb",range:[0,255]},g:{space:"rgb",range:[0,255]},b:{space:"rgb",range:[0,255]}};for(var i in r)r.hasOwnProperty(i)&&(n.fn[i]=n.fn._partial(i));e.Color=n}(typeof exports=="object"&&exports||this);
\ No newline at end of file
index f8b4583d4377597961cf46ff3dd05931988458f1..bf5e67ede6afaf99de02f4a7891ea0ddd8ae2848 100644 (file)
@@ -29,7 +29,7 @@ jQuery(document).ready( function($) {
                        return;
                noSyncChecks = true;
                var th = $(this), c = th.is(':checked'), id = th.val().toString();
-               $('#in-link-category-' + id + ', #in-popular-category-' + id).prop( 'checked', c );
+               $('#in-link-category-' + id + ', #in-popular-link_category-' + id).prop( 'checked', c );
                noSyncChecks = false;
        };
 
index 3f5433a4c05ea93b3def6653c7273607128cd9e6..5ab75a6a749e2a7dfff209bd77c49d986b438ce5 100644 (file)
@@ -1 +1 @@
-jQuery(document).ready(function(c){var b,a=false,d,e;c("#link_name").focus();postboxes.add_postbox_toggles("link");c("#category-tabs a").click(function(){var f=c(this).attr("href");c(this).parent().addClass("tabs").siblings("li").removeClass("tabs");c(".tabs-panel").hide();c(f).show();if("#categories-all"==f){deleteUserSetting("cats")}else{setUserSetting("cats","pop")}return false});if(getUserSetting("cats")){c('#category-tabs a[href="#categories-pop"]').click()}b=c("#newcat").one("focus",function(){c(this).val("").removeClass("form-input-tip")});c("#link-category-add-submit").click(function(){b.focus()});d=function(){if(a){return}a=true;var f=c(this),h=f.is(":checked"),g=f.val().toString();c("#in-link-category-"+g+", #in-popular-category-"+g).prop("checked",h);a=false};e=function(g,f){c(f.what+" response_data",g).each(function(){var h=c(c(this).text());h.find("label").each(function(){var j=c(this),l=j.find("input").val(),m=j.find("input")[0].id,i=c.trim(j.text()),k;c("#"+m).change(d);k=c('<option value="'+parseInt(l,10)+'"></option>').text(i)})})};c("#categorychecklist").wpList({alt:"",what:"link-category",response:"category-ajax-response",addAfter:e});c('a[href="#categories-all"]').click(function(){deleteUserSetting("cats")});c('a[href="#categories-pop"]').click(function(){setUserSetting("cats","pop")});if("pop"==getUserSetting("cats")){c('a[href="#categories-pop"]').click()}c("#category-add-toggle").click(function(){c(this).parents("div:first").toggleClass("wp-hidden-children");c('#category-tabs a[href="#categories-all"]').click();c("#newcategory").focus();return false});c(".categorychecklist :checkbox").change(d).filter(":checked").change()});
\ No newline at end of file
+jQuery(document).ready(function(c){var b,a=false,d,e;c("#link_name").focus();postboxes.add_postbox_toggles("link");c("#category-tabs a").click(function(){var f=c(this).attr("href");c(this).parent().addClass("tabs").siblings("li").removeClass("tabs");c(".tabs-panel").hide();c(f).show();if("#categories-all"==f){deleteUserSetting("cats")}else{setUserSetting("cats","pop")}return false});if(getUserSetting("cats")){c('#category-tabs a[href="#categories-pop"]').click()}b=c("#newcat").one("focus",function(){c(this).val("").removeClass("form-input-tip")});c("#link-category-add-submit").click(function(){b.focus()});d=function(){if(a){return}a=true;var f=c(this),h=f.is(":checked"),g=f.val().toString();c("#in-link-category-"+g+", #in-popular-link_category-"+g).prop("checked",h);a=false};e=function(g,f){c(f.what+" response_data",g).each(function(){var h=c(c(this).text());h.find("label").each(function(){var j=c(this),l=j.find("input").val(),m=j.find("input")[0].id,i=c.trim(j.text()),k;c("#"+m).change(d);k=c('<option value="'+parseInt(l,10)+'"></option>').text(i)})})};c("#categorychecklist").wpList({alt:"",what:"link-category",response:"category-ajax-response",addAfter:e});c('a[href="#categories-all"]').click(function(){deleteUserSetting("cats")});c('a[href="#categories-pop"]').click(function(){setUserSetting("cats","pop")});if("pop"==getUserSetting("cats")){c('a[href="#categories-pop"]').click()}c("#category-add-toggle").click(function(){c(this).parents("div:first").toggleClass("wp-hidden-children");c('#category-tabs a[href="#categories-all"]').click();c("#newcategory").focus();return false});c(".categorychecklist :checkbox").change(d).filter(":checked").change()});
\ No newline at end of file
index 20f0fc3becd883bef6b4da4bfe7f067c03d61f47..4c6efec3dfc5249fa61a61b6bd9fa63249dbf68b 100644 (file)
@@ -42,12 +42,17 @@ var wpNavMenu;
 
                        this.attachUnsavedChangesListener();
 
-                       if( api.menuList.length ) // If no menu, we're in the + tab.
+                       if ( api.menuList.length )
                                this.initSortables();
 
-                       this.initToggles();
+                       if ( menus.oneThemeLocationNoMenus )
+                               $( '#posttype-page' ).addSelectedToMenu( api.addMenuItemToBottom );
+
+                       this.initManageLocations();
 
-                       this.initTabManager();
+                       this.initAccessibility();
+
+                       this.initToggles();
                },
 
                jQueryExtensions : function() {
@@ -84,19 +89,55 @@ var wpNavMenu;
                                        });
                                        return result;
                                },
+                               shiftHorizontally : function( dir ) {
+                                       return this.each(function(){
+                                               var t = $(this),
+                                                       depth = t.menuItemDepth(),
+                                                       newDepth = depth + dir;
+
+                                               // Change .menu-item-depth-n class
+                                               t.moveHorizontally( newDepth, depth );
+                                       });
+                               },
+                               moveHorizontally : function( newDepth, depth ) {
+                                       return this.each(function(){
+                                               var t = $(this),
+                                                       children = t.childMenuItems(),
+                                                       diff = newDepth - depth,
+                                                       subItemText = t.find('.is-submenu');
+
+                                               // Change .menu-item-depth-n class
+                                               t.updateDepthClass( newDepth, depth ).updateParentMenuItemDBId();
+
+                                               // If it has children, move those too
+                                               if ( children ) {
+                                                       children.each(function( index ) {
+                                                               var t = $(this),
+                                                                       thisDepth = t.menuItemDepth(),
+                                                                       newDepth = thisDepth + diff;
+                                                               t.updateDepthClass(newDepth, thisDepth).updateParentMenuItemDBId();
+                                                       });
+                                               }
+
+                                               // Show "Sub item" helper text
+                                               if (0 === newDepth)
+                                                       subItemText.hide();
+                                               else
+                                                       subItemText.show();
+                                       });
+                               },
                                updateParentMenuItemDBId : function() {
                                        return this.each(function(){
                                                var item = $(this),
-                                                       input = item.find('.menu-item-data-parent-id'),
-                                                       depth = item.menuItemDepth(),
-                                                       parent = item.prev();
+                                                       input = item.find( '.menu-item-data-parent-id' ),
+                                                       depth = parseInt( item.menuItemDepth() ),
+                                                       parentDepth = depth - 1,
+                                                       parent = item.prevAll( '.menu-item-depth-' + parentDepth ).first();
 
-                                               if( depth == 0 ) { // Item is on the top level, has no parent
+                                               if ( 0 == depth ) { // Item is on the top level, has no parent
                                                        input.val(0);
                                                } else { // Find the parent item, and retrieve its object id.
-                                                       while( ! parent[0] || ! parent[0].className || -1 == parent[0].className.indexOf('menu-item') || ( parent.menuItemDepth() != depth - 1 ) )
-                                                               parent = parent.prev();
-                                                       input.val( parent.find('.menu-item-data-db-id').val() );
+                                                       input.val( parent.find( '.menu-item-data-db-id' ).val() );
                                                }
                                        });
                                },
@@ -120,7 +161,7 @@ var wpNavMenu;
 
                                        return this.each(function() {
                                                var t = $(this), menuItems = {},
-                                                       checkboxes = t.find('.tabs-panel-active .categorychecklist li input:checked'),
+                                                       checkboxes = ( menus.oneThemeLocationNoMenus && 0 == t.find('.tabs-panel-active .categorychecklist li input:checked').length ) ? t.find('#page-all li input[type="checkbox"]') : t.find('.tabs-panel-active .categorychecklist li input:checked'),
                                                        re = new RegExp('menu-item\\[(\[^\\]\]*)');
 
                                                processMethod = processMethod || api.addMenuItemToBottom;
@@ -223,6 +264,261 @@ var wpNavMenu;
                        });
                },
 
+               countMenuItems : function( depth ) {
+                       return $( '.menu-item-depth-' + depth ).length;
+               },
+
+               moveMenuItem : function( $this, dir ) {
+
+                       var menuItems = $('#menu-to-edit li');
+                               menuItemsCount = menuItems.length,
+                               thisItem = $this.parents( 'li.menu-item' ),
+                               thisItemChildren = thisItem.childMenuItems(),
+                               thisItemData = thisItem.getItemData(),
+                               thisItemDepth = parseInt( thisItem.menuItemDepth() ),
+                               thisItemPosition = parseInt( thisItem.index() ),
+                               nextItem = thisItem.next(),
+                               nextItemChildren = nextItem.childMenuItems(),
+                               nextItemDepth = parseInt( nextItem.menuItemDepth() ) + 1,
+                               prevItem = thisItem.prev(),
+                               prevItemDepth = parseInt( prevItem.menuItemDepth() ),
+                               prevItemId = prevItem.getItemData()['menu-item-db-id'];
+
+                       switch ( dir ) {
+                       case 'up':
+                               var newItemPosition = thisItemPosition - 1;
+
+                               // Already at top
+                               if ( 0 === thisItemPosition )
+                                       break;
+
+                               // If a sub item is moved to top, shift it to 0 depth
+                               if ( 0 === newItemPosition && 0 !== thisItemDepth )
+                                       thisItem.moveHorizontally( 0, thisItemDepth );
+
+                               // If prev item is sub item, shift to match depth
+                               if ( 0 !== prevItemDepth )
+                                       thisItem.moveHorizontally( prevItemDepth, thisItemDepth );
+
+                               // Does this item have sub items?
+                               if ( thisItemChildren ) {
+                                       var items = thisItem.add( thisItemChildren );
+                                       // Move the entire block
+                                       items.detach().insertBefore( menuItems.eq( newItemPosition ) ).updateParentMenuItemDBId();
+                               } else {
+                                       thisItem.detach().insertBefore( menuItems.eq( newItemPosition ) ).updateParentMenuItemDBId();
+                               }
+                               break;
+                       case 'down':
+                               // Does this item have sub items?
+                               if ( thisItemChildren ) {
+                                       var items = thisItem.add( thisItemChildren ),
+                                               nextItem = menuItems.eq( items.length + thisItemPosition ),
+                                               nextItemChildren = 0 !== nextItem.childMenuItems().length;
+
+                                       if ( nextItemChildren ) {
+                                               var newDepth = parseInt( nextItem.menuItemDepth() ) + 1;
+                                               thisItem.moveHorizontally( newDepth, thisItemDepth );
+                                       }
+
+                                       // Have we reached the bottom?
+                                       if ( menuItemsCount === thisItemPosition + items.length )
+                                               break;
+
+                                       items.detach().insertAfter( menuItems.eq( thisItemPosition + items.length ) ).updateParentMenuItemDBId();
+                               } else {
+                                       // If next item has sub items, shift depth
+                                       if ( 0 !== nextItemChildren.length )
+                                               thisItem.moveHorizontally( nextItemDepth, thisItemDepth );
+
+                                       // Have we reached the bottom
+                                       if ( menuItemsCount === thisItemPosition + 1 )
+                                               break;
+                                       thisItem.detach().insertAfter( menuItems.eq( thisItemPosition + 1 ) ).updateParentMenuItemDBId();
+                               }
+                               break;
+                       case 'top':
+                               // Already at top
+                               if ( 0 === thisItemPosition )
+                                       break;
+                               // Does this item have sub items?
+                               if ( thisItemChildren ) {
+                                       var items = thisItem.add( thisItemChildren );
+                                       // Move the entire block
+                                       items.detach().insertBefore( menuItems.eq( 0 ) ).updateParentMenuItemDBId();
+                               } else {
+                                       thisItem.detach().insertBefore( menuItems.eq( 0 ) ).updateParentMenuItemDBId();
+                               }
+                               break;
+                       case 'left':
+                               // As far left as possible
+                               if ( 0 === thisItemDepth )
+                                       break;
+                               thisItem.shiftHorizontally( -1 );
+                               break;
+                       case 'right':
+                               // Can't be sub item at top
+                               if ( 0 === thisItemPosition )
+                                       break;
+                               // Already sub item of prevItem
+                               if ( thisItemData['menu-item-parent-id'] === prevItemId )
+                                       break;
+                               thisItem.shiftHorizontally( 1 );
+                               break;
+                       }
+                       $this.focus();
+                       api.registerChange();
+                       api.refreshKeyboardAccessibility();
+                       api.refreshAdvancedAccessibility();
+               },
+
+               initAccessibility : function() {
+                       api.refreshKeyboardAccessibility();
+                       api.refreshAdvancedAccessibility();
+
+                       // Events
+                       $( '.menus-move-up' ).on( 'click', function ( e ) {
+                               api.moveMenuItem( $( this ).parents( 'li.menu-item' ).find( 'a.item-edit' ), 'up' );
+                               e.preventDefault();
+                       });
+                       $( '.menus-move-down' ).on( 'click', function ( e ) {
+                               api.moveMenuItem( $( this ).parents( 'li.menu-item' ).find( 'a.item-edit' ), 'down' );
+                               e.preventDefault();
+                       });
+                       $( '.menus-move-top' ).on( 'click', function ( e ) {
+                               api.moveMenuItem( $( this ).parents( 'li.menu-item' ).find( 'a.item-edit' ), 'top' );
+                               e.preventDefault();
+                       });
+                       $( '.menus-move-left' ).on( 'click', function ( e ) {
+                               api.moveMenuItem( $( this ).parents( 'li.menu-item' ).find( 'a.item-edit' ), 'left' );
+                               e.preventDefault();
+                       });
+                       $( '.menus-move-right' ).on( 'click', function ( e ) {
+                               api.moveMenuItem( $( this ).parents( 'li.menu-item' ).find( 'a.item-edit' ), 'right' );
+                               e.preventDefault();
+                       });
+               },
+
+               refreshAdvancedAccessibility : function() {
+
+                       // Hide all links by default
+                       $( '.menu-item-settings .field-move a' ).hide();
+
+                       $( '.item-edit' ).each( function() {
+                               var $this = $(this),
+                                       movement = [],
+                                       availableMovement = '',
+                                       menuItem = $this.parents( 'li.menu-item' ).first(),
+                                       depth = menuItem.menuItemDepth(),
+                                       isPrimaryMenuItem = ( 0 === depth ),
+                                       itemName = $this.parents( '.menu-item-handle' ).find( '.menu-item-title' ).text(),
+                                       position = parseInt( menuItem.index() ),
+                                       prevItemDepth = ( isPrimaryMenuItem ) ? depth : parseInt( depth - 1 ),
+                                       prevItemNameLeft = menuItem.prevAll('.menu-item-depth-' + prevItemDepth).first().find( '.menu-item-title' ).text(),
+                                       prevItemNameRight = menuItem.prevAll('.menu-item-depth-' + depth).first().find( '.menu-item-title' ).text(),
+                                       totalMenuItems = $('#menu-to-edit li').length,
+                                       hasSameDepthSibling = menuItem.nextAll( '.menu-item-depth-' + depth ).length;
+
+                               // Where can they move this menu item?
+                               if ( 0 !== position ) {
+                                       var thisLink = menuItem.find( '.menus-move-up' );
+                                       thisLink.prop( 'title', menus.moveUp ).show();
+                               }
+
+                               if ( 0 !== position && isPrimaryMenuItem ) {
+                                       var thisLink = menuItem.find( '.menus-move-top' );
+                                       thisLink.prop( 'title', menus.moveToTop ).show();
+                               }
+
+                               if ( position + 1 !== totalMenuItems && 0 !== position ) {
+                                       var thisLink = menuItem.find( '.menus-move-down' );
+                                       thisLink.prop( 'title', menus.moveDown ).show();
+                               }
+
+                               if ( 0 === position && 0 !== hasSameDepthSibling ) {
+                                       var thisLink = menuItem.find( '.menus-move-down' );
+                                       thisLink.prop( 'title', menus.moveDown ).show();
+                               }
+
+                               if ( ! isPrimaryMenuItem ) {
+                                       var thisLink = menuItem.find( '.menus-move-left' ),
+                                               thisLinkText = menus.outFrom.replace( '%s', prevItemNameLeft );
+                                       thisLink.prop( 'title', menus.moveOutFrom.replace( '%s', prevItemNameLeft ) ).html( thisLinkText ).show();
+                               }
+
+                               if ( 0 !== position ) {
+                                       if ( menuItem.find( '.menu-item-data-parent-id' ).val() !== menuItem.prev().find( '.menu-item-data-db-id' ).val() ) {
+                                               var thisLink = menuItem.find( '.menus-move-right' ),
+                                                       thisLinkText = menus.under.replace( '%s', prevItemNameRight );
+                                               thisLink.prop( 'title', menus.moveUnder.replace( '%s', prevItemNameRight ) ).html( thisLinkText ).show();
+                                       }
+                               }
+
+                               if ( isPrimaryMenuItem ) {
+                                       var primaryItems = $( '.menu-item-depth-0' ),
+                                               itemPosition = primaryItems.index( menuItem ) + 1,
+                                               totalMenuItems = primaryItems.length,
+
+                                               // String together help text for primary menu items
+                                               title = menus.menuFocus.replace( '%1$s', itemName ).replace( '%2$d', itemPosition ).replace( '%3$d', totalMenuItems );
+                               } else {
+                                       var parentItem = menuItem.prevAll( '.menu-item-depth-' + parseInt( depth - 1 ) ).first(),
+                                               parentItemId = parentItem.find( '.menu-item-data-db-id' ).val(),
+                                               parentItemName = parentItem.find( '.menu-item-title' ).text(),
+                                               subItems = $( '.menu-item .menu-item-data-parent-id[value="' + parentItemId + '"]' ),
+                                               itemPosition = $( subItems.parents('.menu-item').get().reverse() ).index( menuItem ) + 1;
+
+                                               // String together help text for sub menu items
+                                               title = menus.subMenuFocus.replace( '%1$s', itemName ).replace( '%2$d', itemPosition ).replace( '%3$s', parentItemName );
+                               }
+
+                               $this.prop('title', title).html( title );
+                       });
+               },
+
+               refreshKeyboardAccessibility : function() {
+                       $( '.item-edit' ).off( 'focus' ).on( 'focus', function(){
+                               $(this).off( 'keydown' ).on( 'keydown', function(e){
+
+                                       var $this = $(this);
+
+                                       // Bail if it's not an arrow key
+                                       if ( 37 != e.which && 38 != e.which && 39 != e.which && 40 != e.which )
+                                               return;
+
+                                       // Avoid multiple keydown events
+                                       $this.off('keydown');
+
+                                       // Bail if there is only one menu item
+                                       if ( 1 === $('#menu-to-edit li').length )
+                                               return;
+
+                                       // If RTL, swap left/right arrows
+                                       var arrows = { '38' : 'up', '40' : 'down', '37' : 'left', '39' : 'right' };
+                                       if ( $('body').hasClass('rtl') )
+                                               arrows = { '38' : 'up', '40' : 'down', '39' : 'left', '37' : 'right' };
+
+                                       switch ( arrows[e.which] ) {
+                                       case 'up':
+                                               api.moveMenuItem( $this, 'up' );
+                                               break;
+                                       case 'down':
+                                               api.moveMenuItem( $this, 'down' );
+                                               break;
+                                       case 'left':
+                                               api.moveMenuItem( $this, 'left' );
+                                               break;
+                                       case 'right':
+                                               api.moveMenuItem( $this, 'right' );
+                                               break;
+                                       }
+                                       // Put focus back on same menu item
+                                       $( '#edit-' + thisItemData['menu-item-db-id'] ).focus();
+                                       return false;
+                               });
+                       });
+               },
+
                initToggles : function() {
                        // init postboxes
                        postboxes.add_postbox_toggles('nav-menus');
@@ -237,6 +533,16 @@ var wpNavMenu;
                        }
                        // hide fields
                        api.menuList.hideAdvancedMenuItemFields();
+
+                       $('.hide-postbox-tog').click(function () {
+                               var hidden = $( '.accordion-container li.accordion-section' ).filter(':hidden').map(function() { return this.id; }).get().join(',');
+                               $.post(ajaxurl, {
+                                       action: 'closed-postboxes',
+                                       hidden: hidden,
+                                       closedpostboxesnonce: jQuery('#closedpostboxesnonce').val(),
+                                       page: 'nav-menus'
+                               });
+                       });
                },
 
                initSortables : function() {
@@ -246,6 +552,9 @@ var wpNavMenu;
                                body = $('body'), maxChildDepth,
                                menuMaxDepth = initialMenuMaxDepth();
 
+                       if( 0 != $( '#menu-to-edit li' ).length )
+                               $( '.drag-instructions' ).show();
+
                        // Use the right edge if RTL.
                        menuEdge += api.isRTL ? api.menuList.width() : 0;
 
@@ -308,6 +617,13 @@ var wpNavMenu;
                                        // Return child elements to the list
                                        children = transport.children().insertAfter(ui.item);
 
+                                       // Add "sub menu" description
+                                       var subMenuTitle = ui.item.find( '.item-title .is-submenu' );
+                                       if ( 0 < currentDepth )
+                                               subMenuTitle.show();
+                                       else
+                                               subMenuTitle.hide();
+
                                        // Update depth classes
                                        if( depthChange != 0 ) {
                                                ui.item.updateDepthClass( currentDepth );
@@ -328,8 +644,8 @@ var wpNavMenu;
                                                ui.item[0].style.right = 0;
                                        }
 
-                                       // The width of the tab bar might have changed. Just in case.
-                                       api.refreshMenuTabs( true );
+                                       api.refreshKeyboardAccessibility();
+                                       api.refreshAdvancedAccessibility();
                                },
                                change: function(e, ui) {
                                        // Make sure the placeholder is inside the menu.
@@ -410,6 +726,19 @@ var wpNavMenu;
                        }
                },
 
+               initManageLocations : function () {
+                       $('#menu-locations-wrap form').submit(function(){
+                               window.onbeforeunload = null;
+                       });
+                       $('.menu-location-menus select').on('change', function () {
+                               var editLink = $(this).closest('tr').find('.locations-edit-menu-link');
+                               if ($(this).find('option:selected').data('orig'))
+                                       editLink.show();
+                               else
+                                       editLink.hide();
+                       });
+               },
+
                attachMenuEditListeners : function() {
                        var that = this;
                        $('#update-nav-menu').bind('click', function(e) {
@@ -461,6 +790,8 @@ var wpNavMenu;
                                if( '' == $t.val() )
                                        $t.addClass( name ).val( $t.data(name) );
                        });
+
+                       $( '.blank-slate .input-with-default-title' ).focus();
                },
 
                attachThemeLocationsListeners : function() {
@@ -572,8 +903,11 @@ var wpNavMenu;
                        $.post( ajaxurl, params, function(menuMarkup) {
                                var ins = $('#menu-instructions');
                                processMethod(menuMarkup, params);
-                               if( ! ins.hasClass('menu-instructions-inactive') && ins.siblings().length )
-                                       ins.addClass('menu-instructions-inactive');
+                               // Make it stand out a bit more visually, by adding a fadeIn
+                               $( 'li.pending' ).hide().fadeIn('slow');
+                               $( '.drag-instructions' ).show();
+                               if( ! ins.hasClass( 'menu-instructions-inactive' ) && ins.siblings().length )
+                                       ins.addClass( 'menu-instructions-inactive' );
                                callback();
                        });
                },
@@ -586,25 +920,29 @@ var wpNavMenu;
                 */
                addMenuItemToBottom : function( menuMarkup, req ) {
                        $(menuMarkup).hideAdvancedMenuItemFields().appendTo( api.targetList );
+                       api.refreshKeyboardAccessibility();
+                       api.refreshAdvancedAccessibility();
                },
 
                addMenuItemToTop : function( menuMarkup, req ) {
                        $(menuMarkup).hideAdvancedMenuItemFields().prependTo( api.targetList );
+                       api.refreshKeyboardAccessibility();
+                       api.refreshAdvancedAccessibility();
                },
 
                attachUnsavedChangesListener : function() {
-                       $('#menu-management input, #menu-management select, #menu-management, #menu-management textarea').change(function(){
+                       $('#menu-management input, #menu-management select, #menu-management, #menu-management textarea, .menu-location-menus select').change(function(){
                                api.registerChange();
                        });
 
-                       if ( 0 != $('#menu-to-edit').length ) {
+                       if ( 0 != $('#menu-to-edit').length || 0 != $('.menu-location-menus select').length ) {
                                window.onbeforeunload = function(){
                                        if ( api.menusChanged )
                                                return navMenuL10n.saveAlert;
                                };
                        } else {
                                // Make the post boxes read-only, as they can't be used yet
-                               $('#menu-settings-column').find('input,select').prop('disabled', true).end().find('a').attr('href', '#').unbind('click');
+                               $( '#menu-settings-column' ).find( 'input,select' ).end().find( 'a' ).attr( 'href', '#' ).unbind( 'click' );
                        }
                },
 
@@ -618,13 +956,10 @@ var wpNavMenu;
                                        target = $(e.target);
 
                                if ( target.hasClass('nav-tab-link') ) {
-                                       panelId = /#(.*)$/.exec(e.target.href);
-                                       if ( panelId && panelId[1] )
-                                               panelId = panelId[1]
-                                       else
-                                               return false;
 
-                                       wrapper = target.parents('.inside').first();
+                                       panelId = target.data( 'type' );
+
+                                       wrapper = target.parents('.accordion-section-content').first();
 
                                        // upon changing tabs, we want to uncheck all checkboxes
                                        $('input', wrapper).removeAttr('checked');
@@ -638,7 +973,7 @@ var wpNavMenu;
                                        // select the search bar
                                        $('.quick-search', wrapper).focus();
 
-                                       return false;
+                                       e.preventDefault();
                                } else if ( target.hasClass('select-all') ) {
                                        selectAreaMatch = /#(.*)$/.exec(e.target.href);
                                        if ( selectAreaMatch && selectAreaMatch[1] ) {
@@ -688,139 +1023,6 @@ var wpNavMenu;
                        });
                },
 
-               initTabManager : function() {
-                       var fixed = $('.nav-tabs-wrapper'),
-                               fluid = fixed.children('.nav-tabs'),
-                               active = fluid.children('.nav-tab-active'),
-                               tabs = fluid.children('.nav-tab'),
-                               tabsWidth = 0,
-                               fixedRight, fixedLeft,
-                               arrowLeft, arrowRight, resizeTimer, css = {},
-                               marginFluid = api.isRTL ? 'margin-right' : 'margin-left',
-                               marginFixed = api.isRTL ? 'margin-left' : 'margin-right',
-                               msPerPx = 2;
-
-                       /**
-                        * Refreshes the menu tabs.
-                        * Will show and hide arrows where necessary.
-                        * Scrolls to the active tab by default.
-                        *
-                        * @param savePosition {boolean} Optional. Prevents scrolling so
-                        *                that the current position is maintained. Default false.
-                        **/
-                       api.refreshMenuTabs = function( savePosition ) {
-                               var fixedWidth = fixed.width(),
-                                       margin = 0, css = {};
-                               fixedLeft = fixed.offset().left;
-                               fixedRight = fixedLeft + fixedWidth;
-
-                               if( !savePosition )
-                                       active.makeTabVisible();
-
-                               // Prevent space from building up next to the last tab if there's more to show
-                               if( tabs.last().isTabVisible() ) {
-                                       margin = fixed.width() - tabsWidth;
-                                       margin = margin > 0 ? 0 : margin;
-                                       css[marginFluid] = margin + 'px';
-                                       fluid.animate( css, 100, "linear" );
-                               }
-
-                               // Show the arrows only when necessary
-                               if( fixedWidth > tabsWidth )
-                                       arrowLeft.add( arrowRight ).hide();
-                               else
-                                       arrowLeft.add( arrowRight ).show();
-                       }
-
-                       $.fn.extend({
-                               makeTabVisible : function() {
-                                       var t = this.eq(0), left, right, css = {}, shift = 0;
-
-                                       if( ! t.length ) return this;
-
-                                       left = t.offset().left;
-                                       right = left + t.outerWidth();
-
-                                       if( right > fixedRight )
-                                               shift = fixedRight - right;
-                                       else if ( left < fixedLeft )
-                                               shift = fixedLeft - left;
-
-                                       if( ! shift ) return this;
-
-                                       css[marginFluid] = "+=" + api.negateIfRTL * shift + 'px';
-                                       fluid.animate( css, Math.abs( shift ) * msPerPx, "linear" );
-                                       return this;
-                               },
-                               isTabVisible : function() {
-                                       var t = this.eq(0),
-                                               left = t.offset().left,
-                                               right = left + t.outerWidth();
-                                       return ( right <= fixedRight && left >= fixedLeft ) ? true : false;
-                               }
-                       });
-
-                       // Find the width of all tabs
-                       tabs.each(function(){
-                               tabsWidth += $(this).outerWidth(true);
-                       });
-
-                       // Set up fixed margin for overflow, unset padding
-                       css['padding'] = 0;
-                       css[marginFixed] = (-1 * tabsWidth) + 'px';
-                       fluid.css( css );
-
-                       // Build tab navigation
-                       arrowLeft = $('<div class="nav-tabs-arrow nav-tabs-arrow-left"><a>&laquo;</a></div>');
-                       arrowRight = $('<div class="nav-tabs-arrow nav-tabs-arrow-right"><a>&raquo;</a></div>');
-                       // Attach to the document
-                       fixed.wrap('<div class="nav-tabs-nav"/>').parent().prepend( arrowLeft ).append( arrowRight );
-
-                       // Set the menu tabs
-                       api.refreshMenuTabs();
-                       // Make sure the tabs reset on resize
-                       $(window).resize(function() {
-                               if( resizeTimer ) clearTimeout(resizeTimer);
-                               resizeTimer = setTimeout( api.refreshMenuTabs, 200);
-                       });
-
-                       // Build arrow functions
-                       $.each([{
-                                       arrow : arrowLeft,
-                                       next : "next",
-                                       last : "first",
-                                       operator : "+="
-                               },{
-                                       arrow : arrowRight,
-                                       next : "prev",
-                                       last : "last",
-                                       operator : "-="
-                               }], function(){
-                               var that = this;
-                               this.arrow.mousedown(function(){
-                                       var marginFluidVal = Math.abs( parseInt( fluid.css(marginFluid) ) ),
-                                               shift = marginFluidVal,
-                                               css = {};
-
-                                       if( "-=" == that.operator )
-                                               shift = Math.abs( tabsWidth - fixed.width() ) - marginFluidVal;
-
-                                       if( ! shift ) return;
-
-                                       css[marginFluid] = that.operator + shift + 'px';
-                                       fluid.animate( css, shift * msPerPx, "linear" );
-                               }).mouseup(function(){
-                                       var tab, next;
-                                       fluid.stop(true);
-                                       tab = tabs[that.last]();
-                                       while( (next = tab[that.next]()) && next.length && ! next.isTabVisible() ) {
-                                               tab = next;
-                                       }
-                                       tab.makeTabVisible();
-                               });
-                       });
-               },
-
                eventOnClickEditLink : function(clickedEl) {
                        var settings, item,
                        matchedSection = /#(.*)$/.exec(clickedEl.href);
@@ -846,8 +1048,10 @@ var wpNavMenu;
                },
 
                eventOnClickCancelLink : function(clickedEl) {
-                       var settings = $(clickedEl).closest('.menu-item-settings');
-                       settings.setItemData( settings.data('menu-item-data') );
+                       var settings = $( clickedEl ).closest( '.menu-item-settings' ),
+                               thisMenuItem = $( clickedEl ).closest( '.menu-item' );
+                       thisMenuItem.removeClass('menu-item-edit-active').addClass('menu-item-edit-inactive');
+                       settings.setItemData( settings.data('menu-item-data') ).hide();
                        return false;
                },
 
@@ -944,9 +1148,11 @@ var wpNavMenu;
                                }, 350, function() {
                                        var ins = $('#menu-instructions');
                                        el.remove();
-                                       children.shiftDepthClass(-1).updateParentMenuItemDBId();
-                                       if( ! ins.siblings().length )
-                                               ins.removeClass('menu-instructions-inactive');
+                                       children.shiftDepthClass( -1 ).updateParentMenuItemDBId();
+                                       if( 0 == $( '#menu-to-edit li' ).length ) {
+                                               $( '.drag-instructions' ).hide();
+                                               ins.removeClass( 'menu-instructions-inactive' );
+                                       }
                                });
                },
 
index 1f936036c22370089ae3a4460cfc465a4295441d..e385728fa5286390227edd759adbe777ae40f570 100644 (file)
@@ -1 +1 @@
-var wpNavMenu;(function(b){var a=wpNavMenu={options:{menuItemDepthPerLevel:30,globalMaxDepth:11},menuList:undefined,targetList:undefined,menusChanged:false,isRTL:!!("undefined"!=typeof isRtl&&isRtl),negateIfRTL:("undefined"!=typeof isRtl&&isRtl)?-1:1,init:function(){a.menuList=b("#menu-to-edit");a.targetList=a.menuList;this.jQueryExtensions();this.attachMenuEditListeners();this.setupInputWithDefaultTitle();this.attachQuickSearchListeners();this.attachThemeLocationsListeners();this.attachTabsPanelListeners();this.attachUnsavedChangesListener();if(a.menuList.length){this.initSortables()}this.initToggles();this.initTabManager()},jQueryExtensions:function(){b.fn.extend({menuItemDepth:function(){var c=a.isRTL?this.eq(0).css("margin-right"):this.eq(0).css("margin-left");return a.pxToDepth(c&&-1!=c.indexOf("px")?c.slice(0,-2):0)},updateDepthClass:function(d,c){return this.each(function(){var e=b(this);c=c||e.menuItemDepth();b(this).removeClass("menu-item-depth-"+c).addClass("menu-item-depth-"+d)})},shiftDepthClass:function(c){return this.each(function(){var d=b(this),e=d.menuItemDepth();b(this).removeClass("menu-item-depth-"+e).addClass("menu-item-depth-"+(e+c))})},childMenuItems:function(){var c=b();this.each(function(){var d=b(this),f=d.menuItemDepth(),e=d.next();while(e.length&&e.menuItemDepth()>f){c=c.add(e);e=e.next()}});return c},updateParentMenuItemDBId:function(){return this.each(function(){var e=b(this),c=e.find(".menu-item-data-parent-id"),f=e.menuItemDepth(),d=e.prev();if(f==0){c.val(0)}else{while(!d[0]||!d[0].className||-1==d[0].className.indexOf("menu-item")||(d.menuItemDepth()!=f-1)){d=d.prev()}c.val(d.find(".menu-item-data-db-id").val())}})},hideAdvancedMenuItemFields:function(){return this.each(function(){var c=b(this);b(".hide-column-tog").not(":checked").each(function(){c.find(".field-"+b(this).val()).addClass("hidden-field")})})},addSelectedToMenu:function(c){if(0==b("#menu-to-edit").length){return false}return this.each(function(){var e=b(this),d={},g=e.find(".tabs-panel-active .categorychecklist li input:checked"),f=new RegExp("menu-item\\[([^\\]]*)");c=c||a.addMenuItemToBottom;if(!g.length){return false}e.find(".spinner").show();b(g).each(function(){var i=b(this),h=f.exec(i.attr("name")),j="undefined"==typeof h[1]?0:parseInt(h[1],10);if(this.className&&-1!=this.className.indexOf("add-to-top")){c=a.addMenuItemToTop}d[j]=i.closest("li").getItemData("add-menu-item",j)});a.addItemToMenu(d,c,function(){g.removeAttr("checked");e.find(".spinner").hide()})})},getItemData:function(f,g){f=f||"menu-item";var d={},e,c=["menu-item-db-id","menu-item-object-id","menu-item-object","menu-item-parent-id","menu-item-position","menu-item-type","menu-item-title","menu-item-url","menu-item-description","menu-item-attr-title","menu-item-target","menu-item-classes","menu-item-xfn"];if(!g&&f=="menu-item"){g=this.find(".menu-item-data-db-id").val()}if(!g){return d}this.find("input").each(function(){var h;e=c.length;while(e--){if(f=="menu-item"){h=c[e]+"["+g+"]"}else{if(f=="add-menu-item"){h="menu-item["+g+"]["+c[e]+"]"}}if(this.name&&h==this.name){d[c[e]]=this.value}}});return d},setItemData:function(c,d,e){d=d||"menu-item";if(!e&&d=="menu-item"){e=b(".menu-item-data-db-id",this).val()}if(!e){return this}this.find("input").each(function(){var f=b(this),g;b.each(c,function(h,i){if(d=="menu-item"){g=h+"["+e+"]"}else{if(d=="add-menu-item"){g="menu-item["+e+"]["+h+"]"}}if(g==f.attr("name")){f.val(i)}})});return this}})},initToggles:function(){postboxes.add_postbox_toggles("nav-menus");columns.useCheckboxesForHidden();columns.checked=function(c){b(".field-"+c).removeClass("hidden-field")};columns.unchecked=function(c){b(".field-"+c).addClass("hidden-field")};a.menuList.hideAdvancedMenuItemFields()},initSortables:function(){var p=0,e,t,d,l,o,f,c,i,s,m=a.menuList.offset().left,h=b("body"),q,n=r();m+=a.isRTL?a.menuList.width():0;a.menuList.sortable({handle:".menu-item-handle",placeholder:"sortable-placeholder",start:function(A,z){var u,x,w,v,y;if(a.isRTL){z.item[0].style.right="auto"}s=z.item.children(".menu-item-transport");e=z.item.menuItemDepth();j(z,e);w=(z.item.next()[0]==z.placeholder[0])?z.item.next():z.item;v=w.childMenuItems();s.append(v);u=s.outerHeight();u+=(u>0)?(z.placeholder.css("margin-top").slice(0,-2)*1):0;u+=z.helper.outerHeight();i=u;u-=2;z.placeholder.height(u);q=e;v.each(function(){var B=b(this).menuItemDepth();q=(B>q)?B:q});x=z.helper.find(".menu-item-handle").outerWidth();x+=a.depthToPx(q-e);x-=2;z.placeholder.width(x);y=z.placeholder.next();y.css("margin-top",i+"px");z.placeholder.detach();b(this).sortable("refresh");z.item.after(z.placeholder);y.css("margin-top",0);k(z)},stop:function(x,w){var v,u=p-e;v=s.children().insertAfter(w.item);if(u!=0){w.item.updateDepthClass(p);v.shiftDepthClass(u);g(u)}a.registerChange();w.item.updateParentMenuItemDBId();w.item[0].style.top=0;if(a.isRTL){w.item[0].style.left="auto";w.item[0].style.right=0}a.refreshMenuTabs(true)},change:function(v,u){if(!u.placeholder.parent().hasClass("menu")){(l.length)?l.after(u.placeholder):a.menuList.prepend(u.placeholder)}k(u)},sort:function(w,v){var y=v.helper.offset(),u=a.isRTL?y.left+v.helper.width():y.left,x=a.negateIfRTL*a.pxToDepth(u-m);if(x>d||y.top<f){x=d}else{if(x<t){x=t}}if(x!=p){j(v,x)}if(c&&y.top+i>c){o.after(v.placeholder);k(v);b(this).sortable("refreshPositions")}}});function k(u){var v;l=u.placeholder.prev();o=u.placeholder.next();if(l[0]==u.item[0]){l=l.prev()}if(o[0]==u.item[0]){o=o.next()}f=(l.length)?l.offset().top+l.height():0;c=(o.length)?o.offset().top+o.height()/3:0;t=(o.length)?o.menuItemDepth():0;if(l.length){d=((v=l.menuItemDepth()+1)>a.options.globalMaxDepth)?a.options.globalMaxDepth:v}else{d=0}}function j(u,v){u.placeholder.updateDepthClass(v,p);p=v}function r(){if(!h[0].className){return 0}var u=h[0].className.match(/menu-max-depth-(\d+)/);return u&&u[1]?parseInt(u[1]):0}function g(u){var v,w=n;if(u===0){return}else{if(u>0){v=q+u;if(v>n){w=v}}else{if(u<0&&q==n){while(!b(".menu-item-depth-"+w,a.menuList).length&&w>0){w--}}}}h.removeClass("menu-max-depth-"+n).addClass("menu-max-depth-"+w);n=w}},attachMenuEditListeners:function(){var c=this;b("#update-nav-menu").bind("click",function(d){if(d.target&&d.target.className){if(-1!=d.target.className.indexOf("item-edit")){return c.eventOnClickEditLink(d.target)}else{if(-1!=d.target.className.indexOf("menu-save")){return c.eventOnClickMenuSave(d.target)}else{if(-1!=d.target.className.indexOf("menu-delete")){return c.eventOnClickMenuDelete(d.target)}else{if(-1!=d.target.className.indexOf("item-delete")){return c.eventOnClickMenuItemDelete(d.target)}else{if(-1!=d.target.className.indexOf("item-cancel")){return c.eventOnClickCancelLink(d.target)}}}}}}});b('#add-custom-links input[type="text"]').keypress(function(d){if(d.keyCode===13){d.preventDefault();b("#submit-customlinkdiv").click()}})},setupInputWithDefaultTitle:function(){var c="input-with-default-title";b("."+c).each(function(){var f=b(this),e=f.attr("title"),d=f.val();f.data(c,e);if(""==d){f.val(e)}else{if(e==d){return}else{f.removeClass(c)}}}).focus(function(){var d=b(this);if(d.val()==d.data(c)){d.val("").removeClass(c)}}).blur(function(){var d=b(this);if(""==d.val()){d.addClass(c).val(d.data(c))}})},attachThemeLocationsListeners:function(){var d=b("#nav-menu-theme-locations"),c={};c.action="menu-locations-save";c["menu-settings-column-nonce"]=b("#menu-settings-column-nonce").val();d.find('input[type="submit"]').click(function(){d.find("select").each(function(){c[this.name]=b(this).val()});d.find(".spinner").show();b.post(ajaxurl,c,function(e){d.find(".spinner").hide()});return false})},attachQuickSearchListeners:function(){var c;b(".quick-search").keypress(function(f){var d=b(this);if(13==f.which){a.updateQuickSearchResults(d);return false}if(c){clearTimeout(c)}c=setTimeout(function(){a.updateQuickSearchResults(d)},400)}).attr("autocomplete","off")},updateQuickSearchResults:function(d){var c,g,e=2,f=d.val();if(f.length<e){return}c=d.parents(".tabs-panel");g={action:"menu-quick-search","response-format":"markup",menu:b("#menu").val(),"menu-settings-column-nonce":b("#menu-settings-column-nonce").val(),q:f,type:d.attr("name")};b(".spinner",c).show();b.post(ajaxurl,g,function(h){a.processQuickSearchQueryResponse(h,g,c)})},addCustomLink:function(c){var e=b("#custom-menu-item-url").val(),d=b("#custom-menu-item-name").val();c=c||a.addMenuItemToBottom;if(""==e||"http://"==e){return false}b(".customlinkdiv .spinner").show();this.addLinkToMenu(e,d,c,function(){b(".customlinkdiv .spinner").hide();b("#custom-menu-item-name").val("").blur();b("#custom-menu-item-url").val("http://")})},addLinkToMenu:function(e,d,c,f){c=c||a.addMenuItemToBottom;f=f||function(){};a.addItemToMenu({"-1":{"menu-item-type":"custom","menu-item-url":e,"menu-item-title":d}},c,f)},addItemToMenu:function(e,c,g){var f=b("#menu").val(),d=b("#menu-settings-column-nonce").val();c=c||function(){};g=g||function(){};params={action:"add-menu-item",menu:f,"menu-settings-column-nonce":d,"menu-item":e};b.post(ajaxurl,params,function(h){var i=b("#menu-instructions");c(h,params);if(!i.hasClass("menu-instructions-inactive")&&i.siblings().length){i.addClass("menu-instructions-inactive")}g()})},addMenuItemToBottom:function(c,d){b(c).hideAdvancedMenuItemFields().appendTo(a.targetList)},addMenuItemToTop:function(c,d){b(c).hideAdvancedMenuItemFields().prependTo(a.targetList)},attachUnsavedChangesListener:function(){b("#menu-management input, #menu-management select, #menu-management, #menu-management textarea").change(function(){a.registerChange()});if(0!=b("#menu-to-edit").length){window.onbeforeunload=function(){if(a.menusChanged){return navMenuL10n.saveAlert}}}else{b("#menu-settings-column").find("input,select").prop("disabled",true).end().find("a").attr("href","#").unbind("click")}},registerChange:function(){a.menusChanged=true},attachTabsPanelListeners:function(){b("#menu-settings-column").bind("click",function(h){var f,d,i,c,g=b(h.target);if(g.hasClass("nav-tab-link")){d=/#(.*)$/.exec(h.target.href);if(d&&d[1]){d=d[1]}else{return false}i=g.parents(".inside").first();b("input",i).removeAttr("checked");b(".tabs-panel-active",i).removeClass("tabs-panel-active").addClass("tabs-panel-inactive");b("#"+d,i).removeClass("tabs-panel-inactive").addClass("tabs-panel-active");b(".tabs",i).removeClass("tabs");g.parent().addClass("tabs");b(".quick-search",i).focus();return false}else{if(g.hasClass("select-all")){f=/#(.*)$/.exec(h.target.href);if(f&&f[1]){c=b("#"+f[1]+" .tabs-panel-active .menu-item-title input");if(c.length===c.filter(":checked").length){c.removeAttr("checked")}else{c.prop("checked",true)}return false}}else{if(g.hasClass("submit-add-to-menu")){a.registerChange();if(h.target.id&&"submit-customlinkdiv"==h.target.id){a.addCustomLink(a.addMenuItemToBottom)}else{if(h.target.id&&-1!=h.target.id.indexOf("submit-")){b("#"+h.target.id.replace(/submit-/,"")).addSelectedToMenu(a.addMenuItemToBottom)}}return false}else{if(g.hasClass("page-numbers")){b.post(ajaxurl,h.target.href.replace(/.*\?/,"").replace(/action=([^&]*)/,"")+"&action=menu-get-metabox",function(m){if(-1==m.indexOf("replace-id")){return}var l=b.parseJSON(m),e=document.getElementById(l["replace-id"]),k=document.createElement("div"),j=document.createElement("div");if(!l.markup||!e){return}j.innerHTML=l.markup?l.markup:"";e.parentNode.insertBefore(k,e);k.parentNode.removeChild(e);k.parentNode.insertBefore(j,k);k.parentNode.removeChild(k)});return false}}}}})},initTabManager:function(){var h=b(".nav-tabs-wrapper"),j=h.children(".nav-tabs"),g=j.children(".nav-tab-active"),m=j.children(".nav-tab"),e=0,o,f,l,d,k,i={},c=a.isRTL?"margin-right":"margin-left",p=a.isRTL?"margin-left":"margin-right",n=2;a.refreshMenuTabs=function(q){var t=h.width(),s=0,r={};f=h.offset().left;o=f+t;if(!q){g.makeTabVisible()}if(m.last().isTabVisible()){s=h.width()-e;s=s>0?0:s;r[c]=s+"px";j.animate(r,100,"linear")}if(t>e){l.add(d).hide()}else{l.add(d).show()}};b.fn.extend({makeTabVisible:function(){var u=this.eq(0),v,s,r={},q=0;if(!u.length){return this}v=u.offset().left;s=v+u.outerWidth();if(s>o){q=o-s}else{if(v<f){q=f-v}}if(!q){return this}r[c]="+="+a.negateIfRTL*q+"px";j.animate(r,Math.abs(q)*n,"linear");return this},isTabVisible:function(){var r=this.eq(0),s=r.offset().left,q=s+r.outerWidth();return(q<=o&&s>=f)?true:false}});m.each(function(){e+=b(this).outerWidth(true)});i.padding=0;i[p]=(-1*e)+"px";j.css(i);l=b('<div class="nav-tabs-arrow nav-tabs-arrow-left"><a>&laquo;</a></div>');d=b('<div class="nav-tabs-arrow nav-tabs-arrow-right"><a>&raquo;</a></div>');h.wrap('<div class="nav-tabs-nav"/>').parent().prepend(l).append(d);a.refreshMenuTabs();b(window).resize(function(){if(k){clearTimeout(k)}k=setTimeout(a.refreshMenuTabs,200)});b.each([{arrow:l,next:"next",last:"first",operator:"+="},{arrow:d,next:"prev",last:"last",operator:"-="}],function(){var q=this;this.arrow.mousedown(function(){var t=Math.abs(parseInt(j.css(c))),r=t,s={};if("-="==q.operator){r=Math.abs(e-h.width())-t}if(!r){return}s[c]=q.operator+r+"px";j.animate(s,r*n,"linear")}).mouseup(function(){var s,r;j.stop(true);s=m[q.last]();while((r=s[q.next]())&&r.length&&!r.isTabVisible()){s=r}s.makeTabVisible()})})},eventOnClickEditLink:function(d){var c,e,f=/#(.*)$/.exec(d.href);if(f&&f[1]){c=b("#"+f[1]);e=c.parent();if(0!=e.length){if(e.hasClass("menu-item-edit-inactive")){if(!c.data("menu-item-data")){c.data("menu-item-data",c.getItemData())}c.slideDown("fast");e.removeClass("menu-item-edit-inactive").addClass("menu-item-edit-active")}else{c.slideUp("fast");e.removeClass("menu-item-edit-active").addClass("menu-item-edit-inactive")}return false}}},eventOnClickCancelLink:function(d){var c=b(d).closest(".menu-item-settings");c.setItemData(c.data("menu-item-data"));return false},eventOnClickMenuSave:function(e){var f="",c=b("#menu-name"),d=c.val();if(!d||d==c.attr("title")||!d.replace(/\s+/,"")){c.parent().addClass("form-invalid");return false}b("#nav-menu-theme-locations select").each(function(){f+='<input type="hidden" name="'+this.name+'" value="'+b(this).val()+'" />'});b("#update-nav-menu").append(f);a.menuList.find(".menu-item-data-position").val(function(g){return g+1});window.onbeforeunload=null;return true},eventOnClickMenuDelete:function(c){if(confirm(navMenuL10n.warnDeleteMenu)){window.onbeforeunload=null;return true}return false},eventOnClickMenuItemDelete:function(c){var d=parseInt(c.id.replace("delete-",""),10);a.removeMenuItem(b("#menu-item-"+d));a.registerChange();return false},processQuickSearchQueryResponse:function(g,k,c){var e,i,f={},d=document.getElementById("nav-menu-meta"),j=new RegExp("menu-item\\[([^\\]]*)","g"),h=b("<div>").html(g).find("li"),l;if(!h.length){b(".categorychecklist",c).html("<li><p>"+navMenuL10n.noResultsFound+"</p></li>");b(".spinner",c).hide();return}h.each(function(){l=b(this);e=j.exec(l.html());if(e&&e[1]){i=e[1];while(d.elements["menu-item["+i+"][menu-item-type]"]||f[i]){i--}f[i]=true;if(i!=e[1]){l.html(l.html().replace(new RegExp("menu-item\\["+e[1]+"\\]","g"),"menu-item["+i+"]"))}}});b(".categorychecklist",c).html(h);b(".spinner",c).hide()},removeMenuItem:function(d){var c=d.childMenuItems();d.addClass("deleting").animate({opacity:0,height:0},350,function(){var e=b("#menu-instructions");d.remove();c.shiftDepthClass(-1).updateParentMenuItemDBId();if(!e.siblings().length){e.removeClass("menu-instructions-inactive")}})},depthToPx:function(c){return c*a.options.menuItemDepthPerLevel},pxToDepth:function(c){return Math.floor(c/a.options.menuItemDepthPerLevel)}};b(document).ready(function(){wpNavMenu.init()})})(jQuery);
\ No newline at end of file
+var wpNavMenu;(function(b){var a=wpNavMenu={options:{menuItemDepthPerLevel:30,globalMaxDepth:11},menuList:undefined,targetList:undefined,menusChanged:false,isRTL:!!("undefined"!=typeof isRtl&&isRtl),negateIfRTL:("undefined"!=typeof isRtl&&isRtl)?-1:1,init:function(){a.menuList=b("#menu-to-edit");a.targetList=a.menuList;this.jQueryExtensions();this.attachMenuEditListeners();this.setupInputWithDefaultTitle();this.attachQuickSearchListeners();this.attachThemeLocationsListeners();this.attachTabsPanelListeners();this.attachUnsavedChangesListener();if(a.menuList.length){this.initSortables()}if(menus.oneThemeLocationNoMenus){b("#posttype-page").addSelectedToMenu(a.addMenuItemToBottom)}this.initManageLocations();this.initAccessibility();this.initToggles()},jQueryExtensions:function(){b.fn.extend({menuItemDepth:function(){var c=a.isRTL?this.eq(0).css("margin-right"):this.eq(0).css("margin-left");return a.pxToDepth(c&&-1!=c.indexOf("px")?c.slice(0,-2):0)},updateDepthClass:function(d,c){return this.each(function(){var e=b(this);c=c||e.menuItemDepth();b(this).removeClass("menu-item-depth-"+c).addClass("menu-item-depth-"+d)})},shiftDepthClass:function(c){return this.each(function(){var d=b(this),e=d.menuItemDepth();b(this).removeClass("menu-item-depth-"+e).addClass("menu-item-depth-"+(e+c))})},childMenuItems:function(){var c=b();this.each(function(){var d=b(this),f=d.menuItemDepth(),e=d.next();while(e.length&&e.menuItemDepth()>f){c=c.add(e);e=e.next()}});return c},shiftHorizontally:function(c){return this.each(function(){var d=b(this),e=d.menuItemDepth(),f=e+c;d.moveHorizontally(f,e)})},moveHorizontally:function(d,c){return this.each(function(){var f=b(this),e=f.childMenuItems(),h=d-c,g=f.find(".is-submenu");f.updateDepthClass(d,c).updateParentMenuItemDBId();if(e){e.each(function(j){var k=b(this),i=k.menuItemDepth(),l=i+h;k.updateDepthClass(l,i).updateParentMenuItemDBId()})}if(0===d){g.hide()}else{g.show()}})},updateParentMenuItemDBId:function(){return this.each(function(){var e=b(this),c=e.find(".menu-item-data-parent-id"),g=parseInt(e.menuItemDepth()),f=g-1,d=e.prevAll(".menu-item-depth-"+f).first();if(0==g){c.val(0)}else{c.val(d.find(".menu-item-data-db-id").val())}})},hideAdvancedMenuItemFields:function(){return this.each(function(){var c=b(this);b(".hide-column-tog").not(":checked").each(function(){c.find(".field-"+b(this).val()).addClass("hidden-field")})})},addSelectedToMenu:function(c){if(0==b("#menu-to-edit").length){return false}return this.each(function(){var e=b(this),d={},g=(menus.oneThemeLocationNoMenus&&0==e.find(".tabs-panel-active .categorychecklist li input:checked").length)?e.find('#page-all li input[type="checkbox"]'):e.find(".tabs-panel-active .categorychecklist li input:checked"),f=new RegExp("menu-item\\[([^\\]]*)");c=c||a.addMenuItemToBottom;if(!g.length){return false}e.find(".spinner").show();b(g).each(function(){var i=b(this),h=f.exec(i.attr("name")),j="undefined"==typeof h[1]?0:parseInt(h[1],10);if(this.className&&-1!=this.className.indexOf("add-to-top")){c=a.addMenuItemToTop}d[j]=i.closest("li").getItemData("add-menu-item",j)});a.addItemToMenu(d,c,function(){g.removeAttr("checked");e.find(".spinner").hide()})})},getItemData:function(f,g){f=f||"menu-item";var d={},e,c=["menu-item-db-id","menu-item-object-id","menu-item-object","menu-item-parent-id","menu-item-position","menu-item-type","menu-item-title","menu-item-url","menu-item-description","menu-item-attr-title","menu-item-target","menu-item-classes","menu-item-xfn"];if(!g&&f=="menu-item"){g=this.find(".menu-item-data-db-id").val()}if(!g){return d}this.find("input").each(function(){var h;e=c.length;while(e--){if(f=="menu-item"){h=c[e]+"["+g+"]"}else{if(f=="add-menu-item"){h="menu-item["+g+"]["+c[e]+"]"}}if(this.name&&h==this.name){d[c[e]]=this.value}}});return d},setItemData:function(c,d,e){d=d||"menu-item";if(!e&&d=="menu-item"){e=b(".menu-item-data-db-id",this).val()}if(!e){return this}this.find("input").each(function(){var f=b(this),g;b.each(c,function(h,i){if(d=="menu-item"){g=h+"["+e+"]"}else{if(d=="add-menu-item"){g="menu-item["+e+"]["+h+"]"}}if(g==f.attr("name")){f.val(i)}})});return this}})},countMenuItems:function(c){return b(".menu-item-depth-"+c).length},moveMenuItem:function(i,e){var f=b("#menu-to-edit li");menuItemsCount=f.length,thisItem=i.parents("li.menu-item"),thisItemChildren=thisItem.childMenuItems(),thisItemData=thisItem.getItemData(),thisItemDepth=parseInt(thisItem.menuItemDepth()),thisItemPosition=parseInt(thisItem.index()),c=thisItem.next(),g=c.childMenuItems(),nextItemDepth=parseInt(c.menuItemDepth())+1,prevItem=thisItem.prev(),prevItemDepth=parseInt(prevItem.menuItemDepth()),prevItemId=prevItem.getItemData()["menu-item-db-id"];switch(e){case"up":var h=thisItemPosition-1;if(0===thisItemPosition){break}if(0===h&&0!==thisItemDepth){thisItem.moveHorizontally(0,thisItemDepth)}if(0!==prevItemDepth){thisItem.moveHorizontally(prevItemDepth,thisItemDepth)}if(thisItemChildren){var d=thisItem.add(thisItemChildren);d.detach().insertBefore(f.eq(h)).updateParentMenuItemDBId()}else{thisItem.detach().insertBefore(f.eq(h)).updateParentMenuItemDBId()}break;case"down":if(thisItemChildren){var d=thisItem.add(thisItemChildren),c=f.eq(d.length+thisItemPosition),g=0!==c.childMenuItems().length;if(g){var j=parseInt(c.menuItemDepth())+1;thisItem.moveHorizontally(j,thisItemDepth)}if(menuItemsCount===thisItemPosition+d.length){break}d.detach().insertAfter(f.eq(thisItemPosition+d.length)).updateParentMenuItemDBId()}else{if(0!==g.length){thisItem.moveHorizontally(nextItemDepth,thisItemDepth)}if(menuItemsCount===thisItemPosition+1){break}thisItem.detach().insertAfter(f.eq(thisItemPosition+1)).updateParentMenuItemDBId()}break;case"top":if(0===thisItemPosition){break}if(thisItemChildren){var d=thisItem.add(thisItemChildren);d.detach().insertBefore(f.eq(0)).updateParentMenuItemDBId()}else{thisItem.detach().insertBefore(f.eq(0)).updateParentMenuItemDBId()}break;case"left":if(0===thisItemDepth){break}thisItem.shiftHorizontally(-1);break;case"right":if(0===thisItemPosition){break}if(thisItemData["menu-item-parent-id"]===prevItemId){break}thisItem.shiftHorizontally(1);break}i.focus();a.registerChange();a.refreshKeyboardAccessibility();a.refreshAdvancedAccessibility()},initAccessibility:function(){a.refreshKeyboardAccessibility();a.refreshAdvancedAccessibility();b(".menus-move-up").on("click",function(c){a.moveMenuItem(b(this).parents("li.menu-item").find("a.item-edit"),"up");c.preventDefault()});b(".menus-move-down").on("click",function(c){a.moveMenuItem(b(this).parents("li.menu-item").find("a.item-edit"),"down");c.preventDefault()});b(".menus-move-top").on("click",function(c){a.moveMenuItem(b(this).parents("li.menu-item").find("a.item-edit"),"top");c.preventDefault()});b(".menus-move-left").on("click",function(c){a.moveMenuItem(b(this).parents("li.menu-item").find("a.item-edit"),"left");c.preventDefault()});b(".menus-move-right").on("click",function(c){a.moveMenuItem(b(this).parents("li.menu-item").find("a.item-edit"),"right");c.preventDefault()})},refreshAdvancedAccessibility:function(){b(".menu-item-settings .field-move a").hide();b(".item-edit").each(function(){var j=b(this),p=[],v="",h=j.parents("li.menu-item").first(),u=h.menuItemDepth(),m=(0===u),s=j.parents(".menu-item-handle").find(".menu-item-title").text(),t=parseInt(h.index()),i=(m)?u:parseInt(u-1),d=h.prevAll(".menu-item-depth-"+i).first().find(".menu-item-title").text(),l=h.prevAll(".menu-item-depth-"+u).first().find(".menu-item-title").text(),k=b("#menu-to-edit li").length,q=h.nextAll(".menu-item-depth-"+u).length;if(0!==t){var f=h.find(".menus-move-up");f.prop("title",menus.moveUp).show()}if(0!==t&&m){var f=h.find(".menus-move-top");f.prop("title",menus.moveToTop).show()}if(t+1!==k&&0!==t){var f=h.find(".menus-move-down");f.prop("title",menus.moveDown).show()}if(0===t&&0!==q){var f=h.find(".menus-move-down");f.prop("title",menus.moveDown).show()}if(!m){var f=h.find(".menus-move-left"),e=menus.outFrom.replace("%s",d);f.prop("title",menus.moveOutFrom.replace("%s",d)).html(e).show()}if(0!==t){if(h.find(".menu-item-data-parent-id").val()!==h.prev().find(".menu-item-data-db-id").val()){var f=h.find(".menus-move-right"),e=menus.under.replace("%s",l);f.prop("title",menus.moveUnder.replace("%s",l)).html(e).show()}}if(m){var r=b(".menu-item-depth-0"),x=r.index(h)+1,k=r.length,w=menus.menuFocus.replace("%1$s",s).replace("%2$d",x).replace("%3$d",k)}else{var o=h.prevAll(".menu-item-depth-"+parseInt(u-1)).first(),c=o.find(".menu-item-data-db-id").val(),n=o.find(".menu-item-title").text(),g=b('.menu-item .menu-item-data-parent-id[value="'+c+'"]'),x=b(g.parents(".menu-item").get().reverse()).index(h)+1;w=menus.subMenuFocus.replace("%1$s",s).replace("%2$d",x).replace("%3$s",n)}j.prop("title",w).html(w)})},refreshKeyboardAccessibility:function(){b(".item-edit").off("focus").on("focus",function(){b(this).off("keydown").on("keydown",function(f){var d=b(this);if(37!=f.which&&38!=f.which&&39!=f.which&&40!=f.which){return}d.off("keydown");if(1===b("#menu-to-edit li").length){return}var c={"38":"up","40":"down","37":"left","39":"right"};if(b("body").hasClass("rtl")){c={"38":"up","40":"down","39":"left","37":"right"}}switch(c[f.which]){case"up":a.moveMenuItem(d,"up");break;case"down":a.moveMenuItem(d,"down");break;case"left":a.moveMenuItem(d,"left");break;case"right":a.moveMenuItem(d,"right");break}b("#edit-"+thisItemData["menu-item-db-id"]).focus();return false})})},initToggles:function(){postboxes.add_postbox_toggles("nav-menus");columns.useCheckboxesForHidden();columns.checked=function(c){b(".field-"+c).removeClass("hidden-field")};columns.unchecked=function(c){b(".field-"+c).addClass("hidden-field")};a.menuList.hideAdvancedMenuItemFields();b(".hide-postbox-tog").click(function(){var c=b(".accordion-container li.accordion-section").filter(":hidden").map(function(){return this.id}).get().join(",");b.post(ajaxurl,{action:"closed-postboxes",hidden:c,closedpostboxesnonce:jQuery("#closedpostboxesnonce").val(),page:"nav-menus"})})},initSortables:function(){var p=0,e,t,d,l,o,f,c,i,s,m=a.menuList.offset().left,h=b("body"),q,n=r();if(0!=b("#menu-to-edit li").length){b(".drag-instructions").show()}m+=a.isRTL?a.menuList.width():0;a.menuList.sortable({handle:".menu-item-handle",placeholder:"sortable-placeholder",start:function(A,z){var u,x,w,v,y;if(a.isRTL){z.item[0].style.right="auto"}s=z.item.children(".menu-item-transport");e=z.item.menuItemDepth();j(z,e);w=(z.item.next()[0]==z.placeholder[0])?z.item.next():z.item;v=w.childMenuItems();s.append(v);u=s.outerHeight();u+=(u>0)?(z.placeholder.css("margin-top").slice(0,-2)*1):0;u+=z.helper.outerHeight();i=u;u-=2;z.placeholder.height(u);q=e;v.each(function(){var B=b(this).menuItemDepth();q=(B>q)?B:q});x=z.helper.find(".menu-item-handle").outerWidth();x+=a.depthToPx(q-e);x-=2;z.placeholder.width(x);y=z.placeholder.next();y.css("margin-top",i+"px");z.placeholder.detach();b(this).sortable("refresh");z.item.after(z.placeholder);y.css("margin-top",0);k(z)},stop:function(y,w){var v,u=p-e;v=s.children().insertAfter(w.item);var x=w.item.find(".item-title .is-submenu");if(0<p){x.show()}else{x.hide()}if(u!=0){w.item.updateDepthClass(p);v.shiftDepthClass(u);g(u)}a.registerChange();w.item.updateParentMenuItemDBId();w.item[0].style.top=0;if(a.isRTL){w.item[0].style.left="auto";w.item[0].style.right=0}a.refreshKeyboardAccessibility();a.refreshAdvancedAccessibility()},change:function(v,u){if(!u.placeholder.parent().hasClass("menu")){(l.length)?l.after(u.placeholder):a.menuList.prepend(u.placeholder)}k(u)},sort:function(w,v){var y=v.helper.offset(),u=a.isRTL?y.left+v.helper.width():y.left,x=a.negateIfRTL*a.pxToDepth(u-m);if(x>d||y.top<f){x=d}else{if(x<t){x=t}}if(x!=p){j(v,x)}if(c&&y.top+i>c){o.after(v.placeholder);k(v);b(this).sortable("refreshPositions")}}});function k(u){var v;l=u.placeholder.prev();o=u.placeholder.next();if(l[0]==u.item[0]){l=l.prev()}if(o[0]==u.item[0]){o=o.next()}f=(l.length)?l.offset().top+l.height():0;c=(o.length)?o.offset().top+o.height()/3:0;t=(o.length)?o.menuItemDepth():0;if(l.length){d=((v=l.menuItemDepth()+1)>a.options.globalMaxDepth)?a.options.globalMaxDepth:v}else{d=0}}function j(u,v){u.placeholder.updateDepthClass(v,p);p=v}function r(){if(!h[0].className){return 0}var u=h[0].className.match(/menu-max-depth-(\d+)/);return u&&u[1]?parseInt(u[1]):0}function g(u){var v,w=n;if(u===0){return}else{if(u>0){v=q+u;if(v>n){w=v}}else{if(u<0&&q==n){while(!b(".menu-item-depth-"+w,a.menuList).length&&w>0){w--}}}}h.removeClass("menu-max-depth-"+n).addClass("menu-max-depth-"+w);n=w}},initManageLocations:function(){b("#menu-locations-wrap form").submit(function(){window.onbeforeunload=null});b(".menu-location-menus select").on("change",function(){var c=b(this).closest("tr").find(".locations-edit-menu-link");if(b(this).find("option:selected").data("orig")){c.show()}else{c.hide()}})},attachMenuEditListeners:function(){var c=this;b("#update-nav-menu").bind("click",function(d){if(d.target&&d.target.className){if(-1!=d.target.className.indexOf("item-edit")){return c.eventOnClickEditLink(d.target)}else{if(-1!=d.target.className.indexOf("menu-save")){return c.eventOnClickMenuSave(d.target)}else{if(-1!=d.target.className.indexOf("menu-delete")){return c.eventOnClickMenuDelete(d.target)}else{if(-1!=d.target.className.indexOf("item-delete")){return c.eventOnClickMenuItemDelete(d.target)}else{if(-1!=d.target.className.indexOf("item-cancel")){return c.eventOnClickCancelLink(d.target)}}}}}}});b('#add-custom-links input[type="text"]').keypress(function(d){if(d.keyCode===13){d.preventDefault();b("#submit-customlinkdiv").click()}})},setupInputWithDefaultTitle:function(){var c="input-with-default-title";b("."+c).each(function(){var f=b(this),e=f.attr("title"),d=f.val();f.data(c,e);if(""==d){f.val(e)}else{if(e==d){return}else{f.removeClass(c)}}}).focus(function(){var d=b(this);if(d.val()==d.data(c)){d.val("").removeClass(c)}}).blur(function(){var d=b(this);if(""==d.val()){d.addClass(c).val(d.data(c))}});b(".blank-slate .input-with-default-title").focus()},attachThemeLocationsListeners:function(){var d=b("#nav-menu-theme-locations"),c={};c.action="menu-locations-save";c["menu-settings-column-nonce"]=b("#menu-settings-column-nonce").val();d.find('input[type="submit"]').click(function(){d.find("select").each(function(){c[this.name]=b(this).val()});d.find(".spinner").show();b.post(ajaxurl,c,function(e){d.find(".spinner").hide()});return false})},attachQuickSearchListeners:function(){var c;b(".quick-search").keypress(function(f){var d=b(this);if(13==f.which){a.updateQuickSearchResults(d);return false}if(c){clearTimeout(c)}c=setTimeout(function(){a.updateQuickSearchResults(d)},400)}).attr("autocomplete","off")},updateQuickSearchResults:function(d){var c,g,e=2,f=d.val();if(f.length<e){return}c=d.parents(".tabs-panel");g={action:"menu-quick-search","response-format":"markup",menu:b("#menu").val(),"menu-settings-column-nonce":b("#menu-settings-column-nonce").val(),q:f,type:d.attr("name")};b(".spinner",c).show();b.post(ajaxurl,g,function(h){a.processQuickSearchQueryResponse(h,g,c)})},addCustomLink:function(c){var e=b("#custom-menu-item-url").val(),d=b("#custom-menu-item-name").val();c=c||a.addMenuItemToBottom;if(""==e||"http://"==e){return false}b(".customlinkdiv .spinner").show();this.addLinkToMenu(e,d,c,function(){b(".customlinkdiv .spinner").hide();b("#custom-menu-item-name").val("").blur();b("#custom-menu-item-url").val("http://")})},addLinkToMenu:function(e,d,c,f){c=c||a.addMenuItemToBottom;f=f||function(){};a.addItemToMenu({"-1":{"menu-item-type":"custom","menu-item-url":e,"menu-item-title":d}},c,f)},addItemToMenu:function(e,c,g){var f=b("#menu").val(),d=b("#menu-settings-column-nonce").val();c=c||function(){};g=g||function(){};params={action:"add-menu-item",menu:f,"menu-settings-column-nonce":d,"menu-item":e};b.post(ajaxurl,params,function(h){var i=b("#menu-instructions");c(h,params);b("li.pending").hide().fadeIn("slow");b(".drag-instructions").show();if(!i.hasClass("menu-instructions-inactive")&&i.siblings().length){i.addClass("menu-instructions-inactive")}g()})},addMenuItemToBottom:function(c,d){b(c).hideAdvancedMenuItemFields().appendTo(a.targetList);a.refreshKeyboardAccessibility();a.refreshAdvancedAccessibility()},addMenuItemToTop:function(c,d){b(c).hideAdvancedMenuItemFields().prependTo(a.targetList);a.refreshKeyboardAccessibility();a.refreshAdvancedAccessibility()},attachUnsavedChangesListener:function(){b("#menu-management input, #menu-management select, #menu-management, #menu-management textarea, .menu-location-menus select").change(function(){a.registerChange()});if(0!=b("#menu-to-edit").length||0!=b(".menu-location-menus select").length){window.onbeforeunload=function(){if(a.menusChanged){return navMenuL10n.saveAlert}}}else{b("#menu-settings-column").find("input,select").end().find("a").attr("href","#").unbind("click")}},registerChange:function(){a.menusChanged=true},attachTabsPanelListeners:function(){b("#menu-settings-column").bind("click",function(h){var f,d,i,c,g=b(h.target);if(g.hasClass("nav-tab-link")){d=g.data("type");i=g.parents(".accordion-section-content").first();b("input",i).removeAttr("checked");b(".tabs-panel-active",i).removeClass("tabs-panel-active").addClass("tabs-panel-inactive");b("#"+d,i).removeClass("tabs-panel-inactive").addClass("tabs-panel-active");b(".tabs",i).removeClass("tabs");g.parent().addClass("tabs");b(".quick-search",i).focus();h.preventDefault()}else{if(g.hasClass("select-all")){f=/#(.*)$/.exec(h.target.href);if(f&&f[1]){c=b("#"+f[1]+" .tabs-panel-active .menu-item-title input");if(c.length===c.filter(":checked").length){c.removeAttr("checked")}else{c.prop("checked",true)}return false}}else{if(g.hasClass("submit-add-to-menu")){a.registerChange();if(h.target.id&&"submit-customlinkdiv"==h.target.id){a.addCustomLink(a.addMenuItemToBottom)}else{if(h.target.id&&-1!=h.target.id.indexOf("submit-")){b("#"+h.target.id.replace(/submit-/,"")).addSelectedToMenu(a.addMenuItemToBottom)}}return false}else{if(g.hasClass("page-numbers")){b.post(ajaxurl,h.target.href.replace(/.*\?/,"").replace(/action=([^&]*)/,"")+"&action=menu-get-metabox",function(m){if(-1==m.indexOf("replace-id")){return}var l=b.parseJSON(m),e=document.getElementById(l["replace-id"]),k=document.createElement("div"),j=document.createElement("div");if(!l.markup||!e){return}j.innerHTML=l.markup?l.markup:"";e.parentNode.insertBefore(k,e);k.parentNode.removeChild(e);k.parentNode.insertBefore(j,k);k.parentNode.removeChild(k)});return false}}}}})},eventOnClickEditLink:function(d){var c,e,f=/#(.*)$/.exec(d.href);if(f&&f[1]){c=b("#"+f[1]);e=c.parent();if(0!=e.length){if(e.hasClass("menu-item-edit-inactive")){if(!c.data("menu-item-data")){c.data("menu-item-data",c.getItemData())}c.slideDown("fast");e.removeClass("menu-item-edit-inactive").addClass("menu-item-edit-active")}else{c.slideUp("fast");e.removeClass("menu-item-edit-active").addClass("menu-item-edit-inactive")}return false}}},eventOnClickCancelLink:function(e){var d=b(e).closest(".menu-item-settings"),c=b(e).closest(".menu-item");c.removeClass("menu-item-edit-active").addClass("menu-item-edit-inactive");d.setItemData(d.data("menu-item-data")).hide();return false},eventOnClickMenuSave:function(e){var f="",c=b("#menu-name"),d=c.val();if(!d||d==c.attr("title")||!d.replace(/\s+/,"")){c.parent().addClass("form-invalid");return false}b("#nav-menu-theme-locations select").each(function(){f+='<input type="hidden" name="'+this.name+'" value="'+b(this).val()+'" />'});b("#update-nav-menu").append(f);a.menuList.find(".menu-item-data-position").val(function(g){return g+1});window.onbeforeunload=null;return true},eventOnClickMenuDelete:function(c){if(confirm(navMenuL10n.warnDeleteMenu)){window.onbeforeunload=null;return true}return false},eventOnClickMenuItemDelete:function(c){var d=parseInt(c.id.replace("delete-",""),10);a.removeMenuItem(b("#menu-item-"+d));a.registerChange();return false},processQuickSearchQueryResponse:function(g,k,c){var e,i,f={},d=document.getElementById("nav-menu-meta"),j=new RegExp("menu-item\\[([^\\]]*)","g"),h=b("<div>").html(g).find("li"),l;if(!h.length){b(".categorychecklist",c).html("<li><p>"+navMenuL10n.noResultsFound+"</p></li>");b(".spinner",c).hide();return}h.each(function(){l=b(this);e=j.exec(l.html());if(e&&e[1]){i=e[1];while(d.elements["menu-item["+i+"][menu-item-type]"]||f[i]){i--}f[i]=true;if(i!=e[1]){l.html(l.html().replace(new RegExp("menu-item\\["+e[1]+"\\]","g"),"menu-item["+i+"]"))}}});b(".categorychecklist",c).html(h);b(".spinner",c).hide()},removeMenuItem:function(d){var c=d.childMenuItems();d.addClass("deleting").animate({opacity:0,height:0},350,function(){var e=b("#menu-instructions");d.remove();c.shiftDepthClass(-1).updateParentMenuItemDBId();if(0==b("#menu-to-edit li").length){b(".drag-instructions").hide();e.removeClass("menu-instructions-inactive")}})},depthToPx:function(c){return c*a.options.menuItemDepthPerLevel},pxToDepth:function(c){return Math.floor(c/a.options.menuItemDepthPerLevel)}};b(document).ready(function(){wpNavMenu.init()})})(jQuery);
\ No newline at end of file
index f32574abdb1773f5106e655e53d8a18ac74bfb8e..26e9982e28ecdb8664de2f2d236d47c1343a28d6 100644 (file)
@@ -27,7 +27,7 @@ jQuery(document).ready(function($) {
 
        $(window).resize(function(){ tb_position(); });
 
-        $('#dashboard_plugins a.thickbox, .plugins a.thickbox').click( function() {
+       $('#dashboard_plugins, .plugins').on( 'click', 'a.thickbox', function() {
                tb_click.call(this);
 
                $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
index 4d73265c8f2fdc2cd8e3cebed93df446a1c5a0a4..4c461e5c928b20a71962faed37e9ad94c7867786 100644 (file)
@@ -1 +1 @@
-var tb_position;jQuery(document).ready(function(a){tb_position=function(){var f=a("#TB_window"),e=a(window).width(),d=a(window).height(),c=(720<e)?720:e,b=0;if(a("body.admin-bar").length){b=28}if(f.size()){f.width(c-50).height(d-45-b);a("#TB_iframeContent").width(c-50).height(d-75-b);f.css({"margin-left":"-"+parseInt(((c-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){f.css({top:20+b+"px","margin-top":"0"})}}return a("a.thickbox").each(function(){var g=a(this).attr("href");if(!g){return}g=g.replace(/&width=[0-9]+/g,"");g=g.replace(/&height=[0-9]+/g,"");a(this).attr("href",g+"&width="+(c-80)+"&height="+(d-85-b))})};a(window).resize(function(){tb_position()});a("#dashboard_plugins a.thickbox, .plugins a.thickbox").click(function(){tb_click.call(this);a("#TB_title").css({"background-color":"#222",color:"#cfcfcf"});a("#TB_ajaxWindowTitle").html("<strong>"+plugininstallL10n.plugin_information+"</strong>&nbsp;"+a(this).attr("title"));return false});a("#plugin-information #sidemenu a").click(function(){var b=a(this).attr("name");a("#plugin-information-header a.current").removeClass("current");a(this).addClass("current");a("#section-holder div.section").hide();a("#section-"+b).show();return false});a("a.install-now").click(function(){return confirm(plugininstallL10n.ays)})});
\ No newline at end of file
+var tb_position;jQuery(document).ready(function(a){tb_position=function(){var f=a("#TB_window"),e=a(window).width(),d=a(window).height(),c=(720<e)?720:e,b=0;if(a("body.admin-bar").length){b=28}if(f.size()){f.width(c-50).height(d-45-b);a("#TB_iframeContent").width(c-50).height(d-75-b);f.css({"margin-left":"-"+parseInt(((c-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){f.css({top:20+b+"px","margin-top":"0"})}}return a("a.thickbox").each(function(){var g=a(this).attr("href");if(!g){return}g=g.replace(/&width=[0-9]+/g,"");g=g.replace(/&height=[0-9]+/g,"");a(this).attr("href",g+"&width="+(c-80)+"&height="+(d-85-b))})};a(window).resize(function(){tb_position()});a("#dashboard_plugins, .plugins").on("click","a.thickbox",function(){tb_click.call(this);a("#TB_title").css({"background-color":"#222",color:"#cfcfcf"});a("#TB_ajaxWindowTitle").html("<strong>"+plugininstallL10n.plugin_information+"</strong>&nbsp;"+a(this).attr("title"));return false});a("#plugin-information #sidemenu a").click(function(){var b=a(this).attr("name");a("#plugin-information-header a.current").removeClass("current");a(this).addClass("current");a("#section-holder div.section").hide();a("#section-"+b).show();return false});a("a.install-now").click(function(){return confirm(plugininstallL10n.ays)})});
\ No newline at end of file
index 98b7942abc214a79a40bd43b5fded67733d479f4..7b7d4c394448a370ad91c81a4793572b579b9460 100644 (file)
@@ -251,13 +251,126 @@ WPRemoveThumbnail = function(nonce){
        );
 };
 
-})(jQuery);
+$(document).on( 'heartbeat-send.refresh-lock', function( e, data ) {
+       var lock = $('#active_post_lock').val(),
+               post_id = $('#post_ID').val(),
+               send = {};
+
+       if ( ! post_id || ! $('#post-lock-dialog').length )
+               return;
+
+       send['post_id'] = post_id;
+
+       if ( lock )
+               send['lock'] = lock;
+
+       data['wp-refresh-post-lock'] = send;
+});
+
+// Post locks: update the lock string or show the dialog if somebody has taken over editing
+$(document).on( 'heartbeat-tick.refresh-lock', function( e, data ) {
+       var received, wrap, avatar;
+
+       if ( data['wp-refresh-post-lock'] ) {
+               received = data['wp-refresh-post-lock'];
+
+               if ( received.lock_error ) {
+                       // show "editing taken over" message
+                       wrap = $('#post-lock-dialog');
+
+                       if ( wrap.length && ! wrap.is(':visible') ) {
+                               if ( typeof autosave == 'function' ) {
+                                       $(document).on('autosave-disable-buttons.post-lock', function() {
+                                               wrap.addClass('saving');
+                                       }).on('autosave-enable-buttons.post-lock', function() {
+                                               wrap.removeClass('saving').addClass('saved');
+                                               window.onbeforeunload = null;
+                                       });
+
+                                       // Save the latest changes and disable
+                                       if ( ! autosave() )
+                                               window.onbeforeunload = null;
+
+                                       autosave = function(){};
+                               }
+
+                               if ( received.lock_error.avatar_src ) {
+                                       avatar = $('<img class="avatar avatar-64 photo" width="64" height="64" />').attr( 'src', received.lock_error.avatar_src.replace(/&amp;/g, '&') );
+                                       wrap.find('div.post-locked-avatar').empty().append( avatar );
+                               }
+
+                               wrap.show().find('.currently-editing').text( received.lock_error.text );
+                               wrap.find('.wp-tab-first').focus();
+                       }
+               } else if ( received.new_lock ) {
+                       $('#active_post_lock').val( received.new_lock );
+               }
+       }
+});
+
+}(jQuery));
+
+(function($) {
+       var check, timeout;
+
+       function schedule() {
+               check = false;
+               window.clearTimeout( timeout );
+               timeout = window.setTimeout( function(){ check = true; }, 300000 );
+       }
+
+       $(document).on( 'heartbeat-send.wp-refresh-nonces', function( e, data ) {
+               var nonce, post_id;
+
+               if ( check ) {
+                       if ( ( post_id = $('#post_ID').val() ) && ( nonce = $('#_wpnonce').val() ) ) {
+                               data['wp-refresh-post-nonces'] = {
+                                       post_id: post_id,
+                                       post_nonce: nonce
+                               };
+                       }
+               }
+       }).on( 'heartbeat-tick.wp-refresh-nonces', function( e, data ) {
+               var nonces = data['wp-refresh-post-nonces'];
+
+               if ( nonces ) {
+                       schedule();
+
+                       if ( nonces.replace ) {
+                               $.each( nonces.replace, function( selector, value ) {
+                                       $( '#' + selector ).val( value );
+                               });
+                       }
+
+                       if ( nonces.heartbeatNonce )
+                               window.heartbeatSettings.nonce = nonces.heartbeatNonce;
+               }
+       }).ready( function() {
+               schedule();
+       });
+}(jQuery));
 
 jQuery(document).ready( function($) {
        var stamp, visibility, sticky = '', last = 0, co = $('#content');
 
        postboxes.add_postbox_toggles(pagenow);
 
+       // Post locks: contain focus inside the dialog. If the dialog is shown, focus the first item.
+       $('#post-lock-dialog .notification-dialog').on( 'keydown', function(e) {
+               if ( e.which != 9 )
+                       return;
+
+               var target = $(e.target);
+
+               if ( target.hasClass('wp-tab-first') && e.shiftKey ) {
+                       $(this).find('.wp-tab-last').focus();
+                       e.preventDefault();
+               } else if ( target.hasClass('wp-tab-last') && ! e.shiftKey ) {
+                       $(this).find('.wp-tab-first').focus();
+                       e.preventDefault();
+               }
+       }).filter(':visible').find('.wp-tab-first').focus();
+
        // multi-taxonomies
        if ( $('#tagsdiv-post_tag').length ) {
                tagBox.init();
@@ -272,7 +385,7 @@ jQuery(document).ready( function($) {
 
        // categories
        $('.categorydiv').each( function(){
-               var this_id = $(this).attr('id'), noSyncChecks = false, syncChecks, catAddAfter, taxonomyParts, taxonomy, settingName;
+               var this_id = $(this).attr('id'), catAddBefore, catAddAfter, taxonomyParts, taxonomy, settingName;
 
                taxonomyParts = this_id.split('-');
                taxonomyParts.shift();
@@ -302,21 +415,12 @@ jQuery(document).ready( function($) {
 
                $('#new' + taxonomy).keypress( function(event){
                        if( 13 === event.keyCode ) {
-                                event.preventDefault();
-                                $('#' + taxonomy + '-add-submit').click();
+                               event.preventDefault();
+                               $('#' + taxonomy + '-add-submit').click();
                        }
                });
                $('#' + taxonomy + '-add-submit').click( function(){ $('#new' + taxonomy).focus(); });
 
-               syncChecks = function() {
-                       if ( noSyncChecks )
-                               return;
-                       noSyncChecks = true;
-                       var th = jQuery(this), c = th.is(':checked'), id = th.val().toString();
-                       $('#in-' + taxonomy + '-' + id + ', #in-' + taxonomy + '-category-' + id).prop( 'checked', c );
-                       noSyncChecks = false;
-               };
-
                catAddBefore = function( s ) {
                        if ( !$('#new'+taxonomy).val() )
                                return false;
@@ -349,7 +453,7 @@ jQuery(document).ready( function($) {
                        return false;
                });
 
-               $('#' + taxonomy + 'checklist li.popular-category input[type="checkbox"], #' + taxonomy + 'checklist-pop input[type="checkbox"]').live( 'click', function(){
+               $('#' + taxonomy + 'checklist, #' + taxonomy + 'checklist-pop').on( 'click', 'li.popular-category > label input[type="checkbox"]', function() {
                        var t = $(this), c = t.is(':checked'), id = t.val();
                        if ( id && t.parents('#taxonomy-'+taxonomy).length )
                                $('#in-' + taxonomy + '-' + id + ', #in-popular-' + taxonomy + '-' + id).prop( 'checked', c );
@@ -423,11 +527,12 @@ jQuery(document).ready( function($) {
                        } else {
                                $('#timestamp').html(
                                        publishOn + ' <b>' +
-                                       $('option[value="' + $('#mm').val() + '"]', '#mm').text() + ' ' +
-                                       jj + ', ' +
-                                       aa + ' @ ' +
-                                       hh + ':' +
-                                       mn + '</b> '
+                                       postL10n.dateFormat.replace( '%1$s', $('option[value="' + $('#mm').val() + '"]', '#mm').text() )
+                                               .replace( '%2$s', jj )
+                                               .replace( '%3$s', aa )
+                                               .replace( '%4$s', hh )
+                                               .replace( '%5$s', mn )
+                                       + '</b> '
                                );
                        }
 
@@ -478,7 +583,7 @@ jQuery(document).ready( function($) {
                $('.cancel-post-visibility', '#post-visibility-select').click(function () {
                        $('#post-visibility-select').slideUp('fast');
                        $('#visibility-radio-' + $('#hidden-post-visibility').val()).prop('checked', true);
-                       $('#post_password').val($('#hidden_post_password').val());
+                       $('#post_password').val($('#hidden-post-password').val());
                        $('#sticky').prop('checked', $('#hidden-post-sticky').prop('checked'));
                        $('#post-visibility-display').html(visibility);
                        $('.edit-visibility', '#visibility').show();
@@ -593,7 +698,13 @@ jQuery(document).ready( function($) {
                                        new_title: $('#title').val(),
                                        samplepermalinknonce: $('#samplepermalinknonce').val()
                                }, function(data) {
-                                       $('#edit-slug-box').html(data);
+                                       var box = $('#edit-slug-box');
+                                       box.html(data);
+                                       if (box.hasClass('hidden')) {
+                                               box.fadeIn('fast', function () {
+                                                       box.removeClass('hidden');
+                                               });
+                                       }
                                        b.html(revert_b);
                                        real_slug.val(new_slug);
                                        makeSlugeditClickable();
@@ -616,7 +727,7 @@ jQuery(document).ready( function($) {
                        }
 
                        slug_value = ( c > full.length / 4 ) ? '' : full;
-                       e.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children('input').keypress(function(e){
+                       e.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children('input').keypress(function(e) {
                                var key = e.keyCode || 0;
                                // on enter, just save the new slug, don't save the post
                                if ( 13 == key ) {
@@ -627,6 +738,7 @@ jQuery(document).ready( function($) {
                                        b.children('.cancel').click();
                                        return false;
                                }
+                       }).keyup(function(e) {
                                real_slug.val(this.value);
                        }).focus();
                }
@@ -790,5 +902,20 @@ jQuery(document).ready( function($) {
                                });
                        });
                });
+
+               // When changing post formats, change the editor body class
+               $('#post-formats-select input.post-format').on( 'change.set-editor-class', function( event ) {
+                       var editor, body, format = this.id;
+
+                       if ( format && $( this ).prop('checked') ) {
+                               editor = tinymce.get( 'content' );
+
+                               if ( editor ) {
+                                       body = editor.getBody();
+                                       body.className = body.className.replace( /\bpost-format-[^ ]+/, '' );
+                                       editor.dom.addClass( body, format == 'post-format-0' ? 'post-format-standard' : format );
+                               }
+                       }
+               });
        }
 });
index 2fa2b0ca43f344cb7500c71897703f6ee22dddc3..921278a192c4ab6dbf52efa9052e409580808017 100644 (file)
@@ -1 +1 @@
-var tagBox,commentsBox,editPermalink,makeSlugeditClickable,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail,wptitlehint;function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&&jQuery.inArray(d,c)==-1){c.push(d)}});return c}(function(a){tagBox={clean:function(c){var b=postL10n.comma;if(","!==b){c=c.replace(new RegExp(b,"g"),",")}c=c.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,"");if(","!==b){c=c.replace(/,/g,b)}return c},parseTags:function(f){var i=f.id,c=i.split("-check-num-")[1],e=a(f).closest(".tagsdiv"),h=e.find(".the-tags"),b=postL10n.comma,d=h.val().split(b),g=[];delete d[c];a.each(d,function(j,k){k=a.trim(k);if(k){g.push(k)}});h.val(this.clean(g.join(b)));this.quickClicks(e);return false},quickClicks:function(d){var g=a(".the-tags",d),e=a(".tagchecklist",d),f=a(d).attr("id"),b,c;if(!g.length){return}c=g.prop("disabled");b=g.val().split(postL10n.comma);e.empty();a.each(b,function(i,k){var j,h;k=a.trim(k);if(!k){return}j=a("<span />").text(k);if(!c){h=a('<a id="'+f+"-check-num-"+i+'" class="ntdelbutton">X</a>');h.click(function(){tagBox.parseTags(this)});j.prepend("&nbsp;").prepend(h)}e.append(j)})},flushTags:function(g,c,h){c=c||false;var d=a(".the-tags",g),j=a("input.newtag",g),b=postL10n.comma,e,i;i=c?a(c).text():j.val();tagsval=d.val();e=tagsval?tagsval+b+i:i;e=this.clean(e);e=array_unique_noempty(e.split(b)).join(b);d.val(e);this.quickClicks(g);if(!c){j.val("")}if("undefined"==typeof(h)){j.focus()}return false},get:function(c){var b=c.substr(c.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:b},function(e,d){if(0==e||"success"!=d){e=wpAjax.broken}e=a('<p id="tagcloud-'+b+'" class="the-tagcloud">'+e+"</p>");a("a",e).click(function(){tagBox.flushTags(a(this).closest(".inside").children(".tagsdiv"),this);return false});a("#"+c).after(e)})},init:function(){var b=this,c=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)});a("input.tagadd",c).click(function(){b.flushTags(a(this).closest(".tagsdiv"))});a("div.taghint",c).click(function(){a(this).css("visibility","hidden").parent().siblings(".newtag").focus()});a("input.newtag",c).blur(function(){if(this.value==""){a(this).parent().siblings(".taghint").css("visibility","")}}).focus(function(){a(this).parent().siblings(".taghint").css("visibility","hidden")}).keyup(function(d){if(13==d.which){tagBox.flushTags(a(this).closest(".tagsdiv"));return false}}).keypress(function(d){if(13==d.which){d.preventDefault();return false}}).each(function(){var d=a(this).closest("div.tagsdiv").attr("id");a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+d,{delay:500,minchars:2,multiple:true,multipleSep:postL10n.comma+" "})});a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,false,1)})});a("a.tagcloud-link").click(function(){tagBox.get(a(this).attr("id"));a(this).unbind().click(function(){a(this).siblings(".the-tagcloud").toggle();return false});return false})}};commentsBox={st:0,get:function(d,c){var b=this.st,e;if(!c){c=20}this.st+=c;this.total=d;a("#commentsdiv .spinner").show();e={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),p:a("#post_ID").val(),start:b,number:c};a.post(ajaxurl,e,function(f){f=wpAjax.parseAjaxResponse(f);a("#commentsdiv .widefat").show();a("#commentsdiv .spinner").hide();if("object"==typeof f&&f.responses[0]){a("#the-comment-list").append(f.responses[0].data);theList=theExtraList=null;a("a[className*=':']").unbind();if(commentsBox.st>commentsBox.total){a("#show-comments").hide()}else{a("#show-comments").show().children("a").html(postL10n.showcomm)}return}else{if(1==f){a("#show-comments").html(postL10n.endcomm);return}}a("#the-comment-list").append('<tr><td colspan="2">'+wpAjax.broken+"</td></tr>")});return false}};WPSetThumbnailHTML=function(b){a(".inside","#postimagediv").html(b)};WPSetThumbnailID=function(c){var b=a('input[value="_thumbnail_id"]',"#list-table");if(b.size()>0){a("#meta\\["+b.attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(c)}};WPRemoveThumbnail=function(b){a.post(ajaxurl,{action:"set-post-thumbnail",post_id:a("#post_ID").val(),thumbnail_id:-1,_ajax_nonce:b,cookie:encodeURIComponent(document.cookie)},function(c){if(c=="0"){alert(setPostThumbnailL10n.error)}else{WPSetThumbnailHTML(c)}})}})(jQuery);jQuery(document).ready(function(f){var b,a,g="",e=0,h=f("#content");postboxes.add_postbox_toggles(pagenow);if(f("#tagsdiv-post_tag").length){tagBox.init()}else{f("#side-sortables, #normal-sortables, #advanced-sortables").children("div.postbox").each(function(){if(this.id.indexOf("tagsdiv-")===0){tagBox.init();return false}})}f(".categorydiv").each(function(){var n=f(this).attr("id"),j=false,m,o,l,i,k;l=n.split("-");l.shift();i=l.join("-");k=i+"_tab";if(i=="category"){k="cats"}f("a","#"+i+"-tabs").click(function(){var p=f(this).attr("href");f(this).parent().addClass("tabs").siblings("li").removeClass("tabs");f("#"+i+"-tabs").siblings(".tabs-panel").hide();f(p).show();if("#"+i+"-all"==p){deleteUserSetting(k)}else{setUserSetting(k,"pop")}return false});if(getUserSetting(k)){f('a[href="#'+i+'-pop"]',"#"+i+"-tabs").click()}f("#new"+i).one("focus",function(){f(this).val("").removeClass("form-input-tip")});f("#new"+i).keypress(function(p){if(13===p.keyCode){p.preventDefault();f("#"+i+"-add-submit").click()}});f("#"+i+"-add-submit").click(function(){f("#new"+i).focus()});m=function(){if(j){return}j=true;var p=jQuery(this),r=p.is(":checked"),q=p.val().toString();f("#in-"+i+"-"+q+", #in-"+i+"-category-"+q).prop("checked",r);j=false};catAddBefore=function(p){if(!f("#new"+i).val()){return false}p.data+="&"+f(":checked","#"+i+"checklist").serialize();f("#"+i+"-add-submit").prop("disabled",true);return p};o=function(u,t){var q,p=f("#new"+i+"_parent");f("#"+i+"-add-submit").prop("disabled",false);if("undefined"!=t.parsed.responses[0]&&(q=t.parsed.responses[0].supplemental.newcat_parent)){p.before(q);p.remove()}};f("#"+i+"checklist").wpList({alt:"",response:i+"-ajax-response",addBefore:catAddBefore,addAfter:o});f("#"+i+"-add-toggle").click(function(){f("#"+i+"-adder").toggleClass("wp-hidden-children");f('a[href="#'+i+'-all"]',"#"+i+"-tabs").click();f("#new"+i).focus();return false});f("#"+i+'checklist li.popular-category input[type="checkbox"], #'+i+'checklist-pop input[type="checkbox"]').live("click",function(){var p=f(this),r=p.is(":checked"),q=p.val();if(q&&p.parents("#taxonomy-"+i).length){f("#in-"+i+"-"+q+", #in-popular-"+i+"-"+q).prop("checked",r)}})});if(f("#postcustom").length){f("#the-list").wpList({addAfter:function(i,j){f("table#list-table").show()},addBefore:function(i){i.data+="&post_id="+f("#post_ID").val();return i}})}if(f("#submitdiv").length){b=f("#timestamp").html();a=f("#post-visibility-display").html();function d(){var i=f("#post-visibility-select");if(f("input:radio:checked",i).val()!="public"){f("#sticky").prop("checked",false);f("#sticky-span").hide()}else{f("#sticky-span").show()}if(f("input:radio:checked",i).val()!="password"){f("#password-span").hide()}else{f("#password-span").show()}}function c(){if(!f("#timestampdiv").length){return true}var p,q,j,s,r=f("#post_status"),k=f('option[value="publish"]',r),i=f("#aa").val(),n=f("#mm").val(),o=f("#jj").val(),m=f("#hh").val(),l=f("#mn").val();p=new Date(i,n-1,o,m,l);q=new Date(f("#hidden_aa").val(),f("#hidden_mm").val()-1,f("#hidden_jj").val(),f("#hidden_hh").val(),f("#hidden_mn").val());j=new Date(f("#cur_aa").val(),f("#cur_mm").val()-1,f("#cur_jj").val(),f("#cur_hh").val(),f("#cur_mn").val());if(p.getFullYear()!=i||(1+p.getMonth())!=n||p.getDate()!=o||p.getMinutes()!=l){f(".timestamp-wrap","#timestampdiv").addClass("form-invalid");return false}else{f(".timestamp-wrap","#timestampdiv").removeClass("form-invalid")}if(p>j&&f("#original_post_status").val()!="future"){s=postL10n.publishOnFuture;f("#publish").val(postL10n.schedule)}else{if(p<=j&&f("#original_post_status").val()!="publish"){s=postL10n.publishOn;f("#publish").val(postL10n.publish)}else{s=postL10n.publishOnPast;f("#publish").val(postL10n.update)}}if(q.toUTCString()==p.toUTCString()){f("#timestamp").html(b)}else{f("#timestamp").html(s+" <b>"+f('option[value="'+f("#mm").val()+'"]',"#mm").text()+" "+o+", "+i+" @ "+m+":"+l+"</b> ")}if(f("input:radio:checked","#post-visibility-select").val()=="private"){f("#publish").val(postL10n.update);if(k.length==0){r.append('<option value="publish">'+postL10n.privatelyPublished+"</option>")}else{k.html(postL10n.privatelyPublished)}f('option[value="publish"]',r).prop("selected",true);f(".edit-post-status","#misc-publishing-actions").hide()}else{if(f("#original_post_status").val()=="future"||f("#original_post_status").val()=="draft"){if(k.length){k.remove();r.val(f("#hidden_post_status").val())}}else{k.html(postL10n.published)}if(r.is(":hidden")){f(".edit-post-status","#misc-publishing-actions").show()}}f("#post-status-display").html(f("option:selected",r).text());if(f("option:selected",r).val()=="private"||f("option:selected",r).val()=="publish"){f("#save-post").hide()}else{f("#save-post").show();if(f("option:selected",r).val()=="pending"){f("#save-post").show().val(postL10n.savePending)}else{f("#save-post").show().val(postL10n.saveDraft)}}return true}f(".edit-visibility","#visibility").click(function(){if(f("#post-visibility-select").is(":hidden")){d();f("#post-visibility-select").slideDown("fast");f(this).hide()}return false});f(".cancel-post-visibility","#post-visibility-select").click(function(){f("#post-visibility-select").slideUp("fast");f("#visibility-radio-"+f("#hidden-post-visibility").val()).prop("checked",true);f("#post_password").val(f("#hidden_post_password").val());f("#sticky").prop("checked",f("#hidden-post-sticky").prop("checked"));f("#post-visibility-display").html(a);f(".edit-visibility","#visibility").show();c();return false});f(".save-post-visibility","#post-visibility-select").click(function(){var i=f("#post-visibility-select");i.slideUp("fast");f(".edit-visibility","#visibility").show();c();if(f("input:radio:checked",i).val()!="public"){f("#sticky").prop("checked",false)}if(true==f("#sticky").prop("checked")){g="Sticky"}else{g=""}f("#post-visibility-display").html(postL10n[f("input:radio:checked",i).val()+g]);return false});f("input:radio","#post-visibility-select").change(function(){d()});f("#timestampdiv").siblings("a.edit-timestamp").click(function(){if(f("#timestampdiv").is(":hidden")){f("#timestampdiv").slideDown("fast");f("#mm").focus();f(this).hide()}return false});f(".cancel-timestamp","#timestampdiv").click(function(){f("#timestampdiv").slideUp("fast");f("#mm").val(f("#hidden_mm").val());f("#jj").val(f("#hidden_jj").val());f("#aa").val(f("#hidden_aa").val());f("#hh").val(f("#hidden_hh").val());f("#mn").val(f("#hidden_mn").val());f("#timestampdiv").siblings("a.edit-timestamp").show();c();return false});f(".save-timestamp","#timestampdiv").click(function(){if(c()){f("#timestampdiv").slideUp("fast");f("#timestampdiv").siblings("a.edit-timestamp").show()}return false});f("#post").on("submit",function(i){if(!c()){i.preventDefault();f("#timestampdiv").show();f("#publishing-action .spinner").hide();f("#publish").prop("disabled",false).removeClass("button-primary-disabled");return false}});f("#post-status-select").siblings("a.edit-post-status").click(function(){if(f("#post-status-select").is(":hidden")){f("#post-status-select").slideDown("fast");f(this).hide()}return false});f(".save-post-status","#post-status-select").click(function(){f("#post-status-select").slideUp("fast");f("#post-status-select").siblings("a.edit-post-status").show();c();return false});f(".cancel-post-status","#post-status-select").click(function(){f("#post-status-select").slideUp("fast");f("#post_status").val(f("#hidden_post_status").val());f("#post-status-select").siblings("a.edit-post-status").show();c();return false})}if(f("#edit-slug-box").length){editPermalink=function(j){var k,n=0,m=f("#editable-post-name"),o=m.html(),r=f("#post_name"),s=r.val(),p=f("#edit-slug-buttons"),q=p.html(),l=f("#editable-post-name-full").html();f("#view-post-btn").hide();p.html('<a href="#" class="save button button-small">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+"</a>");p.children(".save").click(function(){var i=m.children("input").val();if(i==f("#editable-post-name-full").text()){return f(".cancel","#edit-slug-buttons").click()}f.post(ajaxurl,{action:"sample-permalink",post_id:j,new_slug:i,new_title:f("#title").val(),samplepermalinknonce:f("#samplepermalinknonce").val()},function(t){f("#edit-slug-box").html(t);p.html(q);r.val(i);makeSlugeditClickable();f("#view-post-btn").show()});return false});f(".cancel","#edit-slug-buttons").click(function(){f("#view-post-btn").show();m.html(o);p.html(q);r.val(s);return false});for(k=0;k<l.length;++k){if("%"==l.charAt(k)){n++}}slug_value=(n>l.length/4)?"":l;m.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children("input").keypress(function(t){var i=t.keyCode||0;if(13==i){p.children(".save").click();return false}if(27==i){p.children(".cancel").click();return false}r.val(this.value)}).focus()};makeSlugeditClickable=function(){f("#editable-post-name").click(function(){f("#edit-slug-buttons").children(".edit-slug").click()})};makeSlugeditClickable()}if(typeof(wpWordCount)!="undefined"){f(document).triggerHandler("wpcountwords",[h.val()]);h.keyup(function(j){var i=j.keyCode||j.charCode;if(i==e){return true}if(13==i||8==e||46==e){f(document).triggerHandler("wpcountwords",[h.val()])}e=i;return true})}wptitlehint=function(k){k=k||"title";var i=f("#"+k),j=f("#"+k+"-prompt-text");if(i.val()==""){j.removeClass("screen-reader-text")}j.click(function(){f(this).addClass("screen-reader-text");i.focus()});i.blur(function(){if(this.value==""){j.removeClass("screen-reader-text")}}).focus(function(){j.addClass("screen-reader-text")}).keydown(function(l){j.addClass("screen-reader-text");f(this).unbind(l)})};wptitlehint();(function(){var i=f("textarea#content"),l=null,j;if(!i.length||"ontouchstart" in window){return}function k(n){i.height(Math.max(50,l+n.pageY)+"px");return false}function m(o){var n;i.focus();f(document).unbind("mousemove",k).unbind("mouseup",m);n=parseInt(i.css("height"),10);if(n&&n>50&&n<5000){setUserSetting("ed_size",n)}}i.css("resize","none");j=f('<div id="content-resize-handle"><br></div>');f("#wp-content-wrap").append(j);j.on("mousedown",function(n){l=i.height()-n.pageY;i.blur();f(document).mousemove(k).mouseup(m);return false})})();if(typeof(tinymce)!="undefined"){tinymce.onAddEditor.add(function(i,j){if(j.id!="content"||tinymce.isIOS5){return}function k(){var l,m=document.getElementById("content_ifr"),o=m?parseInt(m.style.height,10):0,n=f("#content_tbl tr.mceFirst").height();if(!o||!n){return false}l=o+n+21;l-=33;return l}j.onLoadContent.add(function(m,q){var r,n=document.getElementById("content"),l=n?parseInt(n.style.height,10):0,p=f("#content_tbl tr.mceFirst").height()||33;if(!l||l<50||l>5000){l=360}if(getUserSetting("ed_size")>5000){setUserSetting("ed_size",360)}r=(l-p)+12;if(r>50&&r<5000){f("#content_tbl").css("height","");f("#content_ifr").css("height",r+"px")}});j.onSaveContent.add(function(m,n){var l=k();if(!l||l<50||l>5000){return}f("textarea#content").css("height",l+"px")});j.onPostRender.add(function(){f("#content_resize").on("mousedown.wp-mce-resize",function(l){f(document).on("mouseup.wp-mce-resize",function(n){var m;f(document).off("mouseup.wp-mce-resize");m=k();if(m&&m>50&&m<5000){setUserSetting("ed_size",m)}})})})})}});
\ No newline at end of file
+var tagBox,commentsBox,editPermalink,makeSlugeditClickable,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail,wptitlehint;function array_unique_noempty(b){var c=[];jQuery.each(b,function(a,d){d=jQuery.trim(d);if(d&&jQuery.inArray(d,c)==-1){c.push(d)}});return c}(function(a){tagBox={clean:function(c){var b=postL10n.comma;if(","!==b){c=c.replace(new RegExp(b,"g"),",")}c=c.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,"");if(","!==b){c=c.replace(/,/g,b)}return c},parseTags:function(f){var i=f.id,c=i.split("-check-num-")[1],e=a(f).closest(".tagsdiv"),h=e.find(".the-tags"),b=postL10n.comma,d=h.val().split(b),g=[];delete d[c];a.each(d,function(j,k){k=a.trim(k);if(k){g.push(k)}});h.val(this.clean(g.join(b)));this.quickClicks(e);return false},quickClicks:function(d){var g=a(".the-tags",d),e=a(".tagchecklist",d),f=a(d).attr("id"),b,c;if(!g.length){return}c=g.prop("disabled");b=g.val().split(postL10n.comma);e.empty();a.each(b,function(i,k){var j,h;k=a.trim(k);if(!k){return}j=a("<span />").text(k);if(!c){h=a('<a id="'+f+"-check-num-"+i+'" class="ntdelbutton">X</a>');h.click(function(){tagBox.parseTags(this)});j.prepend("&nbsp;").prepend(h)}e.append(j)})},flushTags:function(g,c,h){c=c||false;var d=a(".the-tags",g),j=a("input.newtag",g),b=postL10n.comma,e,i;i=c?a(c).text():j.val();tagsval=d.val();e=tagsval?tagsval+b+i:i;e=this.clean(e);e=array_unique_noempty(e.split(b)).join(b);d.val(e);this.quickClicks(g);if(!c){j.val("")}if("undefined"==typeof(h)){j.focus()}return false},get:function(c){var b=c.substr(c.indexOf("-")+1);a.post(ajaxurl,{action:"get-tagcloud",tax:b},function(e,d){if(0==e||"success"!=d){e=wpAjax.broken}e=a('<p id="tagcloud-'+b+'" class="the-tagcloud">'+e+"</p>");a("a",e).click(function(){tagBox.flushTags(a(this).closest(".inside").children(".tagsdiv"),this);return false});a("#"+c).after(e)})},init:function(){var b=this,c=a("div.ajaxtag");a(".tagsdiv").each(function(){tagBox.quickClicks(this)});a("input.tagadd",c).click(function(){b.flushTags(a(this).closest(".tagsdiv"))});a("div.taghint",c).click(function(){a(this).css("visibility","hidden").parent().siblings(".newtag").focus()});a("input.newtag",c).blur(function(){if(this.value==""){a(this).parent().siblings(".taghint").css("visibility","")}}).focus(function(){a(this).parent().siblings(".taghint").css("visibility","hidden")}).keyup(function(d){if(13==d.which){tagBox.flushTags(a(this).closest(".tagsdiv"));return false}}).keypress(function(d){if(13==d.which){d.preventDefault();return false}}).each(function(){var d=a(this).closest("div.tagsdiv").attr("id");a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+d,{delay:500,minchars:2,multiple:true,multipleSep:postL10n.comma+" "})});a("#post").submit(function(){a("div.tagsdiv").each(function(){tagBox.flushTags(this,false,1)})});a("a.tagcloud-link").click(function(){tagBox.get(a(this).attr("id"));a(this).unbind().click(function(){a(this).siblings(".the-tagcloud").toggle();return false});return false})}};commentsBox={st:0,get:function(d,c){var b=this.st,e;if(!c){c=20}this.st+=c;this.total=d;a("#commentsdiv .spinner").show();e={action:"get-comments",mode:"single",_ajax_nonce:a("#add_comment_nonce").val(),p:a("#post_ID").val(),start:b,number:c};a.post(ajaxurl,e,function(f){f=wpAjax.parseAjaxResponse(f);a("#commentsdiv .widefat").show();a("#commentsdiv .spinner").hide();if("object"==typeof f&&f.responses[0]){a("#the-comment-list").append(f.responses[0].data);theList=theExtraList=null;a("a[className*=':']").unbind();if(commentsBox.st>commentsBox.total){a("#show-comments").hide()}else{a("#show-comments").show().children("a").html(postL10n.showcomm)}return}else{if(1==f){a("#show-comments").html(postL10n.endcomm);return}}a("#the-comment-list").append('<tr><td colspan="2">'+wpAjax.broken+"</td></tr>")});return false}};WPSetThumbnailHTML=function(b){a(".inside","#postimagediv").html(b)};WPSetThumbnailID=function(c){var b=a('input[value="_thumbnail_id"]',"#list-table");if(b.size()>0){a("#meta\\["+b.attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(c)}};WPRemoveThumbnail=function(b){a.post(ajaxurl,{action:"set-post-thumbnail",post_id:a("#post_ID").val(),thumbnail_id:-1,_ajax_nonce:b,cookie:encodeURIComponent(document.cookie)},function(c){if(c=="0"){alert(setPostThumbnailL10n.error)}else{WPSetThumbnailHTML(c)}})};a(document).on("heartbeat-send.refresh-lock",function(g,d){var c=a("#active_post_lock").val(),b=a("#post_ID").val(),f={};if(!b||!a("#post-lock-dialog").length){return}f.post_id=b;if(c){f.lock=c}d["wp-refresh-post-lock"]=f});a(document).on("heartbeat-tick.refresh-lock",function(f,d){var g,c,b;if(d["wp-refresh-post-lock"]){g=d["wp-refresh-post-lock"];if(g.lock_error){c=a("#post-lock-dialog");if(c.length&&!c.is(":visible")){if(typeof autosave=="function"){a(document).on("autosave-disable-buttons.post-lock",function(){c.addClass("saving")}).on("autosave-enable-buttons.post-lock",function(){c.removeClass("saving").addClass("saved");window.onbeforeunload=null});if(!autosave()){window.onbeforeunload=null}autosave=function(){}}if(g.lock_error.avatar_src){b=a('<img class="avatar avatar-64 photo" width="64" height="64" />').attr("src",g.lock_error.avatar_src.replace(/&amp;/g,"&"));c.find("div.post-locked-avatar").empty().append(b)}c.show().find(".currently-editing").text(g.lock_error.text);c.find(".wp-tab-first").focus()}}else{if(g.new_lock){a("#active_post_lock").val(g.new_lock)}}}})}(jQuery));(function(c){var a,b;function d(){a=false;window.clearTimeout(b);b=window.setTimeout(function(){a=true},300000)}c(document).on("heartbeat-send.wp-refresh-nonces",function(i,h){var g,f;if(a){if((f=c("#post_ID").val())&&(g=c("#_wpnonce").val())){h["wp-refresh-post-nonces"]={post_id:f,post_nonce:g}}}}).on("heartbeat-tick.wp-refresh-nonces",function(h,g){var f=g["wp-refresh-post-nonces"];if(f){d();if(f.replace){c.each(f.replace,function(e,i){c("#"+e).val(i)})}if(f.heartbeatNonce){window.heartbeatSettings.nonce=f.heartbeatNonce}}}).ready(function(){d()})}(jQuery));jQuery(document).ready(function(f){var b,a,g="",e=0,h=f("#content");postboxes.add_postbox_toggles(pagenow);f("#post-lock-dialog .notification-dialog").on("keydown",function(j){if(j.which!=9){return}var i=f(j.target);if(i.hasClass("wp-tab-first")&&j.shiftKey){f(this).find(".wp-tab-last").focus();j.preventDefault()}else{if(i.hasClass("wp-tab-last")&&!j.shiftKey){f(this).find(".wp-tab-first").focus();j.preventDefault()}}}).filter(":visible").find(".wp-tab-first").focus();if(f("#tagsdiv-post_tag").length){tagBox.init()}else{f("#side-sortables, #normal-sortables, #advanced-sortables").children("div.postbox").each(function(){if(this.id.indexOf("tagsdiv-")===0){tagBox.init();return false}})}f(".categorydiv").each(function(){var m=f(this).attr("id"),l,n,k,i,j;k=m.split("-");k.shift();i=k.join("-");j=i+"_tab";if(i=="category"){j="cats"}f("a","#"+i+"-tabs").click(function(){var o=f(this).attr("href");f(this).parent().addClass("tabs").siblings("li").removeClass("tabs");f("#"+i+"-tabs").siblings(".tabs-panel").hide();f(o).show();if("#"+i+"-all"==o){deleteUserSetting(j)}else{setUserSetting(j,"pop")}return false});if(getUserSetting(j)){f('a[href="#'+i+'-pop"]',"#"+i+"-tabs").click()}f("#new"+i).one("focus",function(){f(this).val("").removeClass("form-input-tip")});f("#new"+i).keypress(function(o){if(13===o.keyCode){o.preventDefault();f("#"+i+"-add-submit").click()}});f("#"+i+"-add-submit").click(function(){f("#new"+i).focus()});l=function(o){if(!f("#new"+i).val()){return false}o.data+="&"+f(":checked","#"+i+"checklist").serialize();f("#"+i+"-add-submit").prop("disabled",true);return o};n=function(t,q){var p,o=f("#new"+i+"_parent");f("#"+i+"-add-submit").prop("disabled",false);if("undefined"!=q.parsed.responses[0]&&(p=q.parsed.responses[0].supplemental.newcat_parent)){o.before(p);o.remove()}};f("#"+i+"checklist").wpList({alt:"",response:i+"-ajax-response",addBefore:l,addAfter:n});f("#"+i+"-add-toggle").click(function(){f("#"+i+"-adder").toggleClass("wp-hidden-children");f('a[href="#'+i+'-all"]',"#"+i+"-tabs").click();f("#new"+i).focus();return false});f("#"+i+"checklist, #"+i+"checklist-pop").on("click",'li.popular-category > label input[type="checkbox"]',function(){var o=f(this),q=o.is(":checked"),p=o.val();if(p&&o.parents("#taxonomy-"+i).length){f("#in-"+i+"-"+p+", #in-popular-"+i+"-"+p).prop("checked",q)}})});if(f("#postcustom").length){f("#the-list").wpList({addAfter:function(i,j){f("table#list-table").show()},addBefore:function(i){i.data+="&post_id="+f("#post_ID").val();return i}})}if(f("#submitdiv").length){b=f("#timestamp").html();a=f("#post-visibility-display").html();function d(){var i=f("#post-visibility-select");if(f("input:radio:checked",i).val()!="public"){f("#sticky").prop("checked",false);f("#sticky-span").hide()}else{f("#sticky-span").show()}if(f("input:radio:checked",i).val()!="password"){f("#password-span").hide()}else{f("#password-span").show()}}function c(){if(!f("#timestampdiv").length){return true}var p,q,j,s,r=f("#post_status"),k=f('option[value="publish"]',r),i=f("#aa").val(),n=f("#mm").val(),o=f("#jj").val(),m=f("#hh").val(),l=f("#mn").val();p=new Date(i,n-1,o,m,l);q=new Date(f("#hidden_aa").val(),f("#hidden_mm").val()-1,f("#hidden_jj").val(),f("#hidden_hh").val(),f("#hidden_mn").val());j=new Date(f("#cur_aa").val(),f("#cur_mm").val()-1,f("#cur_jj").val(),f("#cur_hh").val(),f("#cur_mn").val());if(p.getFullYear()!=i||(1+p.getMonth())!=n||p.getDate()!=o||p.getMinutes()!=l){f(".timestamp-wrap","#timestampdiv").addClass("form-invalid");return false}else{f(".timestamp-wrap","#timestampdiv").removeClass("form-invalid")}if(p>j&&f("#original_post_status").val()!="future"){s=postL10n.publishOnFuture;f("#publish").val(postL10n.schedule)}else{if(p<=j&&f("#original_post_status").val()!="publish"){s=postL10n.publishOn;f("#publish").val(postL10n.publish)}else{s=postL10n.publishOnPast;f("#publish").val(postL10n.update)}}if(q.toUTCString()==p.toUTCString()){f("#timestamp").html(b)}else{f("#timestamp").html(s+" <b>"+postL10n.dateFormat.replace("%1$s",f('option[value="'+f("#mm").val()+'"]',"#mm").text()).replace("%2$s",o).replace("%3$s",i).replace("%4$s",m).replace("%5$s",l)+"</b> ")}if(f("input:radio:checked","#post-visibility-select").val()=="private"){f("#publish").val(postL10n.update);if(k.length==0){r.append('<option value="publish">'+postL10n.privatelyPublished+"</option>")}else{k.html(postL10n.privatelyPublished)}f('option[value="publish"]',r).prop("selected",true);f(".edit-post-status","#misc-publishing-actions").hide()}else{if(f("#original_post_status").val()=="future"||f("#original_post_status").val()=="draft"){if(k.length){k.remove();r.val(f("#hidden_post_status").val())}}else{k.html(postL10n.published)}if(r.is(":hidden")){f(".edit-post-status","#misc-publishing-actions").show()}}f("#post-status-display").html(f("option:selected",r).text());if(f("option:selected",r).val()=="private"||f("option:selected",r).val()=="publish"){f("#save-post").hide()}else{f("#save-post").show();if(f("option:selected",r).val()=="pending"){f("#save-post").show().val(postL10n.savePending)}else{f("#save-post").show().val(postL10n.saveDraft)}}return true}f(".edit-visibility","#visibility").click(function(){if(f("#post-visibility-select").is(":hidden")){d();f("#post-visibility-select").slideDown("fast");f(this).hide()}return false});f(".cancel-post-visibility","#post-visibility-select").click(function(){f("#post-visibility-select").slideUp("fast");f("#visibility-radio-"+f("#hidden-post-visibility").val()).prop("checked",true);f("#post_password").val(f("#hidden-post-password").val());f("#sticky").prop("checked",f("#hidden-post-sticky").prop("checked"));f("#post-visibility-display").html(a);f(".edit-visibility","#visibility").show();c();return false});f(".save-post-visibility","#post-visibility-select").click(function(){var i=f("#post-visibility-select");i.slideUp("fast");f(".edit-visibility","#visibility").show();c();if(f("input:radio:checked",i).val()!="public"){f("#sticky").prop("checked",false)}if(true==f("#sticky").prop("checked")){g="Sticky"}else{g=""}f("#post-visibility-display").html(postL10n[f("input:radio:checked",i).val()+g]);return false});f("input:radio","#post-visibility-select").change(function(){d()});f("#timestampdiv").siblings("a.edit-timestamp").click(function(){if(f("#timestampdiv").is(":hidden")){f("#timestampdiv").slideDown("fast");f("#mm").focus();f(this).hide()}return false});f(".cancel-timestamp","#timestampdiv").click(function(){f("#timestampdiv").slideUp("fast");f("#mm").val(f("#hidden_mm").val());f("#jj").val(f("#hidden_jj").val());f("#aa").val(f("#hidden_aa").val());f("#hh").val(f("#hidden_hh").val());f("#mn").val(f("#hidden_mn").val());f("#timestampdiv").siblings("a.edit-timestamp").show();c();return false});f(".save-timestamp","#timestampdiv").click(function(){if(c()){f("#timestampdiv").slideUp("fast");f("#timestampdiv").siblings("a.edit-timestamp").show()}return false});f("#post").on("submit",function(i){if(!c()){i.preventDefault();f("#timestampdiv").show();f("#publishing-action .spinner").hide();f("#publish").prop("disabled",false).removeClass("button-primary-disabled");return false}});f("#post-status-select").siblings("a.edit-post-status").click(function(){if(f("#post-status-select").is(":hidden")){f("#post-status-select").slideDown("fast");f(this).hide()}return false});f(".save-post-status","#post-status-select").click(function(){f("#post-status-select").slideUp("fast");f("#post-status-select").siblings("a.edit-post-status").show();c();return false});f(".cancel-post-status","#post-status-select").click(function(){f("#post-status-select").slideUp("fast");f("#post_status").val(f("#hidden_post_status").val());f("#post-status-select").siblings("a.edit-post-status").show();c();return false})}if(f("#edit-slug-box").length){editPermalink=function(j){var k,n=0,m=f("#editable-post-name"),o=m.html(),r=f("#post_name"),s=r.val(),p=f("#edit-slug-buttons"),q=p.html(),l=f("#editable-post-name-full").html();f("#view-post-btn").hide();p.html('<a href="#" class="save button button-small">'+postL10n.ok+'</a> <a class="cancel" href="#">'+postL10n.cancel+"</a>");p.children(".save").click(function(){var i=m.children("input").val();if(i==f("#editable-post-name-full").text()){return f(".cancel","#edit-slug-buttons").click()}f.post(ajaxurl,{action:"sample-permalink",post_id:j,new_slug:i,new_title:f("#title").val(),samplepermalinknonce:f("#samplepermalinknonce").val()},function(u){var t=f("#edit-slug-box");t.html(u);if(t.hasClass("hidden")){t.fadeIn("fast",function(){t.removeClass("hidden")})}p.html(q);r.val(i);makeSlugeditClickable();f("#view-post-btn").show()});return false});f(".cancel","#edit-slug-buttons").click(function(){f("#view-post-btn").show();m.html(o);p.html(q);r.val(s);return false});for(k=0;k<l.length;++k){if("%"==l.charAt(k)){n++}}slug_value=(n>l.length/4)?"":l;m.html('<input type="text" id="new-post-slug" value="'+slug_value+'" />').children("input").keypress(function(t){var i=t.keyCode||0;if(13==i){p.children(".save").click();return false}if(27==i){p.children(".cancel").click();return false}}).keyup(function(i){r.val(this.value)}).focus()};makeSlugeditClickable=function(){f("#editable-post-name").click(function(){f("#edit-slug-buttons").children(".edit-slug").click()})};makeSlugeditClickable()}if(typeof(wpWordCount)!="undefined"){f(document).triggerHandler("wpcountwords",[h.val()]);h.keyup(function(j){var i=j.keyCode||j.charCode;if(i==e){return true}if(13==i||8==e||46==e){f(document).triggerHandler("wpcountwords",[h.val()])}e=i;return true})}wptitlehint=function(k){k=k||"title";var i=f("#"+k),j=f("#"+k+"-prompt-text");if(i.val()==""){j.removeClass("screen-reader-text")}j.click(function(){f(this).addClass("screen-reader-text");i.focus()});i.blur(function(){if(this.value==""){j.removeClass("screen-reader-text")}}).focus(function(){j.addClass("screen-reader-text")}).keydown(function(l){j.addClass("screen-reader-text");f(this).unbind(l)})};wptitlehint();(function(){var i=f("textarea#content"),l=null,j;if(!i.length||"ontouchstart" in window){return}function k(n){i.height(Math.max(50,l+n.pageY)+"px");return false}function m(o){var n;i.focus();f(document).unbind("mousemove",k).unbind("mouseup",m);n=parseInt(i.css("height"),10);if(n&&n>50&&n<5000){setUserSetting("ed_size",n)}}i.css("resize","none");j=f('<div id="content-resize-handle"><br></div>');f("#wp-content-wrap").append(j);j.on("mousedown",function(n){l=i.height()-n.pageY;i.blur();f(document).mousemove(k).mouseup(m);return false})})();if(typeof(tinymce)!="undefined"){tinymce.onAddEditor.add(function(i,j){if(j.id!="content"||tinymce.isIOS5){return}function k(){var l,m=document.getElementById("content_ifr"),o=m?parseInt(m.style.height,10):0,n=f("#content_tbl tr.mceFirst").height();if(!o||!n){return false}l=o+n+21;l-=33;return l}j.onLoadContent.add(function(m,q){var r,n=document.getElementById("content"),l=n?parseInt(n.style.height,10):0,p=f("#content_tbl tr.mceFirst").height()||33;if(!l||l<50||l>5000){l=360}if(getUserSetting("ed_size")>5000){setUserSetting("ed_size",360)}r=(l-p)+12;if(r>50&&r<5000){f("#content_tbl").css("height","");f("#content_ifr").css("height",r+"px")}});j.onSaveContent.add(function(m,n){var l=k();if(!l||l<50||l>5000){return}f("textarea#content").css("height",l+"px")});j.onPostRender.add(function(){f("#content_resize").on("mousedown.wp-mce-resize",function(l){f(document).on("mouseup.wp-mce-resize",function(n){var m;f(document).off("mouseup.wp-mce-resize");m=k();if(m&&m>50&&m<5000){setUserSetting("ed_size",m)}})})})});f("#post-formats-select input.post-format").on("change.set-editor-class",function(k){var j,i,l=this.id;if(l&&f(this).prop("checked")){j=tinymce.get("content");if(j){i=j.getBody();i.className=i.className.replace(/\bpost-format-[^ ]+/,"");j.dom.addClass(i,l=="post-format-0"?"post-format-standard":l)}}})}});
\ No newline at end of file
diff --git a/wp-admin/js/revisions-js.php b/wp-admin/js/revisions-js.php
deleted file mode 100644 (file)
index b262e00..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-
-// The JS here is purposefully obfuscated to preserve mystery and romance.
-// If you want to see behind the curtain, visit http://core.trac.wordpress.org/ticket/15262
-
-if ( !defined( 'ABSPATH' ) )
-       exit;
-
-/** @ignore */
-function dvortr( $str ) {
-       return strtr(
-               $str,
-               '\',.pyfgcrl/=\\aoeuidhtns-;qjkxbmwvz"<>PYFGCRL?+|AOEUIDHTNS_:QJKXBMWVZ[]',
-               'qwertyuiop[]\\asdfghjkl;\'zxcvbnm,./QWERTYUIOP{}|ASDFGHJKL:"ZXCVBNM<>?-='
-       );
-}
-
-$j = esc_url( site_url( '/wp-includes/js/jquery/jquery.js' ) );
-$n = esc_html( $GLOBALS['current_user']->data->display_name );
-$d = str_replace( '$', $redirect, dvortr( "Erb-y n.y ydco dall.b aiacbv Wa ce]-irxajt- dp.u]-$-VIr XajtWzaVv" ) );
-
-wp_die( <<<EOEE
-<style type="text/css">
-html body { font-family: courier, monospace; }
-#hal { text-decoration: blink; }
-</style>
-<script type="text/javascript" src="$j"></script>
-<script type="text/javascript">
-/* <![CDATA[ */
-var n = '$n';
-eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\\\b'+e(c)+'\\\\b','g'),k[c]);return p}('6(4(){2 e=6(\\'#Q\\').v();2 i=\\'\\\\\\',.R/=\\\\\\\\S-;T"<>U?+|V:W[]X{}\\'.u(\\'\\');2 o=\\'Y[]\\\\\\\\Z;\\\\\\'10,./11{}|12:"13<>?-=14+\\'.u(\\'\\');2 5=4(s){r=\\'\\';6.15(s.u(\\'\\'),4(){2 t=16.D();2 c=6.17(t,i);r+=\\'\$\\'==t?n:(-1==c?t:o[c])});j r};2 a=[\\'O.E[18 e.y.19.1a\\',\\'1b 1c. 1d .1e.,1f 1g\\',\\'O.E e.1h 1i 8\\',\\'9\\',\\'0\\'];2 b=[\\'<1j. 1k \$1l\\',\\'1m. 1n 1o 1p\\',\\'1q, 1r. ,1s. 1t\\'];2 w=[];2 h=6(5(\\'#1u\\'));6(5(\\'1v\\')).1w(4(e){7(1x!==e.1y){j}7(x&&x.F){x.F();j G}1z.1A=6(5(\\'#1B\\')).1C(\\'1D\\');j G});2 k=4(){2 l=a.H();7(\\'I\\'==J l){7(m){2 c={};c[5(\\'1E\\')]=5(\\'1F\\');c[5(\\'1G\\')]=5(\\'1H..b\\');6(5(\\'1I 1J\\')).1K(c);p();h.v().1L({1M:1},z,\\'1N\\',4(){h.K()});d(m,L)}j}w=5(l).u(\\'\\');A()};2 A=4(){B=w.H();7(\\'I\\'==J B){7(m){h.M(5(\\'1O 1P\\'));d(k,C)}N{7(a.P){d(p,C);d(k,z)}N{d(4(){p();h.v()},C);d(4(){e.K()},L)}}j}h.M(B.D());d(A,1Q)};2 m=4(){a=b;m=1R;k()};p=4(){2 f=6(\\'p\\').1S(0);2 g=6.1T(f.q).1U();1V(2 g=f.q.P;g>0;g--){7(3==f.q[g-1].1W||\\'1X\\'==f.q[g-1].1Y.1Z()){f.20(f.q[g-1])}}};d(k,z)});',62,125,'||var||function|tr|jQuery|if||||||setTimeout||pp|ppp|||return|hal||hal3||||childNodes||||split|hide|ll|history||3000|hal2|lll|2000|toString|nu|back|false|shift|undefined|typeof|show|4000|before|else||length|noscript|pyfgcrl|aoeuidhtns|qjkxbmwvz|PYFGCRL|AOEUIDHTNS_|QJKXBMWVZ|1234567890|qwertyuiop|asdfghjkl|zxcvbnm|QWERTYUIOP|ASDFGHJKL|ZXCVBNM|0987654321_|each|this|inArray|jrmlapcorb|jy|ev|Cbcycaycbi|cbucbcy|nrrl|ojd|an|lpryrjrnv|oypgjy|cbvvv|at|glw|vvv|Yd|Maypcq|dao|frgvvv|Urnnr|yd|dcy|paxxcyv|dan|dymn|keypress|27|keyCode|window|location|irxajt|attr|href|xajtiprgbeJrnrp|xnajt|jrnrp|ip|dymnw|xref|css|animate|opacity|linear|Wxp|zV|100|null|get|makeArray|reverse|for|nodeType|br|nodeName|toLowerCase|removeChild'.split('|'),0,{}))
-/* ]]> */
-</script>
-<span id="noscript">$d</span>
-<blink id="hal">&#x258c;</blink>
-EOEE
-,
-dvortr( 'Eabi.p!' )
-);
diff --git a/wp-admin/js/revisions.js b/wp-admin/js/revisions.js
new file mode 100644 (file)
index 0000000..6a8499f
--- /dev/null
@@ -0,0 +1,1080 @@
+window.wp = window.wp || {};
+
+(function($) {
+       var revisions;
+
+       revisions = wp.revisions = { model: {}, view: {}, controller: {} };
+
+       // Link settings.
+       revisions.settings = _.isUndefined( _wpRevisionsSettings ) ? {} : _wpRevisionsSettings;
+
+       // For debugging
+       revisions.debug = false;
+
+       revisions.log = function() {
+               if ( window.console && revisions.debug )
+                       console.log.apply( console, arguments );
+       };
+
+       // Handy functions to help with positioning
+       $.fn.allOffsets = function() {
+               var offset = this.offset() || {top: 0, left: 0}, win = $(window);
+               return _.extend( offset, {
+                       right:  win.width()  - offset.left - this.outerWidth(),
+                       bottom: win.height() - offset.top  - this.outerHeight()
+               });
+       };
+
+       $.fn.allPositions = function() {
+               var position = this.position() || {top: 0, left: 0}, parent = this.parent();
+               return _.extend( position, {
+                       right:  parent.outerWidth()  - position.left - this.outerWidth(),
+                       bottom: parent.outerHeight() - position.top  - this.outerHeight()
+               });
+       };
+
+       // wp_localize_script transforms top-level numbers into strings. Undo that.
+       if ( revisions.settings.to )
+               revisions.settings.to = parseInt( revisions.settings.to, 10 );
+       if ( revisions.settings.from )
+               revisions.settings.from = parseInt( revisions.settings.from, 10 );
+
+       // wp_localize_script does not allow for top-level booleans. Fix that.
+       if ( revisions.settings.compareTwoMode )
+               revisions.settings.compareTwoMode = revisions.settings.compareTwoMode === '1';
+
+       /**
+        * ========================================================================
+        * MODELS
+        * ========================================================================
+        */
+       revisions.model.Slider = Backbone.Model.extend({
+               defaults: {
+                       value: null,
+                       values: null,
+                       min: 0,
+                       max: 1,
+                       step: 1,
+                       range: false,
+                       compareTwoMode: false
+               },
+
+               initialize: function( options ) {
+                       this.frame = options.frame;
+                       this.revisions = options.revisions;
+
+                       // Listen for changes to the revisions or mode from outside
+                       this.listenTo( this.frame, 'update:revisions', this.receiveRevisions );
+                       this.listenTo( this.frame, 'change:compareTwoMode', this.updateMode );
+
+                       // Listen for internal changes
+                       this.listenTo( this, 'change:from', this.handleLocalChanges );
+                       this.listenTo( this, 'change:to', this.handleLocalChanges );
+                       this.listenTo( this, 'change:compareTwoMode', this.updateSliderSettings );
+                       this.listenTo( this, 'update:revisions', this.updateSliderSettings );
+
+                       // Listen for changes to the hovered revision
+                       this.listenTo( this, 'change:hoveredRevision', this.hoverRevision );
+
+                       this.set({
+                               max:   this.revisions.length - 1,
+                               compareTwoMode: this.frame.get('compareTwoMode'),
+                               from: this.frame.get('from'),
+                               to: this.frame.get('to')
+                       });
+                       this.updateSliderSettings();
+               },
+
+               getSliderValue: function( a, b ) {
+                       return isRtl ? this.revisions.length - this.revisions.indexOf( this.get(a) ) - 1 : this.revisions.indexOf( this.get(b) );
+               },
+
+               updateSliderSettings: function() {
+                       if ( this.get('compareTwoMode') ) {
+                               this.set({
+                                       values: [
+                                               this.getSliderValue( 'to', 'from' ),
+                                               this.getSliderValue( 'from', 'to' )
+                                       ],
+                                       value: null,
+                                       range: true // ensures handles cannot cross
+                               });
+                       } else {
+                               this.set({
+                                       value: this.getSliderValue( 'to', 'to' ),
+                                       values: null,
+                                       range: false
+                               });
+                       }
+                       this.trigger( 'update:slider' );
+               },
+
+               // Called when a revision is hovered
+               hoverRevision: function( model, value ) {
+                       this.trigger( 'hovered:revision', value );
+               },
+
+               // Called when `compareTwoMode` changes
+               updateMode: function( model, value ) {
+                       this.set({ compareTwoMode: value });
+               },
+
+               // Called when `from` or `to` changes in the local model
+               handleLocalChanges: function() {
+                       this.frame.set({
+                               from: this.get('from'),
+                               to: this.get('to')
+                       });
+               },
+
+               // Receives revisions changes from outside the model
+               receiveRevisions: function( from, to ) {
+                       // Bail if nothing changed
+                       if ( this.get('from') === from && this.get('to') === to )
+                               return;
+
+                       this.set({ from: from, to: to }, { silent: true });
+                       this.trigger( 'update:revisions', from, to );
+               }
+
+       });
+
+       revisions.model.Tooltip = Backbone.Model.extend({
+               defaults: {
+                       revision: null,
+                       offset: {},
+                       hovering: false, // Whether the mouse is hovering
+                       scrubbing: false // Whether the mouse is scrubbing
+               },
+
+               initialize: function( options ) {
+                       this.frame = options.frame;
+                       this.revisions = options.revisions;
+                       this.slider = options.slider;
+
+                       this.listenTo( this.slider, 'hovered:revision', this.updateRevision );
+                       this.listenTo( this.slider, 'change:hovering', this.setHovering );
+                       this.listenTo( this.slider, 'change:scrubbing', this.setScrubbing );
+               },
+
+
+               updateRevision: function( revision ) {
+                       this.set({ revision: revision });
+               },
+
+               setHovering: function( model, value ) {
+                       this.set({ hovering: value });
+               },
+
+               setScrubbing: function( model, value ) {
+                       this.set({ scrubbing: value });
+               }
+       });
+
+       revisions.model.Revision = Backbone.Model.extend({});
+
+       revisions.model.Revisions = Backbone.Collection.extend({
+               model: revisions.model.Revision,
+
+               initialize: function() {
+                       _.bindAll( this, 'next', 'prev' );
+               },
+
+               next: function( revision ) {
+                       var index = this.indexOf( revision );
+
+                       if ( index !== -1 && index !== this.length - 1 )
+                               return this.at( index + 1 );
+               },
+
+               prev: function( revision ) {
+                       var index = this.indexOf( revision );
+
+                       if ( index !== -1 && index !== 0 )
+                               return this.at( index - 1 );
+               }
+       });
+
+       revisions.model.Field = Backbone.Model.extend({});
+
+       revisions.model.Fields = Backbone.Collection.extend({
+               model: revisions.model.Field
+       });
+
+       revisions.model.Diff = Backbone.Model.extend({
+               initialize: function( attributes, options ) {
+                       var fields = this.get('fields');
+                       this.unset('fields');
+
+                       this.fields = new revisions.model.Fields( fields );
+               }
+       });
+
+       revisions.model.Diffs = Backbone.Collection.extend({
+               initialize: function( models, options ) {
+                       _.bindAll( this, 'getClosestUnloaded' );
+                       this.loadAll = _.once( this._loadAll );
+                       this.revisions = options.revisions;
+                       this.requests  = {};
+               },
+
+               model: revisions.model.Diff,
+
+               ensure: function( id, context ) {
+                       var diff     = this.get( id );
+                       var request  = this.requests[ id ];
+                       var deferred = $.Deferred();
+                       var ids      = {};
+                       var from     = id.split(':')[0];
+                       var to       = id.split(':')[1];
+                       ids[id] = true;
+
+                       wp.revisions.log( 'ensure', id );
+
+                       this.trigger( 'ensure', ids, from, to, deferred.promise() );
+
+                       if ( diff ) {
+                               deferred.resolveWith( context, [ diff ] );
+                       } else {
+                               this.trigger( 'ensure:load', ids, from, to, deferred.promise() );
+                               _.each( ids, _.bind( function( id ) {
+                                       // Remove anything that has an ongoing request
+                                       if ( this.requests[ id ] )
+                                               delete ids[ id ];
+                                       // Remove anything we already have
+                                       if ( this.get( id ) )
+                                               delete ids[ id ];
+                               }, this ) );
+                               if ( ! request ) {
+                                       // Always include the ID that started this ensure
+                                       ids[ id ] = true;
+                                       request   = this.load( _.keys( ids ) );
+                               }
+
+                               request.done( _.bind( function() {
+                                       deferred.resolveWith( context, [ this.get( id ) ] );
+                               }, this ) ).fail( _.bind( function() {
+                                       deferred.reject();
+                               }) );
+                       }
+
+                       return deferred.promise();
+               },
+
+               // Returns an array of proximal diffs
+               getClosestUnloaded: function( ids, centerId ) {
+                       var self = this;
+                       return _.chain([0].concat( ids )).initial().zip( ids ).sortBy( function( pair ) {
+                               return Math.abs( centerId - pair[1] );
+                       }).map( function( pair ) {
+                               return pair.join(':');
+                       }).filter( function( diffId ) {
+                               return _.isUndefined( self.get( diffId ) ) && ! self.requests[ diffId ];
+                       }).value();
+               },
+
+               _loadAll: function( allRevisionIds, centerId, num ) {
+                       var self = this, deferred = $.Deferred();
+                       diffs = _.first( this.getClosestUnloaded( allRevisionIds, centerId ), num );
+                       if ( _.size( diffs ) > 0 ) {
+                               this.load( diffs ).done( function() {
+                                       self._loadAll( allRevisionIds, centerId, num ).done( function() {
+                                               deferred.resolve();
+                                       });
+                               }).fail( function() {
+                                       if ( 1 === num ) { // Already tried 1. This just isn't working. Give up.
+                                               deferred.reject();
+                                       } else { // Request fewer diffs this time
+                                               self._loadAll( allRevisionIds, centerId, Math.ceil( num / 2 ) ).done( function() {
+                                                       deferred.resolve();
+                                               });
+                                       }
+                               });
+                       } else {
+                               deferred.resolve();
+                       }
+                       return deferred;
+               },
+
+               load: function( comparisons ) {
+                       wp.revisions.log( 'load', comparisons );
+                       // Our collection should only ever grow, never shrink, so remove: false
+                       return this.fetch({ data: { compare: comparisons }, remove: false }).done( function(){
+                               wp.revisions.log( 'load:complete', comparisons );
+                       });
+               },
+
+               sync: function( method, model, options ) {
+                       if ( 'read' === method ) {
+                               options = options || {};
+                               options.context = this;
+                               options.data = _.extend( options.data || {}, {
+                                       action: 'get-revision-diffs',
+                                       post_id: revisions.settings.postId
+                               });
+
+                               var deferred = wp.ajax.send( options );
+                               var requests = this.requests;
+
+                               // Record that we're requesting each diff.
+                               if ( options.data.compare ) {
+                                       _.each( options.data.compare, function( id ) {
+                                               requests[ id ] = deferred;
+                                       });
+                               }
+
+                               // When the request completes, clear the stored request.
+                               deferred.always( function() {
+                                       if ( options.data.compare ) {
+                                               _.each( options.data.compare, function( id ) {
+                                                       delete requests[ id ];
+                                               });
+                                       }
+                               });
+
+                               return deferred;
+
+                       // Otherwise, fall back to `Backbone.sync()`.
+                       } else {
+                               return Backbone.Model.prototype.sync.apply( this, arguments );
+                       }
+               }
+       });
+
+
+       revisions.model.FrameState = Backbone.Model.extend({
+               defaults: {
+                       loading: false,
+                       error: false,
+                       compareTwoMode: false
+               },
+
+               initialize: function( attributes, options ) {
+                       var properties = {};
+
+                       _.bindAll( this, 'receiveDiff' );
+                       this._debouncedEnsureDiff = _.debounce( this._ensureDiff, 200 );
+
+                       this.revisions = options.revisions;
+                       this.diffs = new revisions.model.Diffs( [], { revisions: this.revisions });
+
+                       // Set the initial diffs collection provided through the settings
+                       this.diffs.set( revisions.settings.diffData );
+
+                       // Set up internal listeners
+                       this.listenTo( this, 'change:from', this.changeRevisionHandler );
+                       this.listenTo( this, 'change:to', this.changeRevisionHandler );
+                       this.listenTo( this, 'change:compareTwoMode', this.changeMode );
+                       this.listenTo( this, 'update:revisions', this.updatedRevisions );
+                       this.listenTo( this.diffs, 'ensure:load', this.updateLoadingStatus );
+                       this.listenTo( this, 'update:diff', this.updateLoadingStatus );
+
+                       // Set the initial revisions, baseUrl, and mode as provided through settings
+                       properties.to = this.revisions.get( revisions.settings.to );
+                       properties.from = this.revisions.get( revisions.settings.from );
+                       properties.compareTwoMode = revisions.settings.compareTwoMode;
+                       properties.baseUrl = revisions.settings.baseUrl;
+                       this.set( properties );
+
+                       // Start the router if browser supports History API
+                       if ( window.history && window.history.pushState ) {
+                               this.router = new revisions.Router({ model: this });
+                               Backbone.history.start({ pushState: true });
+                       }
+               },
+
+               updateLoadingStatus: function() {
+                       this.set( 'error', false );
+                       this.set( 'loading', ! this.diff() );
+               },
+
+               changeMode: function( model, value ) {
+                       // If we were on the first revision before switching, we have to bump them over one
+                       if ( value && 0 === this.revisions.indexOf( this.get('to') ) ) {
+                               this.set({
+                                       from: this.revisions.at(0),
+                                       to: this.revisions.at(1)
+                               });
+                       }
+               },
+
+               updatedRevisions: function( from, to ) {
+                       if ( this.get( 'compareTwoMode' ) ) {
+                               // TODO: compare-two loading strategy
+                       } else {
+                               this.diffs.loadAll( this.revisions.pluck('id'), to.id, 40 );
+                       }
+               },
+
+               // Fetch the currently loaded diff.
+               diff: function() {
+                       return this.diffs.get( this._diffId );
+               },
+
+               // So long as `from` and `to` are changed at the same time, the diff
+               // will only be updated once. This is because Backbone updates all of
+               // the changed attributes in `set`, and then fires the `change` events.
+               updateDiff: function( options ) {
+                       var from, to, diffId, diff;
+
+                       options = options || {};
+                       from = this.get('from');
+                       to = this.get('to');
+                       diffId = ( from ? from.id : 0 ) + ':' + to.id;
+
+                       // Check if we're actually changing the diff id.
+                       if ( this._diffId === diffId )
+                               return $.Deferred().reject().promise();
+
+                       this._diffId = diffId;
+                       this.trigger( 'update:revisions', from, to );
+
+                       diff = this.diffs.get( diffId );
+
+                       // If we already have the diff, then immediately trigger the update.
+                       if ( diff ) {
+                               this.receiveDiff( diff );
+                               return $.Deferred().resolve().promise();
+                       // Otherwise, fetch the diff.
+                       } else {
+                               if ( options.immediate ) {
+                                       return this._ensureDiff();
+                               } else {
+                                       this._debouncedEnsureDiff();
+                                       return $.Deferred().reject().promise();
+                               }
+                       }
+               },
+
+               // A simple wrapper around `updateDiff` to prevent the change event's
+               // parameters from being passed through.
+               changeRevisionHandler: function( model, value, options ) {
+                       this.updateDiff();
+               },
+
+               receiveDiff: function( diff ) {
+                       // Did we actually get a diff?
+                       if ( _.isUndefined( diff ) || _.isUndefined( diff.id ) ) {
+                               this.set({
+                                       loading: false,
+                                       error: true
+                               });
+                       } else if ( this._diffId === diff.id ) { // Make sure the current diff didn't change
+                               this.trigger( 'update:diff', diff );
+                       }
+               },
+
+               _ensureDiff: function() {
+                       return this.diffs.ensure( this._diffId, this ).always( this.receiveDiff );
+               }
+       });
+
+
+       /**
+        * ========================================================================
+        * VIEWS
+        * ========================================================================
+        */
+
+       // The frame view. This contains the entire page.
+       revisions.view.Frame = wp.Backbone.View.extend({
+               className: 'revisions',
+               template: wp.template('revisions-frame'),
+
+               initialize: function() {
+                       this.listenTo( this.model, 'update:diff', this.renderDiff );
+                       this.listenTo( this.model, 'change:compareTwoMode', this.updateCompareTwoMode );
+                       this.listenTo( this.model, 'change:loading', this.updateLoadingStatus );
+                       this.listenTo( this.model, 'change:error', this.updateErrorStatus );
+
+                       this.views.set( '.revisions-control-frame', new revisions.view.Controls({
+                               model: this.model
+                       }) );
+               },
+
+               render: function() {
+                       wp.Backbone.View.prototype.render.apply( this, arguments );
+
+                       $('html').css( 'overflow-y', 'scroll' );
+                       $('#wpbody-content .wrap').append( this.el );
+                       this.updateCompareTwoMode();
+                       this.renderDiff( this.model.diff() );
+                       this.views.ready();
+
+                       return this;
+               },
+
+               renderDiff: function( diff ) {
+                       this.views.set( '.revisions-diff-frame', new revisions.view.Diff({
+                               model: diff
+                       }) );
+               },
+
+               updateLoadingStatus: function() {
+                       this.$el.toggleClass( 'loading', this.model.get('loading') );
+               },
+
+               updateErrorStatus: function() {
+                       this.$el.toggleClass( 'diff-error', this.model.get('error') );
+               },
+
+               updateCompareTwoMode: function() {
+                       this.$el.toggleClass( 'comparing-two-revisions', this.model.get('compareTwoMode') );
+               }
+       });
+
+       // The control view.
+       // This contains the revision slider, previous/next buttons, the meta info and the compare checkbox.
+       revisions.view.Controls = wp.Backbone.View.extend({
+               className: 'revisions-controls',
+
+               initialize: function() {
+                       _.bindAll( this, 'setWidth' );
+
+                       // Add the button view
+                       this.views.add( new revisions.view.Buttons({
+                               model: this.model
+                       }) );
+
+                       // Add the checkbox view
+                       this.views.add( new revisions.view.Checkbox({
+                               model: this.model
+                       }) );
+
+                       // Prep the slider model
+                       var slider = new revisions.model.Slider({
+                               frame: this.model,
+                               revisions: this.model.revisions
+                       });
+
+                       // Prep the tooltip model
+                       var tooltip = new revisions.model.Tooltip({
+                               frame: this.model,
+                               revisions: this.model.revisions,
+                               slider: slider
+                       });
+
+                       // Add the tooltip view
+                       this.views.add( new revisions.view.Tooltip({
+                               model: tooltip
+                       }) );
+
+                       // Add the tickmarks view
+                       this.views.add( new revisions.view.Tickmarks({
+                               model: tooltip
+                       }) );
+
+                       // Add the slider view
+                       this.views.add( new revisions.view.Slider({
+                               model: slider
+                       }) );
+
+                       // Add the Metabox view
+                       this.views.add( new revisions.view.Metabox({
+                               model: this.model
+                       }) );
+               },
+
+               ready: function() {
+                       this.top = this.$el.offset().top;
+                       this.window = $(window);
+                       this.window.on( 'scroll.wp.revisions', {controls: this}, function(e) {
+                               var controls = e.data.controls;
+                               var container = controls.$el.parent();
+                               var scrolled = controls.window.scrollTop();
+                               var frame = controls.views.parent;
+
+                               if ( scrolled >= controls.top ) {
+                                       if ( ! frame.$el.hasClass('pinned') ) {
+                                               controls.setWidth();
+                                               container.css('height', container.height() + 'px' );
+                                               controls.window.on('resize.wp.revisions.pinning click.wp.revisions.pinning', {controls: controls}, function(e) {
+                                                       e.data.controls.setWidth();
+                                               });
+                                       }
+                                       frame.$el.addClass('pinned');
+                               } else if ( frame.$el.hasClass('pinned') ) {
+                                       controls.window.off('.wp.revisions.pinning');
+                                       controls.$el.css('width', 'auto');
+                                       frame.$el.removeClass('pinned');
+                                       container.css('height', 'auto');
+                                       controls.top = controls.$el.offset().top;
+                               } else {
+                                       controls.top = controls.$el.offset().top;
+                               }
+                       });
+               },
+
+               setWidth: function() {
+                       this.$el.css('width', this.$el.parent().width() + 'px');
+               }
+       });
+
+       // The tickmarks view
+       revisions.view.Tickmarks = wp.Backbone.View.extend({
+               className: 'revisions-tickmarks',
+               direction: isRtl ? 'right' : 'left',
+
+               initialize: function() {
+                       this.listenTo( this.model, 'change:revision', this.reportTickPosition );
+               },
+
+               reportTickPosition: function( model, revision ) {
+                       var offset, thisOffset, parentOffset, tick, index = this.model.revisions.indexOf( revision );
+                       thisOffset = this.$el.allOffsets();
+                       parentOffset = this.$el.parent().allOffsets();
+                       if ( index === this.model.revisions.length - 1 ) {
+                               // Last one
+                               offset = {
+                                       rightPlusWidth: thisOffset.left - parentOffset.left + 1,
+                                       leftPlusWidth: thisOffset.right - parentOffset.right + 1
+                               };
+                       } else {
+                               // Normal tick
+                               tick = this.$('div:nth-of-type(' + (index + 1) + ')');
+                               offset = tick.allPositions();
+                               _.extend( offset, {
+                                       left: offset.left + thisOffset.left - parentOffset.left,
+                                       right: offset.right + thisOffset.right - parentOffset.right
+                               });
+                               _.extend( offset, {
+                                       leftPlusWidth: offset.left + tick.outerWidth(),
+                                       rightPlusWidth: offset.right + tick.outerWidth()
+                               });
+                       }
+                       this.model.set({ offset: offset });
+               },
+
+               ready: function() {
+                       var tickCount, tickWidth;
+                       tickCount = this.model.revisions.length - 1;
+                       tickWidth = 1 / tickCount;
+                       this.$el.css('width', ( this.model.revisions.length * 50 ) + 'px');
+
+                       _(tickCount).times( function( index ){
+                               this.$el.append( '<div style="' + this.direction + ': ' + ( 100 * tickWidth * index ) + '%"></div>' );
+                       }, this );
+               }
+       });
+
+       // The metabox view
+       revisions.view.Metabox = wp.Backbone.View.extend({
+               className: 'revisions-meta',
+
+               initialize: function() {
+                       // Add the 'from' view
+                       this.views.add( new revisions.view.MetaFrom({
+                               model: this.model,
+                               className: 'diff-meta diff-meta-from'
+                       }) );
+
+                       // Add the 'to' view
+                       this.views.add( new revisions.view.MetaTo({
+                               model: this.model
+                       }) );
+               }
+       });
+
+       // The revision meta view (to be extended)
+       revisions.view.Meta = wp.Backbone.View.extend({
+               template: wp.template('revisions-meta'),
+
+               events: {
+                       'click .restore-revision': 'restoreRevision'
+               },
+
+               initialize: function() {
+                       this.listenTo( this.model, 'update:revisions', this.render );
+               },
+
+               prepare: function() {
+                       return _.extend( this.model.toJSON()[this.type] || {}, {
+                               type: this.type
+                       });
+               },
+
+               restoreRevision: function() {
+                       document.location = this.model.get('to').attributes.restoreUrl;
+               }
+       });
+
+       // The revision meta 'from' view
+       revisions.view.MetaFrom = revisions.view.Meta.extend({
+               className: 'diff-meta diff-meta-from',
+               type: 'from'
+       });
+
+       // The revision meta 'to' view
+       revisions.view.MetaTo = revisions.view.Meta.extend({
+               className: 'diff-meta diff-meta-to',
+               type: 'to'
+       });
+
+       // The checkbox view.
+       revisions.view.Checkbox = wp.Backbone.View.extend({
+               className: 'revisions-checkbox',
+               template: wp.template('revisions-checkbox'),
+
+               events: {
+                       'click .compare-two-revisions': 'compareTwoToggle'
+               },
+
+               initialize: function() {
+                       this.listenTo( this.model, 'change:compareTwoMode', this.updateCompareTwoMode );
+               },
+
+               ready: function() {
+                       if ( this.model.revisions.length < 3 )
+                               $('.revision-toggle-compare-mode').hide();
+               },
+
+               updateCompareTwoMode: function() {
+                       this.$('.compare-two-revisions').prop( 'checked', this.model.get('compareTwoMode') );
+               },
+
+               // Toggle the compare two mode feature when the compare two checkbox is checked.
+               compareTwoToggle: function( event ) {
+                       // Activate compare two mode?
+                       this.model.set({ compareTwoMode: $('.compare-two-revisions').prop('checked') });
+               }
+       });
+
+       // The tooltip view.
+       // Encapsulates the tooltip.
+       revisions.view.Tooltip = wp.Backbone.View.extend({
+               className: 'revisions-tooltip',
+               template: wp.template('revisions-meta'),
+
+               initialize: function( options ) {
+                       this.listenTo( this.model, 'change:offset', this.render );
+                       this.listenTo( this.model, 'change:hovering', this.toggleVisibility );
+                       this.listenTo( this.model, 'change:scrubbing', this.toggleVisibility );
+               },
+
+               prepare: function() {
+                       if ( _.isNull( this.model.get('revision') ) )
+                               return;
+                       else
+                               return _.extend( { type: 'tooltip' }, {
+                                       attributes: this.model.get('revision').toJSON()
+                               });
+               },
+
+               render: function() {
+                       var direction, directionVal, flipped, css = {}, position = this.model.revisions.indexOf( this.model.get('revision') ) + 1;
+                       flipped = ( position / this.model.revisions.length ) > 0.5;
+                       if ( isRtl ) {
+                               direction = flipped ? 'left' : 'right';
+                               directionVal = flipped ? 'leftPlusWidth' : direction;
+                       } else {
+                               direction = flipped ? 'right' : 'left';
+                               directionVal = flipped ? 'rightPlusWidth' : direction;
+                       }
+                       otherDirection = 'right' === direction ? 'left': 'right';
+                       wp.Backbone.View.prototype.render.apply( this, arguments );
+                       css[direction] = this.model.get('offset')[directionVal] + 'px';
+                       css[otherDirection] = '';
+                       this.$el.toggleClass( 'flipped', flipped ).css( css );
+               },
+
+               visible: function() {
+                       return this.model.get( 'scrubbing' ) || this.model.get( 'hovering' );
+               },
+
+               toggleVisibility: function( options ) {
+                       if ( this.visible() )
+                               this.$el.stop().show().fadeTo( 100 - this.el.style.opacity * 100, 1 );
+                       else
+                               this.$el.stop().fadeTo( this.el.style.opacity * 300, 0, function(){ $(this).hide(); } );
+                       return;
+               }
+       });
+
+       // The buttons view.
+       // Encapsulates all of the configuration for the previous/next buttons.
+       revisions.view.Buttons = wp.Backbone.View.extend({
+               className: 'revisions-buttons',
+               template: wp.template('revisions-buttons'),
+
+               events: {
+                       'click .revisions-next .button': 'nextRevision',
+                       'click .revisions-previous .button': 'previousRevision'
+               },
+
+               initialize: function() {
+                       this.listenTo( this.model, 'update:revisions', this.disabledButtonCheck );
+               },
+
+               ready: function() {
+                       this.disabledButtonCheck();
+               },
+
+               // Go to a specific model index
+               gotoModel: function( toIndex ) {
+                       var attributes = {
+                               to: this.model.revisions.at( toIndex )
+                       };
+                       // If we're at the first revision, unset 'from'.
+                       if ( toIndex )
+                               attributes.from = this.model.revisions.at( toIndex - 1 );
+                       else
+                               this.model.unset('from', { silent: true });
+
+                       this.model.set( attributes );
+               },
+
+               // Go to the 'next' revision
+               nextRevision: function() {
+                       var toIndex = this.model.revisions.indexOf( this.model.get('to') ) + 1;
+                       this.gotoModel( toIndex );
+               },
+
+               // Go to the 'previous' revision
+               previousRevision: function() {
+                       var toIndex = this.model.revisions.indexOf( this.model.get('to') ) - 1;
+                       this.gotoModel( toIndex );
+               },
+
+               // Check to see if the Previous or Next buttons need to be disabled or enabled.
+               disabledButtonCheck: function() {
+                       var maxVal = this.model.revisions.length - 1,
+                               minVal = 0,
+                               next = $('.revisions-next .button'),
+                               previous = $('.revisions-previous .button'),
+                               val = this.model.revisions.indexOf( this.model.get('to') );
+
+                       // Disable "Next" button if you're on the last node.
+                       next.prop( 'disabled', ( maxVal === val ) );
+
+                       // Disable "Previous" button if you're on the first node.
+                       previous.prop( 'disabled', ( minVal === val ) );
+               }
+       });
+
+
+       // The slider view.
+       revisions.view.Slider = wp.Backbone.View.extend({
+               className: 'wp-slider',
+               direction: isRtl ? 'right' : 'left',
+
+               events: {
+                       'mousemove' : 'mouseMove'
+               },
+
+               initialize: function() {
+                       _.bindAll( this, 'start', 'slide', 'stop', 'mouseMove', 'mouseEnter', 'mouseLeave' );
+                       this.listenTo( this.model, 'update:slider', this.applySliderSettings );
+               },
+
+               ready: function() {
+                       this.$el.css('width', ( this.model.revisions.length * 50 ) + 'px');
+                       this.$el.slider( _.extend( this.model.toJSON(), {
+                               start: this.start,
+                               slide: this.slide,
+                               stop:  this.stop
+                       }) );
+
+                       this.$el.hoverIntent({
+                               over: this.mouseEnter,
+                               out: this.mouseLeave,
+                               timeout: 800
+                       });
+
+                       this.applySliderSettings();
+               },
+
+               mouseMove: function( e ) {
+                       var zoneCount = this.model.revisions.length - 1, // One fewer zone than models
+                               sliderFrom = this.$el.allOffsets()[this.direction], // "From" edge of slider
+                               sliderWidth = this.$el.width(), // Width of slider
+                               tickWidth = sliderWidth / zoneCount, // Calculated width of zone
+                               actualX = isRtl? $(window).width() - e.pageX : e.pageX; // Flipped for RTL - sliderFrom;
+                       actualX = actualX - sliderFrom; // Offset of mouse position in slider
+                       var currentModelIndex = Math.floor( ( actualX + ( tickWidth / 2 )  ) / tickWidth ); // Calculate the model index
+
+                       // Ensure sane value for currentModelIndex.
+                       if ( currentModelIndex < 0 )
+                               currentModelIndex = 0;
+                       else if ( currentModelIndex >= this.model.revisions.length )
+                               currentModelIndex = this.model.revisions.length - 1;
+
+                       // Update the tooltip mode
+                       this.model.set({ hoveredRevision: this.model.revisions.at( currentModelIndex ) });
+               },
+
+               mouseLeave: function() {
+                       this.model.set({ hovering: false });
+               },
+
+               mouseEnter: function() {
+                       this.model.set({ hovering: true });
+               },
+
+               applySliderSettings: function() {
+                       this.$el.slider( _.pick( this.model.toJSON(), 'value', 'values', 'range' ) );
+                       var handles = this.$('a.ui-slider-handle');
+
+                       if ( this.model.get('compareTwoMode') ) {
+                               // in RTL mode the 'left handle' is the second in the slider, 'right' is first
+                               handles.first()
+                                       .toggleClass( 'to-handle', !! isRtl )
+                                       .toggleClass( 'from-handle', ! isRtl );
+                               handles.last()
+                                       .toggleClass( 'from-handle', !! isRtl )
+                                       .toggleClass( 'to-handle', ! isRtl );
+                       } else {
+                               handles.removeClass('from-handle to-handle');
+                       }
+               },
+
+               start: function( event, ui ) {
+                       this.model.set({ scrubbing: true });
+
+                       // Track the mouse position to enable smooth dragging,
+                       // overrides default jQuery UI step behavior.
+                       $( window ).on( 'mousemove.wp.revisions', { view: this }, function( e ) {
+                               var view              = e.data.view,
+                                   leftDragBoundary  = view.$el.offset().left,
+                                   sliderOffset      = leftDragBoundary,
+                                   sliderRightEdge   = leftDragBoundary + view.$el.width(),
+                                   rightDragBoundary = sliderRightEdge,
+                                   leftDragReset     = '0',
+                                   rightDragReset    = '100%',
+                                   handle            = $( ui.handle );
+
+                               // In two handle mode, ensure handles can't be dragged past each other.
+                               // Adjust left/right boundaries and reset points.
+                               if ( view.model.get('compareTwoMode') ) {
+                                       var handles = handle.parent().find('.ui-slider-handle');
+                                       if ( handle.is( handles.first() ) ) { // We're the left handle
+                                               rightDragBoundary = handles.last().offset().left;
+                                               rightDragReset    = rightDragBoundary - sliderOffset;
+                                       } else { // We're the right handle
+                                               leftDragBoundary = handles.first().offset().left + handles.first().width();
+                                               leftDragReset    = leftDragBoundary - sliderOffset;
+                                       }
+                               }
+
+                               // Follow mouse movements, as long as handle remains inside slider.
+                               if ( e.pageX < leftDragBoundary ) {
+                                       handle.css( 'left', leftDragReset ); // Mouse to left of slider.
+                               } else if ( e.pageX > rightDragBoundary ) {
+                                       handle.css( 'left', rightDragReset ); // Mouse to right of slider.
+                               } else {
+                                       handle.css( 'left', e.pageX - sliderOffset ); // Mouse in slider.
+                               }
+                       } );
+               },
+
+               getPosition: function( position ) {
+                       return isRtl ? this.model.revisions.length - position - 1: position;
+               },
+
+               // Responds to slide events
+               slide: function( event, ui ) {
+                       var attributes, movedRevision;
+                       // Compare two revisions mode
+                       if ( this.model.get('compareTwoMode') ) {
+                               // Prevent sliders from occupying same spot
+                               if ( ui.values[1] === ui.values[0] )
+                                       return false;
+                               if ( isRtl )
+                                       ui.values.reverse();
+                               attributes = {
+                                       from: this.model.revisions.at( this.getPosition( ui.values[0] ) ),
+                                       to: this.model.revisions.at( this.getPosition( ui.values[1] ) )
+                               };
+                       } else {
+                               attributes = {
+                                       to: this.model.revisions.at( this.getPosition( ui.value ) )
+                               };
+                               // If we're at the first revision, unset 'from'.
+                               if ( this.getPosition( ui.value ) > 0 )
+                                       attributes.from = this.model.revisions.at( this.getPosition( ui.value ) - 1 );
+                               else
+                                       attributes.from = undefined;
+                       }
+                       movedRevision = this.model.revisions.at( this.getPosition( ui.value ) );
+
+                       // If we are scrubbing, a scrub to a revision is considered a hover
+                       if ( this.model.get('scrubbing') )
+                               attributes.hoveredRevision = movedRevision;
+
+                       this.model.set( attributes );
+               },
+
+               stop: function( event, ui ) {
+                       $( window ).off('mousemove.wp.revisions');
+                       this.model.updateSliderSettings(); // To snap us back to a tick mark
+                       this.model.set({ scrubbing: false });
+               }
+       });
+
+       // The diff view.
+       // This is the view for the current active diff.
+       revisions.view.Diff = wp.Backbone.View.extend({
+               className: 'revisions-diff',
+               template: wp.template('revisions-diff'),
+
+               // Generate the options to be passed to the template.
+               prepare: function() {
+                       return _.extend({ fields: this.model.fields.toJSON() }, this.options );
+               }
+       });
+
+       // The revisions router
+       // takes URLs with #hash fragments and routes them
+       revisions.Router = Backbone.Router.extend({
+               initialize: function( options ) {
+                       this.model = options.model;
+                       this.routes = _.object([
+                               [ this.baseUrl( '?from=:from&to=:to' ), 'handleRoute' ],
+                               [ this.baseUrl( '?from=:from&to=:to' ), 'handleRoute' ]
+                       ]);
+                       // Maintain state and history when navigating
+                       this.listenTo( this.model, 'update:diff', _.debounce( this.updateUrl, 250 ) );
+                       this.listenTo( this.model, 'change:compareTwoMode', this.updateUrl );
+               },
+
+               baseUrl: function( url ) {
+                       return this.model.get('baseUrl') + url;
+               },
+
+               updateUrl: function() {
+                       var from = this.model.has('from') ? this.model.get('from').id : 0;
+                       var to = this.model.get('to').id;
+                       if ( this.model.get('compareTwoMode' ) )
+                               this.navigate( this.baseUrl( '?from=' + from + '&to=' + to ) );
+                       else
+                               this.navigate( this.baseUrl( '?revision=' + to ) );
+               },
+
+               handleRoute: function( a, b ) {
+                       var from, to, compareTwo = _.isUndefined( b );
+
+                       if ( ! compareTwo ) {
+                               b = this.model.revisions.get( a );
+                               a = this.model.revisions.prev( b );
+                               b = b ? b.id : 0;
+                               a = a ? a.id : 0;
+                       }
+
+                       this.model.set({
+                               from: this.model.revisions.get( parseInt( a, 10 ) ),
+                               to: this.model.revisions.get( parseInt( a, 10 ) ),
+                               compareTwoMode: compareTwo
+                       });
+               }
+       });
+
+       // Initialize the revisions UI.
+       revisions.init = function() {
+               revisions.view.frame = new revisions.view.Frame({
+                       model: new revisions.model.FrameState({}, {
+                               revisions: new revisions.model.Revisions( revisions.settings.revisionData )
+                       })
+               }).render();
+       };
+
+       $( revisions.init );
+}(jQuery));
diff --git a/wp-admin/js/revisions.min.js b/wp-admin/js/revisions.min.js
new file mode 100644 (file)
index 0000000..a1e1a00
--- /dev/null
@@ -0,0 +1 @@
+window.wp=window.wp||{};(function(b){var a;a=wp.revisions={model:{},view:{},controller:{}};a.settings=_.isUndefined(_wpRevisionsSettings)?{}:_wpRevisionsSettings;a.debug=false;a.log=function(){if(window.console&&a.debug){console.log.apply(console,arguments)}};b.fn.allOffsets=function(){var d=this.offset()||{top:0,left:0},c=b(window);return _.extend(d,{right:c.width()-d.left-this.outerWidth(),bottom:c.height()-d.top-this.outerHeight()})};b.fn.allPositions=function(){var c=this.position()||{top:0,left:0},d=this.parent();return _.extend(c,{right:d.outerWidth()-c.left-this.outerWidth(),bottom:d.outerHeight()-c.top-this.outerHeight()})};if(a.settings.to){a.settings.to=parseInt(a.settings.to,10)}if(a.settings.from){a.settings.from=parseInt(a.settings.from,10)}if(a.settings.compareTwoMode){a.settings.compareTwoMode=a.settings.compareTwoMode==="1"}a.model.Slider=Backbone.Model.extend({defaults:{value:null,values:null,min:0,max:1,step:1,range:false,compareTwoMode:false},initialize:function(c){this.frame=c.frame;this.revisions=c.revisions;this.listenTo(this.frame,"update:revisions",this.receiveRevisions);this.listenTo(this.frame,"change:compareTwoMode",this.updateMode);this.listenTo(this,"change:from",this.handleLocalChanges);this.listenTo(this,"change:to",this.handleLocalChanges);this.listenTo(this,"change:compareTwoMode",this.updateSliderSettings);this.listenTo(this,"update:revisions",this.updateSliderSettings);this.listenTo(this,"change:hoveredRevision",this.hoverRevision);this.set({max:this.revisions.length-1,compareTwoMode:this.frame.get("compareTwoMode"),from:this.frame.get("from"),to:this.frame.get("to")});this.updateSliderSettings()},getSliderValue:function(d,c){return isRtl?this.revisions.length-this.revisions.indexOf(this.get(d))-1:this.revisions.indexOf(this.get(c))},updateSliderSettings:function(){if(this.get("compareTwoMode")){this.set({values:[this.getSliderValue("to","from"),this.getSliderValue("from","to")],value:null,range:true})}else{this.set({value:this.getSliderValue("to","to"),values:null,range:false})}this.trigger("update:slider")},hoverRevision:function(c,d){this.trigger("hovered:revision",d)},updateMode:function(c,d){this.set({compareTwoMode:d})},handleLocalChanges:function(){this.frame.set({from:this.get("from"),to:this.get("to")})},receiveRevisions:function(d,c){if(this.get("from")===d&&this.get("to")===c){return}this.set({from:d,to:c},{silent:true});this.trigger("update:revisions",d,c)}});a.model.Tooltip=Backbone.Model.extend({defaults:{revision:null,offset:{},hovering:false,scrubbing:false},initialize:function(c){this.frame=c.frame;this.revisions=c.revisions;this.slider=c.slider;this.listenTo(this.slider,"hovered:revision",this.updateRevision);this.listenTo(this.slider,"change:hovering",this.setHovering);this.listenTo(this.slider,"change:scrubbing",this.setScrubbing)},updateRevision:function(c){this.set({revision:c})},setHovering:function(c,d){this.set({hovering:d})},setScrubbing:function(c,d){this.set({scrubbing:d})}});a.model.Revision=Backbone.Model.extend({});a.model.Revisions=Backbone.Collection.extend({model:a.model.Revision,initialize:function(){_.bindAll(this,"next","prev")},next:function(d){var c=this.indexOf(d);if(c!==-1&&c!==this.length-1){return this.at(c+1)}},prev:function(d){var c=this.indexOf(d);if(c!==-1&&c!==0){return this.at(c-1)}}});a.model.Field=Backbone.Model.extend({});a.model.Fields=Backbone.Collection.extend({model:a.model.Field});a.model.Diff=Backbone.Model.extend({initialize:function(d,e){var c=this.get("fields");this.unset("fields");this.fields=new a.model.Fields(c)}});a.model.Diffs=Backbone.Collection.extend({initialize:function(d,c){_.bindAll(this,"getClosestUnloaded");this.loadAll=_.once(this._loadAll);this.revisions=c.revisions;this.requests={}},model:a.model.Diff,ensure:function(j,d){var g=this.get(j);var f=this.requests[j];var c=b.Deferred();var e={};var i=j.split(":")[0];var h=j.split(":")[1];e[j]=true;wp.revisions.log("ensure",j);this.trigger("ensure",e,i,h,c.promise());if(g){c.resolveWith(d,[g])}else{this.trigger("ensure:load",e,i,h,c.promise());_.each(e,_.bind(function(k){if(this.requests[k]){delete e[k]}if(this.get(k)){delete e[k]}},this));if(!f){e[j]=true;f=this.load(_.keys(e))}f.done(_.bind(function(){c.resolveWith(d,[this.get(j)])},this)).fail(_.bind(function(){c.reject()}))}return c.promise()},getClosestUnloaded:function(e,c){var d=this;return _.chain([0].concat(e)).initial().zip(e).sortBy(function(f){return Math.abs(c-f[1])}).map(function(f){return f.join(":")}).filter(function(f){return _.isUndefined(d.get(f))&&!d.requests[f]}).value()},_loadAll:function(g,c,f){var e=this,d=b.Deferred();diffs=_.first(this.getClosestUnloaded(g,c),f);if(_.size(diffs)>0){this.load(diffs).done(function(){e._loadAll(g,c,f).done(function(){d.resolve()})}).fail(function(){if(1===f){d.reject()}else{e._loadAll(g,c,Math.ceil(f/2)).done(function(){d.resolve()})}})}else{d.resolve()}return d},load:function(c){wp.revisions.log("load",c);return this.fetch({data:{compare:c},remove:false}).done(function(){wp.revisions.log("load:complete",c)})},sync:function(g,e,d){if("read"===g){d=d||{};d.context=this;d.data=_.extend(d.data||{},{action:"get-revision-diffs",post_id:a.settings.postId});var c=wp.ajax.send(d);var f=this.requests;if(d.data.compare){_.each(d.data.compare,function(h){f[h]=c})}c.always(function(){if(d.data.compare){_.each(d.data.compare,function(h){delete f[h]})}});return c}else{return Backbone.Model.prototype.sync.apply(this,arguments)}}});a.model.FrameState=Backbone.Model.extend({defaults:{loading:false,error:false,compareTwoMode:false},initialize:function(c,d){var e={};_.bindAll(this,"receiveDiff");this._debouncedEnsureDiff=_.debounce(this._ensureDiff,200);this.revisions=d.revisions;this.diffs=new a.model.Diffs([],{revisions:this.revisions});this.diffs.set(a.settings.diffData);this.listenTo(this,"change:from",this.changeRevisionHandler);this.listenTo(this,"change:to",this.changeRevisionHandler);this.listenTo(this,"change:compareTwoMode",this.changeMode);this.listenTo(this,"update:revisions",this.updatedRevisions);this.listenTo(this.diffs,"ensure:load",this.updateLoadingStatus);this.listenTo(this,"update:diff",this.updateLoadingStatus);e.to=this.revisions.get(a.settings.to);e.from=this.revisions.get(a.settings.from);e.compareTwoMode=a.settings.compareTwoMode;e.baseUrl=a.settings.baseUrl;this.set(e);if(window.history&&window.history.pushState){this.router=new a.Router({model:this});Backbone.history.start({pushState:true})}},updateLoadingStatus:function(){this.set("error",false);this.set("loading",!this.diff())},changeMode:function(c,d){if(d&&0===this.revisions.indexOf(this.get("to"))){this.set({from:this.revisions.at(0),to:this.revisions.at(1)})}},updatedRevisions:function(d,c){if(this.get("compareTwoMode")){}else{this.diffs.loadAll(this.revisions.pluck("id"),c.id,40)}},diff:function(){return this.diffs.get(this._diffId)},updateDiff:function(c){var g,f,d,e;c=c||{};g=this.get("from");f=this.get("to");d=(g?g.id:0)+":"+f.id;if(this._diffId===d){return b.Deferred().reject().promise()}this._diffId=d;this.trigger("update:revisions",g,f);e=this.diffs.get(d);if(e){this.receiveDiff(e);return b.Deferred().resolve().promise()}else{if(c.immediate){return this._ensureDiff()}else{this._debouncedEnsureDiff();return b.Deferred().reject().promise()}}},changeRevisionHandler:function(d,e,c){this.updateDiff()},receiveDiff:function(c){if(_.isUndefined(c)||_.isUndefined(c.id)){this.set({loading:false,error:true})}else{if(this._diffId===c.id){this.trigger("update:diff",c)}}},_ensureDiff:function(){return this.diffs.ensure(this._diffId,this).always(this.receiveDiff)}});a.view.Frame=wp.Backbone.View.extend({className:"revisions",template:wp.template("revisions-frame"),initialize:function(){this.listenTo(this.model,"update:diff",this.renderDiff);this.listenTo(this.model,"change:compareTwoMode",this.updateCompareTwoMode);this.listenTo(this.model,"change:loading",this.updateLoadingStatus);this.listenTo(this.model,"change:error",this.updateErrorStatus);this.views.set(".revisions-control-frame",new a.view.Controls({model:this.model}))},render:function(){wp.Backbone.View.prototype.render.apply(this,arguments);b("html").css("overflow-y","scroll");b("#wpbody-content .wrap").append(this.el);this.updateCompareTwoMode();this.renderDiff(this.model.diff());this.views.ready();return this},renderDiff:function(c){this.views.set(".revisions-diff-frame",new a.view.Diff({model:c}))},updateLoadingStatus:function(){this.$el.toggleClass("loading",this.model.get("loading"))},updateErrorStatus:function(){this.$el.toggleClass("diff-error",this.model.get("error"))},updateCompareTwoMode:function(){this.$el.toggleClass("comparing-two-revisions",this.model.get("compareTwoMode"))}});a.view.Controls=wp.Backbone.View.extend({className:"revisions-controls",initialize:function(){_.bindAll(this,"setWidth");this.views.add(new a.view.Buttons({model:this.model}));this.views.add(new a.view.Checkbox({model:this.model}));var c=new a.model.Slider({frame:this.model,revisions:this.model.revisions});var d=new a.model.Tooltip({frame:this.model,revisions:this.model.revisions,slider:c});this.views.add(new a.view.Tooltip({model:d}));this.views.add(new a.view.Tickmarks({model:d}));this.views.add(new a.view.Slider({model:c}));this.views.add(new a.view.Metabox({model:this.model}))},ready:function(){this.top=this.$el.offset().top;this.window=b(window);this.window.on("scroll.wp.revisions",{controls:this},function(g){var d=g.data.controls;var c=d.$el.parent();var f=d.window.scrollTop();var h=d.views.parent;if(f>=d.top){if(!h.$el.hasClass("pinned")){d.setWidth();c.css("height",c.height()+"px");d.window.on("resize.wp.revisions.pinning click.wp.revisions.pinning",{controls:d},function(i){i.data.controls.setWidth()})}h.$el.addClass("pinned")}else{if(h.$el.hasClass("pinned")){d.window.off(".wp.revisions.pinning");d.$el.css("width","auto");h.$el.removeClass("pinned");c.css("height","auto");d.top=d.$el.offset().top}else{d.top=d.$el.offset().top}}})},setWidth:function(){this.$el.css("width",this.$el.parent().width()+"px")}});a.view.Tickmarks=wp.Backbone.View.extend({className:"revisions-tickmarks",direction:isRtl?"right":"left",initialize:function(){this.listenTo(this.model,"change:revision",this.reportTickPosition)},reportTickPosition:function(f,e){var i,h,c,g,d=this.model.revisions.indexOf(e);h=this.$el.allOffsets();c=this.$el.parent().allOffsets();if(d===this.model.revisions.length-1){i={rightPlusWidth:h.left-c.left+1,leftPlusWidth:h.right-c.right+1}}else{g=this.$("div:nth-of-type("+(d+1)+")");i=g.allPositions();_.extend(i,{left:i.left+h.left-c.left,right:i.right+h.right-c.right});_.extend(i,{leftPlusWidth:i.left+g.outerWidth(),rightPlusWidth:i.right+g.outerWidth()})}this.model.set({offset:i})},ready:function(){var d,c;d=this.model.revisions.length-1;c=1/d;this.$el.css("width",(this.model.revisions.length*50)+"px");_(d).times(function(e){this.$el.append('<div style="'+this.direction+": "+(100*c*e)+'%"></div>')},this)}});a.view.Metabox=wp.Backbone.View.extend({className:"revisions-meta",initialize:function(){this.views.add(new a.view.MetaFrom({model:this.model,className:"diff-meta diff-meta-from"}));this.views.add(new a.view.MetaTo({model:this.model}))}});a.view.Meta=wp.Backbone.View.extend({template:wp.template("revisions-meta"),events:{"click .restore-revision":"restoreRevision"},initialize:function(){this.listenTo(this.model,"update:revisions",this.render)},prepare:function(){return _.extend(this.model.toJSON()[this.type]||{},{type:this.type})},restoreRevision:function(){document.location=this.model.get("to").attributes.restoreUrl}});a.view.MetaFrom=a.view.Meta.extend({className:"diff-meta diff-meta-from",type:"from"});a.view.MetaTo=a.view.Meta.extend({className:"diff-meta diff-meta-to",type:"to"});a.view.Checkbox=wp.Backbone.View.extend({className:"revisions-checkbox",template:wp.template("revisions-checkbox"),events:{"click .compare-two-revisions":"compareTwoToggle"},initialize:function(){this.listenTo(this.model,"change:compareTwoMode",this.updateCompareTwoMode)},ready:function(){if(this.model.revisions.length<3){b(".revision-toggle-compare-mode").hide()}},updateCompareTwoMode:function(){this.$(".compare-two-revisions").prop("checked",this.model.get("compareTwoMode"))},compareTwoToggle:function(c){this.model.set({compareTwoMode:b(".compare-two-revisions").prop("checked")})}});a.view.Tooltip=wp.Backbone.View.extend({className:"revisions-tooltip",template:wp.template("revisions-meta"),initialize:function(c){this.listenTo(this.model,"change:offset",this.render);this.listenTo(this.model,"change:hovering",this.toggleVisibility);this.listenTo(this.model,"change:scrubbing",this.toggleVisibility)},prepare:function(){if(_.isNull(this.model.get("revision"))){return}else{return _.extend({type:"tooltip"},{attributes:this.model.get("revision").toJSON()})}},render:function(){var g,e,f,d={},c=this.model.revisions.indexOf(this.model.get("revision"))+1;f=(c/this.model.revisions.length)>0.5;if(isRtl){g=f?"left":"right";e=f?"leftPlusWidth":g}else{g=f?"right":"left";e=f?"rightPlusWidth":g}otherDirection="right"===g?"left":"right";wp.Backbone.View.prototype.render.apply(this,arguments);d[g]=this.model.get("offset")[e]+"px";d[otherDirection]="";this.$el.toggleClass("flipped",f).css(d)},visible:function(){return this.model.get("scrubbing")||this.model.get("hovering")},toggleVisibility:function(c){if(this.visible()){this.$el.stop().show().fadeTo(100-this.el.style.opacity*100,1)}else{this.$el.stop().fadeTo(this.el.style.opacity*300,0,function(){b(this).hide()})}return}});a.view.Buttons=wp.Backbone.View.extend({className:"revisions-buttons",template:wp.template("revisions-buttons"),events:{"click .revisions-next .button":"nextRevision","click .revisions-previous .button":"previousRevision"},initialize:function(){this.listenTo(this.model,"update:revisions",this.disabledButtonCheck)},ready:function(){this.disabledButtonCheck()},gotoModel:function(d){var c={to:this.model.revisions.at(d)};if(d){c.from=this.model.revisions.at(d-1)}else{this.model.unset("from",{silent:true})}this.model.set(c)},nextRevision:function(){var c=this.model.revisions.indexOf(this.model.get("to"))+1;this.gotoModel(c)},previousRevision:function(){var c=this.model.revisions.indexOf(this.model.get("to"))-1;this.gotoModel(c)},disabledButtonCheck:function(){var g=this.model.revisions.length-1,c=0,d=b(".revisions-next .button"),e=b(".revisions-previous .button"),f=this.model.revisions.indexOf(this.model.get("to"));d.prop("disabled",(g===f));e.prop("disabled",(c===f))}});a.view.Slider=wp.Backbone.View.extend({className:"wp-slider",direction:isRtl?"right":"left",events:{mousemove:"mouseMove"},initialize:function(){_.bindAll(this,"start","slide","stop","mouseMove","mouseEnter","mouseLeave");this.listenTo(this.model,"update:slider",this.applySliderSettings)},ready:function(){this.$el.css("width",(this.model.revisions.length*50)+"px");this.$el.slider(_.extend(this.model.toJSON(),{start:this.start,slide:this.slide,stop:this.stop}));this.$el.hoverIntent({over:this.mouseEnter,out:this.mouseLeave,timeout:800});this.applySliderSettings()},mouseMove:function(j){var d=this.model.revisions.length-1,i=this.$el.allOffsets()[this.direction],g=this.$el.width(),c=g/d,h=isRtl?b(window).width()-j.pageX:j.pageX;h=h-i;var f=Math.floor((h+(c/2))/c);if(f<0){f=0}else{if(f>=this.model.revisions.length){f=this.model.revisions.length-1}}this.model.set({hoveredRevision:this.model.revisions.at(f)})},mouseLeave:function(){this.model.set({hovering:false})},mouseEnter:function(){this.model.set({hovering:true})},applySliderSettings:function(){this.$el.slider(_.pick(this.model.toJSON(),"value","values","range"));var c=this.$("a.ui-slider-handle");if(this.model.get("compareTwoMode")){c.first().toggleClass("to-handle",!!isRtl).toggleClass("from-handle",!isRtl);c.last().toggleClass("from-handle",!!isRtl).toggleClass("to-handle",!isRtl)}else{c.removeClass("from-handle to-handle")}},start:function(c,d){this.model.set({scrubbing:true});b(window).on("mousemove.wp.revisions",{view:this},function(i){var j=i.data.view,n=j.$el.offset().left,f=n,g=n+j.$el.width(),k=g,l="0",o="100%",h=b(d.handle);if(j.model.get("compareTwoMode")){var m=h.parent().find(".ui-slider-handle");if(h.is(m.first())){k=m.last().offset().left;o=k-f}else{n=m.first().offset().left+m.first().width();l=n-f}}if(i.pageX<n){h.css("left",l)}else{if(i.pageX>k){h.css("left",o)}else{h.css("left",i.pageX-f)}}})},getPosition:function(c){return isRtl?this.model.revisions.length-c-1:c},slide:function(d,f){var c,e;if(this.model.get("compareTwoMode")){if(f.values[1]===f.values[0]){return false}if(isRtl){f.values.reverse()}c={from:this.model.revisions.at(this.getPosition(f.values[0])),to:this.model.revisions.at(this.getPosition(f.values[1]))}}else{c={to:this.model.revisions.at(this.getPosition(f.value))};if(this.getPosition(f.value)>0){c.from=this.model.revisions.at(this.getPosition(f.value)-1)}else{c.from=undefined}}e=this.model.revisions.at(this.getPosition(f.value));if(this.model.get("scrubbing")){c.hoveredRevision=e}this.model.set(c)},stop:function(c,d){b(window).off("mousemove.wp.revisions");this.model.updateSliderSettings();this.model.set({scrubbing:false})}});a.view.Diff=wp.Backbone.View.extend({className:"revisions-diff",template:wp.template("revisions-diff"),prepare:function(){return _.extend({fields:this.model.fields.toJSON()},this.options)}});a.Router=Backbone.Router.extend({initialize:function(c){this.model=c.model;this.routes=_.object([[this.baseUrl("?from=:from&to=:to"),"handleRoute"],[this.baseUrl("?from=:from&to=:to"),"handleRoute"]]);this.listenTo(this.model,"update:diff",_.debounce(this.updateUrl,250));this.listenTo(this.model,"change:compareTwoMode",this.updateUrl)},baseUrl:function(c){return this.model.get("baseUrl")+c},updateUrl:function(){var d=this.model.has("from")?this.model.get("from").id:0;var c=this.model.get("to").id;if(this.model.get("compareTwoMode")){this.navigate(this.baseUrl("?from="+d+"&to="+c))}else{this.navigate(this.baseUrl("?revision="+c))}},handleRoute:function(d,c){var g,f,e=_.isUndefined(c);if(!e){c=this.model.revisions.get(d);d=this.model.revisions.prev(c);c=c?c.id:0;d=d?d.id:0}this.model.set({from:this.model.revisions.get(parseInt(d,10)),to:this.model.revisions.get(parseInt(d,10)),compareTwoMode:e})}});a.init=function(){a.view.frame=new a.view.Frame({model:new a.model.FrameState({},{revisions:new a.model.Revisions(a.settings.revisionData)})}).render()};b(a.init)}(jQuery));
\ No newline at end of file
index e8ac151a207cf25671dd1bd9e2c9f8d3dbf89eaa..c403ad8c24200d5dcd2e7f8ae7ef72fc42585bb8 100644 (file)
@@ -1,6 +1,6 @@
 jQuery(document).ready(function($) {
 
-       $('.delete-tag').live('click', function(e){
+       $('#the-list').on('click', '.delete-tag', function(e){
                var t = $(this), tr = t.parents('tr'), r = true, data;
                if ( 'undefined' != showNotice )
                        r = showNotice.warn();
index b14c79ce2365480c253ae2c37f33fe581a5a071b..c187750fd0d7f0760ab33bf9483d2f9aa9951acc 100644 (file)
@@ -1 +1 @@
-jQuery(document).ready(function(a){a(".delete-tag").live("click",function(g){var b=a(this),f=b.parents("tr"),c=true,d;if("undefined"!=showNotice){c=showNotice.warn()}if(c){d=b.attr("href").replace(/[^?]*\?/,"").replace(/action=delete/,"action=delete-tag");a.post(ajaxurl,d,function(e){if("1"==e){a("#ajax-response").empty();f.fadeOut("normal",function(){f.remove()});a('select#parent option[value="'+d.match(/tag_ID=(\d+)/)[1]+'"]').remove();a("a.tag-link-"+d.match(/tag_ID=(\d+)/)[1]).remove()}else{if("-1"==e){a("#ajax-response").empty().append('<div class="error"><p>'+tagsl10n.noPerm+"</p></div>");f.children().css("backgroundColor","")}else{a("#ajax-response").empty().append('<div class="error"><p>'+tagsl10n.broken+"</p></div>");f.children().css("backgroundColor","")}}});f.children().css("backgroundColor","#f33")}return false});a("#submit").click(function(){var b=a(this).parents("form");if(!validateForm(b)){return false}a.post(ajaxurl,a("#addtag").serialize(),function(h){a("#ajax-response").empty();var f=wpAjax.parseAjaxResponse(h,"ajax-response");if(!f||f.errors){return}var g=b.find("select#parent").val();if(g>0&&a("#tag-"+g).length>0){a(".tags #tag-"+g).after(f.responses[0].supplemental.noparents)}else{a(".tags").prepend(f.responses[0].supplemental.parents)}a(".tags .no-items").remove();if(b.find("select#parent")){var e=f.responses[1].supplemental;var c="";for(var d=0;d<f.responses[1].position;d++){c+="&nbsp;&nbsp;&nbsp;"}b.find("select#parent option:selected").after('<option value="'+e.term_id+'">'+c+e.name+"</option>")}a('input[type="text"]:visible, textarea:visible',b).val("")});return false})});
\ No newline at end of file
+jQuery(document).ready(function(a){a("#the-list").on("click",".delete-tag",function(g){var b=a(this),f=b.parents("tr"),c=true,d;if("undefined"!=showNotice){c=showNotice.warn()}if(c){d=b.attr("href").replace(/[^?]*\?/,"").replace(/action=delete/,"action=delete-tag");a.post(ajaxurl,d,function(e){if("1"==e){a("#ajax-response").empty();f.fadeOut("normal",function(){f.remove()});a('select#parent option[value="'+d.match(/tag_ID=(\d+)/)[1]+'"]').remove();a("a.tag-link-"+d.match(/tag_ID=(\d+)/)[1]).remove()}else{if("-1"==e){a("#ajax-response").empty().append('<div class="error"><p>'+tagsl10n.noPerm+"</p></div>");f.children().css("backgroundColor","")}else{a("#ajax-response").empty().append('<div class="error"><p>'+tagsl10n.broken+"</p></div>");f.children().css("backgroundColor","")}}});f.children().css("backgroundColor","#f33")}return false});a("#submit").click(function(){var b=a(this).parents("form");if(!validateForm(b)){return false}a.post(ajaxurl,a("#addtag").serialize(),function(h){a("#ajax-response").empty();var f=wpAjax.parseAjaxResponse(h,"ajax-response");if(!f||f.errors){return}var g=b.find("select#parent").val();if(g>0&&a("#tag-"+g).length>0){a(".tags #tag-"+g).after(f.responses[0].supplemental.noparents)}else{a(".tags").prepend(f.responses[0].supplemental.parents)}a(".tags .no-items").remove();if(b.find("select#parent")){var e=f.responses[1].supplemental;var c="";for(var d=0;d<f.responses[1].position;d++){c+="&nbsp;&nbsp;&nbsp;"}b.find("select#parent option:selected").after('<option value="'+e.term_id+'">'+c+e.name+"</option>")}a('input[type="text"]:visible, textarea:visible',b).val("")});return false})});
\ No newline at end of file
index 079c73b5e419614e7d9403849468ee8e4ad1c06b..0899ab72f09a4f25b534afd85d0dfa8ca78bdb07 100644 (file)
@@ -18,6 +18,31 @@ jQuery( function($) {
        });
 });
 
+/**
+ * Theme Browser Thickbox
+ *
+ * Aligns theme browser thickbox.
+ */
+var tb_position;
+jQuery(document).ready( function($) {
+       tb_position = function() {
+               var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(), W = ( 1040 < width ) ? 1040 : width, adminbar_height = 0;
+
+               if ( $('body.admin-bar').length )
+                       adminbar_height = 28;
+
+               if ( tbWindow.size() ) {
+                       tbWindow.width( W - 50 ).height( H - 45 - adminbar_height );
+                       $('#TB_iframeContent').width( W - 50 ).height( H - 75 - adminbar_height );
+                       tbWindow.css({'margin-left': '-' + parseInt( ( ( W - 50 ) / 2 ), 10 ) + 'px'});
+                       if ( typeof document.body.style.maxWidth != 'undefined' )
+                               tbWindow.css({'top': 20 + adminbar_height + 'px','margin-top':'0'});
+               };
+       };
+
+       $(window).resize(function(){ tb_position(); });
+});
+
 /**
  * Theme Install
  *
index a67f9ba1a35645b8eac1cebfdbb52e50877c8aeb..3efe890ff20422198e6b719db2cb20d260e46b52 100644 (file)
@@ -1 +1 @@
-jQuery(function(a){a("#availablethemes").on("click",".theme-detail",function(c){var d=a(this).closest(".available-theme"),b=d.find(".themedetaildiv");if(!b.length){b=d.find(".install-theme-info .theme-details");b=b.clone().addClass("themedetaildiv").appendTo(d).hide()}b.toggle();c.preventDefault()})});jQuery(function(c){if(!window.postMessage){return}var e=c("#theme-installer"),d=e.find(".install-theme-info"),b=e.find(".wp-full-overlay-main"),a=c(document.body);e.on("click",".close-full-overlay",function(f){e.fadeOut(200,function(){b.empty();a.removeClass("theme-installer-active full-overlay-active")});f.preventDefault()});e.on("click",".collapse-sidebar",function(f){e.toggleClass("collapsed").toggleClass("expanded");f.preventDefault()});c("#availablethemes").on("click",".install-theme-preview",function(f){var g;d.html(c(this).closest(".installable-theme").find(".install-theme-info").html());g=d.find(".theme-preview-url").val();b.html('<iframe src="'+g+'" />');e.fadeIn(200,function(){a.addClass("theme-installer-active full-overlay-active")});f.preventDefault()})});var ThemeViewer;(function(a){ThemeViewer=function(b){function d(){a("#filter-click, #mini-filter-click").unbind("click").click(function(){a("#filter-click").toggleClass("current");a("#filter-box").slideToggle();a("#current-theme").slideToggle(300);return false});a("#filter-box :checkbox").unbind("click").click(function(){var e=a("#filter-box :checked").length,f=a("#filter-click").text();if(f.indexOf("(")!=-1){f=f.substr(0,f.indexOf("("))}if(e==0){a("#filter-click").text(f)}else{a("#filter-click").text(f+" ("+e+")")}})}var c={init:d};return c}})(jQuery);jQuery(document).ready(function(a){theme_viewer=new ThemeViewer();theme_viewer.init()});var ThemeScroller;(function(a){ThemeScroller={querying:false,scrollPollingDelay:500,failedRetryDelay:4000,outListBottomThreshold:300,init:function(){var b=this;if(typeof ajaxurl==="undefined"||typeof list_args==="undefined"||typeof theme_list_args==="undefined"){a(".pagination-links").show();return}this.nonce=a("#_ajax_fetch_list_nonce").val();this.nextPage=(theme_list_args.paged+1);this.$outList=a("#availablethemes");this.$spinner=a("div.tablenav.bottom").children(".spinner");this.$window=a(window);this.$document=a(document);if(theme_list_args.total_pages>=this.nextPage){this.pollInterval=setInterval(function(){return b.poll()},this.scrollPollingDelay)}},poll:function(){var b=this.$document.scrollTop()+this.$window.innerHeight();if(this.querying||(b<this.$outList.height()-this.outListBottomThreshold)){return}this.ajax()},process:function(b){if(b===undefined){clearInterval(this.pollInterval);return}if(this.nextPage>theme_list_args.total_pages){clearInterval(this.pollInterval)}if(this.nextPage<=(theme_list_args.total_pages+1)){this.$outList.append(b.rows)}},ajax:function(){var b=this;this.querying=true;var c={action:"fetch-list",paged:this.nextPage,s:theme_list_args.search,tab:theme_list_args.tab,type:theme_list_args.type,_ajax_fetch_list_nonce:this.nonce,"features[]":theme_list_args.features,list_args:list_args};this.$spinner.show();a.getJSON(ajaxurl,c).done(function(d){b.nextPage++;b.process(d);b.$spinner.hide();b.querying=false}).fail(function(){b.$spinner.hide();b.querying=false;setTimeout(function(){b.ajax()},b.failedRetryDelay)})}};a(document).ready(function(b){ThemeScroller.init()})})(jQuery);
\ No newline at end of file
+jQuery(function(a){a("#availablethemes").on("click",".theme-detail",function(c){var d=a(this).closest(".available-theme"),b=d.find(".themedetaildiv");if(!b.length){b=d.find(".install-theme-info .theme-details");b=b.clone().addClass("themedetaildiv").appendTo(d).hide()}b.toggle();c.preventDefault()})});var tb_position;jQuery(document).ready(function(a){tb_position=function(){var f=a("#TB_window"),e=a(window).width(),d=a(window).height(),c=(1040<e)?1040:e,b=0;if(a("body.admin-bar").length){b=28}if(f.size()){f.width(c-50).height(d-45-b);a("#TB_iframeContent").width(c-50).height(d-75-b);f.css({"margin-left":"-"+parseInt(((c-50)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){f.css({top:20+b+"px","margin-top":"0"})}}};a(window).resize(function(){tb_position()})});jQuery(function(c){if(!window.postMessage){return}var e=c("#theme-installer"),d=e.find(".install-theme-info"),b=e.find(".wp-full-overlay-main"),a=c(document.body);e.on("click",".close-full-overlay",function(f){e.fadeOut(200,function(){b.empty();a.removeClass("theme-installer-active full-overlay-active")});f.preventDefault()});e.on("click",".collapse-sidebar",function(f){e.toggleClass("collapsed").toggleClass("expanded");f.preventDefault()});c("#availablethemes").on("click",".install-theme-preview",function(f){var g;d.html(c(this).closest(".installable-theme").find(".install-theme-info").html());g=d.find(".theme-preview-url").val();b.html('<iframe src="'+g+'" />');e.fadeIn(200,function(){a.addClass("theme-installer-active full-overlay-active")});f.preventDefault()})});var ThemeViewer;(function(a){ThemeViewer=function(b){function d(){a("#filter-click, #mini-filter-click").unbind("click").click(function(){a("#filter-click").toggleClass("current");a("#filter-box").slideToggle();a("#current-theme").slideToggle(300);return false});a("#filter-box :checkbox").unbind("click").click(function(){var e=a("#filter-box :checked").length,f=a("#filter-click").text();if(f.indexOf("(")!=-1){f=f.substr(0,f.indexOf("("))}if(e==0){a("#filter-click").text(f)}else{a("#filter-click").text(f+" ("+e+")")}})}var c={init:d};return c}})(jQuery);jQuery(document).ready(function(a){theme_viewer=new ThemeViewer();theme_viewer.init()});var ThemeScroller;(function(a){ThemeScroller={querying:false,scrollPollingDelay:500,failedRetryDelay:4000,outListBottomThreshold:300,init:function(){var b=this;if(typeof ajaxurl==="undefined"||typeof list_args==="undefined"||typeof theme_list_args==="undefined"){a(".pagination-links").show();return}this.nonce=a("#_ajax_fetch_list_nonce").val();this.nextPage=(theme_list_args.paged+1);this.$outList=a("#availablethemes");this.$spinner=a("div.tablenav.bottom").children(".spinner");this.$window=a(window);this.$document=a(document);if(theme_list_args.total_pages>=this.nextPage){this.pollInterval=setInterval(function(){return b.poll()},this.scrollPollingDelay)}},poll:function(){var b=this.$document.scrollTop()+this.$window.innerHeight();if(this.querying||(b<this.$outList.height()-this.outListBottomThreshold)){return}this.ajax()},process:function(b){if(b===undefined){clearInterval(this.pollInterval);return}if(this.nextPage>theme_list_args.total_pages){clearInterval(this.pollInterval)}if(this.nextPage<=(theme_list_args.total_pages+1)){this.$outList.append(b.rows)}},ajax:function(){var b=this;this.querying=true;var c={action:"fetch-list",paged:this.nextPage,s:theme_list_args.search,tab:theme_list_args.tab,type:theme_list_args.type,_ajax_fetch_list_nonce:this.nonce,"features[]":theme_list_args.features,list_args:list_args};this.$spinner.show();a.getJSON(ajaxurl,c).done(function(d){b.nextPage++;b.process(d);b.$spinner.hide();b.querying=false}).fail(function(){b.$spinner.hide();b.querying=false;setTimeout(function(){b.ajax()},b.failedRetryDelay)})}};a(document).ready(function(b){ThemeScroller.init()})})(jQuery);
\ No newline at end of file
index 2abd79952ffa5788c2412f56482ddae1f475a0a2..6f9c5678e80d4415af083b85a26c08670c6f8b74 100644 (file)
@@ -15,10 +15,7 @@ if ( ! current_user_can('manage_links') )
 $title = __('Add New Link');
 $parent_file = 'link-manager.php';
 
-wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image',
-       'description', 'visible', 'target', 'category', 'link_id',
-       'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel',
-       'notes', 'linkcheck[]'));
+wp_reset_vars( array('action', 'cat_id', 'link_id' ) );
 
 wp_enqueue_script('link');
 wp_enqueue_script('xfn');
index 92194f039213c40289d86b1752b5937dff94da78..3154f8e3db97177cf9214b667072d92f44f41405 100644 (file)
@@ -31,7 +31,7 @@ if ( $doaction && isset( $_REQUEST['linkcheck'] ) ) {
                exit;
        }
 } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
-        wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) );
+        wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
         exit;
 }
 
@@ -72,7 +72,7 @@ if ( ! current_user_can('manage_links') )
 <?php screen_icon(); ?>
 <h2><?php echo esc_html( $title ); ?> <a href="link-add.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'link'); ?></a> <?php
 if ( !empty($_REQUEST['s']) )
-       printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( stripslashes($_REQUEST['s']) ) ); ?>
+       printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( wp_unslash($_REQUEST['s']) ) ); ?>
 </h2>
 
 <?php
index d12d229ed83fe22f05f399289fc9c2d2a5c0e36e..e696d4544187f55f9cd28efdd47c83ba84597839 100644 (file)
@@ -12,7 +12,7 @@
 /** Load WordPress Administration Bootstrap */
 require_once ('admin.php');
 
-wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]'));
+wp_reset_vars( array( 'action', 'cat_id', 'link_id' ) );
 
 if ( ! current_user_can('manage_links') )
        wp_link_manager_disabled_message();
index 4d185ed53627751e83decc4f402a12a72f9b8867..8dfe3b18ad37487d470942348a212451d8e22108 100644 (file)
@@ -119,7 +119,7 @@ if ( is_array( $load ) )
        $load = implode( '', $load );
 
 $load = preg_replace( '/[^a-z0-9,_-]+/i', '', $load );
-$load = explode(',', $load);
+$load = array_unique( explode( ',', $load ) );
 
 if ( empty($load) )
        exit;
index 8ff93f52e4d2e8a5e3503308b3adfaf3dd024dd1..d2f8bfbdee4e4e0eb17e02f6be20bb3df5903762 100644 (file)
@@ -96,7 +96,7 @@ require(ABSPATH . '/wp-includes/script-loader.php');
 require(ABSPATH . '/wp-includes/version.php');
 
 $load = preg_replace( '/[^a-z0-9,_-]+/i', '', $_GET['load'] );
-$load = explode(',', $load);
+$load = array_unique( explode( ',', $load ) );
 
 if ( empty($load) )
        exit;
index 2880169408b0a5fa686d140274d8e7c3de815038..7cc13e11ace666f56e4084612afe9df8d8d9b63c 100644 (file)
@@ -21,7 +21,7 @@ header( 'Content-Type: text/html; charset=utf-8' );
        ?>
 </head>
 <body class="wp-core-ui">
-<h1 id="logo"><a href="<?php esc_attr_e( 'http://wordpress.org/' ); ?>"><?php _e( 'WordPress' ); ?></a></h1>
+<h1 id="logo"><a href="<?php echo esc_url( __( 'http://wordpress.org/' ) ); ?>"><?php _e( 'WordPress' ); ?></a></h1>
 
 <?php
 
index c6a7ae141584e2df823d9e0ee64199c59a0975ef..e4288119573db1bfc087d9a323eff3b496809766 100644 (file)
@@ -68,7 +68,7 @@ if ( get_user_setting('uploader') || isset( $_GET['browser-uploader'] ) )
        <?php screen_icon(); ?>
        <h2><?php echo esc_html( $title ); ?></h2>
 
-       <form enctype="multipart/form-data" method="post" action="<?php echo admin_url('media-new.php'); ?>" class="<?php echo $form_class; ?>" id="file-form">
+       <form enctype="multipart/form-data" method="post" action="<?php echo admin_url('media-new.php'); ?>" class="<?php echo esc_attr( $form_class ); ?>" id="file-form">
 
        <?php media_upload_form(); ?>
 
index 25ebaa00fa8db9fdf40613c6aa51612863110f26..c158cc20375b0c94bb19cdbd659fba1c6b54dce2 100644 (file)
@@ -87,7 +87,7 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
                        $menu_file = $submenu_items[0][2];
                        if ( false !== ( $pos = strpos( $menu_file, '?' ) ) )
                                $menu_file = substr( $menu_file, 0, $pos );
-                       if ( ! empty( $menu_hook ) || ( ('index.php' != $submenu_items[0][2]) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) ) ) {
+                       if ( ! empty( $menu_hook ) || ( ( 'index.php' != $submenu_items[0][2] ) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) ) {
                                $admin_is_parent = true;
                                echo "<a href='admin.php?page={$submenu_items[0][2]}'$class $aria_attributes>$arrow<div class='wp-menu-image'>$img</div><div class='wp-menu-name'>$title</div></a>";
                        } else {
@@ -98,7 +98,7 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
                        $menu_file = $item[2];
                        if ( false !== ( $pos = strpos( $menu_file, '?' ) ) )
                                $menu_file = substr( $menu_file, 0, $pos );
-                       if ( ! empty( $menu_hook ) || ( ('index.php' != $item[2]) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) ) ) {
+                       if ( ! empty( $menu_hook ) || ( ( 'index.php' != $item[2] ) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) ) {
                                $admin_is_parent = true;
                                echo "\n\t<a href='admin.php?page={$item[2]}'$class $aria_attributes>$arrow<div class='wp-menu-image'>$img</div><div class='wp-menu-name'>{$item[0]}</div></a>";
                        } else {
@@ -150,12 +150,12 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
 
                                $title = wptexturize($sub_item[0]);
 
-                               if ( ! empty( $menu_hook ) || ( ('index.php' != $sub_item[2]) && file_exists( WP_PLUGIN_DIR . "/$sub_file" ) ) ) {
+                               if ( ! empty( $menu_hook ) || ( ( 'index.php' != $sub_item[2] ) && file_exists( WP_PLUGIN_DIR . "/$sub_file" ) && ! file_exists( ABSPATH . "/wp-admin/$sub_file" ) ) ) {
                                        // If admin.php is the current page or if the parent exists as a file in the plugins or admin dir
-                                       if ( (!$admin_is_parent && file_exists(WP_PLUGIN_DIR . "/$menu_file") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}")) || file_exists($menu_file) )
-                                               $sub_item_url = add_query_arg( array('page' => $sub_item[2]), $item[2] );
+                                       if ( ( ! $admin_is_parent && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! is_dir( WP_PLUGIN_DIR . "/{$item[2]}" ) ) || file_exists( $menu_file ) )
+                                               $sub_item_url = add_query_arg( array( 'page' => $sub_item[2] ), $item[2] );
                                        else
-                                               $sub_item_url = add_query_arg( array('page' => $sub_item[2]), 'admin.php' );
+                                               $sub_item_url = add_query_arg( array( 'page' => $sub_item[2] ), 'admin.php' );
 
                                        $sub_item_url = esc_url( $sub_item_url );
                                        echo "<li$class><a href='$sub_item_url'$class>$title</a></li>";
index 90c585dbd9d909881e306596cc7564a5c96ce9fc..365b4595441c1fdb0ce1e0d76b51be2098e83779 100644 (file)
@@ -136,17 +136,15 @@ unset($ptype, $ptype_obj, $ptype_class, $ptype_for_id, $ptype_menu_position, $me
 
 $menu[59] = array( '', 'read', 'separator2', '', 'wp-menu-separator' );
 
-if ( current_user_can( 'switch_themes') ) {
-       $menu[60] = array( __('Appearance'), 'switch_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'none' );
-               $submenu['themes.php'][5]  = array(__('Themes'), 'switch_themes', 'themes.php');
-               if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
-                       $submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php');
-} else {
-       $menu[60] = array( __('Appearance'), 'edit_theme_options', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'none' );
-               $submenu['themes.php'][5]  = array(__('Themes'), 'edit_theme_options', 'themes.php');
-               if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
-                       $submenu['themes.php'][10] = array(__('Menus'), 'edit_theme_options', 'nav-menus.php' );
-}
+$appearance_cap = current_user_can( 'switch_themes') ? 'switch_themes' : 'edit_theme_options';
+
+$menu[60] = array( __('Appearance'), $appearance_cap, 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'div' );
+       $submenu['themes.php'][5] = array( __( 'Themes' ), $appearance_cap, 'themes.php' );
+       $submenu['themes.php'][6] = array( __( 'Customize' ), 'edit_theme_options', 'customize.php', 'hide-if-no-customize' );
+       if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) )
+               $submenu['themes.php'][10] = array(__( 'Menus' ), 'edit_theme_options', 'nav-menus.php');
+
+unset( $appearance_cap );
 
 // Add 'Editor' to the bottom of the Appearance menu.
 if ( ! is_multisite() )
index 361d0f6cde93bb04b5d48f8448a64480cf43d5d3..549d03b5a8c18054d250618638b72b064381335e 100644 (file)
@@ -36,6 +36,11 @@ $nav_menu_selected_title = '';
 // The menu id of the current menu being edited
 $nav_menu_selected_id = isset( $_REQUEST['menu'] ) ? (int) $_REQUEST['menu'] : 0;
 
+// Get existing menu locations assignments
+$locations = get_registered_nav_menus();
+$menu_locations = get_nav_menu_locations();
+$num_locations = count( array_keys( $locations ) );
+
 // Allowed actions: add, update, delete
 $action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'edit';
 
@@ -221,49 +226,60 @@ switch ( $action ) {
                if ( is_nav_menu_item( $menu_item_id ) && wp_delete_post( $menu_item_id, true ) )
                        $messages[] = '<div id="message" class="updated"><p>' . __('The menu item has been successfully deleted.') . '</p></div>';
                break;
+
        case 'delete':
                check_admin_referer( 'delete-nav_menu-' . $nav_menu_selected_id );
-
                if ( is_nav_menu( $nav_menu_selected_id ) ) {
-                       $deleted_nav_menu = wp_get_nav_menu_object( $nav_menu_selected_id );
-                       $delete_nav_menu = wp_delete_nav_menu( $nav_menu_selected_id );
-
-                       if ( is_wp_error($delete_nav_menu) ) {
-                               $messages[] = '<div id="message" class="error"><p>' . $delete_nav_menu->get_error_message() . '</p></div>';
-                       } else {
-                               // Remove this menu from any locations.
-                               $locations = get_theme_mod( 'nav_menu_locations' );
-                               foreach ( (array) $locations as $location => $menu_id ) {
-                                       if ( $menu_id == $nav_menu_selected_id )
-                                               $locations[ $location ] = 0;
-                               }
-                               set_theme_mod( 'nav_menu_locations', $locations );
-                               $messages[] = '<div id="message" class="updated"><p>' . __('The menu has been successfully deleted.') . '</p></div>';
-                               // Select the next available menu
-                               $nav_menu_selected_id = 0;
-                               $_nav_menus = wp_get_nav_menus( array('orderby' => 'name') );
-                               foreach( $_nav_menus as $index => $_nav_menu ) {
-                                       if ( strcmp( $_nav_menu->name, $deleted_nav_menu->name ) >= 0
-                                        || $index == count( $_nav_menus ) - 1 ) {
-                                               $nav_menu_selected_id = $_nav_menu->term_id;
-                                               break;
-                                       }
-                               }
-                       }
-                       unset( $delete_nav_menu, $deleted_nav_menu, $_nav_menus );
+                       $deletion = wp_delete_nav_menu( $nav_menu_selected_id );
                } else {
                        // Reset the selected menu
                        $nav_menu_selected_id = 0;
                        unset( $_REQUEST['menu'] );
                }
+
+               if ( ! isset( $deletion ) )
+                       break;
+
+               if ( is_wp_error( $deletion ) )
+                       $messages[] = '<div id="message" class="error"><p>' . $deletion->get_error_message() . '</p></div>';
+               else
+                       $messages[] = '<div id="message" class="updated"><p>' . __( 'The menu has been successfully deleted.' ) . '</p></div>';
+               break;
+
+       case 'delete_menus':
+               check_admin_referer( 'nav_menus_bulk_actions' );
+               foreach ( $_REQUEST['delete_menus'] as $menu_id_to_delete ) {
+                       if ( ! is_nav_menu( $menu_id_to_delete ) )
+                               continue;
+
+                       $deletion = wp_delete_nav_menu( $menu_id_to_delete );
+                       if ( is_wp_error( $deletion ) ) {
+                               $messages[] = '<div id="message" class="error"><p>' . $deletion->get_error_message() . '</p></div>';
+                               $deletion_error = true;
+                       }
+               }
+
+               if ( empty( $deletion_error ) )
+                       $messages[] = '<div id="message" class="updated"><p>' . __( 'Selected menus have been successfully deleted.' ) . '</p></div>';
                break;
 
        case 'update':
                check_admin_referer( 'update-nav_menu', 'update-nav-menu-nonce' );
 
-               // Update menu theme locations
-               if ( isset( $_POST['menu-locations'] ) )
-                       set_theme_mod( 'nav_menu_locations', array_map( 'absint', $_POST['menu-locations'] ) );
+               // Remove menu locations that have been unchecked
+               foreach ( $locations as $location => $description ) {
+                       if ( ( empty( $_POST['menu-locations'] ) || empty( $_POST['menu-locations'][ $location ] ) ) && isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] == $nav_menu_selected_id )
+                               unset( $menu_locations[ $location ] );
+               }
+
+               // Merge new and existing menu locations if any new ones are set
+               if ( isset( $_POST['menu-locations'] ) ) {
+                       $new_menu_locations = array_map( 'absint', $_POST['menu-locations'] );
+                       $menu_locations = array_merge( $menu_locations, $new_menu_locations );
+               }
+
+               // Set menu locations
+               set_theme_mod( 'nav_menu_locations', $menu_locations );
 
                // Add Menu
                if ( 0 == $nav_menu_selected_id ) {
@@ -278,20 +294,41 @@ switch ( $action ) {
                                        $_menu_object = wp_get_nav_menu_object( $_nav_menu_selected_id );
                                        $nav_menu_selected_id = $_nav_menu_selected_id;
                                        $nav_menu_selected_title = $_menu_object->name;
-                                       $messages[] = '<div id="message" class="updated"><p>' . sprintf( __('The <strong>%s</strong> menu has been successfully created.'), $nav_menu_selected_title ) . '</p></div>';
+                                       if ( isset( $_REQUEST['menu-item'] ) )
+                                               wp_save_nav_menu_items( $nav_menu_selected_id, absint( $_REQUEST['menu-item'] ) );
+                                       if ( isset( $_REQUEST['zero-menu-state'] ) ) {
+                                               // If there are menu items, add them
+                                               wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title );
+                                               // Auto-save nav_menu_locations
+                                               $locations = get_theme_mod( 'nav_menu_locations' );
+                                               foreach ( (array) $locations as $location => $menu_id ) {
+                                                               $locations[ $location ] = $nav_menu_selected_id;
+                                                               break; // There should only be 1
+                                               }
+                                               set_theme_mod( 'nav_menu_locations', $locations );
+                                       }
+                                       if ( isset( $_REQUEST['use-location'] ) ) {
+                                               $locations = get_theme_mod( 'nav_menu_locations' );
+                                               if ( isset( $locations[$_REQUEST['use-location']] ) )
+                                                       $locations[$_REQUEST['use-location']] = $nav_menu_selected_id;
+                                               set_theme_mod( 'nav_menu_locations', $locations );
+                                       }
+                                       // $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( '<strong>%s</strong> has been created.' ), $nav_menu_selected_title ) . '</p></div>';
+                                       wp_redirect( admin_url( 'nav-menus.php?menu=' . $_nav_menu_selected_id ) );
+                                       exit();
                                }
                        } else {
-                               $messages[] = '<div id="message" class="error"><p>' . __('Please enter a valid menu name.') . '</p></div>';
+                               $messages[] = '<div id="message" class="error"><p>' . __( 'Please enter a valid menu name.' ) . '</p></div>';
                        }
 
-               // update existing menu
+               // Update existing menu
                } else {
 
                        $_menu_object = wp_get_nav_menu_object( $nav_menu_selected_id );
 
                        $menu_title = trim( esc_html( $_POST['menu-name'] ) );
                        if ( ! $menu_title ) {
-                               $messages[] = '<div id="message" class="error"><p>' . __('Please enter a valid menu name.') . '</p></div>';
+                               $messages[] = '<div id="message" class="error"><p>' . __( 'Please enter a valid menu name.' ) . '</p></div>';
                                $menu_title = $_menu_object->name;
                        }
 
@@ -307,89 +344,87 @@ switch ( $action ) {
                        }
 
                        // Update menu items
-
                        if ( ! is_wp_error( $_menu_object ) ) {
-                               $unsorted_menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array('orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID', 'post_status' => 'draft,publish') );
-                               $menu_items = array();
-                               // Index menu items by db ID
-                               foreach( $unsorted_menu_items as $_item )
-                                       $menu_items[$_item->db_id] = $_item;
-
-                               $post_fields = array( 'menu-item-db-id', 'menu-item-object-id', 'menu-item-object', 'menu-item-parent-id', 'menu-item-position', 'menu-item-type', 'menu-item-title', 'menu-item-url', 'menu-item-description', 'menu-item-attr-title', 'menu-item-target', 'menu-item-classes', 'menu-item-xfn' );
-                               wp_defer_term_counting(true);
-                               // Loop through all the menu items' POST variables
-                               if ( ! empty( $_POST['menu-item-db-id'] ) ) {
-                                       foreach( (array) $_POST['menu-item-db-id'] as $_key => $k ) {
-
-                                               // Menu item title can't be blank
-                                               if ( empty( $_POST['menu-item-title'][$_key] ) )
-                                                       continue;
-
-                                               $args = array();
-                                               foreach ( $post_fields as $field )
-                                                       $args[$field] = isset( $_POST[$field][$_key] ) ? $_POST[$field][$_key] : '';
-
-                                               $menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][$_key] != $_key ? 0 : $_key ), $args );
-
-                                               if ( is_wp_error( $menu_item_db_id ) )
-                                                       $messages[] = '<div id="message" class="error"><p>' . $menu_item_db_id->get_error_message() . '</p></div>';
-                                               elseif ( isset( $menu_items[$menu_item_db_id] ) )
-                                                       unset( $menu_items[$menu_item_db_id] );
-                                       }
-                               }
-
-                               // Remove menu items from the menu that weren't in $_POST
-                               if ( ! empty( $menu_items ) ) {
-                                       foreach ( array_keys( $menu_items ) as $menu_item_id ) {
-                                               if ( is_nav_menu_item( $menu_item_id ) ) {
-                                                       wp_delete_post( $menu_item_id );
-                                               }
-                                       }
-                               }
+                               $messages = array_merge( $messages, wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title ) );
+                       }
+               }
+               break;
+       case 'locations':
+               if ( ! $num_locations ) {
+                       wp_redirect( admin_url( 'nav-menus.php' ) );
+                       exit();
+               }
 
-                               // Store 'auto-add' pages.
-                               $auto_add = ! empty( $_POST['auto-add-pages'] );
-                               $nav_menu_option = (array) get_option( 'nav_menu_options' );
-                               if ( ! isset( $nav_menu_option['auto_add'] ) )
-                                       $nav_menu_option['auto_add'] = array();
-                               if ( $auto_add ) {
-                                       if ( ! in_array( $nav_menu_selected_id, $nav_menu_option['auto_add'] ) )
-                                               $nav_menu_option['auto_add'][] = $nav_menu_selected_id;
-                               } else {
-                                       if ( false !== ( $key = array_search( $nav_menu_selected_id, $nav_menu_option['auto_add'] ) ) )
-                                               unset( $nav_menu_option['auto_add'][$key] );
-                               }
-                               // Remove nonexistent/deleted menus
-                               $nav_menu_option['auto_add'] = array_intersect( $nav_menu_option['auto_add'], wp_get_nav_menus( array( 'fields' => 'ids' ) ) );
-                               update_option( 'nav_menu_options', $nav_menu_option );
+               add_filter( 'screen_options_show_screen', '__return_false' );
 
-                               wp_defer_term_counting(false);
+               if ( isset( $_POST['menu-locations'] ) ) {
+                       check_admin_referer( 'save-menu-locations' );
 
-                               do_action( 'wp_update_nav_menu', $nav_menu_selected_id );
+                       $new_menu_locations = array_map( 'absint', $_POST['menu-locations'] );
+                       $menu_locations = array_merge( $menu_locations, $new_menu_locations );
+                       // Set menu locations
+                       set_theme_mod( 'nav_menu_locations', $menu_locations );
 
-                               $messages[] = '<div id="message" class="updated"><p>' . sprintf( __('The <strong>%s</strong> menu has been updated.'), $nav_menu_selected_title ) . '</p></div>';
-                               unset( $menu_items, $unsorted_menu_items );
-                       }
+                       $messages[] = '<div id="message" class="updated"><p>' . __( 'Menu locations updated.' ) . '</p></div>';
                }
                break;
 }
 
 // Get all nav menus
 $nav_menus = wp_get_nav_menus( array('orderby' => 'name') );
+$menu_count = count( $nav_menus );
+
+// Are we on the add new screen?
+$add_new_screen = ( isset( $_GET['menu'] ) && 0 == $_GET['menu'] ) ? true : false;
+
+$locations_screen = ( isset( $_GET['action'] ) && 'locations' == $_GET['action'] ) ? true : false;
+
+// If we have one theme location, and zero menus, we take them right into editing their first menu
+$page_count = wp_count_posts( 'page' );
+$one_theme_location_no_menus = ( 1 == count( get_registered_nav_menus() ) && ! $add_new_screen && empty( $nav_menus ) && ! empty( $page_count->publish ) ) ? true : false;
+
+$nav_menus_l10n = array(
+       'oneThemeLocationNoMenus' => $one_theme_location_no_menus,
+       'moveUp'       => __( 'Move up one' ),
+       'moveDown'     => __( 'Move down one' ),
+       'moveToTop'    => __( 'Move to the top' ),
+       /* translators: %s: previous item name */
+       'moveUnder'    => __( 'Move under %s' ),
+       /* translators: %s: previous item name */
+       'moveOutFrom'  => __( 'Move out from under %s' ),
+       /* translators: %s: previous item name */
+       'under'        => __( 'Under %s' ),
+       /* translators: %s: previous item name */
+       'outFrom'      => __( 'Out from under %s' ),
+       /* translators: 1: item name, 2: item position, 3: total number of items */
+       'menuFocus'    => __( '%1$s. Menu item %2$d of %3$d.' ),
+       /* translators: 1: item name, 2: item position, 3: parent item name */
+       'subMenuFocus' => __( '%1$s. Sub item number %2$d under %3$s.' ),
+);
+wp_localize_script( 'nav-menu', 'menus', $nav_menus_l10n );
 
-// Get recently edited nav menu
-$recently_edited = (int) get_user_option( 'nav_menu_recently_edited' );
+// Redirect to add screen if there are no menus and this users has either zero, or more than 1 theme locations
+if ( 0 == $menu_count && ! $add_new_screen && ! $one_theme_location_no_menus )
+       wp_redirect( admin_url( 'nav-menus.php?action=edit&menu=0' ) );
 
-// If there was no recently edited menu, and $nav_menu_selected_id is a nav menu, update recently edited menu.
-if ( !$recently_edited && is_nav_menu( $nav_menu_selected_id ) ) {
+// Get recently edited nav menu
+$recently_edited = absint( get_user_option( 'nav_menu_recently_edited' ) );
+if ( empty( $recently_edited ) && is_nav_menu( $nav_menu_selected_id ) )
        $recently_edited = $nav_menu_selected_id;
 
-// Else if $nav_menu_selected_id is not a menu and not requesting that we create a new menu, but $recently_edited is a menu, grab that one.
-} elseif ( 0 == $nav_menu_selected_id && ! isset( $_REQUEST['menu'] ) && is_nav_menu( $recently_edited ) ) {
+// Use $recently_edited if none are selected
+if ( empty( $nav_menu_selected_id ) && ! isset( $_GET['menu'] ) && is_nav_menu( $recently_edited ) )
        $nav_menu_selected_id = $recently_edited;
 
-// Else try to grab the first menu from the menus list
-} elseif ( 0 == $nav_menu_selected_id && ! isset( $_REQUEST['menu'] ) && ! empty($nav_menus) ) {
+// On deletion of menu, if another menu exists, show it
+if ( ! $add_new_screen && 0 < $menu_count && isset( $_GET['action'] ) && 'delete' == $_GET['action'] )
+       $nav_menu_selected_id = $nav_menus[0]->term_id;
+
+// Set $nav_menu_selected_id to 0 if no menus
+if ( $one_theme_location_no_menus ) {
+       $nav_menu_selected_id = 0;
+} elseif ( empty( $nav_menu_selected_id ) && ! empty( $nav_menus ) && ! $add_new_screen ) {
+       // if we have no selection yet, and we have menus, set to the first one in the list
        $nav_menu_selected_id = $nav_menus[0]->term_id;
 }
 
@@ -405,11 +440,13 @@ if ( ! $nav_menu_selected_title && is_nav_menu( $nav_menu_selected_id ) ) {
 
 // Generate truncated menu names
 foreach( (array) $nav_menus as $key => $_nav_menu ) {
-       $_nav_menu->truncated_name = trim( wp_html_excerpt( $_nav_menu->name, 40 ) );
-       if ( $_nav_menu->truncated_name != $_nav_menu->name )
-               $_nav_menu->truncated_name .= '&hellip;';
+       $nav_menus[$key]->truncated_name = wp_html_excerpt( $_nav_menu->name, 40, '&hellip;' );
+}
 
-       $nav_menus[$key]->truncated_name = $_nav_menu->truncated_name;
+// Retrieve menu locations
+if ( current_theme_supports( 'menus' ) ) {
+       $locations = get_registered_nav_menus();
+       $menu_locations = get_nav_menu_locations();
 }
 
 // Ensure the user will be able to scroll horizontally
@@ -418,8 +455,10 @@ global $_wp_nav_menu_max_depth;
 $_wp_nav_menu_max_depth = 0;
 
 // Calling wp_get_nav_menu_to_edit generates $_wp_nav_menu_max_depth
-if ( is_nav_menu( $nav_menu_selected_id ) )
+if ( is_nav_menu( $nav_menu_selected_id ) ) {
+       $menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array( 'post_status' => 'any' ) );
        $edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id );
+}
 
 function wp_nav_menu_max_depth($classes) {
        global $_wp_nav_menu_max_depth;
@@ -431,23 +470,57 @@ add_filter('admin_body_class', 'wp_nav_menu_max_depth');
 wp_nav_menu_setup();
 wp_initial_nav_menu_meta_boxes();
 
-if ( ! current_theme_supports( 'menus' ) && ! wp_get_nav_menus() )
-       $messages[] = '<div id="message" class="updated"><p>' . __('The current theme does not natively support menus, but you can use the &#8220;Custom Menu&#8221; widget to add any menus you create here to the theme&#8217;s sidebar.') . '</p></div>';
-
-get_current_screen()->add_help_tab( array(
-'id'           => 'overview',
-'title'                => __('Overview'),
-'content'      =>
-       '<p>' . __('This feature allows you to use a custom menu in place of your theme&#8217;s default menus.') . '</p>' .
-       '<p>' . __('Custom menus may contain links to pages, categories, custom links or other content types (use the Screen Options tab to decide which ones to show on the screen). You can specify a different navigation label for a menu item as well as other attributes. You can create multiple menus. If your theme includes more than one menu location, you can choose which custom menu to associate with each. You can also use custom menus in conjunction with the Custom Menus widget.') . '</p>' .
-       '<p>' . sprintf( __('If your theme does not support the custom menus feature (the default themes, %1$s and %2$s, do), you can learn about adding this support by following the Documentation link to the side.'), 'Twenty Twelve', 'Twenty Eleven' ) . '</p>'
-) );
-get_current_screen()->add_help_tab( array(
-'id'           => 'create-menus',
-'title'                => __('Create Menus'),
-'content'      =>
-       '<p>' . __('To create a new custom menu, click on the + tab, give the menu a name, and click Create Menu. Next, add menu items from the appropriate boxes. You&#8217;ll be able to edit the information for each menu item, and can drag and drop to change their order. You can also drag a menu item a little to the right to make it a submenu. Don&#8217;t forget to click Save Menu when you&#8217;re finished.') . '</p>'
-) );
+if ( ! current_theme_supports( 'menus' ) && ! $num_locations )
+       $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( 'Your theme does not natively support menus, but you can use them in sidebars by adding a &#8220;Custom Menus&#8221; widget on the <a href="%s">Widgets</a> screen.' ), admin_url( 'widgets.php' ) ) . '</p></div>';
+
+if ( ! $locations_screen ) : // Main tab
+       $overview  = '<p>' . __( 'This screen is used for managing your custom navigation menus.' ) . '</p>';
+       $overview .= '<p>' . sprintf( __( 'Menus can be displayed in locations defined by your theme, even used in sidebars by adding a &#8220;Custom Menus&#8221; widget on the <a href="%1$s">Widgets</a> screen. If your theme does not support the custom menus feature (the default themes, %2$s and %3$s, do), you can learn about adding this support by following the Documentation link to the side.' ), admin_url( 'widgets.php' ), 'Twenty Thirteen', 'Twenty Twelve' ) . '</p>';
+       $overview .= '<p>' . __( 'From this screen you can:' ) . '</p>';
+       $overview .= '<ul><li>' . __( 'Create, edit, and delete menus' ) . '</li>';
+       $overview .= '<li>' . __( 'Add, organize, and modify individual menu items' ) . '</li></ul>';
+
+       get_current_screen()->add_help_tab( array(
+               'id'      => 'overview',
+               'title'   => __( 'Overview' ),
+               'content' => $overview
+       ) );
+
+       $menu_management  = '<p>' . __( 'The menu management box at the top of the screen is used to control which menu is opened in the editor below.' ) . '</p>';
+       $menu_management .= '<ul><li>' . __( 'To edit an existing menu, <strong>choose a menu from the drop down and click Select</strong>' ) . '</li>';
+       $menu_management .= '<li>' . __( 'If you haven&#8217;t yet created any menus, <strong>click the &#8217;create a new menu&#8217; link</strong> to get started' ) . '</li></ul>';
+       $menu_management .= '<p>' . __( 'You can assign theme locations to individual menus by <strong>selecting the desired settings</strong> at the bottom of the menu editor. To assign menus to all theme locations at once, <strong>visit the Manage Locations tab</strong> at the top of the screen.' ) . '</p>';
+
+       get_current_screen()->add_help_tab( array(
+               'id'      => 'menu-management',
+               'title'   => __( 'Menu Management' ),
+               'content' => $menu_management
+       ) );
+
+       $editing_menus  = '<p>' . __( 'Each custom menu may contain a mix of links to pages, categories, custom URLs or other content types. Menu links are added by selecting items from the expanding boxes in the left-hand column below.' ) . '</p>';
+       $editing_menus .= '<p>' . __( '<strong>Clicking the title of any menu item</strong> in the editor will reveal a standard group of settings. Additional settings such as link target, CSS classes, link relationships, and link descriptions can be enabled and disabled via the Screen Options tab.' ) . '</p>';
+       $editing_menus .= '<ul><li>' . __( 'Add one or several items at once by <strong>selecting the checkbox next to each item and clicking Add to Menu</strong>' ) . '</li>';
+       $editing_menus .= '<li>' . __( 'To add a custom link, <strong>expand the Links section, enter a URL and link text, and click Add to Menu</strong>' ) .'</li>';
+       $editing_menus .= '<li>' . __( 'To reorganize menu items, <strong>drag and drop items with your mouse or use your keyboard</strong>. Drag or move a menu item a little to the right to make it a submenu' ) . '</li>';
+       $editing_menus .= '<li>' . __( 'Delete a menu item by <strong>expanding it and clicking the Remove link</strong>' ) . '</li></ul>';
+
+       get_current_screen()->add_help_tab( array(
+               'id'      => 'editing-menus',
+               'title'   => __( 'Editing Menus' ),
+               'content' => $editing_menus
+       ) );
+else : // Locations Tab
+       $locations_overview  = '<p>' . __( 'This screen is used for globally assigning menus to locations defined by your theme.' ) . '</p>';
+       $locations_overview .= '<ul><li>' . __( 'To assign menus to one or more theme locations, <strong>select a menu from each location&#8217;s drop down.</strong> When you&#8217;re finished, <strong>click Save Changes</strong>' ) . '</li>';
+       $locations_overview .= '<li>' . __( 'To edit a menu currently assigned to a theme location, <strong>click the adjacent &#8217;Edit&#8217; link</strong>' ) . '</li>';
+       $locations_overview .= '<li>' . __( 'To add a new menu instead of assigning an existing one, <strong>click the &#8217;Use new menu&#8217; link</strong>. Your new menu will be automatically assigned to that theme location' ) . '</li></ul>';
+
+       get_current_screen()->add_help_tab( array(
+               'id'      => 'locations-overview',
+               'title'   => __( 'Overview' ),
+               'content' => $locations_overview
+       ) );
+endif;
 
 get_current_screen()->set_help_sidebar(
        '<p><strong>' . __('For more information:') . '</strong></p>' .
@@ -460,148 +533,232 @@ require_once( './admin-header.php' );
 ?>
 <div class="wrap">
        <?php screen_icon(); ?>
-       <h2><?php esc_html_e('Menus'); ?></h2>
+       <h2 class="nav-tab-wrapper">
+               <a href="<?php echo admin_url( 'nav-menus.php' ); ?>" class="nav-tab<?php if ( ! isset( $_GET['action'] ) || isset( $_GET['action'] ) && 'locations' != $_GET['action'] ) echo ' nav-tab-active'; ?>"><?php esc_html_e( 'Edit Menus' ); ?></a>
+               <?php if ( $num_locations && $menu_count ) : ?>
+                       <a href="<?php echo esc_url( add_query_arg( array( 'action' => 'locations' ), admin_url( 'nav-menus.php' ) ) ); ?>" class="nav-tab<?php if ( $locations_screen ) echo ' nav-tab-active'; ?>"><?php esc_html_e( 'Manage Locations' ); ?></a>
+               <?php endif; ?>
+       </h2>
        <?php
        foreach( $messages as $message ) :
                echo $message . "\n";
        endforeach;
        ?>
+       <?php
+       if ( $locations_screen ) :
+               echo '<p>' . sprintf( _n( 'Your theme supports %s menu. Select which menu you would like to use below.', 'Your theme supports %s menus. Select a menu to use for each theme location below.', $num_locations ), number_format_i18n( $num_locations ) ) . '</p>';
+       ?>
+       <div id="menu-locations-wrap">
+               <form method="post" action="<?php echo esc_url( add_query_arg( array( 'action' => 'locations' ), admin_url( 'nav-menus.php' ) ) ); ?>">
+                       <table class="widefat fixed" cellspacing="0" id="menu-locations-table">
+                               <thead>
+                               <tr>
+                                       <th scope="col" class="manage-column column-locations"><?php _e( 'Theme Location' ); ?></th>
+                                       <th scope="col" class="manage-column column-menus"><?php _e( 'Assigned Menu' ); ?></th>
+                               </tr>
+                               </thead>
+                               <!--<tfoot>
+                               <tr>
+                                       <th scope="col" class="manage-column column-locations"><?php _e( 'Theme Location' ); ?></th>
+                                       <th scope="col" class="manage-column column-menus"><?php _e( 'Assigned Menu' ); ?></th>
+                               </tr>
+                               </tfoot>-->
+                               <tbody class="menu-locations">
+                               <?php foreach ( $locations as $_location => $_name ) { ?>
+                                       <tr id="menu-locations-row">
+                                               <td class="menu-location-title"><strong><?php echo $_name; ?></strong></td>
+                                               <td class="menu-location-menus">
+                                                       <select name="menu-locations[<?php echo $_location; ?>]" id="locations-<?php echo $_location; ?>">
+                                                               <option value="0"><?php printf( '&mdash; %s &mdash;', esc_html__( 'Select a Menu' ) ); ?></option>
+                                                               <?php foreach ( $nav_menus as $menu ) : ?>
+                                                                       <?php $selected = isset( $menu_locations[$_location] ) && $menu_locations[$_location] == $menu->term_id; ?>
+                                                                       <option <?php if ( $selected ) echo 'data-orig="true"'; ?> <?php selected( $selected ); ?> value="<?php echo $menu->term_id; ?>">
+                                                                               <?php echo wp_html_excerpt( $menu->name, 40, '&hellip;' ); ?>
+                                                                       </option>
+                                                               <?php endforeach; ?>
+                                                       </select>
+                                                       <div class="locations-row-links">
+                                                               <?php if ( isset( $menu_locations[ $_location ] ) && 0 != $menu_locations[ $_location ] ) : ?>
+                                                               <span class="locations-edit-menu-link">
+                                                                       <a href="<?php echo esc_url( add_query_arg( array( 'action' => 'edit', 'menu' => $menu_locations[$_location] ), admin_url( 'nav-menus.php' ) ) ); ?>">
+                                                                               <?php _ex( 'Edit', 'menu' ); ?>
+                                                                       </a>
+                                                               </span>
+                                                               <?php endif; ?>
+                                                               <span class="locations-add-menu-link">
+                                                                       <a href="<?php echo esc_url( add_query_arg( array( 'action' => 'edit', 'menu' => 0, 'use-location' => $_location ), admin_url( 'nav-menus.php' ) ) ); ?>">
+                                                                               <?php _ex( 'Use new menu', 'menu' ); ?>
+                                                                       </a>
+                                                               </span>
+                                                       </div><!-- #locations-row-links -->
+                                               </td><!-- .menu-location-menus -->
+                                       </tr><!-- #menu-locations-row -->
+                               <?php } // foreach ?>
+                               </tbody>
+                       </table>
+                       <p class="button-controls"><?php submit_button( __( 'Save Changes' ), 'primary left', 'nav-menu-locations', false ); ?></p>
+                       <?php wp_nonce_field( 'save-menu-locations' ); ?>
+                       <input type="hidden" name="menu" id="nav-menu-meta-object-id" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
+               </form>
+       </div><!-- #menu-locations-wrap -->
+       <?php do_action( 'after_menu_locations_table' ); ?>
+       <?php else : ?>
+       <div class="manage-menus">
+               <?php if ( $menu_count < 2 ) : ?>
+               <span class="add-edit-menu-action">
+                       <?php printf( __( 'Edit your menu below, or <a href="%s">create a new menu</a>.' ), esc_url( add_query_arg( array( 'action' => 'edit', 'menu' => 0 ), admin_url( 'nav-menus.php' ) ) ) ); ?>
+               </span><!-- /add-edit-menu-action -->
+               <?php else : ?>
+                       <form method="get" action="<?php echo admin_url( 'nav-menus.php' ); ?>">
+                       <input type="hidden" name="action" value="edit" />
+                       <label for="menu" class="selected-menu"><?php _e( 'Select a menu to edit:' ); ?></label>
+                       <select name="menu" id="menu">
+                               <?php if ( $add_new_screen ) : ?>
+                                       <option value="0" selected="selected"><?php _e( '-- Select --' ); ?></option>
+                               <?php endif; ?>
+                               <?php foreach( (array) $nav_menus as $_nav_menu ) : ?>
+                                       <option value="<?php echo esc_attr( $_nav_menu->term_id ); ?>" <?php selected( $_nav_menu->term_id, $nav_menu_selected_id ); ?>>
+                                               <?php
+                                               echo esc_html( $_nav_menu->truncated_name ) ;
+
+                                               if ( ! empty( $menu_locations ) && in_array( $_nav_menu->term_id, $menu_locations ) ) {
+                                                       $locations_assigned_to_this_menu = array();
+                                                       foreach ( array_keys( $menu_locations, $_nav_menu->term_id ) as $menu_location_key ) {
+                                                                $locations_assigned_to_this_menu[] = $locations[ $menu_location_key ];
+                                                       }
+                                                       $assigned_locations = array_slice( $locations_assigned_to_this_menu, 0, absint( apply_filters( 'wp_nav_locations_listed_per_menu', 3 ) ) );
+
+                                                       // Adds ellipses following the number of locations defined in $assigned_locations
+                                                       printf( ' (%1$s%2$s)',
+                                                               implode( ', ', $assigned_locations ),
+                                                               count( $locations_assigned_to_this_menu ) > count( $assigned_locations ) ? ' &hellip;' : ''
+                                                       );
+                                               }
+                                               ?>
+                                       </option>
+                               <?php endforeach; ?>
+                       </select>
+                       <span class="submit-btn"><input type="submit" class="button-secondary" value="<?php _e( 'Select' ); ?>"></span>
+                       <span class="add-new-menu-action">
+                               <?php printf( __( 'or <a href="%s">create a new menu</a>.' ), esc_url( add_query_arg( array( 'action' => 'edit', 'menu' => 0 ), admin_url( 'nav-menus.php' ) ) ) ); ?>
+                       </span><!-- /add-new-menu-action -->
+               </form>
+       <?php endif; ?>
+       </div><!-- /manage-menus -->
        <div id="nav-menus-frame">
-       <div id="menu-settings-column" class="metabox-holder<?php if ( !$nav_menu_selected_id ) { echo ' metabox-holder-disabled'; } ?>">
+       <div id="menu-settings-column" class="metabox-holder<?php if ( isset( $_GET['menu'] ) && '0' == $_GET['menu'] ) { echo ' metabox-holder-disabled'; } ?>">
 
-               <form id="nav-menu-meta" action="<?php echo admin_url( 'nav-menus.php' ); ?>" class="nav-menu-meta" method="post" enctype="multipart/form-data">
+               <div class="clear"></div>
+
+               <form id="nav-menu-meta" action="" class="nav-menu-meta" method="post" enctype="multipart/form-data">
                        <input type="hidden" name="menu" id="nav-menu-meta-object-id" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
                        <input type="hidden" name="action" value="add-menu-item" />
                        <?php wp_nonce_field( 'add-menu_item', 'menu-settings-column-nonce' ); ?>
-                       <?php do_meta_boxes( 'nav-menus', 'side', null ); ?>
+                       <?php do_accordion_sections( 'nav-menus', 'side', null ); ?>
                </form>
 
        </div><!-- /#menu-settings-column -->
        <div id="menu-management-liquid">
                <div id="menu-management">
-                       <div id="select-nav-menu-container" class="hide-if-js">
-                               <form id="select-nav-menu" action="">
-                                       <strong><label for="select-nav-menu"><?php esc_html_e( 'Select Menu:' ); ?></label></strong>
-                                       <select class="select-nav-menu" name="menu">
-                                               <?php foreach( (array) $nav_menus as $_nav_menu ) : ?>
-                                                       <option value="<?php echo esc_attr($_nav_menu->term_id) ?>" <?php selected($nav_menu_selected_id, $_nav_menu->term_id); ?>>
-                                                               <?php echo esc_html( $_nav_menu->truncated_name ); ?>
-                                                       </option>
-                                               <?php endforeach; ?>
-                                               <option value="0"><?php esc_html_e('Add New Menu'); ?></option>
-                                       </select>
-                                       <input type="hidden" name="action" value="edit" />
-                                       <?php submit_button( __( 'Select' ), 'secondary', 'select_menu', false ); ?>
-                               </form>
-                       </div>
-                       <div class="nav-tabs-wrapper">
-                       <div class="nav-tabs">
-                               <?php
-                               foreach( (array) $nav_menus as $_nav_menu ) :
-                                       if ( $nav_menu_selected_id == $_nav_menu->term_id ) : ?><span class="nav-tab nav-tab-active">
-                                                       <?php echo esc_html( $_nav_menu->truncated_name ); ?>
-                                               </span><?php else : ?><a href="<?php
-                                                       echo esc_url(add_query_arg(
-                                                               array(
-                                                                       'action' => 'edit',
-                                                                       'menu' => $_nav_menu->term_id,
-                                                               ),
-                                                               admin_url( 'nav-menus.php' )
-                                                       ));
-                                               ?>" class="nav-tab hide-if-no-js">
-                                                       <?php echo esc_html( $_nav_menu->truncated_name ); ?>
-                                               </a><?php endif;
-                               endforeach;
-                               if ( 0 == $nav_menu_selected_id ) : ?><span class="nav-tab menu-add-new nav-tab-active">
-                                       <?php printf( '<abbr title="%s">+</abbr>', esc_html__( 'Add menu' ) ); ?>
-                               </span><?php else : ?><a href="<?php
-                                       echo esc_url(add_query_arg(
-                                               array(
-                                                       'action' => 'edit',
-                                                       'menu' => 0,
-                                               ),
-                                               admin_url( 'nav-menus.php' )
-                                       ));
-                               ?>" class="nav-tab menu-add-new">
-                                       <?php printf( '<abbr title="%s">+</abbr>', esc_html__( 'Add menu' ) ); ?>
-                               </a><?php endif; ?>
-                       </div>
-                       </div>
-                       <div class="menu-edit">
-                               <form id="update-nav-menu" action="<?php echo admin_url( 'nav-menus.php' ); ?>" method="post" enctype="multipart/form-data">
+                       <form id="update-nav-menu" action="" method="post" enctype="multipart/form-data">
+                               <div class="menu-edit <?php if ( $add_new_screen ) echo 'blank-slate'; ?>">
+                                       <?php
+                                       wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
+                                       wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
+                                       wp_nonce_field( 'update-nav_menu', 'update-nav-menu-nonce' );
+
+                                       if ( $one_theme_location_no_menus ) { ?>
+                                               <input type="hidden" name="zero-menu-state" value="true" />
+                                       <?php } ?>
+                                       <input type="hidden" name="action" value="update" />
+                                       <input type="hidden" name="menu" id="menu" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
                                        <div id="nav-menu-header">
-                                               <div id="submitpost" class="submitbox">
-                                                       <div class="major-publishing-actions">
-                                                               <label class="menu-name-label howto open-label" for="menu-name">
-                                                                       <span><?php _e('Menu Name'); ?></span>
-                                                                       <input name="menu-name" id="menu-name" type="text" class="menu-name regular-text menu-item-textbox input-with-default-title" title="<?php esc_attr_e('Enter menu name here'); ?>" value="<?php echo esc_attr( $nav_menu_selected_title ); ?>" />
-                                                               </label>
-                                                               <?php if ( !empty( $nav_menu_selected_id ) ) :
-                                                                       if ( ! isset( $auto_add ) ) {
-                                                                               $auto_add = get_option( 'nav_menu_options' );
-                                                                               if ( ! isset( $auto_add['auto_add'] ) )
-                                                                                       $auto_add = false;
-                                                                               elseif ( false !== array_search( $nav_menu_selected_id, $auto_add['auto_add'] ) )
-                                                                                       $auto_add = true;
-                                                                               else
-                                                                                       $auto_add = false;
-                                                                       }
-                                                               ?>
-                                                               <div class="auto-add-pages">
-                                                                       <label class="howto"><input type="checkbox"<?php checked( $auto_add ); ?> name="auto-add-pages" value="1" /> <?php printf( __('Automatically add new top-level pages' ), esc_url( admin_url( 'edit.php?post_type=page' ) ) ); ?></label>
-                                                               </div>
-                                                               <?php endif; ?>
-                                                               <br class="clear" />
-                                                               <div class="publishing-action">
-                                                                       <?php submit_button( empty( $nav_menu_selected_id ) ? __( 'Create Menu' ) : __( 'Save Menu' ), 'button-primary menu-save', 'save_menu', false, array( 'id' => 'save_menu_header' ) ); ?>
-                                                               </div><!-- END .publishing-action -->
-
-                                                               <?php if ( ! empty( $nav_menu_selected_id ) ) : ?>
-                                                               <div class="delete-action">
-                                                                       <a class="submitdelete deletion menu-delete" href="<?php echo esc_url( wp_nonce_url( admin_url('nav-menus.php?action=delete&amp;menu=' . $nav_menu_selected_id), 'delete-nav_menu-' . $nav_menu_selected_id ) ); ?>"><?php _e('Delete Menu'); ?></a>
-                                                               </div><!-- END .delete-action -->
-                                                               <?php endif; ?>
-                                                       </div><!-- END .major-publishing-actions -->
-                                               </div><!-- END #submitpost .submitbox -->
-                                               <?php
-                                               wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
-                                               wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
-                                               wp_nonce_field( 'update-nav_menu', 'update-nav-menu-nonce' );
-                                               ?>
-                                               <input type="hidden" name="action" value="update" />
-                                               <input type="hidden" name="menu" id="menu" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
-                                       </div><!-- END #nav-menu-header -->
+                                               <div class="major-publishing-actions">
+                                                       <label class="menu-name-label howto open-label" for="menu-name">
+                                                               <span><?php _e( 'Menu Name' ); ?></span>
+                                                               <input name="menu-name" id="menu-name" type="text" class="menu-name regular-text menu-item-textbox input-with-default-title" title="<?php esc_attr_e( 'Enter menu name here' ); ?>" value="<?php if ( $one_theme_location_no_menus ) _e( 'Menu 1' ); else echo esc_attr( $nav_menu_selected_title ); ?>" />
+                                                       </label>
+                                                       <div class="publishing-action">
+                                                               <?php submit_button( empty( $nav_menu_selected_id ) ? __( 'Create Menu' ) : __( 'Save Menu' ), 'button-primary menu-save', 'save_menu', false, array( 'id' => 'save_menu_header' ) ); ?>
+                                                       </div><!-- END .publishing-action -->
+                                               </div><!-- END .major-publishing-actions -->
+                                       </div><!-- END .nav-menu-header -->
                                        <div id="post-body">
                                                <div id="post-body-content">
+                                                       <?php if ( ! $add_new_screen ) : ?>
+                                                       <h3><?php _e( 'Menu Structure' ); ?></h3>
+                                                       <?php $starter_copy = ( $one_theme_location_no_menus ) ? __( 'Edit your default menu by adding or removing items. Drag each item into the order you prefer. Click Create Menu to save your changes.' ) : __( 'Drag each item into the order you prefer. Click the arrow on the right of the item to reveal additional configuration options.' ); ?>
+                                                       <div class="drag-instructions post-body-plain" <?php if ( isset( $menu_items ) && 0 == count( $menu_items ) ) { ?>style="display: none;"<?php } ?>>
+                                                               <p><?php echo $starter_copy; ?></p>
+                                                       </div>
                                                        <?php
-                                                       if ( isset( $edit_markup ) ) {
-                                                               if ( ! is_wp_error( $edit_markup ) )
-                                                                       echo $edit_markup;
-                                                       } else if ( empty( $nav_menu_selected_id ) ) {
-                                                               echo '<div class="post-body-plain">';
-                                                               echo '<p>' . __('To create a custom menu, give it a name above and click Create Menu. Then choose items like pages, categories or custom links from the left column to add to this menu.') . '</p>';
-                                                               echo '<p>' . __('After you have added your items, drag and drop to put them in the order you want. You can also click each item to reveal additional configuration options.') . '</p>';
-                                                               echo '<p>' . __('When you have finished building your custom menu, make sure you click the Save Menu button.') . '</p>';
-                                                               echo '</div>';
-                                                       }
+                                                       if ( isset( $edit_markup ) && ! is_wp_error( $edit_markup ) ) {
+                                                               echo $edit_markup;
+                                                       } else {
                                                        ?>
+                                                       <ul class="menu" id="menu-to-edit"></ul>
+                                                       <?php } ?>
+                                                       <?php endif; ?>
+                                                       <?php if ( $add_new_screen ) : ?>
+                                                               <p class="post-body-plain"><?php _e( 'Give your menu a name above, then click Create Menu.' ); ?></p>
+                                                               <?php if ( isset( $_GET['use-location'] ) ) : ?>
+                                                                       <input type="hidden" name="use-location" value="<?php echo esc_attr( $_GET['use-location'] ); ?>" />
+                                                               <?php endif; ?>
+                                                       <?php endif; ?>
+                                                       <div class="menu-settings" <?php if ( $one_theme_location_no_menus ) { ?>style="display: none;"<?php } ?>>
+                                                               <h3><?php _e( 'Menu Settings' ); ?></h3>
+                                                               <?php
+                                                               if ( ! isset( $auto_add ) ) {
+                                                                       $auto_add = get_option( 'nav_menu_options' );
+                                                                       if ( ! isset( $auto_add['auto_add'] ) )
+                                                                               $auto_add = false;
+                                                                       elseif ( false !== array_search( $nav_menu_selected_id, $auto_add['auto_add'] ) )
+                                                                               $auto_add = true;
+                                                                       else
+                                                                               $auto_add = false;
+                                                               } ?>
+
+                                                               <dl class="auto-add-pages">
+                                                                       <dt class="howto"><?php _e( 'Auto add pages' ); ?></dt>
+                                                                       <dd class="checkbox-input"><input type="checkbox"<?php checked( $auto_add ); ?> name="auto-add-pages" id="auto-add-pages" value="1" /> <label for="auto-add-pages"><?php printf( __('Automatically add new top-level pages to this menu' ), esc_url( admin_url( 'edit.php?post_type=page' ) ) ); ?></label></dd>
+                                                               </dl>
+
+                                                               <?php if ( current_theme_supports( 'menus' ) ) : ?>
+
+                                                                       <dl class="menu-theme-locations">
+                                                                               <dt class="howto"><?php _e( 'Theme locations' ); ?></dt>
+                                                                               <?php foreach ( $locations as $location => $description ) : ?>
+                                                                               <dd class="checkbox-input">
+                                                                                       <input type="checkbox"<?php checked( isset( $menu_locations[ $location ] ) && $menu_locations[ $location ] == $nav_menu_selected_id ); ?> name="menu-locations[<?php echo esc_attr( $location ); ?>]" id="locations-<?php echo esc_attr( $location ); ?>" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" /> <label for="locations-<?php echo esc_attr( $location ); ?>"><?php echo $description; ?></label>
+                                                                                       <?php if ( ! empty( $menu_locations[ $location ] ) && $menu_locations[ $location ] != $nav_menu_selected_id ) : ?>
+                                                                                       <span class="theme-location-set"> <?php printf( __( "(Currently set to: %s)" ), wp_get_nav_menu_object( $menu_locations[ $location ] )->name ); ?> </span>
+                                                                                       <?php endif; ?>
+                                                                               </dd>
+                                                                               <?php endforeach; ?>
+                                                                       </dl>
+
+                                                               <?php endif; ?>
+
+                                                       </div>
                                                </div><!-- /#post-body-content -->
                                        </div><!-- /#post-body -->
                                        <div id="nav-menu-footer">
                                                <div class="major-publishing-actions">
-                                               <div class="publishing-action">
-                                                       <?php
-                                                       if ( ! empty( $nav_menu_selected_id ) )
-                                                               submit_button( __( 'Save Menu' ), 'button-primary menu-save', 'save_menu', false, array( 'id' => 'save_menu_footer' ) );
-                                                       ?>
-                                               </div>
-                                               </div>
+                                                       <?php if ( 0 != $menu_count && ! $add_new_screen ) : ?>
+                                                       <span class="delete-action">
+                                                               <a class="submitdelete deletion menu-delete" href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 'action' => 'delete', 'menu' => $nav_menu_selected_id, admin_url() ) ), 'delete-nav_menu-' . $nav_menu_selected_id) ); ?>"><?php _e('Delete Menu'); ?></a>
+                                                       </span><!-- END .delete-action -->
+                                                       <?php endif; ?>
+                                                       <div class="publishing-action">
+                                                               <?php submit_button( empty( $nav_menu_selected_id ) ? __( 'Create Menu' ) : __( 'Save Menu' ), 'button-primary menu-save', 'save_menu', false, array( 'id' => 'save_menu_header' ) ); ?>
+                                                       </div><!-- END .publishing-action -->
+                                               </div><!-- END .major-publishing-actions -->
                                        </div><!-- /#nav-menu-footer -->
-                               </form><!-- /#update-nav-menu -->
-                       </div><!-- /.menu-edit -->
+                               </div><!-- /.menu-edit -->
+                       </form><!-- /#update-nav-menu -->
                </div><!-- /#menu-management -->
        </div><!-- /#menu-management-liquid -->
        </div><!-- /#nav-menus-frame -->
+       <?php endif; ?>
 </div><!-- /.wrap-->
-
 <?php include( './admin-footer.php' ); ?>
index d5549145ce25603d97af5a2e44218ed6efd29653..c3dea684714304bc22520020f4f3621ab666b3d3 100644 (file)
@@ -314,7 +314,7 @@ function network_step2( $errors = false ) {
        $base              = parse_url( $slashed_home, PHP_URL_PATH );
        $document_root_fix = str_replace( '\\', '/', realpath( $_SERVER['DOCUMENT_ROOT'] ) );
        $abspath_fix       = str_replace( '\\', '/', ABSPATH );
-       $home_path         = 0 === strpos( $abspath_fix, $document_root_fix ) ? $document_root_fix . $base : str_replace( '\\', '/', get_home_path() );
+       $home_path         = 0 === strpos( $abspath_fix, $document_root_fix ) ? $document_root_fix . $base : get_home_path();
        $wp_siteurl_subdir = preg_replace( '#^' . preg_quote( $home_path, '#' ) . '#', '', $abspath_fix );
        $rewrite_base      = ! empty( $wp_siteurl_subdir ) ? ltrim( trailingslashit( $wp_siteurl_subdir ), '/' ) : '';
 
@@ -374,8 +374,7 @@ define('SUBDOMAIN_INSTALL', <?php echo $subdomain_install ? 'true' : 'false'; ?>
 define('DOMAIN_CURRENT_SITE', '<?php echo $hostname; ?>');
 define('PATH_CURRENT_SITE', '<?php echo $base; ?>');
 define('SITE_ID_CURRENT_SITE', 1);
-define('BLOG_ID_CURRENT_SITE', 1);
-</textarea>
+define('BLOG_ID_CURRENT_SITE', 1);</textarea>
 <?php
        $keys_salts = array( 'AUTH_KEY' => '', 'SECURE_AUTH_KEY' => '', 'LOGGED_IN_KEY' => '', 'NONCE_KEY' => '', 'AUTH_SALT' => '', 'SECURE_AUTH_SALT' => '', 'LOGGED_IN_SALT' => '', 'NONCE_SALT' => '' );
        foreach ( $keys_salts as $c => $v ) {
@@ -520,7 +519,7 @@ if ( $_POST ) {
        $base              = parse_url( trailingslashit( get_option( 'home' ) ), PHP_URL_PATH );
        $subdomain_install = allow_subdomain_install() ? !empty( $_POST['subdomain_install'] ) : false;
        if ( ! network_domain_check() ) {
-               $result = populate_network( 1, get_clean_basedomain(), sanitize_email( $_POST['email'] ), stripslashes( $_POST['sitename'] ), $base, $subdomain_install );
+               $result = populate_network( 1, get_clean_basedomain(), sanitize_email( $_POST['email'] ), wp_unslash( $_POST['sitename'] ), $base, $subdomain_install );
                if ( is_wp_error( $result ) ) {
                        if ( 1 == count( $result->get_error_codes() ) && 'no_wildcard_dns' == $result->get_error_code() )
                                network_step2( $result );
index d2875f3e83fa3d71c4dd82dd8d2d3a3517a67ea6..96c2c248a641160c65c80244c975de98dc2c7183 100644 (file)
@@ -22,14 +22,30 @@ if ( ! current_user_can( 'manage_network' ) )
 $title = __( 'Dashboard' );
 $parent_file = 'index.php';
 
-       get_current_screen()->add_help_tab( array(
-               'id'      => 'overview',
-               'title'   => __('Overview'),
-               'content' =>
-                       '<p>' . __('Until WordPress 3.0, running multiple sites required using WordPress MU instead of regular WordPress. In version 3.0, these applications have merged. If you are a former MU user, you should be aware of the following changes:') . '</p>' .
-                       '<ul><li>' . __('Site Admin is now Super Admin (we highly encourage you to get yourself a cape!).') . '</li>' .
-                       '<li>' . __('Blogs are now called Sites; Site is now called Network.') . '</li></ul>' .
-                       '<p>' . __('The Right Now box provides the network administrator with links to the screens to either create a new site or user, or to search existing users and sites. Screens for Sites and Users are also accessible through the left-hand navigation in the Network Admin section.') . '</p>'
+$overview = '<p>' . __( 'Welcome to your Network Admin. This area of the Administration Screens is used for managing all aspects of your Multisite Network.' ) . '</p>';
+$overview .= '<p>' . __( 'From here you can:' ) . '</p>';
+$overview .= '<ul><li>' . __( 'Add and manage sites or users' ) . '</li>';
+$overview .= '<li>' . __( 'Install and activate themes or plugins' ) . '</li>';
+$overview .= '<li>' . __( 'Update your network' ) . '</li>';
+$overview .= '<li>' . __( 'Modify global network settings' ) . '</li></ul>';
+
+get_current_screen()->add_help_tab( array(
+       'id'      => 'overview',
+       'title'   => __( 'Overview' ),
+       'content' => $overview
+) );
+
+$quick_tasks = '<p>' . __( 'The Right Now widget on this screen provides current user and site counts on your network.' ) . '</p>';
+$quick_tasks .= '<ul><li>' . __( 'To add a new user <strong>click Create a New User</strong>' ) . '</li>';
+$quick_tasks .= '<li>' . __( 'To add a new site <strong>click Create a New Site</strong>' ) . '</li></ul>';
+$quick_tasks .= '<p>' . __( 'To search for a user or site, use the search boxes.' ) . '</p>';
+$quick_tasks .= '<ul><li>' . __( '<strong>To search for a user</strong> enter all or part of a username or email address' ) . '</li>';
+$quick_tasks .= '<li>' . __( '<strong>To search for a site</strong> enter the path or domain' ) . '</li></ul>';
+
+get_current_screen()->add_help_tab( array(
+       'id'      => 'quick-tasks',
+       'title'   => __( 'Quick Tasks' ),
+       'content' => $quick_tasks
 ) );
 
 get_current_screen()->set_help_sidebar(
index 68cf7e494c20b8beaf5836976c86c62d22b17cbf..31d9b7204ca4d783c2e0f794e1aeb386b5e08db5 100644 (file)
@@ -56,7 +56,7 @@ if ( $update_data['counts']['total'] ) {
 unset($update_data);
 
 $submenu[ 'upgrade.php' ][10] = array( __( 'Available Updates' ), 'update_core', 'update-core.php' );
-$submenu[ 'upgrade.php' ][15] = array( __( 'Update Network' ), 'manage_network', 'upgrade.php' );
+$submenu[ 'upgrade.php' ][15] = array( __( 'Upgrade Network' ), 'manage_network', 'upgrade.php' );
 
 $menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator-last' );
 
index b3a0f897f4d1579df039cba2e5b076de7b0120c3..e7456940316e365963393f0c09450d81ddc00d4b 100644 (file)
@@ -61,7 +61,7 @@ if ( $_POST ) {
        foreach ( $options as $option_name ) {
                if ( ! isset($_POST[$option_name]) )
                        continue;
-               $value = stripslashes_deep( $_POST[$option_name] );
+               $value = wp_unslash( $_POST[$option_name] );
                update_site_option( $option_name, $value );
        }
 
@@ -181,7 +181,7 @@ if ( isset( $_GET['updated'] ) ) {
                                <th scope="row"><label for="welcome_email"><?php _e( 'Welcome Email' ) ?></label></th>
                                <td>
                                        <textarea name="welcome_email" id="welcome_email" rows="5" cols="45" class="large-text">
-<?php echo esc_textarea( stripslashes( get_site_option( 'welcome_email' ) ) ) ?></textarea>
+<?php echo esc_textarea( get_site_option( 'welcome_email' ) ) ?></textarea>
                                        <br />
                                        <?php _e( 'The welcome email sent to new site owners.' ) ?>
                                </td>
@@ -190,7 +190,7 @@ if ( isset( $_GET['updated'] ) ) {
                                <th scope="row"><label for="welcome_user_email"><?php _e( 'Welcome User Email' ) ?></label></th>
                                <td>
                                        <textarea name="welcome_user_email" id="welcome_user_email" rows="5" cols="45" class="large-text">
-<?php echo esc_textarea( stripslashes( get_site_option( 'welcome_user_email' ) ) ) ?></textarea>
+<?php echo esc_textarea( get_site_option( 'welcome_user_email' ) ) ?></textarea>
                                        <br />
                                        <?php _e( 'The welcome email sent to new users.' ) ?>
                                </td>
@@ -199,7 +199,7 @@ if ( isset( $_GET['updated'] ) ) {
                                <th scope="row"><label for="first_post"><?php _e( 'First Post' ) ?></label></th>
                                <td>
                                        <textarea name="first_post" id="first_post" rows="5" cols="45" class="large-text">
-<?php echo esc_textarea( stripslashes( get_site_option( 'first_post' ) ) ) ?></textarea>
+<?php echo esc_textarea( get_site_option( 'first_post' ) ) ?></textarea>
                                        <br />
                                        <?php _e( 'The first post on a new site.' ) ?>
                                </td>
@@ -208,7 +208,7 @@ if ( isset( $_GET['updated'] ) ) {
                                <th scope="row"><label for="first_page"><?php _e( 'First Page' ) ?></label></th>
                                <td>
                                        <textarea name="first_page" id="first_page" rows="5" cols="45" class="large-text">
-<?php echo esc_textarea( stripslashes( get_site_option('first_page') ) ) ?></textarea>
+<?php echo esc_textarea( get_site_option( 'first_page' ) ) ?></textarea>
                                        <br />
                                        <?php _e( 'The first page on a new site.' ) ?>
                                </td>
@@ -217,7 +217,7 @@ if ( isset( $_GET['updated'] ) ) {
                                <th scope="row"><label for="first_comment"><?php _e( 'First Comment' ) ?></label></th>
                                <td>
                                        <textarea name="first_comment" id="first_comment" rows="5" cols="45" class="large-text">
-<?php echo esc_textarea( stripslashes( get_site_option('first_comment') ) ) ?></textarea>
+<?php echo esc_textarea( get_site_option( 'first_comment' ) ) ?></textarea>
                                        <br />
                                        <?php _e( 'The first comment on a new site.' ) ?>
                                </td>
index bcc71f9f18057fb5e3a78cbec2426f3c14870c19..7dd6aeb23af3c461a3b59fcc8de8b5eb22e2bffd 100644 (file)
@@ -62,7 +62,7 @@ if ( isset($_REQUEST['action']) && 'update-site' == $_REQUEST['action'] ) {
        delete_option( 'rewrite_rules' );
 
        // update blogs table
-       $blog_data = stripslashes_deep( $_POST['blog'] );
+       $blog_data = wp_unslash( $_POST['blog'] );
        $existing_details = get_blog_details( $id, false );
        $blog_data_checkboxes = array( 'public', 'archived', 'spam', 'mature', 'deleted' );
        foreach ( $blog_data_checkboxes as $c ) {
index db2e1f74c081dfcaa68603861ff1f248df64c2e4..9fc5eefd48e0f8435e055e4533723d88bdada40b 100644 (file)
@@ -88,7 +88,7 @@ if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) {
                $content_mail = sprintf( __( 'New site created by %1$s
 
 Address: %2$s
-Name: %3$s' ), $current_user->user_login , get_site_url( $id ), stripslashes( $title ) );
+Name: %3$s' ), $current_user->user_login , get_site_url( $id ), wp_unslash( $title ) );
                wp_mail( get_site_option('admin_email'), sprintf( __( '[%s] New Site Created' ), $current_site->site_name ), $content_mail, 'From: "Site Admin" <' . get_site_option( 'admin_email' ) . '>' );
                wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' => 1 ) );
                wp_redirect( add_query_arg( array( 'update' => 'added', 'id' => $id ), 'site-new.php' ) );
index f807fcf2c5eea37c682cf4b14d1fb58eef2e5339..c3aec75dee6605c26ab1fcea1cf7fc300412ad11 100644 (file)
@@ -49,17 +49,13 @@ if ( isset($_REQUEST['action']) && 'update-site' == $_REQUEST['action'] && is_ar
 
        switch_to_blog( $id );
 
-       $c = 1;
-       $count = count( $_POST['option'] );
        $skip_options = array( 'allowedthemes' ); // Don't update these options since they are handled elsewhere in the form.
        foreach ( (array) $_POST['option'] as $key => $val ) {
+               $key = wp_unslash( $key );
+               $val = wp_unslash( $val );
                if ( $key === 0 || is_array( $val ) || in_array($key, $skip_options) )
                        continue; // Avoids "0 is a protected WP option and may not be modified" error when edit blog options
-               if ( $c == $count )
-                       update_option( $key, stripslashes( $val ) );
-               else
-                       update_option( $key, stripslashes( $val ), false ); // no need to refresh blog details yet
-               $c++;
+               update_option( $key, $val );
        }
 
        do_action( 'wpmu_update_blog_options' );
@@ -121,7 +117,7 @@ if ( ! empty( $messages ) ) {
                        $class = 'all-options';
                        if ( is_serialized( $option->option_value ) ) {
                                if ( is_serialized_string( $option->option_value ) ) {
-                                       $option->option_value = esc_html( maybe_unserialize( $option->option_value ), 'single' );
+                                       $option->option_value = esc_html( maybe_unserialize( $option->option_value ) );
                                } else {
                                        $option->option_value = 'SERIALIZED DATA';
                                        $disabled = true;
index 2064a763b59289a18284a37680b74bedcb51a8ee..0c7a1c7296108291b6b39952280254a7810f3248 100644 (file)
@@ -85,12 +85,10 @@ if ( $action ) {
                        if ( !empty( $_POST['newuser'] ) ) {
                                $update = 'adduser';
                                $newuser = $_POST['newuser'];
-                               $userid = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM " . $wpdb->users . " WHERE user_login = %s", $newuser ) );
-                               if ( $userid ) {
-                                       $blog_prefix = $wpdb->get_blog_prefix( $id );
-                                       $user = $wpdb->get_var( "SELECT user_id FROM " . $wpdb->usermeta . " WHERE user_id='$userid' AND meta_key='{$blog_prefix}capabilities'" );
-                                       if ( $user == false )
-                                               add_user_to_blog( $id, $userid, $_POST['new_role'] );
+                               $user = get_user_by( 'login', $newuser );
+                               if ( $user && $user->exists() ) {
+                                       if ( ! is_user_member_of_blog( $user->ID, $id ) )
+                                               add_user_to_blog( $id, $user->ID, $_POST['new_role'] );
                                        else
                                                $update = 'err_add_member';
                                } else {
index e9b314da1d8891aa0f036a48c1a3c7cf9382a182..93341c35e97eeeae6e22dc9c36711996a0ee0d41 100644 (file)
@@ -73,13 +73,13 @@ if ( isset( $_GET['action'] ) ) {
                                ?>
                        </head>
                        <body class="wp-core-ui">
-                               <h1 id="logo"><a href="<?php esc_attr_e( 'http://wordpress.org/' ); ?>"><?php _e( 'WordPress' ); ?></a></h1>
+                               <h1 id="logo"><a href="<?php echo esc_url( __( 'http://wordpress.org/' ) ); ?>"><?php _e( 'WordPress' ); ?></a></h1>
                                <form action="sites.php?action=<?php echo esc_attr( $_GET['action2'] ) ?>" method="post">
                                        <input type="hidden" name="action" value="<?php echo esc_attr( $_GET['action2'] ) ?>" />
                                        <input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
                                        <input type="hidden" name="_wp_http_referer" value="<?php echo esc_attr( wp_get_referer() ); ?>" />
                                        <?php wp_nonce_field( $_GET['action2'], '_wpnonce', false ); ?>
-                                       <p><?php echo esc_html( stripslashes( $_GET['msg'] ) ); ?></p>
+                                       <p><?php echo esc_html( wp_unslash( $_GET['msg'] ) ); ?></p>
                                        <?php submit_button( __('Confirm'), 'button' ); ?>
                                </form>
                        </body>
index 04840ee1109d585099d9663160d33254e8747e1c..711b44e0f210ab050248c4bacb34e9cf4d7c80cb 100644 (file)
@@ -220,6 +220,8 @@ get_current_screen()->set_help_sidebar(
 $title = __('Themes');
 $parent_file = 'themes.php';
 
+wp_enqueue_script( 'theme' );
+
 require_once(ABSPATH . 'wp-admin/admin-header.php');
 
 ?>
index cfbf4002ace24c56214675050b8abdbe26c58551..74156547e9e9b237acc4fb1283a2239e37dbbeb4 100644 (file)
@@ -15,21 +15,21 @@ if ( ! is_multisite() )
 
 require_once( ABSPATH . WPINC . '/http.php' );
 
-$title = __( 'Update Network' );
+$title = __( 'Upgrade Network' );
 $parent_file = 'upgrade.php';
 
 get_current_screen()->add_help_tab( array(
        'id'      => 'overview',
        'title'   => __('Overview'),
        'content' =>
-               '<p>' . __('Only use this screen once you have updated to a new version of WordPress through Updates/Available Updates (via the Network Administration navigation menu or the Toolbar). Clicking the Update Network button will step through each site in the network, five at a time, and make sure any database updates are applied.') . '</p>' .
+               '<p>' . __('Only use this screen once you have updated to a new version of WordPress through Updates/Available Updates (via the Network Administration navigation menu or the Toolbar). Clicking the Upgrade Network button will step through each site in the network, five at a time, and make sure any database updates are applied.') . '</p>' .
                '<p>' . __('If a version update to core has not happened, clicking this button won&#8217;t affect anything.') . '</p>' .
                '<p>' . __('If this process fails for any reason, users logging in to their sites will force the same update.') . '</p>'
 ) );
 
 get_current_screen()->set_help_sidebar(
        '<p><strong>' . __('For more information:') . '</strong></p>' .
-       '<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Updates_Screen" target="_blank">Documentation on Update Network</a>') . '</p>' .
+       '<p>' . __('<a href="http://codex.wordpress.org/Network_Admin_Updates_Screen" target="_blank">Documentation on Upgrade Network</a>') . '</p>' .
        '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
 );
 
@@ -40,7 +40,7 @@ if ( ! current_user_can( 'manage_network' ) )
 
 echo '<div class="wrap">';
 screen_icon('tools');
-echo '<h2>' . __( 'Update Network' ) . '</h2>';
+echo '<h2>' . __( 'Upgrade Network' ) . '</h2>';
 
 $action = isset($_GET['action']) ? $_GET['action'] : 'show';
 
@@ -84,8 +84,12 @@ switch ( $action ) {
        break;
        case 'show':
        default:
-               ?><p><?php _e( 'You can update all the sites on your network through this page. It works by calling the update script of each site automatically. Hit the link below to update.' ); ?></p>
-               <p><a class="button" href="upgrade.php?action=upgrade"><?php _e("Update Network"); ?></a></p><?php
+               ?>
+               <h3><?php _e( 'Database Upgrade Required' ); ?></h3>
+               <p><?php _e( 'WordPress has been updated! Before we send you on your way, we need to individually upgrade the sites in your network.' ); ?></p>
+               <p><?php _e( 'The upgrade process may take a little while, so please be patient.' ); ?></p>
+               <p><a class="button" href="upgrade.php?action=upgrade"><?php _e( 'Upgrade Network' ); ?></a></p>
+               <?php
                do_action( 'wpmu_upgrade_page' );
        break;
 }
index 204491451276797bd98f72a6060db02c30606839..316fffe58cbd7d6eca86b4336caf81f464fc8c04 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Add Site Administration Screen
+ * Add New User network administration panel.
  *
  * @package WordPress
  * @subpackage Multisite
index df14d51aab79cbc2432093689a50d33ff3debbd6..6e8d79f3c926883e84d9d2c5f771246520607ad8 100644 (file)
@@ -164,7 +164,7 @@ printf( __('Comments should be displayed with the %s comments at the top of each
 <?php do_settings_fields('discussion', 'default'); ?>
 </table>
 
-<h3><?php _e('Avatars'); ?></h3>
+<h3 class="title"><?php _e('Avatars'); ?></h3>
 
 <p><?php _e('An avatar is an image that follows you from weblog to weblog appearing beside your name when you comment on avatar enabled sites. Here you can enable the display of avatars for people who comment on your site.'); ?></p>
 
index 066caafbbe47b20c770c214bed445e544305119b..1c706c87d7296cdc94df67f4d80ea307a263bf46 100644 (file)
@@ -2,14 +2,13 @@
 /**
  * WordPress Options Header.
  *
- * Resets variables: 'action', 'standalone', and 'option_group_id'. Displays
- * updated message, if updated variable is part of the URL query.
+ * Displays updated message, if updated variable is part of the URL query.
  *
  * @package WordPress
  * @subpackage Administration
  */
 
-wp_reset_vars(array('action', 'standalone', 'option_group_id'));
+wp_reset_vars( array( 'action' ) );
 
 if ( isset( $_GET['updated'] ) && isset( $_GET['page'] ) ) {
        // For backwards compat with plugins that don't use the Settings API and just set updated=1 in the redirect
index 71d4292c6c509ce94c89a5448313d36b31856d5c..8ba2371f7faa0f5b2d764f160fddcaddb75cec9a 100644 (file)
@@ -46,7 +46,7 @@ include('./admin-header.php');
 <form action="options.php" method="post">
 <?php settings_fields('media'); ?>
 
-<h3><?php _e('Image sizes') ?></h3>
+<h3 class="title"><?php _e('Image sizes') ?></h3>
 <p><?php _e('The sizes listed below determine the maximum dimensions in pixels to use when inserting an image into the body of a post.'); ?></p>
 
 <table class="form-table">
@@ -86,14 +86,14 @@ include('./admin-header.php');
 </table>
 
 <?php if ( isset( $GLOBALS['wp_settings']['media']['embeds'] ) ) : ?>
-<h3><?php _e('Embeds') ?></h3>
+<h3 class="title"><?php _e('Embeds') ?></h3>
 <table class="form-table">
 <?php do_settings_fields( 'media', 'embeds' ); ?>
 </table>
 <?php endif; ?>
 
 <?php if ( !is_multisite() ) : ?>
-<h3><?php _e('Uploading Files'); ?></h3>
+<h3 class="title"><?php _e('Uploading Files'); ?></h3>
 <table class="form-table">
 <?php
 // If upload_url_path is not the default (empty), and upload_path is not the default ('wp-content/uploads' or empty)
index 906361e8a8fac0bbb2835cd7786f83104a334991..d086fdc6b1cf722f2a5e78c3675379cc254fad4f 100644 (file)
@@ -71,8 +71,6 @@ jQuery(document).ready(function() {
 }
 add_filter('admin_head', 'options_permalink_add_js');
 
-include('./admin-header.php');
-
 $home_path = get_home_path();
 $iis7_permalinks = iis7_supports_permalinks();
 
@@ -115,7 +113,8 @@ if ( isset($_POST['permalink_structure']) || isset($_POST['category_base']) ) {
                $wp_rewrite->set_tag_base( $tag_base );
        }
 
-       create_initial_taxonomies();
+       wp_redirect( admin_url( 'options-permalink.php?settings-updated=true' ) );
+       exit;
 }
 
 $permalink_structure = get_option('permalink_structure');
@@ -141,7 +140,9 @@ else
 
 flush_rewrite_rules();
 
-if (isset($_POST['submit'])) : ?>
+require( ABSPATH . 'wp-admin/admin-header.php' );
+
+if ( ! empty( $_GET['settings-updated'] ) ) : ?>
 <div id="message" class="updated"><p><?php
 if ( ! is_multisite() ) {
        if ( $iis7_permalinks ) {
@@ -188,7 +189,7 @@ $structures = array(
        4 => $prefix . '/%postname%/',
 );
 ?>
-<h3><?php _e('Common Settings'); ?></h3>
+<h3 class="title"><?php _e('Common Settings'); ?></h3>
 <table class="form-table permalink-structure">
        <tr>
                <th><label><input name="selection" type="radio" value="" <?php checked('', $permalink_structure); ?> /> <?php _e('Default'); ?></label></th>
@@ -223,11 +224,11 @@ $structures = array(
        </tr>
 </table>
 
-<h3><?php _e('Optional'); ?></h3>
+<h3 class="title"><?php _e('Optional'); ?></h3>
 <?php
 $suffix = '';
 if ( ! $is_apache && ! $iis7_permalinks )
-       $suffix = 'index.php/';
+       $suffix = $wp_rewrite->index . '/';
 ?>
 <p><?php
 /* translators: %s is a placeholder that must come at the start of the URL path. */
index 53647fd6dd05be47002c66be6659a52bff141aa9..8015bae418b0e9893e2ed7f9497376673f35dcb2 100644 (file)
@@ -79,23 +79,21 @@ wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_category', 'o
 </td>
 </tr>
 <?php
-if ( current_theme_supports( 'post-formats' ) ) :
-       $post_formats = get_theme_support( 'post-formats' );
-       if ( is_array( $post_formats[0] ) ) :
+$post_formats = get_post_format_strings();
+unset( $post_formats['standard'] );
 ?>
 <tr valign="top">
 <th scope="row"><label for="default_post_format"><?php _e('Default Post Format') ?></label></th>
 <td>
        <select name="default_post_format" id="default_post_format">
-               <option value="0"><?php _e('Standard'); ?></option>
-<?php foreach ( $post_formats[0] as $format ): ?>
-               <option<?php selected( get_option('default_post_format'), $format ); ?> value="<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></option>
+               <option value="0"><?php echo get_post_format_string( 'standard' ); ?></option>
+<?php foreach ( $post_formats as $format_slug => $format_name ): ?>
+               <option<?php selected( get_option( 'default_post_format' ), $format_slug ); ?> value="<?php echo esc_attr( $format_slug ); ?>"><?php echo esc_html( $format_name ); ?></option>
 <?php endforeach; ?>
        </select>
 </td>
 </tr>
-<?php endif; endif;
-
+<?php
 if ( get_option( 'link_manager_enabled' ) ) :
 ?>
 <tr valign="top">
@@ -118,14 +116,14 @@ do_settings_fields('writing', 'remote_publishing'); // A deprecated section.
 <p><?php _e('Press This is a bookmarklet: a little app that runs in your browser and lets you grab bits of the web.');?></p>
 <p><?php _e('Use Press This to clip text, images and videos from any web page. Then edit and add more straight from Press This before you save or publish it in a post on your site.'); ?></p>
 <p><?php _e('Drag-and-drop the following link to your bookmarks bar or right click it and add it to your favorites for a posting shortcut.') ?></p>
-<p class="pressthis"><a onclick="return false;" oncontextmenu="if(window.navigator.userAgent.indexOf('WebKit')!=-1||window.navigator.userAgent.indexOf('MSIE')!=-1)jQuery('.pressthis-code').show().find('textarea').focus().select();return false;" href="<?php echo htmlspecialchars( get_shortcut_link() ); ?>"><span><?php _e('Press This') ?></span></a></p>
+<p class="pressthis"><a onclick="return false;" oncontextmenu="if(window.navigator.userAgent.indexOf('WebKit')!=-1||window.navigator.userAgent.indexOf('MSIE')!=-1){jQuery('.pressthis-code').show().find('textarea').focus().select();return false;}" href="<?php echo htmlspecialchars( get_shortcut_link() ); ?>"><span><?php _e('Press This') ?></span></a></p>
 <div class="pressthis-code" style="display:none;">
        <p class="description"><?php _e('If your bookmarks toolbar is hidden: copy the code below, open your Bookmarks manager, create new bookmark, type Press This into the name field and paste the code into the URL field.') ?></p>
        <p><textarea rows="5" cols="120" readonly="readonly"><?php echo htmlspecialchars( get_shortcut_link() ); ?></textarea></p>
 </div>
 
 <?php if ( apply_filters( 'enable_post_by_email_configuration', true ) ) { ?>
-<h3><?php _e('Post via e-mail') ?></h3>
+<h3 class="title"><?php _e('Post via e-mail') ?></h3>
 <p><?php printf(__('To post to WordPress by e-mail you must set up a secret e-mail account with POP3 access. Any mail received at this address will be posted, so it&#8217;s a good idea to keep this address very secret. Here are three random strings you could use: <kbd>%s</kbd>, <kbd>%s</kbd>, <kbd>%s</kbd>.'), wp_generate_password(8, false), wp_generate_password(8, false), wp_generate_password(8, false)) ?></p>
 
 <table class="form-table">
@@ -159,7 +157,7 @@ wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'default_email_categor
 <?php } ?>
 
 <?php if ( apply_filters( 'enable_update_services_configuration', true ) ) { ?>
-<h3><?php _e('Update Services') ?></h3>
+<h3 class="title"><?php _e('Update Services') ?></h3>
 
 <?php if ( 1 == get_option('blog_public') ) : ?>
 
index 92ae917bf7d4760c7945fba2a4d892136f6d2775..80a07190df4b8eea0ec8bb477c1483b0a46ef76f 100644 (file)
@@ -120,16 +120,16 @@ if ( 'update' == $action ) {
        if ( 'options' == $option_page ) {
                if ( is_multisite() && ! is_super_admin() )
                        wp_die( __( 'You do not have sufficient permissions to modify unregistered settings for this site.' ) );
-               $options = explode( ',', stripslashes( $_POST[ 'page_options' ] ) );
+               $options = explode( ',', wp_unslash( $_POST[ 'page_options' ] ) );
        } else {
                $options = $whitelist_options[ $option_page ];
        }
 
        // Handle custom date/time formats
        if ( 'general' == $option_page ) {
-               if ( !empty($_POST['date_format']) && isset($_POST['date_format_custom']) && '\c\u\s\t\o\m' == stripslashes( $_POST['date_format'] ) )
+               if ( !empty($_POST['date_format']) && isset($_POST['date_format_custom']) && '\c\u\s\t\o\m' == wp_unslash( $_POST['date_format'] ) )
                        $_POST['date_format'] = $_POST['date_format_custom'];
-               if ( !empty($_POST['time_format']) && isset($_POST['time_format_custom']) && '\c\u\s\t\o\m' == stripslashes( $_POST['time_format'] ) )
+               if ( !empty($_POST['time_format']) && isset($_POST['time_format_custom']) && '\c\u\s\t\o\m' == wp_unslash( $_POST['time_format'] ) )
                        $_POST['time_format'] = $_POST['time_format_custom'];
                // Map UTC+- timezones to gmt_offsets and set timezone_string to empty.
                if ( !empty($_POST['timezone_string']) && preg_match('/^UTC[+-]/', $_POST['timezone_string']) ) {
@@ -150,7 +150,7 @@ if ( 'update' == $action ) {
                                $value = $_POST[ $option ];
                                if ( ! is_array( $value ) )
                                        $value = trim( $value );
-                               $value = stripslashes_deep( $value );
+                               $value = wp_unslash( $value );
                        }
                        update_option( $option, $value );
                }
index 3ab0225061b096aa7cd4c9e21504b2c941fe645b..2167c1ac74d221d2b3f0192796738a3912c675c4 100644 (file)
@@ -20,17 +20,16 @@ if ( !current_user_can('edit_plugins') )
 $title = __("Edit Plugins");
 $parent_file = 'plugins.php';
 
-wp_reset_vars(array('action', 'redirect', 'profile', 'error', 'warning', 'a', 'file', 'plugin'));
+wp_reset_vars( array( 'action', 'error', 'file', 'plugin' ) );
 
 $plugins = get_plugins();
 
 if ( empty($plugins) )
        wp_die( __('There are no plugins installed on this site.') );
 
-if ( isset($_REQUEST['file']) )
-       $plugin = stripslashes($_REQUEST['file']);
-
-if ( empty($plugin) ) {
+if ( $file ) {
+       $plugin = $file;
+} elseif ( empty( $plugin ) ) {
        $plugin = array_keys($plugins);
        $plugin = $plugin[0];
 }
@@ -39,8 +38,6 @@ $plugin_files = get_plugin_files($plugin);
 
 if ( empty($file) )
        $file = $plugin_files[0];
-else
-       $file = stripslashes($file);
 
 $file = validate_file_to_edit($file, $plugin_files);
 $real_file = WP_PLUGIN_DIR . '/' . $file;
@@ -52,7 +49,7 @@ case 'update':
 
        check_admin_referer('edit-plugin_' . $file);
 
-       $newcontent = stripslashes($_POST['newcontent']);
+       $newcontent = wp_unslash( $_POST['newcontent'] );
        if ( is_writeable($real_file) ) {
                $f = fopen($real_file, 'w+');
                fwrite($f, $newcontent);
@@ -117,7 +114,7 @@ default:
        'content'       =>
                '<p>' . __('You can use the editor to make changes to any of your plugins&#8217; individual PHP files. Be aware that if you make changes, plugins updates will overwrite your customizations.') . '</p>' .
                '<p>' . __('Choose a plugin to edit from the menu in the upper right and click the Select button. Click once on any file name to load it in the editor, and make your changes. Don&#8217;t forget to save your changes (Update File) when you&#8217;re finished.') . '</p>' .
-               '<p>' . __('The Documentation menu below the editor lists the PHP functions recognized in the plugin file. Clicking Lookup takes you to a web page about that particular function.') . '</p>' .
+               '<p>' . __('The Documentation menu below the editor lists the PHP functions recognized in the plugin file. Clicking Look Up takes you to a web page about that particular function.') . '</p>' .
                '<p id="newcontent-description">' . __('In the editing area the Tab key enters a tab character. To move below this area by pressing Tab, press the Esc key followed by the Tab key.') . '</p>' .
                '<p>' . __('If you want to make changes but don&#8217;t want them to be overwritten when the plugin is updated, you may be ready to think about writing your own plugin. For information on how to edit plugins, write your own from scratch, or just better understand their anatomy, check out the links below.') . '</p>' .
                ( is_network_admin() ? '<p>' . __('Any edits to files from this screen will be reflected on all sites in the network.') . '</p>' : '' )
@@ -234,7 +231,7 @@ foreach ( $plugin_files as $plugin_file ) :
                <input type="hidden" name="scrollto" id="scrollto" value="<?php echo $scrollto; ?>" />
                </div>
                <?php if ( !empty( $docs_select ) ) : ?>
-               <div id="documentation" class="hide-if-no-js"><label for="docs-list"><?php _e('Documentation:') ?></label> <?php echo $docs_select ?> <input type="button" class="button" value="<?php esc_attr_e( 'Lookup' ) ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'http://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&amp;locale=<?php echo urlencode( get_locale() ) ?>&amp;version=<?php echo urlencode( $wp_version ) ?>&amp;redirect=true'); }" /></div>
+               <div id="documentation" class="hide-if-no-js"><label for="docs-list"><?php _e('Documentation:') ?></label> <?php echo $docs_select ?> <input type="button" class="button" value="<?php esc_attr_e( 'Look Up' ) ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'http://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&amp;locale=<?php echo urlencode( get_locale() ) ?>&amp;version=<?php echo urlencode( $wp_version ) ?>&amp;redirect=true'); }" /></div>
                <?php endif; ?>
 <?php if ( is_writeable($real_file) ) : ?>
        <?php if ( in_array( $file, (array) get_option( 'active_plugins', array() ) ) ) { ?>
index cd64d63c9e5ad146a64fc29664791da46736d730..25470d61a17eefa5e29cd24fc4f6d84d93a74611 100644 (file)
@@ -39,7 +39,7 @@ get_current_screen()->add_help_tab( array(
 'id'           => 'overview',
 'title'                => __('Overview'),
 'content'      =>
-       '<p>' . sprintf(__('Plugins hook into WordPress to extend its functionality with custom features. Plugins are developed independently from the core WordPress application by thousands of developers all over the world. All plugins in the official <a href="%s" target="_blank">WordPress.org Plugin Directory</a> are compatible with the license WordPress uses. You can find new plugins to install by searching or browsing the Directory right here in your own Plugins section.'), 'http://wordpress.org/extend/plugins/') . '</p>'
+       '<p>' . sprintf(__('Plugins hook into WordPress to extend its functionality with custom features. Plugins are developed independently from the core WordPress application by thousands of developers all over the world. All plugins in the official <a href="%s" target="_blank">WordPress.org Plugin Directory</a> are compatible with the license WordPress uses. You can find new plugins to install by searching or browsing the Directory right here in your own Plugins section.'), 'http://wordpress.org/plugins/') . '</p>'
 ) );
 get_current_screen()->add_help_tab( array(
 'id'           => 'adding-plugins',
index 7fc30363d3cb3a1a25249b304d4172115b8aaa18..c371b6410f5d703f6098bad207b08c0409cd90a2 100644 (file)
@@ -340,7 +340,7 @@ get_current_screen()->add_help_tab( array(
 'title'                => __('Overview'),
 'content'      =>
        '<p>' . __('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.') . '</p>' .
-       '<p>' . sprintf(__('You can find additional plugins for your site by using the <a href="%1$s">Plugin Browser/Installer</a> functionality or by browsing the <a href="%2$s" target="_blank">WordPress Plugin Directory</a> directly and installing new plugins manually. To manually install a plugin you generally just need to upload the plugin file into your <code>/wp-content/plugins</code> directory. Once a plugin has been installed, you can activate it here.'), 'plugin-install.php', 'http://wordpress.org/extend/plugins/') . '</p>'
+       '<p>' . sprintf(__('You can find additional plugins for your site by using the <a href="%1$s">Plugin Browser/Installer</a> functionality or by browsing the <a href="%2$s" target="_blank">WordPress Plugin Directory</a> directly and installing new plugins manually. To manually install a plugin you generally just need to upload the plugin file into your <code>/wp-content/plugins</code> directory. Once a plugin has been installed, you can activate it here.'), 'plugin-install.php', 'http://wordpress.org/plugins/') . '</p>'
 ) );
 get_current_screen()->add_help_tab( array(
 'id'           => 'compatibility-problems',
index 8fbe7a228a5d021da38c9cac4e5d8a6e9406813d..4d7df63c94107788d467cf511190dbd7855470c3 100644 (file)
@@ -48,6 +48,17 @@ if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) )
 
 wp_enqueue_script( 'autosave' );
 
+if ( is_multisite() ) {
+       add_action( 'admin_footer', '_admin_notice_post_locked' );
+} else {
+       $check_users = get_users( array( 'fields' => 'ID', 'number' => 2 ) );
+
+       if ( count( $check_users ) > 1 )
+               add_action( 'admin_footer', '_admin_notice_post_locked' );
+
+       unset( $check_users );
+}
+
 // Show post form.
 $post = get_default_post_to_edit( $post_type, true );
 $post_ID = $post->ID;
index c638c18d397efcda5260819d243bd977dd748f24..eab89e6b09e649511c3c58562e8bbfa8a349d565 100644 (file)
@@ -14,7 +14,7 @@ require_once('./admin.php');
 $parent_file = 'edit.php';
 $submenu_file = 'edit.php';
 
-wp_reset_vars(array('action', 'safe_mode', 'withcomments', 'posts', 'content', 'edited_post_title', 'comment_error', 'profile', 'trackback_url', 'excerpt', 'showcomments', 'commentstart', 'commentend', 'commentorder'));
+wp_reset_vars( array( 'action' ) );
 
 if ( isset( $_GET['post'] ) )
        $post_id = $post_ID = (int) $_GET['post'];
@@ -133,19 +133,23 @@ case 'edit':
                exit();
        }
 
-       $p = $post_id;
+       if ( ! $post )
+               wp_die( __( 'You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?' ) );
 
-       if ( empty($post->ID) )
-               wp_die( __('You attempted to edit an item that doesn&#8217;t exist. Perhaps it was deleted?') );
+       if ( ! $post_type_object )
+               wp_die( __( 'Unknown post type.' ) );
 
-       if ( null == $post_type_object )
-               wp_die( __('Unknown post type.') );
-
-       if ( !current_user_can($post_type_object->cap->edit_post, $post_id) )
-               wp_die( __('You are not allowed to edit this item.') );
+       if ( ! current_user_can( 'edit_post', $post_id ) )
+               wp_die( __( 'You are not allowed to edit this item.' ) );
 
        if ( 'trash' == $post->post_status )
-               wp_die( __('You can&#8217;t edit this item because it is in the Trash. Please restore it and try again.') );
+               wp_die( __( 'You can&#8217;t edit this item because it is in the Trash. Please restore it and try again.' ) );
+
+       if ( ! empty( $_GET['get-post-lock'] ) ) {
+               wp_set_post_lock( $post_id );
+               wp_redirect( get_edit_post_link( $post_id, 'url' ) );
+               exit();
+       }
 
        $post_type = $post->post_type;
        if ( 'post' == $post_type ) {
@@ -165,15 +169,24 @@ case 'edit':
                $post_new_file = "post-new.php?post_type=$post_type";
        }
 
-       if ( $last = wp_check_post_lock( $post->ID ) ) {
-               add_action('admin_notices', '_admin_notice_post_locked' );
-       } else {
+       if ( ! wp_check_post_lock( $post->ID ) ) {
                $active_post_lock = wp_set_post_lock( $post->ID );
 
                if ( 'attachment' !== $post_type )
                        wp_enqueue_script('autosave');
        }
 
+       if ( is_multisite() ) {
+               add_action( 'admin_footer', '_admin_notice_post_locked' );
+       } else {
+               $check_users = get_users( array( 'fields' => 'ID', 'number' => 2 ) );
+
+               if ( count( $check_users ) > 1 )
+                       add_action( 'admin_footer', '_admin_notice_post_locked' );
+
+               unset( $check_users );
+       }
+
        $title = $post_type_object->labels->edit_item;
        $post = get_post($post_id, OBJECT, 'edit');
 
@@ -204,6 +217,10 @@ case 'editpost':
 
        $post_id = edit_post();
 
+       // Session cookie flag that the post was saved
+       if ( isset( $_COOKIE['wp-saving-post-' . $post_id] ) )
+               setcookie( 'wp-saving-post-' . $post_id, 'saved' );
+
        redirect_post($post_id); // Send user on their way while we keep working
 
        exit();
@@ -212,13 +229,22 @@ case 'editpost':
 case 'trash':
        check_admin_referer('trash-post_' . $post_id);
 
-       $post = get_post($post_id);
+       if ( ! $post )
+               wp_die( __( 'The item you are trying to move to the Trash no longer exists.' ) );
+
+       if ( ! $post_type_object )
+               wp_die( __( 'Unknown post type.' ) );
 
-       if ( !current_user_can($post_type_object->cap->delete_post, $post_id) )
-               wp_die( __('You are not allowed to move this item to the Trash.') );
+       if ( ! current_user_can( 'delete_post', $post_id ) )
+               wp_die( __( 'You are not allowed to move this item to the Trash.' ) );
+
+       if ( $user_id = wp_check_post_lock( $post_id ) ) {
+               $user = get_userdata( $user_id );
+               wp_die( sprintf( __( 'You cannot move this item to the Trash. %s is currently editing.' ), $user->display_name ) );
+       }
 
-       if ( ! wp_trash_post($post_id) )
-               wp_die( __('Error in moving to Trash.') );
+       if ( ! wp_trash_post( $post_id ) )
+               wp_die( __( 'Error in moving to Trash.' ) );
 
        wp_redirect( add_query_arg( array('trashed' => 1, 'ids' => $post_id), $sendback ) );
        exit();
@@ -227,11 +253,17 @@ case 'trash':
 case 'untrash':
        check_admin_referer('untrash-post_' . $post_id);
 
-       if ( !current_user_can($post_type_object->cap->delete_post, $post_id) )
-               wp_die( __('You are not allowed to move this item out of the Trash.') );
+       if ( ! $post )
+               wp_die( __( 'The item you are trying to restore from the Trash no longer exists.' ) );
 
-       if ( ! wp_untrash_post($post_id) )
-               wp_die( __('Error in restoring from Trash.') );
+       if ( ! $post_type_object )
+               wp_die( __( 'Unknown post type.' ) );
+
+       if ( ! current_user_can( 'delete_post', $post_id ) )
+               wp_die( __( 'You are not allowed to move this item out of the Trash.' ) );
+
+       if ( ! wp_untrash_post( $post_id ) )
+               wp_die( __( 'Error in restoring from Trash.' ) );
 
        wp_redirect( add_query_arg('untrashed', 1, $sendback) );
        exit();
@@ -240,17 +272,23 @@ case 'untrash':
 case 'delete':
        check_admin_referer('delete-post_' . $post_id);
 
-       if ( !current_user_can($post_type_object->cap->delete_post, $post_id) )
-               wp_die( __('You are not allowed to delete this item.') );
+       if ( ! $post )
+               wp_die( __( 'This item has already been deleted.' ) );
+
+       if ( ! $post_type_object )
+               wp_die( __( 'Unknown post type.' ) );
+
+       if ( ! current_user_can( 'delete_post', $post_id ) )
+               wp_die( __( 'You are not allowed to delete this item.' ) );
 
-       $force = !EMPTY_TRASH_DAYS;
+       $force = ! EMPTY_TRASH_DAYS;
        if ( $post->post_type == 'attachment' ) {
-               $force = ( $force || !MEDIA_TRASH );
-               if ( ! wp_delete_attachment($post_id, $force) )
-                       wp_die( __('Error in deleting.') );
+               $force = ( $force || ! MEDIA_TRASH );
+               if ( ! wp_delete_attachment( $post_id, $force ) )
+                       wp_die( __( 'Error in deleting.' ) );
        } else {
-               if ( !wp_delete_post($post_id, $force) )
-                       wp_die( __('Error in deleting.') );
+               if ( ! wp_delete_post( $post_id, $force ) )
+                       wp_die( __( 'Error in deleting.' ) );
        }
 
        wp_redirect( add_query_arg('deleted', 1, $sendback) );
index 6542fa31e85975e2ea019053c8ccf122a2c255f7..0f2be6c539872e8217648bf4210fd6fe515f9bbf 100644 (file)
@@ -91,11 +91,11 @@ if ( isset($_REQUEST['action']) && 'post' == $_REQUEST['action'] ) {
 }
 
 // Set Variables
-$title = isset( $_GET['t'] ) ? trim( strip_tags( html_entity_decode( stripslashes( $_GET['t'] ) , ENT_QUOTES) ) ) : '';
+$title = isset( $_GET['t'] ) ? trim( strip_tags( html_entity_decode( wp_unslash( $_GET['t'] ) , ENT_QUOTES) ) ) : '';
 
 $selection = '';
 if ( !empty($_GET['s']) ) {
-       $selection = str_replace('&apos;', "'", stripslashes($_GET['s']));
+       $selection = str_replace('&apos;', "'", wp_unslash($_GET['s']));
        $selection = trim( htmlspecialchars( html_entity_decode($selection, ENT_QUOTES) ) );
 }
 
@@ -303,7 +303,6 @@ die;
 <script type="text/javascript">
 //<![CDATA[
 addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
-var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time() ?>'};
 var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', pagenow = 'press-this', isRtl = <?php echo (int) is_rtl(); ?>;
 var photostorage = false;
 //]]>
@@ -477,7 +476,7 @@ $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace(
                                        <p>
                                                <label for="post_format"><?php _e( 'Post Format:' ); ?>
                                                <select name="post_format" id="post_format">
-                                                       <option value="0"><?php _ex( 'Standard', 'Post format' ); ?></option>
+                                                       <option value="0"><?php echo get_post_format_string( 'standard' ); ?></option>
                                                <?php foreach ( $post_formats[0] as $format ): ?>
                                                        <option<?php selected( $default_format, $format ); ?> value="<?php echo esc_attr( $format ); ?>"> <?php echo esc_html( get_post_format_string( $format ) ); ?></option>
                                                <?php endforeach; ?>
@@ -586,7 +585,7 @@ $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace(
                        </div>
                </div>
 
-               <div id="waiting" style="display: none"><span class="spinner"></span> <span><?php esc_html_e( 'Loading...' ); ?></span></div>
+               <div id="waiting" style="display: none"><span class="spinner"></span> <span><?php esc_html_e( 'Loading&hellip;' ); ?></span></div>
 
                <div id="extra-fields" style="display: none"></div>
 
index dd20c1276542eb641a52c05be312ce1d55df8651..b6b4ae821e640631b168cc773800ad22ba41b84f 100644 (file)
 /** WordPress Administration Bootstrap */
 require_once('./admin.php');
 
-wp_enqueue_script('list-revisions');
+require ABSPATH . 'wp-admin/includes/revision.php';
 
-wp_reset_vars(array('revision', 'left', 'right', 'action'));
+wp_reset_vars( array( 'revision', 'action', 'from', 'to' ) );
 
-$revision_id = absint($revision);
-$left        = absint($left);
-$right       = absint($right);
+$revision_id = absint( $revision );
 
+$from = is_numeric( $from ) ? absint( $from ) : null;
+if ( ! $revision_id )
+       $revision_id = absint( $to );
 $redirect = 'edit.php';
 
 switch ( $action ) :
 case 'restore' :
-       if ( !$revision = wp_get_post_revision( $revision_id ) )
+       if ( ! $revision = wp_get_post_revision( $revision_id ) )
                break;
-       if ( !current_user_can( 'edit_post', $revision->post_parent ) )
-               break;
-       if ( !$post = get_post( $revision->post_parent ) )
-               break;
-
-       // Revisions disabled and we're not looking at an autosave
-       if ( ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') ) && !wp_is_post_autosave( $revision ) ) {
-               $redirect = 'edit.php?post_type=' . $post->post_type;
-               break;
-       }
-
-       check_admin_referer( "restore-post_$post->ID|$revision->ID" );
 
-       wp_restore_post_revision( $revision->ID );
-       $redirect = add_query_arg( array( 'message' => 5, 'revision' => $revision->ID ), get_edit_post_link( $post->ID, 'url' ) );
-       break;
-case 'diff' :
-       if ( !$left_revision  = get_post( $left ) )
-               break;
-       if ( !$right_revision = get_post( $right ) )
+       if ( ! current_user_can( 'edit_post', $revision->post_parent ) )
                break;
 
-       if ( !current_user_can( 'read_post', $left_revision->ID ) || !current_user_can( 'read_post', $right_revision->ID ) )
+       if ( ! $post = get_post( $revision->post_parent ) )
                break;
 
-       // If we're comparing a revision to itself, redirect to the 'view' page for that revision or the edit page for that post
-       if ( $left_revision->ID == $right_revision->ID ) {
-               $redirect = get_edit_post_link( $left_revision->ID );
-               include( './js/revisions-js.php' );
+       // Revisions disabled (previously checked autosaves && ! wp_is_post_autosave( $revision ))
+       if ( ! wp_revisions_enabled( $post ) ) {
+               $redirect = 'edit.php?post_type=' . $post->post_type;
                break;
        }
 
-       // Don't allow reverse diffs?
-       if ( strtotime($right_revision->post_modified_gmt) < strtotime($left_revision->post_modified_gmt) ) {
-               $redirect = add_query_arg( array( 'left' => $right, 'right' => $left ) );
+       // Don't allow revision restore when post is locked
+       if ( wp_check_post_lock( $post->ID ) )
                break;
-       }
-
-       if ( $left_revision->ID == $right_revision->post_parent ) // right is a revision of left
-               $post =& $left_revision;
-       elseif ( $left_revision->post_parent == $right_revision->ID ) // left is a revision of right
-               $post =& $right_revision;
-       elseif ( $left_revision->post_parent == $right_revision->post_parent ) // both are revisions of common parent
-               $post = get_post( $left_revision->post_parent );
-       else
-               break; // Don't diff two unrelated revisions
-
-       if ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') ) { // Revisions disabled
-               if (
-                       // we're not looking at an autosave
-                       ( !wp_is_post_autosave( $left_revision ) && !wp_is_post_autosave( $right_revision ) )
-               ||
-                       // we're not comparing an autosave to the current post
-                       ( $post->ID !== $left_revision->ID && $post->ID !== $right_revision->ID )
-               ) {
-                       $redirect = 'edit.php?post_type=' . $post->post_type;
-                       break;
-               }
-       }
 
-       if (
-               // They're the same
-               $left_revision->ID == $right_revision->ID
-       ||
-               // Neither is a revision
-               ( !wp_get_post_revision( $left_revision->ID ) && !wp_get_post_revision( $right_revision->ID ) )
-       )
-               break;
+       check_admin_referer( "restore-post_{$revision->ID}" );
 
-       $post_title = '<a href="' . get_edit_post_link() . '">' . get_the_title() . '</a>';
-       $h2 = sprintf( __( 'Compare Revisions of &#8220;%1$s&#8221;' ), $post_title );
-       $title = __( 'Revisions' );
-
-       $left  = $left_revision->ID;
-       $right = $right_revision->ID;
-
-       $redirect = false;
+       wp_restore_post_revision( $revision->ID );
+       $redirect = add_query_arg( array( 'message' => 5, 'revision' => $revision->ID ), get_edit_post_link( $post->ID, 'url' ) );
        break;
 case 'view' :
+case 'edit' :
 default :
-       if ( !$revision = wp_get_post_revision( $revision_id ) )
+       if ( ! $revision = wp_get_post_revision( $revision_id ) )
                break;
-       if ( !$post = get_post( $revision->post_parent ) )
+       if ( ! $post = get_post( $revision->post_parent ) )
                break;
 
-       if ( !current_user_can( 'read_post', $revision->ID ) || !current_user_can( 'read_post', $post->ID ) )
+       if ( ! current_user_can( 'read_post', $revision->ID ) || ! current_user_can( 'read_post', $post->ID ) )
                break;
 
        // Revisions disabled and we're not looking at an autosave
-       if ( ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') ) && !wp_is_post_autosave( $revision ) ) {
+       if ( ! wp_revisions_enabled( $post ) && ! wp_is_post_autosave( $revision ) ) {
                $redirect = 'edit.php?post_type=' . $post->post_type;
                break;
        }
 
-       $post_title = '<a href="' . get_edit_post_link() . '">' . get_the_title() . '</a>';
-       $revision_title = wp_post_revision_title( $revision, false );
-       $h2 = sprintf( __( 'Revision for &#8220;%1$s&#8221; created on %2$s' ), $post_title, $revision_title );
+       $post_title = '<a href="' . get_edit_post_link() . '">' . _draft_or_post_title() . '</a>';
+       $h2 = sprintf( __( 'Compare Revisions of &#8220;%1$s&#8221;' ), $post_title );
        $title = __( 'Revisions' );
 
-       // Sets up the diff radio buttons
-       $left  = $revision->ID;
-       $right = $post->ID;
-
        $redirect = false;
        break;
 endswitch;
 
 // Empty post_type means either malformed object found, or no valid parent was found.
-if ( !$redirect && empty($post->post_type) )
+if ( ! $redirect && empty( $post->post_type ) )
        $redirect = 'edit.php';
 
-if ( !empty($redirect) ) {
+if ( ! empty( $redirect ) ) {
        wp_redirect( $redirect );
        exit;
 }
 
 // This is so that the correct "Edit" menu item is selected.
-if ( !empty($post->post_type) && 'post' != $post->post_type )
+if ( ! empty( $post->post_type ) && 'post' != $post->post_type )
        $parent_file = $submenu_file = 'edit.php?post_type=' . $post->post_type;
 else
        $parent_file = $submenu_file = 'edit.php';
 
-require_once( './admin-header.php' );
-
-?>
-
-<div class="wrap">
-
-<h2 class="long-header"><?php echo $h2; ?></h2>
-
-<table class="form-table ie-fixed">
-       <col class="th" />
-<?php if ( 'diff' == $action ) : ?>
-<tr id="revision">
-       <th scope="row"></th>
-       <th scope="col" class="th-full">
-               <span class="alignleft"><?php printf( __('Older: %s'), wp_post_revision_title( $left_revision ) ); ?></span>
-               <span class="alignright"><?php printf( __('Newer: %s'), wp_post_revision_title( $right_revision ) ); ?></span>
-       </th>
-</tr>
-<?php endif;
-
-// use get_post_to_edit filters?
-$identical = true;
-foreach ( _wp_post_revision_fields() as $field => $field_title ) :
-       if ( 'diff' == $action ) {
-               $left_content = apply_filters( "_wp_post_revision_field_$field", $left_revision->$field, $field );
-               $right_content = apply_filters( "_wp_post_revision_field_$field", $right_revision->$field, $field );
-               if ( !$content = wp_text_diff( $left_content, $right_content ) )
-                       continue; // There is no difference between left and right
-               $identical = false;
-       } else {
-               add_filter( "_wp_post_revision_field_$field", 'htmlspecialchars' );
-               $content = apply_filters( "_wp_post_revision_field_$field", $revision->$field, $field );
-       }
-       ?>
-
-       <tr id="revision-field-<?php echo $field; ?>">
-               <th scope="row"><?php echo esc_html( $field_title ); ?></th>
-               <td><div class="pre"><?php echo $content; ?></div></td>
-       </tr>
-
-       <?php
+wp_enqueue_script( 'revisions' );
+wp_localize_script( 'revisions', '_wpRevisionsSettings', wp_prepare_revisions_for_js( $post, $revision_id, $from ) );
 
-endforeach;
+/* Revisions Help Tab */
 
-if ( 'diff' == $action && $identical ) :
+$revisions_overview  = '<p>' . __( 'This screen is used for managing your content revisions.' ) . '</p>';
+$revisions_overview .= '<p>' . __( 'Revisions are saved copies of your post or page, which are periodically created as you update your content. The red text on the left shows the content that was removed. The green text on the right shows the content that was added.' ) . '</p>';
+$revisions_overview .= '<p>' . __( 'From this screen you can review, compare, and restore revisions:' ) . '</p>';
+$revisions_overview .= '<ul><li>' . __( 'To navigate between revisions, <strong>drag the slider handle left or right</strong> or <strong>use the Previous or Next buttons</strong>.' ) . '</li>';
+$revisions_overview .= '<li>' . __( 'Compare two different revisions by <strong>selecting the &#8220;Compare any two revisions&#8221; box</strong> to the side.' ) . '</li>';
+$revisions_overview .= '<li>' . __( 'To restore a revision, <strong>click Restore This Revision</strong>.' ) . '</li></ul>';
 
-       ?>
+get_current_screen()->add_help_tab( array(
+       'id'      => 'revisions-overview',
+       'title'   => __( 'Overview' ),
+       'content' => $revisions_overview
+) );
 
-       <tr><td colspan="2"><div class="updated"><p><?php _e( 'These revisions are identical.' ); ?></p></div></td></tr>
+$revisions_sidebar  = '<p><strong>' . __( 'For more information:' ) . '</strong></p>';
+$revisions_sidebar .= '<p>' . __( '<a href="http://codex.wordpress.org/Revision_Management" target="_blank">Revisions Management</a>' ) . '</p>';
+$revisions_sidebar .= '<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>';
 
-       <?php
+get_current_screen()->set_help_sidebar( $revisions_sidebar );
 
-endif;
+require_once( './admin-header.php' );
 
 ?>
 
-</table>
-
-<br class="clear" />
-
-<h3><?php echo $title; ?></h3>
-
-<?php
-
-$args = array( 'format' => 'form-table', 'parent' => true, 'right' => $right, 'left' => $left );
-if ( ! WP_POST_REVISIONS || !post_type_supports($post->post_type, 'revisions') )
-       $args['type'] = 'autosave';
+<div class="wrap">
+       <?php screen_icon(); ?>
+       <h2 class="long-header"><?php echo $h2; ?></h2>
+</div>
 
-wp_list_post_revisions( $post, $args );
+<script id="tmpl-revisions-frame" type="text/html">
+       <div class="revisions-control-frame"></div>
+       <div class="revisions-diff-frame"></div>
+</script>
+
+<script id="tmpl-revisions-buttons" type="text/html">
+       <div class="revisions-previous">
+               <input class="button" type="button" value="<?php echo esc_attr_x( 'Previous', 'Button label for a previous revision' ); ?>" />
+       </div>
+
+       <div class="revisions-next">
+               <input class="button" type="button" value="<?php echo esc_attr_x( 'Next', 'Button label for a next revision' ); ?>" />
+       </div>
+</script>
+
+<script id="tmpl-revisions-checkbox" type="text/html">
+       <div class="revision-toggle-compare-mode">
+               <label>
+                       <input type="checkbox" class="compare-two-revisions"
+                       <#
+                       if ( 'undefined' !== typeof data && data.model.attributes.compareTwoMode ) {
+                               #> checked="checked"<#
+                       }
+                       #>
+                       />
+                       <?php esc_attr_e( 'Compare any two revisions' ); ?>
+               </label>
+       </div>
+</script>
+
+<script id="tmpl-revisions-meta" type="text/html">
+       <# if ( ! _.isUndefined( data.attributes ) ) { #>
+               <div class="diff-title">
+                       <# if ( 'from' === data.type ) { #>
+                               <strong><?php _ex( 'From:', 'Followed by post revision info' ); ?></strong>
+                       <# } else if ( 'to' === data.type ) { #>
+                               <strong><?php _ex( 'To:', 'Followed by post revision info' ); ?></strong>
+                       <# } #>
+                       <div class="author-card<# if ( data.attributes.autosave ) { #> autosave<# } #>">
+                               {{{ data.attributes.author.avatar }}}
+                               <div class="author-info">
+                               <# if ( data.attributes.autosave ) { #>
+                                       <span class="byline"><?php printf( __( 'Autosave by %s' ),
+                                               '<span class="author-name">{{ data.attributes.author.name }}</span>' ); ?></span>
+                               <# } else if ( data.attributes.current ) { #>
+                                       <span class="byline"><?php printf( __( 'Current Revision by %s' ),
+                                               '<span class="author-name">{{ data.attributes.author.name }}</span>' ); ?></span>
+                               <# } else { #>
+                                       <span class="byline"><?php printf( __( 'Revision by %s' ),
+                                               '<span class="author-name">{{ data.attributes.author.name }}</span>' ); ?></span>
+                               <# } #>
+                                       <span class="time-ago">{{ data.attributes.timeAgo }}</span>
+                                       <span class="date">({{ data.attributes.dateShort }})</span>
+                               </div>
+                       <# if ( 'to' === data.type && data.attributes.restoreUrl ) { #>
+                               <input  <?php if ( wp_check_post_lock( $post->ID ) ) { ?>
+                                       disabled="disabled"
+                               <?php } else { ?>
+                                       <# if ( data.attributes.current ) { #>
+                                               disabled="disabled"
+                                       <# } #>
+                               <?php } ?>
+                               <# if ( data.attributes.autosave ) { #>
+                                       type="button" class="restore-revision button button-primary" value="<?php esc_attr_e( 'Restore This Autosave' ); ?>" />
+                               <# } else { #>
+                                       type="button" class="restore-revision button button-primary" value="<?php esc_attr_e( 'Restore This Revision' ); ?>" />
+                               <# } #>
+                       <# } #>
+               </div>
+       <# if ( 'tooltip' === data.type ) { #>
+               <div class="revisions-tooltip-arrow"><span></span></div>
+       <# } #>
+<# } #>
+</script>
+
+<script id="tmpl-revisions-diff" type="text/html">
+       <div class="loading-indicator"><span class="spinner"></span></div>
+       <div class="diff-error"><?php _e( 'Sorry, something went wrong. The requested comparison could not be loaded.' ); ?></div>
+       <div class="diff">
+       <# _.each( data.fields, function( field ) { #>
+               <h3>{{ field.name }}</h3>
+               {{{ field.diff }}}
+       <# }); #>
+       </div>
+</script>
 
-?>
-
-</div>
 
 <?php
 require_once( './admin-footer.php' );
index 7409d010ffff3eeba4eef1e71eb04d2addfdd52b..82d06e99dc6ad959a6d40d8e87e8792e4dbe9015 100644 (file)
@@ -164,7 +164,7 @@ switch($step) {
 
        case 2:
        foreach ( array( 'dbname', 'uname', 'pwd', 'dbhost', 'prefix' ) as $key )
-               $$key = trim( stripslashes( $_POST[ $key ] ) );
+               $$key = trim( wp_unslash( $_POST[ $key ] ) );
 
        $tryagain_link = '</p><p class="step"><a href="setup-config.php?step=1" onclick="javascript:history.go(-1);return false;" class="button button-large">' . __( 'Try again' ) . '</a>';
 
@@ -283,7 +283,7 @@ el.select();
                chmod(ABSPATH . 'wp-config.php', 0666);
                setup_config_display_header();
 ?>
-<p><?php _e( "All right sparky! You&#8217;ve made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to&hellip;" ); ?></p>
+<p><?php _e( "All right, sparky! You&#8217;ve made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to&hellip;" ); ?></p>
 
 <p class="step"><a href="install.php" class="button button-large"><?php _e( 'Run the install' ); ?></a></p>
 <?php
index c9adabe0cd4b21a289efc727a0b59afd912bfca9..8f95cab11f23fbf66299044f61b34858f7bd91ff 100644 (file)
@@ -26,7 +26,7 @@ get_current_screen()->add_help_tab( array(
 'content'      =>
        '<p>' . __('You can use the Theme Editor to edit the individual CSS and PHP files which make up your theme.') . '</p>
        <p>' . __('Begin by choosing a theme to edit from the dropdown menu and clicking Select. A list then appears of all the template files. Clicking once on any file name causes the file to appear in the large Editor box.') . '</p>
-       <p>' . __('For PHP files, you can use the Documentation dropdown to select from functions recognized in that file. Lookup takes you to a web page with reference material about that particular function.') . '</p>
+       <p>' . __('For PHP files, you can use the Documentation dropdown to select from functions recognized in that file. Look Up takes you to a web page with reference material about that particular function.') . '</p>
        <p id="newcontent-description">' . __('In the editing area the Tab key enters a tab character. To move below this area by pressing Tab, press the Esc key followed by the Tab key.') . '</p>
        <p>' . __('After typing in your edits, click Update File.') . '</p>
        <p>' . __('<strong>Advice:</strong> think very carefully about your site crashing if you are live-editing the theme currently in use.') . '</p>
@@ -68,7 +68,7 @@ if ( empty( $file ) ) {
        $relative_file = 'style.css';
        $file = $allowed_files['style.css'];
 } else {
-       $relative_file = stripslashes( $file );
+       $relative_file = $file;
        $file = $theme->get_stylesheet_directory() . '/' . $relative_file;
 }
 
@@ -78,7 +78,7 @@ $scrollto = isset( $_REQUEST['scrollto'] ) ? (int) $_REQUEST['scrollto'] : 0;
 switch( $action ) {
 case 'update':
        check_admin_referer( 'edit-theme_' . $file . $stylesheet );
-       $newcontent = stripslashes( $_POST['newcontent'] );
+       $newcontent = wp_unslash( $_POST['newcontent'] );
        $location = 'theme-editor.php?file=' . urlencode( $relative_file ) . '&theme=' . urlencode( $stylesheet ) . '&scrollto=' . $scrollto;
        if ( is_writeable( $file ) ) {
                //is_writable() not always reliable, check return value. see comments @ http://uk.php.net/is_writable
@@ -112,7 +112,7 @@ default:
                        $functions = wp_doc_link_parse( $content );
 
                        $docs_select = '<select name="docs-list" id="docs-list">';
-                       $docs_select .= '<option value="">' . esc_attr__( 'Function Name...' ) . '</option>';
+                       $docs_select .= '<option value="">' . esc_attr__( 'Function Name&hellip;' ) . '</option>';
                        foreach ( $functions as $function ) {
                                $docs_select .= '<option value="' . esc_attr( urlencode( $function ) ) . '">' . htmlspecialchars( $function ) . '()</option>';
                        }
@@ -209,7 +209,7 @@ else : ?>
                <div id="documentation" class="hide-if-no-js">
                <label for="docs-list"><?php _e('Documentation:') ?></label>
                <?php echo $docs_select; ?>
-               <input type="button" class="button" value=" <?php esc_attr_e( 'Lookup' ); ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'http://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&amp;locale=<?php echo urlencode( get_locale() ) ?>&amp;version=<?php echo urlencode( $wp_version ) ?>&amp;redirect=true'); }" />
+               <input type="button" class="button" value=" <?php esc_attr_e( 'Look Up' ); ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'http://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&amp;locale=<?php echo urlencode( get_locale() ) ?>&amp;version=<?php echo urlencode( $wp_version ) ?>&amp;redirect=true'); }" />
                </div>
        <?php endif; ?>
 
index 0825c0e4b79d4ae2f7d06c8ebfa2a38806005984..14d9f52e84cfa92145129c109c0884abaa68f363 100644 (file)
@@ -37,7 +37,7 @@ $body_id = $tab;
 do_action('install_themes_pre_' . $tab); //Used to override the general interface, Eg, install or theme information.
 
 $help_overview =
-       '<p>' . sprintf(__('You can find additional themes for your site by using the Theme Browser/Installer on this screen, which will display themes from the <a href="%s" target="_blank">WordPress.org Theme Directory</a>. These themes are designed and developed by third parties, are available free of charge, and are compatible with the license WordPress uses.'), 'http://wordpress.org/extend/themes/') . '</p>' .
+       '<p>' . sprintf(__('You can find additional themes for your site by using the Theme Browser/Installer on this screen, which will display themes from the <a href="%s" target="_blank">WordPress.org Theme Directory</a>. These themes are designed and developed by third parties, are available free of charge, and are compatible with the license WordPress uses.'), 'http://wordpress.org/themes/') . '</p>' .
        '<p>' . __('You can Search for themes by keyword, author, or tag, or can get more specific and search by criteria listed in the feature filter. Alternately, you can browse the themes that are Featured, Newest, or Recently Updated. When you find a theme you like, you can preview it or install it.') . '</p>' .
        '<p>' . __('You can Upload a theme manually if you have already downloaded its ZIP archive onto your computer (make sure it is from a trusted and original source). You can also do it the old-fashioned way and copy a downloaded theme&#8217;s folder via FTP into your <code>/wp-content/themes</code> directory.') . '</p>';
 
index 7852a721364af2c6ccd91be7a942ed4e17b5df61..14ed887da02a8dade8cae4d6de153df928fb70af 100644 (file)
@@ -54,7 +54,7 @@ if ( current_user_can( 'install_themes' ) ) {
        if ( is_multisite() ) {
                $help_install = '<p>' . __('Installing themes on Multisite can only be done from the Network Admin section.') . '</p>';
        } else {
-               $help_install = '<p>' . sprintf( __('If you would like to see more themes to choose from, click on the &#8220;Install Themes&#8221; tab and you will be able to browse or search for additional themes from the <a href="%s" target="_blank">WordPress.org Theme Directory</a>. Themes in the WordPress.org Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they&#8217;re free!'), 'http://wordpress.org/extend/themes/' ) . '</p>';
+               $help_install = '<p>' . sprintf( __('If you would like to see more themes to choose from, click on the &#8220;Install Themes&#8221; tab and you will be able to browse or search for additional themes from the <a href="%s" target="_blank">WordPress.org Theme Directory</a>. Themes in the WordPress.org Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they&#8217;re free!'), 'http://wordpress.org/themes/' ) . '</p>';
        }
 
        get_current_screen()->add_help_tab( array(
@@ -159,7 +159,7 @@ $customize_title = sprintf( __( 'Customize &#8220;%s&#8221;' ), $ct->display('Na
        if ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) {
                foreach ( (array) $submenu['themes.php'] as $item) {
                        $class = '';
-                       if ( 'themes.php' == $item[2] || 'theme-editor.php' == $item[2] )
+                       if ( 'themes.php' == $item[2] || 'theme-editor.php' == $item[2] || 'customize.php' == $item[2] )
                                continue;
                        // 0 = name, 1 = capability, 2 = file
                        if ( ( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file)) )
index a036f28553c8289e4f94b20bfd135886adebd8a7..387be90356c31989e9bfb74662525d539d87cf0c 100644 (file)
@@ -43,7 +43,7 @@ require_once('./admin-header.php');
 
        <p><?php _e('Use Press This to clip text, images and videos from any web page. Then edit and add more straight from Press This before you save or publish it in a post on your site.'); ?></p>
        <p class="description"><?php _e('Drag-and-drop the following link to your bookmarks bar or right click it and add it to your favorites for a posting shortcut.') ?></p>
-       <p class="pressthis"><a onclick="return false;" oncontextmenu="if(window.navigator.userAgent.indexOf('WebKit')!=-1||window.navigator.userAgent.indexOf('MSIE')!=-1)jQuery('.pressthis-code').show().find('textarea').focus().select();return false;" href="<?php echo htmlspecialchars( get_shortcut_link() ); ?>"><span><?php _e('Press This') ?></span></a></p>
+       <p class="pressthis"><a onclick="return false;" oncontextmenu="if(window.navigator.userAgent.indexOf('WebKit')!=-1||window.navigator.userAgent.indexOf('MSIE')!=-1){jQuery('.pressthis-code').show().find('textarea').focus().select();return false;}" href="<?php echo htmlspecialchars( get_shortcut_link() ); ?>"><span><?php _e('Press This') ?></span></a></p>
        <div class="pressthis-code" style="display:none;">
        <p class="description"><?php _e('If your bookmarks toolbar is hidden: copy the code below, open your Bookmarks manager, create new bookmark, type Press This into the name field and paste the code into the URL field.') ?></p>
        <p><textarea rows="5" cols="120" readonly="readonly"><?php echo htmlspecialchars( get_shortcut_link() ); ?></textarea></p>
index a45b9be988431f171d6aa28423121c30a2882aba..c8f58774296342707420dde77afec63f04a923d1 100644 (file)
@@ -188,7 +188,7 @@ function list_plugin_updates() {
        ?>
 <h3><?php _e( 'Plugins' ); ?></h3>
 <p><?php _e( 'The following plugins have new versions available. Check the ones you want to update and then click &#8220;Update Plugins&#8221;.' ); ?></p>
-<form method="post" action="<?php echo $form_action; ?>" name="upgrade-plugins" class="upgrade">
+<form method="post" action="<?php echo esc_url( $form_action ); ?>" name="upgrade-plugins" class="upgrade">
 <?php wp_nonce_field('upgrade-core'); ?>
 <p><input id="upgrade-plugins" class="button" type="submit" value="<?php esc_attr_e('Update Plugins'); ?>" name="upgrade" /></p>
 <table class="widefat" cellspacing="0" id="update-plugins-table">
@@ -266,7 +266,7 @@ function list_theme_updates() {
 <h3><?php _e( 'Themes' ); ?></h3>
 <p><?php _e( 'The following themes have new versions available. Check the ones you want to update and then click &#8220;Update Themes&#8221;.' ); ?></p>
 <p><?php printf( __('<strong>Please Note:</strong> Any customizations you have made to theme files will be lost. Please consider using <a href="%s">child themes</a> for modifications.'), _x('http://codex.wordpress.org/Child_Themes', 'Link used in suggestion to use child themes in GUU') ); ?></p>
-<form method="post" action="<?php echo $form_action; ?>" name="upgrade-themes" class="upgrade">
+<form method="post" action="<?php echo esc_url( $form_action ); ?>" name="upgrade-themes" class="upgrade">
 <?php wp_nonce_field('upgrade-core'); ?>
 <p><input id="upgrade-themes" class="button" type="submit" value="<?php esc_attr_e('Update Themes'); ?>" name="upgrade" /></p>
 <table class="widefat" cellspacing="0" id="update-themes-table">
@@ -289,7 +289,7 @@ function list_theme_updates() {
                echo "
        <tr class='active'>
                <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr( $stylesheet ) . "' /></th>
-               <td class='plugin-title'><img src='" . esc_url( $theme->get_screenshot() ) . "' width='64' height='64' style='float:left; padding: 0 5px 5px' /><strong>" . $theme->display('Name') . '</strong> ' . sprintf( __( 'You have version %1$s installed. Update to %2$s.' ), $theme->display('Version'), $theme->update['new_version'] ) . "</td>
+               <td class='plugin-title'><img src='" . esc_url( $theme->get_screenshot() ) . "' width='85' height='64' style='float:left; padding: 0 5px 5px' /><strong>" . $theme->display('Name') . '</strong> ' . sprintf( __( 'You have version %1$s installed. Update to %2$s.' ), $theme->display('Version'), $theme->update['new_version'] ) . "</td>
        </tr>";
        }
 ?>
index 9a632ef05c8fc4be81cfc3dd04ea9f3ccae72fa1..b04287735d6611cb4b14f263c882bf4944fa092e 100644 (file)
@@ -58,7 +58,7 @@ else
        ?>
 </head>
 <body class="wp-core-ui">
-<h1 id="logo"><a href="<?php esc_attr_e( 'http://wordpress.org/' ); ?>"><?php _e( 'WordPress' ); ?></a></h1>
+<h1 id="logo"><a href="<?php echo esc_url( __( 'http://wordpress.org/' ) ); ?>"><?php _e( 'WordPress' ); ?></a></h1>
 
 <?php if ( get_option( 'db_version' ) == $wp_db_version || !is_blog_installed() ) : ?>
 
@@ -77,7 +77,7 @@ else
 <?php else :
 switch ( $step ) :
        case 0:
-               $goback = stripslashes( wp_get_referer() );
+               $goback = wp_get_referer();
                $goback = esc_url_raw( $goback );
                $goback = urlencode( $goback );
 ?>
@@ -90,7 +90,7 @@ switch ( $step ) :
        case 1:
                wp_upgrade();
 
-                       $backto = !empty($_GET['backto']) ? stripslashes( urldecode( $_GET['backto'] ) ) : __get_option( 'home' ) . '/';
+                       $backto = !empty($_GET['backto']) ? wp_unslash( urldecode( $_GET['backto'] ) ) : __get_option( 'home' ) . '/';
                        $backto = esc_url( $backto );
                        $backto = wp_validate_redirect($backto, __get_option( 'home' ) . '/');
 ?>
index 7d50d5290daba823ee12f12a1b922bbb26ed4ae5..8dec1302a1629e32ef8286ebb35efdb1675a7428 100644 (file)
@@ -99,7 +99,7 @@ if ( $doaction ) {
                                        wp_die( __( 'You are not allowed to move this post to the trash.' ) );
 
                                if ( !wp_trash_post( $post_id ) )
-                                       wp_die( __( 'Error in moving to trash...' ) );
+                                       wp_die( __( 'Error in moving to trash.' ) );
                        }
                        $location = add_query_arg( array( 'trashed' => count( $post_ids ), 'ids' => join( ',', $post_ids ) ), $location );
                        break;
@@ -111,7 +111,7 @@ if ( $doaction ) {
                                        wp_die( __( 'You are not allowed to move this post out of the trash.' ) );
 
                                if ( !wp_untrash_post( $post_id ) )
-                                       wp_die( __( 'Error in restoring from trash...' ) );
+                                       wp_die( __( 'Error in restoring from trash.' ) );
                        }
                        $location = add_query_arg( 'untrashed', count( $post_ids ), $location );
                        break;
@@ -123,7 +123,7 @@ if ( $doaction ) {
                                        wp_die( __( 'You are not allowed to delete this post.' ) );
 
                                if ( !wp_delete_attachment( $post_id_del ) )
-                                       wp_die( __( 'Error in deleting...' ) );
+                                       wp_die( __( 'Error in deleting.' ) );
                        }
                        $location = add_query_arg( 'deleted', count( $post_ids ), $location );
                        break;
@@ -132,7 +132,7 @@ if ( $doaction ) {
        wp_redirect( $location );
        exit;
 } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) {
-        wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) );
+        wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
         exit;
 }
 
index eadc1f08eb139797f5461c473c31a80440914cf0..bb9119f2217f47f25d7299660a649e139a9b32aa 100644 (file)
@@ -9,7 +9,7 @@
 /** WordPress Administration Bootstrap */
 require_once('./admin.php');
 
-wp_reset_vars(array('action', 'redirect', 'profile', 'user_id', 'wp_http_referer'));
+wp_reset_vars( array( 'action', 'user_id', 'wp_http_referer' ) );
 
 $user_id = (int) $user_id;
 $current_user = wp_get_current_user();
@@ -54,7 +54,7 @@ get_current_screen()->set_help_sidebar(
     '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
 );
 
-$wp_http_referer = remove_query_arg(array('update', 'delete_count'), stripslashes($wp_http_referer));
+$wp_http_referer = remove_query_arg(array('update', 'delete_count'), $wp_http_referer );
 
 $user_can_edit = current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' );
 
@@ -250,7 +250,6 @@ if ( !( IS_PROFILE_PAGE && !$user_can_edit ) ) : ?>
 <td><select name="role" id="role">
 <?php
 // Compare user role against currently editable roles
-// TODO: create a function that does this: wp_get_user_role()
 $user_roles = array_intersect( array_values( $profileuser->roles ), array_keys( get_editable_roles() ) );
 $user_role  = array_shift( $user_roles );
 
@@ -337,7 +336,7 @@ if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_c
        <td><input type="text" name="email" id="email" value="<?php echo esc_attr($profileuser->user_email) ?>" class="regular-text" />
        <?php
        $new_email = get_option( $current_user->ID . '_new_email' );
-       if ( $new_email && $new_email != $current_user->user_email ) : ?>
+       if ( $new_email && $new_email['newemail'] != $current_user->user_email && $profileuser->ID == $current_user->ID ) : ?>
        <div class="updated inline">
        <p><?php printf( __('There is a pending change of your e-mail to <code>%1$s</code>. <a href="%2$s">Cancel</a>'), $new_email['newemail'], esc_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ) ) ); ?></p>
        </div>
@@ -377,10 +376,18 @@ if ( $show_password_fields ) :
 ?>
 <tr id="password">
        <th><label for="pass1"><?php _e('New Password'); ?></label></th>
-       <td><input type="password" name="pass1" id="pass1" size="16" value="" autocomplete="off" /> <span class="description"><?php _e("If you would like to change the password type a new one. Otherwise leave this blank."); ?></span><br />
-               <input type="password" name="pass2" id="pass2" size="16" value="" autocomplete="off" /> <span class="description"><?php _e("Type your new password again."); ?></span><br />
-               <div id="pass-strength-result"><?php _e('Strength indicator'); ?></div>
-               <p class="description indicator-hint"><?php _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ &amp; ).'); ?></p>
+       <td>
+               <input class="hidden" value=" " /><!-- #24364 workaround -->
+               <input type="password" name="pass1" id="pass1" size="16" value="" autocomplete="off" /> <span class="description"><?php _e("If you would like to change the password type a new one. Otherwise leave this blank."); ?></span>
+       </td>
+</tr>
+<tr>
+       <th scope="row"><label for="pass2"><?php _e('Repeat New Password'); ?></label></th>
+       <td>
+       <input name="pass2" type="password" id="pass2" size="16" value="" autocomplete="off" /> <span class="description" for="pass2"><?php _e("Type your new password again."); ?></span>
+       <br />
+       <div id="pass-strength-result"><?php _e('Strength indicator'); ?></div>
+       <p class="description indicator-hint"><?php _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ &amp; ).'); ?></p>
        </td>
 </tr>
 <?php endif; ?>
@@ -393,25 +400,27 @@ if ( $show_password_fields ) :
                do_action( 'edit_user_profile', $profileuser );
 ?>
 
-<?php if ( count($profileuser->caps) > count($profileuser->roles) && apply_filters('additional_capabilities_display', true, $profileuser) ) { ?>
-<br class="clear" />
-       <table width="99%" style="border: none;" cellspacing="2" cellpadding="3" class="editform">
-               <tr>
-                       <th scope="row"><?php _e('Additional Capabilities') ?></th>
-                       <td><?php
-                       $output = '';
-                       foreach ( $profileuser->caps as $cap => $value ) {
-                               if ( !$wp_roles->is_role($cap) ) {
-                                       if ( $output != '' )
-                                               $output .= ', ';
-                                       $output .= $value ? $cap : "Denied: {$cap}";
-                               }
-                       }
-                       echo $output;
-                       ?></td>
-               </tr>
-       </table>
-<?php } ?>
+<?php if ( count( $profileuser->caps ) > count( $profileuser->roles ) && apply_filters( 'additional_capabilities_display', true, $profileuser ) ) : ?>
+<h3><?php _e( 'Additional Capabilities' ); ?></h3>
+<table class="form-table">
+<tr>
+       <th scope="row"><?php _e( 'Capabilities' ); ?></th>
+       <td>
+<?php
+       $output = '';
+       foreach ( $profileuser->caps as $cap => $value ) {
+               if ( ! $wp_roles->is_role( $cap ) ) {
+                       if ( '' != $output )
+                               $output .= ', ';
+                       $output .= $value ? $cap : sprintf( __( 'Denied: %s' ), $cap );
+               }
+       }
+       echo $output;
+?>
+       </td>
+</tr>
+</table>
+<?php endif; ?>
 
 <input type="hidden" name="action" value="update" />
 <input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr($user_id); ?>" />
index f9616a2c850d392e8847de6d430c41f01f95f081..33b819641580af3724e125b82c8e4094ae007de5 100644 (file)
@@ -113,11 +113,10 @@ Please click the following link to confirm the invite:
        } else {
                // Adding a new user to this blog
                $user_details = wpmu_validate_user_signup( $_REQUEST[ 'user_login' ], $_REQUEST[ 'email' ] );
-               unset( $user_details[ 'errors' ]->errors[ 'user_email_used' ] );
                if ( is_wp_error( $user_details[ 'errors' ] ) && !empty( $user_details[ 'errors' ]->errors ) ) {
                        $add_user_errors = $user_details[ 'errors' ];
                } else {
-                       $new_user_login = apply_filters('pre_user_login', sanitize_user(stripslashes($_REQUEST['user_login']), true));
+                       $new_user_login = apply_filters('pre_user_login', sanitize_user(wp_unslash($_REQUEST['user_login']), true));
                        if ( isset( $_POST[ 'noconfirmation' ] ) && is_super_admin() ) {
                                add_filter( 'wpmu_signup_user_notification', '__return_false' ); // Disable confirmation email
                        }
@@ -209,7 +208,7 @@ if ( isset($_GET['update']) ) {
                        case "does_not_exist":
                                $messages[] = __('The requested user does not exist.');
                                break;
-                       case "does_not_exist":
+                       case "enter_email":
                                $messages[] = __('Please enter a valid email address.');
                                break;
                }
@@ -310,7 +309,7 @@ foreach ( array( 'user_login' => 'login', 'first_name' => 'firstname', 'last_nam
        $var = "new_user_$var";
        if( isset( $_POST['createuser'] ) ) {
                if ( ! isset($$var) )
-                       $$var = isset( $_POST[$post_field] ) ? stripslashes( $_POST[$post_field] ) : '';
+                       $$var = isset( $_POST[$post_field] ) ? wp_unslash( $_POST[$post_field] ) : '';
        } else {
                $$var = false;
        }
@@ -341,9 +340,15 @@ foreach ( array( 'user_login' => 'login', 'first_name' => 'firstname', 'last_nam
        </tr>
 <?php if ( apply_filters('show_password_fields', true) ) : ?>
        <tr class="form-field form-required">
-               <th scope="row"><label for="pass1"><?php _e('Password'); ?> <span class="description"><?php /* translators: password input field */_e('(twice, required)'); ?></span></label></th>
-               <td><input name="pass1" type="password" id="pass1" autocomplete="off" />
-               <br />
+               <th scope="row"><label for="pass1"><?php _e('Password'); ?> <span class="description"><?php /* translators: password input field */_e('(required)'); ?></span></label></th>
+               <td>
+                       <input class="hidden" value=" " /><!-- #24364 workaround -->
+                       <input name="pass1" type="password" id="pass1" autocomplete="off" />
+               </td>
+       </tr>
+       <tr class="form-field form-required">
+               <th scope="row"><label for="pass2"><?php _e('Repeat Password'); ?> <span class="description"><?php /* translators: password input field */_e('(required)'); ?></span></label></th>
+               <td>
                <input name="pass2" type="password" id="pass2" autocomplete="off" />
                <br />
                <div id="pass-strength-result"><?php _e('Strength indicator'); ?></div>
index 6ea17657c15d4f3fd748cceafb7238c8211c3b5f..e807487a5791a1ef1443301da5ba0f40f99c3432 100644 (file)
@@ -64,9 +64,9 @@ get_current_screen()->set_help_sidebar(
 );
 
 if ( empty($_REQUEST) ) {
-       $referer = '<input type="hidden" name="wp_http_referer" value="'. esc_attr(stripslashes($_SERVER['REQUEST_URI'])) . '" />';
+       $referer = '<input type="hidden" name="wp_http_referer" value="'. esc_attr( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '" />';
 } elseif ( isset($_REQUEST['wp_http_referer']) ) {
-       $redirect = remove_query_arg(array('wp_http_referer', 'updated', 'delete_count'), stripslashes($_REQUEST['wp_http_referer']));
+       $redirect = remove_query_arg(array('wp_http_referer', 'updated', 'delete_count'), wp_unslash( $_REQUEST['wp_http_referer'] ) );
        $referer = '<input type="hidden" name="wp_http_referer" value="' . esc_attr($redirect) . '" />';
 } else {
        $redirect = 'users.php';
@@ -86,6 +86,9 @@ jQuery(document).ready( function($) {
        $('input[name=delete_option]').one('change', function() {
                submit.prop('disabled', false);
        });
+       $('#reassign_user').focus( function() {
+               $('#delete_option1').prop('checked', true).trigger('change');
+       });
 });
 </script>
 <?php
@@ -354,7 +357,7 @@ break;
 default:
 
        if ( !empty($_GET['_wp_http_referer']) ) {
-               wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI'])));
+               wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce'), wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
                exit;
        }
 
@@ -378,7 +381,7 @@ default:
                case 'add':
                        if ( isset( $_GET['id'] ) && ( $user_id = $_GET['id'] ) && current_user_can( 'edit_user', $user_id ) ) {
                                $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( 'New user created. <a href="%s">Edit user</a>' ),
-                                       esc_url( add_query_arg( 'wp_http_referer', urlencode( stripslashes( $_SERVER['REQUEST_URI'] ) ),
+                                       esc_url( add_query_arg( 'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ),
                                                self_admin_url( 'user-edit.php?user_id=' . $user_id ) ) ) ) . '</p></div>';
                        } else {
                                $messages[] = '<div id="message" class="updated"><p>' . __( 'New user created.' ) . '</p></div>';
index 194e00f54489aac29b19661e83c258ca2c0ffdba..7b4a5e9dc07b7c270047484b7cf7501069383a67 100644 (file)
@@ -57,9 +57,9 @@ $user = wp_get_current_user();
 if ( $user->exists() ) {
        if ( empty( $user->display_name ) )
                $user->display_name=$user->user_login;
-       $comment_author       = $wpdb->escape($user->display_name);
-       $comment_author_email = $wpdb->escape($user->user_email);
-       $comment_author_url   = $wpdb->escape($user->user_url);
+       $comment_author       = wp_slash( $user->display_name );
+       $comment_author_email = wp_slash( $user->user_email );
+       $comment_author_url   = wp_slash( $user->user_url );
        if ( current_user_can('unfiltered_html') ) {
                if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $_POST['_wp_unfiltered_html_comment'] ) {
                        kses_remove_filters(); // start with a clean slate
diff --git a/wp-content/plugins/akismet/.htaccess b/wp-content/plugins/akismet/.htaccess
deleted file mode 100644 (file)
index cfad468..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-Order Deny,Allow
-Deny from all
-
-<FilesMatch "^akismet\.(css|js)$">
-       Allow from all
-</FilesMatch>
-
-#allow access to any image
-<FilesMatch "^(.+)\.(png|gif)$">
-       Allow from all
-</FilesMatch>
\ No newline at end of file
index 481b0f3d50de2dd18068862c605ac6091317369f..f80719169977cd3f11a0b76c564704af050b9f69 100644 (file)
@@ -39,10 +39,10 @@ function akismet_load_js_and_css() {
                'plugins_page_akismet-key-config', 
                'jetpack_page_akismet-key-config',
        ) ) ) {
-               wp_register_style( 'akismet.css', AKISMET_PLUGIN_URL . 'akismet.css', array(), '2.5.4.4' );
+               wp_register_style( 'akismet.css', AKISMET_PLUGIN_URL . 'akismet.css', array(), '2.5.9' );
                wp_enqueue_style( 'akismet.css');
        
-               wp_register_script( 'akismet.js', AKISMET_PLUGIN_URL . 'akismet.js', array('jquery'), '2.5.4.6' );
+               wp_register_script( 'akismet.js', AKISMET_PLUGIN_URL . 'akismet.js', array('jquery'), '2.5.9' );
                wp_enqueue_script( 'akismet.js' );
                wp_localize_script( 'akismet.js', 'WPAkismet', array(
                        'comment_author_url_nonce' => wp_create_nonce( 'comment_author_url_nonce' )
@@ -67,11 +67,14 @@ add_filter( 'plugin_action_links', 'akismet_plugin_action_links', 10, 2 );
 function akismet_conf() {
        global $akismet_nonce, $current_user;
        
-       $new_key_link  = 'https://akismet.com/get/';
-       $api_key       = akismet_get_key();
-       $show_key_form = $api_key;
-       $key_status    = 'empty';
-       $saved_ok      = false;
+       $new_key_link    = 'https://akismet.com/get/';
+       $config_link     = esc_url( add_query_arg( array( 'page' => 'akismet-key-config', 'show' => 'enter-api-key' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'plugins.php' ) ) );
+       $stats_link      = esc_url( add_query_arg( array( 'page' => 'akismet-stats-display' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'index.php' ) ) );
+       $api_key         = akismet_get_key();
+       $show_key_form   = $api_key;
+       $key_status      = 'empty';
+       $saved_ok        = false;
+       $key_status_text = '';
        
        $ms = array();
 
@@ -98,17 +101,17 @@ function akismet_conf() {
                                $ms[] = 'key_empty';
                }  
                else
-                       $key_status = akismet_verify_key( $key );
-
+                       $key_status = akismet_verify_key( $key );               
+               
                if ( $key != $api_key && $key_status == 'valid' ) {
-                       update_option('wordpress_api_key', $key);
                        $ms[] = 'new_key_valid';
+                       update_option('wordpress_api_key', $key);
                }
                elseif ( $key_status == 'invalid' )
                        $ms[] = 'new_key_invalid';
                elseif ( $key_status == 'failed' )
                        $ms[] = 'new_key_failed';
-                       
+
                $api_key = $key_status == 'valid' ? $key : false;
 
                if ( isset( $_POST['akismet_discard_month'] ) )
@@ -130,6 +133,9 @@ function akismet_conf() {
                check_admin_referer( $akismet_nonce );
                akismet_get_server_connectivity(0);
        }
+       elseif ( isset( $_GET['show'] ) && $_GET['show'] == 'enter-api-key' ) {
+               $show_key_form = true;
+       }
        
        if ( $show_key_form ) {
                //check current key status
@@ -154,7 +160,14 @@ function akismet_conf() {
                        elseif ( !empty( $key ) && $key_status == 'failed' )
                                $ms[] = 'key_failed';
                }
-       }
+       }       
+               
+       $key_status_strings = array( 
+               'empty'   => __( 'Empty' ), 
+               'valid'   => __( 'Valid' ), 
+               'invalid' => __( 'Invalid' ), 
+               'failed'  => __( 'Failed' ), 
+       );
 
        $messages = array(
                'new_key_empty'   => array( 'class' => 'updated fade', 'text' => __('Your key has been cleared.' ) ),
@@ -174,7 +187,7 @@ function akismet_conf() {
        <?php if ( !$api_key ) : ?>
        <h2 class="ak-header"><?php _e('Akismet'); ?></h2>
        <?php else: ?>
-       <h2 class="ak-header"><?php printf( __( 'Akismet <a href="%s" class="add-new-h2">Stats</a>' ), esc_url( add_query_arg( array( 'page' => 'akismet-stats-display' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'index.php' ) ) ) ); ?></h2>
+       <h2 class="ak-header"><?php printf( __( 'Akismet <a href="%s" class="add-new-h2">Stats</a>' ), $stats_link ); ?></h2>
        <?php endif; ?>
        <div class="no-key <?php echo $show_key_form ? 'hidden' : '';?>">
                <p><?php _e('Akismet eliminates the comment and trackback spam you get on your site. To use Akismet you may need to sign up for an API key. Click the button below to get started.'); ?></p>
@@ -182,10 +195,10 @@ function akismet_conf() {
                        <input type="hidden" name="return" value="1"/> 
                        <input type="hidden" name="jetpack" value="<?php echo (string) class_exists( 'Jetpack' );?>"/>
                        <input type="hidden" name="user" value="<?php echo esc_attr( $current_user->user_login );?>"/>
-                       <input type="submit" class="button button-primary" value="<?php echo esc_attr( __('Create a new Akismet Key') ); ?>"/>
+                       <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Create a new Akismet Key' ); ?>"/>
                </form>
                <br/>
-               <a href="#" class="switch-have-key"><?php _e('I already have a key'); ?></a>
+               <a href="<?php echo $config_link;?>"><?php _e('I already have a key'); ?></a>
        </div>
        <div class="have-key <?php echo $show_key_form ? '' : 'hidden';?>">
                <?php if ( !empty($_POST['submit'] ) && $saved_ok ) : ?>
@@ -203,7 +216,7 @@ function akismet_conf() {
                                        <tr>
                                                <th><label for="key"><?php _e('Akismet API Key');?></label></th>
                                                <td>
-                                                       <input id="key" name="key" type="text" size="15" maxlength="12" value="<?php echo esc_html( get_option('wordpress_api_key') ); ?>" class="regular-text code <?php echo $key_status;?>"><div class="under-input key-status <?php echo $key_status;?>"><?php echo ucfirst( $key_status );?></div>
+                                                       <input id="key" name="key" type="text" size="15" maxlength="12" value="<?php echo esc_attr( get_option('wordpress_api_key') ); ?>" class="regular-text code <?php echo $key_status;?>"><div class="under-input key-status <?php echo $key_status;?>"><?php echo isset( $key_status_strings[ $key_status ] ) ? $key_status_strings[ $key_status ] : '';?></div>
                                                        <p class="need-key description"><?php printf( __('You must enter a valid Akismet API key here. If you need an API key, you can <a href="%s">create one here</a>'), '#' );?></p>
                                                </td>
                                        </tr>
@@ -212,8 +225,8 @@ function akismet_conf() {
                                                <th scope="row"><?php _e('Settings');?></th>
                                                <td>
                                                        <fieldset><legend class="screen-reader-text"><span><?php _e('Settings');?></span></legend>
-                                                       <label for="akismet_discard_month" title="<?php echo esc_attr( __( 'Auto-detete old spam' ) ); ?>"><input name="akismet_discard_month" id="akismet_discard_month" value="true" type="checkbox" <?php echo get_option('akismet_discard_month') == 'true' ? 'checked="checked"':''; ?>> <span><?php _e('Auto-delete spam submitted on posts more than a month old.'); ?></span></label><br>
-                                                       <label for="akismet_show_user_comments_approved" title="<?php echo esc_attr( __( 'Show approved comments' ) ); ?>"><input name="akismet_show_user_comments_approved" id="akismet_show_user_comments_approved" value="true" type="checkbox" <?php echo get_option('akismet_show_user_comments_approved') == 'true' ? 'checked="checked"':''; ?>> <span><?php _e('Show the number of comments you\'ve approved beside each comment author.'); ?></span></label>
+                                                       <label for="akismet_discard_month" title="<?php esc_attr_e( 'Auto-detete old spam' ); ?>"><input name="akismet_discard_month" id="akismet_discard_month" value="true" type="checkbox" <?php echo get_option('akismet_discard_month') == 'true' ? 'checked="checked"':''; ?>> <span><?php _e('Auto-delete spam submitted on posts more than a month old.'); ?></span></label><br>
+                                                       <label for="akismet_show_user_comments_approved" title="<?php esc_attr_e( 'Show approved comments' ); ?>"><input name="akismet_show_user_comments_approved" id="akismet_show_user_comments_approved" value="true" type="checkbox" <?php echo get_option('akismet_show_user_comments_approved') == 'true' ? 'checked="checked"':''; ?>> <span><?php _e('Show the number of comments you\'ve approved beside each comment author.'); ?></span></label>
                                                        </fieldset>
                                                </td>
                                        </tr>
@@ -301,12 +314,13 @@ function akismet_conf() {
 function akismet_stats_display() {
        global $akismet_api_host, $akismet_api_port;
        
-       $blog    = urlencode( get_bloginfo('url') );
-       $api_key = akismet_get_key();?>
+       $blog        = urlencode( get_bloginfo('url') );
+       $api_key     = akismet_get_key();
+       $config_link = esc_url( add_query_arg( array( 'page' => 'akismet-key-config' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'plugins.php' ) ) );?>
        
 <div class="wrap"><?php        
        if ( !$api_key ) :?>
-       <div id="akismet-warning" class="updated fade"><p><strong><?php _e('Akismet is almost ready.');?></strong> <?php printf( __( 'You must <a href="%1$s">enter your Akismet API key</a> for it to work.' ), esc_url( add_query_arg( array( 'page' => 'akismet-key-config' ), admin_url( 'admin.php' ) ) ) );?></p></div><?php
+       <div id="akismet-warning" class="updated fade"><p><strong><?php _e('Akismet is almost ready.');?></strong> <?php printf( __( 'You must <a href="%1$s">enter your Akismet API key</a> for it to work.' ), $config_link );?></p></div><?php
        else :?>
        <iframe src="<?php echo esc_url( sprintf( '%s://akismet.com/web/1.0/user-stats.php?blog=%s&api_key=%s', is_ssl()?'https':'http', $blog, $api_key ) ); ?>" width="100%" height="2500px" frameborder="0" id="akismet-stats-frame"></iframe><?php
        endif;?>
@@ -368,7 +382,7 @@ function akismet_admin_warnings() {
                                        <style type="text/css">  
 .akismet_activate{min-width:825px;border:1px solid #4F800D;padding:5px;margin:15px 0;background:#83AF24;background-image:-webkit-gradient(linear,0% 0,80% 100%,from(#83AF24),to(#4F800D));background-image:-moz-linear-gradient(80% 100% 120deg,#4F800D,#83AF24);-moz-border-radius:3px;border-radius:3px;-webkit-border-radius:3px;position:relative;overflow:hidden}.akismet_activate .aa_a{position:absolute;top:-5px;right:10px;font-size:140px;color:#769F33;font-family:Georgia, "Times New Roman", Times, serif;z-index:1}.akismet_activate .aa_button{font-weight:bold;border:1px solid #029DD6;border-top:1px solid #06B9FD;font-size:15px;text-align:center;padding:9px 0 8px 0;color:#FFF;background:#029DD6;background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#029DD6),to(#0079B1));background-image:-moz-linear-gradient(0% 100% 90deg,#0079B1,#029DD6);-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px}.akismet_activate .aa_button:hover{text-decoration:none !important;border:1px solid #029DD6;border-bottom:1px solid #00A8EF;font-size:15px;text-align:center;padding:9px 0 8px 0;color:#F0F8FB;background:#0079B1;background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#0079B1),to(#0092BF));background-image:-moz-linear-gradient(0% 100% 90deg,#0092BF,#0079B1);-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px}.akismet_activate .aa_button_border{border:1px solid #006699;-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px;background:#029DD6;background-image:-webkit-gradient(linear,0% 0,0% 100%,from(#029DD6),to(#0079B1));background-image:-moz-linear-gradient(0% 100% 90deg,#0079B1,#029DD6)}.akismet_activate .aa_button_container{cursor:pointer;display:inline-block;background:#DEF1B8;padding:5px;-moz-border-radius:2px;border-radius:2px;-webkit-border-radius:2px;width:266px}.akismet_activate .aa_description{position:absolute;top:22px;left:285px;margin-left:25px;color:#E5F2B1;font-size:15px;z-index:1000}.akismet_activate .aa_description strong{color:#FFF;font-weight:normal}
                                        </style>                       
-                                       <form name="akismet_activate" action="https://akismet.com/get/" method="POST"> 
+                                       <form name="akismet_activate" action="'.esc_url( add_query_arg( array( 'page' => 'akismet-key-config' ), class_exists( 'Jetpack' ) ? admin_url( 'admin.php' ) : admin_url( 'plugins.php' ) ) ).'" method="POST"> 
                                                <input type="hidden" name="return" value="1"/>
                                                <input type="hidden" name="jetpack" value="'.(string) class_exists( 'Jetpack' ).'"/>
                                                <input type="hidden" name="user" value="'.esc_attr( $current_user->user_login ).'"/>
@@ -376,10 +390,10 @@ function akismet_admin_warnings() {
                                                        <div class="aa_a">A</div>     
                                                        <div class="aa_button_container" onclick="document.akismet_activate.submit();">  
                                                                <div class="aa_button_border">          
-                                                                       <div class="aa_button">Activate your Akismet account</div>  
+                                                                       <div class="aa_button">'.__('Activate your Akismet account').'</div>  
                                                                </div>  
                                                        </div>  
-                                                       <div class="aa_description"><strong>Almost done</strong> - activate your account and say goodbye to comment spam.</div>  
+                                                       <div class="aa_description">'.__('<strong>Almost done</strong> - activate your account and say goodbye to comment spam').'</div>  
                                                </div>  
                                        </form>  
                                </div>  
index 15a1b2c2e56cb4f57c62b9b016e0d45cbde53e15..919ea0e7596b3677a8438c006e4b2db4ce7f9fcb 100644 (file)
@@ -6,7 +6,7 @@
 Plugin Name: Akismet
 Plugin URI: http://akismet.com/?return=true
 Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from comment and trackback spam</strong>. It keeps your site protected from spam even while you sleep. To get started: 1) Click the "Activate" link to the left of this description, 2) <a href="http://akismet.com/get/?return=true">Sign up for an Akismet API key</a>, and 3) Go to your Akismet configuration page, and save your API key.
-Version: 2.5.8
+Version: 2.5.9
 Author: Automattic
 Author URI: http://automattic.com/wordpress-plugins/
 License: GPLv2 or later
@@ -34,7 +34,7 @@ if ( !function_exists( 'add_action' ) ) {
        exit;
 }
 
-define('AKISMET_VERSION', '2.5.8');
+define('AKISMET_VERSION', '2.5.9');
 define('AKISMET_PLUGIN_URL', plugin_dir_url( __FILE__ ));
 
 /** If you hardcode a WP.com API key here, all key config screens will be hidden */
diff --git a/wp-content/plugins/akismet/img/logo.png b/wp-content/plugins/akismet/img/logo.png
new file mode 100644 (file)
index 0000000..b5f5b9a
Binary files /dev/null and b/wp-content/plugins/akismet/img/logo.png differ
diff --git a/wp-content/plugins/akismet/img/logo@2x.png b/wp-content/plugins/akismet/img/logo@2x.png
new file mode 100644 (file)
index 0000000..80c835b
Binary files /dev/null and b/wp-content/plugins/akismet/img/logo@2x.png differ
index 597749e7ec82a9b5d9950c0202c328c4f7d06a91..d0094d2029c0e57b6b067b65cae2bfe351691a24 100644 (file)
@@ -3,7 +3,7 @@ Contributors: matt, ryan, andy, mdawaffe, tellyworth, josephscott, lessbloat, eo
 Tags: akismet, comments, spam
 Requires at least: 3.0
 Tested up to: 3.6
-Stable tag: 2.5.8
+Stable tag: 2.5.9
 License: GPLv2 or later
 
 Akismet checks your comments against the Akismet web service to see if they look like spam or not.
@@ -31,6 +31,11 @@ Upload the Akismet plugin to your blog, Activate it, then enter your [Akismet.co
 
 == Changelog ==
 
+= 2.5.9 =
+* Update 'Already have a key' link to redirect page rather than depend on javascript
+* Fix some non-translatable strings to be translatable
+* Update Activation banner in plugins page to redirect user to Akismet config page
+
 = 2.5.8 =
 * Simplify the activation process for new users
 * Remove the reporter_ip parameter
index d2287e2425b7bfacf9a870c3ee485d8f214e8fa1..2b1e07b59e8374eaac9f4fbb6a33176e1d18b263 100644 (file)
@@ -5,7 +5,7 @@
  */
 /*
 Plugin Name: Hello Dolly
-Plugin URI: http://wordpress.org/extend/plugins/hello-dolly/
+Plugin URI: http://wordpress.org/plugins/hello-dolly/
 Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page.
 Author: Matt Mullenweg
 Version: 1.6
diff --git a/wp-content/themes/twentyeleven/404.php b/wp-content/themes/twentyeleven/404.php
deleted file mode 100644 (file)
index 03e0651..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php
-/**
- * The template for displaying 404 pages (Not Found).
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-
-get_header(); ?>
-
-       <div id="primary">
-               <div id="content" role="main">
-
-                       <article id="post-0" class="post error404 not-found">
-                               <header class="entry-header">
-                                       <h1 class="entry-title"><?php _e( 'This is somewhat embarrassing, isn&rsquo;t it?', 'twentyeleven' ); ?></h1>
-                               </header>
-
-                               <div class="entry-content">
-                                       <p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching, or one of the links below, can help.', 'twentyeleven' ); ?></p>
-
-                                       <?php get_search_form(); ?>
-
-                                       <?php the_widget( 'WP_Widget_Recent_Posts', array( 'number' => 10 ), array( 'widget_id' => '404' ) ); ?>
-
-                                       <div class="widget">
-                                               <h2 class="widgettitle"><?php _e( 'Most Used Categories', 'twentyeleven' ); ?></h2>
-                                               <ul>
-                                               <?php wp_list_categories( array( 'orderby' => 'count', 'order' => 'DESC', 'show_count' => 1, 'title_li' => '', 'number' => 10 ) ); ?>
-                                               </ul>
-                                       </div>
-
-                                       <?php
-                                       /* translators: %1$s: smilie */
-                                       $archive_content = '<p>' . sprintf( __( 'Try looking in the monthly archives. %1$s', 'twentyeleven' ), convert_smilies( ':)' ) ) . '</p>';
-                                       the_widget( 'WP_Widget_Archives', array('count' => 0 , 'dropdown' => 1 ), array( 'after_title' => '</h2>'.$archive_content ) );
-                                       ?>
-
-                                       <?php the_widget( 'WP_Widget_Tag_Cloud' ); ?>
-
-                               </div><!-- .entry-content -->
-                       </article><!-- #post-0 -->
-
-               </div><!-- #content -->
-       </div><!-- #primary -->
-
-<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/archive.php b/wp-content/themes/twentyeleven/archive.php
deleted file mode 100644 (file)
index 13390e2..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-<?php
-/**
- * The template for displaying Archive pages.
- *
- * Used to display archive-type pages if nothing more specific matches a query.
- * For example, puts together date-based pages if no date.php file exists.
- *
- * Learn more: http://codex.wordpress.org/Template_Hierarchy
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-
-get_header(); ?>
-
-               <section id="primary">
-                       <div id="content" role="main">
-
-                       <?php if ( have_posts() ) : ?>
-
-                               <header class="page-header">
-                                       <h1 class="page-title">
-                                               <?php if ( is_day() ) : ?>
-                                                       <?php printf( __( 'Daily Archives: %s', 'twentyeleven' ), '<span>' . get_the_date() . '</span>' ); ?>
-                                               <?php elseif ( is_month() ) : ?>
-                                                       <?php printf( __( 'Monthly Archives: %s', 'twentyeleven' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyeleven' ) ) . '</span>' ); ?>
-                                               <?php elseif ( is_year() ) : ?>
-                                                       <?php printf( __( 'Yearly Archives: %s', 'twentyeleven' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentyeleven' ) ) . '</span>' ); ?>
-                                               <?php else : ?>
-                                                       <?php _e( 'Blog Archives', 'twentyeleven' ); ?>
-                                               <?php endif; ?>
-                                       </h1>
-                               </header>
-
-                               <?php twentyeleven_content_nav( 'nav-above' ); ?>
-
-                               <?php /* Start the Loop */ ?>
-                               <?php while ( have_posts() ) : the_post(); ?>
-
-                                       <?php
-                                               /* Include the Post-Format-specific template for the content.
-                                                * If you want to overload this in a child theme then include a file
-                                                * called content-___.php (where ___ is the Post Format name) and that will be used instead.
-                                                */
-                                               get_template_part( 'content', get_post_format() );
-                                       ?>
-
-                               <?php endwhile; ?>
-
-                               <?php twentyeleven_content_nav( 'nav-below' ); ?>
-
-                       <?php else : ?>
-
-                               <article id="post-0" class="post no-results not-found">
-                                       <header class="entry-header">
-                                               <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
-                                       </header><!-- .entry-header -->
-
-                                       <div class="entry-content">
-                                               <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
-                                               <?php get_search_form(); ?>
-                                       </div><!-- .entry-content -->
-                               </article><!-- #post-0 -->
-
-                       <?php endif; ?>
-
-                       </div><!-- #content -->
-               </section><!-- #primary -->
-
-<?php get_sidebar(); ?>
-<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/author.php b/wp-content/themes/twentyeleven/author.php
deleted file mode 100644 (file)
index 472cb13..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-<?php
-/**
- * The template for displaying Author Archive pages.
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-
-get_header(); ?>
-
-               <section id="primary">
-                       <div id="content" role="main">
-
-                       <?php if ( have_posts() ) : ?>
-
-                               <?php
-                                       /* Queue the first post, that way we know
-                                        * what author we're dealing with (if that is the case).
-                                        *
-                                        * We reset this later so we can run the loop
-                                        * properly with a call to rewind_posts().
-                                        */
-                                       the_post();
-                               ?>
-
-                               <header class="page-header">
-                                       <h1 class="page-title author"><?php printf( __( 'Author Archives: %s', 'twentyeleven' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( "ID" ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); ?></h1>
-                               </header>
-
-                               <?php
-                                       /* Since we called the_post() above, we need to
-                                        * rewind the loop back to the beginning that way
-                                        * we can run the loop properly, in full.
-                                        */
-                                       rewind_posts();
-                               ?>
-
-                               <?php twentyeleven_content_nav( 'nav-above' ); ?>
-
-                               <?php
-                               // If a user has filled out their description, show a bio on their entries.
-                               if ( get_the_author_meta( 'description' ) ) : ?>
-                               <div id="author-info">
-                                       <div id="author-avatar">
-                                               <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 60 ) ); ?>
-                                       </div><!-- #author-avatar -->
-                                       <div id="author-description">
-                                               <h2><?php printf( __( 'About %s', 'twentyeleven' ), get_the_author() ); ?></h2>
-                                               <?php the_author_meta( 'description' ); ?>
-                                       </div><!-- #author-description  -->
-                               </div><!-- #author-info -->
-                               <?php endif; ?>
-
-                               <?php /* Start the Loop */ ?>
-                               <?php while ( have_posts() ) : the_post(); ?>
-
-                                       <?php
-                                               /* Include the Post-Format-specific template for the content.
-                                                * If you want to overload this in a child theme then include a file
-                                                * called content-___.php (where ___ is the Post Format name) and that will be used instead.
-                                                */
-                                               get_template_part( 'content', get_post_format() );
-                                       ?>
-
-                               <?php endwhile; ?>
-
-                               <?php twentyeleven_content_nav( 'nav-below' ); ?>
-
-                       <?php else : ?>
-
-                               <article id="post-0" class="post no-results not-found">
-                                       <header class="entry-header">
-                                               <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
-                                       </header><!-- .entry-header -->
-
-                                       <div class="entry-content">
-                                               <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
-                                               <?php get_search_form(); ?>
-                                       </div><!-- .entry-content -->
-                               </article><!-- #post-0 -->
-
-                       <?php endif; ?>
-
-                       </div><!-- #content -->
-               </section><!-- #primary -->
-
-<?php get_sidebar(); ?>
-<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/category.php b/wp-content/themes/twentyeleven/category.php
deleted file mode 100644 (file)
index 539cbbd..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-/**
- * The template for displaying Category Archive pages.
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-
-get_header(); ?>
-
-               <section id="primary">
-                       <div id="content" role="main">
-
-                       <?php if ( have_posts() ) : ?>
-
-                               <header class="page-header">
-                                       <h1 class="page-title"><?php
-                                               printf( __( 'Category Archives: %s', 'twentyeleven' ), '<span>' . single_cat_title( '', false ) . '</span>' );
-                                       ?></h1>
-
-                                       <?php
-                                               $category_description = category_description();
-                                               if ( ! empty( $category_description ) )
-                                                       echo apply_filters( 'category_archive_meta', '<div class="category-archive-meta">' . $category_description . '</div>' );
-                                       ?>
-                               </header>
-
-                               <?php twentyeleven_content_nav( 'nav-above' ); ?>
-
-                               <?php /* Start the Loop */ ?>
-                               <?php while ( have_posts() ) : the_post(); ?>
-
-                                       <?php
-                                               /* Include the Post-Format-specific template for the content.
-                                                * If you want to overload this in a child theme then include a file
-                                                * called content-___.php (where ___ is the Post Format name) and that will be used instead.
-                                                */
-                                               get_template_part( 'content', get_post_format() );
-                                       ?>
-
-                               <?php endwhile; ?>
-
-                               <?php twentyeleven_content_nav( 'nav-below' ); ?>
-
-                       <?php else : ?>
-
-                               <article id="post-0" class="post no-results not-found">
-                                       <header class="entry-header">
-                                               <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
-                                       </header><!-- .entry-header -->
-
-                                       <div class="entry-content">
-                                               <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
-                                               <?php get_search_form(); ?>
-                                       </div><!-- .entry-content -->
-                               </article><!-- #post-0 -->
-
-                       <?php endif; ?>
-
-                       </div><!-- #content -->
-               </section><!-- #primary -->
-
-<?php get_sidebar(); ?>
-<?php get_footer(); ?>
diff --git a/wp-content/themes/twentyeleven/colors/dark.css b/wp-content/themes/twentyeleven/colors/dark.css
deleted file mode 100644 (file)
index 63b809f..0000000
+++ /dev/null
@@ -1,623 +0,0 @@
-/*
-       A dark color scheme for Twenty Eleven
-*/
-
-/* =Global
------------------------------------------------ */
-
-body {
-       background: #1d1d1d;
-       color: #bbb;
-}
-#page {
-       background: #0f0f0f;
-}
-
-/* Headings */
-hr {
-       background-color: #333;
-}
-
-/* Text elements */
-blockquote cite {
-       color: #999;
-}
-pre {
-       background: #0b0b0b;
-}
-code, kbd {
-       font: 13px Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
-}
-abbr, acronym, dfn {
-       border-bottom: 1px dotted #999;
-}
-ins {
-       background: #00063f;
-}
-input[type=text],
-input[type=password],
-input[type=email],
-input[type=url],
-input[type=number],
-textarea {
-       border: 1px solid #222;
-}
-input#s {
-       background-color: #ddd;
-}
-
-/* Links */
-a {
-}
-
-
-/* =Header
------------------------------------------------ */
-
-#branding {
-       border-top: 2px solid #0a0a0a;
-}
-#site-title a {
-       color: #eee;
-}
-#site-title a:hover,
-#site-title a:focus,
-#site-title a:active {
-}
-#site-description {
-       color: #858585;
-}
-#branding #s {
-       background-color: #ddd;
-}
-
-
-/* =Menu
------------------------------------------------ */
-
-#access {
-       background: #333; /* Show a solid color for older browsers */
-       background: -moz-linear-gradient(#383838, #272727);
-       background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#383838), to(#272727)); /* older webkit syntax */
-       background: -webkit-linear-gradient(#383838, #272727);
-       border-bottom: 1px solid #222;
-}
-
-/* =Content
------------------------------------------------ */
-
-.page-title {
-       color: #ccc;
-}
-.hentry {
-       border-color: #222;
-}
-.entry-title {
-       color: #ddd;
-}
-.entry-title,
-.entry-title a {
-       color: #ddd;
-}
-.entry-title a:hover,
-.entry-title a:focus,
-.entry-title a:active {
-}
-.entry-meta {
-       color: #999;
-}
-.entry-content h1,
-.entry-content h2,
-.comment-content h1,
-.comment-content h2 {
-       color: #fff;
-}
-.entry-content table,
-.comment-content table {
-       border-color: #222;
-}
-.entry-content th,
-.comment-content th {
-       color: #999;
-}
-.entry-content td,
-.comment-content td {
-       border-color: #222;
-}
-.page-link {
-}
-.page-link a {
-       background: #242424;
-       color: #bbb;
-}
-.page-link a:hover {
-       background: #999;
-       color: #000;
-}
-.entry-meta .edit-link a {
-       background: #242424;
-       color: #bbb;
-}
-.entry-meta .edit-link a:hover,
-.entry-meta .edit-link a:focus,
-.entry-meta .edit-link a:active {
-       background: #999;
-       color: #000;
-}
-
-/* Images */
-.wp-caption {
-       background: #2c2c2c;
-}
-.wp-caption .wp-caption-text {
-       color: #999;
-}
-.wp-caption .wp-caption-text:before {
-       color: #999;
-}
-
-/* Image borders */
-img[class*="wp-image-"],
-#content .gallery .gallery-icon img {
-       border-color: #2c2c2c;
-}
-.wp-caption img {
-       border-color: #2c2c2c;
-}
-a:focus img[class*="wp-image-"],
-a:hover img[class*="wp-image-"],
-a:active img[class*="wp-image-"] {
-       background: #2c2c2c;
-       border-color: #444;
-}
-.wp-caption a:focus img,
-.wp-caption a:active img,
-.wp-caption a:hover img {
-       background: #0f0f0f;
-       border-color: #2c2c2c;
-}
-
-/* Password Protected Posts */
-.post-password-required input[type=password] {
-       background: #ddd;
-}
-.post-password-required input[type=password]:focus {
-       background: #fff;
-}
-
-/* Author Info */
-.singular #author-info {
-       background: #060606;
-       border-color: #222;
-}
-.archive #author-info {
-       border-color: #222;
-}
-#author-avatar img {
-       background: #000;
-       -webkit-box-shadow: 0 1px 2px #444;
-       -moz-box-shadow: 0 1px 2px #444;
-       box-shadow: 0 1px 2px #444;
-}
-#author-description h2 {
-       color: #fff;
-}
-
-/* Comments link */
-.entry-header .comments-link a {
-       background: #282828 url(../images/comment-bubble-dark.png) no-repeat;
-       border-color: #222;
-       color: #888;
-}
-
-.rtl .entry-header .comments-link a {
-       background-image: url(../images/comment-bubble-dark-rtl.png);
-}
-/* Singular content styles for Posts and Pages */
-.singular .entry-title {
-       color: #fff;
-}
-
-
-/* =Status
------------------------------------------------ */
-
-.format-status img.avatar {
-       -webkit-box-shadow: 0 1px 2px #333;
-       -moz-box-shadow: 0 1px 2px #333;
-       box-shadow: 0 1px 2px #333;
-}
-
-
-/* =Quote
------------------------------------------------ */
-
-.format-quote blockquote {
-       color: #aaa;
-}
-
-
-/* =Image
------------------------------------------------ */
-
-.indexed.format-image .wp-caption {
-       background: #242424;
-}
-.indexed.format-image .entry-meta .edit-link a {
-       color: #ddd;
-}
-.indexed.format-image .entry-meta .edit-link a:hover {
-       color: #fff;
-}
-
-
-/* =error404
------------------------------------------------ */
-.error404 #main #searchform {
-       background: #060606;
-       border-color: #222;
-}
-
-
-/* =Showcase
------------------------------------------------ */
-
-h1.showcase-heading {
-       color: #ccc;
-}
-
-/* Intro */
-article.intro {
-       background: #060606;
-}
-article.intro .entry-content {
-       color: #eee;
-}
-article.intro .edit-link a {
-       background: #555;
-       color: #000;
-}
-article.intro .edit-link a:hover {
-       background: #888;
-}
-
-/* Featured post */
-section.featured-post .hentry {
-       color: #999;
-}
-
-/* Small featured post */
-section.featured-post .attachment-small-feature {
-       border-color: #444;
-}
-section.featured-post .attachment-small-feature:hover {
-       border-color: #777;
-}
-article.feature-image.small .entry-summary {
-       color: #aaa;
-}
-article.feature-image.small .entry-summary p a {
-       background: #ddd;
-       color: #111;
-}
-article.feature-image.small .entry-summary p a:hover {
-       color: #40220c;
-}
-
-/* Large featured post */
-article.feature-image.large .entry-title a {
-       background: #ddd;
-       background: rgba(0,0,0,0.8);
-       color: #fff;
-}
-section.feature-image.large:hover .entry-title a,
-section.feature-image.large .entry-title:hover a {
-       background: #111;
-       background: rgba(255,255,255,0.8);
-       color: #000;
-}
-section.feature-image.large img {
-       border-bottom: 1px solid #222;
-}
-
-/* Featured Slider */
-.featured-posts {
-       border-color: #222;
-}
-.featured-posts section.featured-post {
-       background: #000;
-}
-.featured-post .feature-text:after,
-.featured-post .feature-image.small:after {
-       background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%); /* FF3.6+ */
-       background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,1))); /* Chrome,Safari4+ */
-       background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* Chrome10+,Safari5.1+ */
-       background: -o-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* Opera11.10+ */
-       background: -ms-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* IE10+ */
-       filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#000000',GradientType=0 ); /* IE6-9 */
-       background: linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* W3C */
-}
-.feature-slider a {
-       background: #c3c3c3;
-       background: rgba(60,60,60,0.9);
-       -webkit-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5);
-       -moz-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5);
-       box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5);
-}
-.feature-slider a.active {
-       background: #000;
-       background: rgba(255,255,255,0.8);
-       -webkit-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8);
-       -moz-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8);
-       box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8);
-}
-
-/* Recent Posts */
-section.recent-posts .other-recent-posts {
-       border-color: #222;
-}
-section.recent-posts .other-recent-posts .entry-title {
-       border-color: #222;
-}
-section.recent-posts .other-recent-posts a[rel="bookmark"] {
-       color: #ccc;
-}
-section.recent-posts .other-recent-posts a[rel="bookmark"]:hover {
-}
-section.recent-posts .other-recent-posts .comments-link a,
-section.recent-posts .other-recent-posts .comments-link > span {
-       border-color: #959595;
-       color: #bbb;
-}
-section.recent-posts .other-recent-posts .comments-link > span {
-       border-color: #444;
-       color: #777;
-}
-section.recent-posts .other-recent-posts .comments-link a:hover {
-}
-
-
-/* =Attachments
------------------------------------------------ */
-
-.image-attachment div.attachment {
-       background: #060606;
-       border-color: #222;
-}
-.image-attachment div.attachment a img {
-       border-color: #060606;
-}
-.image-attachment div.attachment a:focus img,
-.image-attachment div.attachment a:hover img,
-.image-attachment div.attachment a:active img {
-       border-color: #2c2c2c;
-       background: #0f0f0f;
-}
-
-
-/* =Widgets
------------------------------------------------ */
-
-.widget-title {
-       color: #ccc;
-}
-.widget ul li {
-       color: #888;
-}
-
-/* Search Widget */
-.widget_search #searchsubmit {
-       background: #222;
-       border-color: #333;
-       -webkit-box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09);
-       -moz-box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09);
-       box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09);
-       color: #777;
-}
-.widget_search #searchsubmit:active {
-       -webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1);
-       -moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1);
-       box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1);
-       color: #40220c;
-}
-
-/* Calendar Widget */
-.widget_calendar #wp-calendar {
-       color: #aaa;
-}
-.widget_calendar #wp-calendar th {
-       background: #0b0b0b;
-       border-color: #333;
-}
-.widget_calendar #wp-calendar tfoot td {
-       background: #0b0b0b;
-       border-color: #333;
-}
-
-
-/* =Comments
------------------------------------------------ */
-
-#comments-title {
-       color: #bbb;
-}
-.nocomments {
-       color: #555;
-}
-.commentlist > li.comment {
-       background: #090909;
-       border-color: #222;
-}
-.commentlist .children li.comment {
-       background: #000;
-       border-color: #222;
-}
-.rtl .commentlist .children li.comment {
-       border-color: #222;
-}
-.comment-meta {
-       color: #999;
-}
-.commentlist .avatar {
-       -webkit-box-shadow: 0 1px 2px #222;
-       -moz-box-shadow: 0 1px 2px #222;
-       box-shadow: 0 1px 2px #222;
-}
-a.comment-reply-link {
-       background: #242424;
-       color: #bbb;
-}
-li.bypostauthor a.comment-reply-link {
-       background: #111;
-}
-a.comment-reply-link:hover,
-a.comment-reply-link:focus,
-a.comment-reply-link:active,
-li.bypostauthor a.comment-reply-link:hover,
-li.bypostauthor a.comment-reply-link:focus,
-li.bypostauthor a.comment-reply-link:active {
-       background: #999;
-       color: #000;
-}
-.commentlist > li:before {
-       content: url(../images/comment-arrow-dark.png);
-}
-.rtl .commentlist > li:before {
-       content: url(../images/comment-arrow-dark-rtl.png);
-}
-
-/* Post author highlighting */
-.commentlist > li.bypostauthor {
-       background: #222;
-       border-color: #2c2c2c;
-}
-.commentlist > li.bypostauthor:before {
-       content: url(../images/comment-arrow-bypostauthor-dark.png);
-}
-.rtl .commentlist > li.bypostauthor:before {
-       content: url(../images/comment-arrow-bypostauthor-dark-rtl.png);
-}
-
-/* Post Author threaded comments */
-.commentlist .children > li.bypostauthor {
-       background: #222;
-       border-color: #2c2c2c;
-}
-.commentlist > li.bypostauthor .comment-meta {
-       color: #a8a8a8;
-}
-
-/* Comment Form */
-#respond {
-       background: #222;
-       border-color: #2c2c2c;
-}
-#respond input[type="text"],
-#respond textarea {
-       background: #000;
-       border: 4px solid #111;
-       -webkit-box-shadow: inset 0 1px 3px rgba(51,51,51,0.95);
-       -moz-box-shadow: inset 0 1px 3px rgba(51,51,51,0.95);
-       box-shadow: inset 0 1px 3px rgba(51,51,51,0.95);
-       color: #bbb;
-}
-#respond .comment-form-author label,
-#respond .comment-form-email label,
-#respond .comment-form-url label,
-#respond .comment-form-comment label {
-       background: #111;
-       -webkit-box-shadow: 1px 2px 2px rgba(51,51,51,0.8);
-       -moz-box-shadow: 1px 2px 2px rgba(51,51,51,0.8);
-       box-shadow: 1px 1px 2px rgba(51,51,51,0.8);
-       color: #aaa;
-}
-.rtl #respond .comment-form-author label,
-.rtl #respond .comment-form-email label,
-.rtl #respond .comment-form-url label,
-.rtl #respond .comment-form-comment label {
-       -webkit-box-shadow: -1px 2px 2px rgba(51,51,51,0.8);
-       -moz-box-shadow: -1px 2px 2px rgba(51,51,51,0.8);
-       box-shadow: -1px 1px 2px rgba(51,51,51,0.8);
-}
-#respond .comment-form-author .required,
-#respond .comment-form-email .required {
-       color: #42caff;
-}
-#respond input#submit {
-       background: #ddd;
-       -webkit-box-shadow: 0px 1px 2px rgba(0,0,0,0.3);
-       -moz-box-shadow: 0px 1px 2px rgba(0,0,0,0.3);
-       box-shadow: 0px 1px 2px rgba(0,0,0,0.3);
-       color: #111;
-       text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
-}
-#respond input#submit:active {
-       color: #40220c;
-}
-#respond #cancel-comment-reply-link {
-       color: #999;
-}
-#reply-title {
-       color: #ccc;
-}
-#cancel-comment-reply-link {
-       color: #777;
-}
-#cancel-comment-reply-link:focus,
-#cancel-comment-reply-link:active,
-#cancel-comment-reply-link:hover {
-       color: #00b4cc;
-}
-
-
-/* =Footer
------------------------------------------------ */
-
-#supplementary {
-       border-color: #222;
-}
-
-/* Site Generator Line */
-#site-generator {
-       background: #060606;
-       border-color: #000;
-}
-
-
-/* =Print
------------------------------------------------ */
-
-@media print {
-       body {
-               color: #333;
-               background: none !important;
-       }
-       #page {
-               background: none !important;
-       }
-
-       /* Comments */
-       .commentlist > li.comment {
-       }
-
-       /* Post author highlighting */
-       .commentlist > li.bypostauthor {
-               color: #333;
-       }
-       .commentlist > li.bypostauthor .comment-meta {
-               color: #959595;
-       }
-       .commentlist > li:before {
-               content: none !important;
-       }
-
-       /* Post Author threaded comments */
-       .commentlist .children > li.bypostauthor {
-               background: #fff;
-               border-color: #ddd;
-       }
-       .commentlist .children > li.bypostauthor > article,
-       .commentlist .children > li.bypostauthor > article .comment-meta {
-               color: #959595;
-       }
-}
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/comments.php b/wp-content/themes/twentyeleven/comments.php
deleted file mode 100644 (file)
index 6b77fee..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-<?php
-/**
- * The template for displaying Comments.
- *
- * The area of the page that contains both current comments
- * and the comment form. The actual display of comments is
- * handled by a callback to twentyeleven_comment() which is
- * located in the functions.php file.
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-?>
-       <div id="comments">
-       <?php if ( post_password_required() ) : ?>
-               <p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyeleven' ); ?></p>
-       </div><!-- #comments -->
-       <?php
-                       /* Stop the rest of comments.php from being processed,
-                        * but don't kill the script entirely -- we still have
-                        * to fully load the template.
-                        */
-                       return;
-               endif;
-       ?>
-
-       <?php // You can start editing here -- including this comment! ?>
-
-       <?php if ( have_comments() ) : ?>
-               <h2 id="comments-title">
-                       <?php
-                               printf( _n( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'twentyeleven' ),
-                                       number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
-                       ?>
-               </h2>
-
-               <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
-               <nav id="comment-nav-above">
-                       <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1>
-                       <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyeleven' ) ); ?></div>
-                       <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentyeleven' ) ); ?></div>
-               </nav>
-               <?php endif; // check for comment navigation ?>
-
-               <ol class="commentlist">
-                       <?php
-                               /* Loop through and list the comments. Tell wp_list_comments()
-                                * to use twentyeleven_comment() to format the comments.
-                                * If you want to overload this in a child theme then you can
-                                * define twentyeleven_comment() and that will be used instead.
-                                * See twentyeleven_comment() in twentyeleven/functions.php for more.
-                                */
-                               wp_list_comments( array( 'callback' => 'twentyeleven_comment' ) );
-                       ?>
-               </ol>
-
-               <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
-               <nav id="comment-nav-below">
-                       <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1>
-                       <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentyeleven' ) ); ?></div>
-                       <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentyeleven' ) ); ?></div>
-               </nav>
-               <?php endif; // check for comment navigation ?>
-
-               <?php
-               /* If there are no comments and comments are closed, let's leave a little note, shall we?
-                * But we only want the note on posts and pages that had comments in the first place.
-                */
-               if ( ! comments_open() && get_comments_number() ) : ?>
-               <p class="nocomments"><?php _e( 'Comments are closed.' , 'twentyeleven' ); ?></p>
-               <?php endif; ?>
-
-       <?php endif; // have_comments() ?>
-
-       <?php comment_form(); ?>
-
-</div><!-- #comments -->
diff --git a/wp-content/themes/twentyeleven/content-aside.php b/wp-content/themes/twentyeleven/content-aside.php
deleted file mode 100644 (file)
index f6df40b..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-/**
- * The template for displaying posts in the Aside Post Format on index and archive pages
- *
- * Learn more: http://codex.wordpress.org/Post_Formats
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-?>
-
-       <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
-               <header class="entry-header">
-                       <hgroup>
-                               <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
-                               <h3 class="entry-format"><?php _e( 'Aside', 'twentyeleven' ); ?></h3>
-                       </hgroup>
-
-                       <?php if ( comments_open() && ! post_password_required() ) : ?>
-                       <div class="comments-link">
-                               <?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?>
-                       </div>
-                       <?php endif; ?>
-               </header><!-- .entry-header -->
-
-               <?php if ( is_search() ) : // Only display Excerpts for Search ?>
-               <div class="entry-summary">
-                       <?php the_excerpt(); ?>
-               </div><!-- .entry-summary -->
-               <?php else : ?>
-               <div class="entry-content">
-                       <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
-                       <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
-               </div><!-- .entry-content -->
-               <?php endif; ?>
-
-               <footer class="entry-meta">
-                       <?php twentyeleven_posted_on(); ?>
-                       <?php if ( comments_open() ) : ?>
-                       <span class="sep"> | </span>
-                       <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
-                       <?php endif; ?>
-                       <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
-               </footer><!-- .entry-meta -->
-       </article><!-- #post-<?php the_ID(); ?> -->
diff --git a/wp-content/themes/twentyeleven/content-featured.php b/wp-content/themes/twentyeleven/content-featured.php
deleted file mode 100644 (file)
index 7144a49..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-/**
- * The template for displaying content featured in the showcase.php page template
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-
-global $feature_class;
-?>
-<article id="post-<?php the_ID(); ?>" <?php post_class( $feature_class ); ?>>
-       <header class="entry-header">
-               <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
-
-               <div class="entry-meta">
-                       <?php twentyeleven_posted_on(); ?>
-               </div><!-- .entry-meta -->
-       </header><!-- .entry-header -->
-
-       <div class="entry-summary">
-               <?php the_excerpt(); ?>
-               <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
-       </div><!-- .entry-content -->
-
-       <footer class="entry-meta">
-               <?php
-                       /* translators: used between list items, there is a space after the comma */
-                       $tag_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
-                       if ( '' != $tag_list ) {
-                               $utility_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
-                       } else {
-                               $utility_text = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
-                       }
-                       printf(
-                               $utility_text,
-                               /* translators: used between list items, there is a space after the comma */
-                               get_the_category_list( __( ', ', 'twentyeleven' ) ),
-                               $tag_list,
-                               esc_url( get_permalink() ),
-                               the_title_attribute( 'echo=0' )
-                       );
-               ?>
-
-               <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
-       </footer><!-- .entry-meta -->
-</article><!-- #post-<?php the_ID(); ?> -->
diff --git a/wp-content/themes/twentyeleven/content-gallery.php b/wp-content/themes/twentyeleven/content-gallery.php
deleted file mode 100644 (file)
index 9976cf1..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-<?php
-/**
- * The template for displaying posts in the Gallery Post Format on index and archive pages
- *
- * Learn more: http://codex.wordpress.org/Post_Formats
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-?>
-
-<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
-       <header class="entry-header">
-               <hgroup>
-                       <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
-                       <h3 class="entry-format"><?php _e( 'Gallery', 'twentyeleven' ); ?></h3>
-               </hgroup>
-
-               <div class="entry-meta">
-                       <?php twentyeleven_posted_on(); ?>
-               </div><!-- .entry-meta -->
-       </header><!-- .entry-header -->
-
-       <?php if ( is_search() ) : // Only display Excerpts for search pages ?>
-               <div class="entry-summary">
-                       <?php the_excerpt(); ?>
-               </div><!-- .entry-summary -->
-               <?php else : ?>
-               <div class="entry-content">
-                       <?php if ( post_password_required() ) : ?>
-                               <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
-
-                       <?php else : ?>
-                               <?php
-                                       $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
-                                       if ( $images ) :
-                                               $total_images = count( $images );
-                                               $image = array_shift( $images );
-                                               $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
-                               ?>
-
-                               <figure class="gallery-thumb">
-                                       <a href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
-                               </figure><!-- .gallery-thumb -->
-
-                               <p><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyeleven' ),
-                                               'href="' . esc_url( get_permalink() ) . '" title="' . esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ) . '" rel="bookmark"',
-                                               number_format_i18n( $total_images )
-                                       ); ?></em></p>
-                       <?php endif; ?>
-                       <?php the_excerpt(); ?>
-               <?php endif; ?>
-               <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
-       </div><!-- .entry-content -->
-       <?php endif; ?>
-
-       <footer class="entry-meta">
-               <?php $show_sep = false; ?>
-               <?php
-                       /* translators: used between list items, there is a space after the comma */
-                       $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
-                       if ( $categories_list ):
-               ?>
-               <span class="cat-links">
-                       <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
-                       $show_sep = true; ?>
-               </span>
-               <?php endif; // End if categories ?>
-               <?php
-                       /* translators: used between list items, there is a space after the comma */
-                       $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
-                       if ( $tags_list ):
-                       if ( $show_sep ) : ?>
-               <span class="sep"> | </span>
-                       <?php endif; // End if $show_sep ?>
-               <span class="tag-links">
-                       <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
-                       $show_sep = true; ?>
-               </span>
-               <?php endif; // End if $tags_list ?>
-
-               <?php if ( comments_open() ) : ?>
-               <?php if ( $show_sep ) : ?>
-               <span class="sep"> | </span>
-               <?php endif; // End if $show_sep ?>
-               <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
-               <?php endif; // End if comments_open() ?>
-
-               <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
-       </footer><!-- .entry-meta -->
-</article><!-- #post-<?php the_ID(); ?> -->
diff --git a/wp-content/themes/twentyeleven/content-image.php b/wp-content/themes/twentyeleven/content-image.php
deleted file mode 100644 (file)
index e5973f9..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-<?php
-/**
- * The template for displaying posts in the Image Post Format on index and archive pages
- *
- * Learn more: http://codex.wordpress.org/Post_Formats
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-?>
-       <article id="post-<?php the_ID(); ?>" <?php post_class( 'indexed' ); ?>>
-               <header class="entry-header">
-                       <hgroup>
-                               <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
-                               <h3 class="entry-format"><?php _e( 'Image', 'twentyeleven' ); ?></h3>
-                       </hgroup>
-
-                       <?php if ( comments_open() && ! post_password_required() ) : ?>
-                       <div class="comments-link">
-                               <?php comments_popup_link( '<span class="leave-reply">' . __( "Reply", 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?>
-                       </div>
-                       <?php endif; ?>
-               </header><!-- .entry-header -->
-
-               <div class="entry-content">
-                       <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
-                       <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
-               </div><!-- .entry-content -->
-
-               <footer class="entry-meta">
-                       <div class="entry-meta">
-                               <?php
-                                       printf( __( '<a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%4$s" title="%5$s" rel="author">%6$s</a></span></span>', 'twentyeleven' ),
-                                               esc_url( get_permalink() ),
-                                               get_the_date( 'c' ),
-                                               get_the_date(),
-                                               esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
-                                               esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) ),
-                                               get_the_author()
-                                       );
-                               ?>
-                       </div><!-- .entry-meta -->
-                       <div class="entry-meta">
-                               <?php
-                                       /* translators: used between list items, there is a space after the comma */
-                                       $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
-                                       if ( $categories_list ):
-                               ?>
-                               <span class="cat-links">
-                                       <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list ); ?>
-                               </span>
-                               <?php endif; // End if categories ?>
-                               <?php
-                                       /* translators: used between list items, there is a space after the comma */
-                                       $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
-                                       if ( $tags_list ): ?>
-                               <span class="tag-links">
-                                       <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
-                               </span>
-                               <?php endif; // End if $tags_list ?>
-
-                               <?php if ( comments_open() ) : ?>
-                               <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
-                               <?php endif; // End if comments_open() ?>
-                       </div><!-- .entry-meta -->
-
-                       <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
-               </footer><!-- .entry-meta -->
-       </article><!-- #post-<?php the_ID(); ?> -->
diff --git a/wp-content/themes/twentyeleven/content-intro.php b/wp-content/themes/twentyeleven/content-intro.php
deleted file mode 100644 (file)
index 573112d..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-<?php
-/**
- * The template for displaying page content in the showcase.php page template
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-?>
-
-<article id="post-<?php the_ID(); ?>" <?php post_class( 'intro' ); ?>>
-       <header class="entry-header">
-               <h2 class="entry-title"><?php the_title(); ?></h2>
-       </header><!-- .entry-header -->
-
-       <div class="entry-content">
-               <?php the_content(); ?>
-               <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
-               <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
-       </div><!-- .entry-content -->
-</article><!-- #post-<?php the_ID(); ?> -->
diff --git a/wp-content/themes/twentyeleven/content-link.php b/wp-content/themes/twentyeleven/content-link.php
deleted file mode 100644 (file)
index 2e447ce..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-/**
- * The template for displaying posts in the Link Post Format on index and archive pages
- *
- * Learn more: http://codex.wordpress.org/Post_Formats
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-?>
-
-       <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
-               <header class="entry-header">
-                       <hgroup>
-                               <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
-                               <h3 class="entry-format"><?php _e( 'Link', 'twentyeleven' ); ?></h3>
-                       </hgroup>
-
-                       <?php if ( comments_open() && ! post_password_required() ) : ?>
-                       <div class="comments-link">
-                               <?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?>
-                       </div>
-                       <?php endif; ?>
-               </header><!-- .entry-header -->
-
-               <?php if ( is_search() ) : // Only display Excerpts for Search ?>
-               <div class="entry-summary">
-                       <?php the_excerpt(); ?>
-               </div><!-- .entry-summary -->
-               <?php else : ?>
-               <div class="entry-content">
-                       <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
-                       <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
-               </div><!-- .entry-content -->
-               <?php endif; ?>
-
-               <footer class="entry-meta">
-                       <?php twentyeleven_posted_on(); ?>
-                       <?php if ( comments_open() ) : ?>
-                       <span class="sep"> | </span>
-                       <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
-                       <?php endif; ?>
-                       <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
-               </footer><!-- .entry-meta -->
-       </article><!-- #post-<?php the_ID(); ?> -->
diff --git a/wp-content/themes/twentyeleven/content-page.php b/wp-content/themes/twentyeleven/content-page.php
deleted file mode 100644 (file)
index c499842..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-/**
- * The template used for displaying page content in page.php
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-?>
-
-<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
-       <header class="entry-header">
-               <h1 class="entry-title"><?php the_title(); ?></h1>
-       </header><!-- .entry-header -->
-
-       <div class="entry-content">
-               <?php the_content(); ?>
-               <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
-       </div><!-- .entry-content -->
-       <footer class="entry-meta">
-               <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
-       </footer><!-- .entry-meta -->
-</article><!-- #post-<?php the_ID(); ?> -->
diff --git a/wp-content/themes/twentyeleven/content-quote.php b/wp-content/themes/twentyeleven/content-quote.php
deleted file mode 100644 (file)
index 89a0c29..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<?php
-/**
- * The default template for displaying content
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-?>
-
-       <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
-               <header class="entry-header">
-                       <hgroup>
-                               <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
-                               <h3 class="entry-format"><?php _e( 'Quote', 'twentyeleven' ); ?></h3>
-                       </hgroup>
-
-                       <div class="entry-meta">
-                               <?php twentyeleven_posted_on(); ?>
-                       </div><!-- .entry-meta -->
-
-                       <?php if ( comments_open() && ! post_password_required() ) : ?>
-                       <div class="comments-link">
-                               <?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?>
-                       </div>
-                       <?php endif; ?>
-               </header><!-- .entry-header -->
-
-               <?php if ( is_search() ) : // Only display Excerpts for Search ?>
-               <div class="entry-summary">
-                       <?php the_excerpt(); ?>
-               </div><!-- .entry-summary -->
-               <?php else : ?>
-               <div class="entry-content">
-                       <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
-                       <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
-               </div><!-- .entry-content -->
-               <?php endif; ?>
-
-               <footer class="entry-meta">
-                       <?php $show_sep = false; ?>
-                       <?php
-                               /* translators: used between list items, there is a space after the comma */
-                               $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
-                               if ( $categories_list ):
-                       ?>
-                       <span class="cat-links">
-                               <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
-                               $show_sep = true; ?>
-                       </span>
-                       <?php endif; // End if categories ?>
-                       <?php
-                               /* translators: used between list items, there is a space after the comma */
-                               $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
-                               if ( $tags_list ):
-                               if ( $show_sep ) : ?>
-                       <span class="sep"> | </span>
-                               <?php endif; // End if $show_sep ?>
-                       <span class="tag-links">
-                               <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
-                               $show_sep = true; ?>
-                       </span>
-                       <?php endif; // End if $tags_list ?>
-
-                       <?php if ( comments_open() ) : ?>
-                       <?php if ( $show_sep ) : ?>
-                       <span class="sep"> | </span>
-                       <?php endif; // End if $show_sep ?>
-                       <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
-                       <?php endif; // End if comments_open() ?>
-
-                       <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
-               </footer><!-- .entry-meta -->
-       </article><!-- #post-<?php the_ID(); ?> -->
diff --git a/wp-content/themes/twentyeleven/content-single.php b/wp-content/themes/twentyeleven/content-single.php
deleted file mode 100644 (file)
index 8c28371..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-/**
- * The template for displaying content in the single.php template
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-?>
-
-<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
-       <header class="entry-header">
-               <h1 class="entry-title"><?php the_title(); ?></h1>
-
-               <?php if ( 'post' == get_post_type() ) : ?>
-               <div class="entry-meta">
-                       <?php twentyeleven_posted_on(); ?>
-               </div><!-- .entry-meta -->
-               <?php endif; ?>
-       </header><!-- .entry-header -->
-
-       <div class="entry-content">
-               <?php the_content(); ?>
-               <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
-       </div><!-- .entry-content -->
-
-       <footer class="entry-meta">
-               <?php
-                       /* translators: used between list items, there is a space after the comma */
-                       $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
-
-                       /* translators: used between list items, there is a space after the comma */
-                       $tag_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
-                       if ( '' != $tag_list ) {
-                               $utility_text = __( 'This entry was posted in %1$s and tagged %2$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
-                       } elseif ( '' != $categories_list ) {
-                               $utility_text = __( 'This entry was posted in %1$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
-                       } else {
-                               $utility_text = __( 'This entry was posted by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
-                       }
-
-                       printf(
-                               $utility_text,
-                               $categories_list,
-                               $tag_list,
-                               esc_url( get_permalink() ),
-                               the_title_attribute( 'echo=0' ),
-                               get_the_author(),
-                               esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) )
-                       );
-               ?>
-               <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
-
-               <?php if ( get_the_author_meta( 'description' ) && ( ! function_exists( 'is_multi_author' ) || is_multi_author() ) ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries ?>
-               <div id="author-info">
-                       <div id="author-avatar">
-                               <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 68 ) ); ?>
-                       </div><!-- #author-avatar -->
-                       <div id="author-description">
-                               <h2><?php printf( __( 'About %s', 'twentyeleven' ), get_the_author() ); ?></h2>
-                               <?php the_author_meta( 'description' ); ?>
-                               <div id="author-link">
-                                       <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
-                                               <?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentyeleven' ), get_the_author() ); ?>
-                                       </a>
-                               </div><!-- #author-link -->
-                       </div><!-- #author-description -->
-               </div><!-- #author-info -->
-               <?php endif; ?>
-       </footer><!-- .entry-meta -->
-</article><!-- #post-<?php the_ID(); ?> -->
diff --git a/wp-content/themes/twentyeleven/content-status.php b/wp-content/themes/twentyeleven/content-status.php
deleted file mode 100644 (file)
index 6cd0bad..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-/**
- * The template for displaying posts in the Status Post Format on index and archive pages
- *
- * Learn more: http://codex.wordpress.org/Post_Formats
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- */
-?>
-
-       <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
-               <header class="entry-header">
-                       <hgroup>
-                               <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
-                               <h3 class="entry-format"><?php _e( 'Status', 'twentyeleven' ); ?></h3>
-                       </hgroup>
-
-                       <?php if ( comments_open() && ! post_password_required() ) : ?>
-                       <div class="comments-link">
-                               <?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?>
-                       </div>
-                       <?php endif; ?>
-               </header><!-- .entry-header -->
-
-               <?php if ( is_search() ) : // Only display Excerpts for Search ?>
-               <div class="entry-summary">
-                       <?php the_excerpt(); ?>
-               </div><!-- .entry-summary -->
-               <?php else : ?>
-               <div class="entry-content">
-                       <div class="avatar"><?php echo get_avatar( get_the_author_meta( 'ID' ), apply_filters( 'twentyeleven_status_avatar', '65' ) ); ?></div>
-
-                       <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
-                       <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
-               </div><!-- .entry-content -->
-               <?php endif; ?>
-
-               <footer class="entry-meta">
-                       <?php twentyeleven_posted_on(); ?>
-                       <?php if ( comments_open() ) : ?>
-                       <span class="sep"> | </span>
-                       <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
-                       <?php endif; ?>
-                       <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
-               </footer><!-- .entry-meta -->
-       </article><!-- #post-<?php the_ID(); ?> -->
diff --git a/wp-content/themes/twentyeleven/content.php b/wp-content/themes/twentyeleven/content.php
deleted file mode 100644 (file)
index f245ebf..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-<?php
-/**
- * The default template for displaying content
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-?>
-
-       <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
-               <header class="entry-header">
-                       <?php if ( is_sticky() ) : ?>
-                               <hgroup>
-                                       <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
-                                       <h3 class="entry-format"><?php _e( 'Featured', 'twentyeleven' ); ?></h3>
-                               </hgroup>
-                       <?php else : ?>
-                       <h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
-                       <?php endif; ?>
-
-                       <?php if ( 'post' == get_post_type() ) : ?>
-                       <div class="entry-meta">
-                               <?php twentyeleven_posted_on(); ?>
-                       </div><!-- .entry-meta -->
-                       <?php endif; ?>
-
-                       <?php if ( comments_open() && ! post_password_required() ) : ?>
-                       <div class="comments-link">
-                               <?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?>
-                       </div>
-                       <?php endif; ?>
-               </header><!-- .entry-header -->
-
-               <?php if ( is_search() ) : // Only display Excerpts for Search ?>
-               <div class="entry-summary">
-                       <?php the_excerpt(); ?>
-               </div><!-- .entry-summary -->
-               <?php else : ?>
-               <div class="entry-content">
-                       <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
-                       <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
-               </div><!-- .entry-content -->
-               <?php endif; ?>
-
-               <footer class="entry-meta">
-                       <?php $show_sep = false; ?>
-                       <?php if ( is_object_in_taxonomy( get_post_type(), 'category' ) ) : // Hide category text when not supported ?>
-                       <?php
-                               /* translators: used between list items, there is a space after the comma */
-                               $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
-                               if ( $categories_list ):
-                       ?>
-                       <span class="cat-links">
-                               <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
-                               $show_sep = true; ?>
-                       </span>
-                       <?php endif; // End if categories ?>
-                       <?php endif; // End if is_object_in_taxonomy( get_post_type(), 'category' ) ?>
-                       <?php if ( is_object_in_taxonomy( get_post_type(), 'post_tag' ) ) : // Hide tag text when not supported ?>
-                       <?php
-                               /* translators: used between list items, there is a space after the comma */
-                               $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
-                               if ( $tags_list ):
-                               if ( $show_sep ) : ?>
-                       <span class="sep"> | </span>
-                               <?php endif; // End if $show_sep ?>
-                       <span class="tag-links">
-                               <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
-                               $show_sep = true; ?>
-                       </span>
-                       <?php endif; // End if $tags_list ?>
-                       <?php endif; // End if is_object_in_taxonomy( get_post_type(), 'post_tag' ) ?>
-
-                       <?php if ( comments_open() ) : ?>
-                       <?php if ( $show_sep ) : ?>
-                       <span class="sep"> | </span>
-                       <?php endif; // End if $show_sep ?>
-                       <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
-                       <?php endif; // End if comments_open() ?>
-
-                       <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
-               </footer><!-- .entry-meta -->
-       </article><!-- #post-<?php the_ID(); ?> -->
diff --git a/wp-content/themes/twentyeleven/editor-style-rtl.css b/wp-content/themes/twentyeleven/editor-style-rtl.css
deleted file mode 100644 (file)
index 2146645..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-Theme Name: Twenty Eleven
-*/
-/*
-Used to style the TinyMCE editor.
-*/
-html .mceContentBody {
-       direction: rtl;
-       unicode-bidi: embed;
-       float: right;
-       width: 584px;
-}
-* {
-       font-family: Arial, Tahoma, sans-serif;
-}
-ul, ol {
-       margin: 0 2.5em 1.625em 0;
-}
-blockquote {
-       font-style: normal;
-}
-table {
-       text-align: right;
-}
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/editor-style.css b/wp-content/themes/twentyeleven/editor-style.css
deleted file mode 100644 (file)
index 234bb9c..0000000
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
-Theme Name: Twenty Eleven
-Description: Used to style the TinyMCE editor.
-*/
-
-html .mceContentBody {
-       max-width: 584px;
-}
-* {
-       color: inherit;
-       font: 15px "Helvetica Neue", Helvetica, Arial, sans-serif;
-       font-style: inherit;
-       font-weight: inherit;
-       line-height: 1.625;
-}
-body {
-       color: #333;
-       font: 15px "Helvetica Neue", Helvetica, Arial, "Nimbus Sans L", sans-serif;
-       font-weight: 300;
-       line-height: 1.625;
-}
-
-/* Headings */
-h1,h2,h3,h4,h5,h6 {
-       clear: both;
-}
-h1,
-h2 {
-       color: #000;
-       font-size: 15px;
-       font-weight: bold;
-       margin: 0 0 .8125em;
-}
-h3 {
-       font-size: 10px;
-       letter-spacing: 0.1em;
-       line-height: 2.6em;
-       text-transform: uppercase;
-}
-h4, h5, h6 {
-       font-size: 14px;
-       margin: 0;
-}
-hr {
-       background-color: #ccc;
-       border: 0;
-       height: 1px;
-       margin-bottom: 1.625em;
-}
-
-/* Text elements */
-p, ul, ol, dl {
-       font-weight: 300;
-}
-p {
-       margin-bottom: 1.625em;
-}
-ul, ol {
-       margin: 0 0 1.625em 2.5em;
-       padding: 0;
-}
-ul {
-       list-style: square;
-}
-ol {
-       list-style-type: decimal;
-}
-ol ol {
-       list-style: upper-alpha;
-}
-ol ol ol {
-       list-style: lower-roman;
-}
-ol ol ol ol {
-       list-style: lower-alpha;
-}
-ul ul, ol ol, ul ol, ol ul {
-       margin-bottom: 0;
-}
-dl {
-       margin: 0 1.625em;
-}
-dt {
-       font-size: 15px;
-       font-weight: bold;
-}
-dd {
-       margin: 0 0 1.625em;
-}
-strong {
-       font-weight: bold;
-}
-cite, em, i {
-       font-style: italic;
-}
-cite {
-       border: none;
-}
-big {
-       font-size: 131.25%;
-}
-.mceContentBody blockquote,
-.mceContentBody blockquote p {
-       font-family: Georgia, "Bitstream Charter", serif !important;
-       font-style: italic !important;
-       font-weight: normal;
-       margin: 0 3em;
-}
-.mceContentBody blockquote em,
-.mceContentBody blockquote i,
-.mceContentBody blockquote cite {
-       font-style: normal;
-}
-.mceContentBody blockquote cite {
-       color: #666;
-       font: 12px "Helvetica Neue", Helvetica, Arial, sans-serif;
-       font-weight: 300;
-       letter-spacing: 0.05em;
-       text-transform: uppercase;
-}
-pre {
-       background: #f4f4f4;
-       font: 13px "Courier 10 Pitch", Courier, monospace;
-       line-height: 1.5;
-       margin-bottom: 1.625em;
-       padding: 0.75em 1.625em;
-}
-code, kbd, samp, var {
-       font: 13px Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
-}
-abbr, acronym, dfn {
-       border-bottom: 1px dotted #666;
-       cursor: help;
-}
-address {
-       display: block;
-       margin: 0 0 1.625em;
-}
-del {
-       color: #333;
-}
-ins {
-       background: #fff9c0;
-       border: none;
-       color: #333;
-       text-decoration: none;
-}
-sup,
-sub {
-       font-size: 10px;
-       height: 0;
-       line-height: 1;
-       position: relative;
-       vertical-align: baseline;
-}
-sup {
-       bottom: 1ex;
-}
-sub {
-       top: .5ex;
-}
-input[type=text],
-textarea {
-       background: #fafafa;
-       -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
-       -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
-       box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
-       border: 1px solid #ddd;
-       color: #888;
-}
-input[type=text]:focus,
-textarea:focus {
-       color: #333;
-}
-textarea {
-       padding-left: 3px;
-       width: 98%;
-}
-input[type=text] {
-       padding: 3px;
-}
-
-/* Links */
-a,
-a em,
-a strong {
-       color: #1b8be0;
-       text-decoration: none;
-}
-a:focus,
-a:active,
-a:hover {
-       text-decoration: underline;
-}
-
-/* Alignment */
-.alignleft {
-       display: inline;
-       float: left;
-       margin-right: 1.625em;
-}
-.alignright {
-       display: inline;
-       float: right;
-       margin-left: 1.625em;
-}
-.aligncenter {
-       clear: both;
-       display: block;
-       margin-left: auto;
-       margin-right: auto;
-}
-
-/* Tables */
-table {
-       border: none !important;
-       border-bottom: 1px solid #ddd !important;
-       border-collapse: collapse;
-       border-spacing: 0;
-       text-align: left;
-       margin: 0 0 1.625em;
-       width: 100%;
-}
-tr th {
-       border: none !important;
-       color: #666;
-       font-size: 10px;
-       font-weight: 500;
-       letter-spacing: 0.1em;
-       line-height: 2.6em;
-       text-transform: uppercase;
-}
-td {
-       border: none !important;
-       border-top: 1px solid #ddd !important;
-       padding: 6px 10px 6px 0;
-}
-
-/* Images */
-img[class*="wp-image-"] {
-       height: auto;
-       max-width: 97.5%;
-}
-img.size-full {
-       width: auto; /* Prevent stretching of full-size images in IE8 */
-}
-img.wp-smiley {
-       border: none;
-       margin-bottom: 0;
-       margin-top: 0;
-       padding: 0;
-}
-p img,
-.wp-caption {
-       margin-top: 0.4em;
-}
-img,
-.editor-attachment {
-       border: 1px solid #ddd;
-       padding: 6px;
-}
-img.alignleft,
-img.alignright,
-img.aligncenter {
-       margin-bottom: 1.625em;
-}
-.wp-caption {
-       background: #eee;
-       border: none;
-       margin-bottom: 1.625em;
-       max-width: 96%;
-       padding: 9px;
-}
-.wp-caption img {
-       display: block;
-       margin: 5px auto 0 !important;
-       max-width: 98%;
-       border-color: #eee;
-}
-.wp-caption .wp-caption-text,
-.wp-caption-dd {
-       color: #666;
-       font-family: Georgia, serif !important;
-       font-size: 12px;
-       margin: 0 0 0.6em 0 !important;
-       padding: 0 0 5px 40px;
-       position: relative;
-       text-align: left;
-}
-.wp-caption .wp-caption-text:before {
-       color: #666;
-       content: '\2014';
-       font-size: 14px;
-       font-style: normal;
-       font-weight: bold;
-       margin-right: 5px;
-       position: absolute;
-       left: 10px;
-       top: 7px;
-}
-a:focus img[class*="wp-image-"],
-a:hover img[class*="wp-image-"],
-a:active img[class*="wp-image-"] {
-       background: #eee;
-       border-color: #bbb;
-}
-.wp-caption a:focus img,
-.wp-caption a:active img,
-.wp-caption a:hover img {
-       background: #fff;
-       border-color: #ddd;
-}
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/footer.php b/wp-content/themes/twentyeleven/footer.php
deleted file mode 100644 (file)
index 9cb702c..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * The template for displaying the footer.
- *
- * Contains the closing of the id=main div and all content after
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-?>
-
-       </div><!-- #main -->
-
-       <footer id="colophon" role="contentinfo">
-
-                       <?php
-                               /* A sidebar in the footer? Yep. You can can customize
-                                * your footer with three columns of widgets.
-                                */
-                               if ( ! is_404() )
-                                       get_sidebar( 'footer' );
-                       ?>
-
-                       <div id="site-generator">
-                               <?php do_action( 'twentyeleven_credits' ); ?>
-                               <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentyeleven' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentyeleven' ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentyeleven' ), 'WordPress' ); ?></a>
-                       </div>
-       </footer><!-- #colophon -->
-</div><!-- #page -->
-
-<?php wp_footer(); ?>
-
-</body>
-</html>
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/functions.php b/wp-content/themes/twentyeleven/functions.php
deleted file mode 100644 (file)
index 1fc8e65..0000000
+++ /dev/null
@@ -1,614 +0,0 @@
-<?php
-/**
- * Twenty Eleven functions and definitions
- *
- * Sets up the theme and provides some helper functions. Some helper functions
- * are used in the theme as custom template tags. Others are attached to action and
- * filter hooks in WordPress to change core functionality.
- *
- * The first function, twentyeleven_setup(), sets up the theme by registering support
- * for various features in WordPress, such as post thumbnails, navigation menus, and the like.
- *
- * When using a child theme (see http://codex.wordpress.org/Theme_Development and
- * http://codex.wordpress.org/Child_Themes), you can override certain functions
- * (those wrapped in a function_exists() call) by defining them first in your child theme's
- * functions.php file. The child theme's functions.php file is included before the parent
- * theme's file, so the child theme functions would be used.
- *
- * Functions that are not pluggable (not wrapped in function_exists()) are instead attached
- * to a filter or action hook. The hook can be removed by using remove_action() or
- * remove_filter() and you can attach your own function to the hook.
- *
- * We can remove the parent theme's hook only after it is attached, which means we need to
- * wait until setting up the child theme:
- *
- * <code>
- * add_action( 'after_setup_theme', 'my_child_theme_setup' );
- * function my_child_theme_setup() {
- *     // We are providing our own filter for excerpt_length (or using the unfiltered value)
- *     remove_filter( 'excerpt_length', 'twentyeleven_excerpt_length' );
- *     ...
- * }
- * </code>
- *
- * For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API.
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-
-/**
- * Set the content width based on the theme's design and stylesheet.
- */
-if ( ! isset( $content_width ) )
-       $content_width = 584;
-
-/**
- * Tell WordPress to run twentyeleven_setup() when the 'after_setup_theme' hook is run.
- */
-add_action( 'after_setup_theme', 'twentyeleven_setup' );
-
-if ( ! function_exists( 'twentyeleven_setup' ) ):
-/**
- * Sets up theme defaults and registers support for various WordPress features.
- *
- * Note that this function is hooked into the after_setup_theme hook, which runs
- * before the init hook. The init hook is too late for some features, such as indicating
- * support post thumbnails.
- *
- * To override twentyeleven_setup() in a child theme, add your own twentyeleven_setup to your child theme's
- * functions.php file.
- *
- * @uses load_theme_textdomain() For translation/localization support.
- * @uses add_editor_style() To style the visual editor.
- * @uses add_theme_support() To add support for post thumbnails, automatic feed links, custom headers
- *     and backgrounds, and post formats.
- * @uses register_nav_menus() To add support for navigation menus.
- * @uses register_default_headers() To register the default custom header images provided with the theme.
- * @uses set_post_thumbnail_size() To set a custom post thumbnail size.
- *
- * @since Twenty Eleven 1.0
- */
-function twentyeleven_setup() {
-
-       /* Make Twenty Eleven available for translation.
-        * Translations can be added to the /languages/ directory.
-        * If you're building a theme based on Twenty Eleven, use a find and replace
-        * to change 'twentyeleven' to the name of your theme in all the template files.
-        */
-       load_theme_textdomain( 'twentyeleven', get_template_directory() . '/languages' );
-
-       // This theme styles the visual editor with editor-style.css to match the theme style.
-       add_editor_style();
-
-       // Load up our theme options page and related code.
-       require( get_template_directory() . '/inc/theme-options.php' );
-
-       // Grab Twenty Eleven's Ephemera widget.
-       require( get_template_directory() . '/inc/widgets.php' );
-
-       // Add default posts and comments RSS feed links to <head>.
-       add_theme_support( 'automatic-feed-links' );
-
-       // This theme uses wp_nav_menu() in one location.
-       register_nav_menu( 'primary', __( 'Primary Menu', 'twentyeleven' ) );
-
-       // Add support for a variety of post formats
-       add_theme_support( 'post-formats', array( 'aside', 'link', 'gallery', 'status', 'quote', 'image' ) );
-
-       $theme_options = twentyeleven_get_theme_options();
-       if ( 'dark' == $theme_options['color_scheme'] )
-               $default_background_color = '1d1d1d';
-       else
-               $default_background_color = 'e2e2e2';
-
-       // Add support for custom backgrounds.
-       add_theme_support( 'custom-background', array(
-               // Let WordPress know what our default background color is.
-               // This is dependent on our current color scheme.
-               'default-color' => $default_background_color,
-       ) );
-
-       // This theme uses Featured Images (also known as post thumbnails) for per-post/per-page Custom Header images
-       add_theme_support( 'post-thumbnails' );
-
-       // Add support for custom headers.
-       $custom_header_support = array(
-               // The default header text color.
-               'default-text-color' => '000',
-               // The height and width of our custom header.
-               'width' => apply_filters( 'twentyeleven_header_image_width', 1000 ),
-               'height' => apply_filters( 'twentyeleven_header_image_height', 288 ),
-               // Support flexible heights.
-               'flex-height' => true,
-               // Random image rotation by default.
-               'random-default' => true,
-               // Callback for styling the header.
-               'wp-head-callback' => 'twentyeleven_header_style',
-               // Callback for styling the header preview in the admin.
-               'admin-head-callback' => 'twentyeleven_admin_header_style',
-               // Callback used to display the header preview in the admin.
-               'admin-preview-callback' => 'twentyeleven_admin_header_image',
-       );
-
-       add_theme_support( 'custom-header', $custom_header_support );
-
-       if ( ! function_exists( 'get_custom_header' ) ) {
-               // This is all for compatibility with versions of WordPress prior to 3.4.
-               define( 'HEADER_TEXTCOLOR', $custom_header_support['default-text-color'] );
-               define( 'HEADER_IMAGE', '' );
-               define( 'HEADER_IMAGE_WIDTH', $custom_header_support['width'] );
-               define( 'HEADER_IMAGE_HEIGHT', $custom_header_support['height'] );
-               add_custom_image_header( $custom_header_support['wp-head-callback'], $custom_header_support['admin-head-callback'], $custom_header_support['admin-preview-callback'] );
-               add_custom_background();
-       }
-
-       // We'll be using post thumbnails for custom header images on posts and pages.
-       // We want them to be the size of the header image that we just defined
-       // Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
-       set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true );
-
-       // Add Twenty Eleven's custom image sizes.
-       // Used for large feature (header) images.
-       add_image_size( 'large-feature', $custom_header_support['width'], $custom_header_support['height'], true );
-       // Used for featured posts if a large-feature doesn't exist.
-       add_image_size( 'small-feature', 500, 300 );
-
-       // Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
-       register_default_headers( array(
-               'wheel' => array(
-                       'url' => '%s/images/headers/wheel.jpg',
-                       'thumbnail_url' => '%s/images/headers/wheel-thumbnail.jpg',
-                       /* translators: header image description */
-                       'description' => __( 'Wheel', 'twentyeleven' )
-               ),
-               'shore' => array(
-                       'url' => '%s/images/headers/shore.jpg',
-                       'thumbnail_url' => '%s/images/headers/shore-thumbnail.jpg',
-                       /* translators: header image description */
-                       'description' => __( 'Shore', 'twentyeleven' )
-               ),
-               'trolley' => array(
-                       'url' => '%s/images/headers/trolley.jpg',
-                       'thumbnail_url' => '%s/images/headers/trolley-thumbnail.jpg',
-                       /* translators: header image description */
-                       'description' => __( 'Trolley', 'twentyeleven' )
-               ),
-               'pine-cone' => array(
-                       'url' => '%s/images/headers/pine-cone.jpg',
-                       'thumbnail_url' => '%s/images/headers/pine-cone-thumbnail.jpg',
-                       /* translators: header image description */
-                       'description' => __( 'Pine Cone', 'twentyeleven' )
-               ),
-               'chessboard' => array(
-                       'url' => '%s/images/headers/chessboard.jpg',
-                       'thumbnail_url' => '%s/images/headers/chessboard-thumbnail.jpg',
-                       /* translators: header image description */
-                       'description' => __( 'Chessboard', 'twentyeleven' )
-               ),
-               'lanterns' => array(
-                       'url' => '%s/images/headers/lanterns.jpg',
-                       'thumbnail_url' => '%s/images/headers/lanterns-thumbnail.jpg',
-                       /* translators: header image description */
-                       'description' => __( 'Lanterns', 'twentyeleven' )
-               ),
-               'willow' => array(
-                       'url' => '%s/images/headers/willow.jpg',
-                       'thumbnail_url' => '%s/images/headers/willow-thumbnail.jpg',
-                       /* translators: header image description */
-                       'description' => __( 'Willow', 'twentyeleven' )
-               ),
-               'hanoi' => array(
-                       'url' => '%s/images/headers/hanoi.jpg',
-                       'thumbnail_url' => '%s/images/headers/hanoi-thumbnail.jpg',
-                       /* translators: header image description */
-                       'description' => __( 'Hanoi Plant', 'twentyeleven' )
-               )
-       ) );
-}
-endif; // twentyeleven_setup
-
-if ( ! function_exists( 'twentyeleven_header_style' ) ) :
-/**
- * Styles the header image and text displayed on the blog
- *
- * @since Twenty Eleven 1.0
- */
-function twentyeleven_header_style() {
-       $text_color = get_header_textcolor();
-
-       // If no custom options for text are set, let's bail.
-       if ( $text_color == HEADER_TEXTCOLOR )
-               return;
-
-       // If we get this far, we have custom styles. Let's do this.
-       ?>
-       <style type="text/css">
-       <?php
-               // Has the text been hidden?
-               if ( 'blank' == $text_color ) :
-       ?>
-               #site-title,
-               #site-description {
-                       position: absolute !important;
-                       clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
-                       clip: rect(1px, 1px, 1px, 1px);
-               }
-       <?php
-               // If the user has set a custom color for the text use that
-               else :
-       ?>
-               #site-title a,
-               #site-description {
-                       color: #<?php echo $text_color; ?> !important;
-               }
-       <?php endif; ?>
-       </style>
-       <?php
-}
-endif; // twentyeleven_header_style
-
-if ( ! function_exists( 'twentyeleven_admin_header_style' ) ) :
-/**
- * Styles the header image displayed on the Appearance > Header admin panel.
- *
- * Referenced via add_theme_support('custom-header') in twentyeleven_setup().
- *
- * @since Twenty Eleven 1.0
- */
-function twentyeleven_admin_header_style() {
-?>
-       <style type="text/css">
-       .appearance_page_custom-header #headimg {
-               border: none;
-       }
-       #headimg h1,
-       #desc {
-               font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;
-       }
-       #headimg h1 {
-               margin: 0;
-       }
-       #headimg h1 a {
-               font-size: 32px;
-               line-height: 36px;
-               text-decoration: none;
-       }
-       #desc {
-               font-size: 14px;
-               line-height: 23px;
-               padding: 0 0 3em;
-       }
-       <?php
-               // If the user has set a custom color for the text use that
-               if ( get_header_textcolor() != HEADER_TEXTCOLOR ) :
-       ?>
-               #site-title a,
-               #site-description {
-                       color: #<?php echo get_header_textcolor(); ?>;
-               }
-       <?php endif; ?>
-       #headimg img {
-               max-width: 1000px;
-               height: auto;
-               width: 100%;
-       }
-       </style>
-<?php
-}
-endif; // twentyeleven_admin_header_style
-
-if ( ! function_exists( 'twentyeleven_admin_header_image' ) ) :
-/**
- * Custom header image markup displayed on the Appearance > Header admin panel.
- *
- * Referenced via add_theme_support('custom-header') in twentyeleven_setup().
- *
- * @since Twenty Eleven 1.0
- */
-function twentyeleven_admin_header_image() { ?>
-       <div id="headimg">
-               <?php
-               $color = get_header_textcolor();
-               $image = get_header_image();
-               if ( $color && $color != 'blank' )
-                       $style = ' style="color:#' . $color . '"';
-               else
-                       $style = ' style="display:none"';
-               ?>
-               <h1><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
-               <div id="desc"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>
-               <?php if ( $image ) : ?>
-                       <img src="<?php echo esc_url( $image ); ?>" alt="" />
-               <?php endif; ?>
-       </div>
-<?php }
-endif; // twentyeleven_admin_header_image
-
-/**
- * Sets the post excerpt length to 40 words.
- *
- * To override this length in a child theme, remove the filter and add your own
- * function tied to the excerpt_length filter hook.
- */
-function twentyeleven_excerpt_length( $length ) {
-       return 40;
-}
-add_filter( 'excerpt_length', 'twentyeleven_excerpt_length' );
-
-if ( ! function_exists( 'twentyeleven_continue_reading_link' ) ) :
-/**
- * Returns a "Continue Reading" link for excerpts
- */
-function twentyeleven_continue_reading_link() {
-       return ' <a href="'. esc_url( get_permalink() ) . '">' . __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) . '</a>';
-}
-endif; // twentyeleven_continue_reading_link
-
-/**
- * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and twentyeleven_continue_reading_link().
- *
- * To override this in a child theme, remove the filter and add your own
- * function tied to the excerpt_more filter hook.
- */
-function twentyeleven_auto_excerpt_more( $more ) {
-       return ' &hellip;' . twentyeleven_continue_reading_link();
-}
-add_filter( 'excerpt_more', 'twentyeleven_auto_excerpt_more' );
-
-/**
- * Adds a pretty "Continue Reading" link to custom post excerpts.
- *
- * To override this link in a child theme, remove the filter and add your own
- * function tied to the get_the_excerpt filter hook.
- */
-function twentyeleven_custom_excerpt_more( $output ) {
-       if ( has_excerpt() && ! is_attachment() ) {
-               $output .= twentyeleven_continue_reading_link();
-       }
-       return $output;
-}
-add_filter( 'get_the_excerpt', 'twentyeleven_custom_excerpt_more' );
-
-/**
- * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
- */
-function twentyeleven_page_menu_args( $args ) {
-       if ( ! isset( $args['show_home'] ) )
-               $args['show_home'] = true;
-       return $args;
-}
-add_filter( 'wp_page_menu_args', 'twentyeleven_page_menu_args' );
-
-/**
- * Register our sidebars and widgetized areas. Also register the default Epherma widget.
- *
- * @since Twenty Eleven 1.0
- */
-function twentyeleven_widgets_init() {
-
-       register_widget( 'Twenty_Eleven_Ephemera_Widget' );
-
-       register_sidebar( array(
-               'name' => __( 'Main Sidebar', 'twentyeleven' ),
-               'id' => 'sidebar-1',
-               'before_widget' => '<aside id="%1$s" class="widget %2$s">',
-               'after_widget' => "</aside>",
-               'before_title' => '<h3 class="widget-title">',
-               'after_title' => '</h3>',
-       ) );
-
-       register_sidebar( array(
-               'name' => __( 'Showcase Sidebar', 'twentyeleven' ),
-               'id' => 'sidebar-2',
-               'description' => __( 'The sidebar for the optional Showcase Template', 'twentyeleven' ),
-               'before_widget' => '<aside id="%1$s" class="widget %2$s">',
-               'after_widget' => "</aside>",
-               'before_title' => '<h3 class="widget-title">',
-               'after_title' => '</h3>',
-       ) );
-
-       register_sidebar( array(
-               'name' => __( 'Footer Area One', 'twentyeleven' ),
-               'id' => 'sidebar-3',
-               'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ),
-               'before_widget' => '<aside id="%1$s" class="widget %2$s">',
-               'after_widget' => "</aside>",
-               'before_title' => '<h3 class="widget-title">',
-               'after_title' => '</h3>',
-       ) );
-
-       register_sidebar( array(
-               'name' => __( 'Footer Area Two', 'twentyeleven' ),
-               'id' => 'sidebar-4',
-               'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ),
-               'before_widget' => '<aside id="%1$s" class="widget %2$s">',
-               'after_widget' => "</aside>",
-               'before_title' => '<h3 class="widget-title">',
-               'after_title' => '</h3>',
-       ) );
-
-       register_sidebar( array(
-               'name' => __( 'Footer Area Three', 'twentyeleven' ),
-               'id' => 'sidebar-5',
-               'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ),
-               'before_widget' => '<aside id="%1$s" class="widget %2$s">',
-               'after_widget' => "</aside>",
-               'before_title' => '<h3 class="widget-title">',
-               'after_title' => '</h3>',
-       ) );
-}
-add_action( 'widgets_init', 'twentyeleven_widgets_init' );
-
-if ( ! function_exists( 'twentyeleven_content_nav' ) ) :
-/**
- * Display navigation to next/previous pages when applicable
- */
-function twentyeleven_content_nav( $html_id ) {
-       global $wp_query;
-
-       if ( $wp_query->max_num_pages > 1 ) : ?>
-               <nav id="<?php echo esc_attr( $html_id ); ?>">
-                       <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3>
-                       <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentyeleven' ) ); ?></div>
-                       <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?></div>
-               </nav><!-- #nav-above -->
-       <?php endif;
-}
-endif; // twentyeleven_content_nav
-
-/**
- * Return the URL for the first link found in the post content.
- *
- * @since Twenty Eleven 1.0
- * @return string|bool URL or false when no link is present.
- */
-function twentyeleven_url_grabber() {
-       if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) )
-               return false;
-
-       return esc_url_raw( $matches[1] );
-}
-
-/**
- * Count the number of footer sidebars to enable dynamic classes for the footer
- */
-function twentyeleven_footer_sidebar_class() {
-       $count = 0;
-
-       if ( is_active_sidebar( 'sidebar-3' ) )
-               $count++;
-
-       if ( is_active_sidebar( 'sidebar-4' ) )
-               $count++;
-
-       if ( is_active_sidebar( 'sidebar-5' ) )
-               $count++;
-
-       $class = '';
-
-       switch ( $count ) {
-               case '1':
-                       $class = 'one';
-                       break;
-               case '2':
-                       $class = 'two';
-                       break;
-               case '3':
-                       $class = 'three';
-                       break;
-       }
-
-       if ( $class )
-               echo 'class="' . $class . '"';
-}
-
-if ( ! function_exists( 'twentyeleven_comment' ) ) :
-/**
- * Template for comments and pingbacks.
- *
- * To override this walker in a child theme without modifying the comments template
- * simply create your own twentyeleven_comment(), and that function will be used instead.
- *
- * Used as a callback by wp_list_comments() for displaying the comments.
- *
- * @since Twenty Eleven 1.0
- */
-function twentyeleven_comment( $comment, $args, $depth ) {
-       $GLOBALS['comment'] = $comment;
-       switch ( $comment->comment_type ) :
-               case 'pingback' :
-               case 'trackback' :
-       ?>
-       <li class="post pingback">
-               <p><?php _e( 'Pingback:', 'twentyeleven' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?></p>
-       <?php
-                       break;
-               default :
-       ?>
-       <li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
-               <article id="comment-<?php comment_ID(); ?>" class="comment">
-                       <footer class="comment-meta">
-                               <div class="comment-author vcard">
-                                       <?php
-                                               $avatar_size = 68;
-                                               if ( '0' != $comment->comment_parent )
-                                                       $avatar_size = 39;
-
-                                               echo get_avatar( $comment, $avatar_size );
-
-                                               /* translators: 1: comment author, 2: date and time */
-                                               printf( __( '%1$s on %2$s <span class="says">said:</span>', 'twentyeleven' ),
-                                                       sprintf( '<span class="fn">%s</span>', get_comment_author_link() ),
-                                                       sprintf( '<a href="%1$s"><time datetime="%2$s">%3$s</time></a>',
-                                                               esc_url( get_comment_link( $comment->comment_ID ) ),
-                                                               get_comment_time( 'c' ),
-                                                               /* translators: 1: date, 2: time */
-                                                               sprintf( __( '%1$s at %2$s', 'twentyeleven' ), get_comment_date(), get_comment_time() )
-                                                       )
-                                               );
-                                       ?>
-
-                                       <?php edit_comment_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
-                               </div><!-- .comment-author .vcard -->
-
-                               <?php if ( $comment->comment_approved == '0' ) : ?>
-                                       <em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentyeleven' ); ?></em>
-                                       <br />
-                               <?php endif; ?>
-
-                       </footer>
-
-                       <div class="comment-content"><?php comment_text(); ?></div>
-
-                       <div class="reply">
-                               <?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply <span>&darr;</span>', 'twentyeleven' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
-                       </div><!-- .reply -->
-               </article><!-- #comment-## -->
-
-       <?php
-                       break;
-       endswitch;
-}
-endif; // ends check for twentyeleven_comment()
-
-if ( ! function_exists( 'twentyeleven_posted_on' ) ) :
-/**
- * Prints HTML with meta information for the current post-date/time and author.
- * Create your own twentyeleven_posted_on to override in a child theme
- *
- * @since Twenty Eleven 1.0
- */
-function twentyeleven_posted_on() {
-       printf( __( '<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'twentyeleven' ),
-               esc_url( get_permalink() ),
-               esc_attr( get_the_time() ),
-               esc_attr( get_the_date( 'c' ) ),
-               esc_html( get_the_date() ),
-               esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
-               esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) ),
-               get_the_author()
-       );
-}
-endif;
-
-/**
- * Adds two classes to the array of body classes.
- * The first is if the site has only had one author with published posts.
- * The second is if a singular post being displayed
- *
- * @since Twenty Eleven 1.0
- */
-function twentyeleven_body_classes( $classes ) {
-
-       if ( function_exists( 'is_multi_author' ) && ! is_multi_author() )
-               $classes[] = 'single-author';
-
-       if ( is_singular() && ! is_home() && ! is_page_template( 'showcase.php' ) && ! is_page_template( 'sidebar-page.php' ) )
-               $classes[] = 'singular';
-
-       return $classes;
-}
-add_filter( 'body_class', 'twentyeleven_body_classes' );
-
diff --git a/wp-content/themes/twentyeleven/header.php b/wp-content/themes/twentyeleven/header.php
deleted file mode 100644 (file)
index 59b6d3b..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-<?php
-/**
- * The Header for our theme.
- *
- * Displays all of the <head> section and everything up till <div id="main">
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-?><!DOCTYPE html>
-<!--[if IE 6]>
-<html id="ie6" <?php language_attributes(); ?>>
-<![endif]-->
-<!--[if IE 7]>
-<html id="ie7" <?php language_attributes(); ?>>
-<![endif]-->
-<!--[if IE 8]>
-<html id="ie8" <?php language_attributes(); ?>>
-<![endif]-->
-<!--[if !(IE 6) | !(IE 7) | !(IE 8)  ]><!-->
-<html <?php language_attributes(); ?>>
-<!--<![endif]-->
-<head>
-<meta charset="<?php bloginfo( 'charset' ); ?>" />
-<meta name="viewport" content="width=device-width" />
-<title><?php
-       /*
-        * Print the <title> tag based on what is being viewed.
-        */
-       global $page, $paged;
-
-       wp_title( '|', true, 'right' );
-
-       // Add the blog name.
-       bloginfo( 'name' );
-
-       // Add the blog description for the home/front page.
-       $site_description = get_bloginfo( 'description', 'display' );
-       if ( $site_description && ( is_home() || is_front_page() ) )
-               echo " | $site_description";
-
-       // Add a page number if necessary:
-       if ( $paged >= 2 || $page >= 2 )
-               echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) );
-
-       ?></title>
-<link rel="profile" href="http://gmpg.org/xfn/11" />
-<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
-<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
-<!--[if lt IE 9]>
-<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
-<![endif]-->
-<?php
-       /* We add some JavaScript to pages with the comment form
-        * to support sites with threaded comments (when in use).
-        */
-       if ( is_singular() && get_option( 'thread_comments' ) )
-               wp_enqueue_script( 'comment-reply' );
-
-       /* Always have wp_head() just before the closing </head>
-        * tag of your theme, or you will break many plugins, which
-        * generally use this hook to add elements to <head> such
-        * as styles, scripts, and meta tags.
-        */
-       wp_head();
-?>
-</head>
-
-<body <?php body_class(); ?>>
-<div id="page" class="hfeed">
-       <header id="branding" role="banner">
-                       <hgroup>
-                               <h1 id="site-title"><span><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span></h1>
-                               <h2 id="site-description"><?php bloginfo( 'description' ); ?></h2>
-                       </hgroup>
-
-                       <?php
-                               // Check to see if the header image has been removed
-                               $header_image = get_header_image();
-                               if ( $header_image ) :
-                                       // Compatibility with versions of WordPress prior to 3.4.
-                                       if ( function_exists( 'get_custom_header' ) ) {
-                                               // We need to figure out what the minimum width should be for our featured image.
-                                               // This result would be the suggested width if the theme were to implement flexible widths.
-                                               $header_image_width = get_theme_support( 'custom-header', 'width' );
-                                       } else {
-                                               $header_image_width = HEADER_IMAGE_WIDTH;
-                                       }
-                                       ?>
-                       <a href="<?php echo esc_url( home_url( '/' ) ); ?>">
-                               <?php
-                                       // The header image
-                                       // Check if this is a post or page, if it has a thumbnail, and if it's a big one
-                                       if ( is_singular() && has_post_thumbnail( $post->ID ) &&
-                                                       ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ) ) &&
-                                                       $image[1] >= $header_image_width ) :
-                                               // Houston, we have a new header image!
-                                               echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
-                                       else :
-                                               // Compatibility with versions of WordPress prior to 3.4.
-                                               if ( function_exists( 'get_custom_header' ) ) {
-                                                       $header_image_width  = get_custom_header()->width;
-                                                       $header_image_height = get_custom_header()->height;
-                                               } else {
-                                                       $header_image_width  = HEADER_IMAGE_WIDTH;
-                                                       $header_image_height = HEADER_IMAGE_HEIGHT;
-                                               }
-                                               ?>
-                                       <img src="<?php header_image(); ?>" width="<?php echo $header_image_width; ?>" height="<?php echo $header_image_height; ?>" alt="" />
-                               <?php endif; // end check for featured image or standard header ?>
-                       </a>
-                       <?php endif; // end check for removed header image ?>
-
-                       <?php
-                               // Has the text been hidden?
-                               if ( 'blank' == get_header_textcolor() ) :
-                       ?>
-                               <div class="only-search<?php if ( $header_image ) : ?> with-image<?php endif; ?>">
-                               <?php get_search_form(); ?>
-                               </div>
-                       <?php
-                               else :
-                       ?>
-                               <?php get_search_form(); ?>
-                       <?php endif; ?>
-
-                       <nav id="access" role="navigation">
-                               <h3 class="assistive-text"><?php _e( 'Main menu', 'twentyeleven' ); ?></h3>
-                               <?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. */ ?>
-                               <div class="skip-link"><a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to primary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to primary content', 'twentyeleven' ); ?></a></div>
-                               <div class="skip-link"><a class="assistive-text" href="#secondary" title="<?php esc_attr_e( 'Skip to secondary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to secondary content', 'twentyeleven' ); ?></a></div>
-                               <?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assigned to the primary location is the one used. If one isn't assigned, the menu with the lowest ID is used. */ ?>
-                               <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
-                       </nav><!-- #access -->
-       </header><!-- #branding -->
-
-
-       <div id="main">
diff --git a/wp-content/themes/twentyeleven/image.php b/wp-content/themes/twentyeleven/image.php
deleted file mode 100644 (file)
index 3db208e..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-<?php
-/**
- * The template for displaying image attachments.
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-
-get_header(); ?>
-
-               <div id="primary" class="image-attachment">
-                       <div id="content" role="main">
-
-                       <?php while ( have_posts() ) : the_post(); ?>
-
-                               <nav id="nav-single">
-                                       <h3 class="assistive-text"><?php _e( 'Image navigation', 'twentyeleven' ); ?></h3>
-                                       <span class="nav-previous"><?php previous_image_link( false, __( '&larr; Previous' , 'twentyeleven' ) ); ?></span>
-                                       <span class="nav-next"><?php next_image_link( false, __( 'Next &rarr;' , 'twentyeleven' ) ); ?></span>
-                               </nav><!-- #nav-single -->
-
-                                       <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
-                                               <header class="entry-header">
-                                                       <h1 class="entry-title"><?php the_title(); ?></h1>
-
-                                                       <div class="entry-meta">
-                                                               <?php
-                                                                       $metadata = wp_get_attachment_metadata();
-                                                                       printf( __( '<span class="meta-prep meta-prep-entry-date">Published </span> <span class="entry-date"><abbr class="published" title="%1$s">%2$s</abbr></span> at <a href="%3$s" title="Link to full-size image">%4$s &times; %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%8$s</a>', 'twentyeleven' ),
-                                                                               esc_attr( get_the_time() ),
-                                                                               get_the_date(),
-                                                                               esc_url( wp_get_attachment_url() ),
-                                                                               $metadata['width'],
-                                                                               $metadata['height'],
-                                                                               esc_url( get_permalink( $post->post_parent ) ),
-                                                                               esc_attr( strip_tags( get_the_title( $post->post_parent ) ) ),
-                                                                               get_the_title( $post->post_parent )
-                                                                       );
-                                                               ?>
-                                                               <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
-                                                       </div><!-- .entry-meta -->
-
-                                               </header><!-- .entry-header -->
-
-                                               <div class="entry-content">
-
-                                                       <div class="entry-attachment">
-                                                               <div class="attachment">
-<?php
-       /**
-        * Grab the IDs of all the image attachments in a gallery so we can get the URL of the next adjacent image in a gallery,
-        * or the first image (if we're looking at the last image in a gallery), or, in a gallery of one, just the link to that image file
-        */
-       $attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
-       foreach ( $attachments as $k => $attachment ) {
-               if ( $attachment->ID == $post->ID )
-                       break;
-       }
-       $k++;
-       // If there is more than 1 attachment in a gallery
-       if ( count( $attachments ) > 1 ) {
-               if ( isset( $attachments[ $k ] ) )
-                       // get the URL of the next image attachment
-                       $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
-               else
-                       // or get the URL of the first image attachment
-                       $next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID );
-       } else {
-               // or, if there's only 1 image, get the URL of the image
-               $next_attachment_url = wp_get_attachment_url();
-       }
-?>
-                                                                       <a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php
-                                                                       $attachment_size = apply_filters( 'twentyeleven_attachment_size', 848 );
-                                                                       echo wp_get_attachment_image( $post->ID, array( $attachment_size, 1024 ) ); // filterable image width with 1024px limit for image height.
-                                                                       ?></a>
-
-                                                                       <?php if ( ! empty( $post->post_excerpt ) ) : ?>
-                                                                       <div class="entry-caption">
-                                                                               <?php the_excerpt(); ?>
-                                                                       </div>
-                                                                       <?php endif; ?>
-                                                               </div><!-- .attachment -->
-
-                                                       </div><!-- .entry-attachment -->
-
-                                                       <div class="entry-description">
-                                                               <?php the_content(); ?>
-                                                               <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
-                                                       </div><!-- .entry-description -->
-
-                                               </div><!-- .entry-content -->
-
-                                       </article><!-- #post-<?php the_ID(); ?> -->
-
-                                       <?php comments_template(); ?>
-
-                               <?php endwhile; // end of the loop. ?>
-
-                       </div><!-- #content -->
-               </div><!-- #primary -->
-
-<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/images/comment-arrow-bypostauthor-dark-rtl.png b/wp-content/themes/twentyeleven/images/comment-arrow-bypostauthor-dark-rtl.png
deleted file mode 100644 (file)
index 46dac85..0000000
Binary files a/wp-content/themes/twentyeleven/images/comment-arrow-bypostauthor-dark-rtl.png and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/comment-arrow-bypostauthor-dark.png b/wp-content/themes/twentyeleven/images/comment-arrow-bypostauthor-dark.png
deleted file mode 100644 (file)
index e32e285..0000000
Binary files a/wp-content/themes/twentyeleven/images/comment-arrow-bypostauthor-dark.png and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/comment-arrow-bypostauthor-rtl.png b/wp-content/themes/twentyeleven/images/comment-arrow-bypostauthor-rtl.png
deleted file mode 100644 (file)
index 9ae83f0..0000000
Binary files a/wp-content/themes/twentyeleven/images/comment-arrow-bypostauthor-rtl.png and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/comment-arrow-bypostauthor.png b/wp-content/themes/twentyeleven/images/comment-arrow-bypostauthor.png
deleted file mode 100644 (file)
index bf9d3d9..0000000
Binary files a/wp-content/themes/twentyeleven/images/comment-arrow-bypostauthor.png and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/comment-arrow-dark-rtl.png b/wp-content/themes/twentyeleven/images/comment-arrow-dark-rtl.png
deleted file mode 100644 (file)
index 3644fdd..0000000
Binary files a/wp-content/themes/twentyeleven/images/comment-arrow-dark-rtl.png and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/comment-arrow-dark.png b/wp-content/themes/twentyeleven/images/comment-arrow-dark.png
deleted file mode 100644 (file)
index f9b624b..0000000
Binary files a/wp-content/themes/twentyeleven/images/comment-arrow-dark.png and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/comment-arrow-rtl.png b/wp-content/themes/twentyeleven/images/comment-arrow-rtl.png
deleted file mode 100644 (file)
index e3fb1fd..0000000
Binary files a/wp-content/themes/twentyeleven/images/comment-arrow-rtl.png and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/comment-arrow.png b/wp-content/themes/twentyeleven/images/comment-arrow.png
deleted file mode 100644 (file)
index 60a6d5d..0000000
Binary files a/wp-content/themes/twentyeleven/images/comment-arrow.png and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/comment-bubble-dark-rtl.png b/wp-content/themes/twentyeleven/images/comment-bubble-dark-rtl.png
deleted file mode 100644 (file)
index f8c5061..0000000
Binary files a/wp-content/themes/twentyeleven/images/comment-bubble-dark-rtl.png and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/comment-bubble-dark.png b/wp-content/themes/twentyeleven/images/comment-bubble-dark.png
deleted file mode 100644 (file)
index 2d1ca1a..0000000
Binary files a/wp-content/themes/twentyeleven/images/comment-bubble-dark.png and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/comment-bubble-rtl.png b/wp-content/themes/twentyeleven/images/comment-bubble-rtl.png
deleted file mode 100644 (file)
index 55ff63f..0000000
Binary files a/wp-content/themes/twentyeleven/images/comment-bubble-rtl.png and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/comment-bubble.png b/wp-content/themes/twentyeleven/images/comment-bubble.png
deleted file mode 100644 (file)
index 1798846..0000000
Binary files a/wp-content/themes/twentyeleven/images/comment-bubble.png and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/headers/chessboard-thumbnail.jpg b/wp-content/themes/twentyeleven/images/headers/chessboard-thumbnail.jpg
deleted file mode 100644 (file)
index e8c84d3..0000000
Binary files a/wp-content/themes/twentyeleven/images/headers/chessboard-thumbnail.jpg and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/headers/chessboard.jpg b/wp-content/themes/twentyeleven/images/headers/chessboard.jpg
deleted file mode 100644 (file)
index 831961f..0000000
Binary files a/wp-content/themes/twentyeleven/images/headers/chessboard.jpg and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/headers/hanoi-thumbnail.jpg b/wp-content/themes/twentyeleven/images/headers/hanoi-thumbnail.jpg
deleted file mode 100644 (file)
index 9fc963f..0000000
Binary files a/wp-content/themes/twentyeleven/images/headers/hanoi-thumbnail.jpg and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/headers/hanoi.jpg b/wp-content/themes/twentyeleven/images/headers/hanoi.jpg
deleted file mode 100644 (file)
index 5b0fa3f..0000000
Binary files a/wp-content/themes/twentyeleven/images/headers/hanoi.jpg and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/headers/lanterns-thumbnail.jpg b/wp-content/themes/twentyeleven/images/headers/lanterns-thumbnail.jpg
deleted file mode 100644 (file)
index 3790f96..0000000
Binary files a/wp-content/themes/twentyeleven/images/headers/lanterns-thumbnail.jpg and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/headers/lanterns.jpg b/wp-content/themes/twentyeleven/images/headers/lanterns.jpg
deleted file mode 100644 (file)
index f71ce8f..0000000
Binary files a/wp-content/themes/twentyeleven/images/headers/lanterns.jpg and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/headers/pine-cone-thumbnail.jpg b/wp-content/themes/twentyeleven/images/headers/pine-cone-thumbnail.jpg
deleted file mode 100644 (file)
index 248fe00..0000000
Binary files a/wp-content/themes/twentyeleven/images/headers/pine-cone-thumbnail.jpg and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/headers/pine-cone.jpg b/wp-content/themes/twentyeleven/images/headers/pine-cone.jpg
deleted file mode 100644 (file)
index e55ce97..0000000
Binary files a/wp-content/themes/twentyeleven/images/headers/pine-cone.jpg and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/headers/shore-thumbnail.jpg b/wp-content/themes/twentyeleven/images/headers/shore-thumbnail.jpg
deleted file mode 100644 (file)
index 5e5e740..0000000
Binary files a/wp-content/themes/twentyeleven/images/headers/shore-thumbnail.jpg and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/headers/shore.jpg b/wp-content/themes/twentyeleven/images/headers/shore.jpg
deleted file mode 100644 (file)
index 71a8c54..0000000
Binary files a/wp-content/themes/twentyeleven/images/headers/shore.jpg and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/headers/trolley-thumbnail.jpg b/wp-content/themes/twentyeleven/images/headers/trolley-thumbnail.jpg
deleted file mode 100644 (file)
index d2ee200..0000000
Binary files a/wp-content/themes/twentyeleven/images/headers/trolley-thumbnail.jpg and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/headers/trolley.jpg b/wp-content/themes/twentyeleven/images/headers/trolley.jpg
deleted file mode 100644 (file)
index 110a764..0000000
Binary files a/wp-content/themes/twentyeleven/images/headers/trolley.jpg and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/headers/wheel-thumbnail.jpg b/wp-content/themes/twentyeleven/images/headers/wheel-thumbnail.jpg
deleted file mode 100644 (file)
index d7fa971..0000000
Binary files a/wp-content/themes/twentyeleven/images/headers/wheel-thumbnail.jpg and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/headers/wheel.jpg b/wp-content/themes/twentyeleven/images/headers/wheel.jpg
deleted file mode 100644 (file)
index c5b9878..0000000
Binary files a/wp-content/themes/twentyeleven/images/headers/wheel.jpg and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/headers/willow-thumbnail.jpg b/wp-content/themes/twentyeleven/images/headers/willow-thumbnail.jpg
deleted file mode 100644 (file)
index 240fff8..0000000
Binary files a/wp-content/themes/twentyeleven/images/headers/willow-thumbnail.jpg and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/headers/willow.jpg b/wp-content/themes/twentyeleven/images/headers/willow.jpg
deleted file mode 100644 (file)
index e867cc4..0000000
Binary files a/wp-content/themes/twentyeleven/images/headers/willow.jpg and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/search.png b/wp-content/themes/twentyeleven/images/search.png
deleted file mode 100644 (file)
index 5036704..0000000
Binary files a/wp-content/themes/twentyeleven/images/search.png and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/images/wordpress.png b/wp-content/themes/twentyeleven/images/wordpress.png
deleted file mode 100644 (file)
index 4a15056..0000000
Binary files a/wp-content/themes/twentyeleven/images/wordpress.png and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/inc/images/content-sidebar.png b/wp-content/themes/twentyeleven/inc/images/content-sidebar.png
deleted file mode 100644 (file)
index 71a23f7..0000000
Binary files a/wp-content/themes/twentyeleven/inc/images/content-sidebar.png and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/inc/images/content.png b/wp-content/themes/twentyeleven/inc/images/content.png
deleted file mode 100644 (file)
index 301a294..0000000
Binary files a/wp-content/themes/twentyeleven/inc/images/content.png and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/inc/images/dark.png b/wp-content/themes/twentyeleven/inc/images/dark.png
deleted file mode 100644 (file)
index 76b8dad..0000000
Binary files a/wp-content/themes/twentyeleven/inc/images/dark.png and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/inc/images/light.png b/wp-content/themes/twentyeleven/inc/images/light.png
deleted file mode 100644 (file)
index 42d8925..0000000
Binary files a/wp-content/themes/twentyeleven/inc/images/light.png and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/inc/images/sidebar-content.png b/wp-content/themes/twentyeleven/inc/images/sidebar-content.png
deleted file mode 100644 (file)
index 579b9fd..0000000
Binary files a/wp-content/themes/twentyeleven/inc/images/sidebar-content.png and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/inc/theme-customizer.js b/wp-content/themes/twentyeleven/inc/theme-customizer.js
deleted file mode 100644 (file)
index ca63fda..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-( function( $ ){
-       wp.customize( 'blogname', function( value ) {
-               value.bind( function( to ) {
-                       $( '#site-title a' ).html( to );
-               } );
-       } );
-       wp.customize( 'blogdescription', function( value ) {
-               value.bind( function( to ) {
-                       $( '#site-description' ).html( to );
-               } );
-       } );
-} )( jQuery );
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/inc/theme-options.css b/wp-content/themes/twentyeleven/inc/theme-options.css
deleted file mode 100644 (file)
index 464ab8c..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#wpcontent select option {
-       padding-right: 5px;
-}
-.image-radio-option td {
-       padding-top: 15px;
-}
-.image-radio-option label {
-       display: block;
-       float: left;
-       margin: 0 30px 20px 2px;
-       position: relative;
-}
-.image-radio-option input {
-       margin: 0 0 10px;
-}
-.image-radio-option span {
-       display: block;
-       width: 136px;
-}
-.image-radio-option img {
-       margin: 0 0 0 -2px;
-}
-#link-color-example {
-       -moz-border-radius: 4px;
-       -webkit-border-radius: 4px;
-       border-radius: 4px;
-       border: 1px solid #dfdfdf;
-       margin: 0 7px 0 3px;
-       padding: 4px 14px;
-}
-
-body.rtl .image-radio-option label {
-       float: right;
-       margin: 0 2px 20px 30px;
-}
diff --git a/wp-content/themes/twentyeleven/inc/theme-options.js b/wp-content/themes/twentyeleven/inc/theme-options.js
deleted file mode 100644 (file)
index 4cfaec1..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-var farbtastic;
-
-(function($){
-       var pickColor = function(a) {
-               farbtastic.setColor(a);
-               $('#link-color').val(a);
-               $('#link-color-example').css('background-color', a);
-       };
-
-       $(document).ready( function() {
-               $('#default-color').wrapInner('<a href="#" />');
-
-               farbtastic = $.farbtastic('#colorPickerDiv', pickColor);
-
-               pickColor( $('#link-color').val() );
-
-               $('.pickcolor').click( function(e) {
-                       $('#colorPickerDiv').show();
-                       e.preventDefault();
-               });
-
-               $('#link-color').keyup( function() {
-                       var a = $('#link-color').val(),
-                               b = a;
-
-                       a = a.replace(/[^a-fA-F0-9]/, '');
-                       if ( '#' + a !== b )
-                               $('#link-color').val(a);
-                       if ( a.length === 3 || a.length === 6 )
-                               pickColor( '#' + a );
-               });
-
-               $(document).mousedown( function() {
-                       $('#colorPickerDiv').hide();
-               });
-
-               $('#default-color a').click( function(e) {
-                       pickColor( '#' + this.innerHTML.replace(/[^a-fA-F0-9]/, '') );
-                       e.preventDefault();
-               });
-
-               $('.image-radio-option.color-scheme input:radio').change( function() {
-                       var currentDefault = $('#default-color a'),
-                               newDefault = $(this).next().val();
-
-                       if ( $('#link-color').val() == currentDefault.text() )
-                               pickColor( newDefault );
-
-                       currentDefault.text( newDefault );
-               });
-       });
-})(jQuery);
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/inc/theme-options.php b/wp-content/themes/twentyeleven/inc/theme-options.php
deleted file mode 100644 (file)
index 698f2a0..0000000
+++ /dev/null
@@ -1,531 +0,0 @@
-<?php
-/**
- * Twenty Eleven Theme Options
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-
-/**
- * Properly enqueue styles and scripts for our theme options page.
- *
- * This function is attached to the admin_enqueue_scripts action hook.
- *
- * @since Twenty Eleven 1.0
- *
- */
-function twentyeleven_admin_enqueue_scripts( $hook_suffix ) {
-       wp_enqueue_style( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.css', false, '2011-04-28' );
-       wp_enqueue_script( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.js', array( 'farbtastic' ), '2011-06-10' );
-       wp_enqueue_style( 'farbtastic' );
-}
-add_action( 'admin_print_styles-appearance_page_theme_options', 'twentyeleven_admin_enqueue_scripts' );
-
-/**
- * Register the form setting for our twentyeleven_options array.
- *
- * This function is attached to the admin_init action hook.
- *
- * This call to register_setting() registers a validation callback, twentyeleven_theme_options_validate(),
- * which is used when the option is saved, to ensure that our option values are complete, properly
- * formatted, and safe.
- *
- * @since Twenty Eleven 1.0
- */
-function twentyeleven_theme_options_init() {
-
-       register_setting(
-               'twentyeleven_options',       // Options group, see settings_fields() call in twentyeleven_theme_options_render_page()
-               'twentyeleven_theme_options', // Database option, see twentyeleven_get_theme_options()
-               'twentyeleven_theme_options_validate' // The sanitization callback, see twentyeleven_theme_options_validate()
-       );
-
-       // Register our settings field group
-       add_settings_section(
-               'general', // Unique identifier for the settings section
-               '', // Section title (we don't want one)
-               '__return_false', // Section callback (we don't want anything)
-               'theme_options' // Menu slug, used to uniquely identify the page; see twentyeleven_theme_options_add_page()
-       );
-
-       // Register our individual settings fields
-       add_settings_field(
-               'color_scheme',  // Unique identifier for the field for this section
-               __( 'Color Scheme', 'twentyeleven' ), // Setting field label
-               'twentyeleven_settings_field_color_scheme', // Function that renders the settings field
-               'theme_options', // Menu slug, used to uniquely identify the page; see twentyeleven_theme_options_add_page()
-               'general' // Settings section. Same as the first argument in the add_settings_section() above
-       );
-
-       add_settings_field( 'link_color', __( 'Link Color',     'twentyeleven' ), 'twentyeleven_settings_field_link_color', 'theme_options', 'general' );
-       add_settings_field( 'layout',     __( 'Default Layout', 'twentyeleven' ), 'twentyeleven_settings_field_layout',     'theme_options', 'general' );
-}
-add_action( 'admin_init', 'twentyeleven_theme_options_init' );
-
-/**
- * Change the capability required to save the 'twentyeleven_options' options group.
- *
- * @see twentyeleven_theme_options_init() First parameter to register_setting() is the name of the options group.
- * @see twentyeleven_theme_options_add_page() The edit_theme_options capability is used for viewing the page.
- *
- * By default, the options groups for all registered settings require the manage_options capability.
- * This filter is required to change our theme options page to edit_theme_options instead.
- * By default, only administrators have either of these capabilities, but the desire here is
- * to allow for finer-grained control for roles and users.
- *
- * @param string $capability The capability used for the page, which is manage_options by default.
- * @return string The capability to actually use.
- */
-function twentyeleven_option_page_capability( $capability ) {
-       return 'edit_theme_options';
-}
-add_filter( 'option_page_capability_twentyeleven_options', 'twentyeleven_option_page_capability' );
-
-/**
- * Add our theme options page to the admin menu, including some help documentation.
- *
- * This function is attached to the admin_menu action hook.
- *
- * @since Twenty Eleven 1.0
- */
-function twentyeleven_theme_options_add_page() {
-       $theme_page = add_theme_page(
-               __( 'Theme Options', 'twentyeleven' ),   // Name of page
-               __( 'Theme Options', 'twentyeleven' ),   // Label in menu
-               'edit_theme_options',                    // Capability required
-               'theme_options',                         // Menu slug, used to uniquely identify the page
-               'twentyeleven_theme_options_render_page' // Function that renders the options page
-       );
-
-       if ( ! $theme_page )
-               return;
-
-       add_action( "load-$theme_page", 'twentyeleven_theme_options_help' );
-}
-add_action( 'admin_menu', 'twentyeleven_theme_options_add_page' );
-
-function twentyeleven_theme_options_help() {
-
-       $help = '<p>' . __( 'Some themes provide customization options that are grouped together on a Theme Options screen. If you change themes, options may change or disappear, as they are theme-specific. Your current theme, Twenty Eleven, provides the following Theme Options:', 'twentyeleven' ) . '</p>' .
-                       '<ol>' .
-                               '<li>' . __( '<strong>Color Scheme</strong>: You can choose a color palette of "Light" (light background with dark text) or "Dark" (dark background with light text) for your site.', 'twentyeleven' ) . '</li>' .
-                               '<li>' . __( '<strong>Link Color</strong>: You can choose the color used for text links on your site. You can enter the HTML color or hex code, or you can choose visually by clicking the "Select a Color" button to pick from a color wheel.', 'twentyeleven' ) . '</li>' .
-                               '<li>' . __( '<strong>Default Layout</strong>: You can choose if you want your site&#8217;s default layout to have a sidebar on the left, the right, or not at all.', 'twentyeleven' ) . '</li>' .
-                       '</ol>' .
-                       '<p>' . __( 'Remember to click "Save Changes" to save any changes you have made to the theme options.', 'twentyeleven' ) . '</p>';
-
-       $sidebar = '<p><strong>' . __( 'For more information:', 'twentyeleven' ) . '</strong></p>' .
-               '<p>' . __( '<a href="http://codex.wordpress.org/Appearance_Theme_Options_Screen" target="_blank">Documentation on Theme Options</a>', 'twentyeleven' ) . '</p>' .
-               '<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>', 'twentyeleven' ) . '</p>';
-
-       $screen = get_current_screen();
-
-       if ( method_exists( $screen, 'add_help_tab' ) ) {
-               // WordPress 3.3
-               $screen->add_help_tab( array(
-                       'title' => __( 'Overview', 'twentyeleven' ),
-                       'id' => 'theme-options-help',
-                       'content' => $help,
-                       )
-               );
-
-               $screen->set_help_sidebar( $sidebar );
-       } else {
-               // WordPress 3.2
-               add_contextual_help( $screen, $help . $sidebar );
-       }
-}
-
-/**
- * Returns an array of color schemes registered for Twenty Eleven.
- *
- * @since Twenty Eleven 1.0
- */
-function twentyeleven_color_schemes() {
-       $color_scheme_options = array(
-               'light' => array(
-                       'value' => 'light',
-                       'label' => __( 'Light', 'twentyeleven' ),
-                       'thumbnail' => get_template_directory_uri() . '/inc/images/light.png',
-                       'default_link_color' => '#1b8be0',
-               ),
-               'dark' => array(
-                       'value' => 'dark',
-                       'label' => __( 'Dark', 'twentyeleven' ),
-                       'thumbnail' => get_template_directory_uri() . '/inc/images/dark.png',
-                       'default_link_color' => '#e4741f',
-               ),
-       );
-
-       return apply_filters( 'twentyeleven_color_schemes', $color_scheme_options );
-}
-
-/**
- * Returns an array of layout options registered for Twenty Eleven.
- *
- * @since Twenty Eleven 1.0
- */
-function twentyeleven_layouts() {
-       $layout_options = array(
-               'content-sidebar' => array(
-                       'value' => 'content-sidebar',
-                       'label' => __( 'Content on left', 'twentyeleven' ),
-                       'thumbnail' => get_template_directory_uri() . '/inc/images/content-sidebar.png',
-               ),
-               'sidebar-content' => array(
-                       'value' => 'sidebar-content',
-                       'label' => __( 'Content on right', 'twentyeleven' ),
-                       'thumbnail' => get_template_directory_uri() . '/inc/images/sidebar-content.png',
-               ),
-               'content' => array(
-                       'value' => 'content',
-                       'label' => __( 'One-column, no sidebar', 'twentyeleven' ),
-                       'thumbnail' => get_template_directory_uri() . '/inc/images/content.png',
-               ),
-       );
-
-       return apply_filters( 'twentyeleven_layouts', $layout_options );
-}
-
-/**
- * Returns the default options for Twenty Eleven.
- *
- * @since Twenty Eleven 1.0
- */
-function twentyeleven_get_default_theme_options() {
-       $default_theme_options = array(
-               'color_scheme' => 'light',
-               'link_color'   => twentyeleven_get_default_link_color( 'light' ),
-               'theme_layout' => 'content-sidebar',
-       );
-
-       if ( is_rtl() )
-               $default_theme_options['theme_layout'] = 'sidebar-content';
-
-       return apply_filters( 'twentyeleven_default_theme_options', $default_theme_options );
-}
-
-/**
- * Returns the default link color for Twenty Eleven, based on color scheme.
- *
- * @since Twenty Eleven 1.0
- *
- * @param $string $color_scheme Color scheme. Defaults to the active color scheme.
- * @return $string Color.
-*/
-function twentyeleven_get_default_link_color( $color_scheme = null ) {
-       if ( null === $color_scheme ) {
-               $options = twentyeleven_get_theme_options();
-               $color_scheme = $options['color_scheme'];
-       }
-
-       $color_schemes = twentyeleven_color_schemes();
-       if ( ! isset( $color_schemes[ $color_scheme ] ) )
-               return false;
-
-       return $color_schemes[ $color_scheme ]['default_link_color'];
-}
-
-/**
- * Returns the options array for Twenty Eleven.
- *
- * @since Twenty Eleven 1.0
- */
-function twentyeleven_get_theme_options() {
-       return get_option( 'twentyeleven_theme_options', twentyeleven_get_default_theme_options() );
-}
-
-/**
- * Renders the Color Scheme setting field.
- *
- * @since Twenty Eleven 1.3
- */
-function twentyeleven_settings_field_color_scheme() {
-       $options = twentyeleven_get_theme_options();
-
-       foreach ( twentyeleven_color_schemes() as $scheme ) {
-       ?>
-       <div class="layout image-radio-option color-scheme">
-       <label class="description">
-               <input type="radio" name="twentyeleven_theme_options[color_scheme]" value="<?php echo esc_attr( $scheme['value'] ); ?>" <?php checked( $options['color_scheme'], $scheme['value'] ); ?> />
-               <input type="hidden" id="default-color-<?php echo esc_attr( $scheme['value'] ); ?>" value="<?php echo esc_attr( $scheme['default_link_color'] ); ?>" />
-               <span>
-                       <img src="<?php echo esc_url( $scheme['thumbnail'] ); ?>" width="136" height="122" alt="" />
-                       <?php echo $scheme['label']; ?>
-               </span>
-       </label>
-       </div>
-       <?php
-       }
-}
-
-/**
- * Renders the Link Color setting field.
- *
- * @since Twenty Eleven 1.3
- */
-function twentyeleven_settings_field_link_color() {
-       $options = twentyeleven_get_theme_options();
-       ?>
-       <input type="text" name="twentyeleven_theme_options[link_color]" id="link-color" value="<?php echo esc_attr( $options['link_color'] ); ?>" />
-       <a href="#" class="pickcolor hide-if-no-js" id="link-color-example"></a>
-       <input type="button" class="pickcolor button hide-if-no-js" value="<?php esc_attr_e( 'Select a Color', 'twentyeleven' ); ?>" />
-       <div id="colorPickerDiv" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div>
-       <br />
-       <span><?php printf( __( 'Default color: %s', 'twentyeleven' ), '<span id="default-color">' . twentyeleven_get_default_link_color( $options['color_scheme'] ) . '</span>' ); ?></span>
-       <?php
-}
-
-/**
- * Renders the Layout setting field.
- *
- * @since Twenty Eleven 1.3
- */
-function twentyeleven_settings_field_layout() {
-       $options = twentyeleven_get_theme_options();
-       foreach ( twentyeleven_layouts() as $layout ) {
-               ?>
-               <div class="layout image-radio-option theme-layout">
-               <label class="description">
-                       <input type="radio" name="twentyeleven_theme_options[theme_layout]" value="<?php echo esc_attr( $layout['value'] ); ?>" <?php checked( $options['theme_layout'], $layout['value'] ); ?> />
-                       <span>
-                               <img src="<?php echo esc_url( $layout['thumbnail'] ); ?>" width="136" height="122" alt="" />
-                               <?php echo $layout['label']; ?>
-                       </span>
-               </label>
-               </div>
-               <?php
-       }
-}
-
-/**
- * Returns the options array for Twenty Eleven.
- *
- * @since Twenty Eleven 1.2
- */
-function twentyeleven_theme_options_render_page() {
-       ?>
-       <div class="wrap">
-               <?php screen_icon(); ?>
-               <?php $theme_name = function_exists( 'wp_get_theme' ) ? wp_get_theme() : get_current_theme(); ?>
-               <h2><?php printf( __( '%s Theme Options', 'twentyeleven' ), $theme_name ); ?></h2>
-               <?php settings_errors(); ?>
-
-               <form method="post" action="options.php">
-                       <?php
-                               settings_fields( 'twentyeleven_options' );
-                               do_settings_sections( 'theme_options' );
-                               submit_button();
-                       ?>
-               </form>
-       </div>
-       <?php
-}
-
-/**
- * Sanitize and validate form input. Accepts an array, return a sanitized array.
- *
- * @see twentyeleven_theme_options_init()
- * @todo set up Reset Options action
- *
- * @since Twenty Eleven 1.0
- */
-function twentyeleven_theme_options_validate( $input ) {
-       $output = $defaults = twentyeleven_get_default_theme_options();
-
-       // Color scheme must be in our array of color scheme options
-       if ( isset( $input['color_scheme'] ) && array_key_exists( $input['color_scheme'], twentyeleven_color_schemes() ) )
-               $output['color_scheme'] = $input['color_scheme'];
-
-       // Our defaults for the link color may have changed, based on the color scheme.
-       $output['link_color'] = $defaults['link_color'] = twentyeleven_get_default_link_color( $output['color_scheme'] );
-
-       // Link color must be 3 or 6 hexadecimal characters
-       if ( isset( $input['link_color'] ) && preg_match( '/^#?([a-f0-9]{3}){1,2}$/i', $input['link_color'] ) )
-               $output['link_color'] = '#' . strtolower( ltrim( $input['link_color'], '#' ) );
-
-       // Theme layout must be in our array of theme layout options
-       if ( isset( $input['theme_layout'] ) && array_key_exists( $input['theme_layout'], twentyeleven_layouts() ) )
-               $output['theme_layout'] = $input['theme_layout'];
-
-       return apply_filters( 'twentyeleven_theme_options_validate', $output, $input, $defaults );
-}
-
-/**
- * Enqueue the styles for the current color scheme.
- *
- * @since Twenty Eleven 1.0
- */
-function twentyeleven_enqueue_color_scheme() {
-       $options = twentyeleven_get_theme_options();
-       $color_scheme = $options['color_scheme'];
-
-       if ( 'dark' == $color_scheme )
-               wp_enqueue_style( 'dark', get_template_directory_uri() . '/colors/dark.css', array(), null );
-
-       do_action( 'twentyeleven_enqueue_color_scheme', $color_scheme );
-}
-add_action( 'wp_enqueue_scripts', 'twentyeleven_enqueue_color_scheme' );
-
-/**
- * Add a style block to the theme for the current link color.
- *
- * This function is attached to the wp_head action hook.
- *
- * @since Twenty Eleven 1.0
- */
-function twentyeleven_print_link_color_style() {
-       $options = twentyeleven_get_theme_options();
-       $link_color = $options['link_color'];
-
-       $default_options = twentyeleven_get_default_theme_options();
-
-       // Don't do anything if the current link color is the default.
-       if ( $default_options['link_color'] == $link_color )
-               return;
-?>
-       <style>
-               /* Link color */
-               a,
-               #site-title a:focus,
-               #site-title a:hover,
-               #site-title a:active,
-               .entry-title a:hover,
-               .entry-title a:focus,
-               .entry-title a:active,
-               .widget_twentyeleven_ephemera .comments-link a:hover,
-               section.recent-posts .other-recent-posts a[rel="bookmark"]:hover,
-               section.recent-posts .other-recent-posts .comments-link a:hover,
-               .format-image footer.entry-meta a:hover,
-               #site-generator a:hover {
-                       color: <?php echo $link_color; ?>;
-               }
-               section.recent-posts .other-recent-posts .comments-link a:hover {
-                       border-color: <?php echo $link_color; ?>;
-               }
-               article.feature-image.small .entry-summary p a:hover,
-               .entry-header .comments-link a:hover,
-               .entry-header .comments-link a:focus,
-               .entry-header .comments-link a:active,
-               .feature-slider a.active {
-                       background-color: <?php echo $link_color; ?>;
-               }
-       </style>
-<?php
-}
-add_action( 'wp_head', 'twentyeleven_print_link_color_style' );
-
-/**
- * Adds Twenty Eleven layout classes to the array of body classes.
- *
- * @since Twenty Eleven 1.0
- */
-function twentyeleven_layout_classes( $existing_classes ) {
-       $options = twentyeleven_get_theme_options();
-       $current_layout = $options['theme_layout'];
-
-       if ( in_array( $current_layout, array( 'content-sidebar', 'sidebar-content' ) ) )
-               $classes = array( 'two-column' );
-       else
-               $classes = array( 'one-column' );
-
-       if ( 'content-sidebar' == $current_layout )
-               $classes[] = 'right-sidebar';
-       elseif ( 'sidebar-content' == $current_layout )
-               $classes[] = 'left-sidebar';
-       else
-               $classes[] = $current_layout;
-
-       $classes = apply_filters( 'twentyeleven_layout_classes', $classes, $current_layout );
-
-       return array_merge( $existing_classes, $classes );
-}
-add_filter( 'body_class', 'twentyeleven_layout_classes' );
-
-/**
- * Implements Twenty Eleven theme options into Theme Customizer
- *
- * @param $wp_customize Theme Customizer object
- * @return void
- *
- * @since Twenty Eleven 1.3
- */
-function twentyeleven_customize_register( $wp_customize ) {
-       $wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
-       $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
-
-       $options  = twentyeleven_get_theme_options();
-       $defaults = twentyeleven_get_default_theme_options();
-
-       $wp_customize->add_setting( 'twentyeleven_theme_options[color_scheme]', array(
-               'default'    => $defaults['color_scheme'],
-               'type'       => 'option',
-               'capability' => 'edit_theme_options',
-       ) );
-
-       $schemes = twentyeleven_color_schemes();
-       $choices = array();
-       foreach ( $schemes as $scheme ) {
-               $choices[ $scheme['value'] ] = $scheme['label'];
-       }
-
-       $wp_customize->add_control( 'twentyeleven_color_scheme', array(
-               'label'    => __( 'Color Scheme', 'twentyeleven' ),
-               'section'  => 'colors',
-               'settings' => 'twentyeleven_theme_options[color_scheme]',
-               'type'     => 'radio',
-               'choices'  => $choices,
-               'priority' => 5,
-       ) );
-
-       // Link Color (added to Color Scheme section in Theme Customizer)
-       $wp_customize->add_setting( 'twentyeleven_theme_options[link_color]', array(
-               'default'           => twentyeleven_get_default_link_color( $options['color_scheme'] ),
-               'type'              => 'option',
-               'sanitize_callback' => 'sanitize_hex_color',
-               'capability'        => 'edit_theme_options',
-       ) );
-
-       $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_color', array(
-               'label'    => __( 'Link Color', 'twentyeleven' ),
-               'section'  => 'colors',
-               'settings' => 'twentyeleven_theme_options[link_color]',
-       ) ) );
-
-       // Default Layout
-       $wp_customize->add_section( 'twentyeleven_layout', array(
-               'title'    => __( 'Layout', 'twentyeleven' ),
-               'priority' => 50,
-       ) );
-
-       $wp_customize->add_setting( 'twentyeleven_theme_options[theme_layout]', array(
-               'type'              => 'option',
-               'default'           => $defaults['theme_layout'],
-               'sanitize_callback' => 'sanitize_key',
-       ) );
-
-       $layouts = twentyeleven_layouts();
-       $choices = array();
-       foreach ( $layouts as $layout ) {
-               $choices[$layout['value']] = $layout['label'];
-       }
-
-       $wp_customize->add_control( 'twentyeleven_theme_options[theme_layout]', array(
-               'section'    => 'twentyeleven_layout',
-               'type'       => 'radio',
-               'choices'    => $choices,
-       ) );
-}
-add_action( 'customize_register', 'twentyeleven_customize_register' );
-
-/**
- * Bind JS handlers to make Theme Customizer preview reload changes asynchronously.
- * Used with blogname and blogdescription.
- *
- * @since Twenty Eleven 1.3
- */
-function twentyeleven_customize_preview_js() {
-       wp_enqueue_script( 'twentyeleven-customizer', get_template_directory_uri() . '/inc/theme-customizer.js', array( 'customize-preview' ), '20120523', true );
-}
-add_action( 'customize_preview_init', 'twentyeleven_customize_preview_js' );
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/inc/widgets.php b/wp-content/themes/twentyeleven/inc/widgets.php
deleted file mode 100644 (file)
index b39fc72..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-<?php
-/**
- * Makes a custom Widget for displaying Aside, Link, Status, and Quote Posts available with Twenty Eleven
- *
- * Learn more: http://codex.wordpress.org/Widgets_API#Developing_Widgets
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-class Twenty_Eleven_Ephemera_Widget extends WP_Widget {
-
-       /**
-        * Constructor
-        *
-        * @return void
-        **/
-       function Twenty_Eleven_Ephemera_Widget() {
-               $widget_ops = array( 'classname' => 'widget_twentyeleven_ephemera', 'description' => __( 'Use this widget to list your recent Aside, Status, Quote, and Link posts', 'twentyeleven' ) );
-               $this->WP_Widget( 'widget_twentyeleven_ephemera', __( 'Twenty Eleven Ephemera', 'twentyeleven' ), $widget_ops );
-               $this->alt_option_name = 'widget_twentyeleven_ephemera';
-
-               add_action( 'save_post', array(&$this, 'flush_widget_cache' ) );
-               add_action( 'deleted_post', array(&$this, 'flush_widget_cache' ) );
-               add_action( 'switch_theme', array(&$this, 'flush_widget_cache' ) );
-       }
-
-       /**
-        * Outputs the HTML for this widget.
-        *
-        * @param array An array of standard parameters for widgets in this theme
-        * @param array An array of settings for this widget instance
-        * @return void Echoes it's output
-        **/
-       function widget( $args, $instance ) {
-               $cache = wp_cache_get( 'widget_twentyeleven_ephemera', 'widget' );
-
-               if ( !is_array( $cache ) )
-                       $cache = array();
-
-               if ( ! isset( $args['widget_id'] ) )
-                       $args['widget_id'] = null;
-
-               if ( isset( $cache[$args['widget_id']] ) ) {
-                       echo $cache[$args['widget_id']];
-                       return;
-               }
-
-               ob_start();
-               extract( $args, EXTR_SKIP );
-
-               $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Ephemera', 'twentyeleven' ) : $instance['title'], $instance, $this->id_base);
-
-               if ( ! isset( $instance['number'] ) )
-                       $instance['number'] = '10';
-
-               if ( ! $number = absint( $instance['number'] ) )
-                       $number = 10;
-
-               $ephemera_args = array(
-                       'order' => 'DESC',
-                       'posts_per_page' => $number,
-                       'no_found_rows' => true,
-                       'post_status' => 'publish',
-                       'post__not_in' => get_option( 'sticky_posts' ),
-                       'tax_query' => array(
-                               array(
-                                       'taxonomy' => 'post_format',
-                                       'terms' => array( 'post-format-aside', 'post-format-link', 'post-format-status', 'post-format-quote' ),
-                                       'field' => 'slug',
-                                       'operator' => 'IN',
-                               ),
-                       ),
-               );
-               $ephemera = new WP_Query( $ephemera_args );
-
-               if ( $ephemera->have_posts() ) :
-                       echo $before_widget;
-                       echo $before_title;
-                       echo $title; // Can set this with a widget option, or omit altogether
-                       echo $after_title;
-                       ?>
-                       <ol>
-                       <?php while ( $ephemera->have_posts() ) : $ephemera->the_post(); ?>
-
-                               <?php if ( 'link' != get_post_format() ) : ?>
-
-                               <li class="widget-entry-title">
-                                       <a href="<?php echo esc_url( get_permalink() ); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
-                                       <span class="comments-link">
-                                               <?php comments_popup_link( __( '0 <span class="reply">comments &rarr;</span>', 'twentyeleven' ), __( '1 <span class="reply">comment &rarr;</span>', 'twentyeleven' ), __( '% <span class="reply">comments &rarr;</span>', 'twentyeleven' ) ); ?>
-                                       </span>
-                               </li>
-
-                               <?php else : ?>
-
-                               <li class="widget-entry-title">
-                                       <?php
-                                               // Grab first link from the post content. If none found, use the post permalink as fallback.
-                                               $link_url = twentyeleven_url_grabber();
-
-                                               if ( empty( $link_url ) )
-                                                       $link_url = get_permalink();
-                                       ?>
-                                       <a href="<?php echo esc_url( $link_url ); ?>" title="<?php echo esc_attr( sprintf( __( 'Link to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?>&nbsp;<span>&rarr;</span></a>
-                                       <span class="comments-link">
-                                               <?php comments_popup_link( __( '0 <span class="reply">comments &rarr;</span>', 'twentyeleven' ), __( '1 <span class="reply">comment &rarr;</span>', 'twentyeleven' ), __( '% <span class="reply">comments &rarr;</span>', 'twentyeleven' ) ); ?>
-                                       </span>
-                               </li>
-
-                               <?php endif; ?>
-
-                       <?php endwhile; ?>
-                       </ol>
-                       <?php
-
-                       echo $after_widget;
-
-                       // Reset the post globals as this query will have stomped on it
-                       wp_reset_postdata();
-
-               // end check for ephemeral posts
-               endif;
-
-               $cache[$args['widget_id']] = ob_get_flush();
-               wp_cache_set( 'widget_twentyeleven_ephemera', $cache, 'widget' );
-       }
-
-       /**
-        * Deals with the settings when they are saved by the admin. Here is
-        * where any validation should be dealt with.
-        **/
-       function update( $new_instance, $old_instance ) {
-               $instance = $old_instance;
-               $instance['title'] = strip_tags( $new_instance['title'] );
-               $instance['number'] = (int) $new_instance['number'];
-               $this->flush_widget_cache();
-
-               $alloptions = wp_cache_get( 'alloptions', 'options' );
-               if ( isset( $alloptions['widget_twentyeleven_ephemera'] ) )
-                       delete_option( 'widget_twentyeleven_ephemera' );
-
-               return $instance;
-       }
-
-       function flush_widget_cache() {
-               wp_cache_delete( 'widget_twentyeleven_ephemera', 'widget' );
-       }
-
-       /**
-        * Displays the form for this widget on the Widgets page of the WP Admin area.
-        **/
-       function form( $instance ) {
-               $title = isset( $instance['title']) ? esc_attr( $instance['title'] ) : '';
-               $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 10;
-?>
-                       <p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title:', 'twentyeleven' ); ?></label>
-                       <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
-
-                       <p><label for="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>"><?php _e( 'Number of posts to show:', 'twentyeleven' ); ?></label>
-                       <input id="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'number' ) ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" size="3" /></p>
-               <?php
-       }
-}
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/index.php b/wp-content/themes/twentyeleven/index.php
deleted file mode 100644 (file)
index f955f34..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<?php
-/**
- * The main template file.
- *
- * This is the most generic template file in a WordPress theme
- * and one of the two required files for a theme (the other being style.css).
- * It is used to display a page when nothing more specific matches a query.
- * E.g., it puts together the home page when no home.php file exists.
- * Learn more: http://codex.wordpress.org/Template_Hierarchy
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- */
-
-get_header(); ?>
-
-               <div id="primary">
-                       <div id="content" role="main">
-
-                       <?php if ( have_posts() ) : ?>
-
-                               <?php twentyeleven_content_nav( 'nav-above' ); ?>
-
-                               <?php /* Start the Loop */ ?>
-                               <?php while ( have_posts() ) : the_post(); ?>
-
-                                       <?php get_template_part( 'content', get_post_format() ); ?>
-
-                               <?php endwhile; ?>
-
-                               <?php twentyeleven_content_nav( 'nav-below' ); ?>
-
-                       <?php else : ?>
-
-                               <article id="post-0" class="post no-results not-found">
-                                       <header class="entry-header">
-                                               <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
-                                       </header><!-- .entry-header -->
-
-                                       <div class="entry-content">
-                                               <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
-                                               <?php get_search_form(); ?>
-                                       </div><!-- .entry-content -->
-                               </article><!-- #post-0 -->
-
-                       <?php endif; ?>
-
-                       </div><!-- #content -->
-               </div><!-- #primary -->
-
-<?php get_sidebar(); ?>
-<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/js/showcase.js b/wp-content/themes/twentyeleven/js/showcase.js
deleted file mode 100644 (file)
index d9fb2fe..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-(function($) {
-       $(document).ready( function() {
-           $('.feature-slider a').click(function(e) {
-               $('.featured-posts section.featured-post').css({
-                   opacity: 0,
-                   visibility: 'hidden'
-               });
-               $(this.hash).css({
-                   opacity: 1,
-                   visibility: 'visible'
-               });
-               $('.feature-slider a').removeClass('active');
-               $(this).addClass('active');
-               e.preventDefault();
-           });
-       });
-})(jQuery);
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/languages/twentyeleven.pot b/wp-content/themes/twentyeleven/languages/twentyeleven.pot
deleted file mode 100644 (file)
index 2d85b58..0000000
+++ /dev/null
@@ -1,660 +0,0 @@
-# Copyright (C) 2013 the WordPress team
-# This file is distributed under the GNU General Public License v2 or later.
-msgid ""
-msgstr ""
-"Project-Id-Version: Twenty Eleven 1.5\n"
-"Report-Msgid-Bugs-To: http://wordpress.org/tags/twentyeleven\n"
-"POT-Creation-Date: 2013-04-26 13:58:43+00:00\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-
-#: 404.php:17
-msgid "This is somewhat embarrassing, isn&rsquo;t it?"
-msgstr ""
-
-#: 404.php:21
-msgid ""
-"It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps "
-"searching, or one of the links below, can help."
-msgstr ""
-
-#: 404.php:28
-msgid "Most Used Categories"
-msgstr ""
-
-#. translators: %1$s: smilie
-#: 404.php:36
-msgid "Try looking in the monthly archives. %1$s"
-msgstr ""
-
-#: archive.php:25
-msgid "Daily Archives: %s"
-msgstr ""
-
-#: archive.php:27
-msgid "Monthly Archives: %s"
-msgstr ""
-
-#: archive.php:27
-msgctxt "monthly archives date format"
-msgid "F Y"
-msgstr ""
-
-#: archive.php:29
-msgid "Yearly Archives: %s"
-msgstr ""
-
-#: archive.php:29
-msgctxt "yearly archives date format"
-msgid "Y"
-msgstr ""
-
-#: archive.php:31
-msgid "Blog Archives"
-msgstr ""
-
-#: archive.php:57 author.php:74 category.php:50 index.php:37 search.php:42
-#: tag.php:50
-msgid "Nothing Found"
-msgstr ""
-
-#: archive.php:61 author.php:78 category.php:54 index.php:41 tag.php:54
-msgid ""
-"Apologies, but no results were found for the requested archive. Perhaps "
-"searching will help find a related post."
-msgstr ""
-
-#: author.php:28
-msgid "Author Archives: %s"
-msgstr ""
-
-#: author.php:49 content-single.php:60
-msgid "About %s"
-msgstr ""
-
-#: category.php:19
-msgid "Category Archives: %s"
-msgstr ""
-
-#: comments.php:17
-msgid ""
-"This post is password protected. Enter the password to view any comments."
-msgstr ""
-
-#: comments.php:33
-msgid "One thought on &ldquo;%2$s&rdquo;"
-msgid_plural "%1$s thoughts on &ldquo;%2$s&rdquo;"
-msgstr[0] ""
-msgstr[1] ""
-
-#: comments.php:40 comments.php:60
-msgid "Comment navigation"
-msgstr ""
-
-#: comments.php:41 comments.php:61
-msgid "&larr; Older Comments"
-msgstr ""
-
-#: comments.php:42 comments.php:62
-msgid "Newer Comments &rarr;"
-msgstr ""
-
-#: comments.php:71
-msgid "Comments are closed."
-msgstr ""
-
-#: content-aside.php:16 content-featured.php:14 content-gallery.php:16
-#: content-gallery.php:48 content-image.php:15 content-link.php:16
-#: content-quote.php:14 content-status.php:15 content.php:15 content.php:19
-#: inc/widgets.php:89 showcase.php:120 showcase.php:199
-msgid "Permalink to %s"
-msgstr ""
-
-#: content-aside.php:17
-msgid "Aside"
-msgstr ""
-
-#: content-aside.php:22 content-image.php:21 content-link.php:22
-#: content-quote.php:24 content-status.php:21 content.php:30
-msgid "Reply"
-msgstr ""
-
-#: content-aside.php:22 content-image.php:21 content-link.php:22
-#: content-quote.php:24 content-status.php:21 content.php:30
-msgctxt "comments number"
-msgid "1"
-msgstr ""
-
-#: content-aside.php:22 content-image.php:21 content-link.php:22
-#: content-quote.php:24 content-status.php:21 content.php:30
-msgctxt "comments number"
-msgid "%"
-msgstr ""
-
-#: content-aside.php:33 content-gallery.php:32 content-image.php:27
-#: content-link.php:33 content-quote.php:35 content-status.php:34
-#: content.php:41 functions.php:345
-msgid "Continue reading <span class=\"meta-nav\">&rarr;</span>"
-msgstr ""
-
-#: content-aside.php:34 content-featured.php:23 content-gallery.php:54
-#: content-image.php:28 content-intro.php:18 content-link.php:34
-#: content-page.php:18 content-quote.php:36 content-single.php:24
-#: content-status.php:35 content.php:42 image.php:90
-msgid "Pages:"
-msgstr ""
-
-#: content-aside.php:42 content-gallery.php:87 content-image.php:64
-#: content-link.php:42 content-quote.php:69 content-status.php:43
-#: content.php:79 showcase.php:201
-msgid "Leave a reply"
-msgstr ""
-
-#: content-aside.php:42 content-gallery.php:87 content-image.php:64
-#: content-link.php:42 content-quote.php:69 content-status.php:43
-#: content.php:79 showcase.php:201
-msgid "<b>1</b> Reply"
-msgstr ""
-
-#: content-aside.php:42 content-gallery.php:87 content-image.php:64
-#: content-link.php:42 content-quote.php:69 content-status.php:43
-#: content.php:79 showcase.php:201
-msgid "<b>%</b> Replies"
-msgstr ""
-
-#: content-aside.php:44 content-featured.php:45 content-gallery.php:90
-#: content-image.php:68 content-intro.php:19 content-link.php:44
-#: content-page.php:21 content-quote.php:72 content-single.php:52
-#: content-status.php:45 content.php:82 functions.php:525 functions.php:553
-#: image.php:41
-msgid "Edit"
-msgstr ""
-
-#. translators: used between list items, there is a space after the comma
-#: content-featured.php:29 content-featured.php:38 content-gallery.php:62
-#: content-gallery.php:72 content-image.php:47 content-image.php:56
-#: content-quote.php:44 content-quote.php:54 content-single.php:30
-#: content-single.php:33 content.php:51 content.php:63
-msgid ", "
-msgstr ""
-
-#: content-featured.php:31
-msgid ""
-"This entry was posted in %1$s and tagged %2$s. Bookmark the <a href=\"%3$s\" "
-"title=\"Permalink to %4$s\" rel=\"bookmark\">permalink</a>."
-msgstr ""
-
-#: content-featured.php:33
-msgid ""
-"This entry was posted in %1$s. Bookmark the <a href=\"%3$s\" title="
-"\"Permalink to %4$s\" rel=\"bookmark\">permalink</a>."
-msgstr ""
-
-#: content-gallery.php:17
-msgid "Gallery"
-msgstr ""
-
-#: content-gallery.php:47
-msgid "This gallery contains <a %1$s>%2$s photo</a>."
-msgid_plural "This gallery contains <a %1$s>%2$s photos</a>."
-msgstr[0] ""
-msgstr[1] ""
-
-#: content-gallery.php:66 content-image.php:51 content-quote.php:48
-#: content.php:55
-msgid "<span class=\"%1$s\">Posted in</span> %2$s"
-msgstr ""
-
-#: content-gallery.php:78 content-image.php:59 content-quote.php:60
-#: content.php:69
-msgid "<span class=\"%1$s\">Tagged</span> %2$s"
-msgstr ""
-
-#: content-image.php:16
-msgid "Image"
-msgstr ""
-
-#: content-image.php:34
-msgid ""
-"<a href=\"%1$s\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"%2$s"
-"\">%3$s</time></a><span class=\"by-author\"> <span class=\"sep\"> by </span> "
-"<span class=\"author vcard\"><a class=\"url fn n\" href=\"%4$s\" title=\"%5$s"
-"\" rel=\"author\">%6$s</a></span></span>"
-msgstr ""
-
-#: content-image.php:39 functions.php:590
-msgid "View all posts by %s"
-msgstr ""
-
-#: content-link.php:17
-msgid "Link"
-msgstr ""
-
-#: content-quote.php:15
-msgid "Quote"
-msgstr ""
-
-#: content-single.php:35
-msgid ""
-"This entry was posted in %1$s and tagged %2$s by <a href=\"%6$s\">%5$s</a>. "
-"Bookmark the <a href=\"%3$s\" title=\"Permalink to %4$s\" rel=\"bookmark"
-"\">permalink</a>."
-msgstr ""
-
-#: content-single.php:37
-msgid ""
-"This entry was posted in %1$s by <a href=\"%6$s\">%5$s</a>. Bookmark the <a "
-"href=\"%3$s\" title=\"Permalink to %4$s\" rel=\"bookmark\">permalink</a>."
-msgstr ""
-
-#: content-single.php:39
-msgid ""
-"This entry was posted by <a href=\"%6$s\">%5$s</a>. Bookmark the <a href="
-"\"%3$s\" title=\"Permalink to %4$s\" rel=\"bookmark\">permalink</a>."
-msgstr ""
-
-#: content-single.php:64
-msgid "View all posts by %s <span class=\"meta-nav\">&rarr;</span>"
-msgstr ""
-
-#: content-status.php:16
-msgid "Status"
-msgstr ""
-
-#: content.php:16
-msgid "Featured"
-msgstr ""
-
-#. #-#-#-#-#  twentyeleven.pot (Twenty Eleven 1.5)  #-#-#-#-#
-#. Author URI of the plugin/theme
-#: footer.php:27
-msgid "http://wordpress.org/"
-msgstr ""
-
-#: footer.php:27
-msgid "Semantic Personal Publishing Platform"
-msgstr ""
-
-#: footer.php:27
-msgid "Proudly powered by %s"
-msgstr ""
-
-#: functions.php:95
-msgid "Primary Menu"
-msgstr ""
-
-#. translators: header image description
-#: functions.php:164
-msgid "Wheel"
-msgstr ""
-
-#. translators: header image description
-#: functions.php:170
-msgid "Shore"
-msgstr ""
-
-#. translators: header image description
-#: functions.php:176
-msgid "Trolley"
-msgstr ""
-
-#. translators: header image description
-#: functions.php:182
-msgid "Pine Cone"
-msgstr ""
-
-#. translators: header image description
-#: functions.php:188
-msgid "Chessboard"
-msgstr ""
-
-#. translators: header image description
-#: functions.php:194
-msgid "Lanterns"
-msgstr ""
-
-#. translators: header image description
-#: functions.php:200
-msgid "Willow"
-msgstr ""
-
-#. translators: header image description
-#: functions.php:206
-msgid "Hanoi Plant"
-msgstr ""
-
-#: functions.php:394
-msgid "Main Sidebar"
-msgstr ""
-
-#: functions.php:403
-msgid "Showcase Sidebar"
-msgstr ""
-
-#: functions.php:405
-msgid "The sidebar for the optional Showcase Template"
-msgstr ""
-
-#: functions.php:413
-msgid "Footer Area One"
-msgstr ""
-
-#: functions.php:415 functions.php:425 functions.php:435
-msgid "An optional widget area for your site footer"
-msgstr ""
-
-#: functions.php:423
-msgid "Footer Area Two"
-msgstr ""
-
-#: functions.php:433
-msgid "Footer Area Three"
-msgstr ""
-
-#: functions.php:453 single.php:18
-msgid "Post navigation"
-msgstr ""
-
-#: functions.php:454
-msgid "<span class=\"meta-nav\">&larr;</span> Older posts"
-msgstr ""
-
-#: functions.php:455
-msgid "Newer posts <span class=\"meta-nav\">&rarr;</span>"
-msgstr ""
-
-#: functions.php:525
-msgid "Pingback:"
-msgstr ""
-
-#. translators: 1: comment author, 2: date and time
-#: functions.php:542
-msgid "%1$s on %2$s <span class=\"says\">said:</span>"
-msgstr ""
-
-#. translators: 1: date, 2: time
-#: functions.php:548
-msgid "%1$s at %2$s"
-msgstr ""
-
-#: functions.php:557
-msgid "Your comment is awaiting moderation."
-msgstr ""
-
-#: functions.php:566
-msgid "Reply <span>&darr;</span>"
-msgstr ""
-
-#: functions.php:584
-msgid ""
-"<span class=\"sep\">Posted on </span><a href=\"%1$s\" title=\"%2$s\" rel="
-"\"bookmark\"><time class=\"entry-date\" datetime=\"%3$s\">%4$s</time></"
-"a><span class=\"by-author\"> <span class=\"sep\"> by </span> <span class="
-"\"author vcard\"><a class=\"url fn n\" href=\"%5$s\" title=\"%6$s\" rel="
-"\"author\">%7$s</a></span></span>"
-msgstr ""
-
-#: header.php:45
-msgid "Page %s"
-msgstr ""
-
-#: header.php:129
-msgid "Main menu"
-msgstr ""
-
-#: header.php:131
-msgid "Skip to primary content"
-msgstr ""
-
-#: header.php:132
-msgid "Skip to secondary content"
-msgstr ""
-
-#: image.php:18
-msgid "Image navigation"
-msgstr ""
-
-#: image.php:19
-msgid "&larr; Previous"
-msgstr ""
-
-#: image.php:20
-msgid "Next &rarr;"
-msgstr ""
-
-#: image.php:30
-msgid ""
-"<span class=\"meta-prep meta-prep-entry-date\">Published </span> <span class="
-"\"entry-date\"><abbr class=\"published\" title=\"%1$s\">%2$s</abbr></span> "
-"at <a href=\"%3$s\" title=\"Link to full-size image\">%4$s &times; %5$s</a> "
-"in <a href=\"%6$s\" title=\"Return to %7$s\" rel=\"gallery\">%8$s</a>"
-msgstr ""
-
-#: inc/theme-options.php:55 inc/theme-options.php:474
-msgid "Color Scheme"
-msgstr ""
-
-#: inc/theme-options.php:61 inc/theme-options.php:491
-msgid "Link Color"
-msgstr ""
-
-#: inc/theme-options.php:62
-msgid "Default Layout"
-msgstr ""
-
-#: inc/theme-options.php:94 inc/theme-options.php:95
-msgid "Theme Options"
-msgstr ""
-
-#: inc/theme-options.php:110
-msgid ""
-"Some themes provide customization options that are grouped together on a "
-"Theme Options screen. If you change themes, options may change or disappear, "
-"as they are theme-specific. Your current theme, Twenty Eleven, provides the "
-"following Theme Options:"
-msgstr ""
-
-#: inc/theme-options.php:112
-msgid ""
-"<strong>Color Scheme</strong>: You can choose a color palette of \"Light"
-"\" (light background with dark text) or \"Dark\" (dark background with light "
-"text) for your site."
-msgstr ""
-
-#: inc/theme-options.php:113
-msgid ""
-"<strong>Link Color</strong>: You can choose the color used for text links on "
-"your site. You can enter the HTML color or hex code, or you can choose "
-"visually by clicking the \"Select a Color\" button to pick from a color "
-"wheel."
-msgstr ""
-
-#: inc/theme-options.php:114
-msgid ""
-"<strong>Default Layout</strong>: You can choose if you want your site&#8217;"
-"s default layout to have a sidebar on the left, the right, or not at all."
-msgstr ""
-
-#: inc/theme-options.php:116
-msgid ""
-"Remember to click \"Save Changes\" to save any changes you have made to the "
-"theme options."
-msgstr ""
-
-#: inc/theme-options.php:118
-msgid "For more information:"
-msgstr ""
-
-#: inc/theme-options.php:119
-msgid ""
-"<a href=\"http://codex.wordpress.org/Appearance_Theme_Options_Screen\" "
-"target=\"_blank\">Documentation on Theme Options</a>"
-msgstr ""
-
-#: inc/theme-options.php:120
-msgid ""
-"<a href=\"http://wordpress.org/support/\" target=\"_blank\">Support Forums</"
-"a>"
-msgstr ""
-
-#: inc/theme-options.php:127
-msgid "Overview"
-msgstr ""
-
-#: inc/theme-options.php:149
-msgid "Light"
-msgstr ""
-
-#: inc/theme-options.php:155
-msgid "Dark"
-msgstr ""
-
-#: inc/theme-options.php:173
-msgid "Content on left"
-msgstr ""
-
-#: inc/theme-options.php:178
-msgid "Content on right"
-msgstr ""
-
-#: inc/theme-options.php:183
-msgid "One-column, no sidebar"
-msgstr ""
-
-#: inc/theme-options.php:273
-msgid "Select a Color"
-msgstr ""
-
-#: inc/theme-options.php:276
-msgid "Default color: %s"
-msgstr ""
-
-#: inc/theme-options.php:312
-msgid "%s Theme Options"
-msgstr ""
-
-#: inc/theme-options.php:498
-msgid "Layout"
-msgstr ""
-
-#: inc/widgets.php:19
-msgid ""
-"Use this widget to list your recent Aside, Status, Quote, and Link posts"
-msgstr ""
-
-#: inc/widgets.php:20
-msgid "Twenty Eleven Ephemera"
-msgstr ""
-
-#: inc/widgets.php:52
-msgid "Ephemera"
-msgstr ""
-
-#: inc/widgets.php:91 inc/widgets.php:107
-msgid "0 <span class=\"reply\">comments &rarr;</span>"
-msgstr ""
-
-#: inc/widgets.php:91 inc/widgets.php:107
-msgid "1 <span class=\"reply\">comment &rarr;</span>"
-msgstr ""
-
-#: inc/widgets.php:91 inc/widgets.php:107
-msgid "% <span class=\"reply\">comments &rarr;</span>"
-msgstr ""
-
-#: inc/widgets.php:105
-msgid "Link to %s"
-msgstr ""
-
-#: inc/widgets.php:157
-msgid "Title:"
-msgstr ""
-
-#: inc/widgets.php:160
-msgid "Number of posts to show:"
-msgstr ""
-
-#: search.php:18
-msgid "Search Results for: %s"
-msgstr ""
-
-#: search.php:46
-msgid ""
-"Sorry, but nothing matched your search criteria. Please try again with some "
-"different keywords."
-msgstr ""
-
-#: searchform.php:11 searchform.php:12 searchform.php:13
-msgid "Search"
-msgstr ""
-
-#: showcase.php:77
-msgid "Featured Post"
-msgstr ""
-
-#: showcase.php:150
-msgid "Featuring: %s"
-msgstr ""
-
-#: showcase.php:160
-msgid "Recent Posts"
-msgstr ""
-
-#: sidebar.php:19
-msgid "Archives"
-msgstr ""
-
-#: sidebar.php:26
-msgid "Meta"
-msgstr ""
-
-#: single.php:19
-msgid "<span class=\"meta-nav\">&larr;</span> Previous"
-msgstr ""
-
-#: single.php:20
-msgid "Next <span class=\"meta-nav\">&rarr;</span>"
-msgstr ""
-
-#: tag.php:19
-msgid "Tag Archives: %s"
-msgstr ""
-
-#. Theme Name of the plugin/theme
-msgid "Twenty Eleven"
-msgstr ""
-
-#. Theme URI of the plugin/theme
-msgid "http://wordpress.org/extend/themes/twentyeleven"
-msgstr ""
-
-#. Description of the plugin/theme
-msgid ""
-"The 2011 theme for WordPress is sophisticated, lightweight, and adaptable. "
-"Make it yours with a custom menu, header image, and background -- then go "
-"further with available theme options for light or dark color scheme, custom "
-"link colors, and three layout choices. Twenty Eleven comes equipped with a "
-"Showcase page template that transforms your front page into a showcase to "
-"show off your best content, widget support galore (sidebar, three footer "
-"areas, and a Showcase page widget area), and a custom \"Ephemera\" widget to "
-"display your Aside, Link, Quote, or Status posts. Included are styles for "
-"print and for the admin editor, support for featured images (as custom "
-"header images on posts and pages and as large images on featured \"sticky\" "
-"posts), and special styles for six different post formats."
-msgstr ""
-
-#. Author of the plugin/theme
-msgid "the WordPress team"
-msgstr ""
-
-#. Template Name of the plugin/theme
-msgid "Showcase Template"
-msgstr ""
-
-#. Template Name of the plugin/theme
-msgid "Sidebar Template"
-msgstr ""
diff --git a/wp-content/themes/twentyeleven/page.php b/wp-content/themes/twentyeleven/page.php
deleted file mode 100644 (file)
index 5dda4d1..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-<?php
-/**
- * The template for displaying all pages.
- *
- * This is the template that displays all pages by default.
- * Please note that this is the WordPress construct of pages
- * and that other 'pages' on your WordPress site will use a
- * different template.
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-
-get_header(); ?>
-
-               <div id="primary">
-                       <div id="content" role="main">
-
-                               <?php while ( have_posts() ) : the_post(); ?>
-
-                                       <?php get_template_part( 'content', 'page' ); ?>
-
-                                       <?php comments_template( '', true ); ?>
-
-                               <?php endwhile; // end of the loop. ?>
-
-                       </div><!-- #content -->
-               </div><!-- #primary -->
-
-<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/readme.txt b/wp-content/themes/twentyeleven/readme.txt
deleted file mode 100644 (file)
index e803014..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-= TWENTY ELEVEN =
-
-* by the WordPress team, http://wordpress.org/
-
-== ABOUT TWENTY ELEVEN ==
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/rtl.css b/wp-content/themes/twentyeleven/rtl.css
deleted file mode 100644 (file)
index 19ac828..0000000
+++ /dev/null
@@ -1,583 +0,0 @@
-/*
-Theme Name: Twenty Eleven
-
-Adding support for language written in a Right To Left (RTL) direction is easy -
-it's just a matter of overwriting all the horizontal positioning attributes
-of your CSS stylesheet in a separate stylesheet file named rtl.css.
-
-http://codex.wordpress.org/Right_to_Left_Language_Support
-
-*/
-
-/* =Reset reset
------------------------------------------------ */
-
-caption, th, td {
-       text-align: right;
-}
-
-/* =Structure
------------------------------------------------ */
-
-body {
-       direction:rtl;
-       unicode-bidi:embed;
-}
-
-/* Showcase */
-.page-template-showcase-php section.recent-posts {
-       float: left;
-       margin: 0 31% 0 0;
-}
-.page-template-showcase-php #main .widget-area {
-       float: right;
-       margin: 0 0 0 -22.15%;
-}
-
-/* One column */
-
-.one-column article.feature-image.small .entry-summary a {
-       left: auto;
-       right: -9%;
-}
-
-/* Simplify the pullquotes and pull styles */
-.one-column.singular .entry-meta .edit-link a {
-       right: 0px;
-       left: auto;
-}
-/* Make sure we have room for our comment avatars */
-.one-column .commentlist > li.comment {
-       margin-left: 0;
-       margin-right: 102px;
-}
-/* Make sure the logo and search form don't collide */
-.one-column #branding #searchform {
-       right: auto;
-       left: 40px;
-}
-/* Talking avatars take up too much room at this size */
-.one-column .commentlist > li.comment {
-       margin-right: 0;
-}
-.one-column .commentlist > li.comment .comment-meta,
-.one-column .commentlist > li.comment .comment-content {
-       margin-right: 0;
-       margin-left: 85px;
-}
-.one-column .commentlist .avatar {
-       right: auto;
-       left: 1.625em;
-}
-.one-column .commentlist .children .avatar {
-       left: auto;
-       right: 2.2em;
-}
-
-/* =Global
------------------------------------------------ */
-
-/* Text elements */
-p {
-       margin-bottom: 1.625em;
-}
-ul, ol {
-       margin: 0 2.5em 1.625em 0;
-}
-.ltr ul, .ltr ol {
-       margin: 0 0 1.625em 2.5em;
-}
-blockquote {
-       font-family: Arial, sans-serif;
-}
-blockquote em, blockquote i, blockquote cite {
-       font-style: normal;
-}
-
-/* Forms */
-textarea {
-       padding-left: 0;
-       padding-right: 3px;
-}
-input#s {
-       background-position: 97% 6px;
-       padding: 4px 28px 4px 10px;
-}
-
-/* Assistive text */
-#access a.assistive-text:active,
-#access a.assistive-text:focus {
-       left: auto;
-       right: 7.6%;
-}
-
-/* =Header
------------------------------------------------ */
-
-#site-title {
-       margin-right: 0;
-       margin-left: 270px;
-}
-
-#site-description {
-       margin: 0 0 3.65625em 270px;
-}
-
-/* =Menu
--------------------------------------------------------------- */
-
-#access {
-       float: right;
-}
-#access ul {
-       margin: 0 -0.8125em 0 0;
-       padding-right: 0;
-}
-#access li {
-       float: right;
-}
-#access ul ul {
-       float: right;
-       left: auto;
-       right: 0;
-}
-#access ul ul ul {
-       left: auto;
-       right: 100%;
-}
-
-/* Search Form */
-#branding #searchform {
-       right: auto;
-       left: 7.6%;
-       text-align: left;
-}
-#branding #s {
-       float: left;
-}
-#branding .only-search + #access div {
-       padding-right: 0;
-       padding-left: 205px;
-}
-
-
-/* =Content
------------------------------------------------ */
-.entry-title,
-.entry-header .entry-meta {
-       padding-right: 0;
-       padding-left: 76px;
-}
-.entry-content td,
-.comment-content td {
-       padding: 6px 0 6px 10px;
-}
-.page-link span {
-       margin-right: 0;
-       margin-left: 6px;
-}
-.entry-meta .edit-link a {
-       float: left;
-}
-/* Images */
-
-.wp-caption .wp-caption-text,
-.gallery-caption {
-       font-family: Arial, sans-serif;
-}
-.wp-caption .wp-caption-text {
-       padding: 10px 40px 5px 0px;
-}
-.wp-caption .wp-caption-text:before {
-       margin-right: 0;
-       margin-left: 5px;
-       left: auto;
-       right: 10px;
-}
-#content .gallery-columns-4 .gallery-item {
-       padding-right:0;
-       padding-left:2%;
-}
-
-/* Author Info */
-.singular #author-info {
-       margin: 2.2em -35.4% 0 -35.6%;
-}
-#author-avatar {
-       float: right;
-       margin-right: 0;
-       margin-left: -78px;
-}
-#author-description {
-       float: right;
-       margin-left: 0;
-       margin-right: 108px;
-}
-/* Comments link */
-.entry-header .comments-link a {
-       background-image: url(images/comment-bubble-rtl.png);
-       right: auto;
-       left: 0;
-}
-
-/*
-       Post Formats Headings
-*/
-.singular .entry-title,
-.singular .entry-header .entry-meta {
-       padding-left: 0;
-}
-.singular .entry-header .entry-meta {
-       left: auto;
-       right: 0;
-}
-.singular .entry-meta .edit-link a {
-       left: auto;
-       right: 50px;
-}
-
-
-/* =Gallery
------------------------------------------------ */
-
-.format-gallery .gallery-thumb {
-       float: right;
-       margin: .375em 0 0 1.625em;
-}
-
-
-/* =Status
------------------------------------------------ */
-
-.format-status img.avatar {
-       float: right;
-       margin: 4px 0 2px 10px;
-}
-
-
-/* =Image
------------------------------------------------ */
-
-.indexed.format-image div.entry-meta {
-       float: right;
-}
-/* =error404
-----------------------
-------------------------- */
-.error404 #main .widget {
-       float: right;
-       margin-right: auto;
-       margin-left: 3.7%;
-}
-.error404 #main .widget_archive {
-       margin-left: 0;
-}
-.error404 #main .widget_tag_cloud {
-       margin-left: 0;
-}
-
-/* =Showcase
------------------------------------------------ */
-
-article.intro .edit-link a {
-       right: auto;
-       left: 20px;
-}
-
-/* Featured post */
-section.featured-post {
-       float: right;
-}
-
-/* Small featured post */
-section.featured-post .attachment-small-feature {
-       float: left;
-       margin: 0 0 1.625em -8.9%;
-       right: auto;
-       left: -15px;
-}
-article.feature-image.small {
-       float: right;
-}
-article.feature-image.small .entry-summary p a {
-       left:auto;
-       right: -23.8%;
-       padding: 9px 85px 9px 26px;
-}
-
-/* Large featured post */
-section.feature-image.large .hentry {
-       left:auto;
-       right: 9%;
-       margin: 1.625em 0 0 9%;
-}
-/* Featured Slider */
-.featured-posts .showcase-heading {
-       padding-left: 0;
-       padding-right: 8.9%;
-}
-.featured-posts section.featured-post {
-       left: auto;
-       right: 0;
-}
-#content .feature-slider {
-       right: auto;
-       left: 8.9%;
-}
-.feature-slider li {
-       float: right;
-}
-/* Recent Posts */
-section.recent-posts .other-recent-posts a[rel="bookmark"] {
-       float: right;
-}
-section.recent-posts .other-recent-posts .comments-link a,
-section.recent-posts .other-recent-posts .comments-link > span {
-       padding: 0.3125em 1em 0.3125em 0;
-       right: auto;
-       left: 0;
-       text-align: left;
-}
-
-/* =Attachments
------------------------------------------------ */
-
-/* =Navigation
--------------------------------------------------------------- */
-
-.nav-previous {
-       float: right;
-}
-.nav-next {
-       float: left;
-       text-align: left;
-}
-
-/* Singular navigation */
-#nav-single {
-       float: left;
-       text-align: left;
-}
-#nav-single .nav-next {
-       padding-left: 0;
-       padding-right: .5em;
-}
-
-
-/* =Widgets
------------------------------------------------ */
-
-.widget ul ul {
-       margin-left: 0;
-       margin-right: 1.5em;
-}
-
-/* Twitter */
-.widget_twitter .timesince {
-       margin-right: 0;
-       margin-left: -10px;
-       text-align: left;
-}
-
-/* =Comments
------------------------------------------------ */
-
-.commentlist .children li.comment {
-       border-left: none;
-       border-right: 1px solid #ddd;
-       -moz-border-radius: 3px 0  0 3px;
-       border-radius: 3px 0 0 3px;
-}
-.commentlist .children li.comment .comment-meta {
-       margin-left: 0;
-       margin-right: 50px;
-}
-.commentlist .avatar {
-       left: auto;
-       right: -102px;
-}
-.commentlist > li:before {
-       content: url(images/comment-arrow-rtl.png);
-       left:auto;
-       right: -21px;
-}
-.commentlist > li.pingback:before {
-       content: '';
-}
-.commentlist .children .avatar {
-       left: auto;
-       right: 2.2em;
-}
-
-/* Post author highlighting */
-.commentlist > li.bypostauthor:before {
-       content: url(images/comment-arrow-bypostauthor-rtl.png);
-}
-
-/* sidebar-page.php comments */
-/* Make sure we have room for our comment avatars */
-.page-template-sidebar-page-php .commentlist > li.comment,
-.page-template-sidebar-page-php.commentlist .pingback {
-       margin-left: 0;
-       margin-right: 102px;
-}
-
-/* Comment Form */
-#respond .comment-form-author label,
-#respond .comment-form-email label,
-#respond .comment-form-url label,
-#respond .comment-form-comment label {
-       left: auto;
-       right: 4px;
-}
-#respond .comment-form-author label,
-#respond .comment-form-email label,
-#respond .comment-form-url label,
-#respond .comment-form-comment label {
-       -webkit-box-shadow: -1px 2px 2px rgba(204,204,204,0.8);
-       -moz-box-shadow: -1px 2px 2px rgba(204,204,204,0.8);
-       box-shadow: -1px 2px 2px rgba(204,204,204,0.8);
-}
-#respond .comment-form-author .required,
-#respond .comment-form-email .required {
-       left: auto;
-       right: 75%;
-}
-#respond .form-submit {
-       float: left;
-}
-#respond input#submit {
-       left: auto;
-       right: 30px;
-       padding: 5px 22px 5px 42px;
-}
-#respond #cancel-comment-reply-link {
-       margin-left: 0;
-       margin-right: 10px;
-}
-#cancel-comment-reply-link {
-       right: auto;
-       left: 1.625em;
-}
-
-/* =Footer
------------------------------------------------ */
-
-/* Two Footer Widget Areas */
-#supplementary.two .widget-area {
-       float: right;
-       margin-right: 0;
-       margin-left: 3.7%;
-}
-#supplementary.two .widget-area + .widget-area {
-       margin-left: 0;
-}
-
-/* Three Footer Widget Areas */
-#supplementary.three .widget-area {
-       float: right;
-       margin-right: 0;
-       margin-left: 3.7%;
-}
-#supplementary.three .widget-area + .widget-area + .widget-area {
-       margin-left: 0;
-}
-
-/* Site Generator Line */
-#site-generator .sep {
-       background-position: right center;
-}
-
-
-/* =Responsive Structure
------------------------------------------------ */
-
-@media (max-width: 800px) {
-       /* Simplify the showcase template when small feature */
-       section.featured-post .attachment-small-feature,
-       .one-column section.featured-post .attachment-small-feature {
-               float: right;
-       }
-       article.feature-image.small {
-               float: left;
-       }
-       article.feature-image.small .entry-summary p a {
-               right: 0;
-       }
-       .singular .entry-meta .edit-link a {
-               left: auto;
-               right: 0px;
-       }
-       /* Make sure we have room for our comment avatars */
-       .commentlist > li.comment,
-       .commentlist .pingback {
-               margin-left: 0;
-               margin-right: 102px;
-       }
-       /* No need to float footer widgets at this size */
-       #colophon #supplementary .widget-area {
-               margin-left: 0;
-       }
-       /* No need to float 404 widgets at this size */
-       .error404 #main .widget {
-               margin-left: 0;
-       }
-}
-@media (max-width: 650px) {
-       /* @media (max-width: 650px) Reduce font-sizes for better readability on smaller devices */
-       #site-title,
-       #site-description {
-               margin-left: 0;
-       }
-       /* Talking avatars take up too much room at this size */
-       .commentlist > li.comment,
-       .commentlist > li.pingback {
-               margin-right: 0 !important;
-       }
-       .commentlist .children .avatar {
-               left: auto;
-               right: 2.2em;
-       }
-       /* Use the available space in the smaller comment form */
-       #respond .comment-form-author .required,
-       #respond .comment-form-email .required {
-           left: auto;
-           right: 95%;
-       }
-       #content .gallery-columns-3 .gallery-item {
-               padding-right: 0;
-               padding-left:2%;
-       }
-}
-@media (max-width: 450px) {
-       #content .gallery-columns-2 .gallery-item {
-               padding-right:0;
-               padding-left:4%;
-       }
-}
-
-/* =Print
------------------------------------------------ */
-
-@media print {
-       #primary {
-           float: right;
-       }
-       /* Comments */
-       .commentlist .avatar {
-           left: auto;
-           right: 2.2em;
-       }
-       .commentlist li.comment .comment-meta {
-           margin-left: 0;
-           margin-right: 50px;
-       }
-}
-
-/* =IE7
------------------------------------------------ */
-
-#ie7 section.recent-posts {
-       margin-right: 0;
-       margin-left: 7.6%;
-}
diff --git a/wp-content/themes/twentyeleven/screenshot.png b/wp-content/themes/twentyeleven/screenshot.png
deleted file mode 100644 (file)
index 8f120d8..0000000
Binary files a/wp-content/themes/twentyeleven/screenshot.png and /dev/null differ
diff --git a/wp-content/themes/twentyeleven/search.php b/wp-content/themes/twentyeleven/search.php
deleted file mode 100644 (file)
index bf45c2f..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-/**
- * The template for displaying Search Results pages.
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-
-get_header(); ?>
-
-               <section id="primary">
-                       <div id="content" role="main">
-
-                       <?php if ( have_posts() ) : ?>
-
-                               <header class="page-header">
-                                       <h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentyeleven' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
-                               </header>
-
-                               <?php twentyeleven_content_nav( 'nav-above' ); ?>
-
-                               <?php /* Start the Loop */ ?>
-                               <?php while ( have_posts() ) : the_post(); ?>
-
-                                       <?php
-                                               /* Include the Post-Format-specific template for the content.
-                                                * If you want to overload this in a child theme then include a file
-                                                * called content-___.php (where ___ is the Post Format name) and that will be used instead.
-                                                */
-                                               get_template_part( 'content', get_post_format() );
-                                       ?>
-
-                               <?php endwhile; ?>
-
-                               <?php twentyeleven_content_nav( 'nav-below' ); ?>
-
-                       <?php else : ?>
-
-                               <article id="post-0" class="post no-results not-found">
-                                       <header class="entry-header">
-                                               <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
-                                       </header><!-- .entry-header -->
-
-                                       <div class="entry-content">
-                                               <p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'twentyeleven' ); ?></p>
-                                               <?php get_search_form(); ?>
-                                       </div><!-- .entry-content -->
-                               </article><!-- #post-0 -->
-
-                       <?php endif; ?>
-
-                       </div><!-- #content -->
-               </section><!-- #primary -->
-
-<?php get_sidebar(); ?>
-<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/searchform.php b/wp-content/themes/twentyeleven/searchform.php
deleted file mode 100644 (file)
index b83ec1e..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?php
-/**
- * The template for displaying search forms in Twenty Eleven
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-?>
-       <form method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
-               <label for="s" class="assistive-text"><?php _e( 'Search', 'twentyeleven' ); ?></label>
-               <input type="text" class="field" name="s" id="s" placeholder="<?php esc_attr_e( 'Search', 'twentyeleven' ); ?>" />
-               <input type="submit" class="submit" name="submit" id="searchsubmit" value="<?php esc_attr_e( 'Search', 'twentyeleven' ); ?>" />
-       </form>
diff --git a/wp-content/themes/twentyeleven/showcase.php b/wp-content/themes/twentyeleven/showcase.php
deleted file mode 100644 (file)
index 9bc57fc..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-<?php
-/**
- * Template Name: Showcase Template
- * Description: A Page Template that showcases Sticky Posts, Asides, and Blog Posts
- *
- * The showcase template in Twenty Eleven consists of a featured posts section using sticky posts,
- * another recent posts area (with the latest post shown in full and the rest as a list)
- * and a left sidebar holding aside posts.
- *
- * We are creating two queries to fetch the proper posts and a custom widget for the sidebar.
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-
-// Enqueue showcase script for the slider
-wp_enqueue_script( 'twentyeleven-showcase', get_template_directory_uri() . '/js/showcase.js', array( 'jquery' ), '2011-04-28' );
-
-get_header(); ?>
-
-               <div id="primary" class="showcase">
-                       <div id="content" role="main">
-
-                               <?php while ( have_posts() ) : the_post(); ?>
-
-                               <?php
-                                       /**
-                                        * We are using a heading by rendering the_content
-                                        * If we have content for this page, let's display it.
-                                        */
-                                       if ( '' != get_the_content() )
-                                               get_template_part( 'content', 'intro' );
-                               ?>
-
-                               <?php endwhile; ?>
-
-                               <?php
-                                       /**
-                                        * Begin the featured posts section.
-                                        *
-                                        * See if we have any sticky posts and use them to create our featured posts.
-                                        * We limit the featured posts at ten.
-                                        */
-                                       $sticky = get_option( 'sticky_posts' );
-
-                                       // Proceed only if sticky posts exist.
-                                       if ( ! empty( $sticky ) ) :
-
-                                       $featured_args = array(
-                                               'post__in' => $sticky,
-                                               'post_status' => 'publish',
-                                               'posts_per_page' => 10,
-                                               'no_found_rows' => true,
-                                       );
-
-                                       // The Featured Posts query.
-                                       $featured = new WP_Query( $featured_args );
-
-                                       // Proceed only if published posts exist
-                                       if ( $featured->have_posts() ) :
-
-                                       /**
-                                        * We will need to count featured posts starting from zero
-                                        * to create the slider navigation.
-                                        */
-                                       $counter_slider = 0;
-
-                                       // Compatibility with versions of WordPress prior to 3.4.
-                                       if ( function_exists( 'get_custom_header' ) )
-                                               $header_image_width = get_theme_support( 'custom-header', 'width' );
-                                       else
-                                               $header_image_width = HEADER_IMAGE_WIDTH;
-                               ?>
-
-                               <div class="featured-posts">
-                                       <h1 class="showcase-heading"><?php _e( 'Featured Post', 'twentyeleven' ); ?></h1>
-
-                               <?php
-                                       // Let's roll.
-                                       while ( $featured->have_posts() ) : $featured->the_post();
-
-                                       // Increase the counter.
-                                       $counter_slider++;
-
-                                       /**
-                                        * We're going to add a class to our featured post for featured images
-                                        * by default it'll have the feature-text class.
-                                        */
-                                       $feature_class = 'feature-text';
-
-                                       if ( has_post_thumbnail() ) {
-                                               // ... but if it has a featured image let's add some class
-                                               $feature_class = 'feature-image small';
-
-                                               // Hang on. Let's check this here image out.
-                                               $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) );
-
-                                               // Is it bigger than or equal to our header?
-                                               if ( $image[1] >= $header_image_width ) {
-                                                       // If bigger, let's add a BIGGER class. It's EXTRA classy now.
-                                                       $feature_class = 'feature-image large';
-                                               }
-                                       }
-                                       ?>
-
-                                       <section class="featured-post <?php echo $feature_class; ?>" id="featured-post-<?php echo $counter_slider; ?>">
-
-                                               <?php
-                                                       /**
-                                                        * If the thumbnail is as big as the header image
-                                                        * make it a large featured post, otherwise render it small
-                                                        */
-                                                       if ( has_post_thumbnail() ) {
-                                                               if ( $image[1] >= $header_image_width )
-                                                                       $thumbnail_size = 'large-feature';
-                                                               else
-                                                                       $thumbnail_size = 'small-feature';
-                                                               ?>
-                                                               <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_post_thumbnail( $thumbnail_size ); ?></a>
-                                                               <?php
-                                                       }
-                                               ?>
-                                               <?php get_template_part( 'content', 'featured' ); ?>
-                                       </section>
-                               <?php endwhile; ?>
-
-                               <?php
-                                       // Show slider only if we have more than one featured post.
-                                       if ( $featured->post_count > 1 ) :
-                               ?>
-                               <nav class="feature-slider">
-                                       <ul>
-                                       <?php
-
-                                               // Reset the counter so that we end up with matching elements
-                                       $counter_slider = 0;
-
-                                               // Begin from zero
-                                       rewind_posts();
-
-                                               // Let's roll again.
-                                       while ( $featured->have_posts() ) : $featured->the_post();
-                                               $counter_slider++;
-                                                       if ( 1 == $counter_slider )
-                                                               $class = 'class="active"';
-                                                       else
-                                                               $class = '';
-                                       ?>
-                                               <li><a href="#featured-post-<?php echo $counter_slider; ?>" title="<?php echo esc_attr( sprintf( __( 'Featuring: %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" <?php echo $class; ?>></a></li>
-                                       <?php endwhile; ?>
-                                       </ul>
-                               </nav>
-                               <?php endif; // End check for more than one sticky post. ?>
-                               </div><!-- .featured-posts -->
-                               <?php endif; // End check for published posts. ?>
-                               <?php endif; // End check for sticky posts. ?>
-
-                               <section class="recent-posts">
-                                       <h1 class="showcase-heading"><?php _e( 'Recent Posts', 'twentyeleven' ); ?></h1>
-
-                                       <?php
-
-                                       // Display our recent posts, showing full content for the very latest, ignoring Aside posts.
-                                       $recent_args = array(
-                                               'order' => 'DESC',
-                                               'post__not_in' => get_option( 'sticky_posts' ),
-                                               'tax_query' => array(
-                                                       array(
-                                                               'taxonomy' => 'post_format',
-                                                               'terms' => array( 'post-format-aside', 'post-format-link', 'post-format-quote', 'post-format-status' ),
-                                                               'field' => 'slug',
-                                                               'operator' => 'NOT IN',
-                                                       ),
-                                               ),
-                                               'no_found_rows' => true,
-                                       );
-
-                                       // Our new query for the Recent Posts section.
-                                       $recent = new WP_Query( $recent_args );
-
-                                       // The first Recent post is displayed normally
-                                       if ( $recent->have_posts() ) : $recent->the_post();
-
-                                               // Set $more to 0 in order to only get the first part of the post.
-                                               global $more;
-                                               $more = 0;
-
-                                               get_template_part( 'content', get_post_format() );
-
-                                               echo '<ol class="other-recent-posts">';
-
-                                       endif;
-
-                                       // For all other recent posts, just display the title and comment status.
-                                       while ( $recent->have_posts() ) : $recent->the_post(); ?>
-
-                                               <li class="entry-title">
-                                                       <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
-                                                       <span class="comments-link">
-                                                               <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?>
-                                                       </span>
-                                               </li>
-
-                                       <?php
-                                       endwhile;
-
-                                       // If we had some posts, close the <ol>
-                                       if ( $recent->post_count > 0 )
-                                               echo '</ol>';
-                                       ?>
-                               </section><!-- .recent-posts -->
-
-                               <div class="widget-area" role="complementary">
-                                       <?php if ( ! dynamic_sidebar( 'sidebar-2' ) ) : ?>
-
-                                               <?php
-                                               the_widget( 'Twenty_Eleven_Ephemera_Widget', '', array( 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>' ) );
-                                               ?>
-
-                                       <?php endif; // end sidebar widget area ?>
-                               </div><!-- .widget-area -->
-
-                       </div><!-- #content -->
-               </div><!-- #primary -->
-
-<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/sidebar-footer.php b/wp-content/themes/twentyeleven/sidebar-footer.php
deleted file mode 100644 (file)
index cbcb49b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-/**
- * The Footer widget areas.
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-?>
-
-<?php
-       /* The footer widget area is triggered if any of the areas
-        * have widgets. So let's check that first.
-        *
-        * If none of the sidebars have widgets, then let's bail early.
-        */
-       if (   ! is_active_sidebar( 'sidebar-3'  )
-               && ! is_active_sidebar( 'sidebar-4' )
-               && ! is_active_sidebar( 'sidebar-5'  )
-       )
-               return;
-       // If we get this far, we have widgets. Let do this.
-?>
-<div id="supplementary" <?php twentyeleven_footer_sidebar_class(); ?>>
-       <?php if ( is_active_sidebar( 'sidebar-3' ) ) : ?>
-       <div id="first" class="widget-area" role="complementary">
-               <?php dynamic_sidebar( 'sidebar-3' ); ?>
-       </div><!-- #first .widget-area -->
-       <?php endif; ?>
-
-       <?php if ( is_active_sidebar( 'sidebar-4' ) ) : ?>
-       <div id="second" class="widget-area" role="complementary">
-               <?php dynamic_sidebar( 'sidebar-4' ); ?>
-       </div><!-- #second .widget-area -->
-       <?php endif; ?>
-
-       <?php if ( is_active_sidebar( 'sidebar-5' ) ) : ?>
-       <div id="third" class="widget-area" role="complementary">
-               <?php dynamic_sidebar( 'sidebar-5' ); ?>
-       </div><!-- #third .widget-area -->
-       <?php endif; ?>
-</div><!-- #supplementary -->
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/sidebar-page.php b/wp-content/themes/twentyeleven/sidebar-page.php
deleted file mode 100644 (file)
index c10d628..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-/**
- * Template Name: Sidebar Template
- * Description: A Page Template that adds a sidebar to pages
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-
-get_header(); ?>
-
-               <div id="primary">
-                       <div id="content" role="main">
-
-                               <?php while ( have_posts() ) : the_post(); ?>
-
-                                       <?php get_template_part( 'content', 'page' ); ?>
-
-                                       <?php comments_template( '', true ); ?>
-
-                               <?php endwhile; // end of the loop. ?>
-
-                       </div><!-- #content -->
-               </div><!-- #primary -->
-
-<?php get_sidebar(); ?>
-<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/sidebar.php b/wp-content/themes/twentyeleven/sidebar.php
deleted file mode 100644 (file)
index 0f08571..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<?php
-/**
- * The Sidebar containing the main widget area.
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-
-$options = twentyeleven_get_theme_options();
-$current_layout = $options['theme_layout'];
-
-if ( 'content' != $current_layout ) :
-?>
-               <div id="secondary" class="widget-area" role="complementary">
-                       <?php if ( ! dynamic_sidebar( 'sidebar-1' ) ) : ?>
-
-                               <aside id="archives" class="widget">
-                                       <h3 class="widget-title"><?php _e( 'Archives', 'twentyeleven' ); ?></h3>
-                                       <ul>
-                                               <?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
-                                       </ul>
-                               </aside>
-
-                               <aside id="meta" class="widget">
-                                       <h3 class="widget-title"><?php _e( 'Meta', 'twentyeleven' ); ?></h3>
-                                       <ul>
-                                               <?php wp_register(); ?>
-                                               <li><?php wp_loginout(); ?></li>
-                                               <?php wp_meta(); ?>
-                                       </ul>
-                               </aside>
-
-                       <?php endif; // end sidebar widget area ?>
-               </div><!-- #secondary .widget-area -->
-<?php endif; ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/single.php b/wp-content/themes/twentyeleven/single.php
deleted file mode 100644 (file)
index 92a533e..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-/**
- * The Template for displaying all single posts.
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-
-get_header(); ?>
-
-               <div id="primary">
-                       <div id="content" role="main">
-
-                               <?php while ( have_posts() ) : the_post(); ?>
-
-                                       <nav id="nav-single">
-                                               <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3>
-                                               <span class="nav-previous"><?php previous_post_link( '%link', __( '<span class="meta-nav">&larr;</span> Previous', 'twentyeleven' ) ); ?></span>
-                                               <span class="nav-next"><?php next_post_link( '%link', __( 'Next <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?></span>
-                                       </nav><!-- #nav-single -->
-
-                                       <?php get_template_part( 'content-single', get_post_format() ); ?>
-
-                                       <?php comments_template( '', true ); ?>
-
-                               <?php endwhile; // end of the loop. ?>
-
-                       </div><!-- #content -->
-               </div><!-- #primary -->
-
-<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/style.css b/wp-content/themes/twentyeleven/style.css
deleted file mode 100644 (file)
index 6209180..0000000
+++ /dev/null
@@ -1,2719 +0,0 @@
-/*
-Theme Name: Twenty Eleven
-Theme URI: http://wordpress.org/extend/themes/twentyeleven
-Author: the WordPress team
-Author URI: http://wordpress.org/
-Description: The 2011 theme for WordPress is sophisticated, lightweight, and adaptable. Make it yours with a custom menu, header image, and background -- then go further with available theme options for light or dark color scheme, custom link colors, and three layout choices. Twenty Eleven comes equipped with a Showcase page template that transforms your front page into a showcase to show off your best content, widget support galore (sidebar, three footer areas, and a Showcase page widget area), and a custom "Ephemera" widget to display your Aside, Link, Quote, or Status posts. Included are styles for print and for the admin editor, support for featured images (as custom header images on posts and pages and as large images on featured "sticky" posts), and special styles for six different post formats.
-Version: 1.5
-License: GNU General Public License v2 or later
-License URI: http://www.gnu.org/licenses/gpl-2.0.html
-Tags: dark, light, white, black, gray, one-column, two-columns, left-sidebar, right-sidebar, fixed-width, flexible-width, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-image-header, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready
-Text Domain: twentyeleven
-*/
-
-/* =Reset default browser CSS. Based on work by Eric Meyer: http://meyerweb.com/eric/tools/css/reset/index.html
--------------------------------------------------------------- */
-
-html, body, div, span, applet, object, iframe,
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,
-a, abbr, acronym, address, big, cite, code,
-del, dfn, em, font, ins, kbd, q, s, samp,
-small, strike, strong, sub, sup, tt, var,
-dl, dt, dd, ol, ul, li,
-fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td {
-       border: 0;
-       font-family: inherit;
-       font-size: 100%;
-       font-style: inherit;
-       font-weight: inherit;
-       margin: 0;
-       outline: 0;
-       padding: 0;
-       vertical-align: baseline;
-}
-:focus {/* remember to define focus styles! */
-       outline: 0;
-}
-body {
-       background: #fff;
-       line-height: 1;
-}
-ol, ul {
-       list-style: none;
-}
-table {/* tables still need 'cellspacing="0"' in the markup */
-       border-collapse: separate;
-       border-spacing: 0;
-}
-caption, th, td {
-       font-weight: normal;
-       text-align: left;
-}
-blockquote:before, blockquote:after,
-q:before, q:after {
-       content: "";
-}
-blockquote, q {
-       quotes: "" "";
-}
-a img {
-       border: 0;
-}
-article, aside, details, figcaption, figure,
-footer, header, hgroup, menu, nav, section {
-       display: block;
-}
-
-
-/* =Structure
------------------------------------------------ */
-
-body {
-       padding: 0 2em;
-}
-#page {
-       margin: 2em auto;
-       max-width: 1000px;
-}
-#branding hgroup {
-       margin: 0 7.6%;
-}
-#access div {
-       margin: 0 7.6%;
-}
-#primary {
-       float: left;
-       margin: 0 -26.4% 0 0;
-       width: 100%;
-}
-#content {
-       margin: 0 34% 0 7.6%;
-       width: 58.4%;
-}
-#secondary {
-       float: right;
-       margin-right: 7.6%;
-       width: 18.8%;
-}
-
-/* Singular */
-.singular #primary {
-       margin: 0;
-}
-.singular #content,
-.left-sidebar.singular #content {
-       margin: 0 7.6%;
-       position: relative;
-       width: auto;
-}
-.singular .entry-header,
-.singular .entry-content,
-.singular footer.entry-meta,
-.singular #comments-title {
-       margin: 0 auto;
-       width: 68.9%;
-}
-
-/* Attachments */
-.singular .image-attachment .entry-content {
-       margin: 0 auto;
-       width: auto;
-}
-.singular .image-attachment .entry-description {
-       margin: 0 auto;
-       width: 68.9%;
-}
-
-/* Showcase */
-.page-template-showcase-php #primary,
-.left-sidebar.page-template-showcase-php #primary {
-       margin: 0;
-}
-.page-template-showcase-php #content,
-.left-sidebar.page-template-showcase-php #content {
-       margin: 0 7.6%;
-       width: auto;
-}
-.page-template-showcase-php section.recent-posts {
-       float: right;
-       margin: 0 0 0 31%;
-       width: 69%;
-}
-.page-template-showcase-php #main .widget-area {
-       float: left;
-       margin: 0 -22.15% 0 0;
-       width: 22.15%;
-}
-
-/* error404 */
-.error404 #primary {
-       float: none;
-       margin: 0;
-}
-.error404 #primary #content {
-       margin: 0 7.6%;
-       width: auto;
-}
-
-/* Alignment */
-.alignleft {
-       display: inline;
-       float: left;
-       margin-right: 1.625em;
-}
-.alignright {
-       display: inline;
-       float: right;
-       margin-left: 1.625em;
-}
-.aligncenter {
-       clear: both;
-       display: block;
-       margin-left: auto;
-       margin-right: auto;
-}
-
-/* Right Content */
-.left-sidebar #primary {
-       float: right;
-       margin: 0 0 0 -26.4%;
-       width: 100%;
-}
-.left-sidebar #content {
-       margin: 0 7.6% 0 34%;
-       width: 58.4%;
-}
-.left-sidebar #secondary {
-       float: left;
-       margin-left: 7.6%;
-       margin-right: 0;
-       width: 18.8%;
-}
-
-/* One column */
-.one-column #page {
-       max-width: 690px;
-}
-.one-column #content {
-       margin: 0 7.6%;
-       width: auto;
-}
-.one-column #nav-below {
-       border-bottom: 1px solid #ddd;
-       margin-bottom: 1.625em;
-}
-.one-column #secondary {
-       float: none;
-       margin: 0 7.6%;
-       width: auto;
-}
-/* Simplify the showcase template */
-.one-column .page-template-showcase-php section.recent-posts {
-       float: none;
-       margin: 0;
-       width: 100%;
-}
-.one-column .page-template-showcase-php #main .widget-area {
-       float: none;
-       margin: 0;
-       width: auto;
-}
-.one-column .page-template-showcase-php .other-recent-posts {
-       border-bottom: 1px solid #ddd;
-}
-/* Simplify the showcase template when small feature */
-.one-column section.featured-post .attachment-small-feature {
-       border: none;
-       display: block;
-       height: auto;
-       max-width: 60%;
-       position: static;
-}
-.one-column article.feature-image.small {
-       margin: 0 0 1.625em;
-       padding: 0;
-}
-.one-column article.feature-image.small .entry-title {
-       font-size: 20px;
-       line-height: 1.3em;
-}
-.one-column article.feature-image.small .entry-summary {
-       height: 150px;
-       overflow: hidden;
-       padding: 0;
-       text-overflow: ellipsis;
-}
-.one-column article.feature-image.small .entry-summary a {
-       left: -9%;
-}
-/* Remove the margin on singular articles */
-.one-column.singular .entry-header,
-.one-column.singular .entry-content,
-.one-column.singular footer.entry-meta,
-.one-column.singular #comments-title {
-       width: 100%;
-}
-/* Simplify the pullquotes and pull styles */
-.one-column.singular blockquote.pull {
-       margin: 0 0 1.625em;
-}
-.one-column.singular .pull.alignleft {
-       margin: 0 1.625em 0 0;
-}
-.one-column.singular .pull.alignright {
-       margin: 0 0 0 1.625em;
-}
-.one-column.singular .entry-meta .edit-link a {
-       position: absolute;
-       left: 0;
-       top: 40px;
-}
-.one-column.singular #author-info {
-       margin: 2.2em -8.8% 0;
-       padding: 20px 8.8%;
-}
-/* Make sure we have room for our comment avatars */
-.one-column .commentlist > li.comment {
-       margin-left: 102px;
-       width: auto;
-}
-/* Make sure the logo and search form don't collide */
-.one-column #branding #searchform {
-       right: 40px;
-       top: 4em;
-}
-/* Talking avatars take up too much room at this size */
-.one-column .commentlist > li.comment {
-       margin-left: 0;
-}
-.one-column .commentlist > li.comment .comment-meta,
-.one-column .commentlist > li.comment .comment-content {
-       margin-right: 85px;
-}
-.one-column .commentlist .avatar {
-       background: transparent;
-       display: block;
-       padding: 0;
-       top: 1.625em;
-       left: auto;
-       right: 1.625em;
-}
-.one-column .commentlist .children .avatar {
-       background: none;
-       padding: 0;
-       position: absolute;
-       top: 2.2em;
-       left: 2.2em;
-}
-.one-column #respond {
-       width: auto;
-}
-
-
-/* =Global
------------------------------------------------ */
-
-body, input, textarea {
-       color: #373737;
-       font: 15px "Helvetica Neue", Helvetica, Arial, sans-serif;
-       font-weight: 300;
-       line-height: 1.625;
-}
-body {
-       background: #e2e2e2;
-}
-#page {
-       background: #fff;
-}
-
-/* Headings */
-h1,h2,h3,h4,h5,h6 {
-       clear: both;
-}
-hr {
-       background-color: #ccc;
-       border: 0;
-       height: 1px;
-       margin-bottom: 1.625em;
-}
-
-/* Text elements */
-p {
-       margin-bottom: 1.625em;
-}
-ul, ol {
-       margin: 0 0 1.625em 2.5em;
-}
-ul {
-       list-style: square;
-}
-ol {
-       list-style-type: decimal;
-}
-ol ol {
-       list-style: upper-alpha;
-}
-ol ol ol {
-       list-style: lower-roman;
-}
-ol ol ol ol {
-       list-style: lower-alpha;
-}
-ul ul, ol ol, ul ol, ol ul {
-       margin-bottom: 0;
-}
-dl {
-       margin: 0 1.625em;
-}
-dt {
-       font-weight: bold;
-}
-dd {
-       margin-bottom: 1.625em;
-}
-strong {
-       font-weight: bold;
-}
-cite, em, i {
-       font-style: italic;
-}
-blockquote {
-       font-family: Georgia, "Bitstream Charter", serif;
-       font-style: italic;
-       font-weight: normal;
-       margin: 0 3em;
-}
-blockquote em, blockquote i, blockquote cite {
-       font-style: normal;
-}
-blockquote cite {
-       color: #666;
-       font: 12px "Helvetica Neue", Helvetica, Arial, sans-serif;
-       font-weight: 300;
-       letter-spacing: 0.05em;
-       text-transform: uppercase;
-}
-pre {
-       background: #f4f4f4;
-       font: 13px "Courier 10 Pitch", Courier, monospace;
-       line-height: 1.5;
-       margin-bottom: 1.625em;
-       overflow: auto;
-       padding: 0.75em 1.625em;
-}
-code, kbd, samp, var {
-       font: 13px Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
-}
-abbr, acronym, dfn {
-       border-bottom: 1px dotted #666;
-       cursor: help;
-}
-address {
-       display: block;
-       margin: 0 0 1.625em;
-}
-ins {
-       background: #fff9c0;
-       text-decoration: none;
-}
-sup,
-sub {
-       font-size: 10px;
-       height: 0;
-       line-height: 1;
-       position: relative;
-       vertical-align: baseline;
-}
-sup {
-       bottom: 1ex;
-}
-sub {
-       top: .5ex;
-}
-small {
-       font-size: smaller;
-}
-
-/* Forms */
-input[type=text],
-input[type=password],
-input[type=email],
-input[type=url],
-input[type=number],
-textarea {
-       background: #fafafa;
-       -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
-       -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
-       box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
-       border: 1px solid #ddd;
-       color: #888;
-}
-input[type=text]:focus,
-input[type=password]:focus,
-input[type=email]:focus,
-input[type=url]:focus,
-input[type=number]:focus,
-textarea:focus {
-       color: #373737;
-}
-textarea {
-       padding-left: 3px;
-       width: 98%;
-}
-input[type=text],
-input[type=password],
-input[type=email],
-input[type=url],
-input[type=number] {
-       padding: 3px;
-}
-input#s {
-       background: url(images/search.png) no-repeat 5px 6px;
-       -moz-border-radius: 2px;
-       border-radius: 2px;
-       font-size: 14px;
-       height: 22px;
-       line-height: 1.2em;
-       padding: 4px 10px 4px 28px;
-}
-input#searchsubmit {
-       display: none;
-}
-
-/* Links */
-a {
-       color: #1982d1;
-       text-decoration: none;
-}
-a:focus,
-a:active,
-a:hover {
-       text-decoration: underline;
-}
-
-/* Assistive text */
-.assistive-text {
-       position: absolute !important;
-       clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
-       clip: rect(1px, 1px, 1px, 1px);
-}
-#access a.assistive-text:active,
-#access a.assistive-text:focus {
-       background: #eee;
-       border-bottom: 1px solid #ddd;
-       color: #1982d1;
-       clip: auto !important;
-       font-size: 12px;
-       position: absolute;
-       text-decoration: underline;
-       top: 0;
-       left: 7.6%;
-}
-
-
-/* =Header
------------------------------------------------ */
-
-#branding {
-       border-top: 2px solid #bbb;
-       padding-bottom: 10px;
-       position: relative;
-       z-index: 9999;
-}
-#site-title {
-       margin-right: 270px;
-       padding: 3.65625em 0 0;
-}
-#site-title a {
-       color: #111;
-       font-size: 30px;
-       font-weight: bold;
-       line-height: 36px;
-       text-decoration: none;
-}
-#site-title a:hover,
-#site-title a:focus,
-#site-title a:active {
-       color: #1982d1;
-}
-#site-description {
-       color: #7a7a7a;
-       font-size: 14px;
-       margin: 0 270px 3.65625em 0;
-}
-#branding img {
-       height: auto;
-       display: block;
-       width: 100%;
-}
-
-
-/* =Menu
--------------------------------------------------------------- */
-
-#access {
-       background: #222; /* Show a solid color for older browsers */
-       background: -moz-linear-gradient(#252525, #0a0a0a);
-       background: -o-linear-gradient(#252525, #0a0a0a);
-       background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#252525), to(#0a0a0a)); /* older webkit syntax */
-       background: -webkit-linear-gradient(#252525, #0a0a0a);
-       -webkit-box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px;
-       -moz-box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px;
-       box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px;
-       clear: both;
-       display: block;
-       float: left;
-       margin: 0 auto 6px;
-       width: 100%;
-}
-#access ul {
-       font-size: 13px;
-       list-style: none;
-       margin: 0 0 0 -0.8125em;
-       padding-left: 0;
-}
-#access li {
-       float: left;
-       position: relative;
-}
-#access a {
-       color: #eee;
-       display: block;
-       line-height: 3.333em;
-       padding: 0 1.2125em;
-       text-decoration: none;
-}
-#access ul ul {
-       -moz-box-shadow: 0 3px 3px rgba(0,0,0,0.2);
-       -webkit-box-shadow: 0 3px 3px rgba(0,0,0,0.2);
-       box-shadow: 0 3px 3px rgba(0,0,0,0.2);
-       display: none;
-       float: left;
-       margin: 0;
-       position: absolute;
-       top: 3.333em;
-       left: 0;
-       width: 188px;
-       z-index: 99999;
-}
-#access ul ul ul {
-       left: 100%;
-       top: 0;
-}
-#access ul ul a {
-       background: #f9f9f9;
-       border-bottom: 1px dotted #ddd;
-       color: #444;
-       font-size: 13px;
-       font-weight: normal;
-       height: auto;
-       line-height: 1.4em;
-       padding: 10px 10px;
-       width: 168px;
-}
-#access li:hover > a,
-#access ul ul :hover > a,
-#access a:focus {
-       background: #efefef;
-}
-#access li:hover > a,
-#access a:focus {
-       background: #f9f9f9; /* Show a solid color for older browsers */
-       background: -moz-linear-gradient(#f9f9f9, #e5e5e5);
-       background: -o-linear-gradient(#f9f9f9, #e5e5e5);
-       background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f9f9f9), to(#e5e5e5)); /* Older webkit syntax */
-       background: -webkit-linear-gradient(#f9f9f9, #e5e5e5);
-       color: #373737;
-}
-#access ul li:hover > ul {
-       display: block;
-}
-#access .current-menu-item > a,
-#access .current-menu-ancestor > a,
-#access .current_page_item > a,
-#access .current_page_ancestor > a {
-       font-weight: bold;
-}
-
-/* Search Form */
-#branding #searchform {
-       position: absolute;
-       top: 3.8em;
-       right: 7.6%;
-       text-align: right;
-}
-#branding #searchform div {
-       margin: 0;
-}
-#branding #s {
-       float: right;
-       -webkit-transition-duration: 400ms;
-       -webkit-transition-property: width, background;
-       -webkit-transition-timing-function: ease;
-       -moz-transition-duration: 400ms;
-       -moz-transition-property: width, background;
-       -moz-transition-timing-function: ease;
-       -o-transition-duration: 400ms;
-       -o-transition-property: width, background;
-       -o-transition-timing-function: ease;
-       width: 72px;
-}
-#branding #s:focus {
-       background-color: #f9f9f9;
-       width: 196px;
-}
-#branding #searchsubmit {
-       display: none;
-}
-#branding .only-search #searchform {
-       top: 5px;
-       z-index: 1;
-}
-#branding .only-search #s {
-       background-color: #666;
-       border-color: #000;
-       color: #222;
-}
-#branding .only-search #s,
-#branding .only-search #s:focus {
-       width: 85%;
-}
-#branding .only-search #s:focus {
-       background-color: #bbb;
-}
-#branding .with-image #searchform {
-       top: auto;
-       bottom: -27px;
-       max-width: 195px;
-}
-#branding .only-search + #access div {
-       padding-right: 205px;
-}
-
-
-/* =Content
------------------------------------------------ */
-
-#main {
-       clear: both;
-       padding: 1.625em 0 0;
-}
-.page-title {
-       color: #666;
-       font-size: 10px;
-       font-weight: 500;
-       letter-spacing: 0.1em;
-       line-height: 2.6em;
-       margin: 0 0 2.6em;
-       text-transform: uppercase;
-}
-.page-title a {
-       font-size: 12px;
-       font-weight: bold;
-       letter-spacing: 0;
-       text-transform: none;
-}
-.hentry,
-.no-results {
-       border-bottom: 1px solid #ddd;
-       margin: 0 0 1.625em;
-       padding: 0 0 1.625em;
-       position: relative;
-}
-.hentry:last-child,
-.no-results {
-       border-bottom: none;
-}
-.blog .sticky .entry-header .entry-meta {
-       clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
-       clip: rect(1px, 1px, 1px, 1px);
-       position: absolute !important;
-}
-.entry-title,
-.entry-header .entry-meta {
-       padding-right: 76px;
-}
-.entry-title {
-       clear: both;
-       color: #222;
-       font-size: 26px;
-       font-weight: bold;
-       line-height: 1.5em;
-       padding-bottom: .3em;
-       padding-top: 15px;
-}
-.entry-title,
-.entry-title a {
-       color: #222;
-       text-decoration: none;
-}
-.entry-title a:hover,
-.entry-title a:focus,
-.entry-title a:active {
-       color: #1982d1;
-}
-.entry-meta {
-       color: #666;
-       clear: both;
-       font-size: 12px;
-       line-height: 18px;
-}
-.entry-meta a {
-       font-weight: bold;
-}
-.single-author .entry-meta .by-author {
-       display: none;
-}
-.entry-content,
-.entry-summary {
-       padding: 1.625em 0 0;
-}
-.entry-content h1,
-.entry-content h2,
-.comment-content h1,
-.comment-content h2 {
-       color: #000;
-       font-weight: bold;
-       margin: 0 0 .8125em;
-}
-.entry-content h3,
-.comment-content h3 {
-       font-size: 10px;
-       letter-spacing: 0.1em;
-       line-height: 2.6em;
-       text-transform: uppercase;
-}
-.entry-content table,
-.comment-content table {
-       border-bottom: 1px solid #ddd;
-       margin: 0 0 1.625em;
-       width: 100%;
-}
-.entry-content th,
-.comment-content th {
-       color: #666;
-       font-size: 10px;
-       font-weight: 500;
-       letter-spacing: 0.1em;
-       line-height: 2.6em;
-       text-transform: uppercase;
-}
-.entry-content td,
-.comment-content td {
-       border-top: 1px solid #ddd;
-       padding: 6px 10px 6px 0;
-}
-.entry-content #s {
-       width: 75%;
-}
-.comment-content ul,
-.comment-content ol {
-       margin-bottom: 1.625em;
-}
-.comment-content ul ul,
-.comment-content ol ol,
-.comment-content ul ol,
-.comment-content ol ul {
-       margin-bottom: 0;
-}
-dl.gallery-item {
-       margin: 0;
-}
-.page-link {
-       clear: both;
-       display: block;
-       margin: 0 0 1.625em;
-}
-.page-link a {
-       background: #eee;
-       color: #373737;
-       margin: 0;
-       padding: 2px 3px;
-       text-decoration: none;
-}
-.page-link a:hover {
-       background: #888;
-       color: #fff;
-       font-weight: bold;
-}
-.page-link span {
-       margin-right: 6px;
-}
-.entry-meta .edit-link a,
-.commentlist .edit-link a {
-       background: #eee;
-       -moz-border-radius: 3px;
-       border-radius: 3px;
-       color: #666;
-       float: right;
-       font-size: 12px;
-       line-height: 1.5em;
-       font-weight: 300;
-       text-decoration: none;
-       padding: 0 8px;
-}
-.entry-meta .edit-link a:hover,
-.commentlist .edit-link a:hover {
-       background: #888;
-       color: #fff;
-}
-.entry-content .edit-link {
-       clear: both;
-       display: block;
-}
-
-/* Images */
-.entry-content img,
-.comment-content img,
-.widget img {
-       max-width: 97.5%; /* Fluid images for posts, comments, and widgets */
-}
-img[class*="align"],
-img[class*="wp-image-"],
-img[class*="attachment-"] {
-       height: auto; /* Make sure images with WordPress-added height and width attributes are scaled correctly */
-}
-img.size-full,
-img.size-large {
-       max-width: 97.5%;
-       width: auto; /* Prevent stretching of full-size and large-size images with height and width attributes in IE8 */
-       height: auto; /* Make sure images with WordPress-added height and width attributes are scaled correctly */
-}
-.entry-content img.wp-smiley {
-       border: none;
-       margin-bottom: 0;
-       margin-top: 0;
-       padding: 0;
-}
-img.alignleft,
-img.alignright,
-img.aligncenter {
-       margin-bottom: 1.625em;
-}
-p img,
-.wp-caption {
-       margin-top: 0.4em;
-}
-.wp-caption {
-       background: #eee;
-       margin-bottom: 1.625em;
-       max-width: 96%;
-       padding: 9px;
-}
-.wp-caption img {
-       display: block;
-       margin: 0 auto;
-       max-width: 98%;
-}
-.wp-caption .wp-caption-text,
-.gallery-caption {
-       color: #666;
-       font-family: Georgia, serif;
-       font-size: 12px;
-}
-.wp-caption .wp-caption-text {
-       margin-bottom: 0.6em;
-       padding: 10px 0 5px 40px;
-       position: relative;
-}
-.wp-caption .wp-caption-text:before {
-       color: #666;
-       content: '\2014';
-       font-size: 14px;
-       font-style: normal;
-       font-weight: bold;
-       margin-right: 5px;
-       position: absolute;
-       left: 10px;
-       top: 7px;
-}
-#content .gallery {
-       margin: 0 auto 1.625em;
-}
-#content .gallery a img {
-       border: none;
-}
-img#wpstats {
-       display: block;
-       margin: 0 auto 1.625em;
-}
-#content .gallery-columns-4 .gallery-item {
-       width: 23%;
-       padding-right: 2%;
-}
-#content .gallery-columns-4 .gallery-item img {
-       width: 100%;
-       height: auto;
-}
-
-/* Image borders */
-img[class*="align"],
-img[class*="wp-image-"],
-#content .gallery .gallery-icon img {/* Add fancy borders to all WordPress-added images but not things like badges and icons and the like */
-       border: 1px solid #ddd;
-       padding: 6px;
-}
-.wp-caption img {
-       border-color: #eee;
-}
-a:focus img[class*="align"],
-a:hover img[class*="align"],
-a:active img[class*="align"],
-a:focus img[class*="wp-image-"],
-a:hover img[class*="wp-image-"],
-a:active img[class*="wp-image-"],
-#content .gallery .gallery-icon a:focus img,
-#content .gallery .gallery-icon a:hover img,
-#content .gallery .gallery-icon a:active img {/* Add some useful style to those fancy borders for linked images ... */
-       background: #eee;
-       border-color: #bbb;
-}
-.wp-caption a:focus img,
-.wp-caption a:active img,
-.wp-caption a:hover img {/* ... including captioned images! */
-       background: #fff;
-       border-color: #ddd;
-}
-
-/* Make sure videos and embeds fit their containers */
-embed,
-iframe,
-object {
-       max-width: 100%;
-}
-.entry-content .twitter-tweet-rendered {
-       max-width: 100% !important; /* Override the Twitter embed fixed width */
-}
-
-/* Password Protected Posts */
-.post-password-required .entry-header .comments-link {
-       margin: 1.625em 0 0;
-}
-.post-password-required input[type=password] {
-       margin: 0.8125em 0;
-}
-.post-password-required input[type=password]:focus {
-       background: #f7f7f7;
-}
-
-/* Author Info */
-#author-info {
-       font-size: 12px;
-       overflow: hidden;
-}
-.singular #author-info {
-       background: #f9f9f9;
-       border-top: 1px solid #ddd;
-       border-bottom: 1px solid #ddd;
-       margin: 2.2em -35.6% 0 -35.4%;
-       padding: 20px 35.4%;
-}
-.archive #author-info {
-       border-bottom: 1px solid #ddd;
-       margin: 0 0 2.2em;
-       padding: 0 0 2.2em;
-}
-#author-avatar {
-       float: left;
-       margin-right: -78px;
-}
-#author-avatar img {
-       background: #fff;
-       -moz-border-radius: 3px;
-       border-radius: 3px;
-       -webkit-box-shadow: 0 1px 2px #bbb;
-       -moz-box-shadow: 0 1px 2px #bbb;
-       box-shadow: 0 1px 2px #bbb;
-       padding: 3px;
-}
-#author-description {
-       float: left;
-       margin-left: 108px;
-}
-#author-description h2 {
-       color: #000;
-       font-size: 15px;
-       font-weight: bold;
-       margin: 5px 0 10px;
-}
-
-/* Comments link */
-.entry-header .comments-link a {
-       background: #eee url(images/comment-bubble.png) no-repeat;
-       color: #666;
-       font-size: 13px;
-       font-weight: normal;
-       line-height: 35px;
-       overflow: hidden;
-       padding: 0 0 0;
-       position: absolute;
-       top: 1.5em;
-       right: 0;
-       text-align: center;
-       text-decoration: none;
-       width: 43px;
-       height: 36px;
-}
-.entry-header .comments-link a:hover,
-.entry-header .comments-link a:focus,
-.entry-header .comments-link a:active {
-       background-color: #1982d1;
-       color: #fff;
-       color: rgba(255,255,255,0.8);
-}
-.entry-header .comments-link .leave-reply {
-       visibility: hidden;
-}
-
-/*
-Post Formats Headings
-To hide the headings, display: none the ".entry-header .entry-format" selector,
-and remove the padding rules below.
-*/
-.entry-header .entry-format {
-       color: #666;
-       font-size: 10px;
-       font-weight: 500;
-       letter-spacing: 0.1em;
-       line-height: 2.6em;
-       position: absolute;
-       text-transform: uppercase;
-       top: -5px;
-}
-.entry-header hgroup .entry-title {
-       padding-top: 15px;
-}
-article.format-aside .entry-content,
-article.format-link .entry-content,
-article.format-status .entry-content {
-       padding: 20px 0 0;
-}
-article.format-status .entry-content {
-       min-height: 65px;
-}
-.recent-posts .entry-header .entry-format {
-       display: none;
-}
-.recent-posts .entry-header hgroup .entry-title {
-       padding-top: 0;
-}
-
-/* Singular content styles for Posts and Pages */
-.singular .hentry {
-       border-bottom: none;
-       padding: 4.875em 0 0;
-       position: relative;
-}
-.singular.page .hentry {
-       padding: 3.5em 0 0;
-}
-.singular .entry-title {
-       color: #000;
-       font-size: 36px;
-       font-weight: bold;
-       line-height: 48px;
-}
-.singular .entry-title,
-.singular .entry-header .entry-meta {
-       padding-right: 0;
-}
-.singular .entry-header .entry-meta {
-       position: absolute;
-       top: 0;
-       left: 0;
-}
-blockquote.pull {
-       font-size: 21px;
-       font-weight: bold;
-       line-height: 1.6125em;
-       margin: 0 0 1.625em;
-       text-align: center;
-}
-.singular blockquote.pull {
-       margin: 0 -22.25% 1.625em;
-}
-.pull.alignleft {
-       margin: 0 1.625em 0 0;
-       text-align: right;
-}
-.singular .pull.alignleft {
-       margin: 0 1.625em 0 -22.25%;
-}
-.pull.alignright {
-       margin: 0 0 0 1.625em;
-       text-align: left;
-}
-blockquote.pull.alignleft,
-blockquote.pull.alignright {
-       width: 33%;
-}
-.singular .pull.alignright {
-       margin: 0 -22.25% 0 1.625em;
-}
-.singular blockquote.pull.alignleft,
-.singular blockquote.pull.alignright {
-       width: 33%;
-}
-.singular .entry-meta .edit-link a {
-       bottom: auto;
-       left: 50px;
-       position: absolute;
-       right: auto;
-       top: 80px;
-}
-
-
-/* =Aside
------------------------------------------------ */
-
-.format-aside .entry-title,
-.format-aside .entry-header .comments-link {
-       display: none;
-}
-.singular .format-aside .entry-title {
-       display: block;
-}
-.format-aside .entry-content {
-       padding: 0;
-}
-.singular .format-aside .entry-content {
-       padding: 1.625em 0 0;
-}
-
-
-/* =Link
------------------------------------------------ */
-
-.format-link .entry-title,
-.format-link .entry-header .comments-link {
-       display: none;
-}
-.singular .format-link .entry-title {
-       display: block;
-}
-.format-link .entry-content {
-       padding: 0;
-}
-.singular .format-link .entry-content {
-       padding: 1.625em 0 0;
-}
-
-
-/* =Gallery
------------------------------------------------ */
-
-.format-gallery .gallery-thumb {
-       float: left;
-       display: block;
-       margin: .375em 1.625em 0 0;
-       max-width: 100%;
-}
-
-
-/* =Status
------------------------------------------------ */
-
-.format-status .entry-title,
-.format-status .entry-header .comments-link {
-       display: none;
-}
-.singular .format-status .entry-title {
-       display: block;
-}
-.format-status .entry-content {
-       padding: 0;
-}
-.singular .format-status .entry-content {
-       padding: 1.625em 0 0;
-}
-.format-status img.avatar {
-       -moz-border-radius: 3px;
-       border-radius: 3px;
-       -webkit-box-shadow: 0 1px 2px #ccc;
-       -moz-box-shadow: 0 1px 2px #ccc;
-       box-shadow: 0 1px 2px #ccc;
-       float: left;
-       margin: 4px 10px 2px 0;
-       padding: 0;
-}
-
-
-/* =Quote
------------------------------------------------ */
-
-.format-quote blockquote {
-       color: #555;
-       font-size: 17px;
-       margin: 0;
-}
-
-
-/* =Image
------------------------------------------------ */
-
-.indexed.format-image .entry-header {
-       min-height: 61px; /* Prevent the comment icon from colliding with the image when there is no title */
-}
-.indexed.format-image .entry-content {
-       padding-top: 0.5em;
-}
-.indexed.format-image .entry-content p {
-       margin: 1em 0;
-}
-.indexed.format-image .entry-content p:first-child,
-.indexed.format-image .entry-content p:first-child a,
-.indexed.format-image .entry-content p:first-child img {
-       display: block;
-       margin: 0;
-}
-.indexed.format-image .entry-content .wp-caption .wp-caption-text {
-       margin: 0;
-       padding-bottom: 1em;
-}
-.indexed.format-image footer.entry-meta {
-       background: #ddd;
-       overflow: hidden;
-       padding: 4%;
-       max-width: 96%;
-}
-.indexed.format-image div.entry-meta {
-       display: inline-block;
-       float: left;
-       width: 35%;
-}
-.indexed.format-image div.entry-meta + div.entry-meta {
-       float: none;
-       width: 65%;
-}
-.indexed.format-image .entry-meta span.cat-links,
-.indexed.format-image .entry-meta span.tag-links,
-.indexed.format-image .entry-meta span.comments-link {
-       display: block;
-}
-.indexed.format-image footer.entry-meta a {
-       color: #444;
-}
-.indexed.format-image footer.entry-meta a:hover {
-       color: #fff;
-}
-#content .indexed.format-image img {
-       border: none;
-       max-width: 100%;
-       padding: 0;
-}
-.indexed.format-image .wp-caption {
-       background: #111;
-       margin-bottom: 0;
-       max-width: 96%;
-       padding: 2% 2% 0;
-}
-.indexed.format-image .wp-caption .wp-caption-text {
-       color: #ddd;
-}
-.indexed.format-image .wp-caption .wp-caption-text:before {
-       color: #444;
-}
-.indexed.format-image a:hover img {
-       opacity: 0.8;
-}
-
-
-/* =error404
------------------------------------------------ */
-
-.error404 #main #searchform {
-       background: #f9f9f9;
-       border: 1px solid #ddd;
-       border-width: 1px 0;
-       margin: 0 -8.9% 1.625em;
-       overflow: hidden;
-       padding: 1.625em 8.9%;
-}
-.error404 #main #s {
-       width: 95%;
-}
-.error404 #main .widget {
-       clear: none;
-       float: left;
-       margin-right: 3.7%;
-       width: 30.85%;
-}
-.error404 #main .widget_archive {
-       margin-right: 0;
-}
-.error404 #main .widget_tag_cloud {
-       float: none;
-       margin-right: 0;
-       width: 100%;
-}
-.error404 .widgettitle {
-       font-size: 10px;
-       letter-spacing: 0.1em;
-       line-height: 2.6em;
-       text-transform: uppercase;
-}
-
-
-/* =Showcase
------------------------------------------------ */
-
-h1.showcase-heading {
-       color: #666;
-       font-size: 10px;
-       font-weight: 500;
-       letter-spacing: 0.1em;
-       line-height: 2.6em;
-       text-transform: uppercase;
-}
-
-/* Intro */
-article.intro {
-       background: #f9f9f9;
-       border-bottom: none;
-       margin: -1.855em -8.9% 1.625em;
-       padding: 0 8.9%;
-}
-article.intro .entry-title {
-       display: none;
-}
-article.intro .entry-content {
-       color: #111;
-       font-size: 16px;
-       padding: 1.625em 0 0.625em;
-}
-article.intro .edit-link a {
-       background: #aaa;
-       -moz-border-radius: 3px;
-       border-radius: 3px;
-       color: #fff;
-       font-size: 12px;
-       padding: 0 8px;
-       position: absolute;
-       top: 30px;
-       right: 20px;
-       text-decoration: none;
-}
-article.intro .edit-link a:hover,
-article.intro .edit-link a:focus,
-article.intro .edit-link a:active {
-       background: #777;
-}
-
-/* Featured post */
-section.featured-post {
-       float: left;
-       margin: -1.625em -8.9% 1.625em;
-       padding: 1.625em 8.9% 0;
-       position: relative;
-       width: 100%;
-}
-section.featured-post .hentry {
-       border: none;
-       color: #666;
-       margin: 0;
-}
-section.featured-post .entry-meta {
-       clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
-       clip: rect(1px, 1px, 1px, 1px);
-       position: absolute !important;
-}
-
-/* Small featured post */
-section.featured-post .attachment-small-feature {
-       float: right;
-       height: auto;
-       margin: 0 -8.9% 1.625em 0;
-       max-width: 59%;
-       position: relative;
-       right: -15px;
-}
-section.featured-post.small {
-       padding-top: 0;
-}
-section.featured-post .attachment-small-feature:hover,
-section.featured-post .attachment-small-feature:focus,
-section.featured-post .attachment-small-feature:active {
-       opacity: .8;
-}
-article.feature-image.small {
-       float: left;
-       margin: 0 0 1.625em;
-       width: 45%;
-}
-article.feature-image.small .entry-title {
-       line-height: 1.2em;
-}
-article.feature-image.small .entry-summary {
-       color: #555;
-       font-size: 13px;
-}
-article.feature-image.small .entry-summary p a {
-       background: #222;
-       color: #eee;
-       display: block;
-       left: -23.8%;
-       padding: 9px 26px 9px 85px;
-       position: relative;
-       text-decoration: none;
-       top: 20px;
-       width: 180px;
-       z-index: 1;
-}
-article.feature-image.small .entry-summary p a:hover {
-       background: #1982d1;
-       color: #eee;
-       color: rgba(255,255,255,0.8);
-}
-
-/* Large featured post */
-section.feature-image.large {
-       border: none;
-       max-height: 288px;
-       padding: 0;
-       width: 100%;
-}
-section.feature-image.large .showcase-heading {
-       display: none;
-}
-section.feature-image.large .hentry {
-       border-bottom: none;
-       left: 9%;
-       margin: 1.625em 9% 0 0;
-       position: absolute;
-       top: 0;
-}
-article.feature-image.large .entry-title a {
-       background: #222;
-       background: rgba(0,0,0,0.8);
-       -moz-border-radius: 3px;
-       border-radius: 3px;
-       color: #fff;
-       display: inline-block;
-       font-weight: 300;
-       padding: .2em 20px;
-}
-section.feature-image.large:hover .entry-title a,
-section.feature-image.large .entry-title:hover a {
-       background: #eee;
-       background: rgba(255,255,255,0.8);
-       color: #222;
-}
-article.feature-image.large .entry-summary {
-       display: none;
-}
-section.feature-image.large img {
-       display: block;
-       height: auto;
-       max-width: 117.9%;
-       padding: 0 0 6px;
-}
-
-/* Featured Slider */
-.featured-posts {
-       border-bottom: 1px solid #ddd;
-       display: block;
-       height: 328px;
-       margin: 1.625em -8.9% 20px;
-       max-width: 1000px;
-       padding: 0;
-       position: relative;
-       overflow: hidden;
-}
-.featured-posts .showcase-heading {
-       padding-left: 8.9%;
-}
-.featured-posts section.featured-post {
-       background: #fff;
-       height: 288px;
-       left: 0;
-       margin: 0;
-       position: absolute;
-       top: 30px;
-       width: auto;
-}
-.featured-posts section.featured-post.large {
-       max-width: 100%;
-       overflow: hidden;
-}
-.featured-posts section.featured-post {
-       -webkit-transition-duration: 200ms;
-       -webkit-transition-property: opacity, visibility;
-       -webkit-transition-timing-function: ease;
-       -moz-transition-duration: 200ms;
-       -moz-transition-property: opacity, visibility;
-       -moz-transition-timing-function: ease;
-}
-.featured-posts section.featured-post {
-       opacity: 0;
-       visibility: hidden;
-}
-.featured-posts #featured-post-1 {
-       opacity: 1;
-       visibility: visible;
-}
-.featured-post .feature-text:after,
-.featured-post .feature-image.small:after {
-       content: ' ';
-       background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%); /* FF3.6+ */
-       background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0)), color-stop(100%,rgba(255,255,255,1))); /* Chrome,Safari4+ */
-       background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); /* Chrome10+,Safari5.1+ */
-       background: -o-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); /* Opera11.10+ */
-       background: -ms-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); /* IE10+ */
-       filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=0 ); /* IE6-9 */
-       background: linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); /* W3C */
-       width: 100%;
-       height: 45px;
-       position: absolute;
-       top: 230px;
-}
-.featured-post .feature-image.small:after {
-       top: 253px;
-}
-#content .feature-slider {
-       top: 5px;
-       right: 8.9%;
-       overflow: visible;
-       position: absolute;
-}
-.feature-slider ul {
-       list-style-type: none;
-       margin: 0;
-}
-.feature-slider li {
-       float: left;
-       margin: 0 6px;
-}
-.feature-slider a {
-       background: #3c3c3c;
-       background: rgba(60,60,60,0.9);
-       -moz-border-radius: 12px;
-       border-radius: 12px;
-       -webkit-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5);
-       -moz-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5);
-       box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5);
-       display: block;
-       width: 14px;
-       height: 14px;
-}
-.feature-slider a.active {
-       background: #1982d1;
-       -webkit-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8);
-       -moz-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8);
-       box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8);
-       cursor: default;
-       opacity: 0.5;
-}
-
-/* Recent Posts */
-section.recent-posts {
-       padding: 0 0 1.625em;
-}
-section.recent-posts .hentry {
-       border: none;
-       margin: 0;
-}
-section.recent-posts .other-recent-posts {
-       border-bottom: 1px solid #ddd;
-       list-style: none;
-       margin: 0;
-}
-section.recent-posts .other-recent-posts li {
-       padding: 0.3125em 0;
-       position: relative;
-}
-section.recent-posts .other-recent-posts .entry-title {
-       border-top: 1px solid #ddd;
-       font-size: 17px;
-}
-section.recent-posts .other-recent-posts a[rel="bookmark"] {
-       color: #373737;
-       float: left;
-       max-width: 84%;
-}
-section.recent-posts .other-recent-posts a[rel="bookmark"]:after {
-       content: '-';
-       color: transparent;
-       font-size: 11px;
-}
-section.recent-posts .other-recent-posts a[rel="bookmark"]:hover {
-}
-section.recent-posts .other-recent-posts .comments-link a,
-section.recent-posts .other-recent-posts .comments-link > span {
-       border-bottom: 2px solid #999;
-       bottom: -2px;
-       color: #444;
-       display: block;
-       font-size: 10px;
-       font-weight: 500;
-       line-height: 2.76333em;
-       padding: 0.3125em 0 0.3125em 1em;
-       position: absolute;
-       right: 0;
-       text-align: right;
-       text-transform: uppercase;
-       z-index: 1;
-}
-section.recent-posts .other-recent-posts .comments-link > span {
-       border-color: #bbb;
-       color: #888;
-}
-section.recent-posts .other-recent-posts .comments-link a:hover {
-       color: #1982d1;
-       border-color: #1982d1;
-}
-section.recent-posts .other-recent-posts li:after {
-       clear: both;
-       content: '.';
-       display: block;
-       height: 0;
-       visibility: hidden;
-}
-
-
-/* =Attachments
------------------------------------------------ */
-
-.image-attachment div.attachment {
-       background: #f9f9f9;
-       border: 1px solid #ddd;
-       border-width: 1px 0;
-       margin: 0 -8.9% 1.625em;
-       overflow: hidden;
-       padding: 1.625em 1.625em 0;
-       text-align: center;
-}
-.image-attachment div.attachment img {
-       display: block;
-       height: auto;
-       margin: 0 auto 1.625em;
-       max-width: 100%;
-}
-.image-attachment div.attachment a img {
-       border-color: #f9f9f9;
-}
-.image-attachment div.attachment a:focus img,
-.image-attachment div.attachment a:hover img,
-.image-attachment div.attachment a:active img {
-       border-color: #ddd;
-       background: #fff;
-}
-.image-attachment .entry-caption p {
-       font-size: 10px;
-       letter-spacing: 0.1em;
-       line-height: 2.6em;
-       margin: 0 0 2.6em;
-       text-transform: uppercase;
-}
-
-
-/* =Navigation
--------------------------------------------------------------- */
-
-#content nav {
-       clear: both;
-       overflow: hidden;
-       padding: 0 0 1.625em;
-}
-#content nav a {
-       font-size: 12px;
-       font-weight: bold;
-       line-height: 2.2em;
-}
-#nav-above {
-       padding: 0 0 1.625em;
-}
-#nav-above {
-       display: none;
-}
-.paged #nav-above {
-       display: block;
-}
-.nav-previous {
-       float: left;
-       width: 50%;
-}
-.nav-next {
-       float: right;
-       text-align: right;
-       width: 50%;
-}
-#content nav .meta-nav {
-       font-weight: normal;
-}
-
-/* Singular navigation */
-#nav-single {
-       float: right;
-       position: relative;
-       top: -0.3em;
-       text-align: right;
-       z-index: 1;
-}
-#nav-single .nav-previous,
-#nav-single .nav-next {
-       width: auto;
-}
-#nav-single .nav-next {
-       padding-left: .5em;
-}
-#nav-single .nav-previous {
-       padding-right: .5em;
-}
-
-
-/* =Widgets
------------------------------------------------ */
-
-.widget-area {
-       font-size: 12px;
-}
-.widget {
-       word-wrap: break-word;
-       -webkit-hyphens: auto;
-       -moz-hyphens: auto;
-       hyphens: auto;
-       clear: both;
-       margin: 0 0 2.2em;
-}
-.widget-title {
-       color: #666;
-       font-size: 10px;
-       font-weight: 500;
-       letter-spacing: 0.1em;
-       line-height: 2.6em;
-       text-transform: uppercase;
-}
-.widget ul {
-       font-size: 15px;
-       margin: 0;
-}
-.widget ul ul {
-       margin-left: 1.5em;
-}
-.widget ul li {
-       color: #777;
-       font-size: 13px;
-}
-.widget a {
-       font-weight: bold;
-       text-decoration: none;
-}
-.widget a:hover,
-.widget a:focus,
-.widget a:active {
-       text-decoration: underline;
-}
-
-/* Search Widget */
-.widget_search form {
-       margin: 0 0 1.625em;
-}
-.widget_search #s {
-       width: 77%;
-}
-.widget_search #searchsubmit {
-       background: #ddd;
-       border: 1px solid #ccc;
-       -webkit-box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09);
-       -moz-box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09);
-       box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09);
-       color: #888;
-       font-size: 13px;
-       line-height: 25px;
-       position: relative;
-       top: -2px;
-}
-.widget_search #searchsubmit:active {
-       background: #1982d1;
-       border-color: #0861a5;
-       -webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1);
-       -moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1);
-       box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1);
-       color: #bfddf3;
-}
-
-/* Ephemera Widget */
-section.ephemera ol,
-.widget_twentyeleven_ephemera ol {
-       list-style: square;
-       margin: 5px 0 0;
-}
-.widget_twentyeleven_ephemera .widget-entry-title {
-       font-size: 15px;
-       font-weight: bold;
-       padding: 0;
-}
-.widget_twentyeleven_ephemera .comments-link a,
-.widget_twentyeleven_ephemera .comments-link > span {
-       color: #666;
-       display: block;
-       font-size: 10px;
-       font-weight: 500;
-       line-height: 2.76333em;
-       text-transform: uppercase;
-}
-section.ephemera .entry-title .comments-link a:hover,
-.widget_twentyeleven_ephemera .entry-title .comments-link a:hover {
-}
-section.ephemera .entry-title a span {
-       color: #29628d;
-}
-
-/* Twitter */
-.widget_twitter li {
-       list-style-type: none;
-       margin-bottom: 14px;
-}
-.widget_twitter .timesince {
-       display: block;
-       font-size: 11px;
-       margin-right: -10px;
-       text-align: right;
-}
-
-/* Widget Image */
-.widget_image img {
-       border: 0;
-       padding: 0;
-       height: auto;
-       max-width: 100%;
-}
-
-/* Calendar Widget */
-
-.widget_calendar #wp-calendar {
-       color: #555;
-       width: 95%;
-       text-align: center;
-}
-.widget_calendar #wp-calendar caption,
-.widget_calendar #wp-calendar td,
-.widget_calendar #wp-calendar th {
-       text-align: center;
-}
-.widget_calendar #wp-calendar caption {
-       font-size: 11px;
-       font-weight: 500;
-       padding: 5px 0 3px 0;
-       text-transform: uppercase;
-}
-.widget_calendar #wp-calendar th {
-       background: #f4f4f4;
-       border-top: 1px solid #ccc;
-       border-bottom: 1px solid #ccc;
-       font-weight: bold;
-}
-.widget_calendar #wp-calendar tfoot td {
-       background: #f4f4f4;
-       border-top: 1px solid #ccc;
-       border-bottom: 1px solid #ccc;
-}
-
-
-/* =Comments
------------------------------------------------ */
-
-#comments-title {
-       color: #666;
-       font-size: 10px;
-       font-weight: 500;
-       line-height: 2.6em;
-       padding: 0 0 2.6em;
-       text-transform: uppercase;
-}
-.nopassword,
-.nocomments {
-       color: #aaa;
-       font-size: 24px;
-       font-weight: 100;
-       margin: 26px 0;
-       text-align: center;
-}
-.commentlist {
-       list-style: none;
-       margin: 0 auto;
-       width: 68.9%;
-}
-.content .commentlist,
-.page-template-sidebar-page-php .commentlist {
-       width: 100%; /* reset the width for the one-column and sidebar page layout */
-}
-.commentlist > li.comment {
-       background: #f6f6f6;
-       border: 1px solid #ddd;
-       -moz-border-radius: 3px;
-       border-radius: 3px;
-       margin: 0 0 1.625em;
-       padding: 1.625em;
-       position: relative;
-}
-.commentlist .pingback {
-       margin: 0 0 1.625em;
-       padding: 0 1.625em;
-}
-.commentlist .children {
-       list-style: none;
-       margin: 0;
-}
-.commentlist .children li.comment {
-       background: #fff;
-       border-left: 1px solid #ddd;
-       -moz-border-radius: 0 3px 3px 0;
-       border-radius: 0 3px 3px 0;
-       margin: 1.625em 0 0;
-       padding: 1.625em;
-       position: relative;
-}
-.commentlist .children li.comment .fn {
-       display: block;
-}
-.comment-meta .fn {
-       font-style: normal;
-}
-.comment-meta {
-       color: #666;
-       font-size: 12px;
-       line-height: 2.2em;
-}
-.commentlist .children li.comment .comment-meta {
-       line-height: 1.625em;
-       margin-left: 50px;
-}
-.commentlist .children li.comment .comment-content {
-       margin: 1.625em 0 0;
-       word-wrap: break-word;
-       -webkit-hyphens: auto;
-       -moz-hyphens: auto;
-       hyphens: auto;
-}
-.comment-meta a {
-       font-weight: bold;
-}
-.comment-meta a:focus,
-.comment-meta a:active,
-.comment-meta a:hover {
-}
-.commentlist .avatar {
-       -moz-border-radius: 3px;
-       border-radius: 3px;
-       -webkit-box-shadow: 0 1px 2px #ccc;
-       -moz-box-shadow: 0 1px 2px #ccc;
-       box-shadow: 0 1px 2px #ccc;
-       left: -102px;
-       padding: 0;
-       position: absolute;
-       top: 0;
-}
-.commentlist > li:before {
-       content: url(images/comment-arrow.png);
-       left: -21px;
-       position: absolute;
-}
-.commentlist > li.pingback:before {
-       content: '';
-}
-.commentlist .children .avatar {
-       background: none;
-       -webkit-box-shadow: none;
-       -moz-box-shadow: none;
-       box-shadow: none;
-       left: 2.2em;
-       padding: 0;
-       top: 2.2em;
-}
-a.comment-reply-link {
-       background: #eee;
-       -moz-border-radius: 3px;
-       border-radius: 3px;
-       color: #666;
-       display: inline-block;
-       font-size: 12px;
-       padding: 0 8px;
-       text-decoration: none;
-}
-a.comment-reply-link:hover,
-a.comment-reply-link:focus,
-a.comment-reply-link:active {
-       background: #888;
-       color: #fff;
-}
-a.comment-reply-link > span {
-       display: inline-block;
-       position: relative;
-       top: -1px;
-}
-
-/* Post author highlighting */
-.commentlist > li.bypostauthor {
-       background: #ddd;
-       border-color: #d3d3d3;
-}
-.commentlist > li.bypostauthor .comment-meta {
-       color: #575757;
-}
-.commentlist > li.bypostauthor .comment-meta a:focus,
-.commentlist > li.bypostauthor .comment-meta a:active,
-.commentlist > li.bypostauthor .comment-meta a:hover {
-}
-.commentlist > li.bypostauthor:before {
-       content: url(images/comment-arrow-bypostauthor.png);
-}
-
-/* Post Author threaded comments */
-.commentlist .children > li.bypostauthor {
-       background: #ddd;
-       border-color: #d3d3d3;
-}
-
-/* sidebar-page.php comments */
-/* Make sure we have room for our comment avatars */
-.page-template-sidebar-page-php .commentlist > li.comment,
-.page-template-sidebar-page-php.commentlist .pingback {
-       margin-left: 102px;
-       width: auto;
-}
-/* And a full-width comment form */
-.page-template-sidebar-page-php #respond {
-       width: auto;
-}
-
-/* Comment Form */
-#respond {
-       background: #ddd;
-       border: 1px solid #d3d3d3;
-       -moz-border-radius: 3px;
-       border-radius: 3px;
-       margin: 0 auto 1.625em;
-       padding: 1.625em;
-       position: relative;
-       width: 68.9%;
-}
-#respond input[type="text"],
-#respond textarea {
-       background: #fff;
-       border: 4px solid #eee;
-       -moz-border-radius: 5px;
-       border-radius: 5px;
-       -webkit-box-shadow: inset 0 1px 3px rgba(204,204,204,0.95);
-       -moz-box-shadow: inset 0 1px 3px rgba(204,204,204,0.95);
-       box-shadow: inset 0 1px 3px rgba(204,204,204,0.95);
-       position: relative;
-       padding: 10px;
-       text-indent: 80px;
-}
-#respond .comment-form-author,
-#respond .comment-form-email,
-#respond .comment-form-url,
-#respond .comment-form-comment {
-       position: relative;
-}
-#respond .comment-form-author label,
-#respond .comment-form-email label,
-#respond .comment-form-url label,
-#respond .comment-form-comment label {
-       background: #eee;
-       -webkit-box-shadow: 1px 2px 2px rgba(204,204,204,0.8);
-       -moz-box-shadow: 1px 2px 2px rgba(204,204,204,0.8);
-       box-shadow: 1px 2px 2px rgba(204,204,204,0.8);
-       color: #555;
-       display: inline-block;
-       font-size: 13px;
-       left: 4px;
-       min-width: 60px;
-       padding: 4px 10px;
-       position: relative;
-       top: 40px;
-       z-index: 1;
-}
-#respond input[type="text"]:focus,
-#respond textarea:focus {
-       text-indent: 0;
-       z-index: 1;
-}
-#respond textarea {
-       resize: vertical;
-       width: 95%;
-}
-#respond .comment-form-author .required,
-#respond .comment-form-email .required {
-       color: #bd3500;
-       font-size: 22px;
-       font-weight: bold;
-       left: 75%;
-       position: absolute;
-       z-index: 1;
-}
-#respond .comment-notes,
-#respond .logged-in-as {
-       font-size: 13px;
-}
-#respond p {
-       margin: 10px 0;
-}
-#respond .form-submit {
-       float: right;
-       margin: -20px 0 10px;
-}
-#respond input#submit {
-       background: #222;
-       border: none;
-       -moz-border-radius: 3px;
-       border-radius: 3px;
-       -webkit-box-shadow: 0px 1px 2px rgba(0,0,0,0.3);
-       -moz-box-shadow: 0px 1px 2px rgba(0,0,0,0.3);
-       box-shadow: 0px 1px 2px rgba(0,0,0,0.3);
-       color: #eee;
-       cursor: pointer;
-       font-size: 15px;
-       margin: 20px 0;
-       padding: 5px 42px 5px 22px;
-       position: relative;
-       left: 30px;
-       text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
-}
-#respond input#submit:active {
-       background: #1982d1;
-       color: #bfddf3;
-}
-#respond #cancel-comment-reply-link {
-       color: #666;
-       margin-left: 10px;
-       text-decoration: none;
-}
-#respond .logged-in-as a:hover,
-#respond #cancel-comment-reply-link:hover {
-       text-decoration: underline;
-}
-.commentlist #respond {
-       margin: 1.625em 0 0;
-       width: auto;
-}
-#reply-title {
-       color: #373737;
-       font-size: 24px;
-       font-weight: bold;
-       line-height: 30px;
-}
-#cancel-comment-reply-link {
-       color: #888;
-       display: block;
-       font-size: 10px;
-       font-weight: normal;
-       line-height: 2.2em;
-       letter-spacing: 0.05em;
-       position: absolute;
-       right: 1.625em;
-       text-decoration: none;
-       text-transform: uppercase;
-       top: 1.1em;
-}
-#cancel-comment-reply-link:focus,
-#cancel-comment-reply-link:active,
-#cancel-comment-reply-link:hover {
-       color: #ff4b33;
-}
-#respond label {
-       line-height: 2.2em;
-}
-#respond input[type=text] {
-       display: block;
-       height: 24px;
-       width: 75%;
-}
-#respond p {
-       font-size: 12px;
-}
-p.comment-form-comment {
-       margin: 0;
-}
-.form-allowed-tags {
-       display: none;
-}
-
-
-/* =Footer
------------------------------------------------ */
-
-#colophon {
-       clear: both;
-}
-#supplementary {
-       border-top: 1px solid #ddd;
-       padding: 1.625em 7.6%;
-       overflow: hidden;
-}
-
-/* Two Footer Widget Areas */
-#supplementary.two .widget-area {
-       float: left;
-       margin-right: 3.7%;
-       width: 48.1%;
-}
-#supplementary.two .widget-area + .widget-area {
-       margin-right: 0;
-}
-
-/* Three Footer Widget Areas */
-#supplementary.three .widget-area {
-       float: left;
-       margin-right: 3.7%;
-       width: 30.85%;
-}
-#supplementary.three .widget-area + .widget-area + .widget-area {
-       margin-right: 0;
-}
-
-/* Site Generator Line */
-#site-generator {
-       background: #f9f9f9;
-       border-top: 1px solid #ddd;
-       color: #666;
-       font-size: 12px;
-       line-height: 2.2em;
-       padding: 2.2em 0.5em;
-       text-align: center;
-}
-#site-generator a {
-       color: #555;
-       font-weight: bold;
-}
-
-
-/* =Responsive Structure
------------------------------------------------ */
-
-@media (max-width: 800px) {
-       /* Simplify the basic layout */
-       #main #content {
-               margin: 0 7.6%;
-               width: auto;
-       }
-       #nav-below {
-               border-bottom: 1px solid #ddd;
-               margin-bottom: 1.625em;
-       }
-       #main #secondary {
-               float: none;
-               margin: 0 7.6%;
-               width: auto;
-       }
-       /* Simplify the showcase template */
-       .page-template-showcase-php .featured-posts {
-               min-height: 280px;
-       }
-       .featured-posts section.featured-post {
-               height: auto;
-       }
-       .page-template-showcase-php section.recent-posts {
-               float: none;
-               margin: 0;
-               width: 100%;
-       }
-       .page-template-showcase-php #main .widget-area {
-               float: none;
-               margin: 0;
-               width: auto;
-       }
-       .page-template-showcase-php .other-recent-posts {
-               border-bottom: 1px solid #ddd;
-       }
-       /* Simplify the showcase template when small feature */
-       section.featured-post .attachment-small-feature,
-       .one-column section.featured-post .attachment-small-feature {
-               border: none;
-               display: block;
-               float: left;
-               height: auto;
-               margin: 0.625em auto 1.025em;
-               max-width: 30%;
-               position: static;
-       }
-       article.feature-image.small {
-               float: right;
-               margin: 0 0 1.625em;
-               width: 64%;
-       }
-       .one-column article.feature-image.small .entry-summary {
-               height: auto;
-       }
-       article.feature-image.small .entry-summary p a {
-               left: 0;
-               padding-left: 20px;
-               padding-right: 20px;
-               width: auto;
-       }
-       /* Remove the margin on singular articles */
-       .singular .entry-header,
-       .singular .entry-content,
-       .singular footer.entry-meta,
-       .singular #comments-title {
-               width: 100%;
-       }
-       /* Simplify the pullquotes and pull styles */
-       .singular blockquote.pull {
-               margin: 0 0 1.625em;
-       }
-       .singular .pull.alignleft {
-               margin: 0 1.625em 0 0;
-       }
-       .singular .pull.alignright {
-               margin: 0 0 0 1.625em;
-       }
-       .singular .entry-meta .edit-link a {
-               left: 0;
-               position: absolute;
-               top: 40px;
-       }
-       .singular #author-info {
-               margin: 2.2em -8.8% 0;
-               padding: 20px 8.8%;
-       }
-       /* Make sure we have room for our comment avatars */
-       .commentlist {
-               width: 100%;
-       }
-       .commentlist > li.comment,
-       .commentlist .pingback {
-               margin-left: 102px;
-               width: auto;
-       }
-       /* And a full-width comment form */
-       #respond {
-               width: auto;
-       }
-       /* No need to float footer widgets at this size */
-       #colophon #supplementary .widget-area {
-               float: none;
-               margin-right: 0;
-               width: auto;
-       }
-       /* No need to float 404 widgets at this size */
-       .error404 #main .widget {
-               float: none;
-               margin-right: 0;
-               width: auto;
-       }
-
-}
-@media (max-width: 650px) {
-       /* @media (max-width: 650px) Reduce font-sizes for better readability on smaller devices */
-       body, input, textarea {
-               font-size: 13px;
-       }
-       #site-title a {
-               font-size: 24px;
-       }
-       #site-description {
-               font-size: 12px;
-       }
-       #access ul {
-               font-size: 12px;
-       }
-       article.intro .entry-content {
-               font-size: 12px;
-       }
-       .entry-title {
-               font-size: 21px;
-       }
-       .featured-post .entry-title {
-               font-size: 14px;
-       }
-       .singular .entry-title {
-               font-size: 28px;
-       }
-       .entry-meta {
-               font-size: 12px;
-       }
-       blockquote {
-               margin: 0;
-       }
-       blockquote.pull {
-               font-size: 17px;
-       }
-       /* Reposition the site title and description slightly */
-       #site-title {
-               padding: 5.30625em 0 0;
-       }
-       #site-title,
-       #site-description {
-               margin-right: 0;
-       }
-       /* Make sure the logo and search form don't collide */
-       #branding #searchform {
-               top: 1.625em !important;
-       }
-       /* Floated content doesn't work well at this size */
-       .alignleft,
-       .alignright {
-               display: block;
-               float: none;
-               margin-left: 0;
-               margin-right: 0;
-       }
-       /* Make sure the post-post navigation doesn't collide with anything */
-       #nav-single {
-               display: block;
-               position: static;
-       }
-       .singular .hentry {
-               padding: 1.625em 0 0;
-       }
-       .singular.page .hentry {
-               padding: 1.625em 0 0;
-       }
-       /* Talking avatars take up too much room at this size */
-       .commentlist > li.comment,
-       .commentlist > li.pingback {
-               margin-left: 0 !important;
-       }
-       .commentlist .avatar {
-               background: transparent;
-               display: block;
-               padding: 0;
-               position: static;
-       }
-       .commentlist .children .avatar {
-               background: none;
-               left: 2.2em;
-               padding: 0;
-               position: absolute;
-               top: 2.2em;
-       }
-       /* Use the available space in the smaller comment form */
-       #respond input[type="text"] {
-               width: 95%;
-       }
-       #respond .comment-form-author .required,
-       #respond .comment-form-email .required {
-               left: 95%;
-       }
-       #content .gallery-columns-3 .gallery-item {
-               width: 31%;
-               padding-right: 2%;
-       }
-       #content .gallery-columns-3 .gallery-item img {
-               width: 100%;
-               height: auto;
-       }
-
-}
-@media (max-width: 450px) {
-       #content .gallery-columns-2 .gallery-item {
-               width: 45%;
-               padding-right: 4%;
-       }
-       #content .gallery-columns-2 .gallery-item img {
-               width: 100%;
-               height: auto;
-       }
-
-}
-@media only screen and (min-device-width: 320px) and (max-device-width: 480px) {
-       body {
-               padding: 0;
-       }
-       #page {
-               margin-top: 0;
-       }
-       #branding {
-               border-top: none;
-       }
-
-}
-
-
-/* =Print
------------------------------------------------ */
-
-@media print {
-       body {
-               background: none !important;
-               font-size: 10pt;
-       }
-       footer.entry-meta a[rel=bookmark]:link:after,
-       footer.entry-meta a[rel=bookmark]:visited:after {
-               content: " [" attr(href) "] "; /* Show URLs */
-       }
-       #page {
-               clear: both !important;
-               display: block !important;
-               float: none !important;
-               max-width: 100%;
-               position: relative !important;
-       }
-       #branding {
-               border-top: none !important;
-               padding: 0;
-       }
-       #branding hgroup {
-               margin: 0;
-       }
-       #site-title a {
-               font-size: 21pt;
-       }
-       #site-description {
-               font-size: 10pt;
-       }
-       #branding #searchform {
-               display: none;
-       }
-       #branding img {
-               display: none;
-       }
-       #access {
-               display: none;
-       }
-       #main {
-               border-top: none;
-               box-shadow: none;
-       }
-       #primary {
-               float: left;
-               margin: 0;
-               width: 100%;
-       }
-       #content {
-               margin: 0;
-               width: auto;
-       }
-       .singular #content {
-               margin: 0;
-               width: 100%;
-       }
-       .singular .entry-header .entry-meta {
-               position: static;
-       }
-       .entry-meta .edit-link a {
-               display: none;
-       }
-       #content nav {
-               display: none;
-       }
-       .singular .entry-header,
-       .singular .entry-content,
-       .singular footer.entry-meta,
-       .singular #comments-title {
-               margin: 0;
-               width: 100%;
-       }
-       .singular .hentry {
-               padding: 0;
-       }
-       .entry-title,
-       .singular .entry-title {
-               font-size: 21pt;
-       }
-       .entry-meta {
-               font-size: 10pt;
-       }
-       .entry-header .comments-link {
-               display: none;
-       }
-       .page-link {
-               display: none;
-       }
-       .singular #author-info {
-               background: none;
-               border-bottom: none;
-               border-top: none;
-               margin: 2.2em 0 0;
-               padding: 0;
-       }
-       #respond {
-               display: none;
-       }
-       .widget-area {
-               display: none;
-       }
-       #colophon {
-               display: none;
-       }
-
-       /* Comments */
-       .commentlist > li.comment {
-               background: none;
-               border: 1px solid #ddd;
-               -moz-border-radius: 3px 3px 3px 3px;
-               border-radius: 3px 3px 3px 3px;
-               margin: 0 auto 1.625em;
-               padding: 1.625em;
-               position: relative;
-               width: auto;
-       }
-       .commentlist .avatar {
-               height: 39px;
-               left: 2.2em;
-               top: 2.2em;
-               width: 39px;
-       }
-       .commentlist li.comment .comment-meta {
-               line-height: 1.625em;
-               margin-left: 50px;
-       }
-       .commentlist li.comment .fn {
-               display: block;
-       }
-       .commentlist li.comment .comment-content {
-               margin: 1.625em 0 0;
-       }
-       .commentlist .comment-edit-link {
-               display: none;
-       }
-       .commentlist > li::before,
-       .commentlist > li.bypostauthor::before {
-               content: '';
-       }
-       .commentlist .reply {
-               display: none;
-       }
-
-       /* Post author highlighting */
-       .commentlist > li.bypostauthor {
-               color: #444;
-       }
-       .commentlist > li.bypostauthor .comment-meta {
-               color: #666;
-       }
-       .commentlist > li.bypostauthor:before {
-               content: none;
-       }
-
-       /* Post Author threaded comments */
-       .commentlist .children > li.bypostauthor {
-               background: #fff;
-               border-color: #ddd;
-       }
-       .commentlist .children > li.bypostauthor > article,
-       .commentlist .children > li.bypostauthor > article .comment-meta {
-               color: #666;
-       }
-
-}
-
-
-/* =IE7
------------------------------------------------ */
-
-#ie7 article.intro {
-       margin-left: -7.6%;
-       margin-right: -7.6%;
-       padding-left: -7.6%;
-       padding-right: -7.6%;
-       max-width: 1000px;
-}
-#ie7 section.featured-post {
-       margin-left: -7.6%;
-       margin-right: -7.6%;
-       max-width: 850px;
-}
-#ie7 section.recent-posts {
-       margin-right: 7.6%;
-}
-
-/* =IE8
------------------------------------------------ */
-
-#ie8 section.feature-image.large img {
-       width: 100%;
-}
\ No newline at end of file
diff --git a/wp-content/themes/twentyeleven/tag.php b/wp-content/themes/twentyeleven/tag.php
deleted file mode 100644 (file)
index 8180a8c..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-/**
- * The template used to display Tag Archive pages
- *
- * @package WordPress
- * @subpackage Twenty_Eleven
- * @since Twenty Eleven 1.0
- */
-
-get_header(); ?>
-
-               <section id="primary">
-                       <div id="content" role="main">
-
-                       <?php if ( have_posts() ) : ?>
-
-                               <header class="page-header">
-                                       <h1 class="page-title"><?php
-                                               printf( __( 'Tag Archives: %s', 'twentyeleven' ), '<span>' . single_tag_title( '', false ) . '</span>' );
-                                       ?></h1>
-
-                                       <?php
-                                               $tag_description = tag_description();
-                                               if ( ! empty( $tag_description ) )
-                                                       echo apply_filters( 'tag_archive_meta', '<div class="tag-archive-meta">' . $tag_description . '</div>' );
-                                       ?>
-                               </header>
-
-                               <?php twentyeleven_content_nav( 'nav-above' ); ?>
-
-                               <?php /* Start the Loop */ ?>
-                               <?php while ( have_posts() ) : the_post(); ?>
-
-                                       <?php
-                                               /* Include the Post-Format-specific template for the content.
-                                                * If you want to overload this in a child theme then include a file
-                                                * called content-___.php (where ___ is the Post Format name) and that will be used instead.
-                                                */
-                                               get_template_part( 'content', get_post_format() );
-                                       ?>
-
-                               <?php endwhile; ?>
-
-                               <?php twentyeleven_content_nav( 'nav-below' ); ?>
-
-                       <?php else : ?>
-
-                               <article id="post-0" class="post no-results not-found">
-                                       <header class="entry-header">
-                                               <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
-                                       </header><!-- .entry-header -->
-
-                                       <div class="entry-content">
-                                               <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
-                                               <?php get_search_form(); ?>
-                                       </div><!-- .entry-content -->
-                               </article><!-- #post-0 -->
-
-                       <?php endif; ?>
-
-                       </div><!-- #content -->
-               </section><!-- #primary -->
-
-<?php get_sidebar(); ?>
-<?php get_footer(); ?>
diff --git a/wp-content/themes/twentythirteen/404.php b/wp-content/themes/twentythirteen/404.php
new file mode 100644 (file)
index 0000000..f3197f4
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+/**
+ * The template for displaying 404 pages (Not Found).
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+
+get_header(); ?>
+
+       <div id="primary" class="content-area">
+               <div id="content" class="site-content" role="main">
+
+                       <header class="page-header">
+                               <h1 class="page-title"><?php _e( 'Not found', 'twentythirteen' ); ?></h1>
+                       </header>
+
+                       <div class="page-wrapper">
+                               <div class="page-content">
+                                       <h2><?php _e( 'This is somewhat embarrassing, isn&rsquo;t it?', 'twentythirteen' ); ?></h2>
+                                       <p><?php _e( 'It looks like nothing was found at this location. Maybe try a search?', 'twentythirteen' ); ?></p>
+
+                                       <?php get_search_form(); ?>
+                               </div><!-- .page-content -->
+                       </div><!-- .page-wrapper -->
+
+               </div><!-- #content -->
+       </div><!-- #primary -->
+
+<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentythirteen/archive.php b/wp-content/themes/twentythirteen/archive.php
new file mode 100644 (file)
index 0000000..af6c0ca
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+/**
+ * The template for displaying Archive pages.
+ *
+ * Used to display archive-type pages if nothing more specific matches a query.
+ * For example, puts together date-based pages if no date.php file exists.
+ *
+ * If you'd like to further customize these archive views, you may create a
+ * new template file for each specific one. For example, Twenty Thirteen
+ * already has tag.php for Tag archives, category.php for Category archives,
+ * and author.php for Author archives.
+ *
+ * Learn more: http://codex.wordpress.org/Template_Hierarchy
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+
+get_header(); ?>
+
+       <div id="primary" class="content-area">
+               <div id="content" class="site-content" role="main">
+
+               <?php if ( have_posts() ) : ?>
+                       <header class="archive-header">
+                               <h1 class="archive-title"><?php
+                                       if ( is_day() ) :
+                                               printf( __( 'Daily Archives: %s', 'twentythirteen' ), get_the_date() );
+                                       elseif ( is_month() ) :
+                                               printf( __( 'Monthly Archives: %s', 'twentythirteen' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentythirteen' ) ) );
+                                       elseif ( is_year() ) :
+                                               printf( __( 'Yearly Archives: %s', 'twentythirteen' ), get_the_date( _x( 'Y', 'yearly archives date format', 'twentythirteen' ) ) );
+                                       else :
+                                               _e( 'Archives', 'twentythirteen' );
+                                       endif;
+                               ?></h1>
+                       </header><!-- .archive-header -->
+
+                       <?php /* The loop */ ?>
+                       <?php while ( have_posts() ) : the_post(); ?>
+                               <?php get_template_part( 'content', get_post_format() ); ?>
+                       <?php endwhile; ?>
+
+                       <?php twentythirteen_paging_nav(); ?>
+
+               <?php else : ?>
+                       <?php get_template_part( 'content', 'none' ); ?>
+               <?php endif; ?>
+
+               </div><!-- #content -->
+       </div><!-- #primary -->
+
+<?php get_sidebar(); ?>
+<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentythirteen/author-bio.php b/wp-content/themes/twentythirteen/author-bio.php
new file mode 100644 (file)
index 0000000..46ce866
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+/**
+ * The template for displaying Author bios.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+?>
+
+<div class="author-info">
+       <div class="author-avatar">
+               <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentythirteen_author_bio_avatar_size', 74 ) ); ?>
+       </div><!-- .author-avatar -->
+       <div class="author-description">
+               <h2 class="author-title"><?php printf( __( 'About %s', 'twentythirteen' ), get_the_author() ); ?></h2>
+               <p class="author-bio">
+                       <?php the_author_meta( 'description' ); ?>
+                       <a class="author-link" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
+                               <?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentythirteen' ), get_the_author() ); ?>
+                       </a>
+               </p>
+       </div><!-- .author-description -->
+</div><!-- .author-info -->
\ No newline at end of file
diff --git a/wp-content/themes/twentythirteen/author.php b/wp-content/themes/twentythirteen/author.php
new file mode 100644 (file)
index 0000000..dd27b07
--- /dev/null
@@ -0,0 +1,60 @@
+<?php
+/**
+ * The template for displaying Author archive pages.
+ *
+ * Learn more: http://codex.wordpress.org/Template_Hierarchy
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+
+get_header(); ?>
+
+       <div id="primary" class="content-area">
+               <div id="content" class="site-content" role="main">
+
+               <?php if ( have_posts() ) : ?>
+
+                       <?php
+                               /* Queue the first post, that way we know
+                                * what author we're dealing with (if that is the case).
+                                *
+                                * We reset this later so we can run the loop
+                                * properly with a call to rewind_posts().
+                                */
+                               the_post();
+                       ?>
+
+                       <header class="archive-header">
+                               <h1 class="archive-title"><?php printf( __( 'All posts by %s', 'twentythirteen' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); ?></h1>
+                       </header><!-- .archive-header -->
+
+                       <?php
+                               /* Since we called the_post() above, we need to
+                                * rewind the loop back to the beginning that way
+                                * we can run the loop properly, in full.
+                                */
+                               rewind_posts();
+                       ?>
+
+                       <?php if ( get_the_author_meta( 'description' ) ) : ?>
+                               <?php get_template_part( 'author-bio' ); ?>
+                       <?php endif; ?>
+
+                       <?php /* The loop */ ?>
+                       <?php while ( have_posts() ) : the_post(); ?>
+                               <?php get_template_part( 'content', get_post_format() ); ?>
+                       <?php endwhile; ?>
+
+                       <?php twentythirteen_paging_nav(); ?>
+
+               <?php else : ?>
+                       <?php get_template_part( 'content', 'none' ); ?>
+               <?php endif; ?>
+
+               </div><!-- #content -->
+       </div><!-- #primary -->
+
+<?php get_sidebar(); ?>
+<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentythirteen/category.php b/wp-content/themes/twentythirteen/category.php
new file mode 100644 (file)
index 0000000..7971177
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/**
+ * The template for displaying Category pages.
+ *
+ * Learn more: http://codex.wordpress.org/Template_Hierarchy
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+
+get_header(); ?>
+
+       <div id="primary" class="content-area">
+               <div id="content" class="site-content" role="main">
+
+               <?php if ( have_posts() ) : ?>
+                       <header class="archive-header">
+                               <h1 class="archive-title"><?php printf( __( 'Category Archives: %s', 'twentythirteen' ), single_cat_title( '', false ) ); ?></h1>
+
+                               <?php if ( category_description() ) : // Show an optional category description ?>
+                               <div class="archive-meta"><?php echo category_description(); ?></div>
+                               <?php endif; ?>
+                       </header><!-- .archive-header -->
+
+                       <?php /* The loop */ ?>
+                       <?php while ( have_posts() ) : the_post(); ?>
+                               <?php get_template_part( 'content', get_post_format() ); ?>
+                       <?php endwhile; ?>
+
+                       <?php twentythirteen_paging_nav(); ?>
+
+               <?php else : ?>
+                       <?php get_template_part( 'content', 'none' ); ?>
+               <?php endif; ?>
+
+               </div><!-- #content -->
+       </div><!-- #primary -->
+
+<?php get_sidebar(); ?>
+<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentythirteen/comments.php b/wp-content/themes/twentythirteen/comments.php
new file mode 100644 (file)
index 0000000..22818ac
--- /dev/null
@@ -0,0 +1,59 @@
+<?php
+/**
+ * The template for displaying Comments.
+ *
+ * The area of the page that contains comments and the comment form.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+
+/*
+ * If the current post is protected by a password and the visitor has not yet
+ * entered the password we will return early without loading the comments.
+ */
+if ( post_password_required() )
+       return;
+?>
+
+<div id="comments" class="comments-area">
+
+       <?php if ( have_comments() ) : ?>
+               <h2 class="comments-title">
+                       <?php
+                               printf( _nx( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'comments title', 'twentythirteen' ),
+                                       number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
+                       ?>
+               </h2>
+
+               <ol class="comment-list">
+                       <?php
+                               wp_list_comments( array(
+                                       'style'       => 'ol',
+                                       'short_ping'  => true,
+                                       'avatar_size' => 74,
+                               ) );
+                       ?>
+               </ol><!-- .comment-list -->
+
+               <?php
+                       // Are there comments to navigate through?
+                       if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) :
+               ?>
+               <nav class="navigation comment-navigation" role="navigation">
+                       <h1 class="screen-reader-text section-heading"><?php _e( 'Comment navigation', 'twentythirteen' ); ?></h1>
+                       <div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'twentythirteen' ) ); ?></div>
+                       <div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'twentythirteen' ) ); ?></div>
+               </nav><!-- .comment-navigation -->
+               <?php endif; // Check for comment navigation ?>
+
+               <?php if ( ! comments_open() && get_comments_number() ) : ?>
+               <p class="no-comments"><?php _e( 'Comments are closed.' , 'twentythirteen' ); ?></p>
+               <?php endif; ?>
+
+       <?php endif; // have_comments() ?>
+
+       <?php comment_form(); ?>
+
+</div><!-- #comments -->
\ No newline at end of file
diff --git a/wp-content/themes/twentythirteen/content-aside.php b/wp-content/themes/twentythirteen/content-aside.php
new file mode 100644 (file)
index 0000000..9949fdd
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+/**
+ * The template for displaying posts in the Aside post format.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+?>
+
+<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+       <div class="entry-content">
+               <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?>
+               <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
+       </div><!-- .entry-content -->
+
+       <footer class="entry-meta">
+               <?php if ( is_single() ) : ?>
+                       <?php twentythirteen_entry_meta(); ?>
+                       <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?>
+
+                       <?php if ( get_the_author_meta( 'description' ) && is_multi_author() ) : ?>
+                               <?php get_template_part( 'author-bio' ); ?>
+                       <?php endif; ?>
+
+               <?php else : ?>
+                       <?php twentythirteen_entry_date(); ?>
+                       <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?>
+               <?php endif; // is_single() ?>
+       </footer><!-- .entry-meta -->
+</article><!-- #post -->
diff --git a/wp-content/themes/twentythirteen/content-audio.php b/wp-content/themes/twentythirteen/content-audio.php
new file mode 100644 (file)
index 0000000..23abeaf
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+/**
+ * The template for displaying posts in the Audio post format.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+?>
+
+<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+       <header class="entry-header">
+               <?php if ( is_single() ) : ?>
+               <h1 class="entry-title"><?php the_title(); ?></h1>
+               <?php else : ?>
+               <h1 class="entry-title">
+                       <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
+               </h1>
+               <?php endif; // is_single() ?>
+       </header><!-- .entry-header -->
+
+       <div class="entry-content">
+               <div class="audio-content">
+                       <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?>
+                       <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
+               </div><!-- .audio-content -->
+       </div><!-- .entry-content -->
+
+       <footer class="entry-meta">
+               <?php twentythirteen_entry_meta(); ?>
+               <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?>
+
+               <?php if ( is_single() && get_the_author_meta( 'description' ) && is_multi_author() ) : ?>
+                       <?php get_template_part( 'author-bio' ); ?>
+               <?php endif; ?>
+       </footer><!-- .entry-meta -->
+</article><!-- #post -->
diff --git a/wp-content/themes/twentythirteen/content-chat.php b/wp-content/themes/twentythirteen/content-chat.php
new file mode 100644 (file)
index 0000000..eb2fe69
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+/**
+ * The template for displaying posts in the Chat post format.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+?>
+
+<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+       <header class="entry-header">
+               <?php if ( is_single() ) : ?>
+               <h1 class="entry-title"><?php the_title(); ?></h1>
+               <?php else : ?>
+               <h1 class="entry-title">
+                       <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
+               </h1>
+               <?php endif; // is_single() ?>
+       </header><!-- .entry-header -->
+
+       <div class="entry-content">
+               <?php the_content(); ?>
+               <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
+       </div><!-- .entry-content -->
+
+       <footer class="entry-meta">
+               <?php twentythirteen_entry_meta(); ?>
+               <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?>
+       </footer><!-- .entry-meta -->
+</article><!-- #post -->
diff --git a/wp-content/themes/twentythirteen/content-gallery.php b/wp-content/themes/twentythirteen/content-gallery.php
new file mode 100644 (file)
index 0000000..b9537e8
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+/**
+ * The template for displaying posts in the Gallery post format.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+?>
+
+<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+       <header class="entry-header">
+               <?php if ( is_single() ) : ?>
+               <h1 class="entry-title"><?php the_title(); ?></h1>
+               <?php else : ?>
+               <h1 class="entry-title">
+                       <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
+               </h1>
+               <?php endif; // is_single() ?>
+       </header><!-- .entry-header -->
+
+       <div class="entry-content">
+               <?php if ( is_single() || ! get_post_gallery() ) : ?>
+                       <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?>
+                       <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
+               <?php else : ?>
+                       <?php echo get_post_gallery(); ?>
+               <?php endif; // is_single() ?>
+       </div><!-- .entry-content -->
+
+       <footer class="entry-meta">
+               <?php twentythirteen_entry_meta(); ?>
+
+               <?php if ( comments_open() && ! is_single() ) : ?>
+               <span class="comments-link">
+                       <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a comment', 'twentythirteen' ) . '</span>', __( 'One comment so far', 'twentythirteen' ), __( 'View all % comments', 'twentythirteen' ) ); ?>
+               </span><!-- .comments-link -->
+               <?php endif; // comments_open() ?>
+               <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?>
+
+               <?php if ( is_single() && get_the_author_meta( 'description' ) && is_multi_author() ) : ?>
+                       <?php get_template_part( 'author-bio' ); ?>
+               <?php endif; ?>
+       </footer><!-- .entry-meta -->
+</article><!-- #post -->
diff --git a/wp-content/themes/twentythirteen/content-image.php b/wp-content/themes/twentythirteen/content-image.php
new file mode 100644 (file)
index 0000000..34f5144
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/**
+ * The template for displaying posts in the Image post format.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+?>
+
+<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+       <header class="entry-header">
+               <?php if ( is_single() ) : ?>
+               <h1 class="entry-title"><?php the_title(); ?></h1>
+               <?php else : ?>
+               <h1 class="entry-title">
+                       <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
+               </h1>
+               <?php endif; // is_single() ?>
+       </header><!-- .entry-header -->
+
+       <div class="entry-content">
+               <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?>
+               <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
+       </div><!-- .entry-content -->
+
+       <footer class="entry-meta">
+               <?php twentythirteen_entry_meta(); ?>
+
+               <?php if ( comments_open() && ! is_single() ) : ?>
+               <span class="comments-link">
+                       <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a comment', 'twentythirteen' ) . '</span>', __( 'One comment so far', 'twentythirteen' ), __( 'View all % comments', 'twentythirteen' ) ); ?>
+               </span><!-- .comments-link -->
+               <?php endif; // comments_open() ?>
+               <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?>
+
+               <?php if ( is_single() && get_the_author_meta( 'description' ) && is_multi_author() ) : ?>
+                       <?php get_template_part( 'author-bio' ); ?>
+               <?php endif; ?>
+       </footer><!-- .entry-meta -->
+</article><!-- #post -->
diff --git a/wp-content/themes/twentythirteen/content-link.php b/wp-content/themes/twentythirteen/content-link.php
new file mode 100644 (file)
index 0000000..e9082cb
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/**
+ * The template for displaying posts in the Link post format.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+?>
+
+<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+       <header class="entry-header">
+               <h1 class="entry-title">
+                       <a href="<?php echo esc_url( twentythirteen_get_link_url() ); ?>"><?php the_title(); ?></a>
+               </h1>
+
+               <div class="entry-meta">
+                       <?php twentythirteen_entry_date(); ?>
+                       <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?>
+               </div><!-- .entry-meta -->
+       </header><!-- .entry-header -->
+
+       <div class="entry-content">
+               <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?>
+               <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
+       </div><!-- .entry-content -->
+
+       <?php if ( is_single() ) : ?>
+       <footer class="entry-meta">
+               <?php twentythirteen_entry_meta(); ?>
+               <?php if ( get_the_author_meta( 'description' ) && is_multi_author() ) : ?>
+                       <?php get_template_part( 'author-bio' ); ?>
+               <?php endif; ?>
+       </footer><!-- .entry-meta -->
+       <?php endif; // is_single() ?>
+</article><!-- #post -->
diff --git a/wp-content/themes/twentythirteen/content-none.php b/wp-content/themes/twentythirteen/content-none.php
new file mode 100644 (file)
index 0000000..d3d27ec
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+/**
+ * The template for displaying a "No posts found" message.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+?>
+
+<header class="page-header">
+       <h1 class="page-title"><?php _e( 'Nothing Found', 'twentythirteen' ); ?></h1>
+</header>
+
+<div class="page-content">
+       <?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?>
+
+       <p><?php printf( __( 'Ready to publish your first post? <a href="%1$s">Get started here</a>.', 'twentythirteen' ), admin_url( 'post-new.php' ) ); ?></p>
+
+       <?php elseif ( is_search() ) : ?>
+
+       <p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with different keywords.', 'twentythirteen' ); ?></p>
+       <?php get_search_form(); ?>
+
+       <?php else : ?>
+
+       <p><?php _e( 'It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps searching can help.', 'twentythirteen' ); ?></p>
+       <?php get_search_form(); ?>
+
+       <?php endif; ?>
+</div><!-- .page-content -->
diff --git a/wp-content/themes/twentythirteen/content-quote.php b/wp-content/themes/twentythirteen/content-quote.php
new file mode 100644 (file)
index 0000000..4c3422b
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+/**
+ * The template for displaying posts in the Quote post format.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+?>
+
+<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+       <div class="entry-content">
+               <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?>
+               <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
+       </div><!-- .entry-content -->
+
+       <footer class="entry-meta">
+               <?php twentythirteen_entry_meta(); ?>
+
+               <?php if ( comments_open() && ! is_single() ) : ?>
+               <span class="comments-link">
+                       <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a comment', 'twentythirteen' ) . '</span>', __( 'One comment so far', 'twentythirteen' ), __( 'View all % comments', 'twentythirteen' ) ); ?>
+               </span><!-- .comments-link -->
+               <?php endif; // comments_open() ?>
+               <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?>
+       </footer><!-- .entry-meta -->
+</article><!-- #post -->
diff --git a/wp-content/themes/twentythirteen/content-status.php b/wp-content/themes/twentythirteen/content-status.php
new file mode 100644 (file)
index 0000000..281becf
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+/**
+ * The template for displaying posts in the Status post format.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+?>
+
+<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+       <div class="entry-content">
+               <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?>
+               <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
+       </div><!-- .entry-content -->
+
+       <footer class="entry-meta">
+               <?php twentythirteen_entry_meta(); ?>
+               <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?>
+
+               <?php if ( is_single() && get_the_author_meta( 'description' ) && is_multi_author() ) : ?>
+                       <?php get_template_part( 'author-bio' ); ?>
+               <?php endif; ?>
+       </footer><!-- .entry-meta -->
+</article><!-- #post -->
diff --git a/wp-content/themes/twentythirteen/content-video.php b/wp-content/themes/twentythirteen/content-video.php
new file mode 100644 (file)
index 0000000..af2ff71
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/**
+ * The template for displaying posts in the Video post format.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+?>
+
+<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+       <header class="entry-header">
+               <?php if ( is_single() ) : ?>
+               <h1 class="entry-title"><?php the_title(); ?></h1>
+               <?php else : ?>
+               <h1 class="entry-title">
+                       <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
+               </h1>
+               <?php endif; // is_single() ?>
+       </header><!-- .entry-header -->
+
+       <div class="entry-content">
+               <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?>
+               <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
+       </div><!-- .entry-content -->
+
+       <footer class="entry-meta">
+               <?php twentythirteen_entry_meta(); ?>
+
+               <?php if ( comments_open() && ! is_single() ) : ?>
+               <span class="comments-link">
+                       <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a comment', 'twentythirteen' ) . '</span>', __( 'One comment so far', 'twentythirteen' ), __( 'View all % comments', 'twentythirteen' ) ); ?>
+               </span><!-- .comments-link -->
+               <?php endif; // comments_open() ?>
+               <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?>
+
+               <?php if ( is_single() && get_the_author_meta( 'description' ) && is_multi_author() ) : ?>
+                       <?php get_template_part( 'author-bio' ); ?>
+               <?php endif; ?>
+       </footer><!-- .entry-meta -->
+</article><!-- #post -->
diff --git a/wp-content/themes/twentythirteen/content.php b/wp-content/themes/twentythirteen/content.php
new file mode 100644 (file)
index 0000000..4f61b22
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+/**
+ * The default template for displaying content. Used for both single and index/archive/search.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+?>
+
+<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+       <header class="entry-header">
+               <?php if ( has_post_thumbnail() && ! post_password_required() ) : ?>
+               <div class="entry-thumbnail">
+                       <?php the_post_thumbnail(); ?>
+               </div>
+               <?php endif; ?>
+
+               <?php if ( is_single() ) : ?>
+               <h1 class="entry-title"><?php the_title(); ?></h1>
+               <?php else : ?>
+               <h1 class="entry-title">
+                       <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
+               </h1>
+               <?php endif; // is_single() ?>
+
+               <div class="entry-meta">
+                       <?php twentythirteen_entry_meta(); ?>
+                       <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?>
+               </div><!-- .entry-meta -->
+       </header><!-- .entry-header -->
+
+       <?php if ( is_search() ) : // Only display Excerpts for Search ?>
+       <div class="entry-summary">
+               <?php the_excerpt(); ?>
+       </div><!-- .entry-summary -->
+       <?php else : ?>
+       <div class="entry-content">
+               <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?>
+               <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
+       </div><!-- .entry-content -->
+       <?php endif; ?>
+
+       <footer class="entry-meta">
+               <?php if ( comments_open() && ! is_single() ) : ?>
+                       <div class="comments-link">
+                               <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a comment', 'twentythirteen' ) . '</span>', __( 'One comment so far', 'twentythirteen' ), __( 'View all % comments', 'twentythirteen' ) ); ?>
+                       </div><!-- .comments-link -->
+               <?php endif; // comments_open() ?>
+
+               <?php if ( is_single() && get_the_author_meta( 'description' ) && is_multi_author() ) : ?>
+                       <?php get_template_part( 'author-bio' ); ?>
+               <?php endif; ?>
+       </footer><!-- .entry-meta -->
+</article><!-- #post -->
diff --git a/wp-content/themes/twentythirteen/css/editor-style.css b/wp-content/themes/twentythirteen/css/editor-style.css
new file mode 100644 (file)
index 0000000..f7665a8
--- /dev/null
@@ -0,0 +1,578 @@
+/*
+Theme Name: Twenty Thirteen
+Description: Used to style the TinyMCE editor.
+*/
+
+
+/**
+ * Table of Contents:
+ *
+ * 1.0 - Body
+ * 2.0 - Headings
+ * 3.0 - Text Elements
+ * 4.0 - Links
+ * 5.0 - Alignment
+ * 6.0 - Tables
+ * 7.0 - Images
+ * 8.0 - Post Formats
+ * 9.0 - RTL
+ * ----------------------------------------------------------------------------
+ */
+
+
+/**
+ * 1.0 Body
+ * ----------------------------------------------------------------------------
+ */
+
+html .mceContentBody {
+       font-size: 100%;
+       max-width: 604px;
+}
+
+body {
+       color: #141412;
+       font-family: "Source Sans Pro", Helvetica, sans-serif;
+       line-height: 1.5;
+       text-rendering: optimizeLegibility;
+       vertical-align: baseline;
+}
+
+
+/**
+ * 2.0 Headings
+ * ----------------------------------------------------------------------------
+ */
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+       clear: both;
+       font-family: Bitter, Georgia, serif;
+       line-height: 1.3;
+}
+
+h1 {
+       font-size: 48px;
+       margin: 33px 0;
+}
+
+h2 {
+       font-size: 30px;
+       margin: 25px 0;
+}
+
+h3 {
+       font-size: 22px;
+       margin: 22px 0;
+}
+
+h4 {
+       font-size: 20px;
+       margin: 25px 0;
+}
+
+h5 {
+       font-size: 18px;
+       margin: 30px 0;
+}
+
+h6 {
+       font-size: 16px;
+       margin: 36px 0;
+}
+
+hr {
+       background: url(../images/dotted-line.png) repeat center top;
+       background-size: 4px 4px;
+       border: 0;
+       height: 1px;
+       margin: 0 0 24px;
+}
+
+
+/**
+ * 3.0 Text Elements
+ * ----------------------------------------------------------------------------
+ */
+
+p {
+       margin: 0 0 24px;
+}
+
+ol,
+ul {
+       margin: 16px 0;
+       padding: 0 0 0 40px;
+}
+
+ul {
+       list-style-type: square;
+}
+
+ol {
+       list-style: decimal outside;
+}
+
+li > ul,
+li > ol {
+       margin: 0;
+}
+
+dl {
+       margin: 0 20px;
+}
+
+dt {
+       font-weight: bold;
+}
+
+dd {
+       margin: 0 0 20px;
+}
+
+strong {
+       font-weight: bold;
+}
+
+code,
+kbd,
+pre,
+samp {
+       font-family: monospace, serif;
+       font-size: 14px;
+}
+
+pre {
+       background: #f5f5f5;
+       color: #666;
+       font-family: monospace;
+       font-size: 14px;
+       margin: 20px 0;
+       overflow: auto;
+       padding: 20px;
+       white-space: pre;
+       white-space: pre-wrap;
+       word-wrap: break-word;
+}
+
+blockquote,
+q {
+       quotes: none;
+}
+
+blockquote:before,
+blockquote:after,
+q:before,
+q:after {
+       content: "";
+       content: none;
+}
+
+blockquote {
+       font-size: 24px;
+       font-style: italic;
+       font-weight: 300;
+       margin: 24px 40px;
+}
+
+blockquote blockquote {
+       margin-right: 0;
+}
+
+blockquote cite,
+blockquote small {
+       font-size: 14px;
+       font-weight: normal;
+       text-transform: uppercase;
+}
+
+cite {
+       border-bottom: 0;
+}
+
+abbr[title] {
+       border-bottom: 1px dotted;
+}
+
+address {
+       font-style: italic;
+       margin: 0 0 24px;
+}
+
+del {
+       color: #333;
+}
+
+ins {
+       background: #fff9c0;
+       border: none;
+       color: #333;
+       text-decoration: none;
+}
+
+sub,
+sup {
+       font-size: 75%;
+       line-height: 0;
+       position: relative;
+       vertical-align: baseline;
+}
+
+sup {
+       top: -0.5em;
+}
+
+sub {
+       bottom: -0.25em;
+}
+
+
+/**
+ * 4.0 Links
+ * ----------------------------------------------------------------------------
+ */
+
+a {
+       color: #ca3c08;
+       text-decoration: none;
+}
+
+a:visited {
+       color: #ac0404;
+}
+
+a:focus {
+       outline: thin dotted;
+}
+
+a:active,
+a:hover {
+       color: #ea9629;
+       outline: 0;
+}
+
+a:hover {
+       text-decoration: underline;
+}
+
+
+/**
+ * 5.0 Alignment
+ * ----------------------------------------------------------------------------
+ */
+
+.alignleft {
+       float: left;
+       margin: 5px 20px 5px 0;
+}
+
+.alignright {
+       float: right;
+       margin: 5px 0 5px 20px;
+}
+
+.aligncenter {
+       display: block;
+       margin: 5px auto;
+}
+
+img.alignnone {
+       margin: 5px 0;
+}
+
+
+/**
+ * 6.0 Tables
+ * ----------------------------------------------------------------------------
+ */
+
+table {
+       border-bottom: 1px solid #ededed;
+       border-collapse: collapse;
+       border-spacing: 0;
+       font-size: 14px;
+       line-height: 2;
+       margin: 0 0 20px;
+       width: 100%;
+}
+
+caption,
+th,
+td {
+       font-weight: normal;
+       text-align: left;
+}
+
+caption {
+       font-size: 16px;
+       margin: 20px 0;
+}
+
+th {
+       font-weight: bold;
+       text-transform: uppercase;
+}
+
+td {
+       border-top: 1px solid #ededed;
+       padding: 6px 10px 6px 0;
+}
+
+
+/**
+ * 7.0 Images
+ * ----------------------------------------------------------------------------
+ */
+
+img {
+       height: auto;
+       max-width: 100%;
+       vertical-align: middle;
+}
+
+.wp-caption {
+       background: transparent;
+       border: none;
+       margin: 0;
+       padding: 0;
+       text-align: left;
+}
+
+.wp-caption.alignleft {
+       margin: 5px 10px 5px 0;
+}
+
+.wp-caption.alignright {
+       margin: 5px 0 5px 10px;
+}
+
+.wp-caption-dt {
+       margin: 0;
+}
+
+.wp-caption .wp-caption-text,
+.wp-caption-dd {
+       color: #220e10;
+       font-size: 18px;
+       font-style: italic;
+       font-weight: 300;
+       line-height: 1.5;
+       margin-bottom: 24px;
+       padding: 0;
+}
+
+.mceTemp + ul,
+.mceTemp + ol  {
+       list-style-position: inside;
+}
+
+
+/**
+ * 8.0 Post Formats
+ * ----------------------------------------------------------------------------
+ */
+
+/* Aside */
+.post-format-aside {
+       background-color: #f7f5e7;
+}
+
+.post-format-aside blockquote {
+       font-size: 100%;
+       font-weight: normal;
+}
+
+.post-format-aside cite {
+       font-size: 100%;
+       text-transform: none;
+}
+
+.post-format-aside cite:before {
+       content: "\2014";
+       margin-right: 5px;
+}
+
+/* Audio */
+.post-format-audio {
+       background-color: #db572f;
+}
+
+.post-format-audio a {
+       color: #fbfaf3;
+}
+
+.post-format-audio:before {
+       background: url(../images/dotted-line.png) repeat-y 85px 0;
+       background-size: 4px 4px;
+       content: "\f109";
+       display: block;
+       float: left;
+       font-family: Genericons;
+       font-size: 64px;
+       -webkit-font-smoothing: antialiased;
+       height: 100%;
+       line-height: 1;
+       width: 120px;
+}
+
+/* Chat */
+.post-format-chat {
+       background-color: #eadaa6;
+}
+
+.post-format-chat a {
+       color: #722d19;
+}
+
+/* Gallery */
+.post-format-gallery {
+       background-color: #fbca3c;
+}
+
+.post-format-gallery a {
+       color: #722d19;
+}
+
+/* Image: same as Standard/Defaults */
+
+/* Link */
+.post-format-link {
+       background-color: #f7f5e7;
+}
+
+/* Quote */
+.post-format-quote {
+       background-color: #210d10;
+       color: #f7f5e7;
+}
+
+.post-format-quote a {
+       color: #e63f2a;
+}
+
+.post-format-quote blockquote {
+       font-size: 28px;
+       font-style: italic;
+       font-weight: 300;
+       margin: 0;
+       padding-left: 75px;
+       position: relative;
+}
+
+.post-format-quote blockquote:before {
+       content: '\201C';
+       font-size: 140px;
+       font-weight: 400;
+       line-height: .8;
+       padding-right: 25px;
+       position: absolute;
+       left: -15px;
+       top: -3px;
+}
+
+.post-format-quote blockquote small,
+.post-format-quote blockquote cite {
+       display: block;
+       font-size: 16px;
+}
+
+.format-quote .entry-content cite a {
+       border-bottom: 1px dotted #fff;
+       color: #fff;
+}
+
+.format-quote .entry-content cite a:hover {
+       text-decoration: none;
+}
+
+
+/* Status */
+.post-format-status {
+       background-color: #722d19;
+       color: #f7f5e7;
+       font-style: italic;
+       font-weight: 300;
+       padding: 0;
+       padding-left: 35px;
+}
+
+.post-format-status.mceContentBody {
+       font-size: 24px;
+}
+
+.post-format-status:before {
+       background: url(../images/dotted-line.png) repeat-y left bottom;
+       background-size: 4px 4px;
+       content: "";
+       display: block;
+       float: left;
+       height: 100%;
+       position: relative;
+       left: -30px;
+       width: 1px;
+}
+
+.post-format-status > p:first-child:before {
+       background-color: rgba(0, 0, 0, 0.65);
+       content: "";
+       height: 3px;
+       width: 13px;
+       margin-top: 13px;
+       position: absolute;
+       left: 9px;
+}
+
+.post-format-status a {
+       color: #eadaa6;
+}
+
+/* Video */
+.post-format-video {
+       background-color: #db572f;
+}
+
+.post-format-video a {
+       color: #fbfaf3;
+}
+
+
+/**
+ * 9.0 RTL
+ * ----------------------------------------------------------------------------
+ */
+
+html .mceContentBody.rtl {
+       direction: rtl;
+       unicode-bidi: embed;
+}
+
+.rtl ol,
+.rtl ul {
+       padding: 0 40px 0 0;
+}
+
+.rtl .wp-caption,
+.rtl tr th {
+       text-align: right;
+}
+
+.rtl td {
+       padding: 6px 0 6px 10px;
+       text-align: right;
+}
+
+.rtl blockquote blockquote {
+       margin-left: 0;
+       margin-right: 24px;
+}
+
+.rtl.post-format-audio:before,
+.rtl.post-format-status:before,
+.rtl.post-format-status > p:first-child:before {
+       background: none;
+       content: none;
+}
diff --git a/wp-content/themes/twentythirteen/css/ie.css b/wp-content/themes/twentythirteen/css/ie.css
new file mode 100644 (file)
index 0000000..c815a14
--- /dev/null
@@ -0,0 +1,284 @@
+/*
+Styles for older IE versions (previous to IE9).
+*/
+
+.site {
+       min-width: 1040px;
+}
+
+.genericon:before:hover,
+.menu-toggle:after:hover,
+.date a:before:hover,
+.entry-meta .author a:before:hover,
+.format-audio .entry-content:before:hover,
+.comments-link a:before:hover,
+.tags-links a:first-child:before:hover,
+.categories-links a:first-child:before:hover,
+.edit-link > a:before:hover,
+.attachment-meta:before:hover,
+.attachment-meta a:before:hover,
+.comment-awaiting-moderation:before:hover,
+.comment-reply-link:before:hover,
+.comment-reply-title small a:before:hover,
+.bypostauthor > .comment-body .fn:before:hover {
+       text-decoration: none;
+}
+
+.nav-menu .sub-menu ul,
+.nav-menu .children ul {
+       left: 100%;
+}
+
+.site-header .home-link {
+       max-width: 1040px;
+}
+
+.site-header .search-form [type="search"],
+.site-header .search-form [type="text"] {
+       padding-top: 6px;
+}
+
+img.alignright {
+       margin-right: 0;
+}
+
+img.alignleft {
+       margin-left: 0;
+}
+
+.site-main .sidebar-inner {
+       width: 1040px;
+}
+
+.site-main .widget-area {
+       margin-right: 60px;
+}
+
+.format-image .entry-content .size-full {
+       margin: 0;
+       max-width: 604px;
+}
+
+.gallery-columns-1 .gallery-item,
+.gallery-columns-2 .gallery-item,
+.gallery-columns-3 .gallery-item {
+       max-width: none;
+}
+
+.gallery img {
+       width: auto;
+}
+
+.gallery-caption {
+       background: #000;
+       filter: alpha(opacity=0);
+}
+
+.gallery-item:hover .gallery-caption {
+       filter: alpha(opacity=70);
+}
+
+.comment {
+       clear: both;
+}
+
+.comment-meta,
+.comment-content,
+.comment-list .reply {
+       width: 480px;
+}
+
+.depth-2 .comment-meta,
+.depth-2 .comment-content,
+.comment-list .depth-2 .reply {
+       width: 460px;
+}
+
+.depth-3 .comment-meta,
+.depth-3 .comment-content,
+.comment-list .depth-3 .reply {
+       width: 440px;
+}
+
+.depth-4 .comment-meta,
+.depth-4 .comment-content,
+.comment-list .depth-4 .reply {
+       width: 420px;
+}
+
+.depth-5 .comment-meta,
+.depth-5 .comment-content,
+.comment-list .depth-5 .reply {
+       width: 400px;
+}
+
+.comment-meta {
+       margin-bottom: 0;
+}
+
+.widget {
+       background: #f7f5e7;
+}
+
+.site-footer .widget {
+       background: none;
+}
+
+/* Internet Explorer 8 */
+.ie8 .site {
+       border: 0;
+}
+
+.ie8 img.size-full,
+.ie8 img.size-large {
+       height: auto;
+       width: auto;
+}
+
+.ie8 .sidebar .entry-header,
+.ie8 .sidebar .entry-content,
+.ie8 .sidebar .entry-summary,
+.ie8 .sidebar .entry-meta {
+       max-width: 724px;
+}
+
+.ie8 .author-info {
+       margin-left: 0;
+}
+
+.ie8 .paging-navigation .nav-previous .meta-nav {
+       padding: 5px 0 8px;
+       width: 40px;
+}
+
+.ie8 .paging-navigation .nav-next {
+       line-height: 1;
+}
+
+.ie8 .format-status .entry-content:before,
+.ie8 .format-status .entry-meta:before {
+       content: none;
+}
+
+.ie8 .site-main .widget-area {
+       margin-right: 0;
+}
+
+/* Internet Explorer 7 */
+.ie7 audio,
+.ie7 canvas,
+.ie7 video {
+       display: inline;
+       zoom: 1;
+}
+
+.ie7 legend {
+       margin-left: -7px;
+}
+
+.ie7 button,
+.ie7 input,
+.ie7 select,
+.ie7 textarea {
+       vertical-align: middle;
+}
+
+.ie7 button,
+.ie7 input[type="button"],
+.ie7 input[type="reset"],
+.ie7 input[type="submit"] {
+       overflow: visible;
+}
+
+.ie7 input[type="checkbox"],
+.ie7 input[type="radio"] {
+       height: 13px;
+       width: 13px;
+}
+
+.ie7 .screen-reader-text {
+       clip: rect(1px 1px 1px 1px); /* IE7 */
+}
+
+.ie7 .site-header {
+       position: relative;
+       z-index: 1;
+}
+
+.ie7 .main-navigation {
+       max-width: 930px;
+       padding-right: 150px;
+}
+
+.ie7 .nav-menu li a,
+.ie7 .nav-menu li {
+       display: block;
+       float: left;
+}
+
+.ie7 .nav-menu ul {
+       top: 40px;
+}
+
+.ie7 .nav-menu li ul ul {
+       left: 100%;
+       top: 0;
+}
+
+.ie7 .site-header .search-form [type="search"],
+.ie7 .site-header .search-form [type="text"] {
+       background-color: #fff;
+       border: 2px solid #c3c0ab;
+       cursor: text;
+       height: 28px;
+       outline: 0;
+       width: 150px;
+}
+
+.ie7 .entry-header,
+.ie7 .entry-content,
+.ie7 .entry-summary,
+.ie7 .entry-meta {
+       width: 604px;
+}
+
+.ie7 .format-status .entry-content,
+.ie7 .format-status .entry-meta {
+       padding-left: 60px;
+}
+
+.ie7 .sidebar .format-status .entry-content,
+.ie7 .sidebar .format-status .entry-meta {
+       padding-left: 60px;
+}
+
+.ie7 .sidebar .post-navigation .nav-links,
+.ie7 .sidebar .paging-navigation .nav-links {
+       width: 604px;
+}
+
+.ie7 .paging-navigation .meta-nav {
+       padding: 0 0 10px;
+       vertical-align: middle;
+       width: 40px;
+}
+
+.ie7 .comments-title,
+.ie7 .comment-list,
+.ie7 .comment-reply-title,
+.ie7 .comment-respond .comment-form {
+       width: 604px;
+}
+
+.ie7 .site-footer .widget-area {
+       max-width: none;
+       left: auto;
+}
+
+/* RTL for Internet Explorer 7 & 8 */
+.rtl .format-audio .entry-content:before,
+.rtl .comment-reply-link:before,
+.rtl .comment-reply-login:before {
+       -ms-filter: "FlipH";
+       filter: FlipH;
+}
\ No newline at end of file
diff --git a/wp-content/themes/twentythirteen/fonts/COPYING.txt b/wp-content/themes/twentythirteen/fonts/COPYING.txt
new file mode 100644 (file)
index 0000000..aece214
--- /dev/null
@@ -0,0 +1,9 @@
+Genericons is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
+
+The fonts are distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+As a special exception, if you create a document which uses this font, and embed this font or unaltered portions of this font into the document, this font does not by itself cause the resulting document to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the document might be covered by the GNU General Public License. If you modify this font, you may extend this exception to your version of the font, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.
+
+This license does not convey any intellectual property rights to third party trademarks that may be included in the icon font; such marks remain subject to all rights and guidelines of use of their owner.
\ No newline at end of file
similarity index 81%
rename from wp-content/themes/twentyeleven/license.txt
rename to wp-content/themes/twentythirteen/fonts/LICENSE.txt
index 5fbe4a70aac1e20394c50dedee1bfcf49cb4e419..d159169d1050894d3ea3b98e1c965c4058208fe1 100644 (file)
@@ -1,13 +1,12 @@
-                   GNU GENERAL PUBLIC LICENSE
-                      Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc. 
-              51 Franklin St, Fifth Floor, Boston, MA 02110, USA
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
 
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
-                           Preamble
+                            Preamble
 
   The licenses for most software are designed to take away your
 freedom to share and change it.  By contrast, the GNU General Public
@@ -16,7 +15,7 @@ software--to make sure the software is free for all its users.  This
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -57,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
   The precise terms and conditions for copying, distribution and
 modification follow.
 
-                   GNU GENERAL PUBLIC LICENSE
+                    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
   0. This License applies to any program or other work which contains
@@ -121,6 +120,7 @@ distribute the same sections as part of a whole which is a work based
 on the Program, the distribution of the whole must be on the terms of
 this License, whose permissions for other licensees extend to the
 entire whole, and thus to each and every part regardless of who wrote it.
+
 Thus, it is not the intent of this section to claim rights or contest
 your rights to work written entirely by you; rather, the intent is to
 exercise the right to control the distribution of derivative or
@@ -255,7 +255,7 @@ make exceptions for this.  Our decision will be guided by the two goals
 of preserving the free status of all derivatives of our free software and
 of promoting the sharing and reuse of software generally.
 
-                           NO WARRANTY
+                            NO WARRANTY
 
   11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
@@ -277,5 +277,63 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGES.
 
-                    END OF TERMS AND CONDITIONS
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
 
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/wp-content/themes/twentythirteen/fonts/genericons-regular-webfont.eot b/wp-content/themes/twentythirteen/fonts/genericons-regular-webfont.eot
new file mode 100644 (file)
index 0000000..defbbe5
Binary files /dev/null and b/wp-content/themes/twentythirteen/fonts/genericons-regular-webfont.eot differ
diff --git a/wp-content/themes/twentythirteen/fonts/genericons-regular-webfont.svg b/wp-content/themes/twentythirteen/fonts/genericons-regular-webfont.svg
new file mode 100644 (file)
index 0000000..32ff53b
--- /dev/null
@@ -0,0 +1,105 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="genericonsregular" horiz-adv-x="2048" >
+<font-face units-per-em="2048" ascent="1638" descent="-410" />
+<missing-glyph horiz-adv-x="500" />
+<glyph unicode="&#xe000;" horiz-adv-x="500" d="M0 0z" />
+<glyph unicode="&#xf100;" d="M512 512v128h768v-128h-768zM512 768v128h256v-128h-256zM512 1024v128h640v-128h-640zM512 1280v128h1024v-128h-1024zM896 768v128h640v-128h-640zM1280 1024v128h256v-128h-256z" />
+<glyph unicode="&#xf101;" d="M256 1024q0 209 103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5zM768 1024q0 -106 75 -181t181 -75t181 75t75 181t-75 181t-181 75t-181 -75t-75 -181z" />
+<glyph unicode="&#xf102;" d="M128 384v896l512 128l128 256h512l128 -256h512v-1024h-1792zM256 1440v160h256v-96zM576 960q0 -185 131.5 -316.5t316.5 -131.5q186 0 317 131.5t131 316.5t-131 316.5t-317 131.5q-185 0 -316.5 -131.5t-131.5 -316.5zM704 960q0 133 93.5 226.5t226.5 93.5 t226.5 -93.5t93.5 -226.5t-93.5 -226.5t-226.5 -93.5t-226.5 93.5t-93.5 226.5z" />
+<glyph unicode="&#xf103;" d="M128 512v384h384v-384h-384zM128 1024v384h896v-384h-896zM640 512v384h384v-384h-384zM1152 512v896h896v-896h-896z" />
+<glyph unicode="&#xf104;" d="M512 384v1280l1152 -640z" />
+<glyph unicode="&#xf105;" d="M640 1408q0 159 112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5q0 -124 -71.5 -222t-184.5 -138v-536l-256 -128v664q-113 40 -184.5 138t-71.5 222z" />
+<glyph unicode="&#xf106;" d="M384 640l128 768h512l-256 -768h-384zM1152 640l128 768h512l-256 -768h-384z" />
+<glyph unicode="&#xf107;" d="M387 862q0 106 75 181l136 135l91 -90l-136 -136q-38 -37 -38 -90t38 -91l90 -90q38 -38 91 -38t90 38l136 135l91 -90l-136 -136q-75 -75 -181 -75t-181 75l-91 91q-75 75 -75 181zM734 952l362 362l90 -90l-362 -362zM870 1450l135 136q75 75 181 75t181 -75l91 -91 q75 -75 75 -181t-75 -181l-136 -136l-90 91l135 136q38 37 38 90t-38 91l-90 90q-38 38 -91 38t-90 -38l-136 -135z" />
+<glyph unicode="&#xf108;" d="M0 1152v384q0 96 80 176t176 80h1024q96 0 176 -80t80 -176v-384q0 -96 -80 -176t-176 -80h-448l-448 -448v448h-128q-96 0 -176 80t-80 176zM768 640l128 128h384q168 0 276 108t108 276v384q96 0 176 -80t80 -176v-384q0 -96 -80 -176t-176 -80h-128v-448l-448 448 h-320z" />
+<glyph unicode="&#xf109;" d="M256 768v512h384l384 384v-1280l-384 384h-384zM1205 843q75 75 75 181t-75 181l91 91q53 -54 82.5 -124t29.5 -148t-29.5 -148t-82.5 -124zM1386 662q71 71 110.5 164.5t39.5 197.5t-39.5 197.5t-110.5 164.5l91 91q88 -89 137.5 -206t49.5 -247q0 -87 -23 -170 t-64.5 -153.5t-99.5 -129.5z" />
+<glyph unicode="&#xf200;" d="M0 1024q0 208 81 398t218.5 327t327 218t397.5 81q209 0 398.5 -81t326.5 -218t218 -326.5t81 -398.5q0 -335 -195.5 -601.5t-504.5 -369.5q-36 -7 -53 8.5t-17 40.5q0 4 0.5 102t0.5 179q0 130 -69 189q77 9 137.5 24.5t124.5 51.5t107 89t70.5 140t27.5 201 q0 161 -105 274q6 15 11 35t9 56t-3.5 83.5t-26.5 96.5q-4 1 -10.5 2t-32 -1t-55.5 -11t-79.5 -33.5t-104.5 -61.5q-118 33 -256 35q-138 -2 -256 -35q-55 37 -104 61.5t-80 33t-54.5 11.5t-33.5 1l-10 -2q-58 -146 -10 -271q-105 -115 -105 -274q0 -114 27.5 -201 t70.5 -140t107 -89t124.5 -52t136.5 -24q-53 -47 -65 -137q-28 -13 -59.5 -20t-75.5 -6.5t-87.5 28.5t-75.5 83q-2 4 -6.5 10.5t-19 24t-31.5 31t-44 25.5t-56 14h-10t-18.5 -3.5t-17 -9t4 -18.5t34.5 -31q3 -1 7.5 -4t19 -14.5t27.5 -27t30 -43.5t30 -61q1 -3 2.5 -7t8 -17 t15.5 -25.5t24.5 -28t33.5 -28t45 -23.5t57.5 -16t71.5 -3.5t87 11.5q0 -50 0.5 -110t0.5 -64q0 -24 -17 -40t-53 -10q-309 103 -504.5 370t-195.5 602z" />
+<glyph unicode="&#xf201;" d="M0 1024q0 206 82 395.5t219.5 327t327 219.5t395.5 82t395.5 -82t327 -219.5t219.5 -327t82 -395.5t-82 -395.5t-219.5 -327t-327 -219.5t-395.5 -82t-395.5 82t-327 219.5t-219.5 327t-82 395.5zM128 1024q0 -167 58 -319.5t166 -272.5q125 205 339 360t445 232 q-16 48 -80 176q-282 -86 -481.5 -111t-446.5 -1v-64zM160 1232q194 -22 444 14t388 82q-141 282 -320 528q-194 -85 -329.5 -247.5t-182.5 -376.5zM480 320q216 -192 544 -192q181 0 368 80q-33 300 -208 688q-222 -74 -410 -225.5t-294 -350.5zM832 1904 q102 -166 304 -512q6 2 86 31t118.5 45t108 47t122 64t93.5 69q-126 126 -290.5 199t-349.5 73q-32 0 -96 -8t-96 -8zM1200 1248q22 -29 36.5 -54.5t34 -67.5t25.5 -54q170 33 336 30t288 -30q-26 285 -160 464q-71 -57 -162 -104.5t-214.5 -100.5t-183.5 -83zM1344 928 q14 -27 43 -103t74.5 -231t74.5 -306q156 108 258 278t126 362q-276 46 -576 0z" />
+<glyph unicode="&#xf202;" d="M0 381q50 -6 100 -6q293 0 522 180q-137 2 -244.5 83t-147.5 208q44 -7 79 -7q57 0 110 15q-145 29 -241 144.5t-96 267.5v5q86 -48 191 -53q-86 58 -136.5 150t-50.5 200q0 113 57 211q158 -194 383 -310t483 -129q-11 49 -11 96q0 174 123 297t297 123q89 0 168.5 -35 t138.5 -97q142 27 266 102q-47 -150 -184 -233q124 15 241 66q-84 -127 -210 -217q2 -36 2 -55q0 -168 -49 -337t-150 -323.5t-241 -273.5t-336 -190t-420 -71q-351 0 -644 189z" />
+<glyph unicode="&#xf203;" d="M128 384v1280q0 106 75 181t181 75h1280q106 0 181 -75t75 -181v-1280q0 -106 -75 -181t-181 -75h-282v711h270l12 260h-282v192v12q0 60 21.5 87.5t87.5 27.5l166 -1l6 242q-78 10 -183 10q-94 0 -167 -27.5t-117 -74.5t-66 -105.5t-22 -126.5v-236h-254v-260h254v-711 h-724q-106 0 -181 75t-75 181z" />
+<glyph unicode="&#xf204;" d="M640 969v303h222v258q0 78 26 147t77 124t136.5 87t194.5 32q55 0 108 -3t79 -6l26 -3l-7 -282h-193q-76 0 -101.5 -32t-25.5 -101v-3v-2v-9v-207h329l-14 -303h-315v-841h-320v841h-222z" />
+<glyph unicode="&#xf205;" d="M128 1024q0 182 71 348t191 286t286 191t348 71t348 -71t286 -191t191 -286t71 -348t-71 -348t-191 -286t-286 -191t-348 -71t-348 71t-286 191t-191 286t-71 348zM218 1024q0 -236 125 -430.5t329 -294.5l-384 1053q-70 -156 -70 -328zM351 1466h52q37 0 91 2.5t89 4.5 l34 3q21 1 30.5 -14.5t2.5 -32.5t-27 -20q-44 -5 -93 -7l294 -873l176 529l-125 344l-85 7q-20 2 -27.5 19t2.5 33t30 15q133 -10 212 -10q38 0 91.5 2.5t88.5 4.5l35 3q16 1 25.5 -8.5t10 -22t-7 -23.5t-23.5 -13q-43 -5 -92 -7l291 -866l80 268q25 79 33.5 107.5 t18.5 74.5t10 79q0 46 -11.5 90.5t-23.5 71t-32 60.5q-2 4 -11.5 19t-12 20t-10.5 18.5t-11 19t-9 17.5t-8.5 19t-6.5 18t-5.5 19.5t-3 18.5t-1.5 20q0 57 39 100t96 43q3 0 11 -1q-110 101 -249.5 156.5t-294.5 55.5q-208 0 -385.5 -98t-287.5 -266zM796 251 q112 -33 228 -33q138 0 267 46q-3 6 -5 11l-248 679zM1429 328q183 106 291.5 291.5t108.5 404.5q0 207 -98 386q5 -40 5 -82q0 -135 -61 -289z" />
+<glyph unicode="&#xf206;" d="M128 486v485q125 -127 330 -127q30 0 59 3q-32 -61 -32 -118q0 -33 13 -63t28.5 -48.5t45.5 -47.5q-18 0 -54.5 -0.5t-55.5 -0.5q-183 0 -334 -83zM128 1599v65q0 106 75 181t181 75h1280q106 0 181 -75t75 -181v-128h-256v256h-128v-256h-256v-128h256v-256h128v256h256 v-1024q0 -106 -75 -181t-181 -75h-507q5 28 5 50q0 143 -46.5 230t-189.5 194q-3 2 -20.5 15t-25 19t-25.5 20t-27.5 22.5t-24 22t-23 23.5t-17 22t-12.5 22.5t-4 20.5q0 52 23 87t99 94q180 141 180 324q0 113 -45 204.5t-128 139.5h160l135 142h-607q-127 0 -241.5 -49 t-194.5 -132zM139 309q57 85 166 137.5t237 51.5q84 -1 158 -26q19 -13 62 -42.5t61 -42t48 -37t44.5 -41.5t29 -41.5t21.5 -49.5q7 -29 7 -66q0 -16 -1 -24h-588q-85 0 -153 50.5t-92 130.5zM228 1307q-21 161 50.5 269.5t194.5 104.5q121 -4 215.5 -118.5t116.5 -277.5 q21 -160 -43 -256t-187 -92q-125 4 -225.5 108t-121.5 262z" />
+<glyph unicode="&#xf207;" d="M384 1422q0 -58 40.5 -97.5t105.5 -39.5h1q67 0 108.5 39.5t41.5 97.5q-2 60 -42 98.5t-106 38.5q-67 0 -108 -39t-41 -98zM400 384h263v793h-263v-793zM809 384h264v443q0 45 8 64q16 40 50.5 68t85.5 28q133 0 133 -179v-424h264v455q0 175 -83.5 266t-220.5 91 q-50 0 -90.5 -12t-68.5 -34t-45 -41t-33 -44v112h-264v-793z" />
+<glyph unicode="&#xf208;" d="M128 384v1280q0 106 75 181t181 75h1280q106 0 181 -75t75 -181v-1280q0 -106 -75 -181t-181 -75h-1280q-106 0 -181 75t-75 181zM384 1422q0 -58 40.5 -97.5t105.5 -39.5h1q67 0 108.5 39.5t41.5 97.5q-2 60 -42 98.5t-106 38.5q-67 0 -108 -39t-41 -98zM400 384h263 v793h-263v-793zM809 384h264v443q0 45 8 64q16 40 50.5 68t85.5 28q133 0 133 -179v-424h264v455q0 175 -83.5 266t-220.5 91q-50 0 -90.5 -12t-68.5 -34t-45 -41t-33 -44v112h-264v-793z" />
+<glyph unicode="&#xf209;" d="M171 1260q0 109 35.5 219t110 213t179 182t254 126.5t323.5 47.5q176 0 327.5 -60.5t253.5 -161t160 -231t58 -270.5q0 -246 -85 -443t-241 -309.5t-355 -112.5q-99 0 -186.5 46.5t-121.5 110.5q-73 -290 -89 -347q-34 -123 -127 -270l-149 54q-7 167 22 290l162 688 q-40 81 -40 200q0 139 70.5 232.5t172.5 93.5q83 0 127 -53.5t44 -135.5q0 -51 -18.5 -124t-49 -170t-44.5 -154q-23 -99 37.5 -171t161.5 -72q117 0 209.5 92t142 244.5t49.5 334.5q0 214 -139 349t-387 135q-139 0 -257.5 -49.5t-197 -133t-122.5 -193t-44 -229.5 q0 -147 83 -247q18 -21 21.5 -34t-3.5 -37q-16 -61 -25 -101q-7 -24 -24.5 -32t-39.5 1q-127 51 -192.5 181.5t-65.5 300.5z" />
+<glyph unicode="&#xf210;" d="M0 1024q0 208 81 398t218.5 327t327 218t397.5 81q209 0 398.5 -81t326.5 -218t218 -326.5t81 -398.5t-81 -398.5t-218 -326.5t-326.5 -218t-398.5 -81q-147 0 -290 42q74 116 103 219l72 282q28 -53 99 -90.5t151 -37.5q162 0 288.5 91.5t195.5 251t69 359.5 q0 114 -47 220t-130 187.5t-206.5 130.5t-265.5 49q-141 0 -262 -38.5t-205.5 -103t-145.5 -147.5t-89.5 -172.5t-28.5 -178.5q0 -138 53 -243.5t156 -147.5q18 -8 32.5 -1t18.5 26q2 9 10 41t11 41q5 19 2.5 30t-16.5 28q-68 78 -68 200q0 97 35.5 186t99.5 156.5t160 108 t209 40.5q201 0 313.5 -109.5t112.5 -283.5q0 -148 -40 -271.5t-115 -198t-169 -74.5q-82 0 -131.5 58.5t-30.5 138.5q11 46 35.5 125t39.5 138t15 101q0 66 -35.5 109.5t-102.5 43.5q-82 0 -139.5 -76t-57.5 -189q0 -43 8 -83.5t16 -59.5l9 -19q-113 -475 -132 -558 q-24 -97 -18 -235q-275 120 -444 374t-169 564z" />
+<glyph unicode="&#xf211;" d="M160 1024q0 -172 122 -294t294 -122t294 122t122 294t-122 294t-294 122t-294 -122t-122 -294zM1056 1024q0 -172 122 -294t294 -122t294 122t122 294t-122 294t-294 122t-294 -122t-122 -294z" />
+<glyph unicode="&#xf212;" d="M128 1379l84 -108q121 84 141 84q92 0 173 -287q20 -73 46 -167.5t52 -190t46 -167.5q108 -287 265 -287q253 0 619 471q353 451 365 710q16 347 -260 355q-373 12 -505 -417q69 29 133 29q136 0 120 -152q-8 -92 -120 -268q-113 -176 -169 -176q-73 0 -133 271 q-20 78 -72 407q-49 303 -258 284q-89 -8 -265 -160q-126 -113 -262 -231z" />
+<glyph unicode="&#xf213;" d="M128 768v512q0 159 112.5 271.5t271.5 112.5h1024q159 0 271.5 -112.5t112.5 -271.5v-512q0 -104 -51.5 -192.5t-140 -140t-192.5 -51.5h-1024q-104 0 -192.5 51.5t-140 140t-51.5 192.5zM768 640l640 384l-640 384v-768z" />
+<glyph unicode="&#xf214;" d="M472 1186h198v-629q0 -121 26 -187q26 -65 92 -122t161 -89q93 -31 218 -31q110 0 201 22q88 20 208 76v282q-134 -88 -271 -88q-76 0 -136 36q-44 25 -61 70q-17 46 -17 200v460h426v281h-426v453h-255q-17 -139 -62 -228q-48 -93 -121 -154q-74 -64 -181 -99v-253z" />
+<glyph unicode="&#xf215;" d="M128 384v1280q0 106 75 181t181 75h1280q106 0 181 -75t75 -181v-1280q0 -106 -75 -181t-181 -75h-1280q-106 0 -181 75t-75 181zM256 384q0 -53 37.5 -90.5t90.5 -37.5h1280q53 0 90.5 37.5t37.5 90.5v768h-272q16 -66 16 -128q0 -212 -150 -362t-362 -150t-362 150 t-150 362q0 62 16 128h-272v-768zM640 1024q0 -159 112.5 -271.5t271.5 -112.5t271.5 112.5t112.5 271.5t-112.5 271.5t-271.5 112.5t-271.5 -112.5t-112.5 -271.5zM1408 1536q0 -53 37.5 -90.5t90.5 -37.5h128q53 0 90.5 37.5t37.5 90.5v128q0 53 -37.5 90.5t-90.5 37.5 h-128q-53 0 -90.5 -37.5t-37.5 -90.5v-128z" />
+<glyph unicode="&#xf216;" d="M256 790v467q0 31 29 55l702 467q17 11 37 11t37 -11l702 -467q29 -24 29 -55v-467q0 -32 -29 -54l-702 -468q-17 -11 -37 -11q-18 0 -37 11l-702 468q-29 22 -29 54zM388 914l165 110l-165 110v-220zM441 790l517 -344v308l-286 191zM441 1257l231 -154l286 191v307z M791 1024l233 -156l234 156l-234 156zM1090 446l517 344l-231 155l-286 -191v-308zM1090 1294l286 -191l231 154l-517 344v-307zM1495 1024l165 -110v220z" />
+<glyph unicode="&#xf300;" d="M256 896v384q0 106 75 181t181 75h1024q106 0 181 -75t75 -181v-384q0 -106 -75 -181t-181 -75h-448l-448 -448v448h-128q-106 0 -181 75t-75 181z" />
+<glyph unicode="&#xf301;" d="M384 512v1024h384l64 -128h448v-128h-640l-128 -256h128l64 128h960l-256 -640h-1024z" />
+<glyph unicode="&#xf302;" d="M256 768l768 768h512v-512l-768 -768zM1152 1280q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5t-37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5z" />
+<glyph unicode="&#xf303;" d="M256 1088q0 143 55.5 273.5t150 225t225 150t273.5 55.5t273.5 -55.5t225 -150t150 -225t55.5 -273.5t-55.5 -273.5t-150 -225t-225 -150t-273.5 -55.5t-273.5 55.5t-225 150t-150 225t-55.5 273.5zM384 1088q0 -117 45.5 -223.5t123 -184t184 -123t223.5 -45.5 t223.5 45.5t184 123t123 184t45.5 223.5t-45.5 223.5t-123 184t-184 123t-223.5 45.5t-223.5 -45.5t-184 -123t-123 -184t-45.5 -223.5zM896 1062v474h128v-421l298 -298l-90 -91z" />
+<glyph unicode="&#xf304;" d="M512 384v256q0 159 112.5 271.5t271.5 112.5h256q159 0 271.5 -112.5t112.5 -271.5v-256h-1024zM768 1408q0 106 75 181t181 75t181 -75t75 -181t-75 -181t-181 -75t-181 75t-75 181z" />
+<glyph unicode="&#xf305;" d="M256 384v1280h256v128h128v-128h640v128h128v-128h256v-1280h-1408zM384 640q0 -53 37.5 -90.5t90.5 -37.5h896q53 0 90.5 37.5t37.5 90.5v640q0 53 -37.5 90.5t-90.5 37.5h-896q-53 0 -90.5 -37.5t-37.5 -90.5v-640zM768 1216q0 26 19 45t45 19h128q26 0 45 -19t19 -45 v-512q0 -26 -19 -45t-45 -19t-45 19t-19 45v448h-64q-26 0 -45 19t-19 45z" />
+<glyph unicode="&#xf306;" d="M256 384v1280h256v128h128v-128h640v128h128v-128h256v-1280h-1408zM384 640q0 -53 37.5 -90.5t90.5 -37.5h896q53 0 90.5 37.5t37.5 90.5v640q0 53 -37.5 90.5t-90.5 37.5h-896q-53 0 -90.5 -37.5t-37.5 -90.5v-640zM768 1216q0 26 19 45t45 19h256h2h1h3 q22 -2 38.5 -18t19.5 -39v-2v-2v-1v-2q0 -5 -2 -15l-128 -512q-6 -26 -28.5 -40t-48.5 -7q-26 6 -40 28.5t-7 48.5l108 433h-174q-26 0 -45 19t-19 45z" />
+<glyph unicode="&#xf307;" d="M256 384v1280h256v128h128v-128h640v128h128v-128h256v-1280h-1408zM384 640q0 -53 37.5 -90.5t90.5 -37.5h896q53 0 90.5 37.5t37.5 90.5v640q0 53 -37.5 90.5t-90.5 37.5h-896q-53 0 -90.5 -37.5t-37.5 -90.5v-640zM512 640v128h128v-128h-128zM512 896v128h128v-128 h-128zM768 640v128h128v-128h-128zM768 896v128h128v-128h-128zM768 1152v128h128v-128h-128zM1024 640v128h128v-128h-128zM1024 896v128h128v-128h-128zM1024 1152v128h128v-128h-128zM1280 896v128h128v-128h-128zM1280 1152v128h128v-128h-128z" />
+<glyph unicode="&#xf308;" d="M256 384l512 512l128 -128l-512 -512zM576 1216v128h384l320 320v256h128l512 -512v-128h-256l-320 -320v-384h-128z" />
+<glyph unicode="&#xf400;" d="M256 1216q0 117 45.5 223.5t123 184t184 123t223.5 45.5t223.5 -45.5t184 -123t123 -184t45.5 -223.5q0 -184 -111 -337l495 -495l-128 -128l-495 495q-153 -111 -337 -111q-117 0 -223.5 45.5t-184 123t-123 184t-45.5 223.5zM384 1216q0 -185 131.5 -316.5 t316.5 -131.5q186 0 317 131.5t131 316.5t-131 316.5t-317 131.5q-185 0 -316.5 -131.5t-131.5 -316.5z" />
+<glyph unicode="&#xf401;" d="M256 1216q0 117 45.5 223.5t123 184t184 123t223.5 45.5t223.5 -45.5t184 -123t123 -184t45.5 -223.5q0 -184 -111 -337l495 -495l-128 -128l-495 495q-153 -111 -337 -111q-117 0 -223.5 45.5t-184 123t-123 184t-45.5 223.5zM384 1216q0 -185 131.5 -316.5 t316.5 -131.5q186 0 317 131.5t131 316.5t-131 316.5t-317 131.5q-185 0 -316.5 -131.5t-131.5 -316.5zM512 1152v128h640v-128h-640z" />
+<glyph unicode="&#xf402;" d="M256 1216q0 117 45.5 223.5t123 184t184 123t223.5 45.5t223.5 -45.5t184 -123t123 -184t45.5 -223.5q0 -184 -111 -337l495 -495l-128 -128l-495 495q-153 -111 -337 -111q-117 0 -223.5 45.5t-184 123t-123 184t-45.5 223.5zM384 1216q0 -185 131.5 -316.5 t316.5 -131.5q186 0 317 131.5t131 316.5t-131 316.5t-317 131.5q-185 0 -316.5 -131.5t-131.5 -316.5zM512 1152v128h256v256h128v-256h256v-128h-256v-256h-128v256h-256z" />
+<glyph unicode="&#xf403;" d="M0 1024l506 506q101 103 234.5 160.5t283.5 57.5t283.5 -57.5t233.5 -159.5l507 -507l-506 -507q-101 -103 -234.5 -160t-283.5 -57t-283.5 57.5t-233.5 160.5zM272 1024l370 -371q77 -78 175.5 -119.5t206.5 -41.5t206 41.5t174 118.5l373 372l-371 371 q-158 161 -382 161q-108 0 -206.5 -41t-173.5 -119zM640 1024q0 159 112.5 271.5t271.5 112.5t271.5 -112.5t112.5 -271.5t-112.5 -271.5t-271.5 -112.5t-271.5 112.5t-112.5 271.5zM1024 1152q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5t-37.5 90.5t-90.5 37.5 t-90.5 -37.5t-37.5 -90.5z" />
+<glyph unicode="&#xf404;" d="M0 1024l506 506q101 103 234.5 160.5t283.5 57.5q193 0 358 -95l-143 -143q-103 46 -215 46q-108 0 -206.5 -41t-173.5 -119l-372 -372l240 -240l-136 -136zM339 429l90 -90l1280 1280l-90 90zM640 1024q0 159 112.5 271.5t271.5 112.5q44 0 98 -14l-468 -468 q-14 54 -14 98zM666 395l143 143q103 -46 215 -46q108 0 206 41.5t174 118.5l373 372l-241 241l136 135l376 -376l-506 -507q-101 -103 -234.5 -160t-283.5 -57q-193 0 -358 95zM926 654l468 468q14 -54 14 -98q0 -159 -112.5 -271.5t-271.5 -112.5q-44 0 -98 14z" />
+<glyph unicode="&#xf405;" d="M640 768l320 320l-320 320l128 128l320 -320l320 320l128 -128l-320 -320l320 -320l-128 -128l-320 320l-320 -320z" />
+<glyph unicode="&#xf406;" d="M128 256l832 832l-832 832l128 128l832 -832l832 832l128 -128l-832 -832l832 -832l-128 -128l-832 832l-832 -832z" />
+<glyph unicode="&#xf407;" d="M384 1280v128l256 128q0 53 37.5 90.5t90.5 37.5h384q53 0 90.5 -37.5t37.5 -90.5l256 -128v-128h-1152zM512 512v704h128v-704h128v704h128v-704h128v704h128v-704h128v704h128v-704q0 -53 -37.5 -90.5t-90.5 -37.5h-640q-53 0 -90.5 37.5t-37.5 90.5zM768 1472 q0 -26 19 -45t45 -19h256q26 0 45 19t19 45t-19 45t-45 19h-256q-26 0 -45 -19t-19 -45z" />
+<glyph unicode="&#xf408;" d="M256 1151l476 -330l-183 -535l475 332l475 -332l-183 535l476 329h-587l-181 535l-180 -534h-588z" />
+<glyph unicode="&#xf409;" d="M384 1024l640 640l640 -640l-128 -128l-512 512l-512 -512zM640 512v384l384 384l384 -384v-384h-256v384h-256v-384h-256z" />
+<glyph unicode="&#xf410;" d="M256 512v51l576 384l192 -128l192 128l576 -384v-51h-1536zM256 717v614l461 -307zM256 1485v51h1536v-51l-768 -512zM1331 1024l461 307v-614z" />
+<glyph unicode="&#xf411;" d="M384 384v448l896 896l448 -448l-896 -896h-448zM512 768l256 -256l128 128l-256 256zM685 941l96 -96l595 595l-96 96zM845 781l96 -96l595 595l-96 96z" />
+<glyph unicode="&#xf412;" d="M256 640v704l384 384v-704h640v448l640 -640l-640 -640v448h-1024z" />
+<glyph unicode="&#xf413;" d="M128 384q0 106 75 181t181 75t181 -75t75 -181t-75 -181t-181 -75t-181 75t-75 181zM128 971v345q240 0 459 -94t377.5 -253.5t252.5 -379.5t94 -461h-345q0 170 -63.5 324t-181.5 273q-119 119 -272 182.5t-321 63.5zM129 1582v345q243 0 475 -64.5t428.5 -181 t362 -282.5t281 -363.5t180 -430.5t64.5 -477h-345q0 197 -52 385.5t-145.5 348t-227 294t-292 228t-346 146t-383.5 52.5z" />
+<glyph unicode="&#xf414;" d="M21 230q-57 102 31 244l760 1237q57 93 134.5 126.5t155 0t135.5 -126.5l759 -1237q88 -142 31 -244t-224 -102h-1557q-168 0 -225 102zM896 512q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5t-37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5zM896 896 q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5v384q0 53 -37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5v-384z" />
+<glyph unicode="&#xf415;" d="M128 1024h400q45 0 79.5 27.5t44.5 69.5q33 125 136.5 206t235.5 81q154 0 270 -114q38 -38 90.5 -38t90.5 38q37 38 37 91t-37 90q-88 89 -204.5 139t-246.5 50q-194 0 -353 -106t-234 -278h-309v-256zM536 663q0 -53 37 -90q89 -89 205 -139t246 -50q194 0 353 106 t234 278h309v256h-400q-45 0 -79.5 -27.5t-44.5 -69.5q-33 -125 -136.5 -206t-235.5 -81q-156 0 -269 115q-38 37 -91 37t-91 -38q-37 -38 -37 -91zM768 1024q0 -106 75 -181t181 -75t181 75t75 181t-75 181t-181 75t-181 -75t-75 -181z" />
+<glyph unicode="&#xf416;" d="M512 832v320h128v-320q0 -133 93.5 -226.5t226.5 -93.5t226.5 93.5t93.5 226.5v640q0 80 -56 136t-136 56t-136 -56t-56 -136v-512q0 -26 19 -45t45 -19t45 19t19 45v452h128v-452q0 -80 -56 -136t-136 -56t-136 56t-56 136v512q0 133 93.5 226.5t226.5 93.5t226.5 -93.5 t93.5 -226.5v-640q0 -185 -131.5 -316.5t-316.5 -131.5t-316.5 131.5t-131.5 316.5z" />
+<glyph unicode="&#xf417;" d="M384 1216q0 117 45.5 223.5t123 184t184 123t223.5 45.5t223.5 -45.5t184 -123t123 -184t45.5 -223.5t-44.5 -222.5t-124.5 -185.5l-407 -406l-407 406q-80 80 -124.5 185.5t-44.5 222.5zM640 1216q0 -133 93.5 -226.5t226.5 -93.5t226.5 93.5t93.5 226.5t-93.5 226.5 t-226.5 93.5t-226.5 -93.5t-93.5 -226.5z" />
+<glyph unicode="&#xf418;" d="M608 1056l128 128l224 -192l448 512l128 -96l-512 -768h-128z" />
+<glyph unicode="&#xf419;" d="M0 256v256h2048v-256h-2048zM0 896v256h2048v-256h-2048zM0 1536v256h2048v-256h-2048z" />
+<glyph unicode="&#xf421;" d="M384 896v256h1152v-256h-1152z" />
+<glyph unicode="&#xf422;" d="M384 512v1024h1152v-1024h-1152zM512 640h896v640h-896v-640z" />
+<glyph unicode="&#xf423;" d="M83 832l373 671l112 -62l-267 -481h403v-384h-128v256h-493zM768 1024q0 87 43 160.5t116.5 116.5t160.5 43t160.5 -43t116.5 -116.5t43 -160.5t-43 -160.5t-116.5 -116.5t-160.5 -43t-160.5 43t-116.5 116.5t-43 160.5zM896 1024q0 -79 56.5 -135.5t135.5 -56.5 t135.5 56.5t56.5 135.5t-56.5 135.5t-135.5 56.5t-135.5 -56.5t-56.5 -135.5zM1427 832l373 671l112 -62l-267 -481h403v-384h-128v256h-493z" />
+<glyph unicode="&#xf424;" d="M256 640v768l384 384h768l384 -384v-768l-384 -384h-768zM896 640q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5t-37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5zM896 1024q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5v384q0 53 -37.5 90.5t-90.5 37.5 t-90.5 -37.5t-37.5 -90.5v-384z" />
+<glyph unicode="&#xf425;" d="M384 384v1280h256q0 53 37.5 90.5t90.5 37.5h384q53 0 90.5 -37.5t37.5 -90.5h256v-1280h-1152zM512 512h896v1024h-128v-128h-640v128h-128v-1024zM640 704q0 26 19 45t45 19t45 -19t19 -45t-19 -45t-45 -19t-45 19t-19 45zM640 960q0 26 19 45t45 19t45 -19t19 -45 t-19 -45t-45 -19t-45 19t-19 45zM640 1216q0 26 19 45t45 19t45 -19t19 -45t-19 -45t-45 -19t-45 19t-19 45zM768 1600q0 -26 19 -45t45 -19h256q26 0 45 19t19 45t-19 45t-45 19h-256q-26 0 -45 -19t-19 -45zM896 640v128h384v-128h-384zM896 896v128h384v-128h-384z M896 1152v128h384v-128h-384z" />
+<glyph unicode="&#xf426;" d="M128 768q0 106 75 181t181 75h7q-7 29 -7 64q0 133 93.5 226.5t226.5 93.5q134 0 228 -96q47 101 140.5 162.5t207.5 61.5q159 0 271.5 -112.5t112.5 -271.5q0 -62 -23 -128h23q106 0 181 -75t75 -181t-75 -181t-181 -75h-1280q-106 0 -181 75t-75 181z" />
+<glyph unicode="&#xf427;" d="M384 384v288l455 455l-1 1q-74 74 -74 180t74 181l233 233q75 74 181 74t180 -74l286 -286q74 -75 74 -180.5t-74 -180.5l-233 -233q-74 -73 -178.5 -74t-179.5 71l-455 -455h-288zM1088 1360l256 -256l160 160l-256 256z" />
+<glyph unicode="&#xf428;" d="M768 1024q0 106 75 181t181 75t181 -75t75 -181t-75 -181t-181 -75t-181 75t-75 181z" />
+<glyph unicode="&#xf429;" d="M384 896v128h896l-343 343l87 86l493 -493l-493 -493l-87 86l343 343h-896z" />
+<glyph unicode="&#xf430;" d="M531 960l493 -493l87 86l-343 343h896v128h-896l343 343l-87 86z" />
+<glyph unicode="&#xf431;" d="M384 1152l128 128l448 -448l448 448l128 -128l-576 -576z" />
+<glyph unicode="&#xf432;" d="M384 768l576 576l576 -576l-128 -128l-448 448l-448 -448z" />
+<glyph unicode="&#xf433;" d="M0 0v896l896 -896h-896z" />
+<glyph unicode="&#xf434;" d="M1152 0l896 896v-896h-896z" />
+<glyph unicode="&#xf435;" d="M384 512l640 640l640 -640h-1280zM384 1280v128h1280v-128h-1280z" />
+<glyph unicode="&#xf436;" d="M512 640v128h128v-128h-128zM512 896v128h128v-128h-128zM512 1152v128h128v-128h-128zM512 1408v128h128v-128h-128zM768 640v128h128v-128h-128zM768 896v128h128v-128h-128zM768 1152v128h128v-128h-128zM768 1408v128h128v-128h-128zM1024 640v128h128v-128h-128z M1024 896v128h128v-128h-128zM1024 1152v128h128v-128h-128zM1024 1408v128h128v-128h-128zM1280 640v128h128v-128h-128zM1280 896v128h128v-128h-128zM1280 1152v128h128v-128h-128zM1280 1408v128h128v-128h-128z" />
+<glyph unicode="&#xf437;" d="M512 512v1024q0 106 75 181t181 75h512q106 0 181 -75t75 -181v-1024q0 -106 -75 -181t-181 -75h-512q-106 0 -181 75t-75 181zM640 768h768v768h-768v-768zM896 512q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5t-37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5z " />
+<glyph unicode="&#xf438;" d="M256 1024v256h512v128l384 -256l-384 -256v128h-512zM512 512v384h128v-128h768v768h-768v-128h-128v128q0 106 75 181t181 75h512q106 0 181 -75t75 -181v-1024q0 -106 -75 -181t-181 -75h-512q-106 0 -181 75t-75 181zM896 512q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5 t37.5 90.5t-37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5z" />
+<glyph unicode="&#xf439;" d="M384 1152h1280q0 -231 -145.5 -406.5t-366.5 -220.5v-269h-256v269q-221 45 -366.5 220.5t-145.5 406.5zM640 1280v384q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5v-384h-256zM1152 1280v384q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5v-384h-256z" />
+<glyph unicode="&#xf440;" d="M128 768q0 106 75 181t181 75h6q-6 32 -6 64q0 133 93.5 226.5t226.5 93.5q134 0 228 -96q47 101 140.5 162.5t207.5 61.5q159 0 271.5 -112.5t112.5 -271.5q0 -62 -23 -128h23q106 0 181 -75t75 -181t-75 -181t-181 -75h-384v256h-512v-256h-384q-106 0 -181 75t-75 181 zM640 384h256v256h256v-256h256l-384 -384z" />
+<glyph unicode="&#xf441;" d="M128 768q0 106 75 181t181 75h6q-6 32 -6 64q0 133 93.5 226.5t226.5 93.5q134 0 228 -96q47 101 140.5 162.5t207.5 61.5q159 0 271.5 -112.5t112.5 -271.5q0 -62 -23 -128h23q106 0 181 -75t75 -181t-75 -181t-181 -75h-512v256h256l-384 384l-384 -384h256v-256h-512 q-106 0 -181 75t-75 181z" />
+<glyph unicode="&#xf442;" d="M512 512v896h512l-128 -128h-256v-640h640v256l128 128v-512h-896zM896 987l550 549h-422v128h640v-640h-128v422l-550 -550z" />
+<glyph unicode="&#xf443;" d="M512 384v1280h640l384 -384v-896h-1024zM640 512h768v640h-384v384h-384v-1024zM1152 1280h203l-203 203v-203z" />
+<glyph unicode="&#xf444;" d="M384 512v1024q0 106 75 181t181 75h1024v-1152h-64q-53 0 -90.5 -37.5t-37.5 -90.5t37.5 -90.5t90.5 -37.5h64v-128h-1024q-106 0 -181 75t-75 181zM512 512q0 -53 37.5 -90.5t90.5 -37.5h818q-50 55 -50 128t50 128h-818q-53 0 -90.5 -37.5t-37.5 -90.5z" />
+<glyph unicode="&#xf445;" d="M160 747l232 201q-8 67 -8 76q0 8 8 75l-232 201l58 139l305 -21q47 60 107 107l-21 305l139 58l201 -232q67 8 75 8t75 -8l201 232l140 -58l-22 -305q56 -44 107 -107l305 22l58 -139l-232 -201q8 -67 8 -76q0 -8 -8 -75l232 -201l-58 -140l-305 22q-44 -56 -107 -107 l22 -305l-139 -58l-201 232q-67 -8 -76 -8q-8 0 -75 8l-201 -232l-139 58l21 305q-56 44 -107 107l-305 -22zM768 1024q0 -106 75 -181t181 -75t181 75t75 181t-75 181t-181 75t-181 -75t-75 -181z" />
+<glyph unicode="&#xf446;" d="M256 1024q0 209 103 385.5t279.5 279.5t385.5 103t385.5 -103t279.5 -279.5t103 -385.5t-103 -385.5t-279.5 -279.5t-385.5 -103t-385.5 103t-279.5 279.5t-103 385.5zM512 1024q0 -212 150 -362t362 -150q135 0 259 72l-699 699q-72 -126 -72 -259zM765 1464l699 -699 q72 123 72 259q0 212 -150 362t-362 150q-136 0 -259 -72z" />
+<glyph unicode="&#xf447;" d="M256 1664v128h384v-256h1152l-256 -640h-896v-128h896v-128h-1024v1024h-256zM512 384q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5t-37.5 -90.5t-90.5 -37.5t-90.5 37.5t-37.5 90.5zM1280 384q0 53 37.5 90.5t90.5 37.5t90.5 -37.5t37.5 -90.5t-37.5 -90.5 t-90.5 -37.5t-90.5 37.5t-37.5 90.5z" />
+<glyph unicode="&#xf448;" d="M512 384v1280h384v-1280h-384zM1152 384v1280h384v-1280h-384z" />
+<glyph unicode="&#xf449;" d="M512 512v1024h1024v-1024h-1024z" />
+<glyph unicode="&#xf450;" d="M256 384v1280h384v-1280h-384zM768 1024l1024 640v-1280z" />
+<glyph unicode="&#xf451;" d="M256 384v1280l1024 -640zM1408 384v1280h384v-1280h-384z" />
+<glyph unicode="&#xf452;" d="M512 384v1280l1024 -640z" />
+<glyph unicode="&#xf453;" d="M256 256v1536q0 106 75 181t181 75h1024q106 0 181 -75t75 -181v-1536q0 -106 -75 -181t-181 -75h-1024q-106 0 -181 75t-75 181zM512 512h1024v1280h-1024v-1280zM896 256q0 -53 37.5 -90.5t90.5 -37.5t90.5 37.5t37.5 90.5t-37.5 90.5t-90.5 37.5t-90.5 -37.5 t-37.5 -90.5z" />
+<glyph unicode="&#xf454;" d="M128 1024v256h512v128l384 -256l-384 -256v128h-512zM256 256v640h256v-384h1024v1280h-1024v-384h-256v384q0 106 75 181t181 75h1024q106 0 181 -75t75 -181v-1536q0 -106 -75 -181t-181 -75h-1024q-106 0 -181 75t-75 181zM896 256q0 -53 37.5 -90.5t90.5 -37.5 t90.5 37.5t37.5 90.5t-37.5 90.5t-90.5 37.5t-90.5 -37.5t-37.5 -90.5z" />
+<glyph unicode="&#xf500;" d="M128 0l960 960l960 -960h-1920z" />
+<glyph unicode="&#xf501;" d="M0 128l960 960l-960 960v-1920z" />
+<glyph unicode="&#xf502;" d="M128 2048l960 -960l960 960h-1920z" />
+<glyph unicode="&#xf503;" d="M1088 1088l960 960v-1920z" />
+</font>
+</defs></svg> 
\ No newline at end of file
diff --git a/wp-content/themes/twentythirteen/fonts/genericons-regular-webfont.ttf b/wp-content/themes/twentythirteen/fonts/genericons-regular-webfont.ttf
new file mode 100644 (file)
index 0000000..a21dcb6
Binary files /dev/null and b/wp-content/themes/twentythirteen/fonts/genericons-regular-webfont.ttf differ
diff --git a/wp-content/themes/twentythirteen/fonts/genericons-regular-webfont.woff b/wp-content/themes/twentythirteen/fonts/genericons-regular-webfont.woff
new file mode 100644 (file)
index 0000000..b57e62c
Binary files /dev/null and b/wp-content/themes/twentythirteen/fonts/genericons-regular-webfont.woff differ
diff --git a/wp-content/themes/twentythirteen/fonts/genericons.css b/wp-content/themes/twentythirteen/fonts/genericons.css
new file mode 100644 (file)
index 0000000..2fde399
--- /dev/null
@@ -0,0 +1,157 @@
+/**
+
+       Genericons Helper CSS
+
+*/
+
+
+/**
+ * The font was graciously generated by Font Squirrel (http://www.fontsquirrel.com). We love those guys.
+ */
+@font-face {
+       font-family: 'Genericons';
+       src: url('genericons-regular-webfont.eot');
+}
+
+@font-face {
+       font-family: 'Genericons';
+       src: url(data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAC98ABEAAAAATZgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABgAAAABwAAAAcaBk2X0dERUYAAAGcAAAAHQAAACAAjwAET1MvMgAAAbwAAABCAAAAYFFfaIFjbWFwAAACAAAAAIcAAAGayK6UdGN2dCAAAAKIAAAABgAAAAYAfwEJZnBnbQAAApAAAAGxAAACZVO0L6dnYXNwAAAERAAAAAgAAAAI//8AA2dseWYAAARMAAAmfwAAPpi5AaxsaGVhZAAAKswAAAArAAAANgMOxuZoaGVhAAAq+AAAABwAAAAkEAMH3WhtdHgAACsUAAAAcAAAAM5JOTFAbG9jYQAAK4QAAADGAAAAxk3HPlxtYXhwAAAsTAAAACAAAAAgAYoBJW5hbWUAACxsAAABZgAAAwhJCWWYcG9zdAAALdQAAAFwAAAD3pfLCKFwcmVwAAAvRAAAAC4AAAAusPIrFHdlYmYAAC90AAAABgAAAAYLT1HIAAAAAQAAAADMPaLPAAAAAM3t18IAAAAAze27zXjaY2BkYGDgA2IJBhBgYmAEwkQgZgHzGAAIdQCUAAAAeNpjYGZ/zziBgZWBhdWY5QwDA8NMCM10hsEIzAdKYQeh3uF+DA4PGL4ys6X9S2Ng4GBg0AAKMyIpUWBgBACF8guRAAB42mNgYGBmgGAZBkYGEJgC5DGC+SwMFUBaikEAKML1gOEj5yfOT2KfOb5wfpH8ovnF8ovnl5CvzP//MzAA5Rg+MXwS+MzwheGLwBfFLwZfHL4EfGX4/1+BmZ+Fj4+Pg1eeR4NHiUeaR5SHn4eTOw5qFw7AyMYAV8DIBCSY0BUwDHsAAB/OIGwAAAABCQB/AAB42l1Ru05bQRDdDQ8DgcTYIDnaFLOZkMZ7oQUJxNWNYmQ7heUIaTdykYtxAR9AgUQN2q8ZoKGkSJsGIRdIfEI+IRIza4iiNDs7s3POmTNLypGqd+lrz1PnJJDC3QbNNv1OSLWzAPek6+uNjLSDB1psZvTKdfv+Cwab0ZQ7agDlPW8pDxlNO4FatKf+0fwKhvv8H/M7GLQ00/TUOgnpIQTmm3FLg+8ZzbrLD/qC1eFiMDCkmKbiLj+mUv63NOdqy7C1kdG8gzMR+ck0QFNrbQSa/tQh1fNxFEuQy6axNpiYsv4kE8GFyXRVU7XM+NrBXbKz6GCDKs2BB9jDVnkMHg4PJhTStyTKLA0R9mKrxAgRkxwKOeXcyf6kQPlIEsa8SUo744a1BsaR18CgNk+z/zybTW1vHcL4WRzBd78ZSzr4yIbaGBFiO2IpgAlEQkZV+YYaz70sBuRS+89AlIDl8Y9/nQi07thEPJe1dQ4xVgh6ftvc8suKu1a5zotCd2+qaqjSKc37Xs6+xwOeHgvDQWPBm8/7/kqB+jwsrjRoDgRDejd6/6K16oirvBc+sifTv7FaAAAAAAAAAf//AAJ42q17CXgb5bX2d2ak0WJbmtFqy5YsyVqc2LESrXYWRyQsSRxCICFrgRCWNC4FwlYopUxZmrCFXrhNKaQkpC3Q5aczckLa5nJxKf17KYjlwc3llrZ/0+dpWVp66b2UQmJN/nO+kRyFpKX3ea5tzfLNaPyd853lPcswYE0/sxiTBCYwiVlVJjIba2Fu5mVB9kmmsYwGVc2S0eScZq1qSlazZzRfTnNUNX9Wa81obVXQ2jOa5WCF2Vuz2axmq1ZsFmffWNkmOmjb4ujTbLLugz4tWNVdnmy24gvSdZ/s6NM7oI/NnAWFmP9kHwGnU2PAjjJBrakWVlMF9SieC0xVoelj1PdMALxqw1+kwcsWMM2Z0dxVzYsTxHn6kJiDOGOtTdYVnI+tqvuhT1faFM+YxeEUE8EhpnvdeAaSjeHZzFlM9iSiFo8sWKIJ5gtki/lUHNiLcCHsgQtffNHYZZxv7ILsjokdOybETPPgiy8KO2l0B7HYwlRQbaqkcu76WZjdxHmLcwtntI4qTU2sjjlFn71Pa6lqdpxtpGm2QZxtZ1XrlHUPHklVvRvn3QaKR7c7h4a0oKIJQ1onUiH63DhvzaNoVqSlI6x49rYieUCDPqUiWKWhISTLqyS9MW9MISZ7ZJbLMpn1xAW5GA3IUlRF/vK/D5GrZbD94IcgGYd/+IOtB8B54IDxPqgi8fsom2SW6O4NxleN7caHYIOrwFar33KA0ywwe7NMLSSadXtrLkdC5ciSXKFQtWVBkzMaO6hZssgFTZR1O3A2SFmtRdZb8cRdpRVjNHOcdf2Tww/y1cDpGLjHncDo1NwazLw0qTIGNCQR/wU8UfDUgl+wokDRNTpUUWbaWJ6B5uJTwXlZq2MOK8MFcVZJjhxV3Y1cdzLFg9zWrQ7ci0MkvXlkm98n2RSrMoBPOwTDh+7dcpRtudeq7jp0aNfnnu2tvakKD/Q+i/KJEmxr8ISBNwa4DIBzF5Cd9Z2gktTTh4lwqyBaa9JNXB/72HKmKRnizLQMygNo/VxGbFXSsCSyqbuqz8A5Jm2Kp+wULS7FF2jvjMW5YE9roUEmtrn8wfZIrM+U7/x8CNokXzcEsvwongEHBMFbKmZxzOeGdKmYz0Aq7ga4dWTb+m2p1LrUaBIPRiZG1oMMo+uMHQNb6WRkZNu6rfXLwnsTI1vXbUuO4mkKD0bwXje/V1hKJ3g/PqJ+mdGqsHEbrYGH9bB+psUymjen+askGK05rr2JjNZ+UAtXiVCmW2RkfwdS0IHsz8WyAb/ik3pioPTEU1CKZYsFxRzrw+XevcHCNuxGSS0bZXXDbpG08fHXaEQ1yiQJ/CJujTKM7zY2qK89DuqxEVqHhvxYUY7D7Iy6ZeRaam9oqRdXoKOum3a0Ik637CfF8yp6IDyESwAoO09KjtY2j7eDsx+lGKeXLObTpQigBAWHIZ+iY7/PhQqF/5TLcwE5Vpgzp7DujLPOOmP9mosGVswWGYn0EfyMEO+Ld++8u7jujAMvHzhj/dq3b1n96D1zyO6Qnc/bUQvZJvYppl2S0c6vatNJ60D7JJfzYlUrynonkJTrm3HmRZxjZeTM5WgntE7lSavsn3vquRu5BJ1/CRoceSNemK6UW5zeMOvtz5cXr7qAiLR69sYTyZlZTpeS97BELmthHr/MrFKqkC8W8ulhC22EVHoAXIItlZZsA6IbpKDk90XEoGRzwQCkByzp6eCCQDBiCUZsxZKPVCudYHvACze+/ArcCJ49xg3G84k4nHbmDeqq0mbJaXd7LW25uReVrrvzzutKG4czTufsmZtLq9QblhZau+avWR0VHOF4MWxp7XAoIdERDsXbQGzzdCeK884ZgHjCeN64wcJehs/hw/cYfzJuf8XQa3/YZOvusDx79i1zHN2LRp+46pEt7t5FF8wCweKZlYwJQiw5S5EE4b6brt511ROji6L2zLo2FwyWLG09ne2CrSXkQdq6B2OiPdTR3RFwis7s9Zb2qLRJCNDa2GjD18bNOrnUz0a5Ws6uYZU2xvq0VJUca3dVGzTX62yu6zKqhKyfheu1IEsm6RxcsrNQF8pt1tY2S6CrO9E7ozBnEV+v9hRpvIN5pw/PLy9YvpSWqVvZa4eu8Bw6HvRUYplTuUNoB1ywKK6XjKYRXZ3o8wSLrJRKt6IBCCRKQlpiEIhlS4IoMW/AO2wppRI9cQkiQrBoCQppl+CNAH7HU0p8g1YKduLH+41vGO8YtxsX4+edxDWX3QTffUMuG783tvw1+gy8d+c9Y88YfwblNVi070Dse782tr1/6c+k3WfetXna5439P4iqsDwQTkvfhqWfDX3xjCf/utI1e3145wvtxh/F7InP/wb+X2HxY8ZL11eheOZMdVW2/UuBRQMQev9c48CRB8eXQz/ctsR4xbr5UeNRYXZ0eEHi8/fJtSvDuZWtMakTwmNDF4waezofMH72lctg5fhAXX/G7cxWZlnGlEAuWkIJDeSyuJuHIjoAhXwpYLGSfOeygWCxJNnogyLrhFboiWazkPzdHf/e298zVPin8VWbV10y9DA8A0LL+0+s3TVn++cyd3zu2pWfFzb+zHjTuP43xiNwk7RX2HOzzR1+4wHrTOvs71+2ZeMzb7bNyjzx/unDnSM7VrhzN69LeB83njCe/9N2mp/KEFfYVJZmpzIykWgs41XNlSU/Ec1pgaoWMsWnF7HaQQJwCN0cMmIxLYj4I6dPQwEKIkTQQkPcvTZbUwWd0zyyr8FSqifuEsLQQ043nlJ3jFrZ6I4do8bvwdVq/L5vwaPSss3n37em3zBq/aM7yLfS5SO4FX4KlvHWuSX4L2fp/GtP/aMxWRsiUISekqnWN3DunWwZt6dBjgv82QoDAoisA6EjemN7VWtFiNCV0UIHNSFLcEnJVjpCdE9H0NFXCXXQYYghngybeBJnmR8WcEm6QUQpDVtiIhKjCOqv85d+59Ol0VDI9qOlOVjsMn5ijIvPQQaEZXdeXpZE0fh9+TRRcLxkvDK5X1xMKmqd4rEbkdsqdj7i4u1Ma8toa6taNKOnCohnuqr69Ayi35Umszc36eo81NWzs9ql1cq8S2me85YiWZfK+kYcRwUeRf7PIwV2kAJ7A6vXX8CVN7qWlBrsDubz9gwuOv+CjZeSznYpewP9i5deTMcrPfq0WaS9HtlTRO0NoPZKqL0p0l6QvNlctjgfigHJJtnAK6LZLQYD5lgEzMFhoZAno+vgEhwknbYACXgqLULRg/YaZdmmbn8XlsJlsPTd7dvfNfYa/2zsfTd/+AVDPf32cDB5WU/c73X5+mdBSrvpXJ/b57v9rNSnenpkL7jlvlnQs7xD8QXbfYLXKkutVrsoLhsS7Zcbbz30svE1OOvKa+78gih8AFv3/8dG6zxxyUf+Dx4Jwh+NGy+2hHeCyyqI0B0XrcLkVwQF1tiEeBScNOjtCAg4+jC0njX0idjA2kLcEnF2trS7AorPObQKLrni2cNfjQ1IVuGx2vZRuPr1l8Z6p2990MTmU+t7GlvLLmE7mbY6o/XmtMVVkj+EpAsRbuU0X7Wy0EdLuDCCS9iBMnmpuc7ZOgSL45KGsloCLXe2Ek/QrfFBlMpNuMY2ROtjouv09bRycaXstLZEpvUtGFm56kK+3otXo99lfaejOdZFFx7bBgbJBy9U9oMc60nM+cRG7lq9Ci0PuUwIxqWeuFgwNTYMMaVHiflNWEzaiy4XXa0dr5f4Ya4Ui0viMATRt1qDtK6oyd5UMYhPCkgoHepN1Ug4GuqOeBZ793/FVPGjjEdcCPdR2a3W8+4Ve9wJb1hR7ANL965bsXtr7ZGbf3fa0C/UlUu8qxJzw2GbDWp7z912iv/eG294KuBXb7zpOfg9/O5mcd5QbG4yDBbpFLIMPH7gj57E/9IVuPeJTwmh1i6l09fud+ZPn3PP/i37Z27fePjr524G6Gib0zErPqsjnJTtl1iKj/yHxfK7r+8et1heZoTNECRJy6Qga8UoJs3OZeQ3oxhHZBDTcMPHGhiZoj5PVUtmNY8JelBvyQDaEPTobS5kfacHTWGU9K8dYyfZnUylTaTmC8wBRJUDgPYEIycE7kq+NAy5rB/Znefm0VaIgXr2KbBwhbB8wcJzZLBhWPRVsNvl03K3g/2xO7JnD8Zl4wPr9tlnnTV77pnLjuwXOybfgAMzvL2DY8Ya+On3nmzvT3VceZxMdrEoK1G8iBYH0W+sD83MTB44RaMHFa2Y07wYq8haCGkd5LSGq2R6wrIeQQpjVS1mSmZfVeuT9X7T7Awh1ZEwN/taTNHbgyhqcY9WGNL6FH1mkdBqFC/rvQUzXmx2C4iw/zFuTLkJ8gPA/gHWNDuOHZbrP45PwL6DQGo5YqhT2HdZJUC4yZ3RplWJQxIyZAFnSKGqFWS9CylH3xiXKUbCIEpfiLti6IfDLe8uYf4+p0vrQC6O6z74UEuNj3l8KW9fBbfRO6N39kiokkNsr8fXEUoN0A80HWvlEOhdBVTa4NA8Utq4UpECM+lohkd3TyNuzpyG+t/CuodNLUb3RAA54PH7BAvGLGkB7XE6VfLWsQQPACSy1miEGfHT70NFtRFKTqeE75zx5Veg7wkNMi9c823j33560ffii+X4eV+2hff03nPpijXJea7gDZdc+4OLjLc/uOudr61Z4bHZZIetJ3DzrZY/fvqXLz58wQ3PGUfuft+47tB5ZePXQzfeX3zsRkE7+zN3HfjUObn7nhm66Evfh1lPHgTXRY+9fv39F/tD7fN622VHDqyNuMLErqvY7aziIr4j1Fic0QarWrfpA1dz1idR22Q9h5xeWtWWyvrpeDSnqs2R9ZAZc6xBQVyaQ970ZVasJNt4urLfZfV2D54iL6fTOR49MJ8YGHBR9LESeboYow+Hk3lDyWm5OfOXfyTiIATbE08XSwhITfYNCMg/0e8LBANFFNJSMZVGLnN8QGxG7pfID6LUollFyIBLETw+4DBjgvvvXRJe1LV9+Z7anec/+tft9/zXtz47NLrJE7YIsmi1uk49Qx3f8tyh5TvOP+cib8usyBkLz7latju2eNslRKlPHBdfGOfj5097pl+zCUKFkf0w/9+umvj6xjO/8OjY2jtfnW53eR1lhzegLPvshZWtZ7/+xD//9cvXLh94+LrpC1Y/sKXvbK/XSK648M7rYZJR7Lxb2GDbYN2NEYWb9TJu93Jk8FxmYgXMbIasO5DjbY1EikcORItyKmqp73e/B2vee894XLi7fmD5rvH4e/VjvufrjnbbdjOGLglWYFoLZSE0f0ZTcL2TCIUoMu9sQatiG9L8SoVJXtIBXFy5O9pjCn4QpduLUYMnlwXm9SQTIg6gWJMrS4mkBZK68gbfJ8725fO+y75Wg8vhwlbZ+KNx122nlbfJ9iu3DC6e68vPemWt9nnrRZetNA4tfurpRcYh+Hf4MYiw3t5qrAg/8AlNA/cyWAwZr/2BLZQwrOffFOZjHgY0aZROT1UP1NNKUwYOBSIWHwCrA9RDuyxs16FN+icn2Sf1TYJKWUgKvCmrY9DQJr2dvA8DeI2pUi/a6zhGcpojgwYYtJ6M1nWQOBTI6glijUw5ozbyJjnFx90uuvJiSUHa0ySTCoHUHkJmiM1e+7+h0G0XnHfT5evXXP/FO5bO7VcU+Lax6qgyY+biJZ+y7KnddcOCU66Kdgd8gxBak+iYMfAgvAAd8JO71p43r9xznA/pYX1sDruF+xD0FpGMlq5qHRktntMy6BUoPapZZFRe0OZyxpjQNYoCYyrwtKkEJKUiczz0nEeZpihSFB/SpiljkXA/jyo7KS/D9I40LntnNNlLYxlFT0w7mSPB8D7HkzUxVEV0dBhPxRJ1iUyaTgYDkFQfoGoe503UkYKVFUaMd2VjwlhjTMjGu8Azb4eMZ4TukYJaGOGb4xzKKA2KbMHwhDEB/RPDC7qNZw7Rlxp3jxTQrAEup41JBkpKEGOTbuReGvk3gLE5aBnOHj9KvUzJay3C4V4vbqfcykzkS4cfqQ+0d0WJ+oSyV7IShguSPxiLJ6f3E+SjOCVfgmI2CMQPG5AYQGo+pL2gJMVgUhGDJTxOWxVryQHBArCw8K9KryL8azhcW6D4PN7agvBt3/xmQbAav33jDYg89tbbby8QrG8Yv4XIG7Uj8OVvigF4tbsdXm1pMWa0dxszogGjv6UFJgI7L7/ceNx4HPJPw+CDT0Ou9vTOnTtrcVjz0NNC19MPwpra05f/EhlBeTkmUV7Oz5qScd4MZfRNEk5IvyFUtJjRIeXbRneIqCL8FLeUT9uBz1UFJqkS5el7eOyHUanEobaAT2/N6G2kLw7GTQnPkwUR2ooIYYEUDh9SU1W1LI4fRXVESUckibpp5v8lmq8F0WA7owoFZelQ7J0H8em6i0/agXAFjqXzSaVrlEkbHRkZFfHUwFNLgc5GpnJ/NsrTdLMkO49rkZ9n7snPpbiFVTAoNRWmp6r1mLKBOpJGWYgqKAttFl8YF13v6FE8+1r91q5EksP+MArKPoryYslGweG4UM7jiwjZYQF9WNwFFNdSWvCKp8AKEbA+dcUVTxlHjN8aR55S1j/087d//tB6cwffVGH6OlH/yE14JDiO3YU7Yyf8wlhvHFyPfoTnyHFVGLKdRfiqoFlQzBqPJ6O1HKQ0vPcjy87yxWzAJ8UFdmgXoGWsMV4MwVXiZvIoE3eYZZBjfGxBrepnn25UQPooy1Xp66ZwqS+NkRXCd6GqWx1ZXg6woRebwbWutaq1yrqAnDX9GRmlRLUyjQItNi2M30QllDjjNYeZjkV1HKhPOFbI+flHgYbRQZePIZHfki+ioeEiHEcj3BMnKUJjjyQcYWgwuGGY5MYkFVJDqVQ+hYAPDQuKIKVgGV0X+F3r8qlUyGB4T6gpb1ynuci+0qC5kNHyOUrunUhr6aS0nkDWYB28drx7K4FXLT/g0nLjer/woTZjnFX6Z+QIpI7hPj8FUSUrCltXKt07bToXvoIb9Ssz9LHcycXmCOitwqLPJiL8HICS9+8zCVATxUBMFFRpRijUZbvsib/NLyEaFAQQrE5kW5cN7wedtR7Ht4YFzrAcRkJz2Hy2kO1vcLIroydm5nK8MDALuRjNVHrzc3M4EkPRKMyjmmR/Rh8s48gMjHtOwfMTmX5qE9MxTtCFKF7rruqWOO1lct96bz8ep6v69AHay9zO5wfxOFfVi7NpL+tzcUwq4/H8qm5fQPupBTvtY+XQi6Mifhr7v3X8tzivnuTn5Gwn4wmm1TyhiNo8TjDfrKkSjhDRAjJeHcJAV8mBn+w9r8YabBwVvszLV8a4StYdx0Q8KgNaU9UYN5qeRalvLwtT1g89SpDWkFtSs+Jp+taQaT+plhIiX2q1uGTynw5Fa0HJDVL5x0XpsDFgLY56LWtYyEYwTrIB96UDcKy0Caxu8q6A/1QN5avfv/bnDyWPVTYtI3WreO33v2ooKvznFesfEsRjZU3GTF0+NvcYu7Qx+wjP0tdpiJ9IQ0+dhn1EQyR6Eioiyhjzt3Tw/LxHcxBZFQj5eGb+71ElUp3871O2VVA/jjjDXOjj6ZvGxproS3Jb1ZOtRLiVjvQ6+irdETrsjqHZrdM+vYn2XqQ9SuqixbOVdC/dmk7it3rTdNhLCbT0FIf6SLuQQ5plSEsrlWCXTGFDyKNbXUP/m8yi1Jif0mQfxzQe56AS/AOsm8pjmXV+Bv12Jk2wNl7T6SMpwSjJU6VgIF33dbxhwqzehg82AexYvXobRllpUcT2CEeM05S9Toun2yzipgk+2Fz+rhj1J1CuJhwlwhUg1BB0AIGGtIh+P1tEzEghra1R1vc0AM/hS6AF+qHlYjhiSJcYf0EE/ZeL/wBXnfmT155dCtca9zz8m8t+MmKpo+ldHBZZGBzedPXVlxpWw7rpqqs3wWHjnmUrVpwJ18DVj5yzrPaOefMhoQGbmHWKF9RN0om8yLEyIyFBDjhMDuQzeoGAXvd0xVORu5QhvtxlJ7O5g6FwMjWDyomaxVORPN6hBp25bNDGCYOgG41RGnjqGlLeEqVLSpAuERt64l6g0mGPSe+OH33z3k1XIlnG3e9uS66zsnWTMw7t6i8a/a4QXSDC/7wNrucM2fGjC2DChZdNqi+4d+CcZfS91+l7tRW7DrmM/mJt/70DRP+ftxrbiCewESaK/bsOMbO2Iagch7agxRQIvTvA5qBWg7LBrWIZbSLfGOMiO/6c31Ov7fAcCz7D64Cph6hieXIcN2JZnRznm8lxBLHHnfN7GrlRwnQtaLFmsNsYZWcIxQWz2YqbK7PbhWqp+DvIUfKitu5Mcp/JdXoAIT/hPs0t6zLKKEaP3kY3jxaUMf6lwFDPoNzKiCYqQryHMthBH+UOMeTT2hXUUab3U7OK4KA1hEKyDh6tfkK0zb9mVMhMx8jdIgHJkQIQsGCTrO7VyIPRACENwlpHWYjcHI/i1BoTxmvl5g+OW9x5wm20NmjnIhjTfBlxLnozEf8g1kKjv9wPr8Pr++GXtX379lpuNp6svQVLjb1CEBYLwdrb3H+ZcQv1AbhYL8aD7owmHdRcVc0l6y1mRgvZpLdQBt9iB+QFxRsCLptXcQAP8KkHRCB/S9YDf4+iBbHwDid8OI6qZtXf4Fu0KeRheQwm4YxdiM0ZFCBYAn8Sn0geIAlo0ITy+LhQPsygauQkCmdyUBVYDpBbhpqrCpcaVajmcgYO5Wq87sFlY1wax39u57lzBorDUoIS6RR9VAzcxidJMMnCzdggrNhgnElb/Oa4qBrlST57XCB+rdZG23rMiE/Gp0Y5ShNRjhzcN2AE5iR9FymwkzjwJJ44iACTLdTiJSCYqPEQr6YSikY5rucytiIjfCxBnV22jO4KI6ZDAGfn4aM/owV4Ggr/kW73owibyNmNq2KuD6XDESamzPxXPW4RFd6mEMsL6VQCTxB6hhDZ5J3A+kE1Y5d34UmY9y/GYzdf9xnjxcf+G16GO2DkjS8Yj33yAFrPHxt3QIDfJ47A2n8xfmQs+vO3If+Zz9wsXARrv/CWsde41hh47ydwA8yHtgObOT1+pOcPtgHkO6U9zEhV5n1g7UhELEMZe5xlMVWCYQgEIYCK0YhYRdoTakTMuOyqNcIHQw89NFv465qrHvvwD8Kd3FzX/9QXtlt+ft7Checd6dv+AuzjYyYOhHq2g/O2nhsLoIUosBFG/rwXcTH5LdCKGS1zkDBuCeU6l0Es5unqtXFv1NuFy9g+pNnIZDvb/MHuWN/MPG9AI1c9c5YXtZiXBYKBbKmYT1O9wGJDQoKUm02UUB3ilNGm/Ffc1nBQKnxpxmnO2Eu3PXhNanMqmVzz1i3PGM+MGM/DA8m1b97yDAyPQMG40rxn55bUaOrHfJ0srDT9pj1XpVKp0eTaiye+W3vB3AMfvzqZguvrHXm8H4z3fKWpspKiYgEVyj3ViofXlT1+BCitVEZqFJDMxrQu3otGxvCYCbTzoJ/XkdzIkIo1lCI/5lP01m5qzkPv1ZGkEbuit0Qpld3qIWMI3BiS0QtEG8upmEubq4eivLNMIQlBQE2tdVfuvhKtmIo7OjM+JCgilslh3H7gwO2CuvzKK5fXw89njbl0JjC6UlN/QJjFxOAq3CcRznPhig8wLWBa+mBTzdpn4jI07rpPJpIsraYlqwMsn4QGLdVIIYNaR1Nrlxubjc3LH6s3AU6hp7dfXW6Mwo7laJveP0AXTR+5gXyk9Tdk2sjoBKFH2KD+BsYpFLFE1XGBbaAeOHKFdpqv2UcYaepKtdaVfyplRP1gxxoE7ewDZn6g3kV6bEs5KBH/v0Xl2lh/JiWLLBnd2ojV0FhbyAzSF6bsP02Y5tLbyJHYzCyT3WxipFQqPYGsnWPqQUmqkuHDJhm1JFLSapKCOMKMK4SynVn/Hz7Ry1HjLYzSLShc+PQubuG6MVCVSUZjWa0TPbLZDic1J/aPpSRN+YybgDLZSEa2Kp4WSkDFyUt3RbppPXUxiFfsbn87T9wqYw6Xz2xM8+JqEFAu5ochGwGfC+Kphno66tdWwLVXGn+B+9XxVfc/cf8q2kzf8vCWLQ/DnsYVsSzsGja60ZWxzfVbVq2CIbppi6FOXWuKPWy8G+oTZN+pz9HN89UdGZ4W7Gqkpu1ZElI/UthKVp66PnSZSriCDbGHFcnVRYnoc7fgoZXhYIcXjyx1lQPqujupOSU3JPLGUeo7bjalwtQ4zvhkltRhYq1677GJ/hvZige4pLTyXq5QThuikgBl2uM5bV6VcsjljDY9p51S1VK8cyfDe5ZdOSSb+mSLpoY2JymQ+DFB6UokgtQQU4lScgKPZMoL6XMpAzGnOuZwDy+gG+bIpBz1JIQ+ZxBZkc0NmRnoWB2LcQnt8ccKPQ3PKHxk72lCZd7mTu3jEJqoEpBRUxxuNf2ta8Jq66COboDnJ4h/R1DlEcFNPspvh9Rxu1/w3WRTgsKsRSEuohxyJ8swst6oKN5sReQGXHRQ97mI2JbLDVo2MtbVeoOQhzJ+ZqU1SO6JmiFyRCSSpu4YtdkO3P7F8zMHrtp1KBisVw8EdBzhntsPbLjkxkO7hheYjd1kS9GL2Cy8P5c6i9Op/Hwzpe9zgwvSCP4pY/1TWLLkrZGJJRDB/ZJXRowh2A1sN/X8QpSuToy8tWSJ8duRV0feWiwsMobEl4+y3TyoBMpIWymcspHts3E6RdPc1Et7DTvTyMWKZg62kXnltg5etb5j/T9oCkNTvauOjInGqC1Vs3JkHqMwI81No/Gt1fCO4V0Nq6nbe/Uqw2t4V8FqtNteeFVS+bNQ6EsQw2+lcfCd1ca3yLbB6tXiOL+XvsZz/WWJ5k8RIUUx1O8M42jna+MWRKdlfsTvI39Qpvs4YqYvChgTlY2yiPi2hpHRuFGeqj+LOEn0iwqr4Akus5hBBSc2YJQomo3fgNYdp/k37kMrQMbdbBFvYHuryl+F8PA6KsWoCDTtZtWAp1s4Sj2CcxSYWQ4kYZTpxKpK7Lj3J06Wufw+cb8iR2fmeBd8RYnNIsW1ZCq+RJ7GrNWKP1mgMXum0t47SGOOaqVj2hCNtWYqXf08u9lWrYRnUHYTyHiwgxht8PcvxGpFcrr4EY/YKr72LjrzViuBUIQf8TpFJWGajJ5qJUUZzSxVLWbieH5wbpYnNSvF2cN4pJ9Sf0fjWCLyo4nJf+RcYOrf/xHU41/qqLH/2TkXCYHXf3ithmzwfF6rQc3v5Oi6/h5IV1OJU2nk1amtsCPDXUkHZZp8QydUt+IpanVpuA2B7RgVzDIX1SPNN1W4ryDnTuPU2bQDRkU22VxLMucnoS6n2K0ca8erhECd1YozRabLaUfsacIRXq6ttHlpuM1NtizN+83dWXopoS1LbU5OM/Bsr2rtMtUiExlKvulRJ/WbWSXBrEBqFnSHzMkVXQM61dro/QUzI41xJAJR9AExf0/heJITU2Uy87UKjPeIVLWZ+HrpzMJ4oHiU8XcvuGpMsWFXIy3EcxKM5/apztTBFvG3dDw5CtL8KM0hXqsz62lSC9U/KlaJGGAFR19FstIhRsJ9BHw8LbzjvtOU0JiP2RBppRgtG1EQq+/JyRi/+tVR9ivjV3yN+MaivmE8MsP4b2ibARfAJtOPk08y9xzvYdxp+phuXK2VrJKiTpdIRuvINbxN5KPeBlcodhAXgq9CIoa+tiVFWCSSQuAVjSUoEhCVSidPlPxdV0TZgriV7zASHZWkj3glesfFUEdhFDi+RUCF1j4abfZRPDtJG5OeYz4zTv3CUU5IBNUjW4lEeWaXExJBQrSobJJIfQxm+0IkisQEGZ+/DoGPnT2VWbk/PXHmfLoE/QzTs3501qakUU2ynm9xoEW+jnsuK0f+qBz87bNKaxvNu1Um1nunXt1pLpjJHBNXZDfdKLc6+ii84bWwiuD0ULaK92VQjtlCg3ZzsBVwUDEVxEaLUFIc5OsofUzTUimSwBUQUsY6PKj9QjCxD3Dxf11I0vGjtV807JKZh7MwJ2tDSapTYuco12n6Y1fT9OtvQLWYhFjMd49a7PzdI01StFacLT8VhzSnYjaV0MskSVNccmnySICeTeSMFtjzz3MtwBFV4Gmb5+v4xdRFBa3l6Yzwtp/arUkLpVyTtcTYQ+IWx1sdc0r0VlQ7z2M7TfTtbEfRCHQMHTOaSk9cogYOP9qQIiHHVL5E2TzqDaCEXKE8abZxiOhjJl8smEbzCFkSlaxF6b4S721iu20bbBswTi3S+qOdzFYJD7urvFIqHtRmVrWZsp6n1lteFdVnilRSt9pbp80g25dXxuREG29DCXn2Kf72ru4enr3IokLuC7NYopfehdKKyhhY27vo0O3ZJznbZG/QjIVKKOCldMlaLImlIGK7UlAMBJNBavO3BW1Jyea1pal3w5b2ptLWhn/Y/abd/uZsmJWZ67/ruYXywufuDgzmYNZsPmy81D8/gMMO+8Ln7vIP5oyXhBRHa8IfGoNzMye7mR5ivDS7/mwcF5x1kCce9+4jX03z7cfQlNeDRvQQNN9+pJULYmC4j95+VHycKyE3cU+yMY//hDcgvT6Wy5ZA8kKRNyWe8CZkFvontn6udtqimnBgkTExse2EdyKzE8bEIuHA5yFXO+3GbRPQf8K8L2ekxxgluXmUhDTYGr0hddzaxT1EK++6FrIVp417TXIJTpkch82MDTsoUOQ02tDv6S4vtaIputtD4aCfe0Lz3VNqX/VTYUiu4+dEfU92yIKqMkkYse7b9/GdRDVSinMs7PDzTVEia+6jICzYxRp5ATOBZDE5fywvwN9LoDCAmcEQQcsjZn6ETeUaIsfnJxqPqzYlKkh/zKxCvc6KWs3nIPF+N1v9S3UsS9/wmllXJMH8vyawbfqucOy7IlmAqe8CfwvTfKvVfI2yxp9Qf8+SNb9nyRrvWYrAX3qyN7DZKfX3nP730Bk0obNjTUiTvPeYGFOHKYTA6MJhE55Z2eGpmpXI/T3N0cRnN7FKF83xf4jQbE0I7W/AswSK5F7BKlm6udadFJl5G8gsVv89OTJrvO+qmlQePY5y4aPQrIbrbHBPYDZlHW5GZ1Rzonhp/KTxUo5qT+P0O1k2YzA8tfO3N3GeNMovmzjDUua1K4HXrvi4nU2W8SpYyvW6lkDxo2LBQfp8oLL/D/oHFeoAeNpjYGRgYGBi8vVdNXdGPL/NVwZ5DgYQOPt29zlkmoOBA0IxgSgAVvoK5QB42mNgZGDgYPh/A0QyMPz/DySBIiiAFQBj/AP1eNpNTrENgDAMc0IHdsQ//MADnGKJRzrDQxzCxEScFolUtWIncYIHGX4AdgMjHAYQdDiNtkO8BZ2qmPAMXpNd8aPHEjX9f+mdM72D6T7L3+gbpBCrKuoapE6poQR6c2S/SFlte9qm71pdV5YXStwa2gAAAAAAAAAAAAgAbAC4ATIBeAGGAbwB1AJIApgC9APCBJQE5AVCBZYGhgdmB9AIZAkgCeYKHAp4CqgK8guODBQMQAxsDJYNCg06DbQOUA8WDzwPmhAKEKwRMhGwEdIR9BJ+EpwS1hMCEy4TWBPAFAYUgBT+FUIVVhWCFZwVxhZIFqoXYhekF9YX+BgeGDYYShhgGHQYihioGWwZvBo+GpQa/BtUG7gcBBxUHOodRh2uHdId8B4OHiweOh6MHwwfIh8wHz4fTAAAAAEAAABiAGkAEAAAAAAAAgABAAIAFgAAAQAAuAAAAAB42o1Ru04CQRQ9s6AJMbEwxMJqEym0YFnUNbpWFGiCSohG6UzALIuRfQgr4C/4ZfoDln6EpZVnZodIWAoymZlzzz33NQNgA+/IQeQLAL65UyxQpJViA5v40TgHV8w0eZSEq/EapuJB43XyXxoXsCN+Nd5CyShq/IFt40TjT9hGExdo4QomxvAwxAhPiBDSPuCOyJjo0H7jPSBKlCqrnhAl6BP1FJMQeZjikWdMa6bboybhiuGiwjVRy4JP7ytvWdEnP2CEjA1Zw+OukI3Jlpm/gxcqZZ6AzC7OdcV6pt4+p5M5ZK8yX6Ty3dD2WU3OM+ScFmyuU5zhDpdoo0m0LK68ELlMYy5o7jOv+l+thVsy0ppn+1QmOt+Y/qryWXBwTG/ArM/MKTU9svKdujre4l3FIU9npf4b5D3VVY3egPxIvXa40mRtWt253077vNZzNqhL5z1SMzr8b5u9udTZirdlr3+3BnfZAAB42m3Rx1JVQRSF4fNfA+Ys5ixGxNO7d3PBhAmMmCPGcubEma/pKxm4P4zsqlNrdL5aq3Y36Jbf719ddP973/5+dAMGrGEt61jPGBvYyCY2s4WtbGM7O9jJLnazh72Ms4/9HOAghzjMEY5yjOOc4CSnOM0EZzjLOc5zgYtMcokpLtNTCCpJY5ohM8xyhatc4zo3mOMmt7jNHe4yzwL3uM8DHvKIxyzyhKc84zkveMkrXvOGt7zjPUt84COf+MwXvo79/PF9vu/7f7lQVrOYYVYzzWZOm0NzxpxdztALvdALvdALvdALvdCLFa/oFb2iV/SKXtErI6/ao9qj2qPao9qj2qP2K/8NzVGP1Emd1Emd1Emd1EmdXHVGe9I96Z50T7on3ZPuSfdk0St6RS90Qid0Qid0Qid0Qid0qr2qXtWrelWv6lW9qlf1ql7qpV7qpV7qpV7qpV7qpV7Ta3pNr+m1kde8V/NezXu1vv4BRRflZLgB/4WwAY0AS7AIUFixAQGOWbFGBitYIbAQWUuwFFJYIbCAWR2wBitcWFmwFCsAAAABUcgLTgAA) format('woff'),
+            url('genericons-regular-webfont.ttf') format('truetype'),
+            url('genericons-regular-webfont.svg#genericonsregular') format('svg');
+       font-weight: normal;
+       font-style: normal;
+}
+
+
+/**
+ * All Genericons.
+ */
+[class*="genericon"] {
+       display: inline-block;
+       width: 16px;
+       height: 16px;
+       -webkit-font-smoothing: antialiased;
+       font-size: 16px;
+       line-height: 1;
+       font-family: 'Genericons';
+       text-decoration: inherit;
+       font-weight: normal;
+       font-style: normal;
+       vertical-align: top;
+}
+
+/* IE7 */
+[class*="genericon"] {
+       *overflow: auto;
+       *zoom: 1;
+       *display: inline;
+}
+
+/**
+ * Individual icons.
+ */
+
+/* Post formats */
+.genericon-standard:before {       content: '\f100'; }
+.genericon-aside:before {          content: '\f101'; }
+.genericon-image:before {          content: '\f102'; }
+.genericon-gallery:before {        content: '\f103'; }
+.genericon-video:before {          content: '\f104'; }
+.genericon-status:before {         content: '\f105'; }
+.genericon-quote:before {          content: '\f106'; }
+.genericon-link:before {           content: '\f107'; }
+.genericon-chat:before {           content: '\f108'; }
+.genericon-audio:before {          content: '\f109'; }
+
+/* Social icons */
+.genericon-github:before {         content: '\f200'; }
+.genericon-dribbble:before {       content: '\f201'; }
+.genericon-twitter:before {        content: '\f202'; }
+.genericon-facebook:before {       content: '\f203'; }
+.genericon-facebook-alt:before {   content: '\f204'; }
+.genericon-wordpress:before {      content: '\f205'; }
+.genericon-googleplus:before {     content: '\f206'; }
+.genericon-linkedin:before {       content: '\f207'; }
+.genericon-linkedin-alt:before {   content: '\f208'; }
+.genericon-pinterest:before {      content: '\f209'; }
+.genericon-pinterest-alt:before {  content: '\f210'; }
+.genericon-flickr:before {         content: '\f211'; }
+.genericon-vimeo:before {          content: '\f212'; }
+.genericon-youtube:before {        content: '\f213'; }
+.genericon-tumblr:before {         content: '\f214'; }
+.genericon-instagram:before {      content: '\f215'; }
+.genericon-codepen:before {        content: '\f216'; }
+
+/* Meta icons */
+.genericon-comment:before {        content: '\f300'; }
+.genericon-category:before {       content: '\f301'; }
+.genericon-tag:before {            content: '\f302'; }
+.genericon-time:before {           content: '\f303'; }
+.genericon-user:before {           content: '\f304'; }
+.genericon-day:before {            content: '\f305'; }
+.genericon-week:before {           content: '\f306'; }
+.genericon-month:before {          content: '\f307'; }
+.genericon-pinned:before {         content: '\f308'; }
+
+/* Other icons */
+.genericon-search:before {         content: '\f400'; }
+.genericon-unzoom:before {         content: '\f401'; }
+.genericon-zoom:before {           content: '\f402'; }
+.genericon-show:before {           content: '\f403'; }
+.genericon-hide:before {           content: '\f404'; }
+.genericon-close:before {          content: '\f405'; }
+.genericon-close-alt:before {      content: '\f406'; }
+.genericon-trash:before {          content: '\f407'; }
+.genericon-star:before {           content: '\f408'; }
+.genericon-home:before {           content: '\f409'; }
+.genericon-mail:before {           content: '\f410'; }
+.genericon-edit:before {           content: '\f411'; }
+.genericon-reply:before {          content: '\f412'; }
+.genericon-feed:before {           content: '\f413'; }
+.genericon-warning:before {        content: '\f414'; }
+.genericon-share:before {          content: '\f415'; }
+.genericon-attachment:before {     content: '\f416'; }
+.genericon-location:before {       content: '\f417'; }
+.genericon-checkmark:before {      content: '\f418'; }
+.genericon-menu:before {           content: '\f419'; }
+.genericon-top:before {            content: '\f420'; }
+.genericon-minimize:before {       content: '\f421'; }
+.genericon-maximize:before {       content: '\f422'; }
+.genericon-404:before {            content: '\f423'; }
+.genericon-spam:before {           content: '\f424'; }
+.genericon-summary:before {        content: '\f425'; }
+.genericon-cloud:before {          content: '\f426'; }
+.genericon-key:before {            content: '\f427'; }
+.genericon-dot:before {            content: '\f428'; }
+.genericon-next:before {           content: '\f429'; }
+.genericon-previous:before {       content: '\f430'; }
+.genericon-expand:before {         content: '\f431'; }
+.genericon-collapse:before {       content: '\f432'; }
+.genericon-dropdown:before {       content: '\f433'; }
+.genericon-dropdown-left:before {  content: '\f434'; }
+.genericon-top:before {            content: '\f435'; }
+.genericon-draggable:before {      content: '\f436'; }
+.genericon-phone:before {          content: '\f437'; }
+.genericon-send-to-phone:before {  content: '\f438'; }
+.genericon-plugin:before {         content: '\f439'; }
+.genericon-cloud-download:before { content: '\f440'; }
+.genericon-cloud-upload:before {   content: '\f441'; }
+.genericon-external:before {       content: '\f442'; }
+.genericon-document:before {       content: '\f443'; }
+.genericon-book:before {           content: '\f444'; }
+.genericon-cog:before {            content: '\f445'; }
+.genericon-unapprove:before {      content: '\f446'; }
+.genericon-cart:before {           content: '\f447'; }
+.genericon-pause:before {          content: '\f448'; }
+.genericon-stop:before {           content: '\f449'; }
+.genericon-skip-back:before {      content: '\f450'; }
+.genericon-skip-ahead:before {     content: '\f451'; }
+.genericon-play:before {           content: '\f452'; }
+.genericon-tablet:before {         content: '\f453'; }
+.genericon-send-to-tablet:before { content: '\f454'; }
+
+/* Generic shapes */
+.genericon-uparrow:before {        content: '\f500'; }
+.genericon-rightarrow:before {     content: '\f501'; }
+.genericon-downarrow:before {      content: '\f502'; }
+.genericon-leftarrow:before {      content: '\f503'; }
diff --git a/wp-content/themes/twentythirteen/footer.php b/wp-content/themes/twentythirteen/footer.php
new file mode 100644 (file)
index 0000000..99b6bbb
--- /dev/null
@@ -0,0 +1,27 @@
+<?php
+/**
+ * The template for displaying the footer.
+ *
+ * Contains footer content and the closing of the
+ * #main and #page div elements.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+?>
+
+               </div><!-- #main -->
+               <footer id="colophon" class="site-footer" role="contentinfo">
+                       <?php get_sidebar( 'main' ); ?>
+
+                       <div class="site-info">
+                               <?php do_action( 'twentythirteen_credits' ); ?>
+                               <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentythirteen' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentythirteen' ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentythirteen' ), 'WordPress' ); ?></a>
+                       </div><!-- .site-info -->
+               </footer><!-- #colophon -->
+       </div><!-- #page -->
+
+       <?php wp_footer(); ?>
+</body>
+</html>
\ No newline at end of file
diff --git a/wp-content/themes/twentythirteen/functions.php b/wp-content/themes/twentythirteen/functions.php
new file mode 100644 (file)
index 0000000..b4234bf
--- /dev/null
@@ -0,0 +1,526 @@
+<?php
+/**
+ * Twenty Thirteen functions and definitions.
+ *
+ * Sets up the theme and provides some helper functions, which are used in the
+ * theme as custom template tags. Others are attached to action and filter
+ * hooks in WordPress to change core functionality.
+ *
+ * When using a child theme (see http://codex.wordpress.org/Theme_Development
+ * and http://codex.wordpress.org/Child_Themes), you can override certain
+ * functions (those wrapped in a function_exists() call) by defining them first
+ * in your child theme's functions.php file. The child theme's functions.php
+ * file is included before the parent theme's file, so the child theme
+ * functions would be used.
+ *
+ * Functions that are not pluggable (not wrapped in function_exists()) are
+ * instead attached to a filter or action hook.
+ *
+ * For more information on hooks, actions, and filters,
+ * see http://codex.wordpress.org/Plugin_API
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+
+/**
+ * Sets up the content width value based on the theme's design.
+ * @see twentythirteen_content_width() for template-specific adjustments.
+ */
+if ( ! isset( $content_width ) )
+       $content_width = 604;
+
+/**
+ * Adds support for a custom header image.
+ */
+require get_template_directory() . '/inc/custom-header.php';
+
+/**
+ * Twenty Thirteen only works in WordPress 3.6 or later.
+ */
+if ( version_compare( $GLOBALS['wp_version'], '3.6-alpha', '<' ) )
+       require get_template_directory() . '/inc/back-compat.php';
+
+/**
+ * Sets up theme defaults and registers the various WordPress features that
+ * Twenty Thirteen supports.
+ *
+ * @uses load_theme_textdomain() For translation/localization support.
+ * @uses add_editor_style() To add Visual Editor stylesheets.
+ * @uses add_theme_support() To add support for automatic feed links, post
+ * formats, and post thumbnails.
+ * @uses register_nav_menu() To add support for a navigation menu.
+ * @uses set_post_thumbnail_size() To set a custom post thumbnail size.
+ *
+ * @since Twenty Thirteen 1.0
+ *
+ * @return void
+ */
+function twentythirteen_setup() {
+       /*
+        * Makes Twenty Thirteen available for translation.
+        *
+        * Translations can be added to the /languages/ directory.
+        * If you're building a theme based on Twenty Thirteen, use a find and
+        * replace to change 'twentythirteen' to the name of your theme in all
+        * template files.
+        */
+       load_theme_textdomain( 'twentythirteen', get_template_directory() . '/languages' );
+
+       /*
+        * This theme styles the visual editor to resemble the theme style,
+        * specifically font, colors, icons, and column width.
+        */
+       add_editor_style( array( 'css/editor-style.css', 'fonts/genericons.css', twentythirteen_fonts_url() ) );
+
+       // Adds RSS feed links to <head> for posts and comments.
+       add_theme_support( 'automatic-feed-links' );
+
+       // Switches default core markup for search form, comment form, and comments
+       // to output valid HTML5.
+       add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list' ) );
+
+       /*
+        * This theme supports all available post formats by default.
+        * See http://codex.wordpress.org/Post_Formats
+        */
+       add_theme_support( 'post-formats', array(
+               'aside', 'audio', 'chat', 'gallery', 'image', 'link', 'quote', 'status', 'video'
+       ) );
+
+       // This theme uses wp_nav_menu() in one location.
+       register_nav_menu( 'primary', __( 'Navigation Menu', 'twentythirteen' ) );
+
+       /*
+        * This theme uses a custom image size for featured images, displayed on
+        * "standard" posts and pages.
+        */
+       add_theme_support( 'post-thumbnails' );
+       set_post_thumbnail_size( 604, 270, true );
+
+       // This theme uses its own gallery styles.
+       add_filter( 'use_default_gallery_style', '__return_false' );
+}
+add_action( 'after_setup_theme', 'twentythirteen_setup' );
+
+/**
+ * Returns the Google font stylesheet URL, if available.
+ *
+ * The use of Source Sans Pro and Bitter by default is localized. For languages
+ * that use characters not supported by the font, the font can be disabled.
+ *
+ * @since Twenty Thirteen 1.0
+ *
+ * @return string Font stylesheet or empty string if disabled.
+ */
+function twentythirteen_fonts_url() {
+       $fonts_url = '';
+
+       /* Translators: If there are characters in your language that are not
+        * supported by Source Sans Pro, translate this to 'off'. Do not translate
+        * into your own language.
+        */
+       $source_sans_pro = _x( 'on', 'Source Sans Pro font: on or off', 'twentythirteen' );
+
+       /* Translators: If there are characters in your language that are not
+        * supported by Bitter, translate this to 'off'. Do not translate into your
+        * own language.
+        */
+       $bitter = _x( 'on', 'Bitter font: on or off', 'twentythirteen' );
+
+       if ( 'off' !== $source_sans_pro || 'off' !== $bitter ) {
+               $font_families = array();
+
+               if ( 'off' !== $source_sans_pro )
+                       $font_families[] = 'Source Sans Pro:300,400,700,300italic,400italic,700italic';
+
+               if ( 'off' !== $bitter )
+                       $font_families[] = 'Bitter:400,700';
+
+               $query_args = array(
+                       'family' => urlencode( implode( '|', $font_families ) ),
+                       'subset' => urlencode( 'latin,latin-ext' ),
+               );
+               $fonts_url = add_query_arg( $query_args, "//fonts.googleapis.com/css" );
+       }
+
+       return $fonts_url;
+}
+
+/**
+ * Enqueues scripts and styles for front end.
+ *
+ * @since Twenty Thirteen 1.0
+ *
+ * @return void
+ */
+function twentythirteen_scripts_styles() {
+       // Adds JavaScript to pages with the comment form to support sites with
+       // threaded comments (when in use).
+       if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
+               wp_enqueue_script( 'comment-reply' );
+
+       // Adds Masonry to handle vertical alignment of footer widgets.
+       if ( is_active_sidebar( 'sidebar-1' ) )
+               wp_enqueue_script( 'jquery-masonry' );
+
+       // Loads JavaScript file with functionality specific to Twenty Thirteen.
+       wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '2013-07-18', true );
+
+       // Add Open Sans and Bitter fonts, used in the main stylesheet.
+       wp_enqueue_style( 'twentythirteen-fonts', twentythirteen_fonts_url(), array(), null );
+
+       // Add Genericons font, used in the main stylesheet.
+       wp_enqueue_style( 'genericons', get_template_directory_uri() . '/fonts/genericons.css', array(), '2.09' );
+
+       // Loads our main stylesheet.
+       wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri(), array(), '2013-07-18' );
+
+       // Loads the Internet Explorer specific stylesheet.
+       wp_enqueue_style( 'twentythirteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentythirteen-style' ), '2013-07-18' );
+       wp_style_add_data( 'twentythirteen-ie', 'conditional', 'lt IE 9' );
+}
+add_action( 'wp_enqueue_scripts', 'twentythirteen_scripts_styles' );
+
+/**
+ * Creates a nicely formatted and more specific title element text for output
+ * in head of document, based on current view.
+ *
+ * @since Twenty Thirteen 1.0
+ *
+ * @param string $title Default title text for current view.
+ * @param string $sep Optional separator.
+ * @return string The filtered title.
+ */
+function twentythirteen_wp_title( $title, $sep ) {
+       global $paged, $page;
+
+       if ( is_feed() )
+               return $title;
+
+       // Add the site name.
+       $title .= get_bloginfo( 'name' );
+
+       // Add the site description for the home/front page.
+       $site_description = get_bloginfo( 'description', 'display' );
+       if ( $site_description && ( is_home() || is_front_page() ) )
+               $title = "$title $sep $site_description";
+
+       // Add a page number if necessary.
+       if ( $paged >= 2 || $page >= 2 )
+               $title = "$title $sep " . sprintf( __( 'Page %s', 'twentythirteen' ), max( $paged, $page ) );
+
+       return $title;
+}
+add_filter( 'wp_title', 'twentythirteen_wp_title', 10, 2 );
+
+/**
+ * Registers two widget areas.
+ *
+ * @since Twenty Thirteen 1.0
+ *
+ * @return void
+ */
+function twentythirteen_widgets_init() {
+       register_sidebar( array(
+               'name'          => __( 'Main Widget Area', 'twentythirteen' ),
+               'id'            => 'sidebar-1',
+               'description'   => __( 'Appears in the footer section of the site.', 'twentythirteen' ),
+               'before_widget' => '<aside id="%1$s" class="widget %2$s">',
+               'after_widget'  => '</aside>',
+               'before_title'  => '<h3 class="widget-title">',
+               'after_title'   => '</h3>',
+       ) );
+
+       register_sidebar( array(
+               'name'          => __( 'Secondary Widget Area', 'twentythirteen' ),
+               'id'            => 'sidebar-2',
+               'description'   => __( 'Appears on posts and pages in the sidebar.', 'twentythirteen' ),
+               'before_widget' => '<aside id="%1$s" class="widget %2$s">',
+               'after_widget'  => '</aside>',
+               'before_title'  => '<h3 class="widget-title">',
+               'after_title'   => '</h3>',
+       ) );
+}
+add_action( 'widgets_init', 'twentythirteen_widgets_init' );
+
+if ( ! function_exists( 'twentythirteen_paging_nav' ) ) :
+/**
+ * Displays navigation to next/previous set of posts when applicable.
+ *
+ * @since Twenty Thirteen 1.0
+ *
+ * @return void
+ */
+function twentythirteen_paging_nav() {
+       global $wp_query;
+
+       // Don't print empty markup if there's only one page.
+       if ( $wp_query->max_num_pages < 2 )
+               return;
+       ?>
+       <nav class="navigation paging-navigation" role="navigation">
+               <h1 class="screen-reader-text"><?php _e( 'Posts navigation', 'twentythirteen' ); ?></h1>
+               <div class="nav-links">
+
+                       <?php if ( get_next_posts_link() ) : ?>
+                       <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentythirteen' ) ); ?></div>
+                       <?php endif; ?>
+
+                       <?php if ( get_previous_posts_link() ) : ?>
+                       <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?></div>
+                       <?php endif; ?>
+
+               </div><!-- .nav-links -->
+       </nav><!-- .navigation -->
+       <?php
+}
+endif;
+
+if ( ! function_exists( 'twentythirteen_post_nav' ) ) :
+/**
+ * Displays navigation to next/previous post when applicable.
+*
+* @since Twenty Thirteen 1.0
+*
+* @return void
+*/
+function twentythirteen_post_nav() {
+       global $post;
+
+       // Don't print empty markup if there's nowhere to navigate.
+       $previous = ( is_attachment() ) ? get_post( $post->post_parent ) : get_adjacent_post( false, '', true );
+       $next     = get_adjacent_post( false, '', false );
+
+       if ( ! $next && ! $previous )
+               return;
+       ?>
+       <nav class="navigation post-navigation" role="navigation">
+               <h1 class="screen-reader-text"><?php _e( 'Post navigation', 'twentythirteen' ); ?></h1>
+               <div class="nav-links">
+
+                       <?php previous_post_link( '%link', _x( '<span class="meta-nav">&larr;</span> %title', 'Previous post link', 'twentythirteen' ) ); ?>
+                       <?php next_post_link( '%link', _x( '%title <span class="meta-nav">&rarr;</span>', 'Next post link', 'twentythirteen' ) ); ?>
+
+               </div><!-- .nav-links -->
+       </nav><!-- .navigation -->
+       <?php
+}
+endif;
+
+if ( ! function_exists( 'twentythirteen_entry_meta' ) ) :
+/**
+ * Prints HTML with meta information for current post: categories, tags, permalink, author, and date.
+ *
+ * Create your own twentythirteen_entry_meta() to override in a child theme.
+ *
+ * @since Twenty Thirteen 1.0
+ *
+ * @return void
+ */
+function twentythirteen_entry_meta() {
+       if ( is_sticky() && is_home() && ! is_paged() )
+               echo '<span class="featured-post">' . __( 'Sticky', 'twentythirteen' ) . '</span>';
+
+       if ( ! has_post_format( 'link' ) && 'post' == get_post_type() )
+               twentythirteen_entry_date();
+
+       // Translators: used between list items, there is a space after the comma.
+       $categories_list = get_the_category_list( __( ', ', 'twentythirteen' ) );
+       if ( $categories_list ) {
+               echo '<span class="categories-links">' . $categories_list . '</span>';
+       }
+
+       // Translators: used between list items, there is a space after the comma.
+       $tag_list = get_the_tag_list( '', __( ', ', 'twentythirteen' ) );
+       if ( $tag_list ) {
+               echo '<span class="tags-links">' . $tag_list . '</span>';
+       }
+
+       // Post author
+       if ( 'post' == get_post_type() ) {
+               printf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
+                       esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
+                       esc_attr( sprintf( __( 'View all posts by %s', 'twentythirteen' ), get_the_author() ) ),
+                       get_the_author()
+               );
+       }
+}
+endif;
+
+if ( ! function_exists( 'twentythirteen_entry_date' ) ) :
+/**
+ * Prints HTML with date information for current post.
+ *
+ * Create your own twentythirteen_entry_date() to override in a child theme.
+ *
+ * @since Twenty Thirteen 1.0
+ *
+ * @param boolean $echo Whether to echo the date. Default true.
+ * @return string The HTML-formatted post date.
+ */
+function twentythirteen_entry_date( $echo = true ) {
+       if ( has_post_format( array( 'chat', 'status' ) ) )
+               $format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'twentythirteen' );
+       else
+               $format_prefix = '%2$s';
+
+       $date = sprintf( '<span class="date"><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a></span>',
+               esc_url( get_permalink() ),
+               esc_attr( sprintf( __( 'Permalink to %s', 'twentythirteen' ), the_title_attribute( 'echo=0' ) ) ),
+               esc_attr( get_the_date( 'c' ) ),
+               esc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) )
+       );
+
+       if ( $echo )
+               echo $date;
+
+       return $date;
+}
+endif;
+
+if ( ! function_exists( 'twentythirteen_the_attached_image' ) ) :
+/**
+ * Prints the attached image with a link to the next attached image.
+ *
+ * @since Twenty Thirteen 1.0
+ *
+ * @return void
+ */
+function twentythirteen_the_attached_image() {
+       $post                = get_post();
+       $attachment_size     = apply_filters( 'twentythirteen_attachment_size', array( 724, 724 ) );
+       $next_attachment_url = wp_get_attachment_url();
+
+       /**
+        * Grab the IDs of all the image attachments in a gallery so we can get the URL
+        * of the next adjacent image in a gallery, or the first image (if we're
+        * looking at the last image in a gallery), or, in a gallery of one, just the
+        * link to that image file.
+        */
+       $attachment_ids = get_posts( array(
+               'post_parent'    => $post->post_parent,
+               'fields'         => 'ids',
+               'numberposts'    => -1,
+               'post_status'    => 'inherit',
+               'post_type'      => 'attachment',
+               'post_mime_type' => 'image',
+               'order'          => 'ASC',
+               'orderby'        => 'menu_order ID'
+       ) );
+
+       // If there is more than 1 attachment in a gallery...
+       if ( count( $attachment_ids ) > 1 ) {
+               foreach ( $attachment_ids as $attachment_id ) {
+                       if ( $attachment_id == $post->ID ) {
+                               $next_id = current( $attachment_ids );
+                               break;
+                       }
+               }
+
+               // get the URL of the next image attachment...
+               if ( $next_id )
+                       $next_attachment_url = get_attachment_link( $next_id );
+
+               // or get the URL of the first image attachment.
+               else
+                       $next_attachment_url = get_attachment_link( array_shift( $attachment_ids ) );
+       }
+
+       printf( '<a href="%1$s" title="%2$s" rel="attachment">%3$s</a>',
+               esc_url( $next_attachment_url ),
+               the_title_attribute( array( 'echo' => false ) ),
+               wp_get_attachment_image( $post->ID, $attachment_size )
+       );
+}
+endif;
+
+/**
+ * Returns the URL from the post.
+ *
+ * @uses get_url_in_content() to get the URL in the post meta (if it exists) or
+ * the first link found in the post content.
+ *
+ * Falls back to the post permalink if no URL is found in the post.
+ *
+ * @since Twenty Thirteen 1.0
+ *
+ * @return string The Link format URL.
+ */
+function twentythirteen_get_link_url() {
+       $content = get_the_content();
+       $has_url = get_url_in_content( $content );
+
+       return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() );
+}
+
+/**
+ * Extends the default WordPress body classes.
+ *
+ * Adds body classes to denote:
+ * 1. Single or multiple authors.
+ * 2. Active widgets in the sidebar to change the layout and spacing.
+ * 3. When avatars are disabled in discussion settings.
+ *
+ * @since Twenty Thirteen 1.0
+ *
+ * @param array $classes A list of existing body class values.
+ * @return array The filtered body class list.
+ */
+function twentythirteen_body_class( $classes ) {
+       if ( ! is_multi_author() )
+               $classes[] = 'single-author';
+
+       if ( is_active_sidebar( 'sidebar-2' ) && ! is_attachment() && ! is_404() )
+               $classes[] = 'sidebar';
+
+       if ( ! get_option( 'show_avatars' ) )
+               $classes[] = 'no-avatars';
+
+       return $classes;
+}
+add_filter( 'body_class', 'twentythirteen_body_class' );
+
+/**
+ * Adjusts content_width value for video post formats and attachment templates.
+ *
+ * @since Twenty Thirteen 1.0
+ *
+ * @return void
+ */
+function twentythirteen_content_width() {
+       global $content_width;
+
+       if ( is_attachment() )
+               $content_width = 724;
+       elseif ( has_post_format( 'audio' ) )
+               $content_width = 484;
+}
+add_action( 'template_redirect', 'twentythirteen_content_width' );
+
+/**
+ * Add postMessage support for site title and description for the Customizer.
+ *
+ * @since Twenty Thirteen 1.0
+ *
+ * @param WP_Customize_Manager $wp_customize Customizer object.
+ * @return void
+ */
+function twentythirteen_customize_register( $wp_customize ) {
+       $wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
+       $wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
+       $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
+}
+add_action( 'customize_register', 'twentythirteen_customize_register' );
+
+/**
+ * Binds JavaScript handlers to make Customizer preview reload changes
+ * asynchronously.
+ *
+ * @since Twenty Thirteen 1.0
+ */
+function twentythirteen_customize_preview_js() {
+       wp_enqueue_script( 'twentythirteen-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20130226', true );
+}
+add_action( 'customize_preview_init', 'twentythirteen_customize_preview_js' );
diff --git a/wp-content/themes/twentythirteen/header.php b/wp-content/themes/twentythirteen/header.php
new file mode 100644 (file)
index 0000000..52fce70
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/**
+ * The Header for our theme.
+ *
+ * Displays all of the <head> section and everything up till <div id="main">
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+?><!DOCTYPE html>
+<!--[if IE 7]>
+<html class="ie ie7" <?php language_attributes(); ?>>
+<![endif]-->
+<!--[if IE 8]>
+<html class="ie ie8" <?php language_attributes(); ?>>
+<![endif]-->
+<!--[if !(IE 7) | !(IE 8)  ]><!-->
+<html <?php language_attributes(); ?>>
+<!--<![endif]-->
+<head>
+       <meta charset="<?php bloginfo( 'charset' ); ?>">
+       <meta name="viewport" content="width=device-width">
+       <title><?php wp_title( '|', true, 'right' ); ?></title>
+       <link rel="profile" href="http://gmpg.org/xfn/11">
+       <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
+       <!--[if lt IE 9]>
+       <script src="<?php echo get_template_directory_uri(); ?>/js/html5.js"></script>
+       <![endif]-->
+       <?php wp_head(); ?>
+</head>
+
+<body <?php body_class(); ?>>
+       <div id="page" class="hfeed site">
+               <header id="masthead" class="site-header" role="banner">
+                       <a class="home-link" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
+                               <h1 class="site-title"><?php bloginfo( 'name' ); ?></h1>
+                               <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
+                       </a>
+
+                       <div id="navbar" class="navbar">
+                               <nav id="site-navigation" class="navigation main-navigation" role="navigation">
+                                       <h3 class="menu-toggle"><?php _e( 'Menu', 'twentythirteen' ); ?></h3>
+                                       <a class="screen-reader-text skip-link" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentythirteen' ); ?>"><?php _e( 'Skip to content', 'twentythirteen' ); ?></a>
+                                       <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
+                                       <?php get_search_form(); ?>
+                               </nav><!-- #site-navigation -->
+                       </div><!-- #navbar -->
+               </header><!-- #masthead -->
+
+               <div id="main" class="site-main">
diff --git a/wp-content/themes/twentythirteen/image.php b/wp-content/themes/twentythirteen/image.php
new file mode 100644 (file)
index 0000000..4ef31c4
--- /dev/null
@@ -0,0 +1,82 @@
+<?php
+/**
+ * The template for displaying image attachments.
+ *
+ * Learn more: http://codex.wordpress.org/Template_Hierarchy
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+
+get_header(); ?>
+
+       <div id="primary" class="content-area">
+               <div id="content" class="site-content" role="main">
+                       <article id="post-<?php the_ID(); ?>" <?php post_class( 'image-attachment' ); ?>>
+                               <header class="entry-header">
+                                       <h1 class="entry-title"><?php the_title(); ?></h1>
+
+                                       <div class="entry-meta">
+                                               <?php
+                                                       $published_text = __( '<span class="attachment-meta">Published on <time class="entry-date" datetime="%1$s">%2$s</time> in <a href="%3$s" title="Return to %4$s" rel="gallery">%5$s</a></span>', 'twentythirteen' );
+                                                       $post_title = get_the_title( $post->post_parent );
+                                                       if ( empty( $post_title ) || 0 == $post->post_parent )
+                                                               $published_text = '<span class="attachment-meta"><time class="entry-date" datetime="%1$s">%2$s</time></span>';
+
+                                                       printf( $published_text,
+                                                               esc_attr( get_the_date( 'c' ) ),
+                                                               esc_html( get_the_date() ),
+                                                               esc_url( get_permalink( $post->post_parent ) ),
+                                                               esc_attr( strip_tags( $post_title ) ),
+                                                               $post_title
+                                                       );
+
+                                                       $metadata = wp_get_attachment_metadata();
+                                                       printf( '<span class="attachment-meta full-size-link"><a href="%1$s" title="%2$s">%3$s (%4$s &times; %5$s)</a></span>',
+                                                               esc_url( wp_get_attachment_url() ),
+                                                               esc_attr__( 'Link to full-size image', 'twentythirteen' ),
+                                                               __( 'Full resolution', 'twentythirteen' ),
+                                                               $metadata['width'],
+                                                               $metadata['height']
+                                                       );
+
+                                                       edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' );
+                                               ?>
+                                       </div><!-- .entry-meta -->
+                               </header><!-- .entry-header -->
+
+                               <div class="entry-content">
+                                       <nav id="image-navigation" class="navigation image-navigation" role="navigation">
+                                               <span class="nav-previous"><?php previous_image_link( false, __( '<span class="meta-nav">&larr;</span> Previous', 'twentythirteen' ) ); ?></span>
+                                               <span class="nav-next"><?php next_image_link( false, __( 'Next <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?></span>
+                                       </nav><!-- #image-navigation -->
+
+                                       <div class="entry-attachment">
+                                               <div class="attachment">
+                                                       <?php twentythirteen_the_attached_image(); ?>
+
+                                                       <?php if ( has_excerpt() ) : ?>
+                                                       <div class="entry-caption">
+                                                               <?php the_excerpt(); ?>
+                                                       </div>
+                                                       <?php endif; ?>
+                                               </div><!-- .attachment -->
+                                       </div><!-- .entry-attachment -->
+
+                                       <?php if ( ! empty( $post->post_content ) ) : ?>
+                                       <div class="entry-description">
+                                               <?php the_content(); ?>
+                                               <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentythirteen' ), 'after' => '</div>' ) ); ?>
+                                       </div><!-- .entry-description -->
+                                       <?php endif; ?>
+
+                               </div><!-- .entry-content -->
+                       </article><!-- #post -->
+
+                       <?php comments_template(); ?>
+
+               </div><!-- #content -->
+       </div><!-- #primary -->
+
+<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentythirteen/images/dotted-line-2x.png b/wp-content/themes/twentythirteen/images/dotted-line-2x.png
new file mode 100644 (file)
index 0000000..07f6c93
Binary files /dev/null and b/wp-content/themes/twentythirteen/images/dotted-line-2x.png differ
diff --git a/wp-content/themes/twentythirteen/images/dotted-line-light-2x.png b/wp-content/themes/twentythirteen/images/dotted-line-light-2x.png
new file mode 100644 (file)
index 0000000..059d4ec
Binary files /dev/null and b/wp-content/themes/twentythirteen/images/dotted-line-light-2x.png differ
diff --git a/wp-content/themes/twentythirteen/images/dotted-line-light.png b/wp-content/themes/twentythirteen/images/dotted-line-light.png
new file mode 100644 (file)
index 0000000..b7f82cd
Binary files /dev/null and b/wp-content/themes/twentythirteen/images/dotted-line-light.png differ
diff --git a/wp-content/themes/twentythirteen/images/dotted-line.png b/wp-content/themes/twentythirteen/images/dotted-line.png
new file mode 100644 (file)
index 0000000..115b583
Binary files /dev/null and b/wp-content/themes/twentythirteen/images/dotted-line.png differ
diff --git a/wp-content/themes/twentythirteen/images/headers/circle-thumbnail.png b/wp-content/themes/twentythirteen/images/headers/circle-thumbnail.png
new file mode 100644 (file)
index 0000000..2f9344c
Binary files /dev/null and b/wp-content/themes/twentythirteen/images/headers/circle-thumbnail.png differ
diff --git a/wp-content/themes/twentythirteen/images/headers/circle.png b/wp-content/themes/twentythirteen/images/headers/circle.png
new file mode 100644 (file)
index 0000000..0bd9401
Binary files /dev/null and b/wp-content/themes/twentythirteen/images/headers/circle.png differ
diff --git a/wp-content/themes/twentythirteen/images/headers/diamond-thumbnail.png b/wp-content/themes/twentythirteen/images/headers/diamond-thumbnail.png
new file mode 100644 (file)
index 0000000..82777a0
Binary files /dev/null and b/wp-content/themes/twentythirteen/images/headers/diamond-thumbnail.png differ
diff --git a/wp-content/themes/twentythirteen/images/headers/diamond.png b/wp-content/themes/twentythirteen/images/headers/diamond.png
new file mode 100644 (file)
index 0000000..a14de61
Binary files /dev/null and b/wp-content/themes/twentythirteen/images/headers/diamond.png differ
diff --git a/wp-content/themes/twentythirteen/images/headers/star-thumbnail.png b/wp-content/themes/twentythirteen/images/headers/star-thumbnail.png
new file mode 100644 (file)
index 0000000..693bb76
Binary files /dev/null and b/wp-content/themes/twentythirteen/images/headers/star-thumbnail.png differ
diff --git a/wp-content/themes/twentythirteen/images/headers/star.png b/wp-content/themes/twentythirteen/images/headers/star.png
new file mode 100644 (file)
index 0000000..24ca626
Binary files /dev/null and b/wp-content/themes/twentythirteen/images/headers/star.png differ
diff --git a/wp-content/themes/twentythirteen/images/search-icon-2x.png b/wp-content/themes/twentythirteen/images/search-icon-2x.png
new file mode 100644 (file)
index 0000000..02b63b8
Binary files /dev/null and b/wp-content/themes/twentythirteen/images/search-icon-2x.png differ
diff --git a/wp-content/themes/twentythirteen/images/search-icon.png b/wp-content/themes/twentythirteen/images/search-icon.png
new file mode 100644 (file)
index 0000000..11d8dc8
Binary files /dev/null and b/wp-content/themes/twentythirteen/images/search-icon.png differ
diff --git a/wp-content/themes/twentythirteen/inc/back-compat.php b/wp-content/themes/twentythirteen/inc/back-compat.php
new file mode 100644 (file)
index 0000000..8638adf
--- /dev/null
@@ -0,0 +1,68 @@
+<?php
+/**
+ * Twenty Thirteen back compat functionality.
+ *
+ * Prevents Twenty Thirteen from running on WordPress versions prior to 3.6,
+ * since this theme is not meant to be backwards compatible and relies on
+ * many new functions and markup changes introduced in 3.6.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+
+/**
+ * Prevent switching to Twenty Thirteen on old versions of WordPress. Switches
+ * to the default theme.
+ *
+ * @since Twenty Thirteen 1.0
+ *
+ * @return void
+ */
+function twentythirteen_switch_theme() {
+       switch_theme( WP_DEFAULT_THEME, WP_DEFAULT_THEME );
+       unset( $_GET['activated'] );
+       add_action( 'admin_notices', 'twentythirteen_upgrade_notice' );
+}
+add_action( 'after_switch_theme', 'twentythirteen_switch_theme' );
+
+/**
+ * Prints an update nag after an unsuccessful attempt to switch to
+ * Twenty Thirteen on WordPress versions prior to 3.6.
+ *
+ * @since Twenty Thirteen 1.0
+ *
+ * @return void
+ */
+function twentythirteen_upgrade_notice() {
+       $message = sprintf( __( 'Twenty Thirteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentythirteen' ), $GLOBALS['wp_version'] );
+       printf( '<div class="error"><p>%s</p></div>', $message );
+}
+
+/**
+ * Prevents the Customizer from being loaded on WordPress versions prior to 3.6.
+ *
+ * @since Twenty Thirteen 1.0
+ *
+ * @return void
+ */
+function twentythirteen_customize() {
+       wp_die( sprintf( __( 'Twenty Thirteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentythirteen' ), $GLOBALS['wp_version'] ), '', array(
+               'back_link' => true,
+       ) );
+}
+add_action( 'load-customize.php', 'twentythirteen_customize' );
+
+/**
+ * Prevents the Theme Preview from being loaded on WordPress versions prior to 3.4.
+ *
+ * @since Twenty Thirteen 1.0
+ *
+ * @return void
+ */
+function twentythirteen_preview() {
+       if ( isset( $_GET['preview'] ) ) {
+               wp_die( sprintf( __( 'Twenty Thirteen requires at least WordPress version 3.6. You are running version %s. Please upgrade and try again.', 'twentythirteen' ), $GLOBALS['wp_version'] ) );
+       }
+}
+add_action( 'template_redirect', 'twentythirteen_preview' );
\ No newline at end of file
diff --git a/wp-content/themes/twentythirteen/inc/custom-header.php b/wp-content/themes/twentythirteen/inc/custom-header.php
new file mode 100644 (file)
index 0000000..a835061
--- /dev/null
@@ -0,0 +1,215 @@
+<?php
+/**
+ * Implements a custom header for Twenty Thirteen.
+ * See http://codex.wordpress.org/Custom_Headers
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+
+/**
+ * Sets up the WordPress core custom header arguments and settings.
+ *
+ * @uses add_theme_support() to register support for 3.4 and up.
+ * @uses twentythirteen_header_style() to style front-end.
+ * @uses twentythirteen_admin_header_style() to style wp-admin form.
+ * @uses twentythirteen_admin_header_image() to add custom markup to wp-admin form.
+ * @uses register_default_headers() to set up the bundled header images.
+ *
+ * @since Twenty Thirteen 1.0
+ */
+function twentythirteen_custom_header_setup() {
+       $args = array(
+               // Text color and image (empty to use none).
+               'default-text-color'     => '220e10',
+               'default-image'          => '%s/images/headers/circle.png',
+
+               // Set height and width, with a maximum value for the width.
+               'height'                 => 230,
+               'width'                  => 1600,
+
+               // Callbacks for styling the header and the admin preview.
+               'wp-head-callback'       => 'twentythirteen_header_style',
+               'admin-head-callback'    => 'twentythirteen_admin_header_style',
+               'admin-preview-callback' => 'twentythirteen_admin_header_image',
+       );
+
+       add_theme_support( 'custom-header', $args );
+
+       /*
+        * Default custom headers packaged with the theme.
+        * %s is a placeholder for the theme template directory URI.
+        */
+       register_default_headers( array(
+               'circle' => array(
+                       'url'           => '%s/images/headers/circle.png',
+                       'thumbnail_url' => '%s/images/headers/circle-thumbnail.png',
+                       'description'   => _x( 'Circle', 'header image description', 'twentythirteen' )
+               ),
+               'diamond' => array(
+                       'url'           => '%s/images/headers/diamond.png',
+                       'thumbnail_url' => '%s/images/headers/diamond-thumbnail.png',
+                       'description'   => _x( 'Diamond', 'header image description', 'twentythirteen' )
+               ),
+               'star' => array(
+                       'url'           => '%s/images/headers/star.png',
+                       'thumbnail_url' => '%s/images/headers/star-thumbnail.png',
+                       'description'   => _x( 'Star', 'header image description', 'twentythirteen' )
+               ),
+       ) );
+}
+add_action( 'after_setup_theme', 'twentythirteen_custom_header_setup' );
+
+/**
+ * Loads our special font CSS files.
+ *
+ * @since Twenty Thirteen 1.0
+ */
+function twentythirteen_custom_header_fonts() {
+       // Add Open Sans and Bitter fonts.
+       wp_enqueue_style( 'twentythirteen-fonts', twentythirteen_fonts_url(), array(), null );
+
+       // Add Genericons font.
+       wp_enqueue_style( 'genericons', get_template_directory_uri() . '/fonts/genericons.css', array(), '2.09' );
+}
+add_action( 'admin_print_styles-appearance_page_custom-header', 'twentythirteen_custom_header_fonts' );
+
+/**
+ * Styles the header text displayed on the blog.
+ *
+ * get_header_textcolor() options: Hide text (returns 'blank'), or any hex value.
+ *
+ * @since Twenty Thirteen 1.0
+ */
+function twentythirteen_header_style() {
+       $header_image = get_header_image();
+       $text_color   = get_header_textcolor();
+
+       // If no custom options for text are set, let's bail.
+       if ( empty( $header_image ) && $text_color == get_theme_support( 'custom-header', 'default-text-color' ) )
+               return;
+
+       // If we get this far, we have custom styles.
+       ?>
+       <style type="text/css" id="twentythirteen-header-css">
+       <?php
+               if ( ! empty( $header_image ) ) :
+       ?>
+               .site-header {
+                       background: url(<?php header_image(); ?>) no-repeat scroll top;
+                       background-size: 1600px auto;
+               }
+       <?php
+               endif;
+
+               // Has the text been hidden?
+               if ( ! display_header_text() ) :
+       ?>
+               .site-title,
+               .site-description {
+                       position: absolute;
+                       clip: rect(1px 1px 1px 1px); /* IE7 */
+                       clip: rect(1px, 1px, 1px, 1px);
+               }
+       <?php
+                       if ( empty( $header_image ) ) :
+       ?>
+               .site-header .home-link {
+                       min-height: 0;
+               }
+       <?php
+                       endif;
+
+               // If the user has set a custom color for the text, use that.
+               elseif ( $text_color != get_theme_support( 'custom-header', 'default-text-color' ) ) :
+       ?>
+               .site-title,
+               .site-description {
+                       color: #<?php echo esc_attr( $text_color ); ?>;
+               }
+       <?php endif; ?>
+       </style>
+       <?php
+}
+
+/**
+ * Styles the header image displayed on the Appearance > Header admin panel.
+ *
+ * @since Twenty Thirteen 1.0
+ */
+function twentythirteen_admin_header_style() {
+       $header_image = get_header_image();
+?>
+       <style type="text/css" id="twentythirteen-admin-header-css">
+       .appearance_page_custom-header #headimg {
+               border: none;
+               -webkit-box-sizing: border-box;
+               -moz-box-sizing:    border-box;
+               box-sizing:         border-box;
+               <?php
+               if ( ! empty( $header_image ) ) {
+                       echo 'background: url(' . esc_url( $header_image ) . ') no-repeat scroll top; background-size: 1600px auto;';
+               } ?>
+               padding: 0 20px;
+       }
+       #headimg .home-link {
+               -webkit-box-sizing: border-box;
+               -moz-box-sizing:    border-box;
+               box-sizing:         border-box;
+               margin: 0 auto;
+               max-width: 1040px;
+               <?php
+               if ( ! empty( $header_image ) || display_header_text() ) {
+                       echo 'min-height: 230px;';
+               } ?>
+               width: 100%;
+       }
+       <?php if ( ! display_header_text() ) : ?>
+       #headimg h1,
+       #headimg h2 {
+               position: absolute !important;
+               clip: rect(1px 1px 1px 1px); /* IE7 */
+               clip: rect(1px, 1px, 1px, 1px);
+       }
+       <?php endif; ?>
+       #headimg h1 {
+               font: bold 60px/1 Bitter, Georgia, serif;
+               margin: 0;
+               padding: 58px 0 10px;
+       }
+       #headimg h1 a {
+               text-decoration: none;
+       }
+       #headimg h1 a:hover {
+               text-decoration: underline;
+       }
+       #headimg h2 {
+               font: 200 italic 24px "Source Sans Pro", Helvetica, sans-serif;
+               margin: 0;
+               text-shadow: none;
+       }
+       .default-header img {
+               max-width: 230px;
+               width: auto;
+       }
+       </style>
+<?php
+}
+
+/**
+ * Outputs markup to be displayed on the Appearance > Header admin panel.
+ * This callback overrides the default markup displayed there.
+ *
+ * @since Twenty Thirteen 1.0
+ */
+function twentythirteen_admin_header_image() {
+       ?>
+       <div id="headimg" style="background: url(<?php header_image(); ?>) no-repeat scroll top; background-size: 1600px auto;">
+               <?php $style = ' style="color:#' . get_header_textcolor() . ';"'; ?>
+               <div class="home-link">
+                       <h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="#"><?php bloginfo( 'name' ); ?></a></h1>
+                       <h2 id="desc" class="displaying-header-text"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></h2>
+               </div>
+       </div>
+<?php }
diff --git a/wp-content/themes/twentythirteen/index.php b/wp-content/themes/twentythirteen/index.php
new file mode 100644 (file)
index 0000000..67faeaf
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+/**
+ * The main template file.
+ *
+ * This is the most generic template file in a WordPress theme and one of the
+ * two required files for a theme (the other being style.css).
+ * It is used to display a page when nothing more specific matches a query.
+ * For example, it puts together the home page when no home.php file exists.
+ *
+ * Learn more: http://codex.wordpress.org/Template_Hierarchy
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+
+get_header(); ?>
+
+       <div id="primary" class="content-area">
+               <div id="content" class="site-content" role="main">
+               <?php if ( have_posts() ) : ?>
+
+                       <?php /* The loop */ ?>
+                       <?php while ( have_posts() ) : the_post(); ?>
+                               <?php get_template_part( 'content', get_post_format() ); ?>
+                       <?php endwhile; ?>
+
+                       <?php twentythirteen_paging_nav(); ?>
+
+               <?php else : ?>
+                       <?php get_template_part( 'content', 'none' ); ?>
+               <?php endif; ?>
+
+               </div><!-- #content -->
+       </div><!-- #primary -->
+
+<?php get_sidebar(); ?>
+<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentythirteen/js/functions.js b/wp-content/themes/twentythirteen/js/functions.js
new file mode 100644 (file)
index 0000000..777a5cf
--- /dev/null
@@ -0,0 +1,81 @@
+/**
+ * Functionality specific to Twenty Thirteen.
+ *
+ * Provides helper functions to enhance the theme experience.
+ */
+
+( function( $ ) {
+       var body    = $( 'body' ),
+           _window = $( window );
+
+       /**
+        * Adds a top margin to the footer if the sidebar widget area is higher
+        * than the rest of the page, to help the footer always visually clear
+        * the sidebar.
+        */
+       $( function() {
+               if ( body.is( '.sidebar' ) ) {
+                       var sidebar   = $( '#secondary .widget-area' ),
+                           secondary = ( 0 == sidebar.length ) ? -40 : sidebar.height(),
+                           margin    = $( '#tertiary .widget-area' ).height() - $( '#content' ).height() - secondary;
+
+                       if ( margin > 0 && _window.innerWidth() > 999 )
+                               $( '#colophon' ).css( 'margin-top', margin + 'px' );
+               }
+       } );
+
+       /**
+        * Enables menu toggle for small screens.
+        */
+       ( function() {
+               var nav = $( '#site-navigation' ), button, menu;
+               if ( ! nav )
+                       return;
+
+               button = nav.find( '.menu-toggle' );
+               if ( ! button )
+                       return;
+
+               // Hide button if menu is missing or empty.
+               menu = nav.find( '.nav-menu' );
+               if ( ! menu || ! menu.children().length ) {
+                       button.hide();
+                       return;
+               }
+
+               $( '.menu-toggle' ).on( 'click.twentythirteen', function() {
+                       nav.toggleClass( 'toggled-on' );
+               } );
+       } )();
+
+       /**
+        * Makes "skip to content" link work correctly in IE9 and Chrome for better
+        * accessibility.
+        *
+        * @link http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/
+        */
+       _window.on( 'hashchange.twentythirteen', function() {
+               var element = document.getElementById( location.hash.substring( 1 ) );
+
+               if ( element ) {
+                       if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) )
+                               element.tabIndex = -1;
+
+                       element.focus();
+               }
+       } );
+
+       /**
+        * Arranges footer widgets vertically.
+        */
+       if ( $.isFunction( $.fn.masonry ) ) {
+               var columnWidth = body.is( '.sidebar' ) ? 228 : 245;
+
+               $( '#secondary .widget-area' ).masonry( {
+                       itemSelector: '.widget',
+                       columnWidth: columnWidth,
+                       gutterWidth: 20,
+                       isRTL: body.is( '.rtl' )
+               } );
+       }
+} )( jQuery );
\ No newline at end of file
similarity index 97%
rename from wp-content/themes/twentyeleven/js/html5.js
rename to wp-content/themes/twentythirteen/js/html5.js
index fabcb85ec3bfd6ae6ec5d88b86b0ba0498e2a530..a7889168fb20749a297d73c63f61eaf3f6d01663 100644 (file)
@@ -1,4 +1,5 @@
 /*! HTML5 Shiv v3.6 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed */
+/* Source: https://github.com/aFarkas/html5shiv */
 (function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag();
 a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x<style>article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}</style>";
 c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^<|^(?:a|b|button|code|div|fieldset|form|h1|h2|h3|h4|h5|h6|i|iframe|img|input|label|li|link|ol|option|p|param|q|script|select|span|strong|style|table|tbody|td|textarea|tfoot|th|thead|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="<xyz></xyz>";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");
diff --git a/wp-content/themes/twentythirteen/js/theme-customizer.js b/wp-content/themes/twentythirteen/js/theme-customizer.js
new file mode 100644 (file)
index 0000000..640db0f
--- /dev/null
@@ -0,0 +1,40 @@
+/**
+ * Theme Customizer enhancements for a better user experience.
+ *
+ * Contains handlers to make Theme Customizer preview reload changes asynchronously.
+ * Things like site title and description changes.
+ */
+
+( function( $ ) {
+       // Site title and description.
+       wp.customize( 'blogname', function( value ) {
+               value.bind( function( to ) {
+                       $( '.site-title' ).text( to );
+               } );
+       } );
+       wp.customize( 'blogdescription', function( value ) {
+               value.bind( function( to ) {
+                       $( '.site-description' ).text( to );
+               } );
+       } );
+       // Header text color.
+       wp.customize( 'header_textcolor', function( value ) {
+               value.bind( function( to ) {
+                       if ( 'blank' == to ) {
+                               if ( 'remove-header' == _wpCustomizeSettings.values.header_image )
+                                       $( '.home-link' ).css( 'min-height', '0' );
+                               $( '.site-title, .site-description' ).css( {
+                                       'clip': 'rect(1px, 1px, 1px, 1px)',
+                                       'position': 'absolute'
+                               } );
+                       } else {
+                               $( '.home-link' ).css( 'min-height', '230px' );
+                               $( '.site-title, .site-description' ).css( {
+                                       'clip': 'auto',
+                                       'color': to,
+                                       'position': 'relative'
+                               } );
+                       }
+               } );
+       } );
+} )( jQuery );
diff --git a/wp-content/themes/twentythirteen/languages/twentythirteen.pot b/wp-content/themes/twentythirteen/languages/twentythirteen.pot
new file mode 100644 (file)
index 0000000..24bb302
--- /dev/null
@@ -0,0 +1,333 @@
+# Copyright (C) 2013 the WordPress team
+# This file is distributed under the GNU General Public License v2 or later.
+msgid ""
+msgstr ""
+"Project-Id-Version: Twenty Thirteen 1.0\n"
+"Report-Msgid-Bugs-To: http://wordpress.org/tags/twentythirteen\n"
+"POT-Creation-Date: 2013-08-01 18:14:18+00:00\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"PO-Revision-Date: 2013-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+
+#: 404.php:16
+msgid "Not found"
+msgstr ""
+
+#: 404.php:21
+msgid "This is somewhat embarrassing, isn&rsquo;t it?"
+msgstr ""
+
+#: 404.php:22
+msgid "It looks like nothing was found at this location. Maybe try a search?"
+msgstr ""
+
+#: archive.php:29
+msgid "Daily Archives: %s"
+msgstr ""
+
+#: archive.php:31
+msgid "Monthly Archives: %s"
+msgstr ""
+
+#: archive.php:31
+msgctxt "monthly archives date format"
+msgid "F Y"
+msgstr ""
+
+#: archive.php:33
+msgid "Yearly Archives: %s"
+msgstr ""
+
+#: archive.php:33
+msgctxt "yearly archives date format"
+msgid "Y"
+msgstr ""
+
+#: archive.php:35
+msgid "Archives"
+msgstr ""
+
+#: author-bio.php:16
+msgid "About %s"
+msgstr ""
+
+#: author-bio.php:20
+msgid "View all posts by %s <span class=\"meta-nav\">&rarr;</span>"
+msgstr ""
+
+#: author.php:30
+msgid "All posts by %s"
+msgstr ""
+
+#: category.php:19
+msgid "Category Archives: %s"
+msgstr ""
+
+#: comments.php:25
+msgctxt "comments title"
+msgid "One thought on &ldquo;%2$s&rdquo;"
+msgid_plural "%1$s thoughts on &ldquo;%2$s&rdquo;"
+msgstr[0] ""
+msgstr[1] ""
+
+#: comments.php:45
+msgid "Comment navigation"
+msgstr ""
+
+#: comments.php:46
+msgid "&larr; Older Comments"
+msgstr ""
+
+#: comments.php:47
+msgid "Newer Comments &rarr;"
+msgstr ""
+
+#: comments.php:52
+msgid "Comments are closed."
+msgstr ""
+
+#: content-aside.php:13 content-audio.php:24 content-gallery.php:24
+#: content-image.php:23 content-link.php:24 content-quote.php:13
+#: content-status.php:13 content-video.php:23 content.php:39
+msgid "Continue reading <span class=\"meta-nav\">&rarr;</span>"
+msgstr ""
+
+#: content-aside.php:14 content-audio.php:25 content-chat.php:24
+#: content-gallery.php:25 content-image.php:24 content-link.php:25
+#: content-quote.php:14 content-status.php:14 content-video.php:24
+#: content.php:40 image.php:70 page.php:35
+msgid "Pages:"
+msgstr ""
+
+#: content-aside.php:20 content-aside.php:28 content-audio.php:31
+#: content-chat.php:29 content-gallery.php:39 content-image.php:35
+#: content-link.php:19 content-quote.php:25 content-status.php:19
+#: content-video.php:35 content.php:29 image.php:44 page.php:39
+msgid "Edit"
+msgstr ""
+
+#: content-gallery.php:36 content-image.php:32 content-quote.php:22
+#: content-video.php:32 content.php:47
+msgid "Leave a comment"
+msgstr ""
+
+#: content-gallery.php:36 content-image.php:32 content-quote.php:22
+#: content-video.php:32 content.php:47
+msgid "One comment so far"
+msgstr ""
+
+#: content-gallery.php:36 content-image.php:32 content-quote.php:22
+#: content-video.php:32 content.php:47
+msgid "View all % comments"
+msgstr ""
+
+#: content-none.php:12
+msgid "Nothing Found"
+msgstr ""
+
+#: content-none.php:18
+msgid ""
+"Ready to publish your first post? <a href=\"%1$s\">Get started here</a>."
+msgstr ""
+
+#: content-none.php:22
+msgid ""
+"Sorry, but nothing matched your search terms. Please try again with "
+"different keywords."
+msgstr ""
+
+#: content-none.php:27
+msgid ""
+"It seems we can&rsquo;t find what you&rsquo;re looking for. Perhaps "
+"searching can help."
+msgstr ""
+
+#. #-#-#-#-#  twentythirteen.pot (Twenty Thirteen 1.0)  #-#-#-#-#
+#. Author URI of the plugin/theme
+#: footer.php:20
+msgid "http://wordpress.org/"
+msgstr ""
+
+#: footer.php:20
+msgid "Semantic Personal Publishing Platform"
+msgstr ""
+
+#: footer.php:20
+msgid "Proudly powered by %s"
+msgstr ""
+
+#: functions.php:93
+msgid "Navigation Menu"
+msgstr ""
+
+#. Translators: If there are characters in your language that are not
+#.      * supported by Source Sans Pro, translate this to 'off'. Do not translate
+#.      * into your own language.
+#: functions.php:124
+msgctxt "Source Sans Pro font: on or off"
+msgid "on"
+msgstr ""
+
+#. Translators: If there are characters in your language that are not
+#.      * supported by Bitter, translate this to 'off'. Do not translate into your
+#.      * own language.
+#: functions.php:130
+msgctxt "Bitter font: on or off"
+msgid "on"
+msgstr ""
+
+#: functions.php:212
+msgid "Page %s"
+msgstr ""
+
+#: functions.php:227
+msgid "Main Widget Area"
+msgstr ""
+
+#: functions.php:229
+msgid "Appears in the footer section of the site."
+msgstr ""
+
+#: functions.php:237
+msgid "Secondary Widget Area"
+msgstr ""
+
+#: functions.php:239
+msgid "Appears on posts and pages in the sidebar."
+msgstr ""
+
+#: functions.php:264
+msgid "Posts navigation"
+msgstr ""
+
+#: functions.php:268
+msgid "<span class=\"meta-nav\">&larr;</span> Older posts"
+msgstr ""
+
+#: functions.php:272
+msgid "Newer posts <span class=\"meta-nav\">&rarr;</span>"
+msgstr ""
+
+#: functions.php:300
+msgid "Post navigation"
+msgstr ""
+
+#: functions.php:303
+msgctxt "Previous post link"
+msgid "<span class=\"meta-nav\">&larr;</span> %title"
+msgstr ""
+
+#: functions.php:304
+msgctxt "Next post link"
+msgid "%title <span class=\"meta-nav\">&rarr;</span>"
+msgstr ""
+
+#: functions.php:324
+msgid "Sticky"
+msgstr ""
+
+#. Translators: used between list items, there is a space after the comma.
+#: functions.php:330 functions.php:336
+msgid ", "
+msgstr ""
+
+#: functions.php:345
+msgid "View all posts by %s"
+msgstr ""
+
+#: functions.php:365
+msgctxt "1: post format name. 2: date"
+msgid "%1$s on %2$s"
+msgstr ""
+
+#: functions.php:371
+msgid "Permalink to %s"
+msgstr ""
+
+#: header.php:43
+msgid "Menu"
+msgstr ""
+
+#: header.php:44
+msgid "Skip to content"
+msgstr ""
+
+#: image.php:22
+msgid ""
+"<span class=\"attachment-meta\">Published on <time class=\"entry-date\" "
+"datetime=\"%1$s\">%2$s</time> in <a href=\"%3$s\" title=\"Return to %4$s\" "
+"rel=\"gallery\">%5$s</a></span>"
+msgstr ""
+
+#: image.php:38
+msgid "Link to full-size image"
+msgstr ""
+
+#: image.php:39
+msgid "Full resolution"
+msgstr ""
+
+#: image.php:51
+msgid "<span class=\"meta-nav\">&larr;</span> Previous"
+msgstr ""
+
+#: image.php:52
+msgid "Next <span class=\"meta-nav\">&rarr;</span>"
+msgstr ""
+
+#: inc/back-compat.php:38 inc/back-compat.php:50 inc/back-compat.php:65
+msgid ""
+"Twenty Thirteen requires at least WordPress version 3.6. You are running "
+"version %s. Please upgrade and try again."
+msgstr ""
+
+#: inc/custom-header.php:48
+msgctxt "header image description"
+msgid "Circle"
+msgstr ""
+
+#: inc/custom-header.php:53
+msgctxt "header image description"
+msgid "Diamond"
+msgstr ""
+
+#: inc/custom-header.php:58
+msgctxt "header image description"
+msgid "Star"
+msgstr ""
+
+#: search.php:18
+msgid "Search Results for: %s"
+msgstr ""
+
+#: tag.php:21
+msgid "Tag Archives: %s"
+msgstr ""
+
+#: taxonomy-post_format.php:23
+msgid "%s Archives"
+msgstr ""
+
+#. Theme Name of the plugin/theme
+msgid "Twenty Thirteen"
+msgstr ""
+
+#. Theme URI of the plugin/theme
+msgid "http://wordpress.org/themes/twentythirteen"
+msgstr ""
+
+#. Description of the plugin/theme
+msgid ""
+"The 2013 theme for WordPress takes us back to the blog, featuring a full "
+"range of post formats, each displayed beautifully in their own unique way. "
+"Design details abound, starting with a vibrant color scheme and matching "
+"header images, beautiful typography and icons, and a flexible layout that "
+"looks great on any device, big or small."
+msgstr ""
+
+#. Author of the plugin/theme
+msgid "the WordPress team"
+msgstr ""
diff --git a/wp-content/themes/twentythirteen/page.php b/wp-content/themes/twentythirteen/page.php
new file mode 100644 (file)
index 0000000..06e38e7
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+/**
+ * The template for displaying all pages.
+ *
+ * This is the template that displays all pages by default.
+ * Please note that this is the WordPress construct of pages and that other
+ * 'pages' on your WordPress site will use a different template.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+
+get_header(); ?>
+
+       <div id="primary" class="content-area">
+               <div id="content" class="site-content" role="main">
+
+                       <?php /* The loop */ ?>
+                       <?php while ( have_posts() ) : the_post(); ?>
+
+                               <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+                                       <header class="entry-header">
+                                               <?php if ( has_post_thumbnail() && ! post_password_required() ) : ?>
+                                               <div class="entry-thumbnail">
+                                                       <?php the_post_thumbnail(); ?>
+                                               </div>
+                                               <?php endif; ?>
+
+                                               <h1 class="entry-title"><?php the_title(); ?></h1>
+                                       </header><!-- .entry-header -->
+
+                                       <div class="entry-content">
+                                               <?php the_content(); ?>
+                                               <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
+                                       </div><!-- .entry-content -->
+
+                                       <footer class="entry-meta">
+                                               <?php edit_post_link( __( 'Edit', 'twentythirteen' ), '<span class="edit-link">', '</span>' ); ?>
+                                       </footer><!-- .entry-meta -->
+                               </article><!-- #post -->
+
+                               <?php comments_template(); ?>
+                       <?php endwhile; ?>
+
+               </div><!-- #content -->
+       </div><!-- #primary -->
+
+<?php get_sidebar(); ?>
+<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentythirteen/rtl.css b/wp-content/themes/twentythirteen/rtl.css
new file mode 100644 (file)
index 0000000..5428630
--- /dev/null
@@ -0,0 +1,766 @@
+/*
+Theme Name: Twenty Thirteen
+Description: Adds support for languages written in a Right To Left (RTL) direction.
+It's easy, just a matter of overwriting all the horizontal positioning attributes
+of your CSS stylesheet in a separate stylesheet file named rtl.css.
+
+See http://codex.wordpress.org/Right_to_Left_Language_Support
+*/
+
+/**
+ * Table of Contents:
+ *
+ * 1.0 - Reset
+ * 4.0 - Header
+ *   4.1 - Site Header
+ *   4.2 - Navigation
+ * 5.0 - Content
+ *   5.2 - Entry Meta
+ *   5.4 - Galleries
+ *   5.5 - Post Formats
+ *   5.6 - Attachments
+ *   5.7 - Post/Paging Navigation
+ *   5.8 - Author Bio
+ *   5.9 - Archives
+ *   5.10 - Search Results/No posts
+ *   5.12 - Comments
+ * 6.0 - Sidebar
+ *   6.1 - Widgets
+ * 7.0 - Footer
+ * 8.0 - Media Queries
+ * 9.0 - Print
+ * ----------------------------------------------------------------------------
+ */
+
+
+/**
+ * 1.0 Reset
+ * ----------------------------------------------------------------------------
+ */
+
+body {
+       direction: rtl;
+       unicode-bidi: embed;
+}
+
+a {
+       display: inline-block;
+}
+
+blockquote blockquote {
+       margin-left: 0;
+       margin-right: 24px;
+}
+
+menu,
+ol,
+ul {
+       padding: 0 40px 0 0;
+}
+
+caption,
+th,
+td {
+       text-align: right;
+}
+
+td {
+       padding-left: 10px;
+       padding-right: 0;
+}
+
+.assistive-text:focus {
+       left: auto;
+       right: 5px;
+}
+
+
+/**
+ * 4.0 Header
+ * ----------------------------------------------------------------------------
+ */
+
+/**
+ * 4.1 Site Header
+ * ----------------------------------------------------------------------------
+ */
+
+.site-header > a:first-child {
+       display: inherit;
+}
+
+.site-description {
+       font-style: normal;
+}
+
+
+/**
+ * 4.2 Navigation
+ * ----------------------------------------------------------------------------
+ */
+
+/* Navbar */
+ul.nav-menu,
+div.nav-menu > ul {
+       margin: 0 -20px 0 0;
+       padding: 0 0 0 40px;
+}
+
+.nav-menu .sub-menu,
+.nav-menu .children {
+       float: right;
+       left: auto;
+       right: -2px;
+}
+
+.nav-menu .sub-menu ul,
+.nav-menu .children ul {
+       border-left: 2px solid #f7f5e7;
+       border-right: 0;
+       left: auto;
+       right: 100%;
+}
+
+.main-navigation .search-form {
+       left: 0;
+       right: auto;
+}
+
+.site-header .search-field {
+       background-position: 98% center;
+       padding: 0 34px 0 0;
+}
+
+.nav-menu .current_page_item > a,
+.nav-menu .current_page_ancestor > a,
+.nav-menu .current-menu-item > a,
+.nav-menu .current-menu-ancestor > a {
+       font-style: normal;
+}
+
+.menu-toggle {
+       padding-left: 0;
+       padding-right: 20px;
+}
+
+
+/**
+ * 5.0 Content
+ * ----------------------------------------------------------------------------
+ */
+
+.sidebar .entry-header,
+.sidebar .entry-content,
+.sidebar .entry-summary,
+.sidebar .entry-meta {
+       padding-left: 376px;
+       padding-right: 60px;
+}
+
+
+/**
+ * 5.2 Entry Meta
+ * ----------------------------------------------------------------------------
+ */
+
+.entry-meta > span {
+       margin-left: 20px;
+       margin-right: auto;
+}
+
+.entry-meta > span:last-child {
+       margin-left: 0;
+       margin-right: auto;
+}
+
+.featured-post:before {
+       margin-left: 2px;
+       margin-right: auto;
+}
+
+.entry-meta .date a:before {
+       margin-left: 2px;
+}
+
+.comments-link a:before {
+       margin-left: 2px;
+       margin-right: auto;
+}
+
+.tags-links a:first-child:before {
+       margin-left: 2px;
+}
+
+.edit-link a:before {
+       margin-left: 2px;
+}
+
+.page-links .page-links-title {
+       margin-left: 20px;
+       margin-right: auto;
+}
+
+/**
+ * 5.4 Galleries
+ * ----------------------------------------------------------------------------
+ */
+
+.gallery {
+       margin-left: auto;
+       margin-right: -4px;
+}
+
+.gallery-item {
+       float: right;
+       margin: 0 0 4px 4px;
+}
+
+.gallery-item a {
+       display: inline;
+}
+
+
+/**
+ * 5.5 Post Formats
+ * ----------------------------------------------------------------------------
+ */
+
+.entry-content a {
+       display: inline;
+}
+
+.format-aside cite:before {
+       content: normal;
+       margin-right: auto;
+}
+
+.format-aside cite:after {
+       content: "\2014";
+       margin-left: 5px;
+}
+
+.format-audio .entry-content:before {
+       float: right;
+       -webkit-transform: scaleX(-1);
+       -moz-transform:    scaleX(-1);
+       -ms-transform:     scaleX(-1);
+       -o-transform:      scaleX(-1);
+       transform:         scaleX(-1);
+}
+
+.format-audio .audio-content {
+       background-position: right top;
+       float: left;
+       padding-left: 0;
+       padding-right: 35px;
+}
+
+.format-chat .entry-meta .date a:before {
+       margin-left: 4px;
+       margin-right: auto;
+}
+
+.format-image .wp-caption-text {
+       text-align: right;
+}
+
+.format-link .entry-title {
+       margin-left: 20px;
+       margin-right: auto;
+}
+
+.format-status .entry-content,
+.format-status .entry-meta {
+       padding-left: 0;
+       padding-right: 35px;
+}
+
+.sidebar .format-status .entry-content,
+.sidebar .format-status .entry-meta {
+       padding-left: 376px;
+       padding-right: 95px;
+}
+
+.format-status .entry-content:before,
+.format-status .entry-meta:before {
+       left: auto;
+       right: 10px;
+}
+
+.sidebar .format-status .entry-content:before,
+.sidebar .format-status .entry-meta:before {
+       left: auto;
+       right: 70px;
+}
+
+.format-status .entry-content p:first-child:before {
+       left: auto;
+       right: 4px;
+}
+
+.sidebar .format-status .entry-content p:first-child:before {
+       left: auto;
+       right: 64px;
+}
+
+.format-quote blockquote {
+       padding-left: 0;
+       padding-right: 75px;
+}
+
+.format-quote blockquote:before {
+       content: '\201D';
+       padding-left: 25px;
+       padding-right: 0;
+       left: auto;
+       right: -15px;
+}
+
+
+/**
+ * 5.6 Attachments
+ * ----------------------------------------------------------------------------
+ */
+
+.attachment .entry-title {
+       float: right;
+}
+
+.attachment .entry-title:before {
+       margin-left: 10px;
+       margin-right: auto;
+}
+
+.attachment .entry-meta {
+       float: left;
+}
+
+.image-navigation .nav-previous {
+       left: auto;
+       right: 0;
+}
+
+.image-navigation .nav-next {
+       left: 0;
+       right: auto;
+}
+
+.attachment .entry-caption {
+       text-align: right;
+}
+
+
+/**
+ * 5.7 Post/Paging Navigation
+ * ----------------------------------------------------------------------------
+ */
+
+.navigation .nav-previous {
+       float: right;
+}
+
+.navigation .nav-next {
+       float: left;
+}
+
+.sidebar .paging-navigation .nav-links,
+.sidebar .post-navigation .nav-links {
+       padding-left: 376px;
+       padding-right: 60px;
+}
+
+.paging-navigation .nav-previous .meta-nav {
+       margin-left: 10px;
+       margin-right: auto;
+}
+
+.paging-navigation .nav-next .meta-nav {
+       margin-left: auto;
+       margin-right: 10px;
+}
+
+.post-navigation a[rel="next"] {
+       float: left;
+       text-align: left;
+}
+
+
+/**
+ * 5.8 Author Bio
+ * ----------------------------------------------------------------------------
+ */
+
+.author-info {
+       text-align: right; /* gallery & video post formats */
+}
+
+.author.sidebar .author-info {
+       padding-left: 376px;
+       padding-right: 60px;
+}
+
+.author-avatar .avatar {
+       float: right;
+       margin: 0 0 30px 30px;
+}
+
+.author-link {
+       margin-left: auto;
+       margin-right: 2px;
+}
+
+
+/**
+ * 5.9 Archives
+ * ----------------------------------------------------------------------------
+ */
+
+.sidebar .archive-meta {
+       padding-left: 316px;
+       padding-right: 0;
+}
+
+
+/**
+ * 5.10 Search Results/No posts
+ * ----------------------------------------------------------------------------
+ */
+
+.sidebar .page-content {
+       padding-left: 376px;
+       padding-right: 60px;
+}
+
+/**
+ * 5.12 Comments
+ * ----------------------------------------------------------------------------
+ */
+
+.sidebar .comments-title,
+.sidebar .comment-list,
+.sidebar .comment-reply-title,
+.sidebar .comment-navigation,
+.sidebar .comment-respond .comment-form {
+       padding-left: 376px;
+       padding-right: 60px;
+}
+
+.comment-list .children {
+       margin-left: auto;
+       margin-right: 20px;
+}
+
+.comment-author {
+       float: right;
+       margin-left: 50px;
+       margin-right: auto;
+}
+
+.comment-list .edit-link {
+       margin-left: auto;
+       margin-right: 20px;
+}
+
+.comment-metadata,
+.comment-content,
+.comment-list .reply,
+.comment-awaiting-moderation {
+       float: left;
+}
+
+.comment-awaiting-moderation:before {
+       margin-left: 5px;
+       margin-right: auto;
+}
+
+.comment-reply-link:before,
+.comment-reply-login:before {
+       margin-left: 3px;
+       margin-right: auto;
+       -webkit-transform: scaleX(-1);
+       -moz-transform:    scaleX(-1);
+       -ms-transform:     scaleX(-1);
+       -o-transform:      scaleX(-1);
+       transform:         scaleX(-1);
+}
+
+.comment-reply-title small a {
+       float: left;
+}
+
+.comment-form [for="author"],
+.comment-form [for="email"],
+.comment-form [for="url"],
+.comment-form [for="comment"] {
+       float: right;
+}
+
+.form-allowed-tags code {
+       margin-left: auto;
+       margin-right: 3px;
+}
+
+.sidebar .no-comments {
+       padding-left: 376px;
+       padding-right: 60px;
+}
+
+
+/**
+ * 6.0 Sidebar
+ * ----------------------------------------------------------------------------
+ */
+
+.site-main .widget-area {
+       float: left;
+}
+
+.widget-area a {
+       max-width: 100%;
+}
+
+
+/**
+ * 6.1 Widgets
+ * ----------------------------------------------------------------------------
+ */
+
+.widget .widget-title {
+       font-style: normal;
+}
+
+.widget li > ul,
+.widget li > ol {
+       margin-left: auto;
+       margin-right: 20px;
+}
+
+/**
+ * 7.0 Footer
+ * ----------------------------------------------------------------------------
+ */
+
+.site-footer .widget-area,
+.sidebar .site-footer {
+       text-align: right;
+}
+.sidebar .site-footer .widget-area {
+       left: auto;
+       right: -158px;
+}
+
+.site-footer .widget {
+       float: right;
+       margin-left: 20px;
+       margin-right: auto;
+}
+
+.sidebar .site-footer .widget:nth-of-type(4),
+.sidebar .site-footer .widget:nth-of-type(3) {
+       margin-left: 0;
+       margin-right: auto;
+}
+
+
+/**
+ * 8.0 Media Queries
+ * ----------------------------------------------------------------------------
+ */
+
+@media (max-width: 1069px) {
+       ul.nav-menu,
+       div.nav-menu > ul {
+               margin-left: auto;
+               margin-right: 0;
+       }
+
+       .error404 .page-header,
+       .sidebar .format-image .entry-content img.size-full,
+       .sidebar .format-image .wp-caption:first-child .wp-caption-text {
+               margin-right: auto;
+       }
+
+       .main-navigation .search-form {
+               left: 20px;
+               right: auto;
+       }
+
+       .site-main .widget-area {
+               margin-left: 60px;
+               margin-right: auto;
+       }
+}
+
+@media (max-width: 999px) {
+       .sidebar .entry-header,
+       .sidebar .entry-content,
+       .sidebar .entry-summary,
+       .sidebar .entry-meta,
+       .sidebar .comment-list,
+       .sidebar .comment-reply-title,
+       .sidebar .comment-navigation,
+       .sidebar .comment-respond .comment-form,
+       .sidebar .featured-gallery,
+       .sidebar .post-navigation .nav-links,
+       .author.sidebar .author-info,
+       .sidebar .format-image .entry-content {
+               max-width: 604px;
+               padding-left: 0;
+               padding-right: 0;
+       }
+
+       .site-main .widget-area {
+               float: none;
+               margin-left: auto;
+       }
+
+       .attachment .entry-meta {
+               float: right;
+               text-align: right;
+       }
+
+       .sidebar .format-status .entry-content,
+       .sidebar .format-status .entry-meta {
+               padding-left: 0;
+               padding-right: 35px;
+       }
+
+       .sidebar .format-status .entry-content:before,
+       .sidebar .format-status .entry-meta:before {
+               left: auto;
+               right: 10px;
+       }
+
+       .sidebar .format-status .entry-content p:first-child:before {
+               left: auto;
+               right: 4px;
+       }
+
+       .sidebar .site-footer .widget-area {
+               left: auto;
+               right: 0;
+       }
+
+       .sidebar .paging-navigation .nav-links {
+               padding: 0 60px;
+       }
+}
+
+@media (max-width: 767px) {
+       .format-image .entry-content img:first-of-type,
+       .format-image .wp-caption:first-child .wp-caption-text {
+               margin-right: auto;
+       }
+}
+
+@media (max-width: 643px) {
+       .sidebar .entry-header,
+       .sidebar .entry-content,
+       .sidebar .entry-summary,
+       .sidebar .entry-meta,
+       .sidebar .comment-list,
+       .sidebar .comment-navigation,
+       .sidebar .featured-gallery,
+       .sidebar .post-navigation .nav-links,
+       .sidebar .format-image .entry-content {
+               padding-left: 20px;
+               padding-right: 20px;
+       }
+
+       #content .format-status .entry-content,
+       #content .format-status .entry-met {
+               padding-left: 0;
+               padding-right: 35px;
+       }
+
+       .menu-toggle:after {
+               padding-left: 0;
+               padding-right: 8px;
+       }
+
+       .toggled-on .nav-menu,
+       .toggled-on .nav-menu > ul {
+               margin-left: auto;
+               margin-right: 0;
+       }
+
+       .toggled-on .nav-menu li > ul {
+               margin-left: auto;
+               margin-right: 20px;
+               right: auto;
+       }
+
+       #content .featured-gallery {
+               padding-left: 0;
+               padding-right: 24px;
+       }
+
+       .gallery-columns-1 .gallery-item {
+               margin-left: 0;
+               margin-right: auto;
+       }
+
+       .comment-author {
+               margin-left: 30px;
+               margin-right: auto;
+       }
+
+       .format-audio .audio-content {
+               background: none;
+               float: none;
+               padding-left: 0;
+               padding-right: 0;
+       }
+
+       .gallery-columns-3 .gallery-item:nth-of-type(3n) {
+               margin-left: 4px;
+               margin-right: auto;
+       }
+}
+
+@media (max-width: 359px) {
+       .gallery {
+               margin-left: auto;
+               margin-right: 0;
+       }
+
+       .gallery .gallery-item:nth-of-type(even) {
+               margin-left: 0;
+               margin-right: auto;
+       }
+
+       .gallery .gallery-item,
+       .gallery.gallery-columns-3 .gallery-item:nth-of-type(even),
+       .gallery-columns-3 .gallery-item:nth-of-type(3n),
+       .gallery-columns-5 .gallery-item:nth-of-type(5n),
+       .gallery-columns-7 .gallery-item:nth-of-type(7n),
+       .gallery-columns-9 .gallery-item:nth-of-type(9n) {
+               margin-left: 4px;
+               margin-right: auto;
+       }
+
+       .comment-author .avatar {
+               margin-left: 5px;
+               margin-right: auto;
+       }
+}
+
+
+/**
+ * 9.0 Print
+ * ----------------------------------------------------------------------------
+ */
+
+@media print {
+       .entry-content img.alignleft,
+       .entry-content .wp-caption.alignleft {
+               margin-left: auto;
+               margin-right: 0;
+       }
+
+       .entry-content img.alignright,
+       .entry-content .wp-caption.alignright {
+               margin-left: 0;
+               margin-right: auto;
+       }
+}
\ No newline at end of file
diff --git a/wp-content/themes/twentythirteen/screenshot.png b/wp-content/themes/twentythirteen/screenshot.png
new file mode 100644 (file)
index 0000000..199c8d5
Binary files /dev/null and b/wp-content/themes/twentythirteen/screenshot.png differ
diff --git a/wp-content/themes/twentythirteen/search.php b/wp-content/themes/twentythirteen/search.php
new file mode 100644 (file)
index 0000000..7839def
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+/**
+ * The template for displaying Search Results pages.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+
+get_header(); ?>
+
+       <div id="primary" class="content-area">
+               <div id="content" class="site-content" role="main">
+
+               <?php if ( have_posts() ) : ?>
+
+                       <header class="page-header">
+                               <h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentythirteen' ), get_search_query() ); ?></h1>
+                       </header>
+
+                       <?php /* The loop */ ?>
+                       <?php while ( have_posts() ) : the_post(); ?>
+                               <?php get_template_part( 'content', get_post_format() ); ?>
+                       <?php endwhile; ?>
+
+                       <?php twentythirteen_paging_nav(); ?>
+
+               <?php else : ?>
+                       <?php get_template_part( 'content', 'none' ); ?>
+               <?php endif; ?>
+
+               </div><!-- #content -->
+       </div><!-- #primary -->
+
+<?php get_sidebar(); ?>
+<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentythirteen/sidebar-main.php b/wp-content/themes/twentythirteen/sidebar-main.php
new file mode 100644 (file)
index 0000000..bb6034c
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+/**
+ * The sidebar containing the footer widget area.
+ *
+ * If no active widgets in this sidebar, it will be hidden completely.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+
+if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
+       <div id="secondary" class="sidebar-container" role="complementary">
+               <div class="widget-area">
+                       <?php dynamic_sidebar( 'sidebar-1' ); ?>
+               </div><!-- .widget-area -->
+       </div><!-- #secondary -->
+<?php endif; ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentythirteen/sidebar.php b/wp-content/themes/twentythirteen/sidebar.php
new file mode 100644 (file)
index 0000000..750945c
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+/**
+ * The sidebar containing the secondary widget area, displays on posts and pages.
+ *
+ * If no active widgets in this sidebar, it will be hidden completely.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+
+if ( is_active_sidebar( 'sidebar-2' ) ) : ?>
+       <div id="tertiary" class="sidebar-container" role="complementary">
+               <div class="sidebar-inner">
+                       <div class="widget-area">
+                               <?php dynamic_sidebar( 'sidebar-2' ); ?>
+                       </div><!-- .widget-area -->
+               </div><!-- .sidebar-inner -->
+       </div><!-- #tertiary -->
+<?php endif; ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentythirteen/single.php b/wp-content/themes/twentythirteen/single.php
new file mode 100644 (file)
index 0000000..6901828
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+/**
+ * The Template for displaying all single posts.
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+
+get_header(); ?>
+
+       <div id="primary" class="content-area">
+               <div id="content" class="site-content" role="main">
+
+                       <?php /* The loop */ ?>
+                       <?php while ( have_posts() ) : the_post(); ?>
+
+                               <?php get_template_part( 'content', get_post_format() ); ?>
+                               <?php twentythirteen_post_nav(); ?>
+                               <?php comments_template(); ?>
+
+                       <?php endwhile; ?>
+
+               </div><!-- #content -->
+       </div><!-- #primary -->
+
+<?php get_sidebar(); ?>
+<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentythirteen/style.css b/wp-content/themes/twentythirteen/style.css
new file mode 100644 (file)
index 0000000..60d0416
--- /dev/null
@@ -0,0 +1,3121 @@
+/*
+Theme Name: Twenty Thirteen
+Theme URI: http://wordpress.org/themes/twentythirteen
+Author: the WordPress team
+Author URI: http://wordpress.org/
+Description: The 2013 theme for WordPress takes us back to the blog, featuring a full range of post formats, each displayed beautifully in their own unique way. Design details abound, starting with a vibrant color scheme and matching header images, beautiful typography and icons, and a flexible layout that looks great on any device, big or small.
+Version: 1.0
+License: GNU General Public License v2 or later
+License URI: http://www.gnu.org/licenses/gpl-2.0.html
+Tags: black, brown, orange, tan, white, yellow, light, one-column, two-columns, right-sidebar, flexible-width, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, translation-ready
+Text Domain: twentythirteen
+
+This theme, like WordPress, is licensed under the GPL.
+Use it to make something cool, have fun, and share what you've learned with others.
+*/
+
+
+/**
+ * Table of Contents:
+ *
+ * 1.0 - Reset
+ * 2.0 - Repeatable Patterns
+ * 3.0 - Basic Structure
+ * 4.0 - Header
+ *   4.1 - Site Header
+ *   4.2 - Navigation
+ * 5.0 - Content
+ *   5.1 - Entry Header
+ *   5.2 - Entry Meta
+ *   5.3 - Entry Content
+ *   5.4 - Galleries
+ *   5.5 - Post Formats
+ *   5.6 - Attachments
+ *   5.7 - Post/Paging Navigation
+ *   5.8 - Author Bio
+ *   5.9 - Archives
+ *   5.10 - Search Results/No posts
+ *   5.11 - 404
+ *   5.12 - Comments
+ *   5.13 - Multisite
+ * 6.0 - Sidebar
+ *   6.1 - Widgets
+ * 7.0 - Footer
+ * 8.0 - Media Queries
+ * 9.0 - Print
+ * ----------------------------------------------------------------------------
+ */
+
+
+/**
+ * 1.0 Reset
+ *
+ * Modified from Normalize.css to provide cross-browser consistency and a smart
+ * default styling of HTML elements.
+ *
+ * @see http://git.io/normalize
+ * ----------------------------------------------------------------------------
+ */
+
+* {
+       -webkit-box-sizing: border-box;
+       -moz-box-sizing:    border-box;
+       box-sizing:         border-box;
+}
+
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+nav,
+section,
+summary {
+       display: block;
+}
+
+audio,
+canvas,
+video {
+       display: inline-block;
+}
+
+audio:not([controls]) {
+       display: none;
+       height: 0;
+}
+
+[hidden] {
+       display: none;
+}
+
+html {
+       font-size: 100%;
+       overflow-y: scroll;
+       -webkit-text-size-adjust: 100%;
+       -ms-text-size-adjust: 100%;
+}
+
+html,
+button,
+input,
+select,
+textarea {
+       font-family: "Source Sans Pro", Helvetica, sans-serif;
+}
+
+body {
+       color: #141412;
+       line-height: 1.5;
+       margin: 0;
+}
+
+a {
+       color: #ca3c08;
+       text-decoration: none;
+}
+
+a:visited {
+       color: #ac0404;
+}
+
+a:focus {
+       outline: thin dotted;
+}
+
+a:active,
+a:hover {
+       color: #ea9629;
+       outline: 0;
+}
+
+a:hover {
+       text-decoration: underline;
+}
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+       clear: both;
+       font-family: Bitter, Georgia, serif;
+       line-height: 1.3;
+}
+
+h1 {
+       font-size: 48px;
+       margin: 33px 0;
+}
+
+h2 {
+       font-size: 30px;
+       margin: 25px 0;
+}
+
+h3 {
+       font-size: 22px;
+       margin: 22px 0;
+}
+
+h4 {
+       font-size: 20px;
+       margin: 25px 0;
+}
+
+h5 {
+       font-size: 18px;
+       margin: 30px 0;
+}
+
+h6 {
+       font-size: 16px;
+       margin: 36px 0;
+}
+
+address {
+       font-style: italic;
+       margin: 0 0 24px;
+}
+
+abbr[title] {
+       border-bottom: 1px dotted;
+}
+
+b,
+strong {
+       font-weight: bold;
+}
+
+dfn {
+       font-style: italic;
+}
+
+mark {
+       background: #ff0;
+       color: #000;
+}
+
+p {
+       margin: 0 0 24px;
+}
+
+code,
+kbd,
+pre,
+samp {
+       font-family: monospace, serif;
+       font-size: 14px;
+       -webkit-hyphens: none;
+       -moz-hyphens:    none;
+       -ms-hyphens:     none;
+       hyphens:         none;
+}
+
+pre {
+       background: #f5f5f5;
+       color: #666;
+       font-family: monospace;
+       font-size: 14px;
+       margin: 20px 0;
+       overflow: auto;
+       padding: 20px;
+       white-space: pre;
+       white-space: pre-wrap;
+       word-wrap: break-word;
+}
+
+blockquote,
+q {
+       -webkit-hyphens: none;
+       -moz-hyphens:    none;
+       -ms-hyphens:     none;
+       hyphens:         none;
+       quotes: none;
+}
+
+blockquote:before,
+blockquote:after,
+q:before,
+q:after {
+       content: "";
+       content: none;
+}
+
+blockquote {
+       font-size: 18px;
+       font-style: italic;
+       font-weight: 300;
+       margin: 24px 40px;
+}
+
+blockquote blockquote {
+       margin-right: 0;
+}
+
+blockquote cite,
+blockquote small {
+       font-size: 14px;
+       font-weight: normal;
+       text-transform: uppercase;
+}
+
+blockquote em,
+blockquote i {
+       font-style: normal;
+       font-weight: 300;
+}
+
+blockquote strong,
+blockquote b {
+       font-weight: 400;
+}
+
+small {
+       font-size: smaller;
+}
+
+sub,
+sup {
+       font-size: 75%;
+       line-height: 0;
+       position: relative;
+       vertical-align: baseline;
+}
+
+sup {
+       top: -0.5em;
+}
+
+sub {
+       bottom: -0.25em;
+}
+
+dl {
+       margin: 0 20px;
+}
+
+dt {
+       font-weight: bold;
+}
+
+dd {
+       margin: 0 0 20px;
+}
+
+menu,
+ol,
+ul {
+       margin: 16px 0;
+       padding: 0 0 0 40px;
+}
+
+ul {
+       list-style-type: square;
+}
+
+nav ul,
+nav ol {
+       list-style: none;
+       list-style-image: none;
+}
+
+li > ul,
+li > ol {
+       margin: 0;
+}
+
+img {
+       -ms-interpolation-mode: bicubic;
+       border: 0;
+       vertical-align: middle;
+}
+
+svg:not(:root) {
+       overflow: hidden;
+}
+
+figure {
+       margin: 0;
+}
+
+form {
+       margin: 0;
+}
+
+fieldset {
+       border: 1px solid #c0c0c0;
+       margin: 0 2px;
+       padding: 0.35em 0.625em 0.75em;
+}
+
+legend {
+       border: 0;
+       padding: 0;
+       white-space: normal;
+}
+
+button,
+input,
+select,
+textarea {
+       font-size: 100%;
+       margin: 0;
+       max-width: 100%;
+       vertical-align: baseline;
+}
+
+button,
+input {
+       line-height: normal;
+}
+
+button,
+html input[type="button"],
+input[type="reset"],
+input[type="submit"] {
+       -webkit-appearance: button;
+       cursor: pointer;
+}
+
+button[disabled],
+input[disabled] {
+       cursor: default;
+}
+
+input[type="checkbox"],
+input[type="radio"] {
+       padding: 0;
+}
+
+input[type="search"] {
+       -webkit-appearance: textfield;
+       padding-right: 2px; /* Don't cut off the webkit search cancel button */
+       width: 270px;
+}
+
+input[type="search"]::-webkit-search-decoration {
+       -webkit-appearance: none;
+}
+
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+       border: 0;
+       padding: 0;
+}
+
+textarea {
+       overflow: auto;
+       vertical-align: top;
+}
+
+table {
+       border-bottom: 1px solid #ededed;
+       border-collapse: collapse;
+       border-spacing: 0;
+       font-size: 14px;
+       line-height: 2;
+       margin: 0 0 20px;
+       width: 100%;
+}
+
+caption,
+th,
+td {
+       font-weight: normal;
+       text-align: left;
+}
+
+caption {
+       font-size: 16px;
+       margin: 20px 0;
+}
+
+th {
+       font-weight: bold;
+       text-transform: uppercase;
+}
+
+td {
+       border-top: 1px solid #ededed;
+       padding: 6px 10px 6px 0;
+}
+
+del {
+       color: #333;
+}
+
+ins {
+       background: #fff9c0;
+       text-decoration: none;
+}
+
+hr {
+       background: url(images/dotted-line.png) repeat center top;
+       background-size: 4px 4px;
+       border: 0;
+       height: 1px;
+       margin: 0 0 24px;
+}
+
+
+/**
+ * 2.0 Repeatable Patterns
+ * ----------------------------------------------------------------------------
+ */
+
+.genericon:before,
+.menu-toggle:after,
+.featured-post:before,
+.date a:before,
+.entry-meta .author a:before,
+.format-audio .entry-content:before,
+.comments-link a:before,
+.tags-links a:first-child:before,
+.categories-links a:first-child:before,
+.edit-link a:before,
+.attachment .entry-title:before,
+.attachment-meta:before,
+.attachment-meta a:before,
+.comment-awaiting-moderation:before,
+.comment-reply-link:before,
+.comment-reply-login:before,
+.comment-reply-title small a:before,
+.bypostauthor > .comment-body .fn:before,
+.error404 .page-title:before {
+       -webkit-font-smoothing: antialiased;
+       display: inline-block;
+       font: normal 16px/1 Genericons;
+       vertical-align: text-bottom;
+}
+
+/* Clearing floats */
+.clear:after,
+.attachment .entry-header:after,
+.site-footer .widget-area:after,
+.entry-content:after,
+.page-content:after,
+.navigation:after,
+.nav-links:after,
+.gallery:after,
+.comment-form-author:after,
+.comment-form-email:after,
+.comment-form-url:after,
+.comment-body:after {
+       clear: both;
+}
+
+.clear:before,
+.clear:after,
+.attachment .entry-header:before,
+.attachment .entry-header:after,
+.site-footer .widget-area:before,
+.site-footer .widget-area:after,
+.entry-content:before,
+.entry-content:after,
+.page-content:before,
+.page-content:after,
+.navigation:before,
+.navigation:after,
+.nav-links:before,
+.nav-links:after,
+.gallery:before,
+.gallery:after,
+.comment-form-author:before,
+.comment-form-author:after,
+.comment-form-email:before,
+.comment-form-email:after,
+.comment-form-url:before,
+.comment-form-url:after,
+.comment-body:before,
+.comment-body:after {
+       content: "";
+       display: table;
+}
+
+/* Assistive text */
+.screen-reader-text {
+       clip: rect(1px, 1px, 1px, 1px);
+       position: absolute !important;
+}
+
+.screen-reader-text:focus {
+       background-color: #f1f1f1;
+       border-radius: 3px;
+       box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
+       clip: auto !important;
+       color: #21759b;
+       display: block;
+       font-size: 14px;
+       font-weight: bold;
+       height: auto;
+       line-height: normal;
+       padding: 15px 23px 14px;
+       position: absolute;
+       left: 5px;
+       top: 5px;
+       text-decoration: none;
+       width: auto;
+       z-index: 100000; /* Above WP toolbar */
+}
+
+/* Form fields, general styles first. */
+button,
+input,
+textarea {
+       border: 2px solid #d4d0ba;
+       font-family: inherit;
+       padding: 5px;
+}
+
+input,
+textarea {
+       color: #141412;
+}
+
+input:focus,
+textarea:focus {
+       border: 2px solid #c3c0ab;
+       outline: 0;
+}
+
+/* Buttons */
+button,
+input[type="submit"],
+input[type="button"],
+input[type="reset"] {
+       background: #e05d22; /* Old browsers */
+       background: -webkit-linear-gradient(top, #e05d22 0%, #d94412 100%); /* Chrome 10+, Safari 5.1+ */
+       background:   linear-gradient(to bottom, #e05d22 0%, #d94412 100%); /* W3C */
+       border: none;
+       border-bottom: 3px solid #b93207;
+       border-radius: 2px;
+       color: #fff;
+       display: inline-block;
+       padding: 11px 24px 10px;
+       text-decoration: none;
+}
+
+button:hover,
+button:focus,
+input[type="submit"]:hover,
+input[type="button"]:hover,
+input[type="reset"]:hover,
+input[type="submit"]:focus,
+input[type="button"]:focus,
+input[type="reset"]:focus {
+       background: #ed6a31; /* Old browsers */
+       background: -webkit-linear-gradient(top, #ed6a31 0%, #e55627 100%); /* Chrome 10+, Safari 5.1+ */
+       background:   linear-gradient(to bottom, #ed6a31 0%, #e55627 100%); /* W3C */
+       outline: none;
+}
+
+button:active,
+input[type="submit"]:active,
+input[type="button"]:active,
+input[type="reset"]:active {
+       background: #d94412; /* Old browsers */
+       background: -webkit-linear-gradient(top, #d94412 0%, #e05d22 100%); /* Chrome 10+, Safari 5.1+ */
+       background:   linear-gradient(to bottom, #d94412 0%, #e05d22 100%); /* W3C */
+       border: none;
+       border-top: 3px solid #b93207;
+       padding: 10px 24px 11px;
+}
+
+.post-password-required input[type="submit"] {
+       padding: 7px 24px 4px;
+       vertical-align: bottom;
+}
+
+.post-password-required input[type="submit"]:active {
+       padding: 5px 24px 6px;
+}
+
+/* Placeholder text color -- selectors need to be separate to work. */
+::-webkit-input-placeholder {
+       color: #7d7b6d;
+}
+
+:-moz-placeholder {
+       color: #7d7b6d;
+}
+
+::-moz-placeholder {
+       color: #7d7b6d;
+}
+
+:-ms-input-placeholder {
+       color: #7d7b6d;
+}
+
+/*
+ * Responsive images
+ *
+ * Fluid images for posts, comments, and widgets
+ */
+.entry-content img,
+.entry-summary img,
+.comment-content img,
+.widget img,
+.wp-caption {
+       max-width: 100%;
+}
+
+/* Make sure images with WordPress-added height and width attributes are scaled correctly. */
+.entry-content img,
+.entry-summary img,
+.comment-content img[height],
+img[class*="align"],
+img[class*="wp-image-"],
+img[class*="attachment-"] {
+       height: auto;
+}
+
+img.size-full,
+img.size-large,
+img.wp-post-image {
+       height: auto;
+       max-width: 100%;
+}
+
+/* Make sure videos and embeds fit their containers. */
+embed,
+iframe,
+object,
+video {
+       max-width: 100%;
+}
+
+/* Override the Twitter embed fixed width. */
+.entry-content .twitter-tweet-rendered {
+       max-width: 100% !important;
+}
+
+/* Images */
+.alignleft {
+       float: left;
+}
+
+.alignright {
+       float: right;
+}
+
+.aligncenter {
+       display: block;
+       margin-left: auto;
+       margin-right: auto;
+}
+
+img.alignleft {
+       margin: 5px 20px 5px 0;
+}
+
+.wp-caption.alignleft {
+       margin: 5px 10px 5px 0;
+}
+
+img.alignright {
+       margin: 5px 0 5px 20px;
+}
+
+.wp-caption.alignright {
+       margin: 5px 0 5px 10px;
+}
+
+img.aligncenter {
+       margin: 5px auto;
+}
+
+img.alignnone {
+       margin: 5px 0;
+}
+
+.wp-caption .wp-caption-text,
+.entry-caption,
+.gallery-caption {
+       color: #220e10;
+       font-size: 18px;
+       font-style: italic;
+       font-weight: 300;
+}
+
+img.wp-smiley,
+.rsswidget img {
+       border: 0;
+       border-radius: 0;
+       box-shadow: none;
+       margin-bottom: 0;
+       margin-top: 0;
+       padding: 0;
+}
+
+.wp-caption.alignleft + ul,
+.wp-caption.alignleft + ol  {
+       list-style-position: inside;
+}
+
+
+/**
+ * 3.0 Basic Structure
+ * ----------------------------------------------------------------------------
+ */
+
+.site {
+       background-color: #fff;
+       border-left: 1px solid #f2f2f2;
+       border-right: 1px solid #f2f2f2;
+       margin: 0 auto;
+       max-width: 1600px;
+       width: 100%;
+}
+
+.site-main {
+       position: relative;
+}
+
+.site-main .sidebar-container {
+       height: 0;
+       position: absolute;
+       top: 40px;
+       width: 100%;
+       z-index: 1;
+}
+
+.site-main .sidebar-inner {
+       margin: 0 auto;
+       max-width: 1040px;
+}
+
+
+/**
+ * 4.0 Header
+ * ----------------------------------------------------------------------------
+ */
+
+/**
+ * 4.1 Site Header
+ * ----------------------------------------------------------------------------
+ */
+
+.site-header {
+       position: relative;
+}
+
+.site-header .home-link {
+       color: #141412;
+       display: block;
+       margin: 0 auto;
+       max-width: 1080px;
+       min-height: 230px;
+       padding: 0 20px;
+       text-decoration: none;
+       width: 100%;
+}
+
+.site-header .site-title:hover {
+       text-decoration: underline;
+}
+
+.site-title {
+       font-size: 60px;
+       font-weight: bold;
+       line-height: 1;
+       margin: 0;
+       padding: 58px 0 10px;
+}
+
+.site-description {
+       font: 300 italic 24px "Source Sans Pro", Helvetica, sans-serif;
+       margin: 0;
+}
+
+
+/**
+ * 4.2 Navigation
+ * ----------------------------------------------------------------------------
+ */
+
+.main-navigation {
+       clear: both;
+       margin: 0 auto;
+       max-width: 1080px;
+       min-height: 45px;
+       position: relative;
+}
+
+ul.nav-menu,
+div.nav-menu > ul {
+       margin: 0;
+       padding: 0 40px 0 0;
+}
+
+.nav-menu li {
+       display: inline-block;
+       position: relative;
+}
+
+.nav-menu li a {
+       color: #141412;
+       display: block;
+       font-size: 15px;
+       line-height: 1;
+       padding: 15px 20px;
+       text-decoration: none;
+}
+
+.nav-menu li:hover > a,
+.nav-menu li a:hover {
+       background-color: #220e10;
+       color: #fff;
+}
+
+.nav-menu .sub-menu,
+.nav-menu .children {
+       background-color: #220e10;
+       border: 2px solid #f7f5e7;
+       border-top: 0;
+       display: none;
+       padding: 0;
+       position: absolute;
+       left: -2px;
+       z-index: 99999;
+}
+
+.nav-menu .sub-menu ul,
+.nav-menu .children ul {
+       border-left: 0;
+       left: 100%;
+       top: 0;
+}
+
+ul.nav-menu ul a,
+.nav-menu ul ul a {
+       color: #fff;
+       margin: 0;
+       width: 200px;
+}
+
+ul.nav-menu ul a:hover,
+.nav-menu ul ul a:hover {
+       background-color: #db572f;
+}
+
+ul.nav-menu li:hover > ul,
+.nav-menu ul li:hover > ul {
+       display: block;
+}
+
+.nav-menu .current_page_item > a,
+.nav-menu .current_page_ancestor > a,
+.nav-menu .current-menu-item > a,
+.nav-menu .current-menu-ancestor > a {
+       color: #bc360a;
+       font-style: italic;
+}
+
+.menu-toggle {
+       display: none;
+}
+
+/* Navbar */
+.navbar {
+       background-color: #f7f5e7;
+       margin: 0 auto;
+       max-width: 1600px;
+       width: 100%;
+}
+
+.site-header .search-form {
+       position: absolute;
+       right: 20px;
+       top: 1px;
+}
+
+.site-header .search-field {
+       background-color: transparent;
+       background-image: url(images/search-icon.png);
+       background-position: 5px center;
+       background-repeat: no-repeat;
+       background-size: 24px 24px;
+       border: none;
+       cursor: pointer;
+       height: 37px;
+       margin: 3px 0;
+       padding: 0 0 0 34px;
+       position: relative;
+       -webkit-transition: width 400ms ease, background 400ms ease;
+       transition:         width 400ms ease, background 400ms ease;
+       width: 0;
+}
+
+.site-header .search-field:focus {
+       background-color: #fff;
+       border: 2px solid #c3c0ab;
+       cursor: text;
+       outline: 0;
+       width: 230px;
+}
+
+
+/**
+ * 5.0 Content
+ * ----------------------------------------------------------------------------
+ */
+
+.hentry {
+       padding: 40px 0;
+}
+
+.entry-header,
+.entry-content,
+.entry-summary,
+.entry-meta {
+       margin: 0 auto;
+       max-width: 604px;
+       width: 100%;
+}
+
+.sidebar .entry-header,
+.sidebar .entry-content,
+.sidebar .entry-summary,
+.sidebar .entry-meta {
+       max-width: 1040px;
+       padding: 0 376px 0 60px;
+}
+
+
+/**
+ * 5.1 Entry Header
+ * ----------------------------------------------------------------------------
+ */
+
+.sidebar .entry-header .entry-meta {
+       padding: 0;
+}
+
+.entry-thumbnail img {
+       display: block;
+       margin: 0 auto 10px;
+}
+
+.entry-header {
+       margin-bottom: 30px;
+}
+
+.entry-title {
+       font-weight: normal;
+       margin: 0 0 5px;
+}
+
+.entry-title a {
+       color: #141412;
+}
+
+.entry-title a:hover {
+       color: #ea9629;
+}
+
+
+/**
+ * 5.2 Entry Meta
+ * ----------------------------------------------------------------------------
+ */
+
+.entry-meta {
+       clear: both;
+       font-size: 14px;
+}
+
+.entry-meta a {
+       color: #bc360a;
+}
+
+.entry-meta a:hover {
+       color: #bc360a;
+}
+
+.entry-meta > span {
+       margin-right: 20px;
+}
+
+.entry-meta > span:last-child {
+       margin-right: 0;
+}
+
+.featured-post:before {
+       content: "\f308";
+       margin-right: 2px;
+}
+
+.entry-meta .date a:before {
+       content: "\f303";
+}
+
+.comments-link a:before {
+       content: "\f300";
+       margin-right: 2px;
+       position: relative;
+       top: -1px;
+}
+
+.entry-meta .author a:before {
+       content: "\f304";
+       position: relative;
+       top: -1px;
+}
+
+.categories-links a:first-child:before {
+       content: "\f301";
+}
+
+.tags-links a:first-child:before {
+       content: "\f302";
+       position: relative;
+       top: -1px;
+}
+
+.edit-link a:before {
+       content: "\f411";
+       position: relative;
+       top: -1px;
+}
+
+.single-author .entry-meta .author,
+.sticky.format-standard .entry-meta .date,
+.sticky.format-audio .entry-meta .date,
+.sticky.format-chat .entry-meta .date,
+.sticky.format-image .entry-meta .date,
+.sticky.format-gallery .entry-meta .date {
+       display: none;
+}
+
+
+/**
+ * 5.3 Entry Content
+ * ----------------------------------------------------------------------------
+ */
+
+.entry-content {
+       -webkit-hyphens: auto;
+       -moz-hyphens:    auto;
+       -ms-hyphens:     auto;
+       hyphens:         auto;
+       word-wrap: break-word;
+}
+
+.entry-content a,
+.comment-content a {
+       color: #bc360a;
+}
+
+.entry-content a:hover,
+.comment-content a:hover {
+       color: #ea9629;
+}
+
+.entry-content blockquote {
+       font-size: 24px;
+}
+
+.entry-content blockquote cite,
+.entry-content blockquote small {
+       font-size: 16px;
+}
+
+.entry-content img.alignleft,
+.entry-content .wp-caption.alignleft {
+       margin-left: -60px;
+}
+
+.entry-content img.alignright,
+.entry-content .wp-caption.alignright {
+       margin-right: -60px;
+}
+
+footer.entry-meta {
+       margin-top: 24px;
+}
+
+.format-standard footer.entry-meta {
+       margin-top: 0;
+}
+
+/* Page links */
+.page-links {
+       clear: both;
+       font-size: 16px;
+       font-style: italic;
+       font-weight: normal;
+       line-height: 2.2;
+       margin: 20px 0;
+       text-transform: uppercase;
+}
+
+.page-links a,
+.page-links > span {
+       background: #fff;
+       border: 1px solid #fff;
+       padding: 5px 10px;
+       text-decoration: none;
+}
+
+.format-status .entry-content .page-links a,
+.format-gallery .entry-content .page-links a,
+.format-chat .entry-content .page-links a,
+.format-quote .entry-content .page-links a,
+.page-links a {
+       background: #e63f2a;
+       border: 1px solid #e63f2a;
+       color: #fff;
+}
+
+.format-gallery .entry-content .page-links a:hover,
+.format-audio .entry-content .page-links a:hover,
+.format-status .entry-content .page-links a:hover,
+.format-video .entry-content .page-links a:hover,
+.format-chat .entry-content .page-links a:hover,
+.format-quote .entry-content .page-links a:hover,
+.page-links a:hover {
+       background: #fff;
+       color: #e63f2a;
+}
+
+.format-status .entry-content .page-links > span,
+.format-quote .entry-content .page-links > span {
+       background: none;
+}
+
+.page-links .page-links-title {
+       background: transparent;
+       border: none;
+       margin-right: 20px;
+       padding: 0;
+}
+
+/* Mediaelements */
+.hentry .mejs-mediaelement,
+.hentry .mejs-container .mejs-controls {
+       background: #220e10;
+}
+
+.hentry .mejs-controls .mejs-time-rail .mejs-time-loaded,
+.hentry .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current {
+       background: #fff;
+}
+
+.hentry .mejs-controls .mejs-time-rail .mejs-time-current {
+       background: #ea9629;
+}
+
+.hentry .mejs-controls .mejs-time-rail .mejs-time-total,
+.hentry .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total {
+       background: #595959;
+}
+
+.hentry .mejs-controls .mejs-time-rail span,
+.hentry .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total,
+.hentry .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current {
+       border-radius: 0;
+}
+
+
+/**
+ * 5.4 Galleries
+ * ----------------------------------------------------------------------------
+ */
+
+.gallery {
+       margin-bottom: 20px;
+       margin-left: -4px;
+}
+
+.gallery-item {
+       float: left;
+       margin: 0 4px 4px 0;
+       overflow: hidden;
+       position: relative;
+}
+
+.gallery-columns-1.gallery-size-medium,
+.gallery-columns-1.gallery-size-thumbnail,
+.gallery-columns-2.gallery-size-thumbnail,
+.gallery-columns-3.gallery-size-thumbnail {
+       display: table;
+       margin: 0 auto 20px;
+}
+
+.gallery-columns-1 .gallery-item,
+.gallery-columns-2 .gallery-item,
+.gallery-columns-3 .gallery-item {
+       text-align: center;
+}
+
+.gallery-columns-4 .gallery-item {
+       max-width: 23%;
+       max-width: -webkit-calc(25% - 4px);
+       max-width:         calc(25% - 4px);
+}
+
+.gallery-columns-5 .gallery-item {
+       max-width: 19%;
+       max-width: -webkit-calc(20% - 4px);
+       max-width:         calc(20% - 4px);
+}
+
+.gallery-columns-6 .gallery-item {
+       max-width: 15%;
+       max-width: -webkit-calc(16.7% - 4px);
+       max-width:         calc(16.7% - 4px);
+}
+
+.gallery-columns-7 .gallery-item {
+       max-width: 13%;
+       max-width: -webkit-calc(14.28% - 4px);
+       max-width:         calc(14.28% - 4px);
+}
+
+.gallery-columns-8 .gallery-item {
+       max-width: 11%;
+       max-width: -webkit-calc(12.5% - 4px);
+       max-width:         calc(12.5% - 4px);
+}
+
+.gallery-columns-9 .gallery-item {
+       max-width: 9%;
+       max-width: -webkit-calc(11.1% - 4px);
+       max-width:         calc(11.1% - 4px);
+}
+
+.gallery-columns-1 .gallery-item:nth-of-type(1n),
+.gallery-columns-2 .gallery-item:nth-of-type(2n),
+.gallery-columns-3 .gallery-item:nth-of-type(3n),
+.gallery-columns-4 .gallery-item:nth-of-type(4n),
+.gallery-columns-5 .gallery-item:nth-of-type(5n),
+.gallery-columns-6 .gallery-item:nth-of-type(6n),
+.gallery-columns-7 .gallery-item:nth-of-type(7n),
+.gallery-columns-8 .gallery-item:nth-of-type(8n),
+.gallery-columns-9 .gallery-item:nth-of-type(9n) {
+       margin-right: 0;
+}
+
+.gallery-caption {
+       background-color: rgba(0, 0, 0, 0.7);
+       box-sizing: border-box;
+       color: #fff;
+       font-size: 14px;
+       line-height: 1.3;
+       margin: 0;
+       max-height: 50%;
+       opacity: 0;
+       padding: 2px 8px;
+       position: absolute;
+       bottom: 0;
+       left: 0;
+       text-align: left;
+       -webkit-transition: opacity 400ms ease;
+       transition:         opacity 400ms ease;
+       width: 100%;
+}
+
+.gallery-caption:before {
+       box-shadow: 0 -10px 15px #000 inset;
+       content: "";
+       height: 100%;
+       min-height: 49px;
+       position: absolute;
+       left: 0;
+       top: 0;
+       width: 100%;
+}
+
+.gallery-item:hover .gallery-caption {
+       opacity: 1;
+}
+
+.gallery-columns-7 .gallery-caption,
+.gallery-columns-8 .gallery-caption,
+.gallery-columns-9 .gallery-caption {
+       display: none;
+}
+
+
+/**
+ * 5.5 Post Formats
+ * ----------------------------------------------------------------------------
+ */
+
+/* Aside */
+.format-aside {
+       background-color: #f7f5e7;
+}
+
+.blog .format-aside:first-of-type,
+.single .format-aside:first-of-type,
+.format-aside + .format-aside,
+.format-aside + .format-link,
+.format-link + .format-aside {
+       box-shadow: inset 0 2px 2px rgba(173, 165, 105, 0.2);
+}
+
+.format-aside .entry-meta {
+       margin-top: 0;
+}
+
+.format-aside blockquote {
+       font-size: 100%;
+       font-weight: normal;
+}
+
+.format-aside cite {
+       font-size: 100%;
+       text-transform: none;
+}
+
+.format-aside cite:before {
+       content: "\2014";
+       margin-right: 5px;
+}
+
+/* Audio */
+.format-audio {
+       background-color: #db572f;
+}
+
+.format-audio .entry-title {
+       font-size: 28px;
+       font-weight: bold;
+}
+
+.format-audio .entry-content:before {
+       content: "\f109";
+       float: left;
+       font-size: 64px;
+       position: relative;
+       top: 4px;
+}
+
+.format-audio .entry-content a,
+.format-audio .entry-meta a,
+.format-audio .entry-content a:hover,
+.format-audio .entry-meta a:hover {
+       color: #fbfaf3;
+}
+
+.format-audio .audio-content {
+       background: url(images/dotted-line.png) repeat-y left top;
+       background-size: 4px 4px;
+       float: right;
+       padding-left: 35px;
+       width: 80%;
+       width: -webkit-calc(100% - 85px);
+       width:         calc(100% - 85px);
+}
+
+.format-audio .wp-audio-shortcode {
+       height: 30px !important; /* Override mediaelement.js style */
+       margin: 20px 0;
+       max-width: 400px !important; /* Override mediaelement.js style */
+}
+
+.format-audio audio {
+       max-width: 100% !important; /* Avoid player width overflow. */
+}
+
+/* Chat */
+.format-chat {
+       background-color: #eadaa6;
+}
+
+.format-chat .entry-title {
+       font-size: 28px;
+       font-weight: bold;
+}
+
+.format-chat .entry-meta a,
+.format-chat .entry-content a {
+       color: #722d19;
+}
+
+.format-chat .entry-meta .date a:before {
+       content: "\f108";
+       margin-right: 2px;
+}
+
+.format-chat .entry-meta .author {
+       display: none;
+}
+
+.format-chat .chat {
+       margin: 0;
+}
+
+.format-chat .chat .chat-timestamp {
+       color: #722d19;
+       float: right;
+       font-size: 12px;
+       font-weight: normal;
+       margin: 5px 10px 0;
+}
+
+.format-chat .chat .fn {
+       font-style: normal;
+}
+
+/* Gallery */
+.format-gallery {
+       background-color: #fbca3c;
+}
+
+.format-gallery .entry-header {
+       margin-bottom: 15px;
+}
+
+.format-gallery .entry-title {
+       font-size: 50px;
+       font-weight: 400;
+       margin: 0;
+}
+
+.format-gallery .entry-meta a,
+.format-gallery .entry-content a {
+       color: #722d19;
+}
+
+/* Image */
+.format-image .entry-title {
+       font-size: 28px;
+       font-weight: bold;
+}
+
+.format-image .categories-links,
+.format-image .tags-links {
+       display: none;
+}
+
+/* Link */
+.format-link {
+       background-color: #f7f5e7;
+}
+
+.blog .format-link:first-of-type,
+.single .format-link:first-of-type {
+       box-shadow: inset 0 2px 2px rgba(173, 165, 105, 0.2);
+}
+
+.format-link .entry-header,
+.format-link .entry-content p:last-child {
+       margin-bottom: 0;
+}
+
+.format-link .entry-title {
+       color: #ca3c08;
+       display: inline;
+       font: 300 italic 20px "Source Sans Pro", Helvetica, sans-serif;
+       margin-right: 20px;
+}
+
+.format-link .entry-title a {
+       color: #bc360a;
+}
+
+.format-link div.entry-meta {
+       display: inline;
+}
+
+/* Quote */
+.format-quote {
+       background-color: #210d10;
+}
+
+.format-quote .entry-content,
+.format-quote .entry-meta {
+       color: #f7f5e7;
+}
+
+.format-quote .entry-content blockquote {
+       font-size: 28px;
+       margin: 0;
+}
+
+.format-quote .entry-content a,
+.format-quote .entry-meta a,
+.format-quote .linked {
+       color: #e63f2a;
+}
+
+.format-quote .entry-content cite a {
+       border-bottom: 1px dotted #fff;
+       color: #fff;
+}
+
+.format-quote .entry-content cite a:hover {
+       text-decoration: none;
+}
+
+.format-quote blockquote small,
+.format-quote blockquote cite {
+       display: block;
+       font-size: 16px;
+}
+
+.format-quote blockquote {
+       font-style: italic;
+       font-weight: 300;
+       padding-left: 75px;
+       position: relative;
+}
+
+.format-quote blockquote:before {
+       content: '\201C';
+       font-size: 140px;
+       font-weight: 400;
+       line-height: .8;
+       padding-right: 25px;
+       position: absolute;
+       left: -15px;
+       top: -3px;
+}
+
+.format-quote .entry-meta .author {
+       display: none;
+}
+
+/* Status */
+.format-status {
+       background-color: #722d19;
+       padding: 0;
+}
+
+.format-status .entry-content,
+.format-status .entry-meta {
+       padding-left: 35px;
+       position: relative;
+}
+
+.format-status .entry-content a {
+       color: #eadaa6;
+}
+
+.format-status .entry-meta a {
+       color: #f7f5e7;
+}
+
+.sidebar .format-status .entry-content,
+.sidebar .format-status .entry-meta {
+       padding-left: 95px;
+}
+
+.format-status .entry-content:before,
+.format-status .entry-meta:before {
+       background: url(images/dotted-line.png) repeat-y left bottom;
+       background-size: 4px 4px;
+       content: "";
+       display: block;
+       height: 100%;
+       position: absolute;
+       left: 10px;
+       top: 0;
+       width: 1px;
+}
+
+.sidebar .format-status .entry-content:before,
+.sidebar .format-status .entry-meta:before {
+       left: 70px;
+}
+
+.format-status .categories-links,
+.format-status .tags-links {
+       display: none;
+}
+
+/* Ensures the dots in the dot background are in lockstep. */
+.format-status .entry-meta:before {
+       background-position: left top;
+}
+
+.format-status .entry-content {
+       color: #f7f5e7;
+       font-size: 24px;
+       font-style: italic;
+       font-weight: 300;
+       padding-bottom: 30px;
+       padding-top: 40px;
+       position: relative;
+}
+
+.format-status .entry-content p:first-child:before {
+       background-color: rgba(0, 0, 0, 0.65);
+       content: "";
+       height: 3px;
+       margin-top: 13px;
+       position: absolute;
+       left: 4px;
+       width: 13px;
+}
+
+.sidebar .format-status .entry-content > p:first-child:before {
+       left: 64px;
+}
+
+.format-status .entry-content p:last-child {
+       margin-bottom: 0;
+}
+
+.format-status .entry-meta {
+       margin-top: 0;
+       padding-bottom: 40px;
+}
+
+.format-status .entry-meta .date a:before {
+       content: "\f105";
+}
+
+/* Video */
+.format-video {
+       background-color: #db572f;
+}
+
+.format-video .entry-content a,
+.format-video .entry-meta a,
+.format-video .entry-content a:hover,
+.format-video .entry-meta a:hover {
+       color: #fbfaf3;
+}
+
+.format-video .entry-title {
+       font-size: 50px;
+       font-weight: 400;
+}
+
+.format-video .entry-meta {
+       color: #220e10;
+}
+
+
+/**
+ * 5.6 Attachments
+ * ----------------------------------------------------------------------------
+ */
+
+.attachment .hentry {
+       background-color: #e8e5ce;
+       margin: 0;
+       padding: 0;
+}
+
+.attachment .entry-header {
+       margin-bottom: 0;
+       max-width: 1040px;
+       padding: 30px 0;
+}
+
+.attachment .entry-title {
+       display: inline-block;
+       float: left;
+       font: 300 italic 30px "Source Sans Pro", Helvetica, sans-serif;
+       margin: 0;
+}
+
+.attachment .entry-title:before {
+       content: "\f416";
+       font-size: 32px;
+       margin-right: 10px;
+}
+
+.attachment .entry-meta {
+       clear: none;
+       color: inherit;
+       float: right;
+       max-width: 604px;
+       padding: 9px 0 0;
+       text-align: right;
+}
+
+.hentry.attachment:not(.image-attachment) .entry-meta {
+       max-width: 104px;
+}
+
+.attachment footer.entry-meta,
+.single-attachment .site-main .sidebar-container {
+       display: none;
+}
+
+.attachment-meta:before {
+       content: "\f307";
+}
+
+.full-size-link a:before {
+       content: "\f402";
+}
+
+.full-size-link:before {
+       content: none;
+}
+
+.attachment .entry-meta a,
+.attachment .entry-meta .edit-link:before,
+.attachment .full-size-link:before {
+       color: #ca3c08;
+}
+
+.attachment .entry-content {
+       background-color: #fff;
+       max-width: 100%;
+       padding: 40px 0;
+}
+
+.image-navigation {
+       margin: 0 auto;
+       max-width: 1040px;
+       position: relative;
+}
+
+.image-navigation a:hover {
+       text-decoration: none;
+}
+
+.image-navigation .nav-previous,
+.image-navigation .nav-next {
+       position: absolute;
+       top: 50px;
+}
+
+.image-navigation .nav-previous {
+       left: 0;
+}
+
+.image-navigation .nav-next {
+       right: 0;
+}
+
+.image-navigation .meta-nav {
+       font-size: 32px;
+       font-weight: 300;
+       vertical-align: -4px;
+}
+
+.attachment .entry-attachment,
+.attachment p.attachment {
+       margin: 0 auto;
+       max-width: 724px;
+       text-align: center;
+}
+
+.attachment .entry-attachment .attachment {
+       display: inline-block;
+}
+
+.attachment .entry-caption {
+       text-align: left;
+}
+
+.attachment .entry-description {
+       margin: 20px auto 0;
+       max-width: 604px;
+}
+
+.attachment .entry-caption p:last-child,
+.attachment .entry-description p:last-child {
+       margin: 0;
+}
+
+
+/**
+ * 5.7 Post/Paging Navigation
+ * ----------------------------------------------------------------------------
+ */
+
+.navigation .nav-previous {
+       float: left;
+}
+
+.navigation .nav-next {
+       float: right;
+}
+
+.navigation a {
+       color: #bc360a;
+}
+
+.navigation a:hover {
+       color: #ea9629;
+       text-decoration: none;
+}
+
+.paging-navigation {
+       background-color: #e8e5ce;
+       padding: 40px 0;
+}
+
+.paging-navigation .nav-links {
+       margin: 0 auto;
+       max-width: 604px;
+       width: 100%;
+}
+
+.sidebar .paging-navigation .nav-links {
+       max-width: 1040px;
+       padding: 0 376px 0 60px;
+}
+
+.paging-navigation .nav-next {
+       padding: 13px 0;
+}
+
+.paging-navigation a {
+       font-size: 22px;
+       font-style: italic;
+       font-weight: 300;
+}
+
+.paging-navigation .meta-nav {
+       background-color: #e63f2a;
+       border-radius: 50%;
+       color: #fff;
+       display: inline-block;
+       font-size: 26px;
+       padding: 3px 0 8px;
+       text-align: center;
+       width: 50px;
+}
+
+.paging-navigation .nav-previous .meta-nav {
+       margin-right: 10px;
+       padding: 17px 0 23px;
+       width: 80px;
+}
+
+.paging-navigation .nav-next .meta-nav {
+       margin-left: 10px;
+}
+
+.paging-navigation a:hover .meta-nav {
+       background-color: #ea9629;
+       text-decoration: none;
+}
+
+.post-navigation {
+       background-color: #fff;
+       color: #ca3c08;
+       font-size: 20px;
+       font-style: italic;
+       font-weight: 300;
+       padding: 20px 0;
+}
+
+.post-navigation .nav-links {
+       margin: 0 auto;
+       max-width: 1040px;
+}
+
+.sidebar .post-navigation .nav-links {
+       padding: 0 376px 0 60px;
+}
+
+.post-navigation a[rel="next"] {
+       float: right;
+       text-align: right;
+}
+
+
+/**
+ * 5.8 Author Bio
+ * ----------------------------------------------------------------------------
+ */
+
+.author-info {
+       margin: 0 auto;
+       max-width: 604px;
+       padding: 30px 0 10px;
+       text-align: left; /* gallery & video post formats */
+       width: 100%;
+}
+
+.author.sidebar .author-info {
+       max-width: 1040px;
+       padding: 30px 376px 10px 60px;
+}
+
+.single .author-info {
+       padding: 50px 0 0;
+}
+
+.author-avatar .avatar {
+       float: left;
+       margin: 0 30px 30px 0;
+}
+
+.single-format-status .author-description {
+       color: #f7f5e7;
+}
+
+.author-description .author-title {
+       clear: none;
+       font: 300 italic 20px "Source Sans Pro", Helvetica, sans-serif;
+       margin: 0 0 8px;
+}
+
+.author-link {
+       color: #ca3c08;
+       margin-left: 2px;
+}
+
+.author.archive .author-link {
+       display: none;
+}
+
+
+/**
+ * 5.9 Archives
+ * ----------------------------------------------------------------------------
+ */
+
+.archive-header {
+       background-color: #e8e5ce;
+}
+
+.archive-title,
+.archive-meta {
+       font: 300 italic 30px "Source Sans Pro", Helvetica, sans-serif;
+       margin: 0 auto;
+       max-width: 1040px;
+       padding: 30px 0;
+       width: 100%;
+}
+
+.archive-meta {
+       font-size: 16px;
+       font-style: normal;
+       font-weight: normal;
+       margin-top: -15px;
+       padding: 0 0 11px;
+}
+
+.sidebar .archive-meta {
+       padding-right: 316px;
+}
+
+
+/**
+ * 5.10 Search Results/No posts
+ * ----------------------------------------------------------------------------
+ */
+
+.page-header {
+       background-color: #e8e5ce;
+}
+
+.page-title {
+       font: 300 italic 30px "Source Sans Pro", Helvetica, sans-serif;
+       margin: 0 auto;
+       max-width: 1040px;
+       padding: 30px 0;
+       width: 100%;
+}
+
+.page-content {
+       margin: 0 auto;
+       max-width: 604px;
+       padding: 40px 0;
+       width: 100%;
+}
+
+.sidebar .page-content {
+       margin: 0 auto;
+       max-width: 1040px;
+       padding: 40px 376px 40px 60px;
+}
+
+
+/**
+ * 5.11 404
+ * ----------------------------------------------------------------------------
+ */
+
+.error404 .page-header {
+       background-color: #fff;
+}
+
+.error404 .page-title {
+       line-height: 0.6;
+       margin: 0;
+       padding: 300px;
+       position: relative;
+       text-align: center;
+       width: auto;
+}
+
+.error404 .page-title:before {
+       color: #e8e5ce;
+       content: "\f423";
+       font-size: 964px;
+       line-height: 0.6;
+       overflow: hidden;
+       position: absolute;
+       left: 7px;
+       top: 28px;
+}
+
+.error404 .page-wrapper {
+       background-color: #e8e5ce;
+}
+
+.error404 .page-header,
+.error404 .page-content {
+       margin: 0 auto;
+       max-width: 1040px;
+       padding-bottom: 40px;
+       width: 100%;
+}
+
+
+/**
+ * 5.12 Comments
+ * ----------------------------------------------------------------------------
+ */
+
+.comments-title,
+.comment-list,
+.comment-reply-title,
+.must-log-in,
+.comment-respond .comment-form,
+.comment-respond iframe {
+       display: block;
+       margin-left: auto;
+       margin-right: auto;
+       max-width: 604px;
+       width: 100%;
+}
+
+.sidebar .comments-title,
+.sidebar .comment-list,
+.sidebar .must-log-in,
+.sidebar .comment-reply-title,
+.sidebar .comment-navigation,
+.sidebar .comment-respond .comment-form {
+       max-width: 1040px;
+       padding-left: 60px;
+       padding-right: 376px;
+}
+
+.comments-title {
+       font: 300 italic 28px "Source Sans Pro", Helvetica, sans-serif;
+}
+
+.comment-list,
+.comment-list .children {
+       list-style-type: none;
+       padding: 0;
+}
+
+.comment-list .children {
+       margin-left: 20px;
+}
+
+.comment-list > li:after,
+.comment-list .children > li:before {
+       background: url(images/dotted-line.png) repeat left top;
+       background-size: 4px 4px;
+       content: "";
+       display: block;
+       height: 1px;
+       width: 100%;
+}
+
+.comment-list > li:last-child:after {
+       display: none;
+}
+
+.comment-body {
+       padding: 24px 0;
+       position: relative;
+}
+
+.comment-author {
+       float: left;
+       max-width: 74px;
+}
+
+.comment-author .avatar {
+       display: block;
+       margin-bottom: 10px;
+}
+
+.comment-author .fn {
+       word-wrap: break-word;
+}
+
+.comment-author .fn,
+.comment-author .url,
+.comment-reply-link,
+.comment-reply-login {
+       color: #bc360a;
+       font-size: 14px;
+       font-style: normal;
+       font-weight: normal;
+}
+
+.says {
+       display: none;
+}
+
+.no-avatars .comment-author {
+       margin: 0 0 5px;
+       max-width: 100%;
+       position: relative;
+}
+
+.no-avatars .comment-metadata,
+.no-avatars .comment-content,
+.no-avatars .comment-list .reply {
+       width: 100%;
+}
+
+.bypostauthor > .comment-body .fn:before {
+       content: "\f408";
+       vertical-align: text-top;
+}
+
+.comment-list .edit-link {
+       margin-left: 20px;
+}
+
+.comment-metadata,
+.comment-awaiting-moderation,
+.comment-content,
+.comment-list .reply {
+       float: right;
+       width: 79%;
+       width: -webkit-calc(100% - 124px);
+       width:         calc(100% - 124px);
+}
+
+.comment-meta,
+.comment-meta a {
+       color: #a2a2a2;
+       font-size: 13px;
+}
+
+.comment-meta a:hover {
+       color: #ea9629;
+}
+
+.comment-metadata {
+       margin-bottom: 20px;
+}
+
+.ping-meta {
+       color: #a2a2a2;
+       font-size: 13px;
+       line-height: 2;
+}
+
+.comment-awaiting-moderation {
+       color: #a2a2a2;
+}
+
+.comment-awaiting-moderation:before {
+       content: "\f414";
+       margin-right: 5px;
+       position: relative;
+       top: -2px;
+}
+
+.comment-reply-link:before,
+.comment-reply-login:before {
+       content: "\f412";
+       margin-right: 3px;
+}
+
+/* Comment form */
+.comment-respond {
+       background-color: #f7f5e7;
+       padding: 30px 0;
+}
+
+.comment .comment-respond {
+       margin-bottom: 20px;
+       padding: 20px;
+}
+
+.comment-reply-title {
+       font: 300 italic 28px "Source Sans Pro", Helvetica, sans-serif;
+}
+
+.comment-reply-title small a {
+       color: #131310;
+       display: inline-block;
+       float: right;
+       height: 16px;
+       overflow: hidden;
+       width: 16px;
+}
+
+.comment-reply-title small a:hover {
+       color: #ed331c;
+       text-decoration: none;
+}
+
+.comment-reply-title small a:before {
+       content: "\f406";
+       vertical-align: top;
+}
+
+.sidebar .comment-list .comment-reply-title,
+.sidebar .comment-list .comment-respond .comment-form {
+       padding: 0;
+}
+
+.comment-form .comment-notes {
+       margin-bottom: 15px;
+}
+
+.comment-form .comment-form-author,
+.comment-form .comment-form-email,
+.comment-form .comment-form-url {
+       margin-bottom: 8px;
+}
+
+.comment-form [for="author"],
+.comment-form [for="email"],
+.comment-form [for="url"],
+.comment-form [for="comment"] {
+       float: left;
+       padding: 5px 0;
+       width: 120px;
+}
+
+.comment-form .required {
+       color: #ed331c;
+}
+
+.comment-form input[type="text"],
+.comment-form input[type="email"],
+.comment-form input[type="url"] {
+       max-width: 270px;
+       width: 60%;
+}
+
+.comment-form textarea {
+       width: 100%;
+}
+
+.form-allowed-tags,
+.form-allowed-tags code {
+       color: #686758;
+       font-size: 12px;
+}
+
+.form-allowed-tags code {
+       font-size: 10px;
+       margin-left: 3px;
+}
+
+.comment-list .pingback,
+.comment-list .trackback {
+       padding-top: 24px;
+}
+
+.comment-navigation {
+       font-size: 20px;
+       font-style: italic;
+       font-weight: 300;
+       margin: 0 auto;
+       max-width: 604px;
+       padding: 20px 0 30px;
+       width: 100%;
+}
+
+.no-comments {
+       background-color: #f7f5e7;
+       font-size: 20px;
+       font-style: italic;
+       font-weight: 300;
+       margin: 0;
+       padding: 40px 0;
+       text-align: center;
+}
+
+.sidebar .no-comments {
+       padding-left: 60px;
+       padding-right: 376px;
+}
+
+
+/**
+ * 5.13 Multisite
+ * ----------------------------------------------------------------------------
+ */
+
+.site-main .mu_register {
+       margin: 0 auto;
+       max-width: 604px;
+       width: 100%;
+}
+
+.mu_alert {
+       margin-top: 25px;
+}
+
+.site-main .mu_register input[type="submit"],
+.site-main .mu_register #blog_title,
+.site-main .mu_register #user_email,
+.site-main .mu_register #blogname,
+.site-main .mu_register #user_name {
+       font-size: inherit;
+       width: 270px;
+}
+
+.site-main .mu_register input[type="submit"] {
+       width: auto;
+}
+
+
+/**
+ * 6.0 Sidebar
+ * ----------------------------------------------------------------------------
+ */
+
+.site-main .widget-area {
+       float: right;
+       width: 300px;
+}
+
+
+/**
+ * 6.1 Widgets
+ * ----------------------------------------------------------------------------
+ */
+
+.widget {
+       background-color: rgba(247, 245, 231, 0.7);
+       font-size: 14px;
+       -webkit-hyphens: auto;
+       -moz-hyphens:    auto;
+       -ms-hyphens:     auto;
+       hyphens:         auto;
+       margin: 0 0 24px;
+       padding: 20px;
+       word-wrap: break-word;
+}
+
+.widget .widget-title {
+       font: 300 italic 20px "Source Sans Pro", Helvetica, sans-serif;
+       margin: 0 0 10px;
+}
+
+.widget ul,
+.widget ol {
+       list-style-type: none;
+       margin: 0;
+       padding: 0;
+}
+
+.widget li {
+       padding: 5px 0;
+}
+
+.widget .children li:last-child {
+       padding-bottom: 0;
+}
+
+.widget li > ul,
+.widget li > ol {
+       margin-left: 20px;
+}
+
+.widget a {
+       color: #bc360a;
+}
+
+.widget a:hover {
+       color: #ea9629;
+}
+
+/* Search widget */
+.search-form .search-submit {
+       display: none;
+}
+
+/* RSS Widget */
+.widget_rss .rss-date {
+       display: block;
+}
+
+.widget_rss .rss-date,
+.widget_rss li > cite {
+       color: #a2a2a2;
+}
+
+/* Calendar Widget */
+.widget_calendar table,
+.widget_calendar td {
+       border: 0;
+       border-collapse: separate;
+       border-spacing: 1px;
+}
+
+.widget_calendar caption {
+       font-size: 14px;
+       margin: 0;
+}
+
+.widget_calendar th,
+.widget_calendar td {
+       padding: 0;
+       text-align: center;
+}
+
+.widget_calendar a {
+       display: block;
+}
+
+.widget_calendar a:hover {
+       background-color: rgba(0, 0, 0, 0.15);
+}
+
+.widget_calendar tbody td {
+       background-color: rgba(255, 255, 255, 0.5);
+}
+
+.site-footer .widget_calendar tbody td {
+       background-color: rgba(255, 255, 255, 0.05);
+}
+
+.widget_calendar tbody .pad, .site-footer .widget_calendar tbody .pad {
+       background-color: transparent;
+}
+
+
+/**
+ * 7.0 Footer
+ * ----------------------------------------------------------------------------
+ */
+
+.site-footer {
+       background-color: #e8e5ce;
+       color: #686758;
+       font-size: 14px;
+       text-align: center;
+}
+
+.site-footer .widget-area,
+.sidebar .site-footer {
+       text-align: left;
+}
+
+.site-footer a {
+       color: #686758;
+}
+
+.site-footer .sidebar-container {
+       background-color: #220e10;
+       padding: 20px 0;
+}
+
+.site-footer .widget-area {
+       margin: 0 auto;
+       max-width: 1040px;
+       width: 100%;
+}
+
+.sidebar .site-footer .widget-area {
+       max-width: 724px;
+       position: relative;
+       left: -158px;
+}
+
+.site-footer .widget {
+       background: transparent;
+       color: #fff;
+       float: left;
+       margin-right: 20px;
+       width: 245px;
+}
+
+.sidebar .site-footer .widget {
+       width: 228px;
+}
+
+.sidebar .site-footer .widget:nth-of-type(4),
+.sidebar .site-footer .widget:nth-of-type(3) {
+       margin-right: 0;
+}
+
+.site-footer .widget a {
+       color: #e6402a;
+}
+
+.site-footer .widget-title,
+.site-footer .widget-title a,
+.site-footer .wp-caption-text {
+       color: #fff;
+}
+
+.site-info {
+       margin: 0 auto;
+       max-width: 1040px;
+       padding: 30px 0;
+       width: 100%;
+}
+
+#wpstats {
+       display: block;
+       margin: -10px auto 0;
+}
+
+
+/**
+ * 8.0 Media Queries
+ * ----------------------------------------------------------------------------
+ */
+
+@media (max-width: 1599px) {
+       .site {
+               border: 0;
+       }
+}
+
+@media (max-width: 1069px) {
+       .sidebar img.alignleft,
+       .sidebar .wp-caption.alignleft {
+               margin-left: 0;
+       }
+
+       .sidebar img.alignright,
+       .sidebar .wp-caption.alignright {
+               margin-right: 0;
+       }
+
+       .error404 .page-header {
+               margin-left: auto;
+               max-width: 604px;
+               width: 100%;
+       }
+
+       .archive-header,
+       .search .page-header,
+       .archive .page-header,
+       .blog .page-header,
+       .error404 .page-content,
+       .search .page-content,
+       .archive .page-content,
+       .attachment .entry-header,
+       .attachment .entry-content,
+       .post-navigation .nav-links,
+       .sidebar .site-info,
+       .site-footer .widget-area {
+               padding-left: 20px;
+               padding-right: 20px;
+       }
+
+       .error404 .page-title {
+               font-size: 24px;
+               padding: 180px;
+       }
+
+       .error404 .page-title:before {
+               font-size: 554px;
+       }
+
+       .attachment .image-navigation {
+               max-width: 724px;
+       }
+
+       .image-navigation .nav-previous,
+       .image-navigation .nav-next {
+               position: static;
+       }
+
+       .site-main .widget-area {
+               margin-right: 60px;
+       }
+}
+
+@media (max-width: 999px) {
+       .sidebar .entry-header,
+       .sidebar .entry-content,
+       .sidebar .entry-summary,
+       .sidebar .entry-meta,
+       .sidebar .comment-list,
+       .sidebar .comment-reply-title,
+       .sidebar .comment-navigation,
+       .sidebar .comment-respond .comment-form,
+       .sidebar .featured-gallery,
+       .sidebar .post-navigation .nav-links,
+       .author.sidebar .author-info {
+               max-width: 604px;
+               padding-left: 0;
+               padding-right: 0;
+       }
+
+       .sidebar .site-info,
+       .search.sidebar .page-content,
+       .blog.sidebar .page-content,
+       .attachment .entry-header,
+       .sidebar .comments-title {
+               max-width: 604px;
+       }
+
+       .sidebar .archive-meta,
+       .attachment .entry-header,
+       .search.sidebar .page-content,
+       .blog.sidebar .page-content,
+       .sidebar .site-info,
+       .sidebar .comments-title,
+       .sidebar .no-comments {
+               padding-left: 0;
+               padding-right: 0;
+       }
+
+       .attachment .entry-meta {
+               float: left;
+               text-align: left;
+               width: 100%;
+       }
+
+       .attachment .entry-content {
+               max-width: 100%;
+               padding: 40px 0;
+       }
+
+       .format-status .entry-content {
+               padding-top: 40px;
+       }
+
+       .format-status .entry-meta {
+               padding-bottom: 40px;
+       }
+
+       .sidebar .format-status .entry-content,
+       .sidebar .format-status .entry-meta {
+               padding-left: 35px;
+       }
+
+       .sidebar .format-status .entry-content:before,
+       .sidebar .format-status .entry-meta:before {
+               left: 10px;
+       }
+
+       .sidebar .format-status .entry-content p:first-child:before {
+               left: 4px;
+       }
+
+       .sidebar .paging-navigation .nav-links {
+               padding: 0 60px;
+       }
+
+       .site-main .sidebar-container {
+               height: auto;
+               margin: 0 auto;
+               max-width: 604px;
+               position: relative;
+               top: 20px;
+       }
+
+       .site-main .widget-area {
+               float: none;
+               margin: 0;
+               width: 100%;
+       }
+
+       .sidebar .site-footer .widget-area {
+               max-width: 100%;
+               left: 0;
+       }
+}
+
+/* Collapse oversized image and pulled images after iPad breakpoint. */
+@media (max-width: 767px) {
+       .entry-content img.alignleft,
+       .entry-content .wp-caption.alignleft {
+               margin-left: 0;
+       }
+
+       .entry-content img.alignright,
+       .entry-content .wp-caption.alignright {
+               margin-right: 0;
+       }
+
+       .attachment .image-navigation,
+       .attachment .entry-attachment .attachment {
+               max-width: 604px;
+               padding: 0;
+               width: 100%;
+       }
+
+       .gallery-caption {
+               display: none;
+       }
+}
+
+@media (max-width: 643px) {
+       .site-title {
+               font-size: 30px;
+       }
+
+       #content .entry-header,
+       #content .entry-content,
+       #content .entry-summary,
+       #content footer.entry-meta,
+       #content .featured-gallery,
+       .search.sidebar .page-content,
+       .blog.sidebar .page-content,
+       .sidebar .post-navigation .nav-links,
+       .paging-navigation .nav-links,
+       #content .author-info,
+       .comments-area .comments-title,
+       .comments-area .comment-list,
+       .comments-area .comment-navigation,
+       .comment-respond,
+       .sidebar .site-info,
+       .sidebar .paging-navigation .nav-links {
+               padding-left: 20px;
+               padding-right: 20px;
+       }
+
+       #content .format-status .entry-content,
+       #content .format-status .entry-met {
+               padding-left: 35px;
+       }
+
+       /* Small menu */
+       .menu-toggle {
+               cursor: pointer;
+               display: inline-block;
+               font: bold 16px/1.3 "Source Sans Pro", Helvetica, sans-serif;
+               margin: 0;
+               padding: 12px 0 12px 20px;
+       }
+
+       .menu-toggle:after {
+               content: "\f502";
+               font-size: 12px;
+               padding-left: 8px;
+               vertical-align: -4px;
+       }
+
+       .toggled-on .menu-toggle:after {
+               content: "\f500";
+               vertical-align: 2px;
+       }
+
+       .toggled-on .nav-menu,
+       .toggled-on .nav-menu > ul {
+               display: block;
+               margin-left: 0;
+               padding: 0;
+               width: 100%;
+       }
+
+       .toggled-on li,
+       .toggled-on .children {
+               display: block;
+       }
+
+       .toggled-on .nav-menu li > ul {
+               background-color: transparent;
+               display: block;
+               float: none;
+               margin-left: 20px;
+               position: relative;
+               left: auto;
+               top: auto;
+       }
+
+       .toggled-on .nav-menu li > ul a {
+               color: #141412;
+               width: auto;
+       }
+
+       .toggled-on .nav-menu li:hover > a,
+       .toggled-on .nav-menu .children a {
+               background-color: transparent;
+               color: #141412;
+       }
+
+       .toggled-on .nav-menu li a:hover,
+       .toggled-on .nav-menu ul a:hover {
+               background-color: #db572f;
+               color: #fff;
+       }
+
+       ul.nav-menu,
+       div.nav-menu > ul {
+               display: none;
+       }
+
+       #content .featured-gallery {
+               padding-left: 24px;
+       }
+
+       .gallery-columns-1 .gallery-item {
+               margin-right: 0;
+               width: 100%;
+       }
+
+       .entry-title,
+       .format-chat .entry-title,
+       .format-image .entry-title,
+       .format-gallery .entry-title,
+       .format-video .entry-title {
+               font-size: 22px;
+               font-weight: bold;
+       }
+
+       .format-quote blockquote,
+       .format-status .entry-content {
+               font-size: 18px;
+       }
+
+       .format-quote blockquote small,
+       .format-quote blockquote cite {
+               font-size: 13px;
+       }
+
+       .error404 .page-title {
+               padding: 40px 0 0;
+       }
+
+       .error404 .page-title:before {
+               content: normal;
+       }
+
+       .comment-author {
+               margin-right: 30px;
+       }
+
+       .comment-author .avatar {
+               height: auto;
+               max-width: 100%;
+       }
+
+       .comment-metadata,
+       .comment-content,
+       .comment-list .reply {
+               width: 70%;
+               width: -webkit-calc(100% - 104px);
+               width:         calc(100% - 104px);
+       }
+
+       .comment-form input[type="text"],
+       .comment-form input[type="email"],
+       .comment-form input[type="url"] {
+               width: -webkit-calc(100% - 120px);
+               width:         calc(100% - 120px);
+       }
+
+       .comment-form textarea {
+               height: 80px; /* Smaller field for mobile. */
+       }
+
+       /* Audio */
+       .format-audio .entry-content:before {
+               display: none;
+       }
+
+       .format-audio .audio-content {
+               background-image: none;
+               float: none;
+               padding-left: 0;
+               width: auto;
+       }
+}
+
+/* Mobile devices */
+@media (max-width: 359px) {
+       .gallery {
+               margin-left: 0;
+       }
+
+       .gallery .gallery-item,
+       .gallery-columns-2.gallery-size-thumbnail .gallery-item {
+               max-width: none;
+               width: 49%;
+               width: -webkit-calc(50% - 4px);
+               width:         calc(50% - 4px);
+       }
+
+       .gallery-columns-1.gallery-size-medium,
+       .gallery-columns-1.gallery-size-thumbnail,
+       .gallery-columns-2.gallery-size-thumbnail,
+       .gallery-columns-3.gallery-size-thumbnail {
+               display: block;
+       }
+
+       .gallery-columns-1 .gallery-item,
+       .gallery-columns-1.gallery-size-medium .gallery-item,
+       .gallery-columns-1.gallery-size-thumbnail .gallery-item {
+               text-align: center;
+               width: 98%;
+               width: -webkit-calc(100% - 4px);
+               width:         calc(100% - 4px);
+       }
+
+       .gallery-columns-3 .gallery-item:nth-of-type(3n),
+       .gallery-columns-5 .gallery-item:nth-of-type(5n),
+       .gallery-columns-7 .gallery-item:nth-of-type(7n),
+       .gallery-columns-9 .gallery-item:nth-of-type(9n) {
+               margin-right: 4px;
+       }
+
+       .gallery br {
+               display: none;
+       }
+
+       .gallery .gallery-item:nth-of-type(even) {
+               margin-right: 0;
+       }
+
+       /* Comments */
+       .comment-author {
+               margin: 0 0 5px;
+               max-width: 100%;
+       }
+
+       .comment-author .avatar {
+               display: inline;
+               margin: 0 5px 0 0;
+               max-width: 20px;
+       }
+
+       .comment-metadata,
+       .comment-content,
+       .comment-list .reply {
+               width: 100%;
+       }
+}
+
+
+/**
+ * 9.0 Print
+ * ----------------------------------------------------------------------------
+ */
+
+/* Retina-specific styles. */
+@media print,
+       (-o-min-device-pixel-ratio: 5/4),
+       (-webkit-min-device-pixel-ratio: 1.25),
+       (min-resolution: 120dpi) {
+
+       .site-header .search-field {
+               background-image: url(images/search-icon-2x.png);
+       }
+
+       .format-audio .audio-content,
+       .format-status .entry-content:before,
+       .format-status .entry-meta:before,
+       .comment-list > li:after,
+       .comment-list .children > li:before {
+               background-image: url(images/dotted-line-2x.png);
+       }
+}
+
+@media print {
+       body {
+               background: none !important;
+               color: #000;
+               font-size: 10pt;
+       }
+
+       footer a[rel="bookmark"]:link:after,
+       footer a[rel="bookmark"]:visited:after {
+               content: " [" attr(href) "] "; /* Show URLs */
+       }
+
+       .site {
+               max-width: 98%;
+       }
+
+       .site-header {
+               background-image: none !important;
+       }
+
+       .site-header .home-link {
+               max-width: none;
+               min-height: 0;
+       }
+
+       .site-title {
+               color: #000;
+               font-size: 21pt;
+       }
+
+       .site-description {
+               font-size: 10pt;
+       }
+
+       .author-avatar,
+       .site-footer,
+       .comment-respond,
+       .comments-area .comment-edit-link,
+       .comments-area .reply,
+       .comments-link,
+       .entry-meta .edit-link,
+       .page-links,
+       .site-content nav,
+       .widget-area,
+       .main-navigation,
+       .navbar,
+       .more-link {
+               display: none;
+       }
+
+       .entry-header,
+       .entry-content,
+       .entry-summary,
+       .entry-meta {
+               margin: 0;
+               width: 100%;
+       }
+
+       .page-title,
+       .entry-title {
+               font-size: 21pt;
+       }
+
+       .entry-meta,
+       .entry-meta a {
+               color: #444;
+               font-size: 10pt;
+       }
+
+       .entry-content img.alignleft,
+       .entry-content .wp-caption.alignleft {
+               margin-left: 0;
+       }
+
+       .entry-content img.alignright,
+       .entry-content .wp-caption.alignright {
+               margin-right: 0;
+       }
+
+       .format-image .entry-content .size-full {
+               margin: 0;
+       }
+
+       /* Remove colors from post formats */
+       .hentry {
+               background-color: #fff;
+       }
+
+       /* Comments */
+       .comments-area > li.comment {
+               background: none;
+               position: relative;
+               width: auto;
+       }
+
+       .comment-metadata {
+               float: none;
+       }
+
+       .comment-author .fn,
+       .comment-reply-link,
+       .comment-reply-login {
+               color: #333;
+       }
+}
\ No newline at end of file
diff --git a/wp-content/themes/twentythirteen/tag.php b/wp-content/themes/twentythirteen/tag.php
new file mode 100644 (file)
index 0000000..5454005
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+/**
+ * The template for displaying Tag pages.
+ *
+ * Used to display archive-type pages for posts in a tag.
+ *
+ * Learn more: http://codex.wordpress.org/Template_Hierarchy
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+
+get_header(); ?>
+
+       <div id="primary" class="content-area">
+               <div id="content" class="site-content" role="main">
+
+               <?php if ( have_posts() ) : ?>
+                       <header class="archive-header">
+                               <h1 class="archive-title"><?php printf( __( 'Tag Archives: %s', 'twentythirteen' ), single_tag_title( '', false ) ); ?></h1>
+
+                               <?php if ( tag_description() ) : // Show an optional tag description ?>
+                               <div class="archive-meta"><?php echo tag_description(); ?></div>
+                               <?php endif; ?>
+                       </header><!-- .archive-header -->
+
+                       <?php /* The loop */ ?>
+                       <?php while ( have_posts() ) : the_post(); ?>
+                               <?php get_template_part( 'content', get_post_format() ); ?>
+                       <?php endwhile; ?>
+
+                       <?php twentythirteen_paging_nav(); ?>
+
+               <?php else : ?>
+                       <?php get_template_part( 'content', 'none' ); ?>
+               <?php endif; ?>
+
+               </div><!-- #content -->
+       </div><!-- #primary -->
+
+<?php get_sidebar(); ?>
+<?php get_footer(); ?>
\ No newline at end of file
diff --git a/wp-content/themes/twentythirteen/taxonomy-post_format.php b/wp-content/themes/twentythirteen/taxonomy-post_format.php
new file mode 100644 (file)
index 0000000..0deb97c
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/**
+ * The template for displaying Post Format pages.
+ *
+ * Used to display archive-type pages for posts with a post format.
+ * If you'd like to further customize these Post Format views, you may create a
+ * new template file for each specific one.
+ *
+ * Learn more: http://codex.wordpress.org/Template_Hierarchy
+ *
+ * @package WordPress
+ * @subpackage Twenty_Thirteen
+ * @since Twenty Thirteen 1.0
+ */
+
+get_header(); ?>
+
+       <div id="primary" class="content-area">
+               <div id="content" class="site-content" role="main">
+
+               <?php if ( have_posts() ) : ?>
+                       <header class="archive-header">
+                               <h1 class="archive-title"><?php printf( __( '%s Archives', 'twentythirteen' ), '<span>' . get_post_format_string( get_post_format() ) . '</span>' ); ?></h1>
+                       </header><!-- .archive-header -->
+
+                       <?php /* The loop */ ?>
+                       <?php while ( have_posts() ) : the_post(); ?>
+                               <?php get_template_part( 'content', get_post_format() ); ?>
+                       <?php endwhile; ?>
+
+                       <?php twentythirteen_paging_nav(); ?>
+
+               <?php else : ?>
+                       <?php get_template_part( 'content', 'none' ); ?>
+               <?php endif; ?>
+
+               </div><!-- #content -->
+       </div><!-- #primary -->
+
+<?php get_sidebar(); ?>
+<?php get_footer(); ?>
\ No newline at end of file
index c0645018d0adfc6c8860b0e5b3a0b78d544e81fa..4a84ae76d08ae91bbbb59090fc71b0435f24badd 100644 (file)
@@ -10,7 +10,7 @@
 
        <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                <div class="aside">
-                       <h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
+                       <h1 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
                        <div class="entry-content">
                                <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?>
                        </div><!-- .entry-content -->
index aee3869d94c12aaa274e378e8e40f985aad35a87..a683b83cfc4e139f1aa5e3009f13525a784e06be 100644 (file)
@@ -14,7 +14,7 @@
                </div><!-- .entry-content -->
 
                <footer class="entry-meta">
-                       <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark">
+                       <a href="<?php the_permalink(); ?>" rel="bookmark">
                                <h1><?php the_title(); ?></h1>
                                <h2><time class="entry-date" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>"><?php echo get_the_date(); ?></time></h2>
                        </a>
index f00a99c9dd191df07a5ee4dc0b0a0143189fdc58..0abcbf79112ead52c65fe0dc2d43b0e5fc50e5de 100644 (file)
@@ -10,6 +10,9 @@
 
        <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                <header class="entry-header">
+                       <?php if ( ! is_page_template( 'page-templates/front-page.php' ) ) : ?>
+                       <?php the_post_thumbnail(); ?>
+                       <?php endif; ?>
                        <h1 class="entry-title"><?php the_title(); ?></h1>
                </header>
 
index 90cd694be930d513ec238454468758d637a52d8a..bf2936ca21ee97713a20615b6e4b76500f2df5a9 100644 (file)
@@ -20,7 +20,7 @@
                        <h1 class="entry-title"><?php the_title(); ?></h1>
                        <?php else : ?>
                        <h1 class="entry-title">
-                               <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
+                               <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
                        </h1>
                        <?php endif; // is_single() ?>
                        <?php if ( comments_open() ) : ?>
index f376dc79007ac7dbd9f4b3fbbbd082482fc03229..24e9b24f63e3858ae148d84365504e6839de34d2 100644 (file)
@@ -308,7 +308,7 @@ img[class*="wp-image-"],
 img[class*="attachment-"] {
        height: auto; /* Make sure images with WordPress-added height and width attributes are scaled correctly */
 }
-img.mceWPnextpage {
+img.mce-wp-nextpage {
        border-radius: 0;
        box-shadow: none;
 }
@@ -339,4 +339,4 @@ img.wp-smiley {
        line-height: 2;
        margin: 0 0 24px;
        margin: 0 0 1.71429rem;
-}
\ No newline at end of file
+}
index 760c113237bae007231b1dc0ecec084d91626c8a..04981390d30553022d99f3b39abffec0ee032e6b 100644 (file)
@@ -83,45 +83,25 @@ add_action( 'after_setup_theme', 'twentytwelve_setup' );
 require( get_template_directory() . '/inc/custom-header.php' );
 
 /**
- * Enqueues scripts and styles for front-end.
+ * Returns the Google font stylesheet URL if available.
  *
- * @since Twenty Twelve 1.0
+ * The use of Open Sans by default is localized. For languages that use
+ * characters not supported by the font, the font can be disabled.
+ *
+ * @since Twenty Twelve 1.2
+ *
+ * @return string Font stylesheet or empty string if disabled.
  */
-function twentytwelve_scripts_styles() {
-       global $wp_styles;
-
-       /*
-        * Adds JavaScript to pages with the comment form to support
-        * sites with threaded comments (when in use).
-        */
-       if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
-               wp_enqueue_script( 'comment-reply' );
-
-       /*
-        * Adds JavaScript for handling the navigation menu hide-and-show behavior.
-        */
-       wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '1.0', true );
-
-       /*
-        * Loads our special font CSS file.
-        *
-        * The use of Open Sans by default is localized. For languages that use
-        * characters not supported by the font, the font can be disabled.
-        *
-        * To disable in a child theme, use wp_dequeue_style()
-        * function mytheme_dequeue_fonts() {
-        *     wp_dequeue_style( 'twentytwelve-fonts' );
-        * }
-        * add_action( 'wp_enqueue_scripts', 'mytheme_dequeue_fonts', 11 );
-        */
+function twentytwelve_get_font_url() {
+       $font_url = '';
 
        /* translators: If there are characters in your language that are not supported
-          by Open Sans, translate this to 'off'. Do not translate into your own language. */
+        by Open Sans, translate this to 'off'. Do not translate into your own language. */
        if ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'twentytwelve' ) ) {
                $subsets = 'latin,latin-ext';
 
                /* translators: To add an additional Open Sans character subset specific to your language, translate
-                  this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language. */
+                this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language. */
                $subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'twentytwelve' );
 
                if ( 'cyrillic' == $subset )
@@ -136,9 +116,36 @@ function twentytwelve_scripts_styles() {
                        'family' => 'Open+Sans:400italic,700italic,400,700',
                        'subset' => $subsets,
                );
-               wp_enqueue_style( 'twentytwelve-fonts', add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ), array(), null );
+               $font_url = add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" );
        }
 
+       return $font_url;
+}
+
+/**
+ * Enqueues scripts and styles for front-end.
+ *
+ * @since Twenty Twelve 1.0
+ */
+function twentytwelve_scripts_styles() {
+       global $wp_styles;
+
+       /*
+        * Adds JavaScript to pages with the comment form to support
+        * sites with threaded comments (when in use).
+        */
+       if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
+               wp_enqueue_script( 'comment-reply' );
+
+       /*
+        * Adds JavaScript for handling the navigation menu hide-and-show behavior.
+        */
+       wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '1.0', true );
+
+       $font_url = twentytwelve_get_font_url();
+       if ( ! empty( $font_url ) )
+               wp_enqueue_style( 'twentytwelve-fonts', esc_url_raw( $font_url ), array(), null );
+
        /*
         * Loads our main stylesheet.
         */
@@ -152,6 +159,31 @@ function twentytwelve_scripts_styles() {
 }
 add_action( 'wp_enqueue_scripts', 'twentytwelve_scripts_styles' );
 
+/**
+ * Adds additional stylesheets to the TinyMCE editor if needed.
+ *
+ * @uses twentytwelve_get_font_url() To get the Google Font stylesheet URL.
+ *
+ * @since Twenty Twelve 1.2
+ *
+ * @param string $mce_css CSS path to load in TinyMCE.
+ * @return string
+ */
+function twentytwelve_mce_css( $mce_css ) {
+       $font_url = twentytwelve_get_font_url();
+
+       if ( empty( $font_url ) )
+               return $mce_css;
+
+       if ( ! empty( $mce_css ) )
+               $mce_css .= ',';
+
+       $mce_css .= esc_url_raw( str_replace( ',', '%2C', $font_url ) );
+
+       return $mce_css;
+}
+add_filter( 'mce_css', 'twentytwelve_mce_css' );
+
 /**
  * Creates a nicely formatted and more specific title element text
  * for output in head of document, based on current view.
@@ -248,8 +280,8 @@ function twentytwelve_content_nav( $html_id ) {
        if ( $wp_query->max_num_pages > 1 ) : ?>
                <nav id="<?php echo $html_id; ?>" class="navigation" role="navigation">
                        <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3>
-                       <div class="nav-previous alignleft"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentytwelve' ) ); ?></div>
-                       <div class="nav-next alignright"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?></div>
+                       <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'twentytwelve' ) ); ?></div>
+                       <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?></div>
                </nav><!-- #<?php echo $html_id; ?> .navigation -->
        <?php endif;
 }
@@ -286,10 +318,10 @@ function twentytwelve_comment( $comment, $args, $depth ) {
                        <header class="comment-meta comment-author vcard">
                                <?php
                                        echo get_avatar( $comment, 44 );
-                                       printf( '<cite class="fn">%1$s %2$s</cite>',
+                                       printf( '<cite><b class="fn">%1$s</b> %2$s</cite>',
                                                get_comment_author_link(),
                                                // If current post author is also comment author, make it known visually.
-                                               ( $comment->user_id === $post->post_author ) ? '<span> ' . __( 'Post author', 'twentytwelve' ) . '</span>' : ''
+                                               ( $comment->user_id === $post->post_author ) ? '<span>' . __( 'Post author', 'twentytwelve' ) . '</span>' : ''
                                        );
                                        printf( '<a href="%1$s"><time datetime="%2$s">%3$s</time></a>',
                                                esc_url( get_comment_link( $comment->comment_ID ) ),
@@ -383,6 +415,7 @@ endif;
  */
 function twentytwelve_body_class( $classes ) {
        $background_color = get_background_color();
+       $background_image = get_background_image();
 
        if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) )
                $classes[] = 'full-width';
@@ -395,10 +428,12 @@ function twentytwelve_body_class( $classes ) {
                        $classes[] = 'two-sidebars';
        }
 
-       if ( empty( $background_color ) )
-               $classes[] = 'custom-background-empty';
-       elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) )
-               $classes[] = 'custom-background-white';
+       if ( empty( $background_image ) ) {
+               if ( empty( $background_color ) )
+                       $classes[] = 'custom-background-empty';
+               elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) )
+                       $classes[] = 'custom-background-white';
+       }
 
        // Enable custom font class only if the font CSS is queued to load.
        if ( wp_style_is( 'twentytwelve-fonts', 'queue' ) )
@@ -434,8 +469,9 @@ add_action( 'template_redirect', 'twentytwelve_content_width' );
  * @return void
  */
 function twentytwelve_customize_register( $wp_customize ) {
-       $wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
-       $wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
+       $wp_customize->get_setting( 'blogname' )->transport         = 'postMessage';
+       $wp_customize->get_setting( 'blogdescription' )->transport  = 'postMessage';
+       $wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
 }
 add_action( 'customize_register', 'twentytwelve_customize_register' );
 
@@ -445,6 +481,6 @@ add_action( 'customize_register', 'twentytwelve_customize_register' );
  * @since Twenty Twelve 1.0
  */
 function twentytwelve_customize_preview_js() {
-       wp_enqueue_script( 'twentytwelve-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20120827', true );
+       wp_enqueue_script( 'twentytwelve-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20130301', true );
 }
 add_action( 'customize_preview_init', 'twentytwelve_customize_preview_js' );
index f94d0e8f77839c907cdac430fda8f5ba6f63c7b3..595bf98f5a7edcdf48645173f5757b9e9eea2bc4 100644 (file)
@@ -21,7 +21,7 @@
 function twentytwelve_custom_header_setup() {
        $args = array(
                // Text color and image (empty to use none).
-               'default-text-color'     => '444',
+               'default-text-color'     => '515151',
                'default-image'          => '',
 
                // Set height and width, with a maximum value for the width.
@@ -46,10 +46,24 @@ function twentytwelve_custom_header_setup() {
 }
 add_action( 'after_setup_theme', 'twentytwelve_custom_header_setup' );
 
+/**
+ * Loads our special font CSS file.
+ *
+ * @since Twenty Twelve 1.2
+ *
+ * @return void
+ */
+function twentytwelve_custom_header_fonts() {
+       $font_url = twentytwelve_get_font_url();
+       if ( ! empty( $font_url ) )
+               wp_enqueue_style( 'twentytwelve-fonts', esc_url_raw( $font_url ), array(), null );
+}
+add_action( 'admin_print_styles-appearance_page_custom-header', 'twentytwelve_custom_header_fonts' );
+
 /**
  * Styles the header text displayed on the blog.
  *
- * get_header_textcolor() options: 444 is default, hide text (returns 'blank'), or any hex value.
+ * get_header_textcolor() options: 515151 is default, hide text (returns 'blank'), or any hex value.
  *
  * @since Twenty Twelve 1.0
  */
@@ -62,14 +76,14 @@ function twentytwelve_header_style() {
 
        // If we get this far, we have custom styles.
        ?>
-       <style type="text/css">
+       <style type="text/css" id="twentytwelve-header-css">
        <?php
                // Has the text been hidden?
                if ( ! display_header_text() ) :
        ?>
                .site-title,
                .site-description {
-                       position: absolute !important;
+                       position: absolute;
                        clip: rect(1px 1px 1px 1px); /* IE7 */
                        clip: rect(1px, 1px, 1px, 1px);
                }
@@ -77,9 +91,9 @@ function twentytwelve_header_style() {
                // If the user has set a custom color for the text, use that.
                else :
        ?>
-               .site-title a,
-               .site-description {
-                       color: #<?php echo $text_color; ?> !important;
+               .site-header h1 a,
+               .site-header h2 {
+                       color: #<?php echo $text_color; ?>;
                }
        <?php endif; ?>
        </style>
@@ -93,29 +107,30 @@ function twentytwelve_header_style() {
  */
 function twentytwelve_admin_header_style() {
 ?>
-       <style type="text/css">
+       <style type="text/css" id="twentytwelve-admin-header-css">
        .appearance_page_custom-header #headimg {
                border: none;
+               font-family: "Open Sans", Helvetica, Arial, sans-serif;
        }
        #headimg h1,
        #headimg h2 {
-               line-height: 1.6;
+               line-height: 1.84615;
                margin: 0;
                padding: 0;
        }
        #headimg h1 {
-               font-size: 30px;
+               font-size: 26px;
        }
        #headimg h1 a {
                color: #515151;
                text-decoration: none;
        }
        #headimg h1 a:hover {
-               color: #21759b;
+               color: #21759b !important; /* Has to override custom inline style. */
        }
        #headimg h2 {
                color: #757575;
-               font: normal 13px/1.8 "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
+               font-size: 13px;
                margin-bottom: 24px;
        }
        #headimg img {
@@ -140,8 +155,8 @@ function twentytwelve_admin_header_image() {
                else
                        $style = ' style="color:#' . get_header_textcolor() . ';"';
                ?>
-               <h1><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
-               <h2 id="desc"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></h2>
+               <h1 class="displaying-header-text"><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
+               <h2 id="desc" class="displaying-header-text"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></h2>
                <?php $header_image = get_header_image();
                if ( ! empty( $header_image ) ) : ?>
                        <img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" />
index c1018b05ccdf1dd2fc5bfaf6bedca9f5e9063335..bde05d9c51aa4661dd1beabc3c145a2eaba1a6d3 100644 (file)
@@ -9,24 +9,56 @@
        // Site title and description.
        wp.customize( 'blogname', function( value ) {
                value.bind( function( to ) {
-                       $( '.site-title a' ).html( to );
+                       $( '.site-title a' ).text( to );
                } );
        } );
        wp.customize( 'blogdescription', function( value ) {
                value.bind( function( to ) {
-                       $( '.site-description' ).html( to );
+                       $( '.site-description' ).text( to );
                } );
        } );
 
-       // Hook into background color change and adjust body class value as needed.
+       // Header text color
+       wp.customize( 'header_textcolor', function( value ) {
+               value.bind( function( to ) {
+                       if ( 'blank' === to ) {
+                               $( '.site-title, .site-title a, .site-description' ).css( {
+                                       'clip': 'rect(1px, 1px, 1px, 1px)',
+                                       'position': 'absolute'
+                               } );
+                       } else {
+                               $( '.site-title, .site-title a, .site-description' ).css( {
+                                       'clip': 'auto',
+                                       'color': to,
+                                       'position': 'relative'
+                               } );
+                       }
+               } );
+       } );
+
+       // Hook into background color/image change and adjust body class value as needed.
        wp.customize( 'background_color', function( value ) {
                value.bind( function( to ) {
-                       if ( '#ffffff' == to || '#fff' == to )
-                               $( 'body' ).addClass( 'custom-background-white' );
-                       else if ( '' == to )
-                               $( 'body' ).addClass( 'custom-background-empty' );
+                       var body = $( 'body' );
+
+                       if ( ( '#ffffff' == to || '#fff' == to ) && 'none' == body.css( 'background-image' ) )
+                               body.addClass( 'custom-background-white' );
+                       else if ( '' == to && 'none' == body.css( 'background-image' ) )
+                               body.addClass( 'custom-background-empty' );
                        else
-                               $( 'body' ).removeClass( 'custom-background-empty custom-background-white' );
+                               body.removeClass( 'custom-background-empty custom-background-white' );
+               } );
+       } );
+       wp.customize( 'background_image', function( value ) {
+               value.bind( function( to ) {
+                       var body = $( 'body' );
+
+                       if ( '' != to )
+                               body.removeClass( 'custom-background-empty custom-background-white' );
+                       else if ( 'rgb(255, 255, 255)' == body.css( 'background-color' ) )
+                               body.addClass( 'custom-background-white' );
+                       else if ( 'rgb(230, 230, 230)' == body.css( 'background-color' ) && '' == _wpCustomizeSettings.values.background_color )
+                               body.addClass( 'custom-background-empty' );
                } );
        } );
-} )( jQuery );
\ No newline at end of file
+} )( jQuery );
index 2a8843418a0be21c5a126c58192ac1ada6801a59..cf8d7be995a2f05e9de848e9cad65796a7ead7d1 100644 (file)
@@ -2,9 +2,9 @@
 # This file is distributed under the GNU General Public License v2 or later.
 msgid ""
 msgstr ""
-"Project-Id-Version: Twenty Twelve 1.1\n"
+"Project-Id-Version: Twenty Twelve 1.2\n"
 "Report-Msgid-Bugs-To: http://wordpress.org/tags/twentytwelve\n"
-"POT-Creation-Date: 2013-04-26 13:58:46+00:00\n"
+"POT-Creation-Date: 2013-08-01 18:14:15+00:00\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -82,17 +82,16 @@ msgstr ""
 msgid "Comments are closed."
 msgstr ""
 
-#: content-aside.php:13 content-aside.php:20 content-image.php:17
-#: content-link.php:18 content-quote.php:17 content-status.php:15
-#: content.php:23
-msgid "Permalink to %s"
-msgstr ""
-
 #: content-aside.php:15 content-image.php:13 content-link.php:14
 #: content-quote.php:13 content-status.php:21 content.php:39
 msgid "Continue reading <span class=\"meta-nav\">&rarr;</span>"
 msgstr ""
 
+#: content-aside.php:20 content-link.php:18 content-quote.php:17
+#: content-status.php:15
+msgid "Permalink to %s"
+msgstr ""
+
 #: content-aside.php:23 content-image.php:23 content-link.php:21
 #: content-quote.php:20 content-status.php:27 content.php:28
 msgid "Leave a reply"
@@ -109,8 +108,8 @@ msgid "% Replies"
 msgstr ""
 
 #: content-aside.php:26 content-image.php:26 content-link.php:24
-#: content-page.php:21 content-quote.php:23 content-status.php:30
-#: content.php:46 functions.php:309 image.php:37
+#: content-page.php:24 content-quote.php:23 content-status.php:30
+#: content.php:46 functions.php:341 image.php:37
 msgid "Edit"
 msgstr ""
 
@@ -128,7 +127,7 @@ msgid ""
 "related post."
 msgstr ""
 
-#: content-page.php:18 content.php:40 image.php:92
+#: content-page.php:21 content.php:40 image.php:92
 msgid "Pages:"
 msgstr ""
 
@@ -140,7 +139,7 @@ msgstr ""
 msgid "View all posts by %s <span class=\"meta-nav\">&rarr;</span>"
 msgstr ""
 
-#. #-#-#-#-#  twentytwelve.pot (Twenty Twelve 1.1)  #-#-#-#-#
+#. #-#-#-#-#  twentytwelve.pot (Twenty Twelve 1.2)  #-#-#-#-#
 #. Author URI of the plugin/theme
 #: footer.php:17
 msgid "http://wordpress.org/"
@@ -159,111 +158,111 @@ msgid "Primary Menu"
 msgstr ""
 
 #. translators: If there are characters in your language that are not supported
-#.        by Open Sans, translate this to 'off'. Do not translate into your own
+#.      by Open Sans, translate this to 'off'. Do not translate into your own
 #. language.
-#: functions.php:120
+#: functions.php:100
 msgctxt "Open Sans font: on or off"
 msgid "on"
 msgstr ""
 
 #. translators: To add an additional Open Sans character subset specific to
 #. your language, translate
-#.                this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your
+#.              this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your
 #. own language.
-#: functions.php:125
+#: functions.php:105
 msgctxt "Open Sans font: add new subset (greek, cyrillic, vietnamese)"
 msgid "no-subset"
 msgstr ""
 
-#: functions.php:181
+#: functions.php:213
 msgid "Page %s"
 msgstr ""
 
-#: functions.php:206
+#: functions.php:238
 msgid "Main Sidebar"
 msgstr ""
 
-#: functions.php:208
+#: functions.php:240
 msgid ""
 "Appears on posts and pages except the optional Front Page template, which "
 "has its own widgets"
 msgstr ""
 
-#: functions.php:216
+#: functions.php:248
 msgid "First Front Page Widget Area"
 msgstr ""
 
-#: functions.php:218 functions.php:228
+#: functions.php:250 functions.php:260
 msgid ""
 "Appears when using the optional Front Page template with a page set as "
 "Static Front Page"
 msgstr ""
 
-#: functions.php:226
+#: functions.php:258
 msgid "Second Front Page Widget Area"
 msgstr ""
 
-#: functions.php:250 single.php:20
+#: functions.php:282 single.php:20
 msgid "Post navigation"
 msgstr ""
 
-#: functions.php:251
+#: functions.php:283
 msgid "<span class=\"meta-nav\">&larr;</span> Older posts"
 msgstr ""
 
-#: functions.php:252
+#: functions.php:284
 msgid "Newer posts <span class=\"meta-nav\">&rarr;</span>"
 msgstr ""
 
-#: functions.php:277
+#: functions.php:309
 msgid "Pingback:"
 msgstr ""
 
-#: functions.php:277
+#: functions.php:309
 msgid "(Edit)"
 msgstr ""
 
-#: functions.php:292
+#: functions.php:324
 msgid "Post author"
 msgstr ""
 
 #. translators: 1: date, 2: time
-#: functions.php:298
+#: functions.php:330
 msgid "%1$s at %2$s"
 msgstr ""
 
-#: functions.php:304
+#: functions.php:336
 msgid "Your comment is awaiting moderation."
 msgstr ""
 
-#: functions.php:313
+#: functions.php:345
 msgid "Reply"
 msgstr ""
 
 #. Translators: used between list items, there is a space after the comma.
-#: functions.php:332 functions.php:335
+#: functions.php:364 functions.php:367
 msgid ", "
 msgstr ""
 
-#: functions.php:346
+#: functions.php:378
 msgid "View all posts by %s"
 msgstr ""
 
 #. Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's
 #. name.
-#: functions.php:352
+#: functions.php:384
 msgid ""
 "This entry was posted in %1$s and tagged %2$s on %3$s<span class=\"by-author"
 "\"> by %4$s</span>."
 msgstr ""
 
-#: functions.php:354
+#: functions.php:386
 msgid ""
 "This entry was posted in %1$s on %3$s<span class=\"by-author\"> by %4$s</"
 "span>."
 msgstr ""
 
-#: functions.php:356
+#: functions.php:388
 msgid "This entry was posted on %3$s<span class=\"by-author\"> by %4$s</span>."
 msgstr ""
 
@@ -329,7 +328,7 @@ msgid "Twenty Twelve"
 msgstr ""
 
 #. Theme URI of the plugin/theme
-msgid "http://wordpress.org/extend/themes/twentytwelve"
+msgid "http://wordpress.org/themes/twentytwelve"
 msgstr ""
 
 #. Description of the plugin/theme
index cb989a136b26a825c53f0de90a1bde85b9512360..1055f9cca99de447f3009469c7a5e1bed82e1886 100644 (file)
@@ -117,7 +117,7 @@ article.format-link .entry-content {
        left: 0;
        right: auto;
 }
-.comments-area li.bypostauthor cite span {
+.comments-area .bypostauthor cite span {
        margin-right: 5px;
        margin-right: 0.357142857rem;
        margin-left: auto;
index 6b89df372ff0f9a47c7182f22ed4907893be0320..95892b71a46443b304d777696400290937f2367c 100644 (file)
@@ -1,10 +1,10 @@
 /*
 Theme Name: Twenty Twelve
-Theme URI: http://wordpress.org/extend/themes/twentytwelve
+Theme URI: http://wordpress.org/themes/twentytwelve
 Author: the WordPress team
 Author URI: http://wordpress.org/
 Description: The 2012 theme for WordPress is a fully responsive theme that looks great on any device. Features include a front page template with its own widgets, an optional display font, styling for post formats on both index and single views, and an optional no-sidebar page template. Make it yours with a custom menu, header image, and background.
-Version: 1.1
+Version: 1.2
 License: GNU General Public License v2 or later
 License URI: http://www.gnu.org/licenses/gpl-2.0.html
 Tags: light, gray, white, one-column, two-columns, right-sidebar, flexible-width, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready
@@ -214,7 +214,7 @@ textarea {
 }
 button,
 input {
-    line-height: normal;
+       line-height: normal;
 }
 textarea {
        font-size: 100%;
@@ -240,7 +240,7 @@ input[type="submit"],
 input[type="button"],
 input[type="reset"],
 article.post-password-required input[type=submit],
-li.bypostauthor cite span {
+.bypostauthor cite span {
        padding: 6px 10px;
        padding: 0.428571429rem 0.714285714rem;
        font-size: 11px;
@@ -268,7 +268,7 @@ input[type="reset"] {
 }
 button[disabled],
 input[disabled] {
-    cursor: default;
+       cursor: default;
 }
 .menu-toggle:hover,
 button:hover,
@@ -300,9 +300,9 @@ input[type="reset"]:active {
        background-image: -o-linear-gradient(top, #ebebeb, #e1e1e1);
        background-image: linear-gradient(top, #ebebeb, #e1e1e1);
        box-shadow: inset 0 0 8px 2px #c6c6c6, 0 1px 0 0 #f4f4f4;
-       border: none;
+       border-color: transparent;
 }
-li.bypostauthor cite span {
+.bypostauthor cite span {
        color: #fff;
        background-color: #21759b;
        background-image: none;
@@ -505,8 +505,6 @@ a:hover {
        position: absolute !important;
        clip: rect(1px, 1px, 1px, 1px);
 }
-.main-navigation .assistive-text:hover,
-.main-navigation .assistive-text:active,
 .main-navigation .assistive-text:focus {
        background: #fff;
        border: 2px solid #333;
@@ -648,6 +646,9 @@ section[role="banner"] {
 .widget-area .widget a:hover {
        color: #21759b;
 }
+.widget-area .widget a:visited {
+       color: #9f9f9f;
+}
 .widget-area #s {
        width: 53.66666666666%; /* define a width to avoid dropping a wider submit button */
 }
@@ -797,6 +798,10 @@ article.sticky .featured-post {
        margin: 0 0 1.714285714rem;
        line-height: 1.714285714;
 }
+.entry-content a:visited,
+.comment-content a:visited {
+       color: #9f9f9f;
+}
 .entry-content ol,
 .comment-content ol,
 .entry-content ul,
@@ -884,15 +889,19 @@ article.sticky .featured-post {
        margin: 0 0 24px;
        margin: 0 0 1.714285714rem;
 }
-img.alignleft {
+img.alignleft,
+.wp-caption.alignleft {
        margin: 12px 24px 12px 0;
        margin: 0.857142857rem 1.714285714rem 0.857142857rem 0;
 }
-img.alignright {
+img.alignright,
+.wp-caption.alignright {
        margin: 12px 0 12px 24px;
        margin: 0.857142857rem 0 0.857142857rem 1.714285714rem;
 }
-img.aligncenter {
+img.aligncenter,
+.wp-caption.aligncenter {
+       clear: both;
        margin-top: 12px;
        margin-top: 0.857142857rem;
        margin-bottom: 12px;
@@ -1189,6 +1198,9 @@ article.format-quote .entry-content blockquote {
        font-size: 1.071428571rem;
        line-height: 1.42857143;
 }
+.comments-area cite b {
+       font-weight: normal;
+}
 .comments-area article header time {
        line-height: 1.714285714;
        text-decoration: none;
@@ -1229,7 +1241,7 @@ article.format-quote .entry-content blockquote {
        border-radius: 3px;
        border: 1px solid #007cbd;
 }
-.comments-area li.bypostauthor cite span {
+.comments-area .bypostauthor cite span {
        position: absolute;
        margin-left: 5px;
        margin-left: 0.357142857rem;
@@ -1238,6 +1250,9 @@ article.format-quote .entry-content blockquote {
        font-size: 10px;
        font-size: 0.714285714rem;
 }
+.comments-area .bypostauthor cite b {
+       font-weight: bold;
+}
 a.comment-reply-link,
 a.comment-edit-link {
        color: #686868;
diff --git a/wp-includes/ID3/getid3.lib.php b/wp-includes/ID3/getid3.lib.php
new file mode 100644 (file)
index 0000000..f8df233
--- /dev/null
@@ -0,0 +1,1341 @@
+<?php
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org>               //
+//  available at http://getid3.sourceforge.net                 //
+//            or http://www.getid3.org                         //
+/////////////////////////////////////////////////////////////////
+//                                                             //
+// getid3.lib.php - part of getID3()                           //
+// See readme.txt for more details                             //
+//                                                            ///
+/////////////////////////////////////////////////////////////////
+
+
+class getid3_lib
+{
+
+       public static function PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8') {
+               $returnstring = '';
+               for ($i = 0; $i < strlen($string); $i++) {
+                       if ($hex) {
+                               $returnstring .= str_pad(dechex(ord($string{$i})), 2, '0', STR_PAD_LEFT);
+                       } else {
+                               $returnstring .= ' '.(preg_match("#[\x20-\x7E]#", $string{$i}) ? $string{$i} : '¤');
+                       }
+                       if ($spaces) {
+                               $returnstring .= ' ';
+                       }
+               }
+               if (!empty($htmlencoding)) {
+                       if ($htmlencoding === true) {
+                               $htmlencoding = 'UTF-8'; // prior to getID3 v1.9.0 the function's 4th parameter was boolean
+                       }
+                       $returnstring = htmlentities($returnstring, ENT_QUOTES, $htmlencoding);
+               }
+               return $returnstring;
+       }
+
+       public static function trunc($floatnumber) {
+               // truncates a floating-point number at the decimal point
+               // returns int (if possible, otherwise float)
+               if ($floatnumber >= 1) {
+                       $truncatednumber = floor($floatnumber);
+               } elseif ($floatnumber <= -1) {
+                       $truncatednumber = ceil($floatnumber);
+               } else {
+                       $truncatednumber = 0;
+               }
+               if (self::intValueSupported($truncatednumber)) {
+                       $truncatednumber = (int) $truncatednumber;
+               }
+               return $truncatednumber;
+       }
+
+
+       public static function safe_inc(&$variable, $increment=1) {
+               if (isset($variable)) {
+                       $variable += $increment;
+               } else {
+                       $variable = $increment;
+               }
+               return true;
+       }
+
+       public static function CastAsInt($floatnum) {
+               // convert to float if not already
+               $floatnum = (float) $floatnum;
+
+               // convert a float to type int, only if possible
+               if (self::trunc($floatnum) == $floatnum) {
+                       // it's not floating point
+                       if (self::intValueSupported($floatnum)) {
+                               // it's within int range
+                               $floatnum = (int) $floatnum;
+                       }
+               }
+               return $floatnum;
+       }
+
+       public static function intValueSupported($num) {
+               // check if integers are 64-bit
+               static $hasINT64 = null;
+               if ($hasINT64 === null) { // 10x faster than is_null()
+                       $hasINT64 = is_int(pow(2, 31)); // 32-bit int are limited to (2^31)-1
+                       if (!$hasINT64 && !defined('PHP_INT_MIN')) {
+                               define('PHP_INT_MIN', ~PHP_INT_MAX);
+                       }
+               }
+               // if integers are 64-bit - no other check required
+               if ($hasINT64 || (($num <= PHP_INT_MAX) && ($num >= PHP_INT_MIN))) {
+                       return true;
+               }
+               return false;
+       }
+
+       public static function DecimalizeFraction($fraction) {
+               list($numerator, $denominator) = explode('/', $fraction);
+               return $numerator / ($denominator ? $denominator : 1);
+       }
+
+
+       public static function DecimalBinary2Float($binarynumerator) {
+               $numerator   = self::Bin2Dec($binarynumerator);
+               $denominator = self::Bin2Dec('1'.str_repeat('0', strlen($binarynumerator)));
+               return ($numerator / $denominator);
+       }
+
+
+       public static function NormalizeBinaryPoint($binarypointnumber, $maxbits=52) {
+               // http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html
+               if (strpos($binarypointnumber, '.') === false) {
+                       $binarypointnumber = '0.'.$binarypointnumber;
+               } elseif ($binarypointnumber{0} == '.') {
+                       $binarypointnumber = '0'.$binarypointnumber;
+               }
+               $exponent = 0;
+               while (($binarypointnumber{0} != '1') || (substr($binarypointnumber, 1, 1) != '.')) {
+                       if (substr($binarypointnumber, 1, 1) == '.') {
+                               $exponent--;
+                               $binarypointnumber = substr($binarypointnumber, 2, 1).'.'.substr($binarypointnumber, 3);
+                       } else {
+                               $pointpos = strpos($binarypointnumber, '.');
+                               $exponent += ($pointpos - 1);
+                               $binarypointnumber = str_replace('.', '', $binarypointnumber);
+                               $binarypointnumber = $binarypointnumber{0}.'.'.substr($binarypointnumber, 1);
+                       }
+               }
+               $binarypointnumber = str_pad(substr($binarypointnumber, 0, $maxbits + 2), $maxbits + 2, '0', STR_PAD_RIGHT);
+               return array('normalized'=>$binarypointnumber, 'exponent'=>(int) $exponent);
+       }
+
+
+       public static function Float2BinaryDecimal($floatvalue) {
+               // http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html
+               $maxbits = 128; // to how many bits of precision should the calculations be taken?
+               $intpart   = self::trunc($floatvalue);
+               $floatpart = abs($floatvalue - $intpart);
+               $pointbitstring = '';
+               while (($floatpart != 0) && (strlen($pointbitstring) < $maxbits)) {
+                       $floatpart *= 2;
+                       $pointbitstring .= (string) self::trunc($floatpart);
+                       $floatpart -= self::trunc($floatpart);
+               }
+               $binarypointnumber = decbin($intpart).'.'.$pointbitstring;
+               return $binarypointnumber;
+       }
+
+
+       public static function Float2String($floatvalue, $bits) {
+               // http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee-expl.html
+               switch ($bits) {
+                       case 32:
+                               $exponentbits = 8;
+                               $fractionbits = 23;
+                               break;
+
+                       case 64:
+                               $exponentbits = 11;
+                               $fractionbits = 52;
+                               break;
+
+                       default:
+                               return false;
+                               break;
+               }
+               if ($floatvalue >= 0) {
+                       $signbit = '0';
+               } else {
+                       $signbit = '1';
+               }
+               $normalizedbinary  = self::NormalizeBinaryPoint(self::Float2BinaryDecimal($floatvalue), $fractionbits);
+               $biasedexponent    = pow(2, $exponentbits - 1) - 1 + $normalizedbinary['exponent']; // (127 or 1023) +/- exponent
+               $exponentbitstring = str_pad(decbin($biasedexponent), $exponentbits, '0', STR_PAD_LEFT);
+               $fractionbitstring = str_pad(substr($normalizedbinary['normalized'], 2), $fractionbits, '0', STR_PAD_RIGHT);
+
+               return self::BigEndian2String(self::Bin2Dec($signbit.$exponentbitstring.$fractionbitstring), $bits % 8, false);
+       }
+
+
+       public static function LittleEndian2Float($byteword) {
+               return self::BigEndian2Float(strrev($byteword));
+       }
+
+
+       public static function BigEndian2Float($byteword) {
+               // ANSI/IEEE Standard 754-1985, Standard for Binary Floating Point Arithmetic
+               // http://www.psc.edu/general/software/packages/ieee/ieee.html
+               // http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee.html
+
+               $bitword = self::BigEndian2Bin($byteword);
+               if (!$bitword) {
+                       return 0;
+               }
+               $signbit = $bitword{0};
+
+               switch (strlen($byteword) * 8) {
+                       case 32:
+                               $exponentbits = 8;
+                               $fractionbits = 23;
+                               break;
+
+                       case 64:
+                               $exponentbits = 11;
+                               $fractionbits = 52;
+                               break;
+
+                       case 80:
+                               // 80-bit Apple SANE format
+                               // http://www.mactech.com/articles/mactech/Vol.06/06.01/SANENormalized/
+                               $exponentstring = substr($bitword, 1, 15);
+                               $isnormalized = intval($bitword{16});
+                               $fractionstring = substr($bitword, 17, 63);
+                               $exponent = pow(2, self::Bin2Dec($exponentstring) - 16383);
+                               $fraction = $isnormalized + self::DecimalBinary2Float($fractionstring);
+                               $floatvalue = $exponent * $fraction;
+                               if ($signbit == '1') {
+                                       $floatvalue *= -1;
+                               }
+                               return $floatvalue;
+                               break;
+
+                       default:
+                               return false;
+                               break;
+               }
+               $exponentstring = substr($bitword, 1, $exponentbits);
+               $fractionstring = substr($bitword, $exponentbits + 1, $fractionbits);
+               $exponent = self::Bin2Dec($exponentstring);
+               $fraction = self::Bin2Dec($fractionstring);
+
+               if (($exponent == (pow(2, $exponentbits) - 1)) && ($fraction != 0)) {
+                       // Not a Number
+                       $floatvalue = false;
+               } elseif (($exponent == (pow(2, $exponentbits) - 1)) && ($fraction == 0)) {
+                       if ($signbit == '1') {
+                               $floatvalue = '-infinity';
+                       } else {
+                               $floatvalue = '+infinity';
+                       }
+               } elseif (($exponent == 0) && ($fraction == 0)) {
+                       if ($signbit == '1') {
+                               $floatvalue = -0;
+                       } else {
+                               $floatvalue = 0;
+                       }
+                       $floatvalue = ($signbit ? 0 : -0);
+               } elseif (($exponent == 0) && ($fraction != 0)) {
+                       // These are 'unnormalized' values
+                       $floatvalue = pow(2, (-1 * (pow(2, $exponentbits - 1) - 2))) * self::DecimalBinary2Float($fractionstring);
+                       if ($signbit == '1') {
+                               $floatvalue *= -1;
+                       }
+               } elseif ($exponent != 0) {
+                       $floatvalue = pow(2, ($exponent - (pow(2, $exponentbits - 1) - 1))) * (1 + self::DecimalBinary2Float($fractionstring));
+                       if ($signbit == '1') {
+                               $floatvalue *= -1;
+                       }
+               }
+               return (float) $floatvalue;
+       }
+
+
+       public static function BigEndian2Int($byteword, $synchsafe=false, $signed=false) {
+               $intvalue = 0;
+               $bytewordlen = strlen($byteword);
+               if ($bytewordlen == 0) {
+                       return false;
+               }
+               for ($i = 0; $i < $bytewordlen; $i++) {
+                       if ($synchsafe) { // disregard MSB, effectively 7-bit bytes
+                               //$intvalue = $intvalue | (ord($byteword{$i}) & 0x7F) << (($bytewordlen - 1 - $i) * 7); // faster, but runs into problems past 2^31 on 32-bit systems
+                               $intvalue += (ord($byteword{$i}) & 0x7F) * pow(2, ($bytewordlen - 1 - $i) * 7);
+                       } else {
+                               $intvalue += ord($byteword{$i}) * pow(256, ($bytewordlen - 1 - $i));
+                       }
+               }
+               if ($signed && !$synchsafe) {
+                       // synchsafe ints are not allowed to be signed
+                       if ($bytewordlen <= PHP_INT_SIZE) {
+                               $signMaskBit = 0x80 << (8 * ($bytewordlen - 1));
+                               if ($intvalue & $signMaskBit) {
+                                       $intvalue = 0 - ($intvalue & ($signMaskBit - 1));
+                               }
+                       } else {
+                               throw new Exception('ERROR: Cannot have signed integers larger than '.(8 * PHP_INT_SIZE).'-bits ('.strlen($byteword).') in self::BigEndian2Int()');
+                               break;
+                       }
+               }
+               return self::CastAsInt($intvalue);
+       }
+
+
+       public static function LittleEndian2Int($byteword, $signed=false) {
+               return self::BigEndian2Int(strrev($byteword), false, $signed);
+       }
+
+
+       public static function BigEndian2Bin($byteword) {
+               $binvalue = '';
+               $bytewordlen = strlen($byteword);
+               for ($i = 0; $i < $bytewordlen; $i++) {
+                       $binvalue .= str_pad(decbin(ord($byteword{$i})), 8, '0', STR_PAD_LEFT);
+               }
+               return $binvalue;
+       }
+
+
+       public static function BigEndian2String($number, $minbytes=1, $synchsafe=false, $signed=false) {
+               if ($number < 0) {
+                       throw new Exception('ERROR: self::BigEndian2String() does not support negative numbers');
+               }
+               $maskbyte = (($synchsafe || $signed) ? 0x7F : 0xFF);
+               $intstring = '';
+               if ($signed) {
+                       if ($minbytes > PHP_INT_SIZE) {
+                               throw new Exception('ERROR: Cannot have signed integers larger than '.(8 * PHP_INT_SIZE).'-bits in self::BigEndian2String()');
+                       }
+                       $number = $number & (0x80 << (8 * ($minbytes - 1)));
+               }
+               while ($number != 0) {
+                       $quotient = ($number / ($maskbyte + 1));
+                       $intstring = chr(ceil(($quotient - floor($quotient)) * $maskbyte)).$intstring;
+                       $number = floor($quotient);
+               }
+               return str_pad($intstring, $minbytes, "\x00", STR_PAD_LEFT);
+       }
+
+
+       public static function Dec2Bin($number) {
+               while ($number >= 256) {
+                       $bytes[] = (($number / 256) - (floor($number / 256))) * 256;
+                       $number = floor($number / 256);
+               }
+               $bytes[] = $number;
+               $binstring = '';
+               for ($i = 0; $i < count($bytes); $i++) {
+                       $binstring = (($i == count($bytes) - 1) ? decbin($bytes[$i]) : str_pad(decbin($bytes[$i]), 8, '0', STR_PAD_LEFT)).$binstring;
+               }
+               return $binstring;
+       }
+
+
+       public static function Bin2Dec($binstring, $signed=false) {
+               $signmult = 1;
+               if ($signed) {
+                       if ($binstring{0} == '1') {
+                               $signmult = -1;
+                       }
+                       $binstring = substr($binstring, 1);
+               }
+               $decvalue = 0;
+               for ($i = 0; $i < strlen($binstring); $i++) {
+                       $decvalue += ((int) substr($binstring, strlen($binstring) - $i - 1, 1)) * pow(2, $i);
+               }
+               return self::CastAsInt($decvalue * $signmult);
+       }
+
+
+       public static function Bin2String($binstring) {
+               // return 'hi' for input of '0110100001101001'
+               $string = '';
+               $binstringreversed = strrev($binstring);
+               for ($i = 0; $i < strlen($binstringreversed); $i += 8) {
+                       $string = chr(self::Bin2Dec(strrev(substr($binstringreversed, $i, 8)))).$string;
+               }
+               return $string;
+       }
+
+
+       public static function LittleEndian2String($number, $minbytes=1, $synchsafe=false) {
+               $intstring = '';
+               while ($number > 0) {
+                       if ($synchsafe) {
+                               $intstring = $intstring.chr($number & 127);
+                               $number >>= 7;
+                       } else {
+                               $intstring = $intstring.chr($number & 255);
+                               $number >>= 8;
+                       }
+               }
+               return str_pad($intstring, $minbytes, "\x00", STR_PAD_RIGHT);
+       }
+
+
+       public static function array_merge_clobber($array1, $array2) {
+               // written by kcØhireability*com
+               // taken from http://www.php.net/manual/en/function.array-merge-recursive.php
+               if (!is_array($array1) || !is_array($array2)) {
+                       return false;
+               }
+               $newarray = $array1;
+               foreach ($array2 as $key => $val) {
+                       if (is_array($val) && isset($newarray[$key]) && is_array($newarray[$key])) {
+                               $newarray[$key] = self::array_merge_clobber($newarray[$key], $val);
+                       } else {
+                               $newarray[$key] = $val;
+                       }
+               }
+               return $newarray;
+       }
+
+
+       public static function array_merge_noclobber($array1, $array2) {
+               if (!is_array($array1) || !is_array($array2)) {
+                       return false;
+               }
+               $newarray = $array1;
+               foreach ($array2 as $key => $val) {
+                       if (is_array($val) && isset($newarray[$key]) && is_array($newarray[$key])) {
+                               $newarray[$key] = self::array_merge_noclobber($newarray[$key], $val);
+                       } elseif (!isset($newarray[$key])) {
+                               $newarray[$key] = $val;
+                       }
+               }
+               return $newarray;
+       }
+
+
+       public static function ksort_recursive(&$theArray) {
+               ksort($theArray);
+               foreach ($theArray as $key => $value) {
+                       if (is_array($value)) {
+                               self::ksort_recursive($theArray[$key]);
+                       }
+               }
+               return true;
+       }
+
+       public static function fileextension($filename, $numextensions=1) {
+               if (strstr($filename, '.')) {
+                       $reversedfilename = strrev($filename);
+                       $offset = 0;
+                       for ($i = 0; $i < $numextensions; $i++) {
+                               $offset = strpos($reversedfilename, '.', $offset + 1);
+                               if ($offset === false) {
+                                       return '';
+                               }
+                       }
+                       return strrev(substr($reversedfilename, 0, $offset));
+               }
+               return '';
+       }
+
+
+       public static function PlaytimeString($seconds) {
+               $sign = (($seconds < 0) ? '-' : '');
+               $seconds = round(abs($seconds));
+               $H = (int) floor( $seconds                            / 3600);
+               $M = (int) floor(($seconds - (3600 * $H)            ) /   60);
+               $S = (int) round( $seconds - (3600 * $H) - (60 * $M)        );
+               return $sign.($H ? $H.':' : '').($H ? str_pad($M, 2, '0', STR_PAD_LEFT) : intval($M)).':'.str_pad($S, 2, 0, STR_PAD_LEFT);
+       }
+
+
+       public static function DateMac2Unix($macdate) {
+               // Macintosh timestamp: seconds since 00:00h January 1, 1904
+               // UNIX timestamp:      seconds since 00:00h January 1, 1970
+               return self::CastAsInt($macdate - 2082844800);
+       }
+
+
+       public static function FixedPoint8_8($rawdata) {
+               return self::BigEndian2Int(substr($rawdata, 0, 1)) + (float) (self::BigEndian2Int(substr($rawdata, 1, 1)) / pow(2, 8));
+       }
+
+
+       public static function FixedPoint16_16($rawdata) {
+               return self::BigEndian2Int(substr($rawdata, 0, 2)) + (float) (self::BigEndian2Int(substr($rawdata, 2, 2)) / pow(2, 16));
+       }
+
+
+       public static function FixedPoint2_30($rawdata) {
+               $binarystring = self::BigEndian2Bin($rawdata);
+               return self::Bin2Dec(substr($binarystring, 0, 2)) + (float) (self::Bin2Dec(substr($binarystring, 2, 30)) / pow(2, 30));
+       }
+
+
+       public static function CreateDeepArray($ArrayPath, $Separator, $Value) {
+               // assigns $Value to a nested array path:
+               //   $foo = self::CreateDeepArray('/path/to/my', '/', 'file.txt')
+               // is the same as:
+               //   $foo = array('path'=>array('to'=>'array('my'=>array('file.txt'))));
+               // or
+               //   $foo['path']['to']['my'] = 'file.txt';
+               $ArrayPath = ltrim($ArrayPath, $Separator);
+               if (($pos = strpos($ArrayPath, $Separator)) !== false) {
+                       $ReturnedArray[substr($ArrayPath, 0, $pos)] = self::CreateDeepArray(substr($ArrayPath, $pos + 1), $Separator, $Value);
+               } else {
+                       $ReturnedArray[$ArrayPath] = $Value;
+               }
+               return $ReturnedArray;
+       }
+
+       public static function array_max($arraydata, $returnkey=false) {
+               $maxvalue = false;
+               $maxkey = false;
+               foreach ($arraydata as $key => $value) {
+                       if (!is_array($value)) {
+                               if ($value > $maxvalue) {
+                                       $maxvalue = $value;
+                                       $maxkey = $key;
+                               }
+                       }
+               }
+               return ($returnkey ? $maxkey : $maxvalue);
+       }
+
+       public static function array_min($arraydata, $returnkey=false) {
+               $minvalue = false;
+               $minkey = false;
+               foreach ($arraydata as $key => $value) {
+                       if (!is_array($value)) {
+                               if ($value > $minvalue) {
+                                       $minvalue = $value;
+                                       $minkey = $key;
+                               }
+                       }
+               }
+               return ($returnkey ? $minkey : $minvalue);
+       }
+
+       public static function XML2array($XMLstring) {
+               if (function_exists('simplexml_load_string')) {
+                       if (function_exists('get_object_vars')) {
+                               $XMLobject = simplexml_load_string($XMLstring);
+                               return self::SimpleXMLelement2array($XMLobject);
+                       }
+               }
+               return false;
+       }
+
+       public static function SimpleXMLelement2array($XMLobject) {
+               if (!is_object($XMLobject) && !is_array($XMLobject)) {
+                       return $XMLobject;
+               }
+               $XMLarray = (is_object($XMLobject) ? get_object_vars($XMLobject) : $XMLobject);
+               foreach ($XMLarray as $key => $value) {
+                       $XMLarray[$key] = self::SimpleXMLelement2array($value);
+               }
+               return $XMLarray;
+       }
+
+
+       // Allan Hansen <ahØartemis*dk>
+       // self::md5_data() - returns md5sum for a file from startuing position to absolute end position
+       public static function hash_data($file, $offset, $end, $algorithm) {
+               static $tempdir = '';
+               if (!self::intValueSupported($end)) {
+                       return false;
+               }
+               switch ($algorithm) {
+                       case 'md5':
+                               $hash_function = 'md5_file';
+                               $unix_call     = 'md5sum';
+                               $windows_call  = 'md5sum.exe';
+                               $hash_length   = 32;
+                               break;
+
+                       case 'sha1':
+                               $hash_function = 'sha1_file';
+                               $unix_call     = 'sha1sum';
+                               $windows_call  = 'sha1sum.exe';
+                               $hash_length   = 40;
+                               break;
+
+                       default:
+                               throw new Exception('Invalid algorithm ('.$algorithm.') in self::hash_data()');
+                               break;
+               }
+               $size = $end - $offset;
+               while (true) {
+                       if (GETID3_OS_ISWINDOWS) {
+
+                               // It seems that sha1sum.exe for Windows only works on physical files, does not accept piped data
+                               // Fall back to create-temp-file method:
+                               if ($algorithm == 'sha1') {
+                                       break;
+                               }
+
+                               $RequiredFiles = array('cygwin1.dll', 'head.exe', 'tail.exe', $windows_call);
+                               foreach ($RequiredFiles as $required_file) {
+                                       if (!is_readable(GETID3_HELPERAPPSDIR.$required_file)) {
+                                               // helper apps not available - fall back to old method
+                                               break 2;
+                                       }
+                               }
+                               $commandline  = GETID3_HELPERAPPSDIR.'head.exe -c '.$end.' '.escapeshellarg(str_replace('/', DIRECTORY_SEPARATOR, $file)).' | ';
+                               $commandline .= GETID3_HELPERAPPSDIR.'tail.exe -c '.$size.' | ';
+                               $commandline .= GETID3_HELPERAPPSDIR.$windows_call;
+
+                       } else {
+
+                               $commandline  = 'head -c'.$end.' '.escapeshellarg($file).' | ';
+                               $commandline .= 'tail -c'.$size.' | ';
+                               $commandline .= $unix_call;
+
+                       }
+                       if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) {
+                               //throw new Exception('PHP running in Safe Mode - backtick operator not available, using slower non-system-call '.$algorithm.' algorithm');
+                               break;
+                       }
+                       return substr(`$commandline`, 0, $hash_length);
+               }
+
+               if (empty($tempdir)) {
+                       // yes this is ugly, feel free to suggest a better way
+                       require_once(dirname(__FILE__).'/getid3.php');
+                       $getid3_temp = new getID3();
+                       $tempdir = $getid3_temp->tempdir;
+                       unset($getid3_temp);
+               }
+               // try to create a temporary file in the system temp directory - invalid dirname should force to system temp dir
+               if (($data_filename = tempnam($tempdir, 'gI3')) === false) {
+                       // can't find anywhere to create a temp file, just fail
+                       return false;
+               }
+
+               // Init
+               $result = false;
+
+               // copy parts of file
+               try {
+                       self::CopyFileParts($file, $data_filename, $offset, $end - $offset);
+                       $result = $hash_function($data_filename);
+               } catch (Exception $e) {
+                       throw new Exception('self::CopyFileParts() failed in getid_lib::hash_data(): '.$e->getMessage());
+               }
+               unlink($data_filename);
+               return $result;
+       }
+
+       public static function CopyFileParts($filename_source, $filename_dest, $offset, $length) {
+               if (!self::intValueSupported($offset + $length)) {
+                       throw new Exception('cannot copy file portion, it extends beyond the '.round(PHP_INT_MAX / 1073741824).'GB limit');
+               }
+               if (is_readable($filename_source) && is_file($filename_source) && ($fp_src = fopen($filename_source, 'rb'))) {
+                       if (($fp_dest = fopen($filename_dest, 'wb'))) {
+                               if (fseek($fp_src, $offset, SEEK_SET) == 0) {
+                                       $byteslefttowrite = $length;
+                                       while (($byteslefttowrite > 0) && ($buffer = fread($fp_src, min($byteslefttowrite, getID3::FREAD_BUFFER_SIZE)))) {
+                                               $byteswritten = fwrite($fp_dest, $buffer, $byteslefttowrite);
+                                               $byteslefttowrite -= $byteswritten;
+                                       }
+                                       return true;
+                               } else {
+                                       throw new Exception('failed to seek to offset '.$offset.' in '.$filename_source);
+                               }
+                               fclose($fp_dest);
+                       } else {
+                               throw new Exception('failed to create file for writing '.$filename_dest);
+                       }
+                       fclose($fp_src);
+               } else {
+                       throw new Exception('failed to open file for reading '.$filename_source);
+               }
+               return false;
+       }
+
+       public static function iconv_fallback_int_utf8($charval) {
+               if ($charval < 128) {
+                       // 0bbbbbbb
+                       $newcharstring = chr($charval);
+               } elseif ($charval < 2048) {
+                       // 110bbbbb 10bbbbbb
+                       $newcharstring  = chr(($charval >>   6) | 0xC0);
+                       $newcharstring .= chr(($charval & 0x3F) | 0x80);
+               } elseif ($charval < 65536) {
+                       // 1110bbbb 10bbbbbb 10bbbbbb
+                       $newcharstring  = chr(($charval >>  12) | 0xE0);
+                       $newcharstring .= chr(($charval >>   6) | 0xC0);
+                       $newcharstring .= chr(($charval & 0x3F) | 0x80);
+               } else {
+                       // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb
+                       $newcharstring  = chr(($charval >>  18) | 0xF0);
+                       $newcharstring .= chr(($charval >>  12) | 0xC0);
+                       $newcharstring .= chr(($charval >>   6) | 0xC0);
+                       $newcharstring .= chr(($charval & 0x3F) | 0x80);
+               }
+               return $newcharstring;
+       }
+
+       // ISO-8859-1 => UTF-8
+       public static function iconv_fallback_iso88591_utf8($string, $bom=false) {
+               if (function_exists('utf8_encode')) {
+                       return utf8_encode($string);
+               }
+               // utf8_encode() unavailable, use getID3()'s iconv_fallback() conversions (possibly PHP is compiled without XML support)
+               $newcharstring = '';
+               if ($bom) {
+                       $newcharstring .= "\xEF\xBB\xBF";
+               }
+               for ($i = 0; $i < strlen($string); $i++) {
+                       $charval = ord($string{$i});
+                       $newcharstring .= self::iconv_fallback_int_utf8($charval);
+               }
+               return $newcharstring;
+       }
+
+       // ISO-8859-1 => UTF-16BE
+       public static function iconv_fallback_iso88591_utf16be($string, $bom=false) {
+               $newcharstring = '';
+               if ($bom) {
+                       $newcharstring .= "\xFE\xFF";
+               }
+               for ($i = 0; $i < strlen($string); $i++) {
+                       $newcharstring .= "\x00".$string{$i};
+               }
+               return $newcharstring;
+       }
+
+       // ISO-8859-1 => UTF-16LE
+       public static function iconv_fallback_iso88591_utf16le($string, $bom=false) {
+               $newcharstring = '';
+               if ($bom) {
+                       $newcharstring .= "\xFF\xFE";
+               }
+               for ($i = 0; $i < strlen($string); $i++) {
+                       $newcharstring .= $string{$i}."\x00";
+               }
+               return $newcharstring;
+       }
+
+       // ISO-8859-1 => UTF-16LE (BOM)
+       public static function iconv_fallback_iso88591_utf16($string) {
+               return self::iconv_fallback_iso88591_utf16le($string, true);
+       }
+
+       // UTF-8 => ISO-8859-1
+       public static function iconv_fallback_utf8_iso88591($string) {
+               if (function_exists('utf8_decode')) {
+                       return utf8_decode($string);
+               }
+               // utf8_decode() unavailable, use getID3()'s iconv_fallback() conversions (possibly PHP is compiled without XML support)
+               $newcharstring = '';
+               $offset = 0;
+               $stringlength = strlen($string);
+               while ($offset < $stringlength) {
+                       if ((ord($string{$offset}) | 0x07) == 0xF7) {
+                               // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb
+                               $charval = ((ord($string{($offset + 0)}) & 0x07) << 18) &
+                                                  ((ord($string{($offset + 1)}) & 0x3F) << 12) &
+                                                  ((ord($string{($offset + 2)}) & 0x3F) <<  6) &
+                                                       (ord($string{($offset + 3)}) & 0x3F);
+                               $offset += 4;
+                       } elseif ((ord($string{$offset}) | 0x0F) == 0xEF) {
+                               // 1110bbbb 10bbbbbb 10bbbbbb
+                               $charval = ((ord($string{($offset + 0)}) & 0x0F) << 12) &
+                                                  ((ord($string{($offset + 1)}) & 0x3F) <<  6) &
+                                                       (ord($string{($offset + 2)}) & 0x3F);
+                               $offset += 3;
+                       } elseif ((ord($string{$offset}) | 0x1F) == 0xDF) {
+                               // 110bbbbb 10bbbbbb
+                               $charval = ((ord($string{($offset + 0)}) & 0x1F) <<  6) &
+                                                       (ord($string{($offset + 1)}) & 0x3F);
+                               $offset += 2;
+                       } elseif ((ord($string{$offset}) | 0x7F) == 0x7F) {
+                               // 0bbbbbbb
+                               $charval = ord($string{$offset});
+                               $offset += 1;
+                       } else {
+                               // error? throw some kind of warning here?
+                               $charval = false;
+                               $offset += 1;
+                       }
+                       if ($charval !== false) {
+                               $newcharstring .= (($charval < 256) ? chr($charval) : '?');
+                       }
+               }
+               return $newcharstring;
+       }
+
+       // UTF-8 => UTF-16BE
+       public static function iconv_fallback_utf8_utf16be($string, $bom=false) {
+               $newcharstring = '';
+               if ($bom) {
+                       $newcharstring .= "\xFE\xFF";
+               }
+               $offset = 0;
+               $stringlength = strlen($string);
+               while ($offset < $stringlength) {
+                       if ((ord($string{$offset}) | 0x07) == 0xF7) {
+                               // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb
+                               $charval = ((ord($string{($offset + 0)}) & 0x07) << 18) &
+                                                  ((ord($string{($offset + 1)}) & 0x3F) << 12) &
+                                                  ((ord($string{($offset + 2)}) & 0x3F) <<  6) &
+                                                       (ord($string{($offset + 3)}) & 0x3F);
+                               $offset += 4;
+                       } elseif ((ord($string{$offset}) | 0x0F) == 0xEF) {
+                               // 1110bbbb 10bbbbbb 10bbbbbb
+                               $charval = ((ord($string{($offset + 0)}) & 0x0F) << 12) &
+                                                  ((ord($string{($offset + 1)}) & 0x3F) <<  6) &
+                                                       (ord($string{($offset + 2)}) & 0x3F);
+                               $offset += 3;
+                       } elseif ((ord($string{$offset}) | 0x1F) == 0xDF) {
+                               // 110bbbbb 10bbbbbb
+                               $charval = ((ord($string{($offset + 0)}) & 0x1F) <<  6) &
+                                                       (ord($string{($offset + 1)}) & 0x3F);
+                               $offset += 2;
+                       } elseif ((ord($string{$offset}) | 0x7F) == 0x7F) {
+                               // 0bbbbbbb
+                               $charval = ord($string{$offset});
+                               $offset += 1;
+                       } else {
+                               // error? throw some kind of warning here?
+                               $charval = false;
+                               $offset += 1;
+                       }
+                       if ($charval !== false) {
+                               $newcharstring .= (($charval < 65536) ? self::BigEndian2String($charval, 2) : "\x00".'?');
+                       }
+               }
+               return $newcharstring;
+       }
+
+       // UTF-8 => UTF-16LE
+       public static function iconv_fallback_utf8_utf16le($string, $bom=false) {
+               $newcharstring = '';
+               if ($bom) {
+                       $newcharstring .= "\xFF\xFE";
+               }
+               $offset = 0;
+               $stringlength = strlen($string);
+               while ($offset < $stringlength) {
+                       if ((ord($string{$offset}) | 0x07) == 0xF7) {
+                               // 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb
+                               $charval = ((ord($string{($offset + 0)}) & 0x07) << 18) &
+                                                  ((ord($string{($offset + 1)}) & 0x3F) << 12) &
+                                                  ((ord($string{($offset + 2)}) & 0x3F) <<  6) &
+                                                       (ord($string{($offset + 3)}) & 0x3F);
+                               $offset += 4;
+                       } elseif ((ord($string{$offset}) | 0x0F) == 0xEF) {
+                               // 1110bbbb 10bbbbbb 10bbbbbb
+                               $charval = ((ord($string{($offset + 0)}) & 0x0F) << 12) &
+                                                  ((ord($string{($offset + 1)}) & 0x3F) <<  6) &
+                                                       (ord($string{($offset + 2)}) & 0x3F);
+                               $offset += 3;
+                       } elseif ((ord($string{$offset}) | 0x1F) == 0xDF) {
+                               // 110bbbbb 10bbbbbb
+                               $charval = ((ord($string{($offset + 0)}) & 0x1F) <<  6) &
+                                                       (ord($string{($offset + 1)}) & 0x3F);
+                               $offset += 2;
+                       } elseif ((ord($string{$offset}) | 0x7F) == 0x7F) {
+                               // 0bbbbbbb
+                               $charval = ord($string{$offset});
+                               $offset += 1;
+                       } else {
+                               // error? maybe throw some warning here?
+                               $charval = false;
+                               $offset += 1;
+                       }
+                       if ($charval !== false) {
+                               $newcharstring .= (($charval < 65536) ? self::LittleEndian2String($charval, 2) : '?'."\x00");
+                       }
+               }
+               return $newcharstring;
+       }
+
+       // UTF-8 => UTF-16LE (BOM)
+       public static function iconv_fallback_utf8_utf16($string) {
+               return self::iconv_fallback_utf8_utf16le($string, true);
+       }
+
+       // UTF-16BE => UTF-8
+       public static function iconv_fallback_utf16be_utf8($string) {
+               if (substr($string, 0, 2) == "\xFE\xFF") {
+                       // strip BOM
+                       $string = substr($string, 2);
+               }
+               $newcharstring = '';
+               for ($i = 0; $i < strlen($string); $i += 2) {
+                       $charval = self::BigEndian2Int(substr($string, $i, 2));
+                       $newcharstring .= self::iconv_fallback_int_utf8($charval);
+               }
+               return $newcharstring;
+       }
+
+       // UTF-16LE => UTF-8
+       public static function iconv_fallback_utf16le_utf8($string) {
+               if (substr($string, 0, 2) == "\xFF\xFE") {
+                       // strip BOM
+                       $string = substr($string, 2);
+               }
+               $newcharstring = '';
+               for ($i = 0; $i < strlen($string); $i += 2) {
+                       $charval = self::LittleEndian2Int(substr($string, $i, 2));
+                       $newcharstring .= self::iconv_fallback_int_utf8($charval);
+               }
+               return $newcharstring;
+       }
+
+       // UTF-16BE => ISO-8859-1
+       public static function iconv_fallback_utf16be_iso88591($string) {
+               if (substr($string, 0, 2) == "\xFE\xFF") {
+                       // strip BOM
+                       $string = substr($string, 2);
+               }
+               $newcharstring = '';
+               for ($i = 0; $i < strlen($string); $i += 2) {
+                       $charval = self::BigEndian2Int(substr($string, $i, 2));
+                       $newcharstring .= (($charval < 256) ? chr($charval) : '?');
+               }
+               return $newcharstring;
+       }
+
+       // UTF-16LE => ISO-8859-1
+       public static function iconv_fallback_utf16le_iso88591($string) {
+               if (substr($string, 0, 2) == "\xFF\xFE") {
+                       // strip BOM
+                       $string = substr($string, 2);
+               }
+               $newcharstring = '';
+               for ($i = 0; $i < strlen($string); $i += 2) {
+                       $charval = self::LittleEndian2Int(substr($string, $i, 2));
+                       $newcharstring .= (($charval < 256) ? chr($charval) : '?');
+               }
+               return $newcharstring;
+       }
+
+       // UTF-16 (BOM) => ISO-8859-1
+       public static function iconv_fallback_utf16_iso88591($string) {
+               $bom = substr($string, 0, 2);
+               if ($bom == "\xFE\xFF") {
+                       return self::iconv_fallback_utf16be_iso88591(substr($string, 2));
+               } elseif ($bom == "\xFF\xFE") {
+                       return self::iconv_fallback_utf16le_iso88591(substr($string, 2));
+               }
+               return $string;
+       }
+
+       // UTF-16 (BOM) => UTF-8
+       public static function iconv_fallback_utf16_utf8($string) {
+               $bom = substr($string, 0, 2);
+               if ($bom == "\xFE\xFF") {
+                       return self::iconv_fallback_utf16be_utf8(substr($string, 2));
+               } elseif ($bom == "\xFF\xFE") {
+                       return self::iconv_fallback_utf16le_utf8(substr($string, 2));
+               }
+               return $string;
+       }
+
+       public static function iconv_fallback($in_charset, $out_charset, $string) {
+
+               if ($in_charset == $out_charset) {
+                       return $string;
+               }
+
+               // iconv() availble
+               if (function_exists('iconv')) {
+                       if ($converted_string = @iconv($in_charset, $out_charset.'//TRANSLIT', $string)) {
+                               switch ($out_charset) {
+                                       case 'ISO-8859-1':
+                                               $converted_string = rtrim($converted_string, "\x00");
+                                               break;
+                               }
+                               return $converted_string;
+                       }
+
+                       // iconv() may sometimes fail with "illegal character in input string" error message
+                       // and return an empty string, but returning the unconverted string is more useful
+                       return $string;
+               }
+
+
+               // iconv() not available
+               static $ConversionFunctionList = array();
+               if (empty($ConversionFunctionList)) {
+                       $ConversionFunctionList['ISO-8859-1']['UTF-8']    = 'iconv_fallback_iso88591_utf8';
+                       $ConversionFunctionList['ISO-8859-1']['UTF-16']   = 'iconv_fallback_iso88591_utf16';
+                       $ConversionFunctionList['ISO-8859-1']['UTF-16BE'] = 'iconv_fallback_iso88591_utf16be';
+                       $ConversionFunctionList['ISO-8859-1']['UTF-16LE'] = 'iconv_fallback_iso88591_utf16le';
+                       $ConversionFunctionList['UTF-8']['ISO-8859-1']    = 'iconv_fallback_utf8_iso88591';
+                       $ConversionFunctionList['UTF-8']['UTF-16']        = 'iconv_fallback_utf8_utf16';
+                       $ConversionFunctionList['UTF-8']['UTF-16BE']      = 'iconv_fallback_utf8_utf16be';
+                       $ConversionFunctionList['UTF-8']['UTF-16LE']      = 'iconv_fallback_utf8_utf16le';
+                       $ConversionFunctionList['UTF-16']['ISO-8859-1']   = 'iconv_fallback_utf16_iso88591';
+                       $ConversionFunctionList['UTF-16']['UTF-8']        = 'iconv_fallback_utf16_utf8';
+                       $ConversionFunctionList['UTF-16LE']['ISO-8859-1'] = 'iconv_fallback_utf16le_iso88591';
+                       $ConversionFunctionList['UTF-16LE']['UTF-8']      = 'iconv_fallback_utf16le_utf8';
+                       $ConversionFunctionList['UTF-16BE']['ISO-8859-1'] = 'iconv_fallback_utf16be_iso88591';
+                       $ConversionFunctionList['UTF-16BE']['UTF-8']      = 'iconv_fallback_utf16be_utf8';
+               }
+               if (isset($ConversionFunctionList[strtoupper($in_charset)][strtoupper($out_charset)])) {
+                       $ConversionFunction = $ConversionFunctionList[strtoupper($in_charset)][strtoupper($out_charset)];
+                       return self::$ConversionFunction($string);
+               }
+               throw new Exception('PHP does not have iconv() support - cannot convert from '.$in_charset.' to '.$out_charset);
+       }
+
+
+       public static function MultiByteCharString2HTML($string, $charset='ISO-8859-1') {
+               $string = (string) $string; // in case trying to pass a numeric (float, int) string, would otherwise return an empty string
+               $HTMLstring = '';
+
+               switch ($charset) {
+                       case '1251':
+                       case '1252':
+                       case '866':
+                       case '932':
+                       case '936':
+                       case '950':
+                       case 'BIG5':
+                       case 'BIG5-HKSCS':
+                       case 'cp1251':
+                       case 'cp1252':
+                       case 'cp866':
+                       case 'EUC-JP':
+                       case 'EUCJP':
+                       case 'GB2312':
+                       case 'ibm866':
+                       case 'ISO-8859-1':
+                       case 'ISO-8859-15':
+                       case 'ISO8859-1':
+                       case 'ISO8859-15':
+                       case 'KOI8-R':
+                       case 'koi8-ru':
+                       case 'koi8r':
+                       case 'Shift_JIS':
+                       case 'SJIS':
+                       case 'win-1251':
+                       case 'Windows-1251':
+                       case 'Windows-1252':
+                               $HTMLstring = htmlentities($string, ENT_COMPAT, $charset);
+                               break;
+
+                       case 'UTF-8':
+                               $strlen = strlen($string);
+                               for ($i = 0; $i < $strlen; $i++) {
+                                       $char_ord_val = ord($string{$i});
+                                       $charval = 0;
+                                       if ($char_ord_val < 0x80) {
+                                               $charval = $char_ord_val;
+                                       } elseif ((($char_ord_val & 0xF0) >> 4) == 0x0F  &&  $i+3 < $strlen) {
+                                               $charval  = (($char_ord_val & 0x07) << 18);
+                                               $charval += ((ord($string{++$i}) & 0x3F) << 12);
+                                               $charval += ((ord($string{++$i}) & 0x3F) << 6);
+                                               $charval +=  (ord($string{++$i}) & 0x3F);
+                                       } elseif ((($char_ord_val & 0xE0) >> 5) == 0x07  &&  $i+2 < $strlen) {
+                                               $charval  = (($char_ord_val & 0x0F) << 12);
+                                               $charval += ((ord($string{++$i}) & 0x3F) << 6);
+                                               $charval +=  (ord($string{++$i}) & 0x3F);
+                                       } elseif ((($char_ord_val & 0xC0) >> 6) == 0x03  &&  $i+1 < $strlen) {
+                                               $charval  = (($char_ord_val & 0x1F) << 6);
+                                               $charval += (ord($string{++$i}) & 0x3F);
+                                       }
+                                       if (($charval >= 32) && ($charval <= 127)) {
+                                               $HTMLstring .= htmlentities(chr($charval));
+                                       } else {
+                                               $HTMLstring .= '&#'.$charval.';';
+                                       }
+                               }
+                               break;
+
+                       case 'UTF-16LE':
+                               for ($i = 0; $i < strlen($string); $i += 2) {
+                                       $charval = self::LittleEndian2Int(substr($string, $i, 2));
+                                       if (($charval >= 32) && ($charval <= 127)) {
+                                               $HTMLstring .= chr($charval);
+                                       } else {
+                                               $HTMLstring .= '&#'.$charval.';';
+                                       }
+                               }
+                               break;
+
+                       case 'UTF-16BE':
+                               for ($i = 0; $i < strlen($string); $i += 2) {
+                                       $charval = self::BigEndian2Int(substr($string, $i, 2));
+                                       if (($charval >= 32) && ($charval <= 127)) {
+                                               $HTMLstring .= chr($charval);
+                                       } else {
+                                               $HTMLstring .= '&#'.$charval.';';
+                                       }
+                               }
+                               break;
+
+                       default:
+                               $HTMLstring = 'ERROR: Character set "'.$charset.'" not supported in MultiByteCharString2HTML()';
+                               break;
+               }
+               return $HTMLstring;
+       }
+
+
+
+       public static function RGADnameLookup($namecode) {
+               static $RGADname = array();
+               if (empty($RGADname)) {
+                       $RGADname[0] = 'not set';
+                       $RGADname[1] = 'Track Gain Adjustment';
+                       $RGADname[2] = 'Album Gain Adjustment';
+               }
+
+               return (isset($RGADname[$namecode]) ? $RGADname[$namecode] : '');
+       }
+
+
+       public static function RGADoriginatorLookup($originatorcode) {
+               static $RGADoriginator = array();
+               if (empty($RGADoriginator)) {
+                       $RGADoriginator[0] = 'unspecified';
+                       $RGADoriginator[1] = 'pre-set by artist/producer/mastering engineer';
+                       $RGADoriginator[2] = 'set by user';
+                       $RGADoriginator[3] = 'determined automatically';
+               }
+
+               return (isset($RGADoriginator[$originatorcode]) ? $RGADoriginator[$originatorcode] : '');
+       }
+
+
+       public static function RGADadjustmentLookup($rawadjustment, $signbit) {
+               $adjustment = $rawadjustment / 10;
+               if ($signbit == 1) {
+                       $adjustment *= -1;
+               }
+               return (float) $adjustment;
+       }
+
+
+       public static function RGADgainString($namecode, $originatorcode, $replaygain) {
+               if ($replaygain < 0) {
+                       $signbit = '1';
+               } else {
+                       $signbit = '0';
+               }
+               $storedreplaygain = intval(round($replaygain * 10));
+               $gainstring  = str_pad(decbin($namecode), 3, '0', STR_PAD_LEFT);
+               $gainstring .= str_pad(decbin($originatorcode), 3, '0', STR_PAD_LEFT);
+               $gainstring .= $signbit;
+               $gainstring .= str_pad(decbin($storedreplaygain), 9, '0', STR_PAD_LEFT);
+
+               return $gainstring;
+       }
+
+       public static function RGADamplitude2dB($amplitude) {
+               return 20 * log10($amplitude);
+       }
+
+
+       public static function GetDataImageSize($imgData, &$imageinfo=array()) {
+               static $tempdir = '';
+               if (empty($tempdir)) {
+                       // yes this is ugly, feel free to suggest a better way
+                       require_once(dirname(__FILE__).'/getid3.php');
+                       $getid3_temp = new getID3();
+                       $tempdir = $getid3_temp->tempdir;
+                       unset($getid3_temp);
+               }
+               $GetDataImageSize = false;
+               if ($tempfilename = tempnam($tempdir, 'gI3')) {
+                       if (is_writable($tempfilename) && is_file($tempfilename) && ($tmp = fopen($tempfilename, 'wb'))) {
+                               fwrite($tmp, $imgData);
+                               fclose($tmp);
+                               $GetDataImageSize = @getimagesize($tempfilename, $imageinfo);
+                       }
+                       unlink($tempfilename);
+               }
+               return $GetDataImageSize;
+       }
+
+       public static function ImageExtFromMime($mime_type) {
+               // temporary way, works OK for now, but should be reworked in the future
+               return str_replace(array('image/', 'x-', 'jpeg'), array('', '', 'jpg'), $mime_type);
+       }
+
+       public static function ImageTypesLookup($imagetypeid) {
+               static $ImageTypesLookup = array();
+               if (empty($ImageTypesLookup)) {
+                       $ImageTypesLookup[1]  = 'gif';
+                       $ImageTypesLookup[2]  = 'jpeg';
+                       $ImageTypesLookup[3]  = 'png';
+                       $ImageTypesLookup[4]  = 'swf';
+                       $ImageTypesLookup[5]  = 'psd';
+                       $ImageTypesLookup[6]  = 'bmp';
+                       $ImageTypesLookup[7]  = 'tiff (little-endian)';
+                       $ImageTypesLookup[8]  = 'tiff (big-endian)';
+                       $ImageTypesLookup[9]  = 'jpc';
+                       $ImageTypesLookup[10] = 'jp2';
+                       $ImageTypesLookup[11] = 'jpx';
+                       $ImageTypesLookup[12] = 'jb2';
+                       $ImageTypesLookup[13] = 'swc';
+                       $ImageTypesLookup[14] = 'iff';
+               }
+               return (isset($ImageTypesLookup[$imagetypeid]) ? $ImageTypesLookup[$imagetypeid] : '');
+       }
+
+       public static function CopyTagsToComments(&$ThisFileInfo) {
+
+               // Copy all entries from ['tags'] into common ['comments']
+               if (!empty($ThisFileInfo['tags'])) {
+                       foreach ($ThisFileInfo['tags'] as $tagtype => $tagarray) {
+                               foreach ($tagarray as $tagname => $tagdata) {
+                                       foreach ($tagdata as $key => $value) {
+                                               if (!empty($value)) {
+                                                       if (empty($ThisFileInfo['comments'][$tagname])) {
+
+                                                               // fall through and append value
+
+                                                       } elseif ($tagtype == 'id3v1') {
+
+                                                               $newvaluelength = strlen(trim($value));
+                                                               foreach ($ThisFileInfo['comments'][$tagname] as $existingkey => $existingvalue) {
+                                                                       $oldvaluelength = strlen(trim($existingvalue));
+                                                                       if (($newvaluelength <= $oldvaluelength) && (substr($existingvalue, 0, $newvaluelength) == trim($value))) {
+                                                                               // new value is identical but shorter-than (or equal-length to) one already in comments - skip
+                                                                               break 2;
+                                                                       }
+                                                               }
+
+                                                       } elseif (!is_array($value)) {
+
+                                                               $newvaluelength = strlen(trim($value));
+                                                               foreach ($ThisFileInfo['comments'][$tagname] as $existingkey => $existingvalue) {
+                                                                       $oldvaluelength = strlen(trim($existingvalue));
+                                                                       if (($newvaluelength > $oldvaluelength) && (substr(trim($value), 0, strlen($existingvalue)) == $existingvalue)) {
+                                                                               $ThisFileInfo['comments'][$tagname][$existingkey] = trim($value);
+                                                                               break 2;
+                                                                       }
+                                                               }
+
+                                                       }
+                                                       if (is_array($value) || empty($ThisFileInfo['comments'][$tagname]) || !in_array(trim($value), $ThisFileInfo['comments'][$tagname])) {
+                                                               $value = (is_string($value) ? trim($value) : $value);
+                                                               $ThisFileInfo['comments'][$tagname][] = $value;
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+
+                       // Copy to ['comments_html']
+                       foreach ($ThisFileInfo['comments'] as $field => $values) {
+                               if ($field == 'picture') {
+                                       // pictures can take up a lot of space, and we don't need multiple copies of them
+                                       // let there be a single copy in [comments][picture], and not elsewhere
+                                       continue;
+                               }
+                               foreach ($values as $index => $value) {
+                                       if (is_array($value)) {
+                                               $ThisFileInfo['comments_html'][$field][$index] = $value;
+                                       } else {
+                                               $ThisFileInfo['comments_html'][$field][$index] = str_replace('&#0;', '', self::MultiByteCharString2HTML($value, $ThisFileInfo['encoding']));
+                                       }
+                               }
+                       }
+               }
+               return true;
+       }
+
+
+       public static function EmbeddedLookup($key, $begin, $end, $file, $name) {
+
+               // Cached
+               static $cache;
+               if (isset($cache[$file][$name])) {
+                       return (isset($cache[$file][$name][$key]) ? $cache[$file][$name][$key] : '');
+               }
+
+               // Init
+               $keylength  = strlen($key);
+               $line_count = $end - $begin - 7;
+
+               // Open php file
+               $fp = fopen($file, 'r');
+
+               // Discard $begin lines
+               for ($i = 0; $i < ($begin + 3); $i++) {
+                       fgets($fp, 1024);
+               }
+
+               // Loop thru line
+               while (0 < $line_count--) {
+
+                       // Read line
+                       $line = ltrim(fgets($fp, 1024), "\t ");
+
+                       // METHOD A: only cache the matching key - less memory but slower on next lookup of not-previously-looked-up key
+                       //$keycheck = substr($line, 0, $keylength);
+                       //if ($key == $keycheck)  {
+                       //      $cache[$file][$name][$keycheck] = substr($line, $keylength + 1);
+                       //      break;
+                       //}
+
+                       // METHOD B: cache all keys in this lookup - more memory but faster on next lookup of not-previously-looked-up key
+                       //$cache[$file][$name][substr($line, 0, $keylength)] = trim(substr($line, $keylength + 1));
+                       $explodedLine = explode("\t", $line, 2);
+                       $ThisKey   = (isset($explodedLine[0]) ? $explodedLine[0] : '');
+                       $ThisValue = (isset($explodedLine[1]) ? $explodedLine[1] : '');
+                       $cache[$file][$name][$ThisKey] = trim($ThisValue);
+               }
+
+               // Close and return
+               fclose($fp);
+               return (isset($cache[$file][$name][$key]) ? $cache[$file][$name][$key] : '');
+       }
+
+       public static function IncludeDependency($filename, $sourcefile, $DieOnFailure=false) {
+               global $GETID3_ERRORARRAY;
+
+               if (file_exists($filename)) {
+                       if (include_once($filename)) {
+                               return true;
+                       } else {
+                               $diemessage = basename($sourcefile).' depends on '.$filename.', which has errors';
+                       }
+               } else {
+                       $diemessage = basename($sourcefile).' depends on '.$filename.', which is missing';
+               }
+               if ($DieOnFailure) {
+                       throw new Exception($diemessage);
+               } else {
+                       $GETID3_ERRORARRAY[] = $diemessage;
+               }
+               return false;
+       }
+
+       public static function trimNullByte($string) {
+               return trim($string, "\x00");
+       }
+
+       public static function getFileSizeSyscall($path) {
+               $filesize = false;
+
+               if (GETID3_OS_ISWINDOWS) {
+                       if (class_exists('COM')) { // From PHP 5.3.15 and 5.4.5, COM and DOTNET is no longer built into the php core.you have to add COM support in php.ini:
+                               $filesystem = new COM('Scripting.FileSystemObject');
+                               $file = $filesystem->GetFile($path);
+                               $filesize = $file->Size();
+                               unset($filesystem, $file);
+                       } else {
+                               $commandline = 'for %I in ('.escapeshellarg($path).') do @echo %~zI';
+                       }
+               } else {
+                       $commandline = 'ls -l '.escapeshellarg($path).' | awk \'{print $5}\'';
+               }
+               if (isset($commandline)) {
+                       $output = trim(`$commandline`);
+                       if (ctype_digit($output)) {
+                               $filesize = (float) $output;
+                       }
+               }
+               return $filesize;
+       }
+}
\ No newline at end of file
diff --git a/wp-includes/ID3/getid3.php b/wp-includes/ID3/getid3.php
new file mode 100644 (file)
index 0000000..84b9cce
--- /dev/null
@@ -0,0 +1,1776 @@
+<?php
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org>               //
+//  available at http://getid3.sourceforge.net                 //
+//            or http://www.getid3.org                         //
+/////////////////////////////////////////////////////////////////
+//                                                             //
+// Please see readme.txt for more information                  //
+//                                                            ///
+/////////////////////////////////////////////////////////////////
+
+// define a constant rather than looking up every time it is needed
+if (!defined('GETID3_OS_ISWINDOWS')) {
+       define('GETID3_OS_ISWINDOWS', (stripos(PHP_OS, 'WIN') === 0));
+}
+// Get base path of getID3() - ONCE
+if (!defined('GETID3_INCLUDEPATH')) {
+       define('GETID3_INCLUDEPATH', dirname(__FILE__).DIRECTORY_SEPARATOR);
+}
+
+// attempt to define temp dir as something flexible but reliable
+$temp_dir = ini_get('upload_tmp_dir');
+if ($temp_dir && (!is_dir($temp_dir) || !is_readable($temp_dir))) {
+       $temp_dir = '';
+}
+if (!$temp_dir && function_exists('sys_get_temp_dir')) {
+       // PHP v5.2.1+
+       // sys_get_temp_dir() may give inaccessible temp dir, e.g. with open_basedir on virtual hosts
+       $temp_dir = sys_get_temp_dir();
+}
+$temp_dir = realpath($temp_dir);
+$open_basedir = ini_get('open_basedir');
+if ($open_basedir) {
+       // e.g. "/var/www/vhosts/getid3.org/httpdocs/:/tmp/"
+       $temp_dir     = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $temp_dir);
+       $open_basedir = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $open_basedir);
+       if (substr($temp_dir, -1, 1) != DIRECTORY_SEPARATOR) {
+               $temp_dir .= DIRECTORY_SEPARATOR;
+       }
+       $found_valid_tempdir = false;
+       $open_basedirs = explode(PATH_SEPARATOR, $open_basedir);
+       foreach ($open_basedirs as $basedir) {
+               if (substr($basedir, -1, 1) != DIRECTORY_SEPARATOR) {
+                       $basedir .= DIRECTORY_SEPARATOR;
+               }
+               if (preg_match('#^'.preg_quote($basedir).'#', $temp_dir)) {
+                       $found_valid_tempdir = true;
+                       break;
+               }
+       }
+       if (!$found_valid_tempdir) {
+               $temp_dir = '';
+       }
+       unset($open_basedirs, $found_valid_tempdir, $basedir);
+}
+if (!$temp_dir) {
+       $temp_dir = '*'; // invalid directory name should force tempnam() to use system default temp dir
+}
+// $temp_dir = '/something/else/';  // feel free to override temp dir here if it works better for your system
+define('GETID3_TEMP_DIR', $temp_dir);
+unset($open_basedir, $temp_dir);
+
+// End: Defines
+
+
+class getID3
+{
+       // public: Settings
+       public $encoding        = 'UTF-8';        // CASE SENSITIVE! - i.e. (must be supported by iconv()). Examples:  ISO-8859-1  UTF-8  UTF-16  UTF-16BE
+       public $encoding_id3v1  = 'ISO-8859-1';   // Should always be 'ISO-8859-1', but some tags may be written in other encodings such as 'EUC-CN' or 'CP1252'
+
+       // public: Optional tag checks - disable for speed.
+       public $option_tag_id3v1         = true;  // Read and process ID3v1 tags
+       public $option_tag_id3v2         = true;  // Read and process ID3v2 tags
+       public $option_tag_lyrics3       = true;  // Read and process Lyrics3 tags
+       public $option_tag_apetag        = true;  // Read and process APE tags
+       public $option_tags_process      = true;  // Copy tags to root key 'tags' and encode to $this->encoding
+       public $option_tags_html         = true;  // Copy tags to root key 'tags_html' properly translated from various encodings to HTML entities
+
+       // public: Optional tag/comment calucations
+       public $option_extra_info        = true;  // Calculate additional info such as bitrate, channelmode etc
+
+       // public: Optional handling of embedded attachments (e.g. images)
+       public $option_save_attachments  = true; // defaults to true (ATTACHMENTS_INLINE) for backward compatibility
+
+       // public: Optional calculations
+       public $option_md5_data          = false; // Get MD5 sum of data part - slow
+       public $option_md5_data_source   = false; // Use MD5 of source file if availble - only FLAC and OptimFROG
+       public $option_sha1_data         = false; // Get SHA1 sum of data part - slow
+       public $option_max_2gb_check     = null;  // Check whether file is larger than 2GB and thus not supported by 32-bit PHP (null: auto-detect based on PHP_INT_MAX)
+
+       // public: Read buffer size in bytes
+       public $option_fread_buffer_size = 32768;
+
+       // Public variables
+       public $filename;                         // Filename of file being analysed.
+       public $fp;                               // Filepointer to file being analysed.
+       public $info;                             // Result array.
+       public $tempdir = GETID3_TEMP_DIR;
+
+       // Protected variables
+       protected $startup_error   = '';
+       protected $startup_warning = '';
+       protected $memory_limit    = 0;
+
+       const VERSION           = '1.9.7-20130705';
+       const FREAD_BUFFER_SIZE = 32768;
+
+       const ATTACHMENTS_NONE   = false;
+       const ATTACHMENTS_INLINE = true;
+
+       // public: constructor
+       public function __construct() {
+
+               // Check for PHP version
+               $required_php_version = '5.0.5';
+               if (version_compare(PHP_VERSION, $required_php_version, '<')) {
+                       $this->startup_error .= 'getID3() requires PHP v'.$required_php_version.' or higher - you are running v'.PHP_VERSION;
+                       return false;
+               }
+
+               // Check memory
+               $this->memory_limit = ini_get('memory_limit');
+               if (preg_match('#([0-9]+)M#i', $this->memory_limit, $matches)) {
+                       // could be stored as "16M" rather than 16777216 for example
+                       $this->memory_limit = $matches[1] * 1048576;
+               } elseif (preg_match('#([0-9]+)G#i', $this->memory_limit, $matches)) { // The 'G' modifier is available since PHP 5.1.0
+                       // could be stored as "2G" rather than 2147483648 for example
+                       $this->memory_limit = $matches[1] * 1073741824;
+               }
+               if ($this->memory_limit <= 0) {
+                       // memory limits probably disabled
+               } elseif ($this->memory_limit <= 4194304) {
+                       $this->startup_error .= 'PHP has less than 4MB available memory and will very likely run out. Increase memory_limit in php.ini';
+               } elseif ($this->memory_limit <= 12582912) {
+                       $this->startup_warning .= 'PHP has less than 12MB available memory and might run out if all modules are loaded. Increase memory_limit in php.ini';
+               }
+
+               // Check safe_mode off
+               if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) {
+                       $this->warning('WARNING: Safe mode is on, shorten support disabled, md5data/sha1data for ogg vorbis disabled, ogg vorbos/flac tag writing disabled.');
+               }
+
+               if (intval(ini_get('mbstring.func_overload')) > 0) {
+                       $this->warning('WARNING: php.ini contains "mbstring.func_overload = '.ini_get('mbstring.func_overload').'", this may break things.');
+               }
+
+               // Check for magic_quotes_runtime
+               if (function_exists('get_magic_quotes_runtime')) {
+                       if (get_magic_quotes_runtime()) {
+                               return $this->startup_error('magic_quotes_runtime must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_runtime(0) and set_magic_quotes_runtime(1).');
+                       }
+               }
+
+               // Check for magic_quotes_gpc
+               if (function_exists('magic_quotes_gpc')) {
+                       if (get_magic_quotes_gpc()) {
+                               return $this->startup_error('magic_quotes_gpc must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_gpc(0) and set_magic_quotes_gpc(1).');
+                       }
+               }
+
+               // Load support library
+               if (!include_once(GETID3_INCLUDEPATH.'getid3.lib.php')) {
+                       $this->startup_error .= 'getid3.lib.php is missing or corrupt';
+               }
+
+               if ($this->option_max_2gb_check === null) {
+                       $this->option_max_2gb_check = (PHP_INT_MAX <= 2147483647);
+               }
+
+
+               // Needed for Windows only:
+               // Define locations of helper applications for Shorten, VorbisComment, MetaFLAC
+               //   as well as other helper functions such as head, tail, md5sum, etc
+               // This path cannot contain spaces, but the below code will attempt to get the
+               //   8.3-equivalent path automatically
+               // IMPORTANT: This path must include the trailing slash
+               if (GETID3_OS_ISWINDOWS && !defined('GETID3_HELPERAPPSDIR')) {
+
+                       $helperappsdir = GETID3_INCLUDEPATH.'..'.DIRECTORY_SEPARATOR.'helperapps'; // must not have any space in this path
+
+                       if (!is_dir($helperappsdir)) {
+                               $this->startup_warning .= '"'.$helperappsdir.'" cannot be defined as GETID3_HELPERAPPSDIR because it does not exist';
+                       } elseif (strpos(realpath($helperappsdir), ' ') !== false) {
+                               $DirPieces = explode(DIRECTORY_SEPARATOR, realpath($helperappsdir));
+                               $path_so_far = array();
+                               foreach ($DirPieces as $key => $value) {
+                                       if (strpos($value, ' ') !== false) {
+                                               if (!empty($path_so_far)) {
+                                                       $commandline = 'dir /x '.escapeshellarg(implode(DIRECTORY_SEPARATOR, $path_so_far));
+                                                       $dir_listing = `$commandline`;
+                                                       $lines = explode("\n", $dir_listing);
+                                                       foreach ($lines as $line) {
+                                                               $line = trim($line);
+                                                               if (preg_match('#^([0-9/]{10}) +([0-9:]{4,5}( [AP]M)?) +(<DIR>|[0-9,]+) +([^ ]{0,11}) +(.+)$#', $line, $matches)) {
+                                                                       list($dummy, $date, $time, $ampm, $filesize, $shortname, $filename) = $matches;
+                                                                       if ((strtoupper($filesize) == '<DIR>') && (strtolower($filename) == strtolower($value))) {
+                                                                               $value = $shortname;
+                                                                       }
+                                                               }
+                                                       }
+                                               } else {
+                                                       $this->startup_warning .= 'GETID3_HELPERAPPSDIR must not have any spaces in it - use 8dot3 naming convention if neccesary. You can run "dir /x" from the commandline to see the correct 8.3-style names.';
+                                               }
+                                       }
+                                       $path_so_far[] = $value;
+                               }
+                               $helperappsdir = implode(DIRECTORY_SEPARATOR, $path_so_far);
+                       }
+                       define('GETID3_HELPERAPPSDIR', $helperappsdir.DIRECTORY_SEPARATOR);
+               }
+
+               return true;
+       }
+
+       public function version() {
+               return self::VERSION;
+       }
+
+       public function fread_buffer_size() {
+               return $this->option_fread_buffer_size;
+       }
+
+
+       // public: setOption
+       public function setOption($optArray) {
+               if (!is_array($optArray) || empty($optArray)) {
+                       return false;
+               }
+               foreach ($optArray as $opt => $val) {
+                       if (isset($this->$opt) === false) {
+                               continue;
+                       }
+                       $this->$opt = $val;
+               }
+               return true;
+       }
+
+
+       public function openfile($filename) {
+               try {
+                       if (!empty($this->startup_error)) {
+                               throw new getid3_exception($this->startup_error);
+                       }
+                       if (!empty($this->startup_warning)) {
+                               $this->warning($this->startup_warning);
+                       }
+
+                       // init result array and set parameters
+                       $this->filename = $filename;
+                       $this->info = array();
+                       $this->info['GETID3_VERSION']   = $this->version();
+                       $this->info['php_memory_limit'] = $this->memory_limit;
+
+                       // remote files not supported
+                       if (preg_match('/^(ht|f)tp:\/\//', $filename)) {
+                               throw new getid3_exception('Remote files are not supported - please copy the file locally first');
+                       }
+
+                       $filename = str_replace('/', DIRECTORY_SEPARATOR, $filename);
+                       $filename = preg_replace('#(.+)'.preg_quote(DIRECTORY_SEPARATOR).'{2,}#U', '\1'.DIRECTORY_SEPARATOR, $filename);
+
+                       // open local file
+                       if (is_readable($filename) && is_file($filename) && ($this->fp = fopen($filename, 'rb'))) {
+                               // great
+                       } else {
+                               throw new getid3_exception('Could not open "'.$filename.'" (does not exist, or is not a file)');
+                       }
+
+                       $this->info['filesize'] = filesize($filename);
+                       // set redundant parameters - might be needed in some include file
+                       $this->info['filename']     = basename($filename);
+                       $this->info['filepath']     = str_replace('\\', '/', realpath(dirname($filename)));
+                       $this->info['filenamepath'] = $this->info['filepath'].'/'.$this->info['filename'];
+
+
+                       // option_max_2gb_check
+                       if ($this->option_max_2gb_check) {
+                               // PHP (32-bit all, and 64-bit Windows) doesn't support integers larger than 2^31 (~2GB)
+                               // filesize() simply returns (filesize % (pow(2, 32)), no matter the actual filesize
+                               // ftell() returns 0 if seeking to the end is beyond the range of unsigned integer
+                               $fseek = fseek($this->fp, 0, SEEK_END);
+                               if (($fseek < 0) || (($this->info['filesize'] != 0) && (ftell($this->fp) == 0)) ||
+                                       ($this->info['filesize'] < 0) ||
+                                       (ftell($this->fp) < 0)) {
+                                               $real_filesize = getid3_lib::getFileSizeSyscall($this->info['filenamepath']);
+
+                                               if ($real_filesize === false) {
+                                                       unset($this->info['filesize']);
+                                                       fclose($this->fp);
+                                                       throw new getid3_exception('Unable to determine actual filesize. File is most likely larger than '.round(PHP_INT_MAX / 1073741824).'GB and is not supported by PHP.');
+                                               } elseif (getid3_lib::intValueSupported($real_filesize)) {
+                                                       unset($this->info['filesize']);
+                                                       fclose($this->fp);
+                                                       throw new getid3_exception('PHP seems to think the file is larger than '.round(PHP_INT_MAX / 1073741824).'GB, but filesystem reports it as '.number_format($real_filesize, 3).'GB, please report to info@getid3.org');
+                                               }
+                                               $this->info['filesize'] = $real_filesize;
+                                               $this->warning('File is larger than '.round(PHP_INT_MAX / 1073741824).'GB (filesystem reports it as '.number_format($real_filesize, 3).'GB) and is not properly supported by PHP.');
+                               }
+                       }
+
+                       // set more parameters
+                       $this->info['avdataoffset']        = 0;
+                       $this->info['avdataend']           = $this->info['filesize'];
+                       $this->info['fileformat']          = '';                // filled in later
+                       $this->info['audio']['dataformat'] = '';                // filled in later, unset if not used
+                       $this->info['video']['dataformat'] = '';                // filled in later, unset if not used
+                       $this->info['tags']                = array();           // filled in later, unset if not used
+                       $this->info['error']               = array();           // filled in later, unset if not used
+                       $this->info['warning']             = array();           // filled in later, unset if not used
+                       $this->info['comments']            = array();           // filled in later, unset if not used
+                       $this->info['encoding']            = $this->encoding;   // required by id3v2 and iso modules - can be unset at the end if desired
+
+                       return true;
+
+               } catch (Exception $e) {
+                       $this->error($e->getMessage());
+               }
+               return false;
+       }
+
+       // public: analyze file
+       public function analyze($filename) {
+               try {
+                       if (!$this->openfile($filename)) {
+                               return $this->info;
+                       }
+
+                       // Handle tags
+                       foreach (array('id3v2'=>'id3v2', 'id3v1'=>'id3v1', 'apetag'=>'ape', 'lyrics3'=>'lyrics3') as $tag_name => $tag_key) {
+                               $option_tag = 'option_tag_'.$tag_name;
+                               if ($this->$option_tag) {
+                                       $this->include_module('tag.'.$tag_name);
+                                       try {
+                                               $tag_class = 'getid3_'.$tag_name;
+                                               $tag = new $tag_class($this);
+                                               $tag->Analyze();
+                                       }
+                                       catch (getid3_exception $e) {
+                                               throw $e;
+                                       }
+                               }
+                       }
+                       if (isset($this->info['id3v2']['tag_offset_start'])) {
+                               $this->info['avdataoffset'] = max($this->info['avdataoffset'], $this->info['id3v2']['tag_offset_end']);
+                       }
+                       foreach (array('id3v1'=>'id3v1', 'apetag'=>'ape', 'lyrics3'=>'lyrics3') as $tag_name => $tag_key) {
+                               if (isset($this->info[$tag_key]['tag_offset_start'])) {
+                                       $this->info['avdataend'] = min($this->info['avdataend'], $this->info[$tag_key]['tag_offset_start']);
+                               }
+                       }
+
+                       // ID3v2 detection (NOT parsing), even if ($this->option_tag_id3v2 == false) done to make fileformat easier
+                       if (!$this->option_tag_id3v2) {
+                               fseek($this->fp, 0, SEEK_SET);
+                               $header = fread($this->fp, 10);
+                               if ((substr($header, 0, 3) == 'ID3') && (strlen($header) == 10)) {
+                                       $this->info['id3v2']['header']        = true;
+                                       $this->info['id3v2']['majorversion']  = ord($header{3});
+                                       $this->info['id3v2']['minorversion']  = ord($header{4});
+                                       $this->info['avdataoffset']          += getid3_lib::BigEndian2Int(substr($header, 6, 4), 1) + 10; // length of ID3v2 tag in 10-byte header doesn't include 10-byte header length
+                               }
+                       }
+
+                       // read 32 kb file data
+                       fseek($this->fp, $this->info['avdataoffset'], SEEK_SET);
+                       $formattest = fread($this->fp, 32774);
+
+                       // determine format
+                       $determined_format = $this->GetFileFormat($formattest, $filename);
+
+                       // unable to determine file format
+                       if (!$determined_format) {
+                               fclose($this->fp);
+                               return $this->error('unable to determine file format');
+                       }
+
+                       // check for illegal ID3 tags
+                       if (isset($determined_format['fail_id3']) && (in_array('id3v1', $this->info['tags']) || in_array('id3v2', $this->info['tags']))) {
+                               if ($determined_format['fail_id3'] === 'ERROR') {
+                                       fclose($this->fp);
+                                       return $this->error('ID3 tags not allowed on this file type.');
+                               } elseif ($determined_format['fail_id3'] === 'WARNING') {
+                                       $this->warning('ID3 tags not allowed on this file type.');
+                               }
+                       }
+
+                       // check for illegal APE tags
+                       if (isset($determined_format['fail_ape']) && in_array('ape', $this->info['tags'])) {
+                               if ($determined_format['fail_ape'] === 'ERROR') {
+                                       fclose($this->fp);
+                                       return $this->error('APE tags not allowed on this file type.');
+                               } elseif ($determined_format['fail_ape'] === 'WARNING') {
+                                       $this->warning('APE tags not allowed on this file type.');
+                               }
+                       }
+
+                       // set mime type
+                       $this->info['mime_type'] = $determined_format['mime_type'];
+
+                       // supported format signature pattern detected, but module deleted
+                       if (!file_exists(GETID3_INCLUDEPATH.$determined_format['include'])) {
+                               fclose($this->fp);
+                               return $this->error('Format not supported, module "'.$determined_format['include'].'" was removed.');
+                       }
+
+                       // module requires iconv support
+                       // Check encoding/iconv support
+                       if (!empty($determined_format['iconv_req']) && !function_exists('iconv') && !in_array($this->encoding, array('ISO-8859-1', 'UTF-8', 'UTF-16LE', 'UTF-16BE', 'UTF-16'))) {
+                               $errormessage = 'iconv() support is required for this module ('.$determined_format['include'].') for encodings other than ISO-8859-1, UTF-8, UTF-16LE, UTF16-BE, UTF-16. ';
+                               if (GETID3_OS_ISWINDOWS) {
+                                       $errormessage .= 'PHP does not have iconv() support. Please enable php_iconv.dll in php.ini, and copy iconv.dll from c:/php/dlls to c:/windows/system32';
+                               } else {
+                                       $errormessage .= 'PHP is not compiled with iconv() support. Please recompile with the --with-iconv switch';
+                               }
+                               return $this->error($errormessage);
+                       }
+
+                       // include module
+                       include_once(GETID3_INCLUDEPATH.$determined_format['include']);
+
+                       // instantiate module class
+                       $class_name = 'getid3_'.$determined_format['module'];
+                       if (!class_exists($class_name)) {
+                               return $this->error('Format not supported, module "'.$determined_format['include'].'" is corrupt.');
+                       }
+                       $class = new $class_name($this);
+                       $class->Analyze();
+                       unset($class);
+
+                       // close file
+                       fclose($this->fp);
+
+                       // process all tags - copy to 'tags' and convert charsets
+                       if ($this->option_tags_process) {
+                               $this->HandleAllTags();
+                       }
+
+                       // perform more calculations
+                       if ($this->option_extra_info) {
+                               $this->ChannelsBitratePlaytimeCalculations();
+                               $this->CalculateCompressionRatioVideo();
+                               $this->CalculateCompressionRatioAudio();
+                               $this->CalculateReplayGain();
+                               $this->ProcessAudioStreams();
+                       }
+
+                       // get the MD5 sum of the audio/video portion of the file - without ID3/APE/Lyrics3/etc header/footer tags
+                       if ($this->option_md5_data) {
+                               // do not calc md5_data if md5_data_source is present - set by flac only - future MPC/SV8 too
+                               if (!$this->option_md5_data_source || empty($this->info['md5_data_source'])) {
+                                       $this->getHashdata('md5');
+                               }
+                       }
+
+                       // get the SHA1 sum of the audio/video portion of the file - without ID3/APE/Lyrics3/etc header/footer tags
+                       if ($this->option_sha1_data) {
+                               $this->getHashdata('sha1');
+                       }
+
+                       // remove undesired keys
+                       $this->CleanUp();
+
+               } catch (Exception $e) {
+                       $this->error('Caught exception: '.$e->getMessage());
+               }
+
+               // return info array
+               return $this->info;
+       }
+
+
+       // private: error handling
+       public function error($message) {
+               $this->CleanUp();
+               if (!isset($this->info['error'])) {
+                       $this->info['error'] = array();
+               }
+               $this->info['error'][] = $message;
+               return $this->info;
+       }
+
+
+       // private: warning handling
+       public function warning($message) {
+               $this->info['warning'][] = $message;
+               return true;
+       }
+
+
+       // private: CleanUp
+       private function CleanUp() {
+
+               // remove possible empty keys
+               $AVpossibleEmptyKeys = array('dataformat', 'bits_per_sample', 'encoder_options', 'streams', 'bitrate');
+               foreach ($AVpossibleEmptyKeys as $dummy => $key) {
+                       if (empty($this->info['audio'][$key]) && isset($this->info['audio'][$key])) {
+                               unset($this->info['audio'][$key]);
+                       }
+                       if (empty($this->info['video'][$key]) && isset($this->info['video'][$key])) {
+                               unset($this->info['video'][$key]);
+                       }
+               }
+
+               // remove empty root keys
+               if (!empty($this->info)) {
+                       foreach ($this->info as $key => $value) {
+                               if (empty($this->info[$key]) && ($this->info[$key] !== 0) && ($this->info[$key] !== '0')) {
+                                       unset($this->info[$key]);
+                               }
+                       }
+               }
+
+               // remove meaningless entries from unknown-format files
+               if (empty($this->info['fileformat'])) {
+                       if (isset($this->info['avdataoffset'])) {
+                               unset($this->info['avdataoffset']);
+                       }
+                       if (isset($this->info['avdataend'])) {
+                               unset($this->info['avdataend']);
+                       }
+               }
+
+               // remove possible duplicated identical entries
+               if (!empty($this->info['error'])) {
+                       $this->info['error'] = array_values(array_unique($this->info['error']));
+               }
+               if (!empty($this->info['warning'])) {
+                       $this->info['warning'] = array_values(array_unique($this->info['warning']));
+               }
+
+               // remove "global variable" type keys
+               unset($this->info['php_memory_limit']);
+
+               return true;
+       }
+
+
+       // return array containing information about all supported formats
+       public function GetFileFormatArray() {
+               static $format_info = array();
+               if (empty($format_info)) {
+                       $format_info = array(
+
+                               // Audio formats
+
+                               // AC-3   - audio      - Dolby AC-3 / Dolby Digital
+                               'ac3'  => array(
+                                                       'pattern'   => '^\x0B\x77',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'ac3',
+                                                       'mime_type' => 'audio/ac3',
+                                               ),
+
+                               // AAC  - audio       - Advanced Audio Coding (AAC) - ADIF format
+                               'adif' => array(
+                                                       'pattern'   => '^ADIF',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'aac',
+                                                       'mime_type' => 'application/octet-stream',
+                                                       'fail_ape'  => 'WARNING',
+                                               ),
+
+/*
+                               // AA   - audio       - Audible Audiobook
+                               'aa'   => array(
+                                                       'pattern'   => '^.{4}\x57\x90\x75\x36',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'aa',
+                                                       'mime_type' => 'audio/audible',
+                                               ),
+*/
+                               // AAC  - audio       - Advanced Audio Coding (AAC) - ADTS format (very similar to MP3)
+                               'adts' => array(
+                                                       'pattern'   => '^\xFF[\xF0-\xF1\xF8-\xF9]',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'aac',
+                                                       'mime_type' => 'application/octet-stream',
+                                                       'fail_ape'  => 'WARNING',
+                                               ),
+
+
+                               // AU   - audio       - NeXT/Sun AUdio (AU)
+                               'au'   => array(
+                                                       'pattern'   => '^\.snd',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'au',
+                                                       'mime_type' => 'audio/basic',
+                                               ),
+
+                               // AVR  - audio       - Audio Visual Research
+                               'avr'  => array(
+                                                       'pattern'   => '^2BIT',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'avr',
+                                                       'mime_type' => 'application/octet-stream',
+                                               ),
+
+                               // BONK - audio       - Bonk v0.9+
+                               'bonk' => array(
+                                                       'pattern'   => '^\x00(BONK|INFO|META| ID3)',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'bonk',
+                                                       'mime_type' => 'audio/xmms-bonk',
+                                               ),
+
+                               // DSS  - audio       - Digital Speech Standard
+                               'dss'  => array(
+                                                       'pattern'   => '^[\x02-\x03]ds[s2]',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'dss',
+                                                       'mime_type' => 'application/octet-stream',
+                                               ),
+
+                               // DTS  - audio       - Dolby Theatre System
+                               'dts'  => array(
+                                                       'pattern'   => '^\x7F\xFE\x80\x01',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'dts',
+                                                       'mime_type' => 'audio/dts',
+                                               ),
+
+                               // FLAC - audio       - Free Lossless Audio Codec
+                               'flac' => array(
+                                                       'pattern'   => '^fLaC',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'flac',
+                                                       'mime_type' => 'audio/x-flac',
+                                               ),
+
+                               // LA   - audio       - Lossless Audio (LA)
+                               'la'   => array(
+                                                       'pattern'   => '^LA0[2-4]',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'la',
+                                                       'mime_type' => 'application/octet-stream',
+                                               ),
+
+                               // LPAC - audio       - Lossless Predictive Audio Compression (LPAC)
+                               'lpac' => array(
+                                                       'pattern'   => '^LPAC',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'lpac',
+                                                       'mime_type' => 'application/octet-stream',
+                                               ),
+
+                               // MIDI - audio       - MIDI (Musical Instrument Digital Interface)
+                               'midi' => array(
+                                                       'pattern'   => '^MThd',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'midi',
+                                                       'mime_type' => 'audio/midi',
+                                               ),
+
+                               // MAC  - audio       - Monkey's Audio Compressor
+                               'mac'  => array(
+                                                       'pattern'   => '^MAC ',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'monkey',
+                                                       'mime_type' => 'application/octet-stream',
+                                               ),
+
+// has been known to produce false matches in random files (e.g. JPEGs), leave out until more precise matching available
+//                             // MOD  - audio       - MODule (assorted sub-formats)
+//                             'mod'  => array(
+//                                                     'pattern'   => '^.{1080}(M\\.K\\.|M!K!|FLT4|FLT8|[5-9]CHN|[1-3][0-9]CH)',
+//                                                     'group'     => 'audio',
+//                                                     'module'    => 'mod',
+//                                                     'option'    => 'mod',
+//                                                     'mime_type' => 'audio/mod',
+//                                             ),
+
+                               // MOD  - audio       - MODule (Impulse Tracker)
+                               'it'   => array(
+                                                       'pattern'   => '^IMPM',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'mod',
+                                                       //'option'    => 'it',
+                                                       'mime_type' => 'audio/it',
+                                               ),
+
+                               // MOD  - audio       - MODule (eXtended Module, various sub-formats)
+                               'xm'   => array(
+                                                       'pattern'   => '^Extended Module',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'mod',
+                                                       //'option'    => 'xm',
+                                                       'mime_type' => 'audio/xm',
+                                               ),
+
+                               // MOD  - audio       - MODule (ScreamTracker)
+                               's3m'  => array(
+                                                       'pattern'   => '^.{44}SCRM',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'mod',
+                                                       //'option'    => 's3m',
+                                                       'mime_type' => 'audio/s3m',
+                                               ),
+
+                               // MPC  - audio       - Musepack / MPEGplus
+                               'mpc'  => array(
+                                                       'pattern'   => '^(MPCK|MP\+|[\x00\x01\x10\x11\x40\x41\x50\x51\x80\x81\x90\x91\xC0\xC1\xD0\xD1][\x20-37][\x00\x20\x40\x60\x80\xA0\xC0\xE0])',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'mpc',
+                                                       'mime_type' => 'audio/x-musepack',
+                                               ),
+
+                               // MP3  - audio       - MPEG-audio Layer 3 (very similar to AAC-ADTS)
+                               'mp3'  => array(
+                                                       'pattern'   => '^\xFF[\xE2-\xE7\xF2-\xF7\xFA-\xFF][\x00-\x0B\x10-\x1B\x20-\x2B\x30-\x3B\x40-\x4B\x50-\x5B\x60-\x6B\x70-\x7B\x80-\x8B\x90-\x9B\xA0-\xAB\xB0-\xBB\xC0-\xCB\xD0-\xDB\xE0-\xEB\xF0-\xFB]',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'mp3',
+                                                       'mime_type' => 'audio/mpeg',
+                                               ),
+
+                               // OFR  - audio       - OptimFROG
+                               'ofr'  => array(
+                                                       'pattern'   => '^(\*RIFF|OFR)',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'optimfrog',
+                                                       'mime_type' => 'application/octet-stream',
+                                               ),
+
+                               // RKAU - audio       - RKive AUdio compressor
+                               'rkau' => array(
+                                                       'pattern'   => '^RKA',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'rkau',
+                                                       'mime_type' => 'application/octet-stream',
+                                               ),
+
+                               // SHN  - audio       - Shorten
+                               'shn'  => array(
+                                                       'pattern'   => '^ajkg',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'shorten',
+                                                       'mime_type' => 'audio/xmms-shn',
+                                                       'fail_id3'  => 'ERROR',
+                                                       'fail_ape'  => 'ERROR',
+                                               ),
+
+                               // TTA  - audio       - TTA Lossless Audio Compressor (http://tta.corecodec.org)
+                               'tta'  => array(
+                                                       'pattern'   => '^TTA',  // could also be '^TTA(\x01|\x02|\x03|2|1)'
+                                                       'group'     => 'audio',
+                                                       'module'    => 'tta',
+                                                       'mime_type' => 'application/octet-stream',
+                                               ),
+
+                               // VOC  - audio       - Creative Voice (VOC)
+                               'voc'  => array(
+                                                       'pattern'   => '^Creative Voice File',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'voc',
+                                                       'mime_type' => 'audio/voc',
+                                               ),
+
+                               // VQF  - audio       - transform-domain weighted interleave Vector Quantization Format (VQF)
+                               'vqf'  => array(
+                                                       'pattern'   => '^TWIN',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'vqf',
+                                                       'mime_type' => 'application/octet-stream',
+                                               ),
+
+                               // WV  - audio        - WavPack (v4.0+)
+                               'wv'   => array(
+                                                       'pattern'   => '^wvpk',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'wavpack',
+                                                       'mime_type' => 'application/octet-stream',
+                                               ),
+
+
+                               // Audio-Video formats
+
+                               // ASF  - audio/video - Advanced Streaming Format, Windows Media Video, Windows Media Audio
+                               'asf'  => array(
+                                                       'pattern'   => '^\x30\x26\xB2\x75\x8E\x66\xCF\x11\xA6\xD9\x00\xAA\x00\x62\xCE\x6C',
+                                                       'group'     => 'audio-video',
+                                                       'module'    => 'asf',
+                                                       'mime_type' => 'video/x-ms-asf',
+                                                       'iconv_req' => false,
+                                               ),
+
+                               // BINK - audio/video - Bink / Smacker
+                               'bink' => array(
+                                                       'pattern'   => '^(BIK|SMK)',
+                                                       'group'     => 'audio-video',
+                                                       'module'    => 'bink',
+                                                       'mime_type' => 'application/octet-stream',
+                                               ),
+
+                               // FLV  - audio/video - FLash Video
+                               'flv' => array(
+                                                       'pattern'   => '^FLV\x01',
+                                                       'group'     => 'audio-video',
+                                                       'module'    => 'flv',
+                                                       'mime_type' => 'video/x-flv',
+                                               ),
+
+                               // MKAV - audio/video - Mastroka
+                               'matroska' => array(
+                                                       'pattern'   => '^\x1A\x45\xDF\xA3',
+                                                       'group'     => 'audio-video',
+                                                       'module'    => 'matroska',
+                                                       'mime_type' => 'video/x-matroska', // may also be audio/x-matroska
+                                               ),
+
+                               // MPEG - audio/video - MPEG (Moving Pictures Experts Group)
+                               'mpeg' => array(
+                                                       'pattern'   => '^\x00\x00\x01(\xBA|\xB3)',
+                                                       'group'     => 'audio-video',
+                                                       'module'    => 'mpeg',
+                                                       'mime_type' => 'video/mpeg',
+                                               ),
+
+                               // NSV  - audio/video - Nullsoft Streaming Video (NSV)
+                               'nsv'  => array(
+                                                       'pattern'   => '^NSV[sf]',
+                                                       'group'     => 'audio-video',
+                                                       'module'    => 'nsv',
+                                                       'mime_type' => 'application/octet-stream',
+                                               ),
+
+                               // Ogg  - audio/video - Ogg (Ogg-Vorbis, Ogg-FLAC, Speex, Ogg-Theora(*), Ogg-Tarkin(*))
+                               'ogg'  => array(
+                                                       'pattern'   => '^OggS',
+                                                       'group'     => 'audio',
+                                                       'module'    => 'ogg',
+                                                       'mime_type' => 'application/ogg',
+                                                       'fail_id3'  => 'WARNING',
+                                                       'fail_ape'  => 'WARNING',
+                                               ),
+
+                               // QT   - audio/video - Quicktime
+                               'quicktime' => array(
+                                                       'pattern'   => '^.{4}(cmov|free|ftyp|mdat|moov|pnot|skip|wide)',
+                                                       'group'     => 'audio-video',
+                                                       'module'    => 'quicktime',
+                                                       'mime_type' => 'video/quicktime',
+                                               ),
+
+                               // RIFF - audio/video - Resource Interchange File Format (RIFF) / WAV / AVI / CD-audio / SDSS = renamed variant used by SmartSound QuickTracks (www.smartsound.com) / FORM = Audio Interchange File Format (AIFF)
+                               'riff' => array(
+                                                       'pattern'   => '^(RIFF|SDSS|FORM)',
+                                                       'group'     => 'audio-video',
+                                                       'module'    => 'riff',
+                                                       'mime_type' => 'audio/x-wave',
+                                                       'fail_ape'  => 'WARNING',
+                                               ),
+
+                               // Real - audio/video - RealAudio, RealVideo
+                               'real' => array(
+                                                       'pattern'   => '^(\\.RMF|\\.ra)',
+                                                       'group'     => 'audio-video',
+                                                       'module'    => 'real',
+                                                       'mime_type' => 'audio/x-realaudio',
+                                               ),
+
+                               // SWF - audio/video - ShockWave Flash
+                               'swf' => array(
+                                                       'pattern'   => '^(F|C)WS',
+                                                       'group'     => 'audio-video',
+                                                       'module'    => 'swf',
+                                                       'mime_type' => 'application/x-shockwave-flash',
+                                               ),
+
+                               // TS - audio/video - MPEG-2 Transport Stream
+                               'ts' => array(
+                                                       'pattern'   => '^(\x47.{187}){10,}', // packets are 188 bytes long and start with 0x47 "G".  Check for at least 10 packets matching this pattern
+                                                       'group'     => 'audio-video',
+                                                       'module'    => 'ts',
+                                                       'mime_type' => 'video/MP2T',
+                                               ),
+
+
+                               // Still-Image formats
+
+                               // BMP  - still image - Bitmap (Windows, OS/2; uncompressed, RLE8, RLE4)
+                               'bmp'  => array(
+                                                       'pattern'   => '^BM',
+                                                       'group'     => 'graphic',
+                                                       'module'    => 'bmp',
+                                                       'mime_type' => 'image/bmp',
+                                                       'fail_id3'  => 'ERROR',
+                                                       'fail_ape'  => 'ERROR',
+                                               ),
+
+                               // GIF  - still image - Graphics Interchange Format
+                               'gif'  => array(
+                                                       'pattern'   => '^GIF',
+                                                       'group'     => 'graphic',
+                                                       'module'    => 'gif',
+                                                       'mime_type' => 'image/gif',
+                                                       'fail_id3'  => 'ERROR',
+                                                       'fail_ape'  => 'ERROR',
+                                               ),
+
+                               // JPEG - still image - Joint Photographic Experts Group (JPEG)
+                               'jpg'  => array(
+                                                       'pattern'   => '^\xFF\xD8\xFF',
+                                                       'group'     => 'graphic',
+                                                       'module'    => 'jpg',
+                                                       'mime_type' => 'image/jpeg',
+                                                       'fail_id3'  => 'ERROR',
+                                                       'fail_ape'  => 'ERROR',
+                                               ),
+
+                               // PCD  - still image - Kodak Photo CD
+                               'pcd'  => array(
+                                                       'pattern'   => '^.{2048}PCD_IPI\x00',
+                                                       'group'     => 'graphic',
+                                                       'module'    => 'pcd',
+                                                       'mime_type' => 'image/x-photo-cd',
+                                                       'fail_id3'  => 'ERROR',
+                                                       'fail_ape'  => 'ERROR',
+                                               ),
+
+
+                               // PNG  - still image - Portable Network Graphics (PNG)
+                               'png'  => array(
+                                                       'pattern'   => '^\x89\x50\x4E\x47\x0D\x0A\x1A\x0A',
+                                                       'group'     => 'graphic',
+                                                       'module'    => 'png',
+                                                       'mime_type' => 'image/png',
+                                                       'fail_id3'  => 'ERROR',
+                                                       'fail_ape'  => 'ERROR',
+                                               ),
+
+
+                               // SVG  - still image - Scalable Vector Graphics (SVG)
+                               'svg'  => array(
+                                                       'pattern'   => '(<!DOCTYPE svg PUBLIC |xmlns="http:\/\/www\.w3\.org\/2000\/svg")',
+                                                       'group'     => 'graphic',
+                                                       'module'    => 'svg',
+                                                       'mime_type' => 'image/svg+xml',
+                                                       'fail_id3'  => 'ERROR',
+                                                       'fail_ape'  => 'ERROR',
+                                               ),
+
+
+                               // TIFF - still image - Tagged Information File Format (TIFF)
+                               'tiff' => array(
+                                                       'pattern'   => '^(II\x2A\x00|MM\x00\x2A)',
+                                                       'group'     => 'graphic',
+                                                       'module'    => 'tiff',
+                                                       'mime_type' => 'image/tiff',
+                                                       'fail_id3'  => 'ERROR',
+                                                       'fail_ape'  => 'ERROR',
+                                               ),
+
+
+                               // EFAX - still image - eFax (TIFF derivative)
+                               'efax'  => array(
+                                                       'pattern'   => '^\xDC\xFE',
+                                                       'group'     => 'graphic',
+                                                       'module'    => 'efax',
+                                                       'mime_type' => 'image/efax',
+                                                       'fail_id3'  => 'ERROR',
+                                                       'fail_ape'  => 'ERROR',
+                                               ),
+
+
+                               // Data formats
+
+                               // ISO  - data        - International Standards Organization (ISO) CD-ROM Image
+                               'iso'  => array(
+                                                       'pattern'   => '^.{32769}CD001',
+                                                       'group'     => 'misc',
+                                                       'module'    => 'iso',
+                                                       'mime_type' => 'application/octet-stream',
+                                                       'fail_id3'  => 'ERROR',
+                                                       'fail_ape'  => 'ERROR',
+                                                       'iconv_req' => false,
+                                               ),
+
+                               // RAR  - data        - RAR compressed data
+                               'rar'  => array(
+                                                       'pattern'   => '^Rar\!',
+                                                       'group'     => 'archive',
+                                                       'module'    => 'rar',
+                                                       'mime_type' => 'application/octet-stream',
+                                                       'fail_id3'  => 'ERROR',
+                                                       'fail_ape'  => 'ERROR',
+                                               ),
+
+                               // SZIP - audio/data  - SZIP compressed data
+                               'szip' => array(
+                                                       'pattern'   => '^SZ\x0A\x04',
+                                                       'group'     => 'archive',
+                                                       'module'    => 'szip',
+                                                       'mime_type' => 'application/octet-stream',
+                                                       'fail_id3'  => 'ERROR',
+                                                       'fail_ape'  => 'ERROR',
+                                               ),
+
+                               // TAR  - data        - TAR compressed data
+                               'tar'  => array(
+                                                       'pattern'   => '^.{100}[0-9\x20]{7}\x00[0-9\x20]{7}\x00[0-9\x20]{7}\x00[0-9\x20\x00]{12}[0-9\x20\x00]{12}',
+                                                       'group'     => 'archive',
+                                                       'module'    => 'tar',
+                                                       'mime_type' => 'application/x-tar',
+                                                       'fail_id3'  => 'ERROR',
+                                                       'fail_ape'  => 'ERROR',
+                                               ),
+
+                               // GZIP  - data        - GZIP compressed data
+                               'gz'  => array(
+                                                       'pattern'   => '^\x1F\x8B\x08',
+                                                       'group'     => 'archive',
+                                                       'module'    => 'gzip',
+                                                       'mime_type' => 'application/x-gzip',
+                                                       'fail_id3'  => 'ERROR',
+                                                       'fail_ape'  => 'ERROR',
+                                               ),
+
+                               // ZIP  - data         - ZIP compressed data
+                               'zip'  => array(
+                                                       'pattern'   => '^PK\x03\x04',
+                                                       'group'     => 'archive',
+                                                       'module'    => 'zip',
+                                                       'mime_type' => 'application/zip',
+                                                       'fail_id3'  => 'ERROR',
+                                                       'fail_ape'  => 'ERROR',
+                                               ),
+
+
+                               // Misc other formats
+
+                               // PAR2 - data        - Parity Volume Set Specification 2.0
+                               'par2' => array (
+                                                       'pattern'   => '^PAR2\x00PKT',
+                                                       'group'     => 'misc',
+                                                       'module'    => 'par2',
+                                                       'mime_type' => 'application/octet-stream',
+                                                       'fail_id3'  => 'ERROR',
+                                                       'fail_ape'  => 'ERROR',
+                                               ),
+
+                               // PDF  - data        - Portable Document Format
+                               'pdf'  => array(
+                                                       'pattern'   => '^\x25PDF',
+                                                       'group'     => 'misc',
+                                                       'module'    => 'pdf',
+                                                       'mime_type' => 'application/pdf',
+                                                       'fail_id3'  => 'ERROR',
+                                                       'fail_ape'  => 'ERROR',
+                                               ),
+
+                               // MSOFFICE  - data   - ZIP compressed data
+                               'msoffice' => array(
+                                                       'pattern'   => '^\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1', // D0CF11E == DOCFILE == Microsoft Office Document
+                                                       'group'     => 'misc',
+                                                       'module'    => 'msoffice',
+                                                       'mime_type' => 'application/octet-stream',
+                                                       'fail_id3'  => 'ERROR',
+                                                       'fail_ape'  => 'ERROR',
+                                               ),
+
+                                // CUE  - data       - CUEsheet (index to single-file disc images)
+                                'cue' => array(
+                                                       'pattern'   => '', // empty pattern means cannot be automatically detected, will fall through all other formats and match based on filename and very basic file contents
+                                                       'group'     => 'misc',
+                                                       'module'    => 'cue',
+                                                       'mime_type' => 'application/octet-stream',
+                                                  ),
+
+                       );
+               }
+
+               return $format_info;
+       }
+
+
+
+       public function GetFileFormat(&$filedata, $filename='') {
+               // this function will determine the format of a file based on usually
+               // the first 2-4 bytes of the file (8 bytes for PNG, 16 bytes for JPG,
+               // and in the case of ISO CD image, 6 bytes offset 32kb from the start
+               // of the file).
+
+               // Identify file format - loop through $format_info and detect with reg expr
+               foreach ($this->GetFileFormatArray() as $format_name => $info) {
+                       // The /s switch on preg_match() forces preg_match() NOT to treat
+                       // newline (0x0A) characters as special chars but do a binary match
+                       if (!empty($info['pattern']) && preg_match('#'.$info['pattern'].'#s', $filedata)) {
+                               $info['include'] = 'module.'.$info['group'].'.'.$info['module'].'.php';
+                               return $info;
+                       }
+               }
+
+
+               if (preg_match('#\.mp[123a]$#i', $filename)) {
+                       // Too many mp3 encoders on the market put gabage in front of mpeg files
+                       // use assume format on these if format detection failed
+                       $GetFileFormatArray = $this->GetFileFormatArray();
+                       $info = $GetFileFormatArray['mp3'];
+                       $info['include'] = 'module.'.$info['group'].'.'.$info['module'].'.php';
+                       return $info;
+               } elseif (preg_match('/\.cue$/i', $filename) && preg_match('#FILE "[^"]+" (BINARY|MOTOROLA|AIFF|WAVE|MP3)#', $filedata)) {
+                       // there's not really a useful consistent "magic" at the beginning of .cue files to identify them
+                       // so until I think of something better, just go by filename if all other format checks fail
+                       // and verify there's at least one instance of "TRACK xx AUDIO" in the file
+                       $GetFileFormatArray = $this->GetFileFormatArray();
+                       $info = $GetFileFormatArray['cue'];
+                       $info['include']   = 'module.'.$info['group'].'.'.$info['module'].'.php';
+                       return $info;
+               }
+
+               return false;
+       }
+
+
+       // converts array to $encoding charset from $this->encoding
+       public function CharConvert(&$array, $encoding) {
+
+               // identical encoding - end here
+               if ($encoding == $this->encoding) {
+                       return;
+               }
+
+               // loop thru array
+               foreach ($array as $key => $value) {
+
+                       // go recursive
+                       if (is_array($value)) {
+                               $this->CharConvert($array[$key], $encoding);
+                       }
+
+                       // convert string
+                       elseif (is_string($value)) {
+                               $array[$key] = trim(getid3_lib::iconv_fallback($encoding, $this->encoding, $value));
+                       }
+               }
+       }
+
+
+       public function HandleAllTags() {
+
+               // key name => array (tag name, character encoding)
+               static $tags;
+               if (empty($tags)) {
+                       $tags = array(
+                               'asf'       => array('asf'           , 'UTF-16LE'),
+                               'midi'      => array('midi'          , 'ISO-8859-1'),
+                               'nsv'       => array('nsv'           , 'ISO-8859-1'),
+                               'ogg'       => array('vorbiscomment' , 'UTF-8'),
+                               'png'       => array('png'           , 'UTF-8'),
+                               'tiff'      => array('tiff'          , 'ISO-8859-1'),
+                               'quicktime' => array('quicktime'     , 'UTF-8'),
+                               'real'      => array('real'          , 'ISO-8859-1'),
+                               'vqf'       => array('vqf'           , 'ISO-8859-1'),
+                               'zip'       => array('zip'           , 'ISO-8859-1'),
+                               'riff'      => array('riff'          , 'ISO-8859-1'),
+                               'lyrics3'   => array('lyrics3'       , 'ISO-8859-1'),
+                               'id3v1'     => array('id3v1'         , $this->encoding_id3v1),
+                               'id3v2'     => array('id3v2'         , 'UTF-8'), // not according to the specs (every frame can have a different encoding), but getID3() force-converts all encodings to UTF-8
+                               'ape'       => array('ape'           , 'UTF-8'),
+                               'cue'       => array('cue'           , 'ISO-8859-1'),
+                               'matroska'  => array('matroska'      , 'UTF-8'),
+                               'flac'      => array('vorbiscomment' , 'UTF-8'),
+                               'divxtag'   => array('divx'          , 'ISO-8859-1'),
+                       );
+               }
+
+               // loop through comments array
+               foreach ($tags as $comment_name => $tagname_encoding_array) {
+                       list($tag_name, $encoding) = $tagname_encoding_array;
+
+                       // fill in default encoding type if not already present
+                       if (isset($this->info[$comment_name]) && !isset($this->info[$comment_name]['encoding'])) {
+                               $this->info[$comment_name]['encoding'] = $encoding;
+                       }
+
+                       // copy comments if key name set
+                       if (!empty($this->info[$comment_name]['comments'])) {
+                               foreach ($this->info[$comment_name]['comments'] as $tag_key => $valuearray) {
+                                       foreach ($valuearray as $key => $value) {
+                                               if (is_string($value)) {
+                                                       $value = trim($value, " \r\n\t"); // do not trim nulls from $value!! Unicode characters will get mangled if trailing nulls are removed!
+                                               }
+                                               if ($value) {
+                                                       $this->info['tags'][trim($tag_name)][trim($tag_key)][] = $value;
+                                               }
+                                       }
+                                       if ($tag_key == 'picture') {
+                                               unset($this->info[$comment_name]['comments'][$tag_key]);
+                                       }
+                               }
+
+                               if (!isset($this->info['tags'][$tag_name])) {
+                                       // comments are set but contain nothing but empty strings, so skip
+                                       continue;
+                               }
+
+                               if ($this->option_tags_html) {
+                                       foreach ($this->info['tags'][$tag_name] as $tag_key => $valuearray) {
+                                               foreach ($valuearray as $key => $value) {
+                                                       if (is_string($value)) {
+                                                               //$this->info['tags_html'][$tag_name][$tag_key][$key] = getid3_lib::MultiByteCharString2HTML($value, $encoding);
+                                                               $this->info['tags_html'][$tag_name][$tag_key][$key] = str_replace('&#0;', '', trim(getid3_lib::MultiByteCharString2HTML($value, $encoding)));
+                                                       } else {
+                                                               $this->info['tags_html'][$tag_name][$tag_key][$key] = $value;
+                                                       }
+                                               }
+                                       }
+                               }
+
+                               $this->CharConvert($this->info['tags'][$tag_name], $encoding);           // only copy gets converted!
+                       }
+
+               }
+
+               // pictures can take up a lot of space, and we don't need multiple copies of them
+               // let there be a single copy in [comments][picture], and not elsewhere
+               if (!empty($this->info['tags'])) {
+                       $unset_keys = array('tags', 'tags_html');
+                       foreach ($this->info['tags'] as $tagtype => $tagarray) {
+                               foreach ($tagarray as $tagname => $tagdata) {
+                                       if ($tagname == 'picture') {
+                                               foreach ($tagdata as $key => $tagarray) {
+                                                       $this->info['comments']['picture'][] = $tagarray;
+                                                       if (isset($tagarray['data']) && isset($tagarray['image_mime'])) {
+                                                               if (isset($this->info['tags'][$tagtype][$tagname][$key])) {
+                                                                       unset($this->info['tags'][$tagtype][$tagname][$key]);
+                                                               }
+                                                               if (isset($this->info['tags_html'][$tagtype][$tagname][$key])) {
+                                                                       unset($this->info['tags_html'][$tagtype][$tagname][$key]);
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
+                               foreach ($unset_keys as $unset_key) {
+                                       // remove possible empty keys from (e.g. [tags][id3v2][picture])
+                                       if (empty($this->info[$unset_key][$tagtype]['picture'])) {
+                                               unset($this->info[$unset_key][$tagtype]['picture']);
+                                       }
+                                       if (empty($this->info[$unset_key][$tagtype])) {
+                                               unset($this->info[$unset_key][$tagtype]);
+                                       }
+                                       if (empty($this->info[$unset_key])) {
+                                               unset($this->info[$unset_key]);
+                                       }
+                               }
+                               // remove duplicate copy of picture data from (e.g. [id3v2][comments][picture])
+                               if (isset($this->info[$tagtype]['comments']['picture'])) {
+                                       unset($this->info[$tagtype]['comments']['picture']);
+                               }
+                               if (empty($this->info[$tagtype]['comments'])) {
+                                       unset($this->info[$tagtype]['comments']);
+                               }
+                               if (empty($this->info[$tagtype])) {
+                                       unset($this->info[$tagtype]);
+                               }
+                       }
+               }
+               return true;
+       }
+
+
+       public function getHashdata($algorithm) {
+               switch ($algorithm) {
+                       case 'md5':
+                       case 'sha1':
+                               break;
+
+                       default:
+                               return $this->error('bad algorithm "'.$algorithm.'" in getHashdata()');
+                               break;
+               }
+
+               if (!empty($this->info['fileformat']) && !empty($this->info['dataformat']) && ($this->info['fileformat'] == 'ogg') && ($this->info['audio']['dataformat'] == 'vorbis')) {
+
+                       // We cannot get an identical md5_data value for Ogg files where the comments
+                       // span more than 1 Ogg page (compared to the same audio data with smaller
+                       // comments) using the normal getID3() method of MD5'ing the data between the
+                       // end of the comments and the end of the file (minus any trailing tags),
+                       // because the page sequence numbers of the pages that the audio data is on
+                       // do not match. Under normal circumstances, where comments are smaller than
+                       // the nominal 4-8kB page size, then this is not a problem, but if there are
+                       // very large comments, the only way around it is to strip off the comment
+                       // tags with vorbiscomment and MD5 that file.
+                       // This procedure must be applied to ALL Ogg files, not just the ones with
+                       // comments larger than 1 page, because the below method simply MD5's the
+                       // whole file with the comments stripped, not just the portion after the
+                       // comments block (which is the standard getID3() method.
+
+                       // The above-mentioned problem of comments spanning multiple pages and changing
+                       // page sequence numbers likely happens for OggSpeex and OggFLAC as well, but
+                       // currently vorbiscomment only works on OggVorbis files.
+
+                       if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) {
+
+                               $this->warning('Failed making system call to vorbiscomment.exe - '.$algorithm.'_data is incorrect - error returned: PHP running in Safe Mode (backtick operator not available)');
+                               $this->info[$algorithm.'_data'] = false;
+
+                       } else {
+
+                               // Prevent user from aborting script
+                               $old_abort = ignore_user_abort(true);
+
+                               // Create empty file
+                               $empty = tempnam(GETID3_TEMP_DIR, 'getID3');
+                               touch($empty);
+
+                               // Use vorbiscomment to make temp file without comments
+                               $temp = tempnam(GETID3_TEMP_DIR, 'getID3');
+                               $file = $this->info['filenamepath'];
+
+                               if (GETID3_OS_ISWINDOWS) {
+
+                                       if (file_exists(GETID3_HELPERAPPSDIR.'vorbiscomment.exe')) {
+
+                                               $commandline = '"'.GETID3_HELPERAPPSDIR.'vorbiscomment.exe" -w -c "'.$empty.'" "'.$file.'" "'.$temp.'"';
+                                               $VorbisCommentError = `$commandline`;
+
+                                       } else {
+
+                                               $VorbisCommentError = 'vorbiscomment.exe not found in '.GETID3_HELPERAPPSDIR;
+
+                                       }
+
+                               } else {
+
+                                       $commandline = 'vorbiscomment -w -c "'.$empty.'" "'.$file.'" "'.$temp.'" 2>&1';
+                                       $commandline = 'vorbiscomment -w -c '.escapeshellarg($empty).' '.escapeshellarg($file).' '.escapeshellarg($temp).' 2>&1';
+                                       $VorbisCommentError = `$commandline`;
+
+                               }
+
+                               if (!empty($VorbisCommentError)) {
+
+                                       $this->info['warning'][]         = 'Failed making system call to vorbiscomment(.exe) - '.$algorithm.'_data will be incorrect. If vorbiscomment is unavailable, please download from http://www.vorbis.com/download.psp and put in the getID3() directory. Error returned: '.$VorbisCommentError;
+                                       $this->info[$algorithm.'_data']  = false;
+
+                               } else {
+
+                                       // Get hash of newly created file
+                                       switch ($algorithm) {
+                                               case 'md5':
+                                                       $this->info[$algorithm.'_data'] = md5_file($temp);
+                                                       break;
+
+                                               case 'sha1':
+                                                       $this->info[$algorithm.'_data'] = sha1_file($temp);
+                                                       break;
+                                       }
+                               }
+
+                               // Clean up
+                               unlink($empty);
+                               unlink($temp);
+
+                               // Reset abort setting
+                               ignore_user_abort($old_abort);
+
+                       }
+
+               } else {
+
+                       if (!empty($this->info['avdataoffset']) || (isset($this->info['avdataend']) && ($this->info['avdataend'] < $this->info['filesize']))) {
+
+                               // get hash from part of file
+                               $this->info[$algorithm.'_data'] = getid3_lib::hash_data($this->info['filenamepath'], $this->info['avdataoffset'], $this->info['avdataend'], $algorithm);
+
+                       } else {
+
+                               // get hash from whole file
+                               switch ($algorithm) {
+                                       case 'md5':
+                                               $this->info[$algorithm.'_data'] = md5_file($this->info['filenamepath']);
+                                               break;
+
+                                       case 'sha1':
+                                               $this->info[$algorithm.'_data'] = sha1_file($this->info['filenamepath']);
+                                               break;
+                               }
+                       }
+
+               }
+               return true;
+       }
+
+
+       public function ChannelsBitratePlaytimeCalculations() {
+
+               // set channelmode on audio
+               if (!empty($this->info['audio']['channelmode']) || !isset($this->info['audio']['channels'])) {
+                       // ignore
+               } elseif ($this->info['audio']['channels'] == 1) {
+                       $this->info['audio']['channelmode'] = 'mono';
+               } elseif ($this->info['audio']['channels'] == 2) {
+                       $this->info['audio']['channelmode'] = 'stereo';
+               }
+
+               // Calculate combined bitrate - audio + video
+               $CombinedBitrate  = 0;
+               $CombinedBitrate += (isset($this->info['audio']['bitrate']) ? $this->info['audio']['bitrate'] : 0);
+               $CombinedBitrate += (isset($this->info['video']['bitrate']) ? $this->info['video']['bitrate'] : 0);
+               if (($CombinedBitrate > 0) && empty($this->info['bitrate'])) {
+                       $this->info['bitrate'] = $CombinedBitrate;
+               }
+               //if ((isset($this->info['video']) && !isset($this->info['video']['bitrate'])) || (isset($this->info['audio']) && !isset($this->info['audio']['bitrate']))) {
+               //      // for example, VBR MPEG video files cannot determine video bitrate:
+               //      // should not set overall bitrate and playtime from audio bitrate only
+               //      unset($this->info['bitrate']);
+               //}
+
+               // video bitrate undetermined, but calculable
+               if (isset($this->info['video']['dataformat']) && $this->info['video']['dataformat'] && (!isset($this->info['video']['bitrate']) || ($this->info['video']['bitrate'] == 0))) {
+                       // if video bitrate not set
+                       if (isset($this->info['audio']['bitrate']) && ($this->info['audio']['bitrate'] > 0) && ($this->info['audio']['bitrate'] == $this->info['bitrate'])) {
+                               // AND if audio bitrate is set to same as overall bitrate
+                               if (isset($this->info['playtime_seconds']) && ($this->info['playtime_seconds'] > 0)) {
+                                       // AND if playtime is set
+                                       if (isset($this->info['avdataend']) && isset($this->info['avdataoffset'])) {
+                                               // AND if AV data offset start/end is known
+                                               // THEN we can calculate the video bitrate
+                                               $this->info['bitrate'] = round((($this->info['avdataend'] - $this->info['avdataoffset']) * 8) / $this->info['playtime_seconds']);
+                                               $this->info['video']['bitrate'] = $this->info['bitrate'] - $this->info['audio']['bitrate'];
+                                       }
+                               }
+                       }
+               }
+
+               if ((!isset($this->info['playtime_seconds']) || ($this->info['playtime_seconds'] <= 0)) && !empty($this->info['bitrate'])) {
+                       $this->info['playtime_seconds'] = (($this->info['avdataend'] - $this->info['avdataoffset']) * 8) / $this->info['bitrate'];
+               }
+
+               if (!isset($this->info['bitrate']) && !empty($this->info['playtime_seconds'])) {
+                       $this->info['bitrate'] = (($this->info['avdataend'] - $this->info['avdataoffset']) * 8) / $this->info['playtime_seconds'];
+               }
+               if (isset($this->info['bitrate']) && empty($this->info['audio']['bitrate']) && empty($this->info['video']['bitrate'])) {
+                       if (isset($this->info['audio']['dataformat']) && empty($this->info['video']['resolution_x'])) {
+                               // audio only
+                               $this->info['audio']['bitrate'] = $this->info['bitrate'];
+                       } elseif (isset($this->info['video']['resolution_x']) && empty($this->info['audio']['dataformat'])) {
+                               // video only
+                               $this->info['video']['bitrate'] = $this->info['bitrate'];
+                       }
+               }
+
+               // Set playtime string
+               if (!empty($this->info['playtime_seconds']) && empty($this->info['playtime_string'])) {
+                       $this->info['playtime_string'] = getid3_lib::PlaytimeString($this->info['playtime_seconds']);
+               }
+       }
+
+
+       public function CalculateCompressionRatioVideo() {
+               if (empty($this->info['video'])) {
+                       return false;
+               }
+               if (empty($this->info['video']['resolution_x']) || empty($this->info['video']['resolution_y'])) {
+                       return false;
+               }
+               if (empty($this->info['video']['bits_per_sample'])) {
+                       return false;
+               }
+
+               switch ($this->info['video']['dataformat']) {
+                       case 'bmp':
+                       case 'gif':
+                       case 'jpeg':
+                       case 'jpg':
+                       case 'png':
+                       case 'tiff':
+                               $FrameRate = 1;
+                               $PlaytimeSeconds = 1;
+                               $BitrateCompressed = $this->info['filesize'] * 8;
+                               break;
+
+                       default:
+                               if (!empty($this->info['video']['frame_rate'])) {
+                                       $FrameRate = $this->info['video']['frame_rate'];
+                               } else {
+                                       return false;
+                               }
+                               if (!empty($this->info['playtime_seconds'])) {
+                                       $PlaytimeSeconds = $this->info['playtime_seconds'];
+                               } else {
+                                       return false;
+                               }
+                               if (!empty($this->info['video']['bitrate'])) {
+                                       $BitrateCompressed = $this->info['video']['bitrate'];
+                               } else {
+                                       return false;
+                               }
+                               break;
+               }
+               $BitrateUncompressed = $this->info['video']['resolution_x'] * $this->info['video']['resolution_y'] * $this->info['video']['bits_per_sample'] * $FrameRate;
+
+               $this->info['video']['compression_ratio'] = $BitrateCompressed / $BitrateUncompressed;
+               return true;
+       }
+
+
+       public function CalculateCompressionRatioAudio() {
+               if (empty($this->info['audio']['bitrate']) || empty($this->info['audio']['channels']) || empty($this->info['audio']['sample_rate']) || !is_numeric($this->info['audio']['sample_rate'])) {
+                       return false;
+               }
+               $this->info['audio']['compression_ratio'] = $this->info['audio']['bitrate'] / ($this->info['audio']['channels'] * $this->info['audio']['sample_rate'] * (!empty($this->info['audio']['bits_per_sample']) ? $this->info['audio']['bits_per_sample'] : 16));
+
+               if (!empty($this->info['audio']['streams'])) {
+                       foreach ($this->info['audio']['streams'] as $streamnumber => $streamdata) {
+                               if (!empty($streamdata['bitrate']) && !empty($streamdata['channels']) && !empty($streamdata['sample_rate'])) {
+                                       $this->info['audio']['streams'][$streamnumber]['compression_ratio'] = $streamdata['bitrate'] / ($streamdata['channels'] * $streamdata['sample_rate'] * (!empty($streamdata['bits_per_sample']) ? $streamdata['bits_per_sample'] : 16));
+                               }
+                       }
+               }
+               return true;
+       }
+
+
+       public function CalculateReplayGain() {
+               if (isset($this->info['replay_gain'])) {
+                       if (!isset($this->info['replay_gain']['reference_volume'])) {
+                               $this->info['replay_gain']['reference_volume'] = (double) 89.0;
+                       }
+                       if (isset($this->info['replay_gain']['track']['adjustment'])) {
+                               $this->info['replay_gain']['track']['volume'] = $this->info['replay_gain']['reference_volume'] - $this->info['replay_gain']['track']['adjustment'];
+                       }
+                       if (isset($this->info['replay_gain']['album']['adjustment'])) {
+                               $this->info['replay_gain']['album']['volume'] = $this->info['replay_gain']['reference_volume'] - $this->info['replay_gain']['album']['adjustment'];
+                       }
+
+                       if (isset($this->info['replay_gain']['track']['peak'])) {
+                               $this->info['replay_gain']['track']['max_noclip_gain'] = 0 - getid3_lib::RGADamplitude2dB($this->info['replay_gain']['track']['peak']);
+                       }
+                       if (isset($this->info['replay_gain']['album']['peak'])) {
+                               $this->info['replay_gain']['album']['max_noclip_gain'] = 0 - getid3_lib::RGADamplitude2dB($this->info['replay_gain']['album']['peak']);
+                       }
+               }
+               return true;
+       }
+
+       public function ProcessAudioStreams() {
+               if (!empty($this->info['audio']['bitrate']) || !empty($this->info['audio']['channels']) || !empty($this->info['audio']['sample_rate'])) {
+                       if (!isset($this->info['audio']['streams'])) {
+                               foreach ($this->info['audio'] as $key => $value) {
+                                       if ($key != 'streams') {
+                                               $this->info['audio']['streams'][0][$key] = $value;
+                                       }
+                               }
+                       }
+               }
+               return true;
+       }
+
+       public function getid3_tempnam() {
+               return tempnam($this->tempdir, 'gI3');
+       }
+
+       public function include_module($name) {
+               //if (!file_exists($this->include_path.'module.'.$name.'.php')) {
+               if (!file_exists(GETID3_INCLUDEPATH.'module.'.$name.'.php')) {
+                       throw new getid3_exception('Required module.'.$name.'.php is missing.');
+               }
+               include_once(GETID3_INCLUDEPATH.'module.'.$name.'.php');
+               return true;
+       }
+
+}
+
+
+abstract class getid3_handler
+{
+       protected $getid3;                       // pointer
+
+       protected $data_string_flag     = false; // analyzing filepointer or string
+       protected $data_string          = '';    // string to analyze
+       protected $data_string_position = 0;     // seek position in string
+       protected $data_string_length   = 0;     // string length
+
+       private $dependency_to = null;
+
+
+       public function __construct(getID3 $getid3, $call_module=null) {
+               $this->getid3 = $getid3;
+
+               if ($call_module) {
+                       $this->dependency_to = str_replace('getid3_', '', $call_module);
+               }
+       }
+
+
+       // Analyze from file pointer
+       abstract public function Analyze();
+
+
+       // Analyze from string instead
+       public function AnalyzeString($string) {
+               // Enter string mode
+           $this->setStringMode($string);
+
+               // Save info
+               $saved_avdataoffset = $this->getid3->info['avdataoffset'];
+               $saved_avdataend    = $this->getid3->info['avdataend'];
+               $saved_filesize     = (isset($this->getid3->info['filesize']) ? $this->getid3->info['filesize'] : null); // may be not set if called as dependency without openfile() call
+
+               // Reset some info
+               $this->getid3->info['avdataoffset'] = 0;
+               $this->getid3->info['avdataend']    = $this->getid3->info['filesize'] = $this->data_string_length;
+
+               // Analyze
+               $this->Analyze();
+
+               // Restore some info
+               $this->getid3->info['avdataoffset'] = $saved_avdataoffset;
+               $this->getid3->info['avdataend']    = $saved_avdataend;
+               $this->getid3->info['filesize']     = $saved_filesize;
+
+               // Exit string mode
+               $this->data_string_flag = false;
+       }
+
+       public function setStringMode($string) {
+               $this->data_string_flag   = true;
+               $this->data_string        = $string;
+               $this->data_string_length = strlen($string);
+       }
+
+       protected function ftell() {
+               if ($this->data_string_flag) {
+                       return $this->data_string_position;
+               }
+               return ftell($this->getid3->fp);
+       }
+
+       protected function fread($bytes) {
+               if ($this->data_string_flag) {
+                       $this->data_string_position += $bytes;
+                       return substr($this->data_string, $this->data_string_position - $bytes, $bytes);
+               }
+           $pos = $this->ftell() + $bytes;
+           if (!getid3_lib::intValueSupported($pos)) {
+                       throw new getid3_exception('cannot fread('.$bytes.' from '.$this->ftell().') because beyond PHP filesystem limit', 10);
+           }
+               return fread($this->getid3->fp, $bytes);
+       }
+
+       protected function fseek($bytes, $whence=SEEK_SET) {
+               if ($this->data_string_flag) {
+                       switch ($whence) {
+                               case SEEK_SET:
+                                       $this->data_string_position = $bytes;
+                                       break;
+
+                               case SEEK_CUR:
+                                       $this->data_string_position += $bytes;
+                                       break;
+
+                               case SEEK_END:
+                                       $this->data_string_position = $this->data_string_length + $bytes;
+                                       break;
+                       }
+                       return 0;
+           } else {
+               $pos = $bytes;
+               if ($whence == SEEK_CUR) {
+                               $pos = $this->ftell() + $bytes;
+               } elseif ($whence == SEEK_END) {
+                               $pos = $this->info['filesize'] + $bytes;
+               }
+               if (!getid3_lib::intValueSupported($pos)) {
+                               throw new getid3_exception('cannot fseek('.$pos.') because beyond PHP filesystem limit', 10);
+                       }
+               }
+               return fseek($this->getid3->fp, $bytes, $whence);
+       }
+
+       protected function feof() {
+               if ($this->data_string_flag) {
+                       return $this->data_string_position >= $this->data_string_length;
+               }
+               return feof($this->getid3->fp);
+       }
+
+       final protected function isDependencyFor($module) {
+               return $this->dependency_to == $module;
+       }
+
+       protected function error($text)
+       {
+               $this->getid3->info['error'][] = $text;
+
+               return false;
+       }
+
+       protected function warning($text)
+       {
+               return $this->getid3->warning($text);
+       }
+
+       protected function notice($text)
+       {
+               // does nothing for now
+       }
+
+       public function saveAttachment($name, $offset, $length, $image_mime=null) {
+               try {
+
+                       // do not extract at all
+                       if ($this->getid3->option_save_attachments === getID3::ATTACHMENTS_NONE) {
+
+                               $attachment = null; // do not set any
+
+                       // extract to return array
+                       } elseif ($this->getid3->option_save_attachments === getID3::ATTACHMENTS_INLINE) {
+
+                               $this->fseek($offset);
+                               $attachment = $this->fread($length); // get whole data in one pass, till it is anyway stored in memory
+                               if ($attachment === false || strlen($attachment) != $length) {
+                                       throw new Exception('failed to read attachment data');
+                               }
+
+                       // assume directory path is given
+                       } else {
+
+                               // set up destination path
+                               $dir = rtrim(str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $this->getid3->option_save_attachments), DIRECTORY_SEPARATOR);
+                               if (!is_dir($dir) || !is_writable($dir)) { // check supplied directory
+                                       throw new Exception('supplied path ('.$dir.') does not exist, or is not writable');
+                               }
+                               $dest = $dir.DIRECTORY_SEPARATOR.$name.($image_mime ? '.'.getid3_lib::ImageExtFromMime($image_mime) : '');
+
+                               // create dest file
+                               if (($fp_dest = fopen($dest, 'wb')) == false) {
+                                       throw new Exception('failed to create file '.$dest);
+                               }
+
+                               // copy data
+                               $this->fseek($offset);
+                               $buffersize = ($this->data_string_flag ? $length : $this->getid3->fread_buffer_size());
+                               $bytesleft = $length;
+                               while ($bytesleft > 0) {
+                                       if (($buffer = $this->fread(min($buffersize, $bytesleft))) === false || ($byteswritten = fwrite($fp_dest, $buffer)) === false || ($byteswritten === 0)) {
+                                               throw new Exception($buffer === false ? 'not enough data to read' : 'failed to write to destination file, may be not enough disk space');
+                                       }
+                                       $bytesleft -= $byteswritten;
+                               }
+
+                               fclose($fp_dest);
+                               $attachment = $dest;
+
+                       }
+
+               } catch (Exception $e) {
+
+                       // close and remove dest file if created
+                       if (isset($fp_dest) && is_resource($fp_dest)) {
+                               fclose($fp_dest);
+                               unlink($dest);
+                       }
+
+                       // do not set any is case of error
+                       $attachment = null;
+                       $this->warning('Failed to extract attachment '.$name.': '.$e->getMessage());
+
+               }
+
+               // seek to the end of attachment
+               $this->fseek($offset + $length);
+
+               return $attachment;
+       }
+
+}
+
+
+class getid3_exception extends Exception
+{
+       public $message;
+}
\ No newline at end of file
diff --git a/wp-includes/ID3/license.commercial.txt b/wp-includes/ID3/license.commercial.txt
new file mode 100644 (file)
index 0000000..416e5a1
--- /dev/null
@@ -0,0 +1,27 @@
+                  getID3() Commercial License
+                  ===========================
+
+getID3() is licensed under the "GNU Public License" (GPL) and/or the
+"getID3() Commercial License" (gCL). This document describes the gCL.
+
+---------------------------------------------------------------------
+
+The license is non-exclusively granted to a single person or company,
+per payment of the license fee, for the lifetime of that person or
+company. The license is non-transferrable.
+
+The gCL grants the licensee the right to use getID3() in commercial
+closed-source projects. Modifications may be made to getID3() with no
+obligation to release the modified source code. getID3() (or pieces
+thereof) may be included in any number of projects authored (in whole
+or in part) by the licensee.
+
+The licensee may use any version of getID3(), past, present or future,
+as is most convenient. This license does not entitle the licensee to
+receive any technical support, updates or bugfixes, except as such are
+made publicly available to all getID3() users.
+
+The licensee may not sub-license getID3() itself, meaning that any
+commercially released product containing all or parts of getID3() must
+have added functionality beyond what is available in getID3();
+getID3() itself may not be re-licensed by the licensee.
diff --git a/wp-includes/ID3/license.txt b/wp-includes/ID3/license.txt
new file mode 100644 (file)
index 0000000..85f4356
--- /dev/null
@@ -0,0 +1,28 @@
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org>               //
+//  available at http://getid3.sourceforge.net                 //
+//            or http://www.getid3.org                         //
+/////////////////////////////////////////////////////////////////
+
+*****************************************************************
+*****************************************************************
+
+   getID3() is released under multiple licenses. You may choose
+   from the following licenses, and use getID3 according to the
+   terms of the license most suitable to your project.
+
+GNU GPL: https://gnu.org/licenses/gpl.html                   (v3)
+         https://gnu.org/licenses/old-licenses/gpl-2.0.html  (v2)
+         https://gnu.org/licenses/old-licenses/gpl-1.0.html  (v1)
+
+GNU LGPL: https://gnu.org/licenses/lgpl.html                 (v3)
+
+Mozilla MPL: http://www.mozilla.org/MPL/2.0/                 (v2)
+
+getID3 Commercial License: http://getid3.org/#gCL (payment required)
+
+*****************************************************************
+*****************************************************************
+
+Copies of each of the above licenses are included in the 'licenses'
+directory of the getID3 distribution.
diff --git a/wp-includes/ID3/module.audio-video.asf.php b/wp-includes/ID3/module.audio-video.asf.php
new file mode 100644 (file)
index 0000000..cfc60a7
--- /dev/null
@@ -0,0 +1,2019 @@
+<?php
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org>               //
+//  available at http://getid3.sourceforge.net                 //
+//            or http://www.getid3.org                         //
+/////////////////////////////////////////////////////////////////
+// See readme.txt for more details                             //
+/////////////////////////////////////////////////////////////////
+//                                                             //
+// module.audio-video.asf.php                                  //
+// module for analyzing ASF, WMA and WMV files                 //
+// dependencies: module.audio-video.riff.php                   //
+//                                                            ///
+/////////////////////////////////////////////////////////////////
+
+getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true);
+
+class getid3_asf extends getid3_handler
+{
+
+       public function __construct(getID3 $getid3) {
+               parent::__construct($getid3);  // extends getid3_handler::__construct()
+
+               // initialize all GUID constants
+               $GUIDarray = $this->KnownGUIDs();
+               foreach ($GUIDarray as $GUIDname => $hexstringvalue) {
+                       if (!defined($GUIDname)) {
+                               define($GUIDname, $this->GUIDtoBytestring($hexstringvalue));
+                       }
+               }
+       }
+
+       public function Analyze() {
+               $info = &$this->getid3->info;
+
+               // Shortcuts
+               $thisfile_audio = &$info['audio'];
+               $thisfile_video = &$info['video'];
+               $info['asf']  = array();
+               $thisfile_asf = &$info['asf'];
+               $thisfile_asf['comments'] = array();
+               $thisfile_asf_comments    = &$thisfile_asf['comments'];
+               $thisfile_asf['header_object'] = array();
+               $thisfile_asf_headerobject     = &$thisfile_asf['header_object'];
+
+
+               // ASF structure:
+               // * Header Object [required]
+               //   * File Properties Object [required]   (global file attributes)
+               //   * Stream Properties Object [required] (defines media stream & characteristics)
+               //   * Header Extension Object [required]  (additional functionality)
+               //   * Content Description Object          (bibliographic information)
+               //   * Script Command Object               (commands for during playback)
+               //   * Marker Object                       (named jumped points within the file)
+               // * Data Object [required]
+               //   * Data Packets
+               // * Index Object
+
+               // Header Object: (mandatory, one only)
+               // Field Name                   Field Type   Size (bits)
+               // Object ID                    GUID         128             // GUID for header object - GETID3_ASF_Header_Object
+               // Object Size                  QWORD        64              // size of header object, including 30 bytes of Header Object header
+               // Number of Header Objects     DWORD        32              // number of objects in header object
+               // Reserved1                    BYTE         8               // hardcoded: 0x01
+               // Reserved2                    BYTE         8               // hardcoded: 0x02
+
+               $info['fileformat'] = 'asf';
+
+               fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET);
+               $HeaderObjectData = fread($this->getid3->fp, 30);
+
+               $thisfile_asf_headerobject['objectid']      = substr($HeaderObjectData, 0, 16);
+               $thisfile_asf_headerobject['objectid_guid'] = $this->BytestringToGUID($thisfile_asf_headerobject['objectid']);
+               if ($thisfile_asf_headerobject['objectid'] != GETID3_ASF_Header_Object) {
+                       $info['warning'][] = 'ASF header GUID {'.$this->BytestringToGUID($thisfile_asf_headerobject['objectid']).'} does not match expected "GETID3_ASF_Header_Object" GUID {'.$this->BytestringToGUID(GETID3_ASF_Header_Object).'}';
+                       unset($info['fileformat']);
+                       unset($info['asf']);
+                       return false;
+                       break;
+               }
+               $thisfile_asf_headerobject['objectsize']    = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 16, 8));
+               $thisfile_asf_headerobject['headerobjects'] = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 24, 4));
+               $thisfile_asf_headerobject['reserved1']     = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 28, 1));
+               $thisfile_asf_headerobject['reserved2']     = getid3_lib::LittleEndian2Int(substr($HeaderObjectData, 29, 1));
+
+               $NextObjectOffset = ftell($this->getid3->fp);
+               $ASFHeaderData = fread($this->getid3->fp, $thisfile_asf_headerobject['objectsize'] - 30);
+               $offset = 0;
+
+               for ($HeaderObjectsCounter = 0; $HeaderObjectsCounter < $thisfile_asf_headerobject['headerobjects']; $HeaderObjectsCounter++) {
+                       $NextObjectGUID = substr($ASFHeaderData, $offset, 16);
+                       $offset += 16;
+                       $NextObjectGUIDtext = $this->BytestringToGUID($NextObjectGUID);
+                       $NextObjectSize = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));
+                       $offset += 8;
+                       switch ($NextObjectGUID) {
+
+                               case GETID3_ASF_File_Properties_Object:
+                                       // File Properties Object: (mandatory, one only)
+                                       // Field Name                   Field Type   Size (bits)
+                                       // Object ID                    GUID         128             // GUID for file properties object - GETID3_ASF_File_Properties_Object
+                                       // Object Size                  QWORD        64              // size of file properties object, including 104 bytes of File Properties Object header
+                                       // File ID                      GUID         128             // unique ID - identical to File ID in Data Object
+                                       // File Size                    QWORD        64              // entire file in bytes. Invalid if Broadcast Flag == 1
+                                       // Creation Date                QWORD        64              // date & time of file creation. Maybe invalid if Broadcast Flag == 1
+                                       // Data Packets Count           QWORD        64              // number of data packets in Data Object. Invalid if Broadcast Flag == 1
+                                       // Play Duration                QWORD        64              // playtime, in 100-nanosecond units. Invalid if Broadcast Flag == 1
+                                       // Send Duration                QWORD        64              // time needed to send file, in 100-nanosecond units. Players can ignore this value. Invalid if Broadcast Flag == 1
+                                       // Preroll                      QWORD        64              // time to buffer data before starting to play file, in 1-millisecond units. If <> 0, PlayDuration and PresentationTime have been offset by this amount
+                                       // Flags                        DWORD        32              //
+                                       // * Broadcast Flag             bits         1  (0x01)       // file is currently being written, some header values are invalid
+                                       // * Seekable Flag              bits         1  (0x02)       // is file seekable
+                                       // * Reserved                   bits         30 (0xFFFFFFFC) // reserved - set to zero
+                                       // Minimum Data Packet Size     DWORD        32              // in bytes. should be same as Maximum Data Packet Size. Invalid if Broadcast Flag == 1
+                                       // Maximum Data Packet Size     DWORD        32              // in bytes. should be same as Minimum Data Packet Size. Invalid if Broadcast Flag == 1
+                                       // Maximum Bitrate              DWORD        32              // maximum instantaneous bitrate in bits per second for entire file, including all data streams and ASF overhead
+
+                                       // shortcut
+                                       $thisfile_asf['file_properties_object'] = array();
+                                       $thisfile_asf_filepropertiesobject      = &$thisfile_asf['file_properties_object'];
+
+                                       $thisfile_asf_filepropertiesobject['offset']             = $NextObjectOffset + $offset;
+                                       $thisfile_asf_filepropertiesobject['objectid']           = $NextObjectGUID;
+                                       $thisfile_asf_filepropertiesobject['objectid_guid']      = $NextObjectGUIDtext;
+                                       $thisfile_asf_filepropertiesobject['objectsize']         = $NextObjectSize;
+                                       $thisfile_asf_filepropertiesobject['fileid']             = substr($ASFHeaderData, $offset, 16);
+                                       $offset += 16;
+                                       $thisfile_asf_filepropertiesobject['fileid_guid']        = $this->BytestringToGUID($thisfile_asf_filepropertiesobject['fileid']);
+                                       $thisfile_asf_filepropertiesobject['filesize']           = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));
+                                       $offset += 8;
+                                       $thisfile_asf_filepropertiesobject['creation_date']      = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));
+                                       $thisfile_asf_filepropertiesobject['creation_date_unix'] = $this->FILETIMEtoUNIXtime($thisfile_asf_filepropertiesobject['creation_date']);
+                                       $offset += 8;
+                                       $thisfile_asf_filepropertiesobject['data_packets']       = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));
+                                       $offset += 8;
+                                       $thisfile_asf_filepropertiesobject['play_duration']      = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));
+                                       $offset += 8;
+                                       $thisfile_asf_filepropertiesobject['send_duration']      = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));
+                                       $offset += 8;
+                                       $thisfile_asf_filepropertiesobject['preroll']            = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));
+                                       $offset += 8;
+                                       $thisfile_asf_filepropertiesobject['flags_raw']          = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));
+                                       $offset += 4;
+                                       $thisfile_asf_filepropertiesobject['flags']['broadcast'] = (bool) ($thisfile_asf_filepropertiesobject['flags_raw'] & 0x0001);
+                                       $thisfile_asf_filepropertiesobject['flags']['seekable']  = (bool) ($thisfile_asf_filepropertiesobject['flags_raw'] & 0x0002);
+
+                                       $thisfile_asf_filepropertiesobject['min_packet_size']    = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));
+                                       $offset += 4;
+                                       $thisfile_asf_filepropertiesobject['max_packet_size']    = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));
+                                       $offset += 4;
+                                       $thisfile_asf_filepropertiesobject['max_bitrate']        = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));
+                                       $offset += 4;
+
+                                       if ($thisfile_asf_filepropertiesobject['flags']['broadcast']) {
+
+                                               // broadcast flag is set, some values invalid
+                                               unset($thisfile_asf_filepropertiesobject['filesize']);
+                                               unset($thisfile_asf_filepropertiesobject['data_packets']);
+                                               unset($thisfile_asf_filepropertiesobject['play_duration']);
+                                               unset($thisfile_asf_filepropertiesobject['send_duration']);
+                                               unset($thisfile_asf_filepropertiesobject['min_packet_size']);
+                                               unset($thisfile_asf_filepropertiesobject['max_packet_size']);
+
+                                       } else {
+
+                                               // broadcast flag NOT set, perform calculations
+                                               $info['playtime_seconds'] = ($thisfile_asf_filepropertiesobject['play_duration'] / 10000000) - ($thisfile_asf_filepropertiesobject['preroll'] / 1000);
+
+                                               //$info['bitrate'] = $thisfile_asf_filepropertiesobject['max_bitrate'];
+                                               $info['bitrate'] = ((isset($thisfile_asf_filepropertiesobject['filesize']) ? $thisfile_asf_filepropertiesobject['filesize'] : $info['filesize']) * 8) / $info['playtime_seconds'];
+                                       }
+                                       break;
+
+                               case GETID3_ASF_Stream_Properties_Object:
+                                       // Stream Properties Object: (mandatory, one per media stream)
+                                       // Field Name                   Field Type   Size (bits)
+                                       // Object ID                    GUID         128             // GUID for stream properties object - GETID3_ASF_Stream_Properties_Object
+                                       // Object Size                  QWORD        64              // size of stream properties object, including 78 bytes of Stream Properties Object header
+                                       // Stream Type                  GUID         128             // GETID3_ASF_Audio_Media, GETID3_ASF_Video_Media or GETID3_ASF_Command_Media
+                                       // Error Correction Type        GUID         128             // GETID3_ASF_Audio_Spread for audio-only streams, GETID3_ASF_No_Error_Correction for other stream types
+                                       // Time Offset                  QWORD        64              // 100-nanosecond units. typically zero. added to all timestamps of samples in the stream
+                                       // Type-Specific Data Length    DWORD        32              // number of bytes for Type-Specific Data field
+                                       // Error Correction Data Length DWORD        32              // number of bytes for Error Correction Data field
+                                       // Flags                        WORD         16              //
+                                       // * Stream Number              bits         7 (0x007F)      // number of this stream.  1 <= valid <= 127
+                                       // * Reserved                   bits         8 (0x7F80)      // reserved - set to zero
+                                       // * Encrypted Content Flag     bits         1 (0x8000)      // stream contents encrypted if set
+                                       // Reserved                     DWORD        32              // reserved - set to zero
+                                       // Type-Specific Data           BYTESTREAM   variable        // type-specific format data, depending on value of Stream Type
+                                       // Error Correction Data        BYTESTREAM   variable        // error-correction-specific format data, depending on value of Error Correct Type
+
+                                       // There is one GETID3_ASF_Stream_Properties_Object for each stream (audio, video) but the
+                                       // stream number isn't known until halfway through decoding the structure, hence it
+                                       // it is decoded to a temporary variable and then stuck in the appropriate index later
+
+                                       $StreamPropertiesObjectData['offset']             = $NextObjectOffset + $offset;
+                                       $StreamPropertiesObjectData['objectid']           = $NextObjectGUID;
+                                       $StreamPropertiesObjectData['objectid_guid']      = $NextObjectGUIDtext;
+                                       $StreamPropertiesObjectData['objectsize']         = $NextObjectSize;
+                                       $StreamPropertiesObjectData['stream_type']        = substr($ASFHeaderData, $offset, 16);
+                                       $offset += 16;
+                                       $StreamPropertiesObjectData['stream_type_guid']   = $this->BytestringToGUID($StreamPropertiesObjectData['stream_type']);
+                                       $StreamPropertiesObjectData['error_correct_type'] = substr($ASFHeaderData, $offset, 16);
+                                       $offset += 16;
+                                       $StreamPropertiesObjectData['error_correct_guid'] = $this->BytestringToGUID($StreamPropertiesObjectData['error_correct_type']);
+                                       $StreamPropertiesObjectData['time_offset']        = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));
+                                       $offset += 8;
+                                       $StreamPropertiesObjectData['type_data_length']   = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));
+                                       $offset += 4;
+                                       $StreamPropertiesObjectData['error_data_length']  = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));
+                                       $offset += 4;
+                                       $StreamPropertiesObjectData['flags_raw']          = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                       $offset += 2;
+                                       $StreamPropertiesObjectStreamNumber               = $StreamPropertiesObjectData['flags_raw'] & 0x007F;
+                                       $StreamPropertiesObjectData['flags']['encrypted'] = (bool) ($StreamPropertiesObjectData['flags_raw'] & 0x8000);
+
+                                       $offset += 4; // reserved - DWORD
+                                       $StreamPropertiesObjectData['type_specific_data'] = substr($ASFHeaderData, $offset, $StreamPropertiesObjectData['type_data_length']);
+                                       $offset += $StreamPropertiesObjectData['type_data_length'];
+                                       $StreamPropertiesObjectData['error_correct_data'] = substr($ASFHeaderData, $offset, $StreamPropertiesObjectData['error_data_length']);
+                                       $offset += $StreamPropertiesObjectData['error_data_length'];
+
+                                       switch ($StreamPropertiesObjectData['stream_type']) {
+
+                                               case GETID3_ASF_Audio_Media:
+                                                       $thisfile_audio['dataformat']   = (!empty($thisfile_audio['dataformat'])   ? $thisfile_audio['dataformat']   : 'asf');
+                                                       $thisfile_audio['bitrate_mode'] = (!empty($thisfile_audio['bitrate_mode']) ? $thisfile_audio['bitrate_mode'] : 'cbr');
+
+                                                       $audiodata = getid3_riff::parseWAVEFORMATex(substr($StreamPropertiesObjectData['type_specific_data'], 0, 16));
+                                                       unset($audiodata['raw']);
+                                                       $thisfile_audio = getid3_lib::array_merge_noclobber($audiodata, $thisfile_audio);
+                                                       break;
+
+                                               case GETID3_ASF_Video_Media:
+                                                       $thisfile_video['dataformat']   = (!empty($thisfile_video['dataformat'])   ? $thisfile_video['dataformat']   : 'asf');
+                                                       $thisfile_video['bitrate_mode'] = (!empty($thisfile_video['bitrate_mode']) ? $thisfile_video['bitrate_mode'] : 'cbr');
+                                                       break;
+
+                                               case GETID3_ASF_Command_Media:
+                                               default:
+                                                       // do nothing
+                                                       break;
+
+                                       }
+
+                                       $thisfile_asf['stream_properties_object'][$StreamPropertiesObjectStreamNumber] = $StreamPropertiesObjectData;
+                                       unset($StreamPropertiesObjectData); // clear for next stream, if any
+                                       break;
+
+                               case GETID3_ASF_Header_Extension_Object:
+                                       // Header Extension Object: (mandatory, one only)
+                                       // Field Name                   Field Type   Size (bits)
+                                       // Object ID                    GUID         128             // GUID for Header Extension object - GETID3_ASF_Header_Extension_Object
+                                       // Object Size                  QWORD        64              // size of Header Extension object, including 46 bytes of Header Extension Object header
+                                       // Reserved Field 1             GUID         128             // hardcoded: GETID3_ASF_Reserved_1
+                                       // Reserved Field 2             WORD         16              // hardcoded: 0x00000006
+                                       // Header Extension Data Size   DWORD        32              // in bytes. valid: 0, or > 24. equals object size minus 46
+                                       // Header Extension Data        BYTESTREAM   variable        // array of zero or more extended header objects
+
+                                       // shortcut
+                                       $thisfile_asf['header_extension_object'] = array();
+                                       $thisfile_asf_headerextensionobject      = &$thisfile_asf['header_extension_object'];
+
+                                       $thisfile_asf_headerextensionobject['offset']              = $NextObjectOffset + $offset;
+                                       $thisfile_asf_headerextensionobject['objectid']            = $NextObjectGUID;
+                                       $thisfile_asf_headerextensionobject['objectid_guid']       = $NextObjectGUIDtext;
+                                       $thisfile_asf_headerextensionobject['objectsize']          = $NextObjectSize;
+                                       $thisfile_asf_headerextensionobject['reserved_1']          = substr($ASFHeaderData, $offset, 16);
+                                       $offset += 16;
+                                       $thisfile_asf_headerextensionobject['reserved_1_guid']     = $this->BytestringToGUID($thisfile_asf_headerextensionobject['reserved_1']);
+                                       if ($thisfile_asf_headerextensionobject['reserved_1'] != GETID3_ASF_Reserved_1) {
+                                               $info['warning'][] = 'header_extension_object.reserved_1 GUID ('.$this->BytestringToGUID($thisfile_asf_headerextensionobject['reserved_1']).') does not match expected "GETID3_ASF_Reserved_1" GUID ('.$this->BytestringToGUID(GETID3_ASF_Reserved_1).')';
+                                               //return false;
+                                               break;
+                                       }
+                                       $thisfile_asf_headerextensionobject['reserved_2']          = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                       $offset += 2;
+                                       if ($thisfile_asf_headerextensionobject['reserved_2'] != 6) {
+                                               $info['warning'][] = 'header_extension_object.reserved_2 ('.getid3_lib::PrintHexBytes($thisfile_asf_headerextensionobject['reserved_2']).') does not match expected value of "6"';
+                                               //return false;
+                                               break;
+                                       }
+                                       $thisfile_asf_headerextensionobject['extension_data_size'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));
+                                       $offset += 4;
+                                       $thisfile_asf_headerextensionobject['extension_data']      =                              substr($ASFHeaderData, $offset, $thisfile_asf_headerextensionobject['extension_data_size']);
+                                       $unhandled_sections = 0;
+                                       $thisfile_asf_headerextensionobject['extension_data_parsed'] = $this->ASF_HeaderExtensionObjectDataParse($thisfile_asf_headerextensionobject['extension_data'], $unhandled_sections);
+                                       if ($unhandled_sections === 0) {
+                                               unset($thisfile_asf_headerextensionobject['extension_data']);
+                                       }
+                                       $offset += $thisfile_asf_headerextensionobject['extension_data_size'];
+                                       break;
+
+                               case GETID3_ASF_Codec_List_Object:
+                                       // Codec List Object: (optional, one only)
+                                       // Field Name                   Field Type   Size (bits)
+                                       // Object ID                    GUID         128             // GUID for Codec List object - GETID3_ASF_Codec_List_Object
+                                       // Object Size                  QWORD        64              // size of Codec List object, including 44 bytes of Codec List Object header
+                                       // Reserved                     GUID         128             // hardcoded: 86D15241-311D-11D0-A3A4-00A0C90348F6
+                                       // Codec Entries Count          DWORD        32              // number of entries in Codec Entries array
+                                       // Codec Entries                array of:    variable        //
+                                       // * Type                       WORD         16              // 0x0001 = Video Codec, 0x0002 = Audio Codec, 0xFFFF = Unknown Codec
+                                       // * Codec Name Length          WORD         16              // number of Unicode characters stored in the Codec Name field
+                                       // * Codec Name                 WCHAR        variable        // array of Unicode characters - name of codec used to create the content
+                                       // * Codec Description Length   WORD         16              // number of Unicode characters stored in the Codec Description field
+                                       // * Codec Description          WCHAR        variable        // array of Unicode characters - description of format used to create the content
+                                       // * Codec Information Length   WORD         16              // number of Unicode characters stored in the Codec Information field
+                                       // * Codec Information          BYTESTREAM   variable        // opaque array of information bytes about the codec used to create the content
+
+                                       // shortcut
+                                       $thisfile_asf['codec_list_object'] = array();
+                                       $thisfile_asf_codeclistobject      = &$thisfile_asf['codec_list_object'];
+
+                                       $thisfile_asf_codeclistobject['offset']                    = $NextObjectOffset + $offset;
+                                       $thisfile_asf_codeclistobject['objectid']                  = $NextObjectGUID;
+                                       $thisfile_asf_codeclistobject['objectid_guid']             = $NextObjectGUIDtext;
+                                       $thisfile_asf_codeclistobject['objectsize']                = $NextObjectSize;
+                                       $thisfile_asf_codeclistobject['reserved']                  = substr($ASFHeaderData, $offset, 16);
+                                       $offset += 16;
+                                       $thisfile_asf_codeclistobject['reserved_guid']             = $this->BytestringToGUID($thisfile_asf_codeclistobject['reserved']);
+                                       if ($thisfile_asf_codeclistobject['reserved'] != $this->GUIDtoBytestring('86D15241-311D-11D0-A3A4-00A0C90348F6')) {
+                                               $info['warning'][] = 'codec_list_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_codeclistobject['reserved']).'} does not match expected "GETID3_ASF_Reserved_1" GUID {86D15241-311D-11D0-A3A4-00A0C90348F6}';
+                                               //return false;
+                                               break;
+                                       }
+                                       $thisfile_asf_codeclistobject['codec_entries_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));
+                                       $offset += 4;
+                                       for ($CodecEntryCounter = 0; $CodecEntryCounter < $thisfile_asf_codeclistobject['codec_entries_count']; $CodecEntryCounter++) {
+                                               // shortcut
+                                               $thisfile_asf_codeclistobject['codec_entries'][$CodecEntryCounter] = array();
+                                               $thisfile_asf_codeclistobject_codecentries_current = &$thisfile_asf_codeclistobject['codec_entries'][$CodecEntryCounter];
+
+                                               $thisfile_asf_codeclistobject_codecentries_current['type_raw'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                               $offset += 2;
+                                               $thisfile_asf_codeclistobject_codecentries_current['type'] = $this->ASFCodecListObjectTypeLookup($thisfile_asf_codeclistobject_codecentries_current['type_raw']);
+
+                                               $CodecNameLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)) * 2; // 2 bytes per character
+                                               $offset += 2;
+                                               $thisfile_asf_codeclistobject_codecentries_current['name'] = substr($ASFHeaderData, $offset, $CodecNameLength);
+                                               $offset += $CodecNameLength;
+
+                                               $CodecDescriptionLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)) * 2; // 2 bytes per character
+                                               $offset += 2;
+                                               $thisfile_asf_codeclistobject_codecentries_current['description'] = substr($ASFHeaderData, $offset, $CodecDescriptionLength);
+                                               $offset += $CodecDescriptionLength;
+
+                                               $CodecInformationLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                               $offset += 2;
+                                               $thisfile_asf_codeclistobject_codecentries_current['information'] = substr($ASFHeaderData, $offset, $CodecInformationLength);
+                                               $offset += $CodecInformationLength;
+
+                                               if ($thisfile_asf_codeclistobject_codecentries_current['type_raw'] == 2) { // audio codec
+
+                                                       if (strpos($thisfile_asf_codeclistobject_codecentries_current['description'], ',') === false) {
+                                                               $info['warning'][] = '[asf][codec_list_object][codec_entries]['.$CodecEntryCounter.'][description] expected to contain comma-seperated list of parameters: "'.$thisfile_asf_codeclistobject_codecentries_current['description'].'"';
+                                                       } else {
+
+                                                               list($AudioCodecBitrate, $AudioCodecFrequency, $AudioCodecChannels) = explode(',', $this->TrimConvert($thisfile_asf_codeclistobject_codecentries_current['description']));
+                                                               $thisfile_audio['codec'] = $this->TrimConvert($thisfile_asf_codeclistobject_codecentries_current['name']);
+
+                                                               if (!isset($thisfile_audio['bitrate']) && strstr($AudioCodecBitrate, 'kbps')) {
+                                                                       $thisfile_audio['bitrate'] = (int) (trim(str_replace('kbps', '', $AudioCodecBitrate)) * 1000);
+                                                               }
+                                                               //if (!isset($thisfile_video['bitrate']) && isset($thisfile_audio['bitrate']) && isset($thisfile_asf['file_properties_object']['max_bitrate']) && ($thisfile_asf_codeclistobject['codec_entries_count'] > 1)) {
+                                                               if (empty($thisfile_video['bitrate']) && !empty($thisfile_audio['bitrate']) && !empty($info['bitrate'])) {
+                                                                       //$thisfile_video['bitrate'] = $thisfile_asf['file_properties_object']['max_bitrate'] - $thisfile_audio['bitrate'];
+                                                                       $thisfile_video['bitrate'] = $info['bitrate'] - $thisfile_audio['bitrate'];
+                                                               }
+
+                                                               $AudioCodecFrequency = (int) trim(str_replace('kHz', '', $AudioCodecFrequency));
+                                                               switch ($AudioCodecFrequency) {
+                                                                       case 8:
+                                                                       case 8000:
+                                                                               $thisfile_audio['sample_rate'] = 8000;
+                                                                               break;
+
+                                                                       case 11:
+                                                                       case 11025:
+                                                                               $thisfile_audio['sample_rate'] = 11025;
+                                                                               break;
+
+                                                                       case 12:
+                                                                       case 12000:
+                                                                               $thisfile_audio['sample_rate'] = 12000;
+                                                                               break;
+
+                                                                       case 16:
+                                                                       case 16000:
+                                                                               $thisfile_audio['sample_rate'] = 16000;
+                                                                               break;
+
+                                                                       case 22:
+                                                                       case 22050:
+                                                                               $thisfile_audio['sample_rate'] = 22050;
+                                                                               break;
+
+                                                                       case 24:
+                                                                       case 24000:
+                                                                               $thisfile_audio['sample_rate'] = 24000;
+                                                                               break;
+
+                                                                       case 32:
+                                                                       case 32000:
+                                                                               $thisfile_audio['sample_rate'] = 32000;
+                                                                               break;
+
+                                                                       case 44:
+                                                                       case 441000:
+                                                                               $thisfile_audio['sample_rate'] = 44100;
+                                                                               break;
+
+                                                                       case 48:
+                                                                       case 48000:
+                                                                               $thisfile_audio['sample_rate'] = 48000;
+                                                                               break;
+
+                                                                       default:
+                                                                               $info['warning'][] = 'unknown frequency: "'.$AudioCodecFrequency.'" ('.$this->TrimConvert($thisfile_asf_codeclistobject_codecentries_current['description']).')';
+                                                                               break;
+                                                               }
+
+                                                               if (!isset($thisfile_audio['channels'])) {
+                                                                       if (strstr($AudioCodecChannels, 'stereo')) {
+                                                                               $thisfile_audio['channels'] = 2;
+                                                                       } elseif (strstr($AudioCodecChannels, 'mono')) {
+                                                                               $thisfile_audio['channels'] = 1;
+                                                                       }
+                                                               }
+
+                                                       }
+                                               }
+                                       }
+                                       break;
+
+                               case GETID3_ASF_Script_Command_Object:
+                                       // Script Command Object: (optional, one only)
+                                       // Field Name                   Field Type   Size (bits)
+                                       // Object ID                    GUID         128             // GUID for Script Command object - GETID3_ASF_Script_Command_Object
+                                       // Object Size                  QWORD        64              // size of Script Command object, including 44 bytes of Script Command Object header
+                                       // Reserved                     GUID         128             // hardcoded: 4B1ACBE3-100B-11D0-A39B-00A0C90348F6
+                                       // Commands Count               WORD         16              // number of Commands structures in the Script Commands Objects
+                                       // Command Types Count          WORD         16              // number of Command Types structures in the Script Commands Objects
+                                       // Command Types                array of:    variable        //
+                                       // * Command Type Name Length   WORD         16              // number of Unicode characters for Command Type Name
+                                       // * Command Type Name          WCHAR        variable        // array of Unicode characters - name of a type of command
+                                       // Commands                     array of:    variable        //
+                                       // * Presentation Time          DWORD        32              // presentation time of that command, in milliseconds
+                                       // * Type Index                 WORD         16              // type of this command, as a zero-based index into the array of Command Types of this object
+                                       // * Command Name Length        WORD         16              // number of Unicode characters for Command Name
+                                       // * Command Name               WCHAR        variable        // array of Unicode characters - name of this command
+
+                                       // shortcut
+                                       $thisfile_asf['script_command_object'] = array();
+                                       $thisfile_asf_scriptcommandobject      = &$thisfile_asf['script_command_object'];
+
+                                       $thisfile_asf_scriptcommandobject['offset']               = $NextObjectOffset + $offset;
+                                       $thisfile_asf_scriptcommandobject['objectid']             = $NextObjectGUID;
+                                       $thisfile_asf_scriptcommandobject['objectid_guid']        = $NextObjectGUIDtext;
+                                       $thisfile_asf_scriptcommandobject['objectsize']           = $NextObjectSize;
+                                       $thisfile_asf_scriptcommandobject['reserved']             = substr($ASFHeaderData, $offset, 16);
+                                       $offset += 16;
+                                       $thisfile_asf_scriptcommandobject['reserved_guid']        = $this->BytestringToGUID($thisfile_asf_scriptcommandobject['reserved']);
+                                       if ($thisfile_asf_scriptcommandobject['reserved'] != $this->GUIDtoBytestring('4B1ACBE3-100B-11D0-A39B-00A0C90348F6')) {
+                                               $info['warning'][] = 'script_command_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_scriptcommandobject['reserved']).'} does not match expected "GETID3_ASF_Reserved_1" GUID {4B1ACBE3-100B-11D0-A39B-00A0C90348F6}';
+                                               //return false;
+                                               break;
+                                       }
+                                       $thisfile_asf_scriptcommandobject['commands_count']       = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                       $offset += 2;
+                                       $thisfile_asf_scriptcommandobject['command_types_count']  = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                       $offset += 2;
+                                       for ($CommandTypesCounter = 0; $CommandTypesCounter < $thisfile_asf_scriptcommandobject['command_types_count']; $CommandTypesCounter++) {
+                                               $CommandTypeNameLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)) * 2; // 2 bytes per character
+                                               $offset += 2;
+                                               $thisfile_asf_scriptcommandobject['command_types'][$CommandTypesCounter]['name'] = substr($ASFHeaderData, $offset, $CommandTypeNameLength);
+                                               $offset += $CommandTypeNameLength;
+                                       }
+                                       for ($CommandsCounter = 0; $CommandsCounter < $thisfile_asf_scriptcommandobject['commands_count']; $CommandsCounter++) {
+                                               $thisfile_asf_scriptcommandobject['commands'][$CommandsCounter]['presentation_time']  = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));
+                                               $offset += 4;
+                                               $thisfile_asf_scriptcommandobject['commands'][$CommandsCounter]['type_index']         = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                               $offset += 2;
+
+                                               $CommandTypeNameLength = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2)) * 2; // 2 bytes per character
+                                               $offset += 2;
+                                               $thisfile_asf_scriptcommandobject['commands'][$CommandsCounter]['name'] = substr($ASFHeaderData, $offset, $CommandTypeNameLength);
+                                               $offset += $CommandTypeNameLength;
+                                       }
+                                       break;
+
+                               case GETID3_ASF_Marker_Object:
+                                       // Marker Object: (optional, one only)
+                                       // Field Name                   Field Type   Size (bits)
+                                       // Object ID                    GUID         128             // GUID for Marker object - GETID3_ASF_Marker_Object
+                                       // Object Size                  QWORD        64              // size of Marker object, including 48 bytes of Marker Object header
+                                       // Reserved                     GUID         128             // hardcoded: 4CFEDB20-75F6-11CF-9C0F-00A0C90349CB
+                                       // Markers Count                DWORD        32              // number of Marker structures in Marker Object
+                                       // Reserved                     WORD         16              // hardcoded: 0x0000
+                                       // Name Length                  WORD         16              // number of bytes in the Name field
+                                       // Name                         WCHAR        variable        // name of the Marker Object
+                                       // Markers                      array of:    variable        //
+                                       // * Offset                     QWORD        64              // byte offset into Data Object
+                                       // * Presentation Time          QWORD        64              // in 100-nanosecond units
+                                       // * Entry Length               WORD         16              // length in bytes of (Send Time + Flags + Marker Description Length + Marker Description + Padding)
+                                       // * Send Time                  DWORD        32              // in milliseconds
+                                       // * Flags                      DWORD        32              // hardcoded: 0x00000000
+                                       // * Marker Description Length  DWORD        32              // number of bytes in Marker Description field
+                                       // * Marker Description         WCHAR        variable        // array of Unicode characters - description of marker entry
+                                       // * Padding                    BYTESTREAM   variable        // optional padding bytes
+
+                                       // shortcut
+                                       $thisfile_asf['marker_object'] = array();
+                                       $thisfile_asf_markerobject     = &$thisfile_asf['marker_object'];
+
+                                       $thisfile_asf_markerobject['offset']               = $NextObjectOffset + $offset;
+                                       $thisfile_asf_markerobject['objectid']             = $NextObjectGUID;
+                                       $thisfile_asf_markerobject['objectid_guid']        = $NextObjectGUIDtext;
+                                       $thisfile_asf_markerobject['objectsize']           = $NextObjectSize;
+                                       $thisfile_asf_markerobject['reserved']             = substr($ASFHeaderData, $offset, 16);
+                                       $offset += 16;
+                                       $thisfile_asf_markerobject['reserved_guid']        = $this->BytestringToGUID($thisfile_asf_markerobject['reserved']);
+                                       if ($thisfile_asf_markerobject['reserved'] != $this->GUIDtoBytestring('4CFEDB20-75F6-11CF-9C0F-00A0C90349CB')) {
+                                               $info['warning'][] = 'marker_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_markerobject['reserved_1']).'} does not match expected "GETID3_ASF_Reserved_1" GUID {4CFEDB20-75F6-11CF-9C0F-00A0C90349CB}';
+                                               break;
+                                       }
+                                       $thisfile_asf_markerobject['markers_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));
+                                       $offset += 4;
+                                       $thisfile_asf_markerobject['reserved_2'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                       $offset += 2;
+                                       if ($thisfile_asf_markerobject['reserved_2'] != 0) {
+                                               $info['warning'][] = 'marker_object.reserved_2 ('.getid3_lib::PrintHexBytes($thisfile_asf_markerobject['reserved_2']).') does not match expected value of "0"';
+                                               break;
+                                       }
+                                       $thisfile_asf_markerobject['name_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                       $offset += 2;
+                                       $thisfile_asf_markerobject['name'] = substr($ASFHeaderData, $offset, $thisfile_asf_markerobject['name_length']);
+                                       $offset += $thisfile_asf_markerobject['name_length'];
+                                       for ($MarkersCounter = 0; $MarkersCounter < $thisfile_asf_markerobject['markers_count']; $MarkersCounter++) {
+                                               $thisfile_asf_markerobject['markers'][$MarkersCounter]['offset']  = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));
+                                               $offset += 8;
+                                               $thisfile_asf_markerobject['markers'][$MarkersCounter]['presentation_time']         = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 8));
+                                               $offset += 8;
+                                               $thisfile_asf_markerobject['markers'][$MarkersCounter]['entry_length']              = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                               $offset += 2;
+                                               $thisfile_asf_markerobject['markers'][$MarkersCounter]['send_time']                 = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));
+                                               $offset += 4;
+                                               $thisfile_asf_markerobject['markers'][$MarkersCounter]['flags']                     = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));
+                                               $offset += 4;
+                                               $thisfile_asf_markerobject['markers'][$MarkersCounter]['marker_description_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));
+                                               $offset += 4;
+                                               $thisfile_asf_markerobject['markers'][$MarkersCounter]['marker_description']        = substr($ASFHeaderData, $offset, $thisfile_asf_markerobject['markers'][$MarkersCounter]['marker_description_length']);
+                                               $offset += $thisfile_asf_markerobject['markers'][$MarkersCounter]['marker_description_length'];
+                                               $PaddingLength = $thisfile_asf_markerobject['markers'][$MarkersCounter]['entry_length'] - 4 -  4 - 4 - $thisfile_asf_markerobject['markers'][$MarkersCounter]['marker_description_length'];
+                                               if ($PaddingLength > 0) {
+                                                       $thisfile_asf_markerobject['markers'][$MarkersCounter]['padding']               = substr($ASFHeaderData, $offset, $PaddingLength);
+                                                       $offset += $PaddingLength;
+                                               }
+                                       }
+                                       break;
+
+                               case GETID3_ASF_Bitrate_Mutual_Exclusion_Object:
+                                       // Bitrate Mutual Exclusion Object: (optional)
+                                       // Field Name                   Field Type   Size (bits)
+                                       // Object ID                    GUID         128             // GUID for Bitrate Mutual Exclusion object - GETID3_ASF_Bitrate_Mutual_Exclusion_Object
+                                       // Object Size                  QWORD        64              // size of Bitrate Mutual Exclusion object, including 42 bytes of Bitrate Mutual Exclusion Object header
+                                       // Exlusion Type                GUID         128             // nature of mutual exclusion relationship. one of: (GETID3_ASF_Mutex_Bitrate, GETID3_ASF_Mutex_Unknown)
+                                       // Stream Numbers Count         WORD         16              // number of video streams
+                                       // Stream Numbers               WORD         variable        // array of mutually exclusive video stream numbers. 1 <= valid <= 127
+
+                                       // shortcut
+                                       $thisfile_asf['bitrate_mutual_exclusion_object'] = array();
+                                       $thisfile_asf_bitratemutualexclusionobject       = &$thisfile_asf['bitrate_mutual_exclusion_object'];
+
+                                       $thisfile_asf_bitratemutualexclusionobject['offset']               = $NextObjectOffset + $offset;
+                                       $thisfile_asf_bitratemutualexclusionobject['objectid']             = $NextObjectGUID;
+                                       $thisfile_asf_bitratemutualexclusionobject['objectid_guid']        = $NextObjectGUIDtext;
+                                       $thisfile_asf_bitratemutualexclusionobject['objectsize']           = $NextObjectSize;
+                                       $thisfile_asf_bitratemutualexclusionobject['reserved']             = substr($ASFHeaderData, $offset, 16);
+                                       $thisfile_asf_bitratemutualexclusionobject['reserved_guid']        = $this->BytestringToGUID($thisfile_asf_bitratemutualexclusionobject['reserved']);
+                                       $offset += 16;
+                                       if (($thisfile_asf_bitratemutualexclusionobject['reserved'] != GETID3_ASF_Mutex_Bitrate) && ($thisfile_asf_bitratemutualexclusionobject['reserved'] != GETID3_ASF_Mutex_Unknown)) {
+                                               $info['warning'][] = 'bitrate_mutual_exclusion_object.reserved GUID {'.$this->BytestringToGUID($thisfile_asf_bitratemutualexclusionobject['reserved']).'} does not match expected "GETID3_ASF_Mutex_Bitrate" GUID {'.$this->BytestringToGUID(GETID3_ASF_Mutex_Bitrate).'} or  "GETID3_ASF_Mutex_Unknown" GUID {'.$this->BytestringToGUID(GETID3_ASF_Mutex_Unknown).'}';
+                                               //return false;
+                                               break;
+                                       }
+                                       $thisfile_asf_bitratemutualexclusionobject['stream_numbers_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                       $offset += 2;
+                                       for ($StreamNumberCounter = 0; $StreamNumberCounter < $thisfile_asf_bitratemutualexclusionobject['stream_numbers_count']; $StreamNumberCounter++) {
+                                               $thisfile_asf_bitratemutualexclusionobject['stream_numbers'][$StreamNumberCounter] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                               $offset += 2;
+                                       }
+                                       break;
+
+                               case GETID3_ASF_Error_Correction_Object:
+                                       // Error Correction Object: (optional, one only)
+                                       // Field Name                   Field Type   Size (bits)
+                                       // Object ID                    GUID         128             // GUID for Error Correction object - GETID3_ASF_Error_Correction_Object
+                                       // Object Size                  QWORD        64              // size of Error Correction object, including 44 bytes of Error Correction Object header
+                                       // Error Correction Type        GUID         128             // type of error correction. one of: (GETID3_ASF_No_Error_Correction, GETID3_ASF_Audio_Spread)
+                                       // Error Correction Data Length DWORD        32              // number of bytes in Error Correction Data field
+                                       // Error Correction Data        BYTESTREAM   variable        // structure depends on value of Error Correction Type field
+
+                                       // shortcut
+                                       $thisfile_asf['error_correction_object'] = array();
+                                       $thisfile_asf_errorcorrectionobject      = &$thisfile_asf['error_correction_object'];
+
+                                       $thisfile_asf_errorcorrectionobject['offset']                = $NextObjectOffset + $offset;
+                                       $thisfile_asf_errorcorrectionobject['objectid']              = $NextObjectGUID;
+                                       $thisfile_asf_errorcorrectionobject['objectid_guid']         = $NextObjectGUIDtext;
+                                       $thisfile_asf_errorcorrectionobject['objectsize']            = $NextObjectSize;
+                                       $thisfile_asf_errorcorrectionobject['error_correction_type'] = substr($ASFHeaderData, $offset, 16);
+                                       $offset += 16;
+                                       $thisfile_asf_errorcorrectionobject['error_correction_guid'] = $this->BytestringToGUID($thisfile_asf_errorcorrectionobject['error_correction_type']);
+                                       $thisfile_asf_errorcorrectionobject['error_correction_data_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));
+                                       $offset += 4;
+                                       switch ($thisfile_asf_errorcorrectionobject['error_correction_type']) {
+                                               case GETID3_ASF_No_Error_Correction:
+                                                       // should be no data, but just in case there is, skip to the end of the field
+                                                       $offset += $thisfile_asf_errorcorrectionobject['error_correction_data_length'];
+                                                       break;
+
+                                               case GETID3_ASF_Audio_Spread:
+                                                       // Field Name                   Field Type   Size (bits)
+                                                       // Span                         BYTE         8               // number of packets over which audio will be spread.
+                                                       // Virtual Packet Length        WORD         16              // size of largest audio payload found in audio stream
+                                                       // Virtual Chunk Length         WORD         16              // size of largest audio payload found in audio stream
+                                                       // Silence Data Length          WORD         16              // number of bytes in Silence Data field
+                                                       // Silence Data                 BYTESTREAM   variable        // hardcoded: 0x00 * (Silence Data Length) bytes
+
+                                                       $thisfile_asf_errorcorrectionobject['span']                  = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 1));
+                                                       $offset += 1;
+                                                       $thisfile_asf_errorcorrectionobject['virtual_packet_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                                       $offset += 2;
+                                                       $thisfile_asf_errorcorrectionobject['virtual_chunk_length']  = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                                       $offset += 2;
+                                                       $thisfile_asf_errorcorrectionobject['silence_data_length']   = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                                       $offset += 2;
+                                                       $thisfile_asf_errorcorrectionobject['silence_data']          = substr($ASFHeaderData, $offset, $thisfile_asf_errorcorrectionobject['silence_data_length']);
+                                                       $offset += $thisfile_asf_errorcorrectionobject['silence_data_length'];
+                                                       break;
+
+                                               default:
+                                                       $info['warning'][] = 'error_correction_object.error_correction_type GUID {'.$this->BytestringToGUID($thisfile_asf_errorcorrectionobject['reserved']).'} does not match expected "GETID3_ASF_No_Error_Correction" GUID {'.$this->BytestringToGUID(GETID3_ASF_No_Error_Correction).'} or  "GETID3_ASF_Audio_Spread" GUID {'.$this->BytestringToGUID(GETID3_ASF_Audio_Spread).'}';
+                                                       //return false;
+                                                       break;
+                                       }
+
+                                       break;
+
+                               case GETID3_ASF_Content_Description_Object:
+                                       // Content Description Object: (optional, one only)
+                                       // Field Name                   Field Type   Size (bits)
+                                       // Object ID                    GUID         128             // GUID for Content Description object - GETID3_ASF_Content_Description_Object
+                                       // Object Size                  QWORD        64              // size of Content Description object, including 34 bytes of Content Description Object header
+                                       // Title Length                 WORD         16              // number of bytes in Title field
+                                       // Author Length                WORD         16              // number of bytes in Author field
+                                       // Copyright Length             WORD         16              // number of bytes in Copyright field
+                                       // Description Length           WORD         16              // number of bytes in Description field
+                                       // Rating Length                WORD         16              // number of bytes in Rating field
+                                       // Title                        WCHAR        16              // array of Unicode characters - Title
+                                       // Author                       WCHAR        16              // array of Unicode characters - Author
+                                       // Copyright                    WCHAR        16              // array of Unicode characters - Copyright
+                                       // Description                  WCHAR        16              // array of Unicode characters - Description
+                                       // Rating                       WCHAR        16              // array of Unicode characters - Rating
+
+                                       // shortcut
+                                       $thisfile_asf['content_description_object'] = array();
+                                       $thisfile_asf_contentdescriptionobject      = &$thisfile_asf['content_description_object'];
+
+                                       $thisfile_asf_contentdescriptionobject['offset']                = $NextObjectOffset + $offset;
+                                       $thisfile_asf_contentdescriptionobject['objectid']              = $NextObjectGUID;
+                                       $thisfile_asf_contentdescriptionobject['objectid_guid']         = $NextObjectGUIDtext;
+                                       $thisfile_asf_contentdescriptionobject['objectsize']            = $NextObjectSize;
+                                       $thisfile_asf_contentdescriptionobject['title_length']          = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                       $offset += 2;
+                                       $thisfile_asf_contentdescriptionobject['author_length']         = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                       $offset += 2;
+                                       $thisfile_asf_contentdescriptionobject['copyright_length']      = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                       $offset += 2;
+                                       $thisfile_asf_contentdescriptionobject['description_length']    = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                       $offset += 2;
+                                       $thisfile_asf_contentdescriptionobject['rating_length']         = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                       $offset += 2;
+                                       $thisfile_asf_contentdescriptionobject['title']                 = substr($ASFHeaderData, $offset, $thisfile_asf_contentdescriptionobject['title_length']);
+                                       $offset += $thisfile_asf_contentdescriptionobject['title_length'];
+                                       $thisfile_asf_contentdescriptionobject['author']                = substr($ASFHeaderData, $offset, $thisfile_asf_contentdescriptionobject['author_length']);
+                                       $offset += $thisfile_asf_contentdescriptionobject['author_length'];
+                                       $thisfile_asf_contentdescriptionobject['copyright']             = substr($ASFHeaderData, $offset, $thisfile_asf_contentdescriptionobject['copyright_length']);
+                                       $offset += $thisfile_asf_contentdescriptionobject['copyright_length'];
+                                       $thisfile_asf_contentdescriptionobject['description']           = substr($ASFHeaderData, $offset, $thisfile_asf_contentdescriptionobject['description_length']);
+                                       $offset += $thisfile_asf_contentdescriptionobject['description_length'];
+                                       $thisfile_asf_contentdescriptionobject['rating']                = substr($ASFHeaderData, $offset, $thisfile_asf_contentdescriptionobject['rating_length']);
+                                       $offset += $thisfile_asf_contentdescriptionobject['rating_length'];
+
+                                       $ASFcommentKeysToCopy = array('title'=>'title', 'author'=>'artist', 'copyright'=>'copyright', 'description'=>'comment', 'rating'=>'rating');
+                                       foreach ($ASFcommentKeysToCopy as $keytocopyfrom => $keytocopyto) {
+                                               if (!empty($thisfile_asf_contentdescriptionobject[$keytocopyfrom])) {
+                                                       $thisfile_asf_comments[$keytocopyto][] = $this->TrimTerm($thisfile_asf_contentdescriptionobject[$keytocopyfrom]);
+                                               }
+                                       }
+                                       break;
+
+                               case GETID3_ASF_Extended_Content_Description_Object:
+                                       // Extended Content Description Object: (optional, one only)
+                                       // Field Name                   Field Type   Size (bits)
+                                       // Object ID                    GUID         128             // GUID for Extended Content Description object - GETID3_ASF_Extended_Content_Description_Object
+                                       // Object Size                  QWORD        64              // size of ExtendedContent Description object, including 26 bytes of Extended Content Description Object header
+                                       // Content Descriptors Count    WORD         16              // number of entries in Content Descriptors list
+                                       // Content Descriptors          array of:    variable        //
+                                       // * Descriptor Name Length     WORD         16              // size in bytes of Descriptor Name field
+                                       // * Descriptor Name            WCHAR        variable        // array of Unicode characters - Descriptor Name
+                                       // * Descriptor Value Data Type WORD         16              // Lookup array:
+                                                                                                                                                                       // 0x0000 = Unicode String (variable length)
+                                                                                                                                                                       // 0x0001 = BYTE array     (variable length)
+                                                                                                                                                                       // 0x0002 = BOOL           (DWORD, 32 bits)
+                                                                                                                                                                       // 0x0003 = DWORD          (DWORD, 32 bits)
+                                                                                                                                                                       // 0x0004 = QWORD          (QWORD, 64 bits)
+                                                                                                                                                                       // 0x0005 = WORD           (WORD,  16 bits)
+                                       // * Descriptor Value Length    WORD         16              // number of bytes stored in Descriptor Value field
+                                       // * Descriptor Value           variable     variable        // value for Content Descriptor
+
+                                       // shortcut
+                                       $thisfile_asf['extended_content_description_object'] = array();
+                                       $thisfile_asf_extendedcontentdescriptionobject       = &$thisfile_asf['extended_content_description_object'];
+
+                                       $thisfile_asf_extendedcontentdescriptionobject['offset']                    = $NextObjectOffset + $offset;
+                                       $thisfile_asf_extendedcontentdescriptionobject['objectid']                  = $NextObjectGUID;
+                                       $thisfile_asf_extendedcontentdescriptionobject['objectid_guid']             = $NextObjectGUIDtext;
+                                       $thisfile_asf_extendedcontentdescriptionobject['objectsize']                = $NextObjectSize;
+                                       $thisfile_asf_extendedcontentdescriptionobject['content_descriptors_count'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                       $offset += 2;
+                                       for ($ExtendedContentDescriptorsCounter = 0; $ExtendedContentDescriptorsCounter < $thisfile_asf_extendedcontentdescriptionobject['content_descriptors_count']; $ExtendedContentDescriptorsCounter++) {
+                                               // shortcut
+                                               $thisfile_asf_extendedcontentdescriptionobject['content_descriptors'][$ExtendedContentDescriptorsCounter] = array();
+                                               $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current                 = &$thisfile_asf_extendedcontentdescriptionobject['content_descriptors'][$ExtendedContentDescriptorsCounter];
+
+                                               $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['base_offset']  = $offset + 30;
+                                               $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name_length']  = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                               $offset += 2;
+                                               $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name']         = substr($ASFHeaderData, $offset, $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name_length']);
+                                               $offset += $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name_length'];
+                                               $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_type']   = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                               $offset += 2;
+                                               $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_length'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                               $offset += 2;
+                                               $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']        = substr($ASFHeaderData, $offset, $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_length']);
+                                               $offset += $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_length'];
+                                               switch ($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_type']) {
+                                                       case 0x0000: // Unicode string
+                                                               break;
+
+                                                       case 0x0001: // BYTE array
+                                                               // do nothing
+                                                               break;
+
+                                                       case 0x0002: // BOOL
+                                                               $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'] = (bool) getid3_lib::LittleEndian2Int($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']);
+                                                               break;
+
+                                                       case 0x0003: // DWORD
+                                                       case 0x0004: // QWORD
+                                                       case 0x0005: // WORD
+                                                               $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'] = getid3_lib::LittleEndian2Int($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']);
+                                                               break;
+
+                                                       default:
+                                                               $info['warning'][] = 'extended_content_description.content_descriptors.'.$ExtendedContentDescriptorsCounter.'.value_type is invalid ('.$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_type'].')';
+                                                               //return false;
+                                                               break;
+                                               }
+                                               switch ($this->TrimConvert(strtolower($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name']))) {
+
+                                                       case 'wm/albumartist':
+                                                       case 'artist':
+                                                               // Note: not 'artist', that comes from 'author' tag
+                                                               $thisfile_asf_comments['albumartist'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));
+                                                               break;
+
+                                                       case 'wm/albumtitle':
+                                                       case 'album':
+                                                               $thisfile_asf_comments['album']  = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));
+                                                               break;
+
+                                                       case 'wm/genre':
+                                                       case 'genre':
+                                                               $thisfile_asf_comments['genre'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));
+                                                               break;
+
+                                                       case 'wm/partofset':
+                                                               $thisfile_asf_comments['partofset'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));
+                                                               break;
+
+                                                       case 'wm/tracknumber':
+                                                       case 'tracknumber':
+                                                               // be careful casting to int: casting unicode strings to int gives unexpected results (stops parsing at first non-numeric character)
+                                                               $thisfile_asf_comments['track'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));
+                                                               foreach ($thisfile_asf_comments['track'] as $key => $value) {
+                                                                       if (preg_match('/^[0-9\x00]+$/', $value)) {
+                                                                               $thisfile_asf_comments['track'][$key] = intval(str_replace("\x00", '', $value));
+                                                                       }
+                                                               }
+                                                               break;
+
+                                                       case 'wm/track':
+                                                               if (empty($thisfile_asf_comments['track'])) {
+                                                                       $thisfile_asf_comments['track'] = array(1 + $this->TrimConvert($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));
+                                                               }
+                                                               break;
+
+                                                       case 'wm/year':
+                                                       case 'year':
+                                                       case 'date':
+                                                               $thisfile_asf_comments['year'] = array( $this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));
+                                                               break;
+
+                                                       case 'wm/lyrics':
+                                                       case 'lyrics':
+                                                               $thisfile_asf_comments['lyrics'] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));
+                                                               break;
+
+                                                       case 'isvbr':
+                                                               if ($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']) {
+                                                                       $thisfile_audio['bitrate_mode'] = 'vbr';
+                                                                       $thisfile_video['bitrate_mode'] = 'vbr';
+                                                               }
+                                                               break;
+
+                                                       case 'id3':
+                                                               // id3v2 module might not be loaded
+                                                               if (class_exists('getid3_id3v2')) {
+                                                                       $tempfile         = tempnam(GETID3_TEMP_DIR, 'getID3');
+                                                                       $tempfilehandle   = fopen($tempfile, 'wb');
+                                                                       $tempThisfileInfo = array('encoding'=>$info['encoding']);
+                                                                       fwrite($tempfilehandle, $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']);
+                                                                       fclose($tempfilehandle);
+
+                                                                       $getid3_temp = new getID3();
+                                                                       $getid3_temp->openfile($tempfile);
+                                                                       $getid3_id3v2 = new getid3_id3v2($getid3_temp);
+                                                                       $getid3_id3v2->Analyze();
+                                                                       $info['id3v2'] = $getid3_temp->info['id3v2'];
+                                                                       unset($getid3_temp, $getid3_id3v2);
+
+                                                                       unlink($tempfile);
+                                                               }
+                                                               break;
+
+                                                       case 'wm/encodingtime':
+                                                               $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['encoding_time_unix'] = $this->FILETIMEtoUNIXtime($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']);
+                                                               $thisfile_asf_comments['encoding_time_unix'] = array($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['encoding_time_unix']);
+                                                               break;
+
+                                                       case 'wm/picture':
+                                                               $WMpicture = $this->ASF_WMpicture($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']);
+                                                               foreach ($WMpicture as $key => $value) {
+                                                                       $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current[$key] = $value;
+                                                               }
+                                                               unset($WMpicture);
+/*
+                                                               $wm_picture_offset = 0;
+                                                               $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_type_id'] = getid3_lib::LittleEndian2Int(substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset, 1));
+                                                               $wm_picture_offset += 1;
+                                                               $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_type']    = $this->WMpictureTypeLookup($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_type_id']);
+                                                               $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_size']    = getid3_lib::LittleEndian2Int(substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset, 4));
+                                                               $wm_picture_offset += 4;
+
+                                                               $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_mime'] = '';
+                                                               do {
+                                                                       $next_byte_pair = substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset, 2);
+                                                                       $wm_picture_offset += 2;
+                                                                       $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_mime'] .= $next_byte_pair;
+                                                               } while ($next_byte_pair !== "\x00\x00");
+
+                                                               $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_description'] = '';
+                                                               do {
+                                                                       $next_byte_pair = substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset, 2);
+                                                                       $wm_picture_offset += 2;
+                                                                       $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_description'] .= $next_byte_pair;
+                                                               } while ($next_byte_pair !== "\x00\x00");
+
+                                                               $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['dataoffset'] = $wm_picture_offset;
+                                                               $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['data'] = substr($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value'], $wm_picture_offset);
+                                                               unset($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']);
+
+                                                               $imageinfo = array();
+                                                               $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_mime'] = '';
+                                                               $imagechunkcheck = getid3_lib::GetDataImageSize($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['data'], $imageinfo);
+                                                               unset($imageinfo);
+                                                               if (!empty($imagechunkcheck)) {
+                                                                       $thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_mime'] = image_type_to_mime_type($imagechunkcheck[2]);
+                                                               }
+                                                               if (!isset($thisfile_asf_comments['picture'])) {
+                                                                       $thisfile_asf_comments['picture'] = array();
+                                                               }
+                                                               $thisfile_asf_comments['picture'][] = array('data'=>$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['data'], 'image_mime'=>$thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['image_mime']);
+*/
+                                                               break;
+
+                                                       default:
+                                                               switch ($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value_type']) {
+                                                                       case 0: // Unicode string
+                                                                               if (substr($this->TrimConvert($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name']), 0, 3) == 'WM/') {
+                                                                                       $thisfile_asf_comments[str_replace('wm/', '', strtolower($this->TrimConvert($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['name'])))] = array($this->TrimTerm($thisfile_asf_extendedcontentdescriptionobject_contentdescriptor_current['value']));
+                                                                               }
+                                                                               break;
+
+                                                                       case 1:
+                                                                               break;
+                                                               }
+                                                               break;
+                                               }
+
+                                       }
+                                       break;
+
+                               case GETID3_ASF_Stream_Bitrate_Properties_Object:
+                                       // Stream Bitrate Properties Object: (optional, one only)
+                                       // Field Name                   Field Type   Size (bits)
+                                       // Object ID                    GUID         128             // GUID for Stream Bitrate Properties object - GETID3_ASF_Stream_Bitrate_Properties_Object
+                                       // Object Size                  QWORD        64              // size of Extended Content Description object, including 26 bytes of Stream Bitrate Properties Object header
+                                       // Bitrate Records Count        WORD         16              // number of records in Bitrate Records
+                                       // Bitrate Records              array of:    variable        //
+                                       // * Flags                      WORD         16              //
+                                       // * * Stream Number            bits         7  (0x007F)     // number of this stream
+                                       // * * Reserved                 bits         9  (0xFF80)     // hardcoded: 0
+                                       // * Average Bitrate            DWORD        32              // in bits per second
+
+                                       // shortcut
+                                       $thisfile_asf['stream_bitrate_properties_object'] = array();
+                                       $thisfile_asf_streambitratepropertiesobject       = &$thisfile_asf['stream_bitrate_properties_object'];
+
+                                       $thisfile_asf_streambitratepropertiesobject['offset']                    = $NextObjectOffset + $offset;
+                                       $thisfile_asf_streambitratepropertiesobject['objectid']                  = $NextObjectGUID;
+                                       $thisfile_asf_streambitratepropertiesobject['objectid_guid']             = $NextObjectGUIDtext;
+                                       $thisfile_asf_streambitratepropertiesobject['objectsize']                = $NextObjectSize;
+                                       $thisfile_asf_streambitratepropertiesobject['bitrate_records_count']     = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                       $offset += 2;
+                                       for ($BitrateRecordsCounter = 0; $BitrateRecordsCounter < $thisfile_asf_streambitratepropertiesobject['bitrate_records_count']; $BitrateRecordsCounter++) {
+                                               $thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['flags_raw'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 2));
+                                               $offset += 2;
+                                               $thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['flags']['stream_number'] = $thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['flags_raw'] & 0x007F;
+                                               $thisfile_asf_streambitratepropertiesobject['bitrate_records'][$BitrateRecordsCounter]['bitrate'] = getid3_lib::LittleEndian2Int(substr($ASFHeaderData, $offset, 4));
+                                               $offset += 4;
+                                       }
+                                       break;
+
+                               case GETID3_ASF_Padding_Object:
+                                       // Padding Object: (optional)
+                                       // Field Name                   Field Type   Size (bits)
+                                       // Object ID                    GUID         128             // GUID for Padding object - GETID3_ASF_Padding_Object
+                                       // Object Size                  QWORD        64              // size of Padding object, including 24 bytes of ASF Padding Object header
+                                       // Padding Data                 BYTESTREAM   variable        // ignore
+
+                                       // shortcut
+                                       $thisfile_asf['padding_object'] = array();
+                                       $thisfile_asf_paddingobject     = &$thisfile_asf['padding_object'];
+
+                                       $thisfile_asf_paddingobject['offset']                    = $NextObjectOffset + $offset;
+                                       $thisfile_asf_paddingobject['objectid']                  = $NextObjectGUID;
+                                       $thisfile_asf_paddingobject['objectid_guid']             = $NextObjectGUIDtext;
+                                       $thisfile_asf_paddingobject['objectsize']                = $NextObjectSize;
+                                       $thisfile_asf_paddingobject['padding_length']            = $thisfile_asf_paddingobject['objectsize'] - 16 - 8;
+                                       $thisfile_asf_paddingobject['padding']                   = substr($ASFHeaderData, $offset, $thisfile_asf_paddingobject['padding_length']);
+                                       $offset += ($NextObjectSize - 16 - 8);
+                                       break;
+
+                               case GETID3_ASF_Extended_Content_Encryption_Object:
+                               case GETID3_ASF_Content_Encryption_Object:
+                                       // WMA DRM - just ignore
+                                       $offset += ($NextObjectSize - 16 - 8);
+                                       break;
+
+                               default:
+                                       // Implementations shall ignore any standard or non-standard object that they do not know how to handle.
+                                       if ($this->GUIDname($NextObjectGUIDtext)) {
+                                               $info['warning'][] = 'unhandled GUID "'.$this->GUIDname($NextObjectGUIDtext).'" {'.$NextObjectGUIDtext.'} in ASF header at offset '.($offset - 16 - 8);
+                                       } else {
+                                               $info['warning'][] = 'unknown GUID {'.$NextObjectGUIDtext.'} in ASF header at offset '.($offset - 16 - 8);
+                                       }
+                                       $offset += ($NextObjectSize - 16 - 8);
+                                       break;
+                       }
+               }
+               if (isset($thisfile_asf_streambitrateproperties['bitrate_records_count'])) {
+                       $ASFbitrateAudio = 0;
+                       $ASFbitrateVideo = 0;
+                       for ($BitrateRecordsCounter = 0; $BitrateRecordsCounter < $thisfile_asf_streambitrateproperties['bitrate_records_count']; $BitrateRecordsCounter++) {
+                               if (isset($thisfile_asf_codeclistobject['codec_entries'][$BitrateRecordsCounter])) {
+                                       switch ($thisfile_asf_codeclistobject['codec_entries'][$BitrateRecordsCounter]['type_raw']) {
+                                               case 1:
+                                                       $ASFbitrateVideo += $thisfile_asf_streambitrateproperties['bitrate_records'][$BitrateRecordsCounter]['bitrate'];
+                                                       break;
+
+                                               case 2:
+                                                       $ASFbitrateAudio += $thisfile_asf_streambitrateproperties['bitrate_records'][$BitrateRecordsCounter]['bitrate'];
+                                                       break;
+
+                                               default:
+                                                       // do nothing
+                                                       break;
+                                       }
+                               }
+                       }
+                       if ($ASFbitrateAudio > 0) {
+                               $thisfile_audio['bitrate'] = $ASFbitrateAudio;
+                       }
+                       if ($ASFbitrateVideo > 0) {
+                               $thisfile_video['bitrate'] = $ASFbitrateVideo;
+                       }
+               }
+               if (isset($thisfile_asf['stream_properties_object']) && is_array($thisfile_asf['stream_properties_object'])) {
+
+                       $thisfile_audio['bitrate'] = 0;
+                       $thisfile_video['bitrate'] = 0;
+
+                       foreach ($thisfile_asf['stream_properties_object'] as $streamnumber => $streamdata) {
+
+                               switch ($streamdata['stream_type']) {
+                                       case GETID3_ASF_Audio_Media:
+                                               // Field Name                   Field Type   Size (bits)
+                                               // Codec ID / Format Tag        WORD         16              // unique ID of audio codec - defined as wFormatTag field of WAVEFORMATEX structure
+                                               // Number of Channels           WORD         16              // number of channels of audio - defined as nChannels field of WAVEFORMATEX structure
+                                               // Samples Per Second           DWORD        32              // in Hertz - defined as nSamplesPerSec field of WAVEFORMATEX structure
+                                               // Average number of Bytes/sec  DWORD        32              // bytes/sec of audio stream  - defined as nAvgBytesPerSec field of WAVEFORMATEX structure
+                                               // Block Alignment              WORD         16              // block size in bytes of audio codec - defined as nBlockAlign field of WAVEFORMATEX structure
+                                               // Bits per sample              WORD         16              // bits per sample of mono data. set to zero for variable bitrate codecs. defined as wBitsPerSample field of WAVEFORMATEX structure
+                                               // Codec Specific Data Size     WORD         16              // size in bytes of Codec Specific Data buffer - defined as cbSize field of WAVEFORMATEX structure
+                                               // Codec Specific Data          BYTESTREAM   variable        // array of codec-specific data bytes
+
+                                               // shortcut
+                                               $thisfile_asf['audio_media'][$streamnumber] = array();
+                                               $thisfile_asf_audiomedia_currentstream      = &$thisfile_asf['audio_media'][$streamnumber];
+
+                                               $audiomediaoffset = 0;
+
+                                               $thisfile_asf_audiomedia_currentstream = getid3_riff::parseWAVEFORMATex(substr($streamdata['type_specific_data'], $audiomediaoffset, 16));
+                                               $audiomediaoffset += 16;
+
+                                               $thisfile_audio['lossless'] = false;
+                                               switch ($thisfile_asf_audiomedia_currentstream['raw']['wFormatTag']) {
+                                                       case 0x0001: // PCM
+                                                       case 0x0163: // WMA9 Lossless
+                                                               $thisfile_audio['lossless'] = true;
+                                                               break;
+                                               }
+
+                                               if (!empty($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'])) {
+                                                       foreach ($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'] as $dummy => $dataarray) {
+                                                               if (isset($dataarray['flags']['stream_number']) && ($dataarray['flags']['stream_number'] == $streamnumber)) {
+                                                                       $thisfile_asf_audiomedia_currentstream['bitrate'] = $dataarray['bitrate'];
+                                                                       $thisfile_audio['bitrate'] += $dataarray['bitrate'];
+                                                                       break;
+                                                               }
+                                                       }
+                                               } else {
+                                                       if (!empty($thisfile_asf_audiomedia_currentstream['bytes_sec'])) {
+                                                               $thisfile_audio['bitrate'] += $thisfile_asf_audiomedia_currentstream['bytes_sec'] * 8;
+                                                       } elseif (!empty($thisfile_asf_audiomedia_currentstream['bitrate'])) {
+                                                               $thisfile_audio['bitrate'] += $thisfile_asf_audiomedia_currentstream['bitrate'];
+                                                       }
+                                               }
+                                               $thisfile_audio['streams'][$streamnumber]                = $thisfile_asf_audiomedia_currentstream;
+                                               $thisfile_audio['streams'][$streamnumber]['wformattag']  = $thisfile_asf_audiomedia_currentstream['raw']['wFormatTag'];
+                                               $thisfile_audio['streams'][$streamnumber]['lossless']    = $thisfile_audio['lossless'];
+                                               $thisfile_audio['streams'][$streamnumber]['bitrate']     = $thisfile_audio['bitrate'];
+                                               $thisfile_audio['streams'][$streamnumber]['dataformat']  = 'wma';
+                                               unset($thisfile_audio['streams'][$streamnumber]['raw']);
+
+                                               $thisfile_asf_audiomedia_currentstream['codec_data_size'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $audiomediaoffset, 2));
+                                               $audiomediaoffset += 2;
+                                               $thisfile_asf_audiomedia_currentstream['codec_data']      = substr($streamdata['type_specific_data'], $audiomediaoffset, $thisfile_asf_audiomedia_currentstream['codec_data_size']);
+                                               $audiomediaoffset += $thisfile_asf_audiomedia_currentstream['codec_data_size'];
+
+                                               break;
+
+                                       case GETID3_ASF_Video_Media:
+                                               // Field Name                   Field Type   Size (bits)
+                                               // Encoded Image Width          DWORD        32              // width of image in pixels
+                                               // Encoded Image Height         DWORD        32              // height of image in pixels
+                                               // Reserved Flags               BYTE         8               // hardcoded: 0x02
+                                               // Format Data Size             WORD         16              // size of Format Data field in bytes
+                                               // Format Data                  array of:    variable        //
+                                               // * Format Data Size           DWORD        32              // number of bytes in Format Data field, in bytes - defined as biSize field of BITMAPINFOHEADER structure
+                                               // * Image Width                LONG         32              // width of encoded image in pixels - defined as biWidth field of BITMAPINFOHEADER structure
+                                               // * Image Height               LONG         32              // height of encoded image in pixels - defined as biHeight field of BITMAPINFOHEADER structure
+                                               // * Reserved                   WORD         16              // hardcoded: 0x0001 - defined as biPlanes field of BITMAPINFOHEADER structure
+                                               // * Bits Per Pixel Count       WORD         16              // bits per pixel - defined as biBitCount field of BITMAPINFOHEADER structure
+                                               // * Compression ID             FOURCC       32              // fourcc of video codec - defined as biCompression field of BITMAPINFOHEADER structure
+                                               // * Image Size                 DWORD        32              // image size in bytes - defined as biSizeImage field of BITMAPINFOHEADER structure
+                                               // * Horizontal Pixels / Meter  DWORD        32              // horizontal resolution of target device in pixels per meter - defined as biXPelsPerMeter field of BITMAPINFOHEADER structure
+                                               // * Vertical Pixels / Meter    DWORD        32              // vertical resolution of target device in pixels per meter - defined as biYPelsPerMeter field of BITMAPINFOHEADER structure
+                                               // * Colors Used Count          DWORD        32              // number of color indexes in the color table that are actually used - defined as biClrUsed field of BITMAPINFOHEADER structure
+                                               // * Important Colors Count     DWORD        32              // number of color index required for displaying bitmap. if zero, all colors are required. defined as biClrImportant field of BITMAPINFOHEADER structure
+                                               // * Codec Specific Data        BYTESTREAM   variable        // array of codec-specific data bytes
+
+                                               // shortcut
+                                               $thisfile_asf['video_media'][$streamnumber] = array();
+                                               $thisfile_asf_videomedia_currentstream      = &$thisfile_asf['video_media'][$streamnumber];
+
+                                               $videomediaoffset = 0;
+                                               $thisfile_asf_videomedia_currentstream['image_width']                     = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));
+                                               $videomediaoffset += 4;
+                                               $thisfile_asf_videomedia_currentstream['image_height']                    = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));
+                                               $videomediaoffset += 4;
+                                               $thisfile_asf_videomedia_currentstream['flags']                           = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 1));
+                                               $videomediaoffset += 1;
+                                               $thisfile_asf_videomedia_currentstream['format_data_size']                = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 2));
+                                               $videomediaoffset += 2;
+                                               $thisfile_asf_videomedia_currentstream['format_data']['format_data_size'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));
+                                               $videomediaoffset += 4;
+                                               $thisfile_asf_videomedia_currentstream['format_data']['image_width']      = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));
+                                               $videomediaoffset += 4;
+                                               $thisfile_asf_videomedia_currentstream['format_data']['image_height']     = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));
+                                               $videomediaoffset += 4;
+                                               $thisfile_asf_videomedia_currentstream['format_data']['reserved']         = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 2));
+                                               $videomediaoffset += 2;
+                                               $thisfile_asf_videomedia_currentstream['format_data']['bits_per_pixel']   = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 2));
+                                               $videomediaoffset += 2;
+                                               $thisfile_asf_videomedia_currentstream['format_data']['codec_fourcc']     = substr($streamdata['type_specific_data'], $videomediaoffset, 4);
+                                               $videomediaoffset += 4;
+                                               $thisfile_asf_videomedia_currentstream['format_data']['image_size']       = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));
+                                               $videomediaoffset += 4;
+                                               $thisfile_asf_videomedia_currentstream['format_data']['horizontal_pels']  = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));
+                                               $videomediaoffset += 4;
+                                               $thisfile_asf_videomedia_currentstream['format_data']['vertical_pels']    = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));
+                                               $videomediaoffset += 4;
+                                               $thisfile_asf_videomedia_currentstream['format_data']['colors_used']      = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));
+                                               $videomediaoffset += 4;
+                                               $thisfile_asf_videomedia_currentstream['format_data']['colors_important'] = getid3_lib::LittleEndian2Int(substr($streamdata['type_specific_data'], $videomediaoffset, 4));
+                                               $videomediaoffset += 4;
+                                               $thisfile_asf_videomedia_currentstream['format_data']['codec_data']       = substr($streamdata['type_specific_data'], $videomediaoffset);
+
+                                               if (!empty($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'])) {
+                                                       foreach ($thisfile_asf['stream_bitrate_properties_object']['bitrate_records'] as $dummy => $dataarray) {
+                                                               if (isset($dataarray['flags']['stream_number']) && ($dataarray['flags']['stream_number'] == $streamnumber)) {
+                                                                       $thisfile_asf_videomedia_currentstream['bitrate'] = $dataarray['bitrate'];
+                                                                       $thisfile_video['streams'][$streamnumber]['bitrate'] = $dataarray['bitrate'];
+                                                                       $thisfile_video['bitrate'] += $dataarray['bitrate'];
+                                                                       break;
+                                                               }
+                                                       }
+                                               }
+
+                                               $thisfile_asf_videomedia_currentstream['format_data']['codec'] = getid3_riff::fourccLookup($thisfile_asf_videomedia_currentstream['format_data']['codec_fourcc']);
+
+                                               $thisfile_video['streams'][$streamnumber]['fourcc']          = $thisfile_asf_videomedia_currentstream['format_data']['codec_fourcc'];
+                                               $thisfile_video['streams'][$streamnumber]['codec']           = $thisfile_asf_videomedia_currentstream['format_data']['codec'];
+                                               $thisfile_video['streams'][$streamnumber]['resolution_x']    = $thisfile_asf_videomedia_currentstream['image_width'];
+                                               $thisfile_video['streams'][$streamnumber]['resolution_y']    = $thisfile_asf_videomedia_currentstream['image_height'];
+                                               $thisfile_video['streams'][$streamnumber]['bits_per_sample'] = $thisfile_asf_videomedia_currentstream['format_data']['bits_per_pixel'];
+                                               break;
+
+                                       default:
+                                               break;
+                               }
+                       }
+               }
+
+               while (ftell($this->getid3->fp) < $info['avdataend']) {
+                       $NextObjectDataHeader = fread($this->getid3->fp, 24);
+                       $offset = 0;
+                       $NextObjectGUID = substr($NextObjectDataHeader, 0, 16);
+                       $offset += 16;
+                       $NextObjectGUIDtext = $this->BytestringToGUID($NextObjectGUID);
+                       $NextObjectSize = getid3_lib::LittleEndian2Int(substr($NextObjectDataHeader, $offset, 8));
+                       $offset += 8;
+
+                       switch ($NextObjectGUID) {
+                               case GETID3_ASF_Data_Object:
+                                       // Data Object: (mandatory, one only)
+                                       // Field Name                       Field Type   Size (bits)
+                                       // Object ID                        GUID         128             // GUID for Data object - GETID3_ASF_Data_Object
+                                       // Object Size                      QWORD        64              // size of Data object, including 50 bytes of Data Object header. may be 0 if FilePropertiesObject.BroadcastFlag == 1
+                                       // File ID                          GUID         128             // unique identifier. identical to File ID field in Header Object
+                                       // Total Data Packets               QWORD        64              // number of Data Packet entries in Data Object. invalid if FilePropertiesObject.BroadcastFlag == 1
+                                       // Reserved                         WORD         16              // hardcoded: 0x0101
+
+                                       // shortcut
+                                       $thisfile_asf['data_object'] = array();
+                                       $thisfile_asf_dataobject     = &$thisfile_asf['data_object'];
+
+                                       $DataObjectData = $NextObjectDataHeader.fread($this->getid3->fp, 50 - 24);
+                                       $offset = 24;
+
+                                       $thisfile_asf_dataobject['objectid']           = $NextObjectGUID;
+                                       $thisfile_asf_dataobject['objectid_guid']      = $NextObjectGUIDtext;
+                                       $thisfile_asf_dataobject['objectsize']         = $NextObjectSize;
+
+                                       $thisfile_asf_dataobject['fileid']             = substr($DataObjectData, $offset, 16);
+                                       $offset += 16;
+                                       $thisfile_asf_dataobject['fileid_guid']        = $this->BytestringToGUID($thisfile_asf_dataobject['fileid']);
+                                       $thisfile_asf_dataobject['total_data_packets'] = getid3_lib::LittleEndian2Int(substr($DataObjectData, $offset, 8));
+                                       $offset += 8;
+                                       $thisfile_asf_dataobject['reserved']           = getid3_lib::LittleEndian2Int(substr($DataObjectData, $offset, 2));
+                                       $offset += 2;
+                                       if ($thisfile_asf_dataobject['reserved'] != 0x0101) {
+                                               $info['warning'][] = 'data_object.reserved ('.getid3_lib::PrintHexBytes($thisfile_asf_dataobject['reserved']).') does not match expected value of "0x0101"';
+                                               //return false;
+                                               break;
+                                       }
+
+                                       // Data Packets                     array of:    variable        //
+                                       // * Error Correction Flags         BYTE         8               //
+                                       // * * Error Correction Data Length bits         4               // if Error Correction Length Type == 00, size of Error Correction Data in bytes, else hardcoded: 0000
+                                       // * * Opaque Data Present          bits         1               //
+                                       // * * Error Correction Length Type bits         2               // number of bits for size of the error correction data. hardcoded: 00
+                                       // * * Error Correction Present     bits         1               // If set, use Opaque Data Packet structure, else use Payload structure
+                                       // * Error Correction Data
+
+                                       $info['avdataoffset'] = ftell($this->getid3->fp);
+                                       fseek($this->getid3->fp, ($thisfile_asf_dataobject['objectsize'] - 50), SEEK_CUR); // skip actual audio/video data
+                                       $info['avdataend'] = ftell($this->getid3->fp);
+                                       break;
+
+                               case GETID3_ASF_Simple_Index_Object:
+                                       // Simple Index Object: (optional, recommended, one per video stream)
+                                       // Field Name                       Field Type   Size (bits)
+                                       // Object ID                        GUID         128             // GUID for Simple Index object - GETID3_ASF_Data_Object
+                                       // Object Size                      QWORD        64              // size of Simple Index object, including 56 bytes of Simple Index Object header
+                                       // File ID                          GUID         128             // unique identifier. may be zero or identical to File ID field in Data Object and Header Object
+                                       // Index Entry Time Interval        QWORD        64              // interval between index entries in 100-nanosecond units
+                                       // Maximum Packet Count             DWORD        32              // maximum packet count for all index entries
+                                       // Index Entries Count              DWORD        32              // number of Index Entries structures
+                                       // Index Entries                    array of:    variable        //
+                                       // * Packet Number                  DWORD        32              // number of the Data Packet associated with this index entry
+                                       // * Packet Count                   WORD         16              // number of Data Packets to sent at this index entry
+
+                                       // shortcut
+                                       $thisfile_asf['simple_index_object'] = array();
+                                       $thisfile_asf_simpleindexobject      = &$thisfile_asf['simple_index_object'];
+
+                                       $SimpleIndexObjectData = $NextObjectDataHeader.fread($this->getid3->fp, 56 - 24);
+                                       $offset = 24;
+
+                                       $thisfile_asf_simpleindexobject['objectid']                  = $NextObjectGUID;
+                                       $thisfile_asf_simpleindexobject['objectid_guid']             = $NextObjectGUIDtext;
+                                       $thisfile_asf_simpleindexobject['objectsize']                = $NextObjectSize;
+
+                                       $thisfile_asf_simpleindexobject['fileid']                    =                  substr($SimpleIndexObjectData, $offset, 16);
+                                       $offset += 16;
+                                       $thisfile_asf_simpleindexobject['fileid_guid']               = $this->BytestringToGUID($thisfile_asf_simpleindexobject['fileid']);
+                                       $thisfile_asf_simpleindexobject['index_entry_time_interval'] = getid3_lib::LittleEndian2Int(substr($SimpleIndexObjectData, $offset, 8));
+                                       $offset += 8;
+                                       $thisfile_asf_simpleindexobject['maximum_packet_count']      = getid3_lib::LittleEndian2Int(substr($SimpleIndexObjectData, $offset, 4));
+                                       $offset += 4;
+                                       $thisfile_asf_simpleindexobject['index_entries_count']       = getid3_lib::LittleEndian2Int(substr($SimpleIndexObjectData, $offset, 4));
+                                       $offset += 4;
+
+                                       $IndexEntriesData = $SimpleIndexObjectData.fread($this->getid3->fp, 6 * $thisfile_asf_simpleindexobject['index_entries_count']);
+                                       for ($IndexEntriesCounter = 0; $IndexEntriesCounter < $thisfile_asf_simpleindexobject['index_entries_count']; $IndexEntriesCounter++) {
+                                               $thisfile_asf_simpleindexobject['index_entries'][$IndexEntriesCounter]['packet_number'] = getid3_lib::LittleEndian2Int(substr($IndexEntriesData, $offset, 4));
+                                               $offset += 4;
+                                               $thisfile_asf_simpleindexobject['index_entries'][$IndexEntriesCounter]['packet_count']  = getid3_lib::LittleEndian2Int(substr($IndexEntriesData, $offset, 4));
+                                               $offset += 2;
+                                       }
+
+                                       break;
+
+                               case GETID3_ASF_Index_Object:
+                                       // 6.2 ASF top-level Index Object (optional but recommended when appropriate, 0 or 1)
+                                       // Field Name                       Field Type   Size (bits)
+                                       // Object ID                        GUID         128             // GUID for the Index Object - GETID3_ASF_Index_Object
+                                       // Object Size                      QWORD        64              // Specifies the size, in bytes, of the Index Object, including at least 34 bytes of Index Object header
+                                       // Index Entry Time Interval        DWORD        32              // Specifies the time interval between each index entry in ms.
+                                       // Index Specifiers Count           WORD         16              // Specifies the number of Index Specifiers structures in this Index Object.
+                                       // Index Blocks Count               DWORD        32              // Specifies the number of Index Blocks structures in this Index Object.
+
+                                       // Index Entry Time Interval        DWORD        32              // Specifies the time interval between index entries in milliseconds.  This value cannot be 0.
+                                       // Index Specifiers Count           WORD         16              // Specifies the number of entries in the Index Specifiers list.  Valid values are 1 and greater.
+                                       // Index Specifiers                 array of:    varies          //
+                                       // * Stream Number                  WORD         16              // Specifies the stream number that the Index Specifiers refer to. Valid values are between 1 and 127.
+                                       // * Index Type                     WORD         16              // Specifies Index Type values as follows:
+                                                                                                                                                                       //   1 = Nearest Past Data Packet - indexes point to the data packet whose presentation time is closest to the index entry time.
+                                                                                                                                                                       //   2 = Nearest Past Media Object - indexes point to the closest data packet containing an entire object or first fragment of an object.
+                                                                                                                                                                       //   3 = Nearest Past Cleanpoint. - indexes point to the closest data packet containing an entire object (or first fragment of an object) that has the Cleanpoint Flag set.
+                                                                                                                                                                       //   Nearest Past Cleanpoint is the most common type of index.
+                                       // Index Entry Count                DWORD        32              // Specifies the number of Index Entries in the block.
+                                       // * Block Positions                QWORD        varies          // Specifies a list of byte offsets of the beginnings of the blocks relative to the beginning of the first Data Packet (i.e., the beginning of the Data Object + 50 bytes). The number of entries in this list is specified by the value of the Index Specifiers Count field. The order of those byte offsets is tied to the order in which Index Specifiers are listed.
+                                       // * Index Entries                  array of:    varies          //
+                                       // * * Offsets                      DWORD        varies          // An offset value of 0xffffffff indicates an invalid offset value
+
+                                       // shortcut
+                                       $thisfile_asf['asf_index_object'] = array();
+                                       $thisfile_asf_asfindexobject      = &$thisfile_asf['asf_index_object'];
+
+                                       $ASFIndexObjectData = $NextObjectDataHeader.fread($this->getid3->fp, 34 - 24);
+                                       $offset = 24;
+
+                                       $thisfile_asf_asfindexobject['objectid']                  = $NextObjectGUID;
+                                       $thisfile_asf_asfindexobject['objectid_guid']             = $NextObjectGUIDtext;
+                                       $thisfile_asf_asfindexobject['objectsize']                = $NextObjectSize;
+
+                                       $thisfile_asf_asfindexobject['entry_time_interval']       = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4));
+                                       $offset += 4;
+                                       $thisfile_asf_asfindexobject['index_specifiers_count']    = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 2));
+                                       $offset += 2;
+                                       $thisfile_asf_asfindexobject['index_blocks_count']        = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4));
+                                       $offset += 4;
+
+                                       $ASFIndexObjectData .= fread($this->getid3->fp, 4 * $thisfile_asf_asfindexobject['index_specifiers_count']);
+                                       for ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) {
+                                               $IndexSpecifierStreamNumber = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 2));
+                                               $offset += 2;
+                                               $thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter]['stream_number']   = $IndexSpecifierStreamNumber;
+                                               $thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter]['index_type']      = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 2));
+                                               $offset += 2;
+                                               $thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter]['index_type_text'] = $this->ASFIndexObjectIndexTypeLookup($thisfile_asf_asfindexobject['index_specifiers'][$IndexSpecifiersCounter]['index_type']);
+                                       }
+
+                                       $ASFIndexObjectData .= fread($this->getid3->fp, 4);
+                                       $thisfile_asf_asfindexobject['index_entry_count'] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4));
+                                       $offset += 4;
+
+                                       $ASFIndexObjectData .= fread($this->getid3->fp, 8 * $thisfile_asf_asfindexobject['index_specifiers_count']);
+                                       for ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) {
+                                               $thisfile_asf_asfindexobject['block_positions'][$IndexSpecifiersCounter] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 8));
+                                               $offset += 8;
+                                       }
+
+                                       $ASFIndexObjectData .= fread($this->getid3->fp, 4 * $thisfile_asf_asfindexobject['index_specifiers_count'] * $thisfile_asf_asfindexobject['index_entry_count']);
+                                       for ($IndexEntryCounter = 0; $IndexEntryCounter < $thisfile_asf_asfindexobject['index_entry_count']; $IndexEntryCounter++) {
+                                               for ($IndexSpecifiersCounter = 0; $IndexSpecifiersCounter < $thisfile_asf_asfindexobject['index_specifiers_count']; $IndexSpecifiersCounter++) {
+                                                       $thisfile_asf_asfindexobject['offsets'][$IndexSpecifiersCounter][$IndexEntryCounter] = getid3_lib::LittleEndian2Int(substr($ASFIndexObjectData, $offset, 4));
+                                                       $offset += 4;
+                                               }
+                                       }
+                                       break;
+
+
+                               default:
+                                       // Implementations shall ignore any standard or non-standard object that they do not know how to handle.
+                                       if ($this->GUIDname($NextObjectGUIDtext)) {
+                                               $info['warning'][] = 'unhandled GUID "'.$this->GUIDname($NextObjectGUIDtext).'" {'.$NextObjectGUIDtext.'} in ASF body at offset '.($offset - 16 - 8);
+                                       } else {
+                                               $info['warning'][] = 'unknown GUID {'.$NextObjectGUIDtext.'} in ASF body at offset '.(ftell($this->getid3->fp) - 16 - 8);
+                                       }
+                                       fseek($this->getid3->fp, ($NextObjectSize - 16 - 8), SEEK_CUR);
+                                       break;
+                       }
+               }
+
+               if (isset($thisfile_asf_codeclistobject['codec_entries']) && is_array($thisfile_asf_codeclistobject['codec_entries'])) {
+                       foreach ($thisfile_asf_codeclistobject['codec_entries'] as $streamnumber => $streamdata) {
+                               switch ($streamdata['information']) {
+                                       case 'WMV1':
+                                       case 'WMV2':
+                                       case 'WMV3':
+                                       case 'MSS1':
+                                       case 'MSS2':
+                                       case 'WMVA':
+                                       case 'WVC1':
+                                       case 'WMVP':
+                                       case 'WVP2':
+                                               $thisfile_video['dataformat'] = 'wmv';
+                                               $info['mime_type'] = 'video/x-ms-wmv';
+                                               break;
+
+                                       case 'MP42':
+                                       case 'MP43':
+                                       case 'MP4S':
+                                       case 'mp4s':
+                                               $thisfile_video['dataformat'] = 'asf';
+                                               $info['mime_type'] = 'video/x-ms-asf';
+                                               break;
+
+                                       default:
+                                               switch ($streamdata['type_raw']) {
+                                                       case 1:
+                                                               if (strstr($this->TrimConvert($streamdata['name']), 'Windows Media')) {
+                                                                       $thisfile_video['dataformat'] = 'wmv';
+                                                                       if ($info['mime_type'] == 'video/x-ms-asf') {
+                                                                               $info['mime_type'] = 'video/x-ms-wmv';
+                                                                       }
+                                                               }
+                                                               break;
+
+                                                       case 2:
+                                                               if (strstr($this->TrimConvert($streamdata['name']), 'Windows Media')) {
+                                                                       $thisfile_audio['dataformat'] = 'wma';
+                                                                       if ($info['mime_type'] == 'video/x-ms-asf') {
+                                                                               $info['mime_type'] = 'audio/x-ms-wma';
+                                                                       }
+                                                               }
+                                                               break;
+
+                                               }
+                                               break;
+                               }
+                       }
+               }
+
+               switch (isset($thisfile_audio['codec']) ? $thisfile_audio['codec'] : '') {
+                       case 'MPEG Layer-3':
+                               $thisfile_audio['dataformat'] = 'mp3';
+                               break;
+
+                       default:
+                               break;
+               }
+
+               if (isset($thisfile_asf_codeclistobject['codec_entries'])) {
+                       foreach ($thisfile_asf_codeclistobject['codec_entries'] as $streamnumber => $streamdata) {
+                               switch ($streamdata['type_raw']) {
+
+                                       case 1: // video
+                                               $thisfile_video['encoder'] = $this->TrimConvert($thisfile_asf_codeclistobject['codec_entries'][$streamnumber]['name']);
+                                               break;
+
+                                       case 2: // audio
+                                               $thisfile_audio['encoder'] = $this->TrimConvert($thisfile_asf_codeclistobject['codec_entries'][$streamnumber]['name']);
+
+                                               // AH 2003-10-01
+                                               $thisfile_audio['encoder_options'] = $this->TrimConvert($thisfile_asf_codeclistobject['codec_entries'][0]['description']);
+
+                                               $thisfile_audio['codec']   = $thisfile_audio['encoder'];
+                                               break;
+
+                                       default:
+                                               $info['warning'][] = 'Unknown streamtype: [codec_list_object][codec_entries]['.$streamnumber.'][type_raw] == '.$streamdata['type_raw'];
+                                               break;
+
+                               }
+                       }
+               }
+
+               if (isset($info['audio'])) {
+                       $thisfile_audio['lossless']           = (isset($thisfile_audio['lossless'])           ? $thisfile_audio['lossless']           : false);
+                       $thisfile_audio['dataformat']         = (!empty($thisfile_audio['dataformat'])        ? $thisfile_audio['dataformat']         : 'asf');
+               }
+               if (!empty($thisfile_video['dataformat'])) {
+                       $thisfile_video['lossless']           = (isset($thisfile_audio['lossless'])           ? $thisfile_audio['lossless']           : false);
+                       $thisfile_video['pixel_aspect_ratio'] = (isset($thisfile_audio['pixel_aspect_ratio']) ? $thisfile_audio['pixel_aspect_ratio'] : (float) 1);
+                       $thisfile_video['dataformat']         = (!empty($thisfile_video['dataformat'])        ? $thisfile_video['dataformat']         : 'asf');
+               }
+               if (!empty($thisfile_video['streams'])) {
+                       $thisfile_video['streams']['resolution_x'] = 0;
+                       $thisfile_video['streams']['resolution_y'] = 0;
+                       foreach ($thisfile_video['streams'] as $key => $valuearray) {
+                               if (($valuearray['resolution_x'] > $thisfile_video['streams']['resolution_x']) || ($valuearray['resolution_y'] > $thisfile_video['streams']['resolution_y'])) {
+                                       $thisfile_video['resolution_x'] = $valuearray['resolution_x'];
+                                       $thisfile_video['resolution_y'] = $valuearray['resolution_y'];
+                               }
+                       }
+               }
+               $info['bitrate'] = (isset($thisfile_audio['bitrate']) ? $thisfile_audio['bitrate'] : 0) + (isset($thisfile_video['bitrate']) ? $thisfile_video['bitrate'] : 0);
+
+               if ((!isset($info['playtime_seconds']) || ($info['playtime_seconds'] <= 0)) && ($info['bitrate'] > 0)) {
+                       $info['playtime_seconds'] = ($info['filesize'] - $info['avdataoffset']) / ($info['bitrate'] / 8);
+               }
+
+               return true;
+       }
+
+       public static function ASFCodecListObjectTypeLookup($CodecListType) {
+               static $ASFCodecListObjectTypeLookup = array();
+               if (empty($ASFCodecListObjectTypeLookup)) {
+                       $ASFCodecListObjectTypeLookup[0x0001] = 'Video Codec';
+                       $ASFCodecListObjectTypeLookup[0x0002] = 'Audio Codec';
+                       $ASFCodecListObjectTypeLookup[0xFFFF] = 'Unknown Codec';
+               }
+
+               return (isset($ASFCodecListObjectTypeLookup[$CodecListType]) ? $ASFCodecListObjectTypeLookup[$CodecListType] : 'Invalid Codec Type');
+       }
+
+       public static function KnownGUIDs() {
+               static $GUIDarray = array(
+                       'GETID3_ASF_Extended_Stream_Properties_Object'   => '14E6A5CB-C672-4332-8399-A96952065B5A',
+                       'GETID3_ASF_Padding_Object'                      => '1806D474-CADF-4509-A4BA-9AABCB96AAE8',
+                       'GETID3_ASF_Payload_Ext_Syst_Pixel_Aspect_Ratio' => '1B1EE554-F9EA-4BC8-821A-376B74E4C4B8',
+                       'GETID3_ASF_Script_Command_Object'               => '1EFB1A30-0B62-11D0-A39B-00A0C90348F6',
+                       'GETID3_ASF_No_Error_Correction'                 => '20FB5700-5B55-11CF-A8FD-00805F5C442B',
+                       'GETID3_ASF_Content_Branding_Object'             => '2211B3FA-BD23-11D2-B4B7-00A0C955FC6E',
+                       'GETID3_ASF_Content_Encryption_Object'           => '2211B3FB-BD23-11D2-B4B7-00A0C955FC6E',
+                       'GETID3_ASF_Digital_Signature_Object'            => '2211B3FC-BD23-11D2-B4B7-00A0C955FC6E',
+                       'GETID3_ASF_Extended_Content_Encryption_Object'  => '298AE614-2622-4C17-B935-DAE07EE9289C',
+                       'GETID3_ASF_Simple_Index_Object'                 => '33000890-E5B1-11CF-89F4-00A0C90349CB',
+                       'GETID3_ASF_Degradable_JPEG_Media'               => '35907DE0-E415-11CF-A917-00805F5C442B',
+                       'GETID3_ASF_Payload_Extension_System_Timecode'   => '399595EC-8667-4E2D-8FDB-98814CE76C1E',
+                       'GETID3_ASF_Binary_Media'                        => '3AFB65E2-47EF-40F2-AC2C-70A90D71D343',
+                       'GETID3_ASF_Timecode_Index_Object'               => '3CB73FD0-0C4A-4803-953D-EDF7B6228F0C',
+                       'GETID3_ASF_Metadata_Library_Object'             => '44231C94-9498-49D1-A141-1D134E457054',
+                       'GETID3_ASF_Reserved_3'                          => '4B1ACBE3-100B-11D0-A39B-00A0C90348F6',
+                       'GETID3_ASF_Reserved_4'                          => '4CFEDB20-75F6-11CF-9C0F-00A0C90349CB',
+                       'GETID3_ASF_Command_Media'                       => '59DACFC0-59E6-11D0-A3AC-00A0C90348F6',
+                       'GETID3_ASF_Header_Extension_Object'             => '5FBF03B5-A92E-11CF-8EE3-00C00C205365',
+                       'GETID3_ASF_Media_Object_Index_Parameters_Obj'   => '6B203BAD-3F11-4E84-ACA8-D7613DE2CFA7',
+                       'GETID3_ASF_Header_Object'                       => '75B22630-668E-11CF-A6D9-00AA0062CE6C',
+                       'GETID3_ASF_Content_Description_Object'          => '75B22633-668E-11CF-A6D9-00AA0062CE6C',
+                       'GETID3_ASF_Error_Correction_Object'             => '75B22635-668E-11CF-A6D9-00AA0062CE6C',
+                       'GETID3_ASF_Data_Object'                         => '75B22636-668E-11CF-A6D9-00AA0062CE6C',
+                       'GETID3_ASF_Web_Stream_Media_Subtype'            => '776257D4-C627-41CB-8F81-7AC7FF1C40CC',
+                       'GETID3_ASF_Stream_Bitrate_Properties_Object'    => '7BF875CE-468D-11D1-8D82-006097C9A2B2',
+                       'GETID3_ASF_Language_List_Object'                => '7C4346A9-EFE0-4BFC-B229-393EDE415C85',
+                       'GETID3_ASF_Codec_List_Object'                   => '86D15240-311D-11D0-A3A4-00A0C90348F6',
+                       'GETID3_ASF_Reserved_2'                          => '86D15241-311D-11D0-A3A4-00A0C90348F6',
+                       'GETID3_ASF_File_Properties_Object'              => '8CABDCA1-A947-11CF-8EE4-00C00C205365',
+                       'GETID3_ASF_File_Transfer_Media'                 => '91BD222C-F21C-497A-8B6D-5AA86BFC0185',
+                       'GETID3_ASF_Old_RTP_Extension_Data'              => '96800C63-4C94-11D1-837B-0080C7A37F95',
+                       'GETID3_ASF_Advanced_Mutual_Exclusion_Object'    => 'A08649CF-4775-4670-8A16-6E35357566CD',
+                       'GETID3_ASF_Bandwidth_Sharing_Object'            => 'A69609E6-517B-11D2-B6AF-00C04FD908E9',
+                       'GETID3_ASF_Reserved_1'                          => 'ABD3D211-A9BA-11cf-8EE6-00C00C205365',
+                       'GETID3_ASF_Bandwidth_Sharing_Exclusive'         => 'AF6060AA-5197-11D2-B6AF-00C04FD908E9',
+                       'GETID3_ASF_Bandwidth_Sharing_Partial'           => 'AF6060AB-5197-11D2-B6AF-00C04FD908E9',
+                       'GETID3_ASF_JFIF_Media'                          => 'B61BE100-5B4E-11CF-A8FD-00805F5C442B',
+                       'GETID3_ASF_Stream_Properties_Object'            => 'B7DC0791-A9B7-11CF-8EE6-00C00C205365',
+                       'GETID3_ASF_Video_Media'                         => 'BC19EFC0-5B4D-11CF-A8FD-00805F5C442B',
+                       'GETID3_ASF_Audio_Spread'                        => 'BFC3CD50-618F-11CF-8BB2-00AA00B4E220',
+                       'GETID3_ASF_Metadata_Object'                     => 'C5F8CBEA-5BAF-4877-8467-AA8C44FA4CCA',
+                       'GETID3_ASF_Payload_Ext_Syst_Sample_Duration'    => 'C6BD9450-867F-4907-83A3-C77921B733AD',
+                       'GETID3_ASF_Group_Mutual_Exclusion_Object'       => 'D1465A40-5A79-4338-B71B-E36B8FD6C249',
+                       'GETID3_ASF_Extended_Content_Description_Object' => 'D2D0A440-E307-11D2-97F0-00A0C95EA850',
+                       'GETID3_ASF_Stream_Prioritization_Object'        => 'D4FED15B-88D3-454F-81F0-ED5C45999E24',
+                       'GETID3_ASF_Payload_Ext_System_Content_Type'     => 'D590DC20-07BC-436C-9CF7-F3BBFBF1A4DC',
+                       'GETID3_ASF_Old_File_Properties_Object'          => 'D6E229D0-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_ASF_Header_Object'               => 'D6E229D1-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_ASF_Data_Object'                 => 'D6E229D2-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Index_Object'                        => 'D6E229D3-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Stream_Properties_Object'        => 'D6E229D4-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Content_Description_Object'      => 'D6E229D5-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Script_Command_Object'           => 'D6E229D6-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Marker_Object'                   => 'D6E229D7-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Component_Download_Object'       => 'D6E229D8-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Stream_Group_Object'             => 'D6E229D9-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Scalable_Object'                 => 'D6E229DA-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Prioritization_Object'           => 'D6E229DB-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Bitrate_Mutual_Exclusion_Object'     => 'D6E229DC-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Inter_Media_Dependency_Object'   => 'D6E229DD-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Rating_Object'                   => 'D6E229DE-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Index_Parameters_Object'             => 'D6E229DF-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Color_Table_Object'              => 'D6E229E0-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Language_List_Object'            => 'D6E229E1-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Audio_Media'                     => 'D6E229E2-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Video_Media'                     => 'D6E229E3-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Image_Media'                     => 'D6E229E4-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Timecode_Media'                  => 'D6E229E5-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Text_Media'                      => 'D6E229E6-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_MIDI_Media'                      => 'D6E229E7-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Command_Media'                   => 'D6E229E8-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_No_Error_Concealment'            => 'D6E229EA-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Scrambled_Audio'                 => 'D6E229EB-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_No_Color_Table'                  => 'D6E229EC-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_SMPTE_Time'                      => 'D6E229ED-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_ASCII_Text'                      => 'D6E229EE-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Unicode_Text'                    => 'D6E229EF-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_HTML_Text'                       => 'D6E229F0-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_URL_Command'                     => 'D6E229F1-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Filename_Command'                => 'D6E229F2-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_ACM_Codec'                       => 'D6E229F3-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_VCM_Codec'                       => 'D6E229F4-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_QuickTime_Codec'                 => 'D6E229F5-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_DirectShow_Transform_Filter'     => 'D6E229F6-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_DirectShow_Rendering_Filter'     => 'D6E229F7-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_No_Enhancement'                  => 'D6E229F8-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Unknown_Enhancement_Type'        => 'D6E229F9-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Temporal_Enhancement'            => 'D6E229FA-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Spatial_Enhancement'             => 'D6E229FB-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Quality_Enhancement'             => 'D6E229FC-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Number_of_Channels_Enhancement'  => 'D6E229FD-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Frequency_Response_Enhancement'  => 'D6E229FE-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Media_Object'                    => 'D6E229FF-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Mutex_Language'                      => 'D6E22A00-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Mutex_Bitrate'                       => 'D6E22A01-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Mutex_Unknown'                       => 'D6E22A02-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_ASF_Placeholder_Object'          => 'D6E22A0E-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Old_Data_Unit_Extension_Object'      => 'D6E22A0F-35DA-11D1-9034-00A0C90349BE',
+                       'GETID3_ASF_Web_Stream_Format'                   => 'DA1E6B13-8359-4050-B398-388E965BF00C',
+                       'GETID3_ASF_Payload_Ext_System_File_Name'        => 'E165EC0E-19ED-45D7-B4A7-25CBD1E28E9B',
+                       'GETID3_ASF_Marker_Object'                       => 'F487CD01-A951-11CF-8EE6-00C00C205365',
+                       'GETID3_ASF_Timecode_Index_Parameters_Object'    => 'F55E496D-9797-4B5D-8C8B-604DFE9BFB24',
+                       'GETID3_ASF_Audio_Media'                         => 'F8699E40-5B4D-11CF-A8FD-00805F5C442B',
+                       'GETID3_ASF_Media_Object_Index_Object'           => 'FEB103F8-12AD-4C64-840F-2A1D2F7AD48C',
+                       'GETID3_ASF_Alt_Extended_Content_Encryption_Obj' => 'FF889EF1-ADEE-40DA-9E71-98704BB928CE',
+                       'GETID3_ASF_Index_Placeholder_Object'            => 'D9AADE20-7C17-4F9C-BC28-8555DD98E2A2', // http://cpan.uwinnipeg.ca/htdocs/Audio-WMA/Audio/WMA.pm.html
+                       'GETID3_ASF_Compatibility_Object'                => '26F18B5D-4584-47EC-9F5F-0E651F0452C9', // http://cpan.uwinnipeg.ca/htdocs/Audio-WMA/Audio/WMA.pm.html
+               );
+               return $GUIDarray;
+       }
+
+       public static function GUIDname($GUIDstring) {
+               static $GUIDarray = array();
+               if (empty($GUIDarray)) {
+                       $GUIDarray = self::KnownGUIDs();
+               }
+               return array_search($GUIDstring, $GUIDarray);
+       }
+
+       public static function ASFIndexObjectIndexTypeLookup($id) {
+               static $ASFIndexObjectIndexTypeLookup = array();
+               if (empty($ASFIndexObjectIndexTypeLookup)) {
+                       $ASFIndexObjectIndexTypeLookup[1] = 'Nearest Past Data Packet';
+                       $ASFIndexObjectIndexTypeLookup[2] = 'Nearest Past Media Object';
+                       $ASFIndexObjectIndexTypeLookup[3] = 'Nearest Past Cleanpoint';
+               }
+               return (isset($ASFIndexObjectIndexTypeLookup[$id]) ? $ASFIndexObjectIndexTypeLookup[$id] : 'invalid');
+       }
+
+       public static function GUIDtoBytestring($GUIDstring) {
+               // Microsoft defines these 16-byte (128-bit) GUIDs in the strangest way:
+               // first 4 bytes are in little-endian order
+               // next 2 bytes are appended in little-endian order
+               // next 2 bytes are appended in little-endian order
+               // next 2 bytes are appended in big-endian order
+               // next 6 bytes are appended in big-endian order
+
+               // AaBbCcDd-EeFf-GgHh-IiJj-KkLlMmNnOoPp is stored as this 16-byte string:
+               // $Dd $Cc $Bb $Aa $Ff $Ee $Hh $Gg $Ii $Jj $Kk $Ll $Mm $Nn $Oo $Pp
+
+               $hexbytecharstring  = chr(hexdec(substr($GUIDstring,  6, 2)));
+               $hexbytecharstring .= chr(hexdec(substr($GUIDstring,  4, 2)));
+               $hexbytecharstring .= chr(hexdec(substr($GUIDstring,  2, 2)));
+               $hexbytecharstring .= chr(hexdec(substr($GUIDstring,  0, 2)));
+
+               $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 11, 2)));
+               $hexbytecharstring .= chr(hexdec(substr($GUIDstring,  9, 2)));
+
+               $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 16, 2)));
+               $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 14, 2)));
+
+               $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 19, 2)));
+               $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 21, 2)));
+
+               $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 24, 2)));
+               $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 26, 2)));
+               $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 28, 2)));
+               $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 30, 2)));
+               $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 32, 2)));
+               $hexbytecharstring .= chr(hexdec(substr($GUIDstring, 34, 2)));
+
+               return $hexbytecharstring;
+       }
+
+       public static function BytestringToGUID($Bytestring) {
+               $GUIDstring  = str_pad(dechex(ord($Bytestring{3})),  2, '0', STR_PAD_LEFT);
+               $GUIDstring .= str_pad(dechex(ord($Bytestring{2})),  2, '0', STR_PAD_LEFT);
+               $GUIDstring .= str_pad(dechex(ord($Bytestring{1})),  2, '0', STR_PAD_LEFT);
+               $GUIDstring .= str_pad(dechex(ord($Bytestring{0})),  2, '0', STR_PAD_LEFT);
+               $GUIDstring .= '-';
+               $GUIDstring .= str_pad(dechex(ord($Bytestring{5})),  2, '0', STR_PAD_LEFT);
+               $GUIDstring .= str_pad(dechex(ord($Bytestring{4})),  2, '0', STR_PAD_LEFT);
+               $GUIDstring .= '-';
+               $GUIDstring .= str_pad(dechex(ord($Bytestring{7})),  2, '0', STR_PAD_LEFT);
+               $GUIDstring .= str_pad(dechex(ord($Bytestring{6})),  2, '0', STR_PAD_LEFT);
+               $GUIDstring .= '-';
+               $GUIDstring .= str_pad(dechex(ord($Bytestring{8})),  2, '0', STR_PAD_LEFT);
+               $GUIDstring .= str_pad(dechex(ord($Bytestring{9})),  2, '0', STR_PAD_LEFT);
+               $GUIDstring .= '-';
+               $GUIDstring .= str_pad(dechex(ord($Bytestring{10})), 2, '0', STR_PAD_LEFT);
+               $GUIDstring .= str_pad(dechex(ord($Bytestring{11})), 2, '0', STR_PAD_LEFT);
+               $GUIDstring .= str_pad(dechex(ord($Bytestring{12})), 2, '0', STR_PAD_LEFT);
+               $GUIDstring .= str_pad(dechex(ord($Bytestring{13})), 2, '0', STR_PAD_LEFT);
+               $GUIDstring .= str_pad(dechex(ord($Bytestring{14})), 2, '0', STR_PAD_LEFT);
+               $GUIDstring .= str_pad(dechex(ord($Bytestring{15})), 2, '0', STR_PAD_LEFT);
+
+               return strtoupper($GUIDstring);
+       }
+
+       public static function FILETIMEtoUNIXtime($FILETIME, $round=true) {
+               // FILETIME is a 64-bit unsigned integer representing
+               // the number of 100-nanosecond intervals since January 1, 1601
+               // UNIX timestamp is number of seconds since January 1, 1970
+               // 116444736000000000 = 10000000 * 60 * 60 * 24 * 365 * 369 + 89 leap days
+               if ($round) {
+                       return intval(round(($FILETIME - 116444736000000000) / 10000000));
+               }
+               return ($FILETIME - 116444736000000000) / 10000000;
+       }
+
+       public static function WMpictureTypeLookup($WMpictureType) {
+               static $WMpictureTypeLookup = array();
+               if (empty($WMpictureTypeLookup)) {
+                       $WMpictureTypeLookup[0x03] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Front Cover');
+                       $WMpictureTypeLookup[0x04] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Back Cover');
+                       $WMpictureTypeLookup[0x00] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'User Defined');
+                       $WMpictureTypeLookup[0x05] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Leaflet Page');
+                       $WMpictureTypeLookup[0x06] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Media Label');
+                       $WMpictureTypeLookup[0x07] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Lead Artist');
+                       $WMpictureTypeLookup[0x08] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Artist');
+                       $WMpictureTypeLookup[0x09] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Conductor');
+                       $WMpictureTypeLookup[0x0A] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Band');
+                       $WMpictureTypeLookup[0x0B] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Composer');
+                       $WMpictureTypeLookup[0x0C] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Lyricist');
+                       $WMpictureTypeLookup[0x0D] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Recording Location');
+                       $WMpictureTypeLookup[0x0E] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'During Recording');
+                       $WMpictureTypeLookup[0x0F] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'During Performance');
+                       $WMpictureTypeLookup[0x10] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Video Screen Capture');
+                       $WMpictureTypeLookup[0x12] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Illustration');
+                       $WMpictureTypeLookup[0x13] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Band Logotype');
+                       $WMpictureTypeLookup[0x14] = getid3_lib::iconv_fallback('ISO-8859-1', 'UTF-16LE', 'Publisher Logotype');
+               }
+               return (isset($WMpictureTypeLookup[$WMpictureType]) ? $WMpictureTypeLookup[$WMpictureType] : '');
+       }
+
+       public function ASF_HeaderExtensionObjectDataParse(&$asf_header_extension_object_data, &$unhandled_sections) {
+               // http://msdn.microsoft.com/en-us/library/bb643323.aspx
+
+               $offset = 0;
+               $objectOffset = 0;
+               $HeaderExtensionObjectParsed = array();
+               while ($objectOffset < strlen($asf_header_extension_object_data)) {
+                       $offset = $objectOffset;
+                       $thisObject = array();
+
+                       $thisObject['guid']                              =                              substr($asf_header_extension_object_data, $offset, 16);
+                       $offset += 16;
+                       $thisObject['guid_text'] = $this->BytestringToGUID($thisObject['guid']);
+                       $thisObject['guid_name'] = $this->GUIDname($thisObject['guid_text']);
+
+                       $thisObject['size']                              = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  8));
+                       $offset += 8;
+                       if ($thisObject['size'] <= 0) {
+                               break;
+                       }
+
+                       switch ($thisObject['guid']) {
+                               case GETID3_ASF_Extended_Stream_Properties_Object:
+                                       $thisObject['start_time']                        = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  8));
+                                       $offset += 8;
+                                       $thisObject['start_time_unix']                   = $this->FILETIMEtoUNIXtime($thisObject['start_time']);
+
+                                       $thisObject['end_time']                          = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  8));
+                                       $offset += 8;
+                                       $thisObject['end_time_unix']                     = $this->FILETIMEtoUNIXtime($thisObject['end_time']);
+
+                                       $thisObject['data_bitrate']                      = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
+                                       $offset += 4;
+
+                                       $thisObject['buffer_size']                       = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
+                                       $offset += 4;
+
+                                       $thisObject['initial_buffer_fullness']           = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
+                                       $offset += 4;
+
+                                       $thisObject['alternate_data_bitrate']            = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
+                                       $offset += 4;
+
+                                       $thisObject['alternate_buffer_size']             = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
+                                       $offset += 4;
+
+                                       $thisObject['alternate_initial_buffer_fullness'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
+                                       $offset += 4;
+
+                                       $thisObject['maximum_object_size']               = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
+                                       $offset += 4;
+
+                                       $thisObject['flags_raw']                         = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
+                                       $offset += 4;
+                                       $thisObject['flags']['reliable']                = (bool) $thisObject['flags_raw'] & 0x00000001;
+                                       $thisObject['flags']['seekable']                = (bool) $thisObject['flags_raw'] & 0x00000002;
+                                       $thisObject['flags']['no_cleanpoints']          = (bool) $thisObject['flags_raw'] & 0x00000004;
+                                       $thisObject['flags']['resend_live_cleanpoints'] = (bool) $thisObject['flags_raw'] & 0x00000008;
+
+                                       $thisObject['stream_number']                     = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
+                                       $offset += 2;
+
+                                       $thisObject['stream_language_id_index']          = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
+                                       $offset += 2;
+
+                                       $thisObject['average_time_per_frame']            = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
+                                       $offset += 4;
+
+                                       $thisObject['stream_name_count']                 = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
+                                       $offset += 2;
+
+                                       $thisObject['payload_extension_system_count']    = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
+                                       $offset += 2;
+
+                                       for ($i = 0; $i < $thisObject['stream_name_count']; $i++) {
+                                               $streamName = array();
+
+                                               $streamName['language_id_index']             = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
+                                               $offset += 2;
+
+                                               $streamName['stream_name_length']            = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
+                                               $offset += 2;
+
+                                               $streamName['stream_name']                   = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  $streamName['stream_name_length']));
+                                               $offset += $streamName['stream_name_length'];
+
+                                               $thisObject['stream_names'][$i] = $streamName;
+                                       }
+
+                                       for ($i = 0; $i < $thisObject['payload_extension_system_count']; $i++) {
+                                               $payloadExtensionSystem = array();
+
+                                               $payloadExtensionSystem['extension_system_id']   =                              substr($asf_header_extension_object_data, $offset, 16);
+                                               $offset += 16;
+                                               $payloadExtensionSystem['extension_system_id_text'] = $this->BytestringToGUID($payloadExtensionSystem['extension_system_id']);
+
+                                               $payloadExtensionSystem['extension_system_size'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
+                                               $offset += 2;
+                                               if ($payloadExtensionSystem['extension_system_size'] <= 0) {
+                                                       break 2;
+                                               }
+
+                                               $payloadExtensionSystem['extension_system_info_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
+                                               $offset += 4;
+
+                                               $payloadExtensionSystem['extension_system_info_length'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  $payloadExtensionSystem['extension_system_info_length']));
+                                               $offset += $payloadExtensionSystem['extension_system_info_length'];
+
+                                               $thisObject['payload_extension_systems'][$i] = $payloadExtensionSystem;
+                                       }
+
+                                       break;
+
+                               case GETID3_ASF_Padding_Object:
+                                       // padding, skip it
+                                       break;
+
+                               case GETID3_ASF_Metadata_Object:
+                                       $thisObject['description_record_counts'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
+                                       $offset += 2;
+
+                                       for ($i = 0; $i < $thisObject['description_record_counts']; $i++) {
+                                               $descriptionRecord = array();
+
+                                               $descriptionRecord['reserved_1']         = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2)); // must be zero
+                                               $offset += 2;
+
+                                               $descriptionRecord['stream_number']      = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
+                                               $offset += 2;
+
+                                               $descriptionRecord['name_length']        = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
+                                               $offset += 2;
+
+                                               $descriptionRecord['data_type']          = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
+                                               $offset += 2;
+                                               $descriptionRecord['data_type_text'] = $this->ASFmetadataLibraryObjectDataTypeLookup($descriptionRecord['data_type']);
+
+                                               $descriptionRecord['data_length']        = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
+                                               $offset += 4;
+
+                                               $descriptionRecord['name']               =                              substr($asf_header_extension_object_data, $offset,  $descriptionRecord['name_length']);
+                                               $offset += $descriptionRecord['name_length'];
+
+                                               $descriptionRecord['data']               =                              substr($asf_header_extension_object_data, $offset,  $descriptionRecord['data_length']);
+                                               $offset += $descriptionRecord['data_length'];
+                                               switch ($descriptionRecord['data_type']) {
+                                                       case 0x0000: // Unicode string
+                                                               break;
+
+                                                       case 0x0001: // BYTE array
+                                                               // do nothing
+                                                               break;
+
+                                                       case 0x0002: // BOOL
+                                                               $descriptionRecord['data'] = (bool) getid3_lib::LittleEndian2Int($descriptionRecord['data']);
+                                                               break;
+
+                                                       case 0x0003: // DWORD
+                                                       case 0x0004: // QWORD
+                                                       case 0x0005: // WORD
+                                                               $descriptionRecord['data'] = getid3_lib::LittleEndian2Int($descriptionRecord['data']);
+                                                               break;
+
+                                                       case 0x0006: // GUID
+                                                               $descriptionRecord['data_text'] = $this->BytestringToGUID($descriptionRecord['data']);
+                                                               break;
+                                               }
+
+                                               $thisObject['description_record'][$i] = $descriptionRecord;
+                                       }
+                                       break;
+
+                               case GETID3_ASF_Language_List_Object:
+                                       $thisObject['language_id_record_counts'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
+                                       $offset += 2;
+
+                                       for ($i = 0; $i < $thisObject['language_id_record_counts']; $i++) {
+                                               $languageIDrecord = array();
+
+                                               $languageIDrecord['language_id_length']         = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  1));
+                                               $offset += 1;
+
+                                               $languageIDrecord['language_id']                =                              substr($asf_header_extension_object_data, $offset,  $languageIDrecord['language_id_length']);
+                                               $offset += $languageIDrecord['language_id_length'];
+
+                                               $thisObject['language_id_record'][$i] = $languageIDrecord;
+                                       }
+                                       break;
+
+                               case GETID3_ASF_Metadata_Library_Object:
+                                       $thisObject['description_records_count'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
+                                       $offset += 2;
+
+                                       for ($i = 0; $i < $thisObject['description_records_count']; $i++) {
+                                               $descriptionRecord = array();
+
+                                               $descriptionRecord['language_list_index'] = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
+                                               $offset += 2;
+
+                                               $descriptionRecord['stream_number']       = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
+                                               $offset += 2;
+
+                                               $descriptionRecord['name_length']         = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
+                                               $offset += 2;
+
+                                               $descriptionRecord['data_type']           = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  2));
+                                               $offset += 2;
+                                               $descriptionRecord['data_type_text'] = $this->ASFmetadataLibraryObjectDataTypeLookup($descriptionRecord['data_type']);
+
+                                               $descriptionRecord['data_length']         = getid3_lib::LittleEndian2Int(substr($asf_header_extension_object_data, $offset,  4));
+                                               $offset += 4;
+
+                                               $descriptionRecord['name']                =                              substr($asf_header_extension_object_data, $offset,  $descriptionRecord['name_length']);
+                                               $offset += $descriptionRecord['name_length'];
+
+                                               $descriptionRecord['data']                =                              substr($asf_header_extension_object_data, $offset,  $descriptionRecord['data_length']);
+                                               $offset += $descriptionRecord['data_length'];
+
+                                               if (preg_match('#^WM/Picture$#', str_replace("\x00", '', trim($descriptionRecord['name'])))) {
+                                                       $WMpicture = $this->ASF_WMpicture($descriptionRecord['data']);
+                                                       foreach ($WMpicture as $key => $value) {
+                                                               $descriptionRecord['data'] = $WMpicture;
+                                                       }
+                                                       unset($WMpicture);
+                                               }
+
+                                               $thisObject['description_record'][$i] = $descriptionRecord;
+                                       }
+                                       break;
+
+                               default:
+                                       $unhandled_sections++;
+                                       if ($this->GUIDname($thisObject['guid_text'])) {
+                                               $this->getid3->info['warning'][] = 'unhandled Header Extension Object GUID "'.$this->GUIDname($thisObject['guid_text']).'" {'.$thisObject['guid_text'].'} at offset '.($offset - 16 - 8);
+                                       } else {
+                                               $this->getid3->info['warning'][] = 'unknown Header Extension Object GUID {'.$thisObject['guid_text'].'} in at offset '.($offset - 16 - 8);
+                                       }
+                                       break;
+                       }
+                       $HeaderExtensionObjectParsed[] = $thisObject;
+
+                       $objectOffset += $thisObject['size'];
+               }
+               return $HeaderExtensionObjectParsed;
+       }
+
+
+       public static function ASFmetadataLibraryObjectDataTypeLookup($id) {
+               static $ASFmetadataLibraryObjectDataTypeLookup = array(
+                       0x0000 => 'Unicode string', // The data consists of a sequence of Unicode characters
+                       0x0001 => 'BYTE array',     // The type of the data is implementation-specific
+                       0x0002 => 'BOOL',           // The data is 2 bytes long and should be interpreted as a 16-bit unsigned integer. Only 0x0000 or 0x0001 are permitted values
+                       0x0003 => 'DWORD',          // The data is 4 bytes long and should be interpreted as a 32-bit unsigned integer
+                       0x0004 => 'QWORD',          // The data is 8 bytes long and should be interpreted as a 64-bit unsigned integer
+                       0x0005 => 'WORD',           // The data is 2 bytes long and should be interpreted as a 16-bit unsigned integer
+                       0x0006 => 'GUID',           // The data is 16 bytes long and should be interpreted as a 128-bit GUID
+               );
+               return (isset($ASFmetadataLibraryObjectDataTypeLookup[$id]) ? $ASFmetadataLibraryObjectDataTypeLookup[$id] : 'invalid');
+       }
+
+       public function ASF_WMpicture(&$data) {
+               //typedef struct _WMPicture{
+               //  LPWSTR  pwszMIMEType;
+               //  BYTE  bPictureType;
+               //  LPWSTR  pwszDescription;
+               //  DWORD  dwDataLen;
+               //  BYTE*  pbData;
+               //} WM_PICTURE;
+
+               $WMpicture = array();
+
+               $offset = 0;
+               $WMpicture['image_type_id'] = getid3_lib::LittleEndian2Int(substr($data, $offset, 1));
+               $offset += 1;
+               $WMpicture['image_type']    = $this->WMpictureTypeLookup($WMpicture['image_type_id']);
+               $WMpicture['image_size']    = getid3_lib::LittleEndian2Int(substr($data, $offset, 4));
+               $offset += 4;
+
+               $WMpicture['image_mime'] = '';
+               do {
+                       $next_byte_pair = substr($data, $offset, 2);
+                       $offset += 2;
+                       $WMpicture['image_mime'] .= $next_byte_pair;
+               } while ($next_byte_pair !== "\x00\x00");
+
+               $WMpicture['image_description'] = '';
+               do {
+                       $next_byte_pair = substr($data, $offset, 2);
+                       $offset += 2;
+                       $WMpicture['image_description'] .= $next_byte_pair;
+               } while ($next_byte_pair !== "\x00\x00");
+
+               $WMpicture['dataoffset'] = $offset;
+               $WMpicture['data'] = substr($data, $offset);
+
+               $imageinfo = array();
+               $WMpicture['image_mime'] = '';
+               $imagechunkcheck = getid3_lib::GetDataImageSize($WMpicture['data'], $imageinfo);
+               unset($imageinfo);
+               if (!empty($imagechunkcheck)) {
+                       $WMpicture['image_mime'] = image_type_to_mime_type($imagechunkcheck[2]);
+               }
+               if (!isset($this->getid3->info['asf']['comments']['picture'])) {
+                       $this->getid3->info['asf']['comments']['picture'] = array();
+               }
+               $this->getid3->info['asf']['comments']['picture'][] = array('data'=>$WMpicture['data'], 'image_mime'=>$WMpicture['image_mime']);
+
+               return $WMpicture;
+       }
+
+
+       // Remove terminator 00 00 and convert UTF-16LE to Latin-1
+       public static function TrimConvert($string) {
+               return trim(getid3_lib::iconv_fallback('UTF-16LE', 'ISO-8859-1', self::TrimTerm($string)), ' ');
+       }
+
+
+       // Remove terminator 00 00
+       public static function TrimTerm($string) {
+               // remove terminator, only if present (it should be, but...)
+               if (substr($string, -2) === "\x00\x00") {
+                       $string = substr($string, 0, -2);
+               }
+               return $string;
+       }
+
+}
diff --git a/wp-includes/ID3/module.audio-video.flv.php b/wp-includes/ID3/module.audio-video.flv.php
new file mode 100644 (file)
index 0000000..f9c4cf3
--- /dev/null
@@ -0,0 +1,729 @@
+<?php
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org>               //
+//  available at http://getid3.sourceforge.net                 //
+//            or http://www.getid3.org                         //
+//                                                             //
+//  FLV module by Seth Kaufman <sethØwhirl-i-gig*com>          //
+//                                                             //
+//  * version 0.1 (26 June 2005)                               //
+//                                                             //
+//                                                             //
+//  * version 0.1.1 (15 July 2005)                             //
+//  minor modifications by James Heinrich <info@getid3.org>    //
+//                                                             //
+//  * version 0.2 (22 February 2006)                           //
+//  Support for On2 VP6 codec and meta information             //
+//    by Steve Webster <steve.websterØfeaturecreep*com>        //
+//                                                             //
+//  * version 0.3 (15 June 2006)                               //
+//  Modified to not read entire file into memory               //
+//    by James Heinrich <info@getid3.org>                      //
+//                                                             //
+//  * version 0.4 (07 December 2007)                           //
+//  Bugfixes for incorrectly parsed FLV dimensions             //
+//    and incorrect parsing of onMetaTag                       //
+//    by Evgeny Moysevich <moysevichØgmail*com>                //
+//                                                             //
+//  * version 0.5 (21 May 2009)                                //
+//  Fixed parsing of audio tags and added additional codec     //
+//    details. The duration is now read from onMetaTag (if     //
+//    exists), rather than parsing whole file                  //
+//    by Nigel Barnes <ngbarnesØhotmail*com>                   //
+//                                                             //
+//  * version 0.6 (24 May 2009)                                //
+//  Better parsing of files with h264 video                    //
+//    by Evgeny Moysevich <moysevichØgmail*com>                //
+//                                                             //
+//  * version 0.6.1 (30 May 2011)                              //
+//    prevent infinite loops in expGolombUe()                  //
+//                                                             //
+/////////////////////////////////////////////////////////////////
+//                                                             //
+// module.audio-video.flv.php                                  //
+// module for analyzing Shockwave Flash Video files            //
+// dependencies: NONE                                          //
+//                                                            ///
+/////////////////////////////////////////////////////////////////
+
+define('GETID3_FLV_TAG_AUDIO',          8);
+define('GETID3_FLV_TAG_VIDEO',          9);
+define('GETID3_FLV_TAG_META',          18);
+
+define('GETID3_FLV_VIDEO_H263',         2);
+define('GETID3_FLV_VIDEO_SCREEN',       3);
+define('GETID3_FLV_VIDEO_VP6FLV',       4);
+define('GETID3_FLV_VIDEO_VP6FLV_ALPHA', 5);
+define('GETID3_FLV_VIDEO_SCREENV2',     6);
+define('GETID3_FLV_VIDEO_H264',         7);
+
+define('H264_AVC_SEQUENCE_HEADER',          0);
+define('H264_PROFILE_BASELINE',            66);
+define('H264_PROFILE_MAIN',                77);
+define('H264_PROFILE_EXTENDED',            88);
+define('H264_PROFILE_HIGH',               100);
+define('H264_PROFILE_HIGH10',             110);
+define('H264_PROFILE_HIGH422',            122);
+define('H264_PROFILE_HIGH444',            144);
+define('H264_PROFILE_HIGH444_PREDICTIVE', 244);
+
+class getid3_flv extends getid3_handler
+{
+       public $max_frames = 100000; // break out of the loop if too many frames have been scanned; only scan this many if meta frame does not contain useful duration
+
+       public function Analyze() {
+               $info = &$this->getid3->info;
+
+               fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET);
+
+               $FLVdataLength = $info['avdataend'] - $info['avdataoffset'];
+               $FLVheader = fread($this->getid3->fp, 5);
+
+               $info['fileformat'] = 'flv';
+               $info['flv']['header']['signature'] =                           substr($FLVheader, 0, 3);
+               $info['flv']['header']['version']   = getid3_lib::BigEndian2Int(substr($FLVheader, 3, 1));
+               $TypeFlags                          = getid3_lib::BigEndian2Int(substr($FLVheader, 4, 1));
+
+               $magic = 'FLV';
+               if ($info['flv']['header']['signature'] != $magic) {
+                       $info['error'][] = 'Expecting "'.getid3_lib::PrintHexBytes($magic).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($info['flv']['header']['signature']).'"';
+                       unset($info['flv']);
+                       unset($info['fileformat']);
+                       return false;
+               }
+
+               $info['flv']['header']['hasAudio'] = (bool) ($TypeFlags & 0x04);
+               $info['flv']['header']['hasVideo'] = (bool) ($TypeFlags & 0x01);
+
+               $FrameSizeDataLength = getid3_lib::BigEndian2Int(fread($this->getid3->fp, 4));
+               $FLVheaderFrameLength = 9;
+               if ($FrameSizeDataLength > $FLVheaderFrameLength) {
+                       fseek($this->getid3->fp, $FrameSizeDataLength - $FLVheaderFrameLength, SEEK_CUR);
+               }
+               $Duration = 0;
+               $found_video = false;
+               $found_audio = false;
+               $found_meta  = false;
+               $found_valid_meta_playtime = false;
+               $tagParseCount = 0;
+               $info['flv']['framecount'] = array('total'=>0, 'audio'=>0, 'video'=>0);
+               $flv_framecount = &$info['flv']['framecount'];
+               while (((ftell($this->getid3->fp) + 16) < $info['avdataend']) && (($tagParseCount++ <= $this->max_frames) || !$found_valid_meta_playtime))  {
+                       $ThisTagHeader = fread($this->getid3->fp, 16);
+
+                       $PreviousTagLength = getid3_lib::BigEndian2Int(substr($ThisTagHeader,  0, 4));
+                       $TagType           = getid3_lib::BigEndian2Int(substr($ThisTagHeader,  4, 1));
+                       $DataLength        = getid3_lib::BigEndian2Int(substr($ThisTagHeader,  5, 3));
+                       $Timestamp         = getid3_lib::BigEndian2Int(substr($ThisTagHeader,  8, 3));
+                       $LastHeaderByte    = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 15, 1));
+                       $NextOffset = ftell($this->getid3->fp) - 1 + $DataLength;
+                       if ($Timestamp > $Duration) {
+                               $Duration = $Timestamp;
+                       }
+
+                       $flv_framecount['total']++;
+                       switch ($TagType) {
+                               case GETID3_FLV_TAG_AUDIO:
+                                       $flv_framecount['audio']++;
+                                       if (!$found_audio) {
+                                               $found_audio = true;
+                                               $info['flv']['audio']['audioFormat']     = ($LastHeaderByte >> 4) & 0x0F;
+                                               $info['flv']['audio']['audioRate']       = ($LastHeaderByte >> 2) & 0x03;
+                                               $info['flv']['audio']['audioSampleSize'] = ($LastHeaderByte >> 1) & 0x01;
+                                               $info['flv']['audio']['audioType']       =  $LastHeaderByte       & 0x01;
+                                       }
+                                       break;
+
+                               case GETID3_FLV_TAG_VIDEO:
+                                       $flv_framecount['video']++;
+                                       if (!$found_video) {
+                                               $found_video = true;
+                                               $info['flv']['video']['videoCodec'] = $LastHeaderByte & 0x07;
+
+                                               $FLVvideoHeader = fread($this->getid3->fp, 11);
+
+                                               if ($info['flv']['video']['videoCodec'] == GETID3_FLV_VIDEO_H264) {
+                                                       // this code block contributed by: moysevichØgmail*com
+
+                                                       $AVCPacketType = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 0, 1));
+                                                       if ($AVCPacketType == H264_AVC_SEQUENCE_HEADER) {
+                                                               //      read AVCDecoderConfigurationRecord
+                                                               $configurationVersion       = getid3_lib::BigEndian2Int(substr($FLVvideoHeader,  4, 1));
+                                                               $AVCProfileIndication       = getid3_lib::BigEndian2Int(substr($FLVvideoHeader,  5, 1));
+                                                               $profile_compatibility      = getid3_lib::BigEndian2Int(substr($FLVvideoHeader,  6, 1));
+                                                               $lengthSizeMinusOne         = getid3_lib::BigEndian2Int(substr($FLVvideoHeader,  7, 1));
+                                                               $numOfSequenceParameterSets = getid3_lib::BigEndian2Int(substr($FLVvideoHeader,  8, 1));
+
+                                                               if (($numOfSequenceParameterSets & 0x1F) != 0) {
+                                                                       //      there is at least one SequenceParameterSet
+                                                                       //      read size of the first SequenceParameterSet
+                                                                       //$spsSize = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 9, 2));
+                                                                       $spsSize = getid3_lib::LittleEndian2Int(substr($FLVvideoHeader, 9, 2));
+                                                                       //      read the first SequenceParameterSet
+                                                                       $sps = fread($this->getid3->fp, $spsSize);
+                                                                       if (strlen($sps) == $spsSize) { //      make sure that whole SequenceParameterSet was red
+                                                                               $spsReader = new AVCSequenceParameterSetReader($sps);
+                                                                               $spsReader->readData();
+                                                                               $info['video']['resolution_x'] = $spsReader->getWidth();
+                                                                               $info['video']['resolution_y'] = $spsReader->getHeight();
+                                                                       }
+                                                               }
+                                                       }
+                                                       // end: moysevichØgmail*com
+
+                                               } elseif ($info['flv']['video']['videoCodec'] == GETID3_FLV_VIDEO_H263) {
+
+                                                       $PictureSizeType = (getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 3, 2))) >> 7;
+                                                       $PictureSizeType = $PictureSizeType & 0x0007;
+                                                       $info['flv']['header']['videoSizeType'] = $PictureSizeType;
+                                                       switch ($PictureSizeType) {
+                                                               case 0:
+                                                                       //$PictureSizeEnc = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 5, 2));
+                                                                       //$PictureSizeEnc <<= 1;
+                                                                       //$info['video']['resolution_x'] = ($PictureSizeEnc & 0xFF00) >> 8;
+                                                                       //$PictureSizeEnc = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 6, 2));
+                                                                       //$PictureSizeEnc <<= 1;
+                                                                       //$info['video']['resolution_y'] = ($PictureSizeEnc & 0xFF00) >> 8;
+
+                                                                       $PictureSizeEnc['x'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 4, 2));
+                                                                       $PictureSizeEnc['y'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 5, 2));
+                                                                       $PictureSizeEnc['x'] >>= 7;
+                                                                       $PictureSizeEnc['y'] >>= 7;
+                                                                       $info['video']['resolution_x'] = $PictureSizeEnc['x'] & 0xFF;
+                                                                       $info['video']['resolution_y'] = $PictureSizeEnc['y'] & 0xFF;
+                                                                       break;
+
+                                                               case 1:
+                                                                       $PictureSizeEnc['x'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 4, 3));
+                                                                       $PictureSizeEnc['y'] = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 6, 3));
+                                                                       $PictureSizeEnc['x'] >>= 7;
+                                                                       $PictureSizeEnc['y'] >>= 7;
+                                                                       $info['video']['resolution_x'] = $PictureSizeEnc['x'] & 0xFFFF;
+                                                                       $info['video']['resolution_y'] = $PictureSizeEnc['y'] & 0xFFFF;
+                                                                       break;
+
+                                                               case 2:
+                                                                       $info['video']['resolution_x'] = 352;
+                                                                       $info['video']['resolution_y'] = 288;
+                                                                       break;
+
+                                                               case 3:
+                                                                       $info['video']['resolution_x'] = 176;
+                                                                       $info['video']['resolution_y'] = 144;
+                                                                       break;
+
+                                                               case 4:
+                                                                       $info['video']['resolution_x'] = 128;
+                                                                       $info['video']['resolution_y'] = 96;
+                                                                       break;
+
+                                                               case 5:
+                                                                       $info['video']['resolution_x'] = 320;
+                                                                       $info['video']['resolution_y'] = 240;
+                                                                       break;
+
+                                                               case 6:
+                                                                       $info['video']['resolution_x'] = 160;
+                                                                       $info['video']['resolution_y'] = 120;
+                                                                       break;
+
+                                                               default:
+                                                                       $info['video']['resolution_x'] = 0;
+                                                                       $info['video']['resolution_y'] = 0;
+                                                                       break;
+
+                                                       }
+                                               }
+                                               $info['video']['pixel_aspect_ratio'] = $info['video']['resolution_x'] / $info['video']['resolution_y'];
+                                       }
+                                       break;
+
+                               // Meta tag
+                               case GETID3_FLV_TAG_META:
+                                       if (!$found_meta) {
+                                               $found_meta = true;
+                                               fseek($this->getid3->fp, -1, SEEK_CUR);
+                                               $datachunk = fread($this->getid3->fp, $DataLength);
+                                               $AMFstream = new AMFStream($datachunk);
+                                               $reader = new AMFReader($AMFstream);
+                                               $eventName = $reader->readData();
+                                               $info['flv']['meta'][$eventName] = $reader->readData();
+                                               unset($reader);
+
+                                               $copykeys = array('framerate'=>'frame_rate', 'width'=>'resolution_x', 'height'=>'resolution_y', 'audiodatarate'=>'bitrate', 'videodatarate'=>'bitrate');
+                                               foreach ($copykeys as $sourcekey => $destkey) {
+                                                       if (isset($info['flv']['meta']['onMetaData'][$sourcekey])) {
+                                                               switch ($sourcekey) {
+                                                                       case 'width':
+                                                                       case 'height':
+                                                                               $info['video'][$destkey] = intval(round($info['flv']['meta']['onMetaData'][$sourcekey]));
+                                                                               break;
+                                                                       case 'audiodatarate':
+                                                                               $info['audio'][$destkey] = getid3_lib::CastAsInt(round($info['flv']['meta']['onMetaData'][$sourcekey] * 1000));
+                                                                               break;
+                                                                       case 'videodatarate':
+                                                                       case 'frame_rate':
+                                                                       default:
+                                                                               $info['video'][$destkey] = $info['flv']['meta']['onMetaData'][$sourcekey];
+                                                                               break;
+                                                               }
+                                                       }
+                                               }
+                                               if (!empty($info['flv']['meta']['onMetaData']['duration'])) {
+                                                       $found_valid_meta_playtime = true;
+                                               }
+                                       }
+                                       break;
+
+                               default:
+                                       // noop
+                                       break;
+                       }
+                       fseek($this->getid3->fp, $NextOffset, SEEK_SET);
+               }
+
+               $info['playtime_seconds'] = $Duration / 1000;
+               if ($info['playtime_seconds'] > 0) {
+                       $info['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds'];
+               }
+
+               if ($info['flv']['header']['hasAudio']) {
+                       $info['audio']['codec']           =   $this->FLVaudioFormat($info['flv']['audio']['audioFormat']);
+                       $info['audio']['sample_rate']     =     $this->FLVaudioRate($info['flv']['audio']['audioRate']);
+                       $info['audio']['bits_per_sample'] = $this->FLVaudioBitDepth($info['flv']['audio']['audioSampleSize']);
+
+                       $info['audio']['channels']   =  $info['flv']['audio']['audioType'] + 1; // 0=mono,1=stereo
+                       $info['audio']['lossless']   = ($info['flv']['audio']['audioFormat'] ? false : true); // 0=uncompressed
+                       $info['audio']['dataformat'] = 'flv';
+               }
+               if (!empty($info['flv']['header']['hasVideo'])) {
+                       $info['video']['codec']      = $this->FLVvideoCodec($info['flv']['video']['videoCodec']);
+                       $info['video']['dataformat'] = 'flv';
+                       $info['video']['lossless']   = false;
+               }
+
+               // Set information from meta
+               if (!empty($info['flv']['meta']['onMetaData']['duration'])) {
+                       $info['playtime_seconds'] = $info['flv']['meta']['onMetaData']['duration'];
+                       $info['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds'];
+               }
+               if (isset($info['flv']['meta']['onMetaData']['audiocodecid'])) {
+                       $info['audio']['codec'] = $this->FLVaudioFormat($info['flv']['meta']['onMetaData']['audiocodecid']);
+               }
+               if (isset($info['flv']['meta']['onMetaData']['videocodecid'])) {
+                       $info['video']['codec'] = $this->FLVvideoCodec($info['flv']['meta']['onMetaData']['videocodecid']);
+               }
+               return true;
+       }
+
+
+       public function FLVaudioFormat($id) {
+               $FLVaudioFormat = array(
+                       0  => 'Linear PCM, platform endian',
+                       1  => 'ADPCM',
+                       2  => 'mp3',
+                       3  => 'Linear PCM, little endian',
+                       4  => 'Nellymoser 16kHz mono',
+                       5  => 'Nellymoser 8kHz mono',
+                       6  => 'Nellymoser',
+                       7  => 'G.711A-law logarithmic PCM',
+                       8  => 'G.711 mu-law logarithmic PCM',
+                       9  => 'reserved',
+                       10 => 'AAC',
+                       11 => false, // unknown?
+                       12 => false, // unknown?
+                       13 => false, // unknown?
+                       14 => 'mp3 8kHz',
+                       15 => 'Device-specific sound',
+               );
+               return (isset($FLVaudioFormat[$id]) ? $FLVaudioFormat[$id] : false);
+       }
+
+       public function FLVaudioRate($id) {
+               $FLVaudioRate = array(
+                       0 =>  5500,
+                       1 => 11025,
+                       2 => 22050,
+                       3 => 44100,
+               );
+               return (isset($FLVaudioRate[$id]) ? $FLVaudioRate[$id] : false);
+       }
+
+       public function FLVaudioBitDepth($id) {
+               $FLVaudioBitDepth = array(
+                       0 =>  8,
+                       1 => 16,
+               );
+               return (isset($FLVaudioBitDepth[$id]) ? $FLVaudioBitDepth[$id] : false);
+       }
+
+       public function FLVvideoCodec($id) {
+               $FLVvideoCodec = array(
+                       GETID3_FLV_VIDEO_H263         => 'Sorenson H.263',
+                       GETID3_FLV_VIDEO_SCREEN       => 'Screen video',
+                       GETID3_FLV_VIDEO_VP6FLV       => 'On2 VP6',
+                       GETID3_FLV_VIDEO_VP6FLV_ALPHA => 'On2 VP6 with alpha channel',
+                       GETID3_FLV_VIDEO_SCREENV2     => 'Screen video v2',
+                       GETID3_FLV_VIDEO_H264         => 'Sorenson H.264',
+               );
+               return (isset($FLVvideoCodec[$id]) ? $FLVvideoCodec[$id] : false);
+       }
+}
+
+class AMFStream {
+       public $bytes;
+       public $pos;
+
+       public function AMFStream(&$bytes) {
+               $this->bytes =& $bytes;
+               $this->pos = 0;
+       }
+
+       public function readByte() {
+               return getid3_lib::BigEndian2Int(substr($this->bytes, $this->pos++, 1));
+       }
+
+       public function readInt() {
+               return ($this->readByte() << 8) + $this->readByte();
+       }
+
+       public function readLong() {
+               return ($this->readByte() << 24) + ($this->readByte() << 16) + ($this->readByte() << 8) + $this->readByte();
+       }
+
+       public function readDouble() {
+               return getid3_lib::BigEndian2Float($this->read(8));
+       }
+
+       public function readUTF() {
+               $length = $this->readInt();
+               return $this->read($length);
+       }
+
+       public function readLongUTF() {
+               $length = $this->readLong();
+               return $this->read($length);
+       }
+
+       public function read($length) {
+               $val = substr($this->bytes, $this->pos, $length);
+               $this->pos += $length;
+               return $val;
+       }
+
+       public function peekByte() {
+               $pos = $this->pos;
+               $val = $this->readByte();
+               $this->pos = $pos;
+               return $val;
+       }
+
+       public function peekInt() {
+               $pos = $this->pos;
+               $val = $this->readInt();
+               $this->pos = $pos;
+               return $val;
+       }
+
+       public function peekLong() {
+               $pos = $this->pos;
+               $val = $this->readLong();
+               $this->pos = $pos;
+               return $val;
+       }
+
+       public function peekDouble() {
+               $pos = $this->pos;
+               $val = $this->readDouble();
+               $this->pos = $pos;
+               return $val;
+       }
+
+       public function peekUTF() {
+               $pos = $this->pos;
+               $val = $this->readUTF();
+               $this->pos = $pos;
+               return $val;
+       }
+
+       public function peekLongUTF() {
+               $pos = $this->pos;
+               $val = $this->readLongUTF();
+               $this->pos = $pos;
+               return $val;
+       }
+}
+
+class AMFReader {
+       public $stream;
+
+       public function AMFReader(&$stream) {
+               $this->stream =& $stream;
+       }
+
+       public function readData() {
+               $value = null;
+
+               $type = $this->stream->readByte();
+               switch ($type) {
+
+                       // Double
+                       case 0:
+                               $value = $this->readDouble();
+                       break;
+
+                       // Boolean
+                       case 1:
+                               $value = $this->readBoolean();
+                               break;
+
+                       // String
+                       case 2:
+                               $value = $this->readString();
+                               break;
+
+                       // Object
+                       case 3:
+                               $value = $this->readObject();
+                               break;
+
+                       // null
+                       case 6:
+                               return null;
+                               break;
+
+                       // Mixed array
+                       case 8:
+                               $value = $this->readMixedArray();
+                               break;
+
+                       // Array
+                       case 10:
+                               $value = $this->readArray();
+                               break;
+
+                       // Date
+                       case 11:
+                               $value = $this->readDate();
+                               break;
+
+                       // Long string
+                       case 13:
+                               $value = $this->readLongString();
+                               break;
+
+                       // XML (handled as string)
+                       case 15:
+                               $value = $this->readXML();
+                               break;
+
+                       // Typed object (handled as object)
+                       case 16:
+                               $value = $this->readTypedObject();
+                               break;
+
+                       // Long string
+                       default:
+                               $value = '(unknown or unsupported data type)';
+                       break;
+               }
+
+               return $value;
+       }
+
+       public function readDouble() {
+               return $this->stream->readDouble();
+       }
+
+       public function readBoolean() {
+               return $this->stream->readByte() == 1;
+       }
+
+       public function readString() {
+               return $this->stream->readUTF();
+       }
+
+       public function readObject() {
+               // Get highest numerical index - ignored
+//             $highestIndex = $this->stream->readLong();
+
+               $data = array();
+
+               while ($key = $this->stream->readUTF()) {
+                       $data[$key] = $this->readData();
+               }
+               // Mixed array record ends with empty string (0x00 0x00) and 0x09
+               if (($key == '') && ($this->stream->peekByte() == 0x09)) {
+                       // Consume byte
+                       $this->stream->readByte();
+               }
+               return $data;
+       }
+
+       public function readMixedArray() {
+               // Get highest numerical index - ignored
+               $highestIndex = $this->stream->readLong();
+
+               $data = array();
+
+               while ($key = $this->stream->readUTF()) {
+                       if (is_numeric($key)) {
+                               $key = (float) $key;
+                       }
+                       $data[$key] = $this->readData();
+               }
+               // Mixed array record ends with empty string (0x00 0x00) and 0x09
+               if (($key == '') && ($this->stream->peekByte() == 0x09)) {
+                       // Consume byte
+                       $this->stream->readByte();
+               }
+
+               return $data;
+       }
+
+       public function readArray() {
+               $length = $this->stream->readLong();
+               $data = array();
+
+               for ($i = 0; $i < $length; $i++) {
+                       $data[] = $this->readData();
+               }
+               return $data;
+       }
+
+       public function readDate() {
+               $timestamp = $this->stream->readDouble();
+               $timezone = $this->stream->readInt();
+               return $timestamp;
+       }
+
+       public function readLongString() {
+               return $this->stream->readLongUTF();
+       }
+
+       public function readXML() {
+               return $this->stream->readLongUTF();
+       }
+
+       public function readTypedObject() {
+               $className = $this->stream->readUTF();
+               return $this->readObject();
+       }
+}
+
+class AVCSequenceParameterSetReader {
+       public $sps;
+       public $start = 0;
+       public $currentBytes = 0;
+       public $currentBits = 0;
+       public $width;
+       public $height;
+
+       public function AVCSequenceParameterSetReader($sps) {
+               $this->sps = $sps;
+       }
+
+       public function readData() {
+               $this->skipBits(8);
+               $this->skipBits(8);
+               $profile = $this->getBits(8);   //      read profile
+               $this->skipBits(16);
+               $this->expGolombUe();   //      read sps id
+               if (in_array($profile, array(H264_PROFILE_HIGH, H264_PROFILE_HIGH10, H264_PROFILE_HIGH422, H264_PROFILE_HIGH444, H264_PROFILE_HIGH444_PREDICTIVE))) {
+                       if ($this->expGolombUe() == 3) {
+                               $this->skipBits(1);
+                       }
+                       $this->expGolombUe();
+                       $this->expGolombUe();
+                       $this->skipBits(1);
+                       if ($this->getBit()) {
+                               for ($i = 0; $i < 8; $i++) {
+                                       if ($this->getBit()) {
+                                               $size = $i < 6 ? 16 : 64;
+                                               $lastScale = 8;
+                                               $nextScale = 8;
+                                               for ($j = 0; $j < $size; $j++) {
+                                                       if ($nextScale != 0) {
+                                                               $deltaScale = $this->expGolombUe();
+                                                               $nextScale = ($lastScale + $deltaScale + 256) % 256;
+                                                       }
+                                                       if ($nextScale != 0) {
+                                                               $lastScale = $nextScale;
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+               $this->expGolombUe();
+               $pocType = $this->expGolombUe();
+               if ($pocType == 0) {
+                       $this->expGolombUe();
+               } elseif ($pocType == 1) {
+                       $this->skipBits(1);
+                       $this->expGolombSe();
+                       $this->expGolombSe();
+                       $pocCycleLength = $this->expGolombUe();
+                       for ($i = 0; $i < $pocCycleLength; $i++) {
+                               $this->expGolombSe();
+                       }
+               }
+               $this->expGolombUe();
+               $this->skipBits(1);
+               $this->width = ($this->expGolombUe() + 1) * 16;
+               $heightMap = $this->expGolombUe() + 1;
+               $this->height = (2 - $this->getBit()) * $heightMap * 16;
+       }
+
+       public function skipBits($bits) {
+               $newBits = $this->currentBits + $bits;
+               $this->currentBytes += (int)floor($newBits / 8);
+               $this->currentBits = $newBits % 8;
+       }
+
+       public function getBit() {
+               $result = (getid3_lib::BigEndian2Int(substr($this->sps, $this->currentBytes, 1)) >> (7 - $this->currentBits)) & 0x01;
+               $this->skipBits(1);
+               return $result;
+       }
+
+       public function getBits($bits) {
+               $result = 0;
+               for ($i = 0; $i < $bits; $i++) {
+                       $result = ($result << 1) + $this->getBit();
+               }
+               return $result;
+       }
+
+       public function expGolombUe() {
+               $significantBits = 0;
+               $bit = $this->getBit();
+               while ($bit == 0) {
+                       $significantBits++;
+                       $bit = $this->getBit();
+
+                       if ($significantBits > 31) {
+                               // something is broken, this is an emergency escape to prevent infinite loops
+                               return 0;
+                       }
+               }
+               return (1 << $significantBits) + $this->getBits($significantBits) - 1;
+       }
+
+       public function expGolombSe() {
+               $result = $this->expGolombUe();
+               if (($result & 0x01) == 0) {
+                       return -($result >> 1);
+               } else {
+                       return ($result + 1) >> 1;
+               }
+       }
+
+       public function getWidth() {
+               return $this->width;
+       }
+
+       public function getHeight() {
+               return $this->height;
+       }
+}
diff --git a/wp-includes/ID3/module.audio-video.matroska.php b/wp-includes/ID3/module.audio-video.matroska.php
new file mode 100644 (file)
index 0000000..fb0af72
--- /dev/null
@@ -0,0 +1,1765 @@
+<?php
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org>               //
+//  available at http://getid3.sourceforge.net                 //
+//            or http://www.getid3.org                         //
+/////////////////////////////////////////////////////////////////
+// See readme.txt for more details                             //
+/////////////////////////////////////////////////////////////////
+//                                                             //
+// module.audio-video.matriska.php                             //
+// module for analyzing Matroska containers                    //
+// dependencies: NONE                                          //
+//                                                            ///
+/////////////////////////////////////////////////////////////////
+
+
+define('EBML_ID_CHAPTERS',                  0x0043A770); // [10][43][A7][70] -- A system to define basic menus and partition data. For more detailed information, look at the Chapters Explanation.
+define('EBML_ID_SEEKHEAD',                  0x014D9B74); // [11][4D][9B][74] -- Contains the position of other level 1 elements.
+define('EBML_ID_TAGS',                      0x0254C367); // [12][54][C3][67] -- Element containing elements specific to Tracks/Chapters. A list of valid tags can be found <http://www.matroska.org/technical/specs/tagging/index.html>.
+define('EBML_ID_INFO',                      0x0549A966); // [15][49][A9][66] -- Contains miscellaneous general information and statistics on the file.
+define('EBML_ID_TRACKS',                    0x0654AE6B); // [16][54][AE][6B] -- A top-level block of information with many tracks described.
+define('EBML_ID_SEGMENT',                   0x08538067); // [18][53][80][67] -- This element contains all other top-level (level 1) elements. Typically a Matroska file is composed of 1 segment.
+define('EBML_ID_ATTACHMENTS',               0x0941A469); // [19][41][A4][69] -- Contain attached files.
+define('EBML_ID_EBML',                      0x0A45DFA3); // [1A][45][DF][A3] -- Set the EBML characteristics of the data to follow. Each EBML document has to start with this.
+define('EBML_ID_CUES',                      0x0C53BB6B); // [1C][53][BB][6B] -- A top-level element to speed seeking access. All entries are local to the segment.
+define('EBML_ID_CLUSTER',                   0x0F43B675); // [1F][43][B6][75] -- The lower level element containing the (monolithic) Block structure.
+define('EBML_ID_LANGUAGE',                    0x02B59C); //     [22][B5][9C] -- Specifies the language of the track in the Matroska languages form.
+define('EBML_ID_TRACKTIMECODESCALE',          0x03314F); //     [23][31][4F] -- The scale to apply on this track to work at normal speed in relation with other tracks (mostly used to adjust video speed when the audio length differs).
+define('EBML_ID_DEFAULTDURATION',             0x03E383); //     [23][E3][83] -- Number of nanoseconds (i.e. not scaled) per frame.
+define('EBML_ID_CODECNAME',                   0x058688); //     [25][86][88] -- A human-readable string specifying the codec.
+define('EBML_ID_CODECDOWNLOADURL',            0x06B240); //     [26][B2][40] -- A URL to download about the codec used.
+define('EBML_ID_TIMECODESCALE',               0x0AD7B1); //     [2A][D7][B1] -- Timecode scale in nanoseconds (1.000.000 means all timecodes in the segment are expressed in milliseconds).
+define('EBML_ID_COLOURSPACE',                 0x0EB524); //     [2E][B5][24] -- Same value as in AVI (32 bits).
+define('EBML_ID_GAMMAVALUE',                  0x0FB523); //     [2F][B5][23] -- Gamma Value.
+define('EBML_ID_CODECSETTINGS',               0x1A9697); //     [3A][96][97] -- A string describing the encoding setting used.
+define('EBML_ID_CODECINFOURL',                0x1B4040); //     [3B][40][40] -- A URL to find information about the codec used.
+define('EBML_ID_PREVFILENAME',                0x1C83AB); //     [3C][83][AB] -- An escaped filename corresponding to the previous segment.
+define('EBML_ID_PREVUID',                     0x1CB923); //     [3C][B9][23] -- A unique ID to identify the previous chained segment (128 bits).
+define('EBML_ID_NEXTFILENAME',                0x1E83BB); //     [3E][83][BB] -- An escaped filename corresponding to the next segment.
+define('EBML_ID_NEXTUID',                     0x1EB923); //     [3E][B9][23] -- A unique ID to identify the next chained segment (128 bits).
+define('EBML_ID_CONTENTCOMPALGO',               0x0254); //         [42][54] -- The compression algorithm used. Algorithms that have been specified so far are:
+define('EBML_ID_CONTENTCOMPSETTINGS',           0x0255); //         [42][55] -- Settings that might be needed by the decompressor. For Header Stripping (ContentCompAlgo=3), the bytes that were removed from the beggining of each frames of the track.
+define('EBML_ID_DOCTYPE',                       0x0282); //         [42][82] -- A string that describes the type of document that follows this EBML header ('matroska' in our case).
+define('EBML_ID_DOCTYPEREADVERSION',            0x0285); //         [42][85] -- The minimum DocType version an interpreter has to support to read this file.
+define('EBML_ID_EBMLVERSION',                   0x0286); //         [42][86] -- The version of EBML parser used to create the file.
+define('EBML_ID_DOCTYPEVERSION',                0x0287); //         [42][87] -- The version of DocType interpreter used to create the file.
+define('EBML_ID_EBMLMAXIDLENGTH',               0x02F2); //         [42][F2] -- The maximum length of the IDs you'll find in this file (4 or less in Matroska).
+define('EBML_ID_EBMLMAXSIZELENGTH',             0x02F3); //         [42][F3] -- The maximum length of the sizes you'll find in this file (8 or less in Matroska). This does not override the element size indicated at the beginning of an element. Elements that have an indicated size which is larger than what is allowed by EBMLMaxSizeLength shall be considered invalid.
+define('EBML_ID_EBMLREADVERSION',               0x02F7); //         [42][F7] -- The minimum EBML version a parser has to support to read this file.
+define('EBML_ID_CHAPLANGUAGE',                  0x037C); //         [43][7C] -- The languages corresponding to the string, in the bibliographic ISO-639-2 form.
+define('EBML_ID_CHAPCOUNTRY',                   0x037E); //         [43][7E] -- The countries corresponding to the string, same 2 octets as in Internet domains.
+define('EBML_ID_SEGMENTFAMILY',                 0x0444); //         [44][44] -- A randomly generated unique ID that all segments related to each other must use (128 bits).
+define('EBML_ID_DATEUTC',                       0x0461); //         [44][61] -- Date of the origin of timecode (value 0), i.e. production date.
+define('EBML_ID_TAGLANGUAGE',                   0x047A); //         [44][7A] -- Specifies the language of the tag specified, in the Matroska languages form.
+define('EBML_ID_TAGDEFAULT',                    0x0484); //         [44][84] -- Indication to know if this is the default/original language to use for the given tag.
+define('EBML_ID_TAGBINARY',                     0x0485); //         [44][85] -- The values of the Tag if it is binary. Note that this cannot be used in the same SimpleTag as TagString.
+define('EBML_ID_TAGSTRING',                     0x0487); //         [44][87] -- The value of the Tag.
+define('EBML_ID_DURATION',                      0x0489); //         [44][89] -- Duration of the segment (based on TimecodeScale).
+define('EBML_ID_CHAPPROCESSPRIVATE',            0x050D); //         [45][0D] -- Some optional data attached to the ChapProcessCodecID information. For ChapProcessCodecID = 1, it is the "DVD level" equivalent.
+define('EBML_ID_CHAPTERFLAGENABLED',            0x0598); //         [45][98] -- Specify wether the chapter is enabled. It can be enabled/disabled by a Control Track. When disabled, the movie should skip all the content between the TimeStart and TimeEnd of this chapter.
+define('EBML_ID_TAGNAME',                       0x05A3); //         [45][A3] -- The name of the Tag that is going to be stored.
+define('EBML_ID_EDITIONENTRY',                  0x05B9); //         [45][B9] -- Contains all information about a segment edition.
+define('EBML_ID_EDITIONUID',                    0x05BC); //         [45][BC] -- A unique ID to identify the edition. It's useful for tagging an edition.
+define('EBML_ID_EDITIONFLAGHIDDEN',             0x05BD); //         [45][BD] -- If an edition is hidden (1), it should not be available to the user interface (but still to Control Tracks).
+define('EBML_ID_EDITIONFLAGDEFAULT',            0x05DB); //         [45][DB] -- If a flag is set (1) the edition should be used as the default one.
+define('EBML_ID_EDITIONFLAGORDERED',            0x05DD); //         [45][DD] -- Specify if the chapters can be defined multiple times and the order to play them is enforced.
+define('EBML_ID_FILEDATA',                      0x065C); //         [46][5C] -- The data of the file.
+define('EBML_ID_FILEMIMETYPE',                  0x0660); //         [46][60] -- MIME type of the file.
+define('EBML_ID_FILENAME',                      0x066E); //         [46][6E] -- Filename of the attached file.
+define('EBML_ID_FILEREFERRAL',                  0x0675); //         [46][75] -- A binary value that a track/codec can refer to when the attachment is needed.
+define('EBML_ID_FILEDESCRIPTION',               0x067E); //         [46][7E] -- A human-friendly name for the attached file.
+define('EBML_ID_FILEUID',                       0x06AE); //         [46][AE] -- Unique ID representing the file, as random as possible.
+define('EBML_ID_CONTENTENCALGO',                0x07E1); //         [47][E1] -- The encryption algorithm used. The value '0' means that the contents have not been encrypted but only signed. Predefined values:
+define('EBML_ID_CONTENTENCKEYID',               0x07E2); //         [47][E2] -- For public key algorithms this is the ID of the public key the the data was encrypted with.
+define('EBML_ID_CONTENTSIGNATURE',              0x07E3); //         [47][E3] -- A cryptographic signature of the contents.
+define('EBML_ID_CONTENTSIGKEYID',               0x07E4); //         [47][E4] -- This is the ID of the private key the data was signed with.
+define('EBML_ID_CONTENTSIGALGO',                0x07E5); //         [47][E5] -- The algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values:
+define('EBML_ID_CONTENTSIGHASHALGO',            0x07E6); //         [47][E6] -- The hash algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values:
+define('EBML_ID_MUXINGAPP',                     0x0D80); //         [4D][80] -- Muxing application or library ("libmatroska-0.4.3").
+define('EBML_ID_SEEK',                          0x0DBB); //         [4D][BB] -- Contains a single seek entry to an EBML element.
+define('EBML_ID_CONTENTENCODINGORDER',          0x1031); //         [50][31] -- Tells when this modification was used during encoding/muxing starting with 0 and counting upwards. The decoder/demuxer has to start with the highest order number it finds and work its way down. This value has to be unique over all ContentEncodingOrder elements in the segment.
+define('EBML_ID_CONTENTENCODINGSCOPE',          0x1032); //         [50][32] -- A bit field that describes which elements have been modified in this way. Values (big endian) can be OR'ed. Possible values:
+define('EBML_ID_CONTENTENCODINGTYPE',           0x1033); //         [50][33] -- A value describing what kind of transformation has been done. Possible values:
+define('EBML_ID_CONTENTCOMPRESSION',            0x1034); //         [50][34] -- Settings describing the compression used. Must be present if the value of ContentEncodingType is 0 and absent otherwise. Each block must be decompressable even if no previous block is available in order not to prevent seeking.
+define('EBML_ID_CONTENTENCRYPTION',             0x1035); //         [50][35] -- Settings describing the encryption used. Must be present if the value of ContentEncodingType is 1 and absent otherwise.
+define('EBML_ID_CUEREFNUMBER',                  0x135F); //         [53][5F] -- Number of the referenced Block of Track X in the specified Cluster.
+define('EBML_ID_NAME',                          0x136E); //         [53][6E] -- A human-readable track name.
+define('EBML_ID_CUEBLOCKNUMBER',                0x1378); //         [53][78] -- Number of the Block in the specified Cluster.
+define('EBML_ID_TRACKOFFSET',                   0x137F); //         [53][7F] -- A value to add to the Block's Timecode. This can be used to adjust the playback offset of a track.
+define('EBML_ID_SEEKID',                        0x13AB); //         [53][AB] -- The binary ID corresponding to the element name.
+define('EBML_ID_SEEKPOSITION',                  0x13AC); //         [53][AC] -- The position of the element in the segment in octets (0 = first level 1 element).
+define('EBML_ID_STEREOMODE',                    0x13B8); //         [53][B8] -- Stereo-3D video mode.
+define('EBML_ID_OLDSTEREOMODE',                 0x13B9); //         [53][B9] -- Bogus StereoMode value used in old versions of libmatroska. DO NOT USE. (0: mono, 1: right eye, 2: left eye, 3: both eyes).
+define('EBML_ID_PIXELCROPBOTTOM',               0x14AA); //         [54][AA] -- The number of video pixels to remove at the bottom of the image (for HDTV content).
+define('EBML_ID_DISPLAYWIDTH',                  0x14B0); //         [54][B0] -- Width of the video frames to display.
+define('EBML_ID_DISPLAYUNIT',                   0x14B2); //         [54][B2] -- Type of the unit for DisplayWidth/Height (0: pixels, 1: centimeters, 2: inches).
+define('EBML_ID_ASPECTRATIOTYPE',               0x14B3); //         [54][B3] -- Specify the possible modifications to the aspect ratio (0: free resizing, 1: keep aspect ratio, 2: fixed).
+define('EBML_ID_DISPLAYHEIGHT',                 0x14BA); //         [54][BA] -- Height of the video frames to display.
+define('EBML_ID_PIXELCROPTOP',                  0x14BB); //         [54][BB] -- The number of video pixels to remove at the top of the image.
+define('EBML_ID_PIXELCROPLEFT',                 0x14CC); //         [54][CC] -- The number of video pixels to remove on the left of the image.
+define('EBML_ID_PIXELCROPRIGHT',                0x14DD); //         [54][DD] -- The number of video pixels to remove on the right of the image.
+define('EBML_ID_FLAGFORCED',                    0x15AA); //         [55][AA] -- Set if that track MUST be used during playback. There can be many forced track for a kind (audio, video or subs), the player should select the one which language matches the user preference or the default + forced track. Overlay MAY happen between a forced and non-forced track of the same kind.
+define('EBML_ID_MAXBLOCKADDITIONID',            0x15EE); //         [55][EE] -- The maximum value of BlockAddID. A value 0 means there is no BlockAdditions for this track.
+define('EBML_ID_WRITINGAPP',                    0x1741); //         [57][41] -- Writing application ("mkvmerge-0.3.3").
+define('EBML_ID_CLUSTERSILENTTRACKS',           0x1854); //         [58][54] -- The list of tracks that are not used in that part of the stream. It is useful when using overlay tracks on seeking. Then you should decide what track to use.
+define('EBML_ID_CLUSTERSILENTTRACKNUMBER',      0x18D7); //         [58][D7] -- One of the track number that are not used from now on in the stream. It could change later if not specified as silent in a further Cluster.
+define('EBML_ID_ATTACHEDFILE',                  0x21A7); //         [61][A7] -- An attached file.
+define('EBML_ID_CONTENTENCODING',               0x2240); //         [62][40] -- Settings for one content encoding like compression or encryption.
+define('EBML_ID_BITDEPTH',                      0x2264); //         [62][64] -- Bits per sample, mostly used for PCM.
+define('EBML_ID_CODECPRIVATE',                  0x23A2); //         [63][A2] -- Private data only known to the codec.
+define('EBML_ID_TARGETS',                       0x23C0); //         [63][C0] -- Contain all UIDs where the specified meta data apply. It is void to describe everything in the segment.
+define('EBML_ID_CHAPTERPHYSICALEQUIV',          0x23C3); //         [63][C3] -- Specify the physical equivalent of this ChapterAtom like "DVD" (60) or "SIDE" (50), see complete list of values.
+define('EBML_ID_TAGCHAPTERUID',                 0x23C4); //         [63][C4] -- A unique ID to identify the Chapter(s) the tags belong to. If the value is 0 at this level, the tags apply to all chapters in the Segment.
+define('EBML_ID_TAGTRACKUID',                   0x23C5); //         [63][C5] -- A unique ID to identify the Track(s) the tags belong to. If the value is 0 at this level, the tags apply to all tracks in the Segment.
+define('EBML_ID_TAGATTACHMENTUID',              0x23C6); //         [63][C6] -- A unique ID to identify the Attachment(s) the tags belong to. If the value is 0 at this level, the tags apply to all the attachments in the Segment.
+define('EBML_ID_TAGEDITIONUID',                 0x23C9); //         [63][C9] -- A unique ID to identify the EditionEntry(s) the tags belong to. If the value is 0 at this level, the tags apply to all editions in the Segment.
+define('EBML_ID_TARGETTYPE',                    0x23CA); //         [63][CA] -- An informational string that can be used to display the logical level of the target like "ALBUM", "TRACK", "MOVIE", "CHAPTER", etc (see TargetType).
+define('EBML_ID_TRACKTRANSLATE',                0x2624); //         [66][24] -- The track identification for the given Chapter Codec.
+define('EBML_ID_TRACKTRANSLATETRACKID',         0x26A5); //         [66][A5] -- The binary value used to represent this track in the chapter codec data. The format depends on the ChapProcessCodecID used.
+define('EBML_ID_TRACKTRANSLATECODEC',           0x26BF); //         [66][BF] -- The chapter codec using this ID (0: Matroska Script, 1: DVD-menu).
+define('EBML_ID_TRACKTRANSLATEEDITIONUID',      0x26FC); //         [66][FC] -- Specify an edition UID on which this translation applies. When not specified, it means for all editions found in the segment.
+define('EBML_ID_SIMPLETAG',                     0x27C8); //         [67][C8] -- Contains general information about the target.
+define('EBML_ID_TARGETTYPEVALUE',               0x28CA); //         [68][CA] -- A number to indicate the logical level of the target (see TargetType).
+define('EBML_ID_CHAPPROCESSCOMMAND',            0x2911); //         [69][11] -- Contains all the commands associated to the Atom.
+define('EBML_ID_CHAPPROCESSTIME',               0x2922); //         [69][22] -- Defines when the process command should be handled (0: during the whole chapter, 1: before starting playback, 2: after playback of the chapter).
+define('EBML_ID_CHAPTERTRANSLATE',              0x2924); //         [69][24] -- A tuple of corresponding ID used by chapter codecs to represent this segment.
+define('EBML_ID_CHAPPROCESSDATA',               0x2933); //         [69][33] -- Contains the command information. The data should be interpreted depending on the ChapProcessCodecID value. For ChapProcessCodecID = 1, the data correspond to the binary DVD cell pre/post commands.
+define('EBML_ID_CHAPPROCESS',                   0x2944); //         [69][44] -- Contains all the commands associated to the Atom.
+define('EBML_ID_CHAPPROCESSCODECID',            0x2955); //         [69][55] -- Contains the type of the codec used for the processing. A value of 0 means native Matroska processing (to be defined), a value of 1 means the DVD command set is used. More codec IDs can be added later.
+define('EBML_ID_CHAPTERTRANSLATEID',            0x29A5); //         [69][A5] -- The binary value used to represent this segment in the chapter codec data. The format depends on the ChapProcessCodecID used.
+define('EBML_ID_CHAPTERTRANSLATECODEC',         0x29BF); //         [69][BF] -- The chapter codec using this ID (0: Matroska Script, 1: DVD-menu).
+define('EBML_ID_CHAPTERTRANSLATEEDITIONUID',    0x29FC); //         [69][FC] -- Specify an edition UID on which this correspondance applies. When not specified, it means for all editions found in the segment.
+define('EBML_ID_CONTENTENCODINGS',              0x2D80); //         [6D][80] -- Settings for several content encoding mechanisms like compression or encryption.
+define('EBML_ID_MINCACHE',                      0x2DE7); //         [6D][E7] -- The minimum number of frames a player should be able to cache during playback. If set to 0, the reference pseudo-cache system is not used.
+define('EBML_ID_MAXCACHE',                      0x2DF8); //         [6D][F8] -- The maximum cache size required to store referenced frames in and the current frame. 0 means no cache is needed.
+define('EBML_ID_CHAPTERSEGMENTUID',             0x2E67); //         [6E][67] -- A segment to play in place of this chapter. Edition ChapterSegmentEditionUID should be used for this segment, otherwise no edition is used.
+define('EBML_ID_CHAPTERSEGMENTEDITIONUID',      0x2EBC); //         [6E][BC] -- The edition to play from the segment linked in ChapterSegmentUID.
+define('EBML_ID_TRACKOVERLAY',                  0x2FAB); //         [6F][AB] -- Specify that this track is an overlay track for the Track specified (in the u-integer). That means when this track has a gap (see SilentTracks) the overlay track should be used instead. The order of multiple TrackOverlay matters, the first one is the one that should be used. If not found it should be the second, etc.
+define('EBML_ID_TAG',                           0x3373); //         [73][73] -- Element containing elements specific to Tracks/Chapters.
+define('EBML_ID_SEGMENTFILENAME',               0x3384); //         [73][84] -- A filename corresponding to this segment.
+define('EBML_ID_SEGMENTUID',                    0x33A4); //         [73][A4] -- A randomly generated unique ID to identify the current segment between many others (128 bits).
+define('EBML_ID_CHAPTERUID',                    0x33C4); //         [73][C4] -- A unique ID to identify the Chapter.
+define('EBML_ID_TRACKUID',                      0x33C5); //         [73][C5] -- A unique ID to identify the Track. This should be kept the same when making a direct stream copy of the Track to another file.
+define('EBML_ID_ATTACHMENTLINK',                0x3446); //         [74][46] -- The UID of an attachment that is used by this codec.
+define('EBML_ID_CLUSTERBLOCKADDITIONS',         0x35A1); //         [75][A1] -- Contain additional blocks to complete the main one. An EBML parser that has no knowledge of the Block structure could still see and use/skip these data.
+define('EBML_ID_CHANNELPOSITIONS',              0x347B); //         [7D][7B] -- Table of horizontal angles for each successive channel, see appendix.
+define('EBML_ID_OUTPUTSAMPLINGFREQUENCY',       0x38B5); //         [78][B5] -- Real output sampling frequency in Hz (used for SBR techniques).
+define('EBML_ID_TITLE',                         0x3BA9); //         [7B][A9] -- General name of the segment.
+define('EBML_ID_CHAPTERDISPLAY',                  0x00); //             [80] -- Contains all possible strings to use for the chapter display.
+define('EBML_ID_TRACKTYPE',                       0x03); //             [83] -- A set of track types coded on 8 bits (1: video, 2: audio, 3: complex, 0x10: logo, 0x11: subtitle, 0x12: buttons, 0x20: control).
+define('EBML_ID_CHAPSTRING',                      0x05); //             [85] -- Contains the string to use as the chapter atom.
+define('EBML_ID_CODECID',                         0x06); //             [86] -- An ID corresponding to the codec, see the codec page for more info.
+define('EBML_ID_FLAGDEFAULT',                     0x08); //             [88] -- Set if that track (audio, video or subs) SHOULD be used if no language found matches the user preference.
+define('EBML_ID_CHAPTERTRACKNUMBER',              0x09); //             [89] -- UID of the Track to apply this chapter too. In the absense of a control track, choosing this chapter will select the listed Tracks and deselect unlisted tracks. Absense of this element indicates that the Chapter should be applied to any currently used Tracks.
+define('EBML_ID_CLUSTERSLICES',                   0x0E); //             [8E] -- Contains slices description.
+define('EBML_ID_CHAPTERTRACK',                    0x0F); //             [8F] -- List of tracks on which the chapter applies. If this element is not present, all tracks apply
+define('EBML_ID_CHAPTERTIMESTART',                0x11); //             [91] -- Timecode of the start of Chapter (not scaled).
+define('EBML_ID_CHAPTERTIMEEND',                  0x12); //             [92] -- Timecode of the end of Chapter (timecode excluded, not scaled).
+define('EBML_ID_CUEREFTIME',                      0x16); //             [96] -- Timecode of the referenced Block.
+define('EBML_ID_CUEREFCLUSTER',                   0x17); //             [97] -- Position of the Cluster containing the referenced Block.
+define('EBML_ID_CHAPTERFLAGHIDDEN',               0x18); //             [98] -- If a chapter is hidden (1), it should not be available to the user interface (but still to Control Tracks).
+define('EBML_ID_FLAGINTERLACED',                  0x1A); //             [9A] -- Set if the video is interlaced.
+define('EBML_ID_CLUSTERBLOCKDURATION',            0x1B); //             [9B] -- The duration of the Block (based on TimecodeScale). This element is mandatory when DefaultDuration is set for the track. When not written and with no DefaultDuration, the value is assumed to be the difference between the timecode of this Block and the timecode of the next Block in "display" order (not coding order). This element can be useful at the end of a Track (as there is not other Block available), or when there is a break in a track like for subtitle tracks.
+define('EBML_ID_FLAGLACING',                      0x1C); //             [9C] -- Set if the track may contain blocks using lacing.
+define('EBML_ID_CHANNELS',                        0x1F); //             [9F] -- Numbers of channels in the track.
+define('EBML_ID_CLUSTERBLOCKGROUP',               0x20); //             [A0] -- Basic container of information containing a single Block or BlockVirtual, and information specific to that Block/VirtualBlock.
+define('EBML_ID_CLUSTERBLOCK',                    0x21); //             [A1] -- Block containing the actual data to be rendered and a timecode relative to the Cluster Timecode.
+define('EBML_ID_CLUSTERBLOCKVIRTUAL',             0x22); //             [A2] -- A Block with no data. It must be stored in the stream at the place the real Block should be in display order.
+define('EBML_ID_CLUSTERSIMPLEBLOCK',              0x23); //             [A3] -- Similar to Block but without all the extra information, mostly used to reduced overhead when no extra feature is needed.
+define('EBML_ID_CLUSTERCODECSTATE',               0x24); //             [A4] -- The new codec state to use. Data interpretation is private to the codec. This information should always be referenced by a seek entry.
+define('EBML_ID_CLUSTERBLOCKADDITIONAL',          0x25); //             [A5] -- Interpreted by the codec as it wishes (using the BlockAddID).
+define('EBML_ID_CLUSTERBLOCKMORE',                0x26); //             [A6] -- Contain the BlockAdditional and some parameters.
+define('EBML_ID_CLUSTERPOSITION',                 0x27); //             [A7] -- Position of the Cluster in the segment (0 in live broadcast streams). It might help to resynchronise offset on damaged streams.
+define('EBML_ID_CODECDECODEALL',                  0x2A); //             [AA] -- The codec can decode potentially damaged data.
+define('EBML_ID_CLUSTERPREVSIZE',                 0x2B); //             [AB] -- Size of the previous Cluster, in octets. Can be useful for backward playing.
+define('EBML_ID_TRACKENTRY',                      0x2E); //             [AE] -- Describes a track with all elements.
+define('EBML_ID_CLUSTERENCRYPTEDBLOCK',           0x2F); //             [AF] -- Similar to SimpleBlock but the data inside the Block are Transformed (encrypt and/or signed).
+define('EBML_ID_PIXELWIDTH',                      0x30); //             [B0] -- Width of the encoded video frames in pixels.
+define('EBML_ID_CUETIME',                         0x33); //             [B3] -- Absolute timecode according to the segment time base.
+define('EBML_ID_SAMPLINGFREQUENCY',               0x35); //             [B5] -- Sampling frequency in Hz.
+define('EBML_ID_CHAPTERATOM',                     0x36); //             [B6] -- Contains the atom information to use as the chapter atom (apply to all tracks).
+define('EBML_ID_CUETRACKPOSITIONS',               0x37); //             [B7] -- Contain positions for different tracks corresponding to the timecode.
+define('EBML_ID_FLAGENABLED',                     0x39); //             [B9] -- Set if the track is used.
+define('EBML_ID_PIXELHEIGHT',                     0x3A); //             [BA] -- Height of the encoded video frames in pixels.
+define('EBML_ID_CUEPOINT',                        0x3B); //             [BB] -- Contains all information relative to a seek point in the segment.
+define('EBML_ID_CRC32',                           0x3F); //             [BF] -- The CRC is computed on all the data of the Master element it's in, regardless of its position. It's recommended to put the CRC value at the beggining of the Master element for easier reading. All level 1 elements should include a CRC-32.
+define('EBML_ID_CLUSTERBLOCKADDITIONID',          0x4B); //             [CB] -- The ID of the BlockAdditional element (0 is the main Block).
+define('EBML_ID_CLUSTERLACENUMBER',               0x4C); //             [CC] -- The reverse number of the frame in the lace (0 is the last frame, 1 is the next to last, etc). While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback.
+define('EBML_ID_CLUSTERFRAMENUMBER',              0x4D); //             [CD] -- The number of the frame to generate from this lace with this delay (allow you to generate many frames from the same Block/Frame).
+define('EBML_ID_CLUSTERDELAY',                    0x4E); //             [CE] -- The (scaled) delay to apply to the element.
+define('EBML_ID_CLUSTERDURATION',                 0x4F); //             [CF] -- The (scaled) duration to apply to the element.
+define('EBML_ID_TRACKNUMBER',                     0x57); //             [D7] -- The track number as used in the Block Header (using more than 127 tracks is not encouraged, though the design allows an unlimited number).
+define('EBML_ID_CUEREFERENCE',                    0x5B); //             [DB] -- The Clusters containing the required referenced Blocks.
+define('EBML_ID_VIDEO',                           0x60); //             [E0] -- Video settings.
+define('EBML_ID_AUDIO',                           0x61); //             [E1] -- Audio settings.
+define('EBML_ID_CLUSTERTIMESLICE',                0x68); //             [E8] -- Contains extra time information about the data contained in the Block. While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback.
+define('EBML_ID_CUECODECSTATE',                   0x6A); //             [EA] -- The position of the Codec State corresponding to this Cue element. 0 means that the data is taken from the initial Track Entry.
+define('EBML_ID_CUEREFCODECSTATE',                0x6B); //             [EB] -- The position of the Codec State corresponding to this referenced element. 0 means that the data is taken from the initial Track Entry.
+define('EBML_ID_VOID',                            0x6C); //             [EC] -- Used to void damaged data, to avoid unexpected behaviors when using damaged data. The content is discarded. Also used to reserve space in a sub-element for later use.
+define('EBML_ID_CLUSTERTIMECODE',                 0x67); //             [E7] -- Absolute timecode of the cluster (based on TimecodeScale).
+define('EBML_ID_CLUSTERBLOCKADDID',               0x6E); //             [EE] -- An ID to identify the BlockAdditional level.
+define('EBML_ID_CUECLUSTERPOSITION',              0x71); //             [F1] -- The position of the Cluster containing the required Block.
+define('EBML_ID_CUETRACK',                        0x77); //             [F7] -- The track for which a position is given.
+define('EBML_ID_CLUSTERREFERENCEPRIORITY',        0x7A); //             [FA] -- This frame is referenced and has the specified cache priority. In cache only a frame of the same or higher priority can replace this frame. A value of 0 means the frame is not referenced.
+define('EBML_ID_CLUSTERREFERENCEBLOCK',           0x7B); //             [FB] -- Timecode of another frame used as a reference (ie: B or P frame). The timecode is relative to the block it's attached to.
+define('EBML_ID_CLUSTERREFERENCEVIRTUAL',         0x7D); //             [FD] -- Relative position of the data that should be in position of the virtual block.
+
+
+/**
+* @tutorial http://www.matroska.org/technical/specs/index.html
+*
+* @todo Rewrite EBML parser to reduce it's size and honor default element values
+* @todo After rewrite implement stream size calculation, that will provide additional useful info and enable AAC/FLAC audio bitrate detection
+*/
+class getid3_matroska extends getid3_handler
+{
+       // public options
+       public static $hide_clusters    = true;  // if true, do not return information about CLUSTER chunks, since there's a lot of them and they're not usually useful [default: TRUE]
+       public static $parse_whole_file = false; // true to parse the whole file, not only header [default: FALSE]
+
+       // private parser settings/placeholders
+       private $EBMLbuffer        = '';
+       private $EBMLbuffer_offset = 0;
+       private $EBMLbuffer_length = 0;
+       private $current_offset    = 0;
+       private $unuseful_elements = array(EBML_ID_CRC32, EBML_ID_VOID);
+
+       public function Analyze()
+       {
+               $info = &$this->getid3->info;
+
+               // parse container
+               try {
+                       $this->parseEBML($info);
+               } catch (Exception $e) {
+                       $info['error'][] = 'EBML parser: '.$e->getMessage();
+               }
+
+               // calculate playtime
+               if (isset($info['matroska']['info']) && is_array($info['matroska']['info'])) {
+                       foreach ($info['matroska']['info'] as $key => $infoarray) {
+                               if (isset($infoarray['Duration'])) {
+                                       // TimecodeScale is how many nanoseconds each Duration unit is
+                                       $info['playtime_seconds'] = $infoarray['Duration'] * ((isset($infoarray['TimecodeScale']) ? $infoarray['TimecodeScale'] : 1000000) / 1000000000);
+                                       break;
+                               }
+                       }
+               }
+
+               // extract tags
+               if (isset($info['matroska']['tags']) && is_array($info['matroska']['tags'])) {
+                       foreach ($info['matroska']['tags'] as $key => $infoarray) {
+                               $this->ExtractCommentsSimpleTag($infoarray);
+                       }
+               }
+
+               // process tracks
+               if (isset($info['matroska']['tracks']['tracks']) && is_array($info['matroska']['tracks']['tracks'])) {
+                       foreach ($info['matroska']['tracks']['tracks'] as $key => $trackarray) {
+
+                               $track_info = array();
+                               $track_info['dataformat'] = self::CodecIDtoCommonName($trackarray['CodecID']);
+                               $track_info['default'] = (isset($trackarray['FlagDefault']) ? $trackarray['FlagDefault'] : true);
+                               if (isset($trackarray['Name'])) { $track_info['name'] = $trackarray['Name']; }
+
+                               switch ($trackarray['TrackType']) {
+
+                                       case 1: // Video
+                                               $track_info['resolution_x'] = $trackarray['PixelWidth'];
+                                               $track_info['resolution_y'] = $trackarray['PixelHeight'];
+                                               $track_info['display_unit'] = self::displayUnit(isset($trackarray['DisplayUnit']) ? $trackarray['DisplayUnit'] : 0);
+                                               $track_info['display_x']    = (isset($trackarray['DisplayWidth']) ? $trackarray['DisplayWidth'] : $trackarray['PixelWidth']);
+                                               $track_info['display_y']    = (isset($trackarray['DisplayHeight']) ? $trackarray['DisplayHeight'] : $trackarray['PixelHeight']);
+
+                                               if (isset($trackarray['PixelCropBottom'])) { $track_info['crop_bottom'] = $trackarray['PixelCropBottom']; }
+                                               if (isset($trackarray['PixelCropTop']))    { $track_info['crop_top']    = $trackarray['PixelCropTop']; }
+                                               if (isset($trackarray['PixelCropLeft']))   { $track_info['crop_left']   = $trackarray['PixelCropLeft']; }
+                                               if (isset($trackarray['PixelCropRight']))  { $track_info['crop_right']  = $trackarray['PixelCropRight']; }
+                                               if (isset($trackarray['DefaultDuration'])) { $track_info['frame_rate']  = round(1000000000 / $trackarray['DefaultDuration'], 3); }
+                                               if (isset($trackarray['CodecName']))       { $track_info['codec']       = $trackarray['CodecName']; }
+
+                                               switch ($trackarray['CodecID']) {
+                                                       case 'V_MS/VFW/FOURCC':
+                                                               if (!getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, false)) {
+                                                                       $this->warning('Unable to parse codec private data ['.basename(__FILE__).':'.__LINE__.'] because cannot include "module.audio-video.riff.php"');
+                                                                       break;
+                                                               }
+                                                               $parsed = getid3_riff::ParseBITMAPINFOHEADER($trackarray['CodecPrivate']);
+                                                               $track_info['codec'] = getid3_riff::fourccLookup($parsed['fourcc']);
+                                                               $info['matroska']['track_codec_parsed'][$trackarray['TrackNumber']] = $parsed;
+                                                               break;
+
+                                                       /*case 'V_MPEG4/ISO/AVC':
+                                                               $h264['profile']    = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], 1, 1));
+                                                               $h264['level']      = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], 3, 1));
+                                                               $rn                 = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], 4, 1));
+                                                               $h264['NALUlength'] = ($rn & 3) + 1;
+                                                               $rn                 = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], 5, 1));
+                                                               $nsps               = ($rn & 31);
+                                                               $offset             = 6;
+                                                               for ($i = 0; $i < $nsps; $i ++) {
+                                                                       $length        = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], $offset, 2));
+                                                                       $h264['SPS'][] = substr($trackarray['CodecPrivate'], $offset + 2, $length);
+                                                                       $offset       += 2 + $length;
+                                                               }
+                                                               $npps               = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], $offset, 1));
+                                                               $offset            += 1;
+                                                               for ($i = 0; $i < $npps; $i ++) {
+                                                                       $length        = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], $offset, 2));
+                                                                       $h264['PPS'][] = substr($trackarray['CodecPrivate'], $offset + 2, $length);
+                                                                       $offset       += 2 + $length;
+                                                               }
+                                                               $info['matroska']['track_codec_parsed'][$trackarray['TrackNumber']] = $h264;
+                                                               break;*/
+                                               }
+
+                                               $info['video']['streams'][] = $track_info;
+                                               break;
+
+                                       case 2: // Audio
+                                               $track_info['sample_rate'] = (isset($trackarray['SamplingFrequency']) ? $trackarray['SamplingFrequency'] : 8000.0);
+                                               $track_info['channels']    = (isset($trackarray['Channels']) ? $trackarray['Channels'] : 1);
+                                               $track_info['language']    = (isset($trackarray['Language']) ? $trackarray['Language'] : 'eng');
+                                               if (isset($trackarray['BitDepth']))  { $track_info['bits_per_sample'] = $trackarray['BitDepth']; }
+                                               if (isset($trackarray['CodecName'])) { $track_info['codec']           = $trackarray['CodecName']; }
+
+                                               switch ($trackarray['CodecID']) {
+                                                       case 'A_PCM/INT/LIT':
+                                                       case 'A_PCM/INT/BIG':
+                                                               $track_info['bitrate'] = $trackarray['SamplingFrequency'] * $trackarray['Channels'] * $trackarray['BitDepth'];
+                                                               break;
+
+                                                       case 'A_AC3':
+                                                       case 'A_DTS':
+                                                       case 'A_MPEG/L3':
+                                                       case 'A_MPEG/L2':
+                                                       case 'A_FLAC':
+                                                               if (!getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.'.($track_info['dataformat'] == 'mp2' ? 'mp3' : $track_info['dataformat']).'.php', __FILE__, false)) {
+                                                                       $this->warning('Unable to parse audio data ['.basename(__FILE__).':'.__LINE__.'] because cannot include "module.audio.'.$track_info['dataformat'].'.php"');
+                                                                       break;
+                                                               }
+
+                                                               if (!isset($info['matroska']['track_data_offsets'][$trackarray['TrackNumber']])) {
+                                                                       $this->warning('Unable to parse audio data ['.basename(__FILE__).':'.__LINE__.'] because $info[matroska][track_data_offsets]['.$trackarray['TrackNumber'].'] not set');
+                                                                       break;
+                                                               }
+
+                                                               // create temp instance
+                                                               $getid3_temp = new getID3();
+                                                               if ($track_info['dataformat'] != 'flac') {
+                                                                       $getid3_temp->openfile($this->getid3->filename);
+                                                               }
+                                                               $getid3_temp->info['avdataoffset'] = $info['matroska']['track_data_offsets'][$trackarray['TrackNumber']]['offset'];
+                                                               if ($track_info['dataformat'][0] == 'm' || $track_info['dataformat'] == 'flac') {
+                                                                       $getid3_temp->info['avdataend'] = $info['matroska']['track_data_offsets'][$trackarray['TrackNumber']]['offset'] + $info['matroska']['track_data_offsets'][$trackarray['TrackNumber']]['length'];
+                                                               }
+
+                                                               // analyze
+                                                               $class = 'getid3_'.($track_info['dataformat'] == 'mp2' ? 'mp3' : $track_info['dataformat']);
+                                                               $header_data_key = $track_info['dataformat'][0] == 'm' ? 'mpeg' : $track_info['dataformat'];
+                                                               $getid3_audio = new $class($getid3_temp, __CLASS__);
+                                                               if ($track_info['dataformat'] == 'flac') {
+                                                                       $getid3_audio->AnalyzeString($trackarray['CodecPrivate']);
+                                                               }
+                                                               else {
+                                                                       $getid3_audio->Analyze();
+                                                               }
+                                                               if (!empty($getid3_temp->info[$header_data_key])) {
+                                                                       $info['matroska']['track_codec_parsed'][$trackarray['TrackNumber']] = $getid3_temp->info[$header_data_key];
+                                                                       if (isset($getid3_temp->info['audio']) && is_array($getid3_temp->info['audio'])) {
+                                                                               foreach ($getid3_temp->info['audio'] as $key => $value) {
+                                                                                       $track_info[$key] = $value;
+                                                                               }
+                                                                       }
+                                                               }
+                                                               else {
+                                                                       $this->warning('Unable to parse audio data ['.basename(__FILE__).':'.__LINE__.'] because '.$class.'::Analyze() failed at offset '.$getid3_temp->info['avdataoffset']);
+                                                               }
+
+                                                               // copy errors and warnings
+                                                               if (!empty($getid3_temp->info['error'])) {
+                                                                       foreach ($getid3_temp->info['error'] as $newerror) {
+                                                                               $this->warning($class.'() says: ['.$newerror.']');
+                                                                       }
+                                                               }
+                                                               if (!empty($getid3_temp->info['warning'])) {
+                                                                       foreach ($getid3_temp->info['warning'] as $newerror) {
+                                                                               if ($track_info['dataformat'] == 'mp3' && preg_match('/^Probable truncated file: expecting \d+ bytes of audio data, only found \d+ \(short by \d+ bytes\)$/', $newerror)) {
+                                                                                       // LAME/Xing header is probably set, but audio data is chunked into Matroska file and near-impossible to verify if audio stream is complete, so ignore useless warning
+                                                                                       continue;
+                                                                               }
+                                                                               $this->warning($class.'() says: ['.$newerror.']');
+                                                                       }
+                                                               }
+                                                               unset($getid3_temp, $getid3_audio);
+                                                               break;
+
+                                                       case 'A_AAC':
+                                                       case 'A_AAC/MPEG2/LC':
+                                                       case 'A_AAC/MPEG2/LC/SBR':
+                                                       case 'A_AAC/MPEG4/LC':
+                                                       case 'A_AAC/MPEG4/LC/SBR':
+                                                           $this->warning($trackarray['CodecID'].' audio data contains no header, audio/video bitrates can\'t be calculated');
+                                                               break;
+
+                                                       case 'A_VORBIS':
+                                                               if (!isset($trackarray['CodecPrivate'])) {
+                                                                       $this->warning('Unable to parse audio data ['.basename(__FILE__).':'.__LINE__.'] because CodecPrivate data not set');
+                                                                       break;
+                                                               }
+                                                               $vorbis_offset = strpos($trackarray['CodecPrivate'], 'vorbis', 1);
+                                                               if ($vorbis_offset === false) {
+                                                                       $this->warning('Unable to parse audio data ['.basename(__FILE__).':'.__LINE__.'] because CodecPrivate data does not contain "vorbis" keyword');
+                                                                       break;
+                                                               }
+                                                               $vorbis_offset -= 1;
+
+                                                               if (!getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ogg.php', __FILE__, false)) {
+                                                                       $this->warning('Unable to parse audio data ['.basename(__FILE__).':'.__LINE__.'] because cannot include "module.audio.ogg.php"');
+                                                                       break;
+                                                               }
+
+                                                               // create temp instance
+                                                               $getid3_temp = new getID3();
+
+                                                               // analyze
+                                                               $getid3_ogg = new getid3_ogg($getid3_temp);
+                                                               $oggpageinfo['page_seqno'] = 0;
+                                                               $getid3_ogg->ParseVorbisPageHeader($trackarray['CodecPrivate'], $vorbis_offset, $oggpageinfo);
+                                                               if (!empty($getid3_temp->info['ogg'])) {
+                                                                       $info['matroska']['track_codec_parsed'][$trackarray['TrackNumber']] = $getid3_temp->info['ogg'];
+                                                                       if (isset($getid3_temp->info['audio']) && is_array($getid3_temp->info['audio'])) {
+                                                                               foreach ($getid3_temp->info['audio'] as $key => $value) {
+                                                                                       $track_info[$key] = $value;
+                                                                               }
+                                                                       }
+                                                               }
+
+                                                               // copy errors and warnings
+                                                               if (!empty($getid3_temp->info['error'])) {
+                                                                       foreach ($getid3_temp->info['error'] as $newerror) {
+                                                                               $this->warning('getid3_ogg() says: ['.$newerror.']');
+                                                                       }
+                                                               }
+                                                               if (!empty($getid3_temp->info['warning'])) {
+                                                                       foreach ($getid3_temp->info['warning'] as $newerror) {
+                                                                               $this->warning('getid3_ogg() says: ['.$newerror.']');
+                                                                       }
+                                                               }
+
+                                                               if (!empty($getid3_temp->info['ogg']['bitrate_nominal'])) {
+                                                                       $track_info['bitrate'] = $getid3_temp->info['ogg']['bitrate_nominal'];
+                                                               }
+                                                               unset($getid3_temp, $getid3_ogg, $oggpageinfo, $vorbis_offset);
+                                                               break;
+
+                                                       case 'A_MS/ACM':
+                                                               if (!getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, false)) {
+                                                                       $this->warning('Unable to parse audio data ['.basename(__FILE__).':'.__LINE__.'] because cannot include "module.audio-video.riff.php"');
+                                                                       break;
+                                                               }
+
+                                                               $parsed = getid3_riff::parseWAVEFORMATex($trackarray['CodecPrivate']);
+                                                               foreach ($parsed as $key => $value) {
+                                                                       if ($key != 'raw') {
+                                                                               $track_info[$key] = $value;
+                                                                       }
+                                                               }
+                                                               $info['matroska']['track_codec_parsed'][$trackarray['TrackNumber']] = $parsed;
+                                                               break;
+
+                                                       default:
+                                                               $this->warning('Unhandled audio type "'.(isset($trackarray['CodecID']) ? $trackarray['CodecID'] : '').'"');
+                                               }
+
+                                               $info['audio']['streams'][] = $track_info;
+                                               break;
+                               }
+                       }
+
+                       if (!empty($info['video']['streams'])) {
+                               $info['video'] = self::getDefaultStreamInfo($info['video']['streams']);
+                       }
+                       if (!empty($info['audio']['streams'])) {
+                               $info['audio'] = self::getDefaultStreamInfo($info['audio']['streams']);
+                       }
+               }
+
+               // process attachments
+               if (isset($info['matroska']['attachments']) && $this->getid3->option_save_attachments !== getID3::ATTACHMENTS_NONE) {
+                       foreach ($info['matroska']['attachments'] as $i => $entry) {
+                               if (strpos($entry['FileMimeType'], 'image/') === 0 && !empty($entry['FileData'])) {
+                                       $info['matroska']['comments']['picture'][] = array('data' => $entry['FileData'], 'image_mime' => $entry['FileMimeType'], 'filename' => $entry['FileName']);
+                               }
+                       }
+               }
+
+               // determine mime type
+               if (!empty($info['video']['streams'])) {
+                       $info['mime_type'] = ($info['matroska']['doctype'] == 'webm' ? 'video/webm' : 'video/x-matroska');
+               } elseif (!empty($info['audio']['streams'])) {
+                       $info['mime_type'] = ($info['matroska']['doctype'] == 'webm' ? 'audio/webm' : 'audio/x-matroska');
+               } elseif (isset($info['mime_type'])) {
+                       unset($info['mime_type']);
+               }
+
+               return true;
+       }
+
+       private function parseEBML(&$info) {
+               // http://www.matroska.org/technical/specs/index.html#EBMLBasics
+               $this->current_offset = $info['avdataoffset'];
+
+               while ($this->getEBMLelement($top_element, $info['avdataend'])) {
+                       switch ($top_element['id']) {
+
+                               case EBML_ID_EBML:
+                                       $info['fileformat'] = 'matroska';
+                                       $info['matroska']['header']['offset'] = $top_element['offset'];
+                                       $info['matroska']['header']['length'] = $top_element['length'];
+
+                                       while ($this->getEBMLelement($element_data, $top_element['end'], true)) {
+                                               switch ($element_data['id']) {
+
+                                                       case EBML_ID_EBMLVERSION:
+                                                       case EBML_ID_EBMLREADVERSION:
+                                                       case EBML_ID_EBMLMAXIDLENGTH:
+                                                       case EBML_ID_EBMLMAXSIZELENGTH:
+                                                       case EBML_ID_DOCTYPEVERSION:
+                                                       case EBML_ID_DOCTYPEREADVERSION:
+                                                               $element_data['data'] = getid3_lib::BigEndian2Int($element_data['data']);
+                                                               break;
+
+                                                       case EBML_ID_DOCTYPE:
+                                                               $element_data['data'] = getid3_lib::trimNullByte($element_data['data']);
+                                                               $info['matroska']['doctype'] = $element_data['data'];
+                                                               break;
+
+                                                       default:
+                                                               $this->unhandledElement('header', __LINE__, $element_data);
+                                               }
+
+                                               unset($element_data['offset'], $element_data['end']);
+                                               $info['matroska']['header']['elements'][] = $element_data;
+                                       }
+                                       break;
+
+                               case EBML_ID_SEGMENT:
+                                       $info['matroska']['segment'][0]['offset'] = $top_element['offset'];
+                                       $info['matroska']['segment'][0]['length'] = $top_element['length'];
+
+                                       while ($this->getEBMLelement($element_data, $top_element['end'])) {
+                                               if ($element_data['id'] != EBML_ID_CLUSTER || !self::$hide_clusters) { // collect clusters only if required
+                                                       $info['matroska']['segments'][] = $element_data;
+                                               }
+                                               switch ($element_data['id']) {
+
+                                                       case EBML_ID_SEEKHEAD: // Contains the position of other level 1 elements.
+
+                                                               while ($this->getEBMLelement($seek_entry, $element_data['end'])) {
+                                                                       switch ($seek_entry['id']) {
+
+                                                                               case EBML_ID_SEEK: // Contains a single seek entry to an EBML element
+                                                                                       while ($this->getEBMLelement($sub_seek_entry, $seek_entry['end'], true)) {
+
+                                                                                               switch ($sub_seek_entry['id']) {
+
+                                                                                                       case EBML_ID_SEEKID:
+                                                                                                               $seek_entry['target_id']   = self::EBML2Int($sub_seek_entry['data']);
+                                                                                                               $seek_entry['target_name'] = self::EBMLidName($seek_entry['target_id']);
+                                                                                                               break;
+
+                                                                                                       case EBML_ID_SEEKPOSITION:
+                                                                                                               $seek_entry['target_offset'] = $element_data['offset'] + getid3_lib::BigEndian2Int($sub_seek_entry['data']);
+                                                                                                               break;
+
+                                                                                                       default:
+                                                                                                               $this->unhandledElement('seekhead.seek', __LINE__, $sub_seek_entry);                                                                                            }
+                                                                                       }
+
+                                                                                       if ($seek_entry['target_id'] != EBML_ID_CLUSTER || !self::$hide_clusters) { // collect clusters only if required
+                                                                                               $info['matroska']['seek'][] = $seek_entry;
+                                                                                       }
+                                                                                       break;
+
+                                                                               default:
+                                                                                       $this->unhandledElement('seekhead', __LINE__, $seek_entry);
+                                                                       }
+                                                               }
+                                                               break;
+
+                                                       case EBML_ID_TRACKS: // A top-level block of information with many tracks described.
+                                                               $info['matroska']['tracks'] = $element_data;
+
+                                                               while ($this->getEBMLelement($track_entry, $element_data['end'])) {
+                                                                       switch ($track_entry['id']) {
+
+                                                                               case EBML_ID_TRACKENTRY: //subelements: Describes a track with all elements.
+
+                                                                                       while ($this->getEBMLelement($subelement, $track_entry['end'], array(EBML_ID_VIDEO, EBML_ID_AUDIO, EBML_ID_CONTENTENCODINGS, EBML_ID_CODECPRIVATE))) {
+                                                                                               switch ($subelement['id']) {
+
+                                                                                                       case EBML_ID_TRACKNUMBER:
+                                                                                                       case EBML_ID_TRACKUID:
+                                                                                                       case EBML_ID_TRACKTYPE:
+                                                                                                       case EBML_ID_MINCACHE:
+                                                                                                       case EBML_ID_MAXCACHE:
+                                                                                                       case EBML_ID_MAXBLOCKADDITIONID:
+                                                                                                       case EBML_ID_DEFAULTDURATION: // nanoseconds per frame
+                                                                                                               $track_entry[$subelement['id_name']] = getid3_lib::BigEndian2Int($subelement['data']);
+                                                                                                               break;
+
+                                                                                                       case EBML_ID_TRACKTIMECODESCALE:
+                                                                                                               $track_entry[$subelement['id_name']] = getid3_lib::BigEndian2Float($subelement['data']);
+                                                                                                               break;
+
+                                                                                                       case EBML_ID_CODECID:
+                                                                                                       case EBML_ID_LANGUAGE:
+                                                                                                       case EBML_ID_NAME:
+                                                                                                       case EBML_ID_CODECNAME:
+                                                                                                               $track_entry[$subelement['id_name']] = getid3_lib::trimNullByte($subelement['data']);
+                                                                                                               break;
+
+                                                                                                       case EBML_ID_CODECPRIVATE:
+                                                                                                               $track_entry[$subelement['id_name']] = $this->readEBMLelementData($subelement['length'], true);
+                                                                                                               break;
+
+                                                                                                       case EBML_ID_FLAGENABLED:
+                                                                                                       case EBML_ID_FLAGDEFAULT:
+                                                                                                       case EBML_ID_FLAGFORCED:
+                                                                                                       case EBML_ID_FLAGLACING:
+                                                                                                       case EBML_ID_CODECDECODEALL:
+                                                                                                               $track_entry[$subelement['id_name']] = (bool) getid3_lib::BigEndian2Int($subelement['data']);
+                                                                                                               break;
+
+                                                                                                       case EBML_ID_VIDEO:
+
+                                                                                                               while ($this->getEBMLelement($sub_subelement, $subelement['end'], true)) {
+                                                                                                                       switch ($sub_subelement['id']) {
+
+                                                                                                                               case EBML_ID_PIXELWIDTH:
+                                                                                                                               case EBML_ID_PIXELHEIGHT:
+                                                                                                                               case EBML_ID_PIXELCROPBOTTOM:
+                                                                                                                               case EBML_ID_PIXELCROPTOP:
+                                                                                                                               case EBML_ID_PIXELCROPLEFT:
+                                                                                                                               case EBML_ID_PIXELCROPRIGHT:
+                                                                                                                               case EBML_ID_DISPLAYWIDTH:
+                                                                                                                               case EBML_ID_DISPLAYHEIGHT:
+                                                                                                                               case EBML_ID_DISPLAYUNIT:
+                                                                                                                               case EBML_ID_ASPECTRATIOTYPE:
+                                                                                                                               case EBML_ID_STEREOMODE:
+                                                                                                                               case EBML_ID_OLDSTEREOMODE:
+                                                                                                                                       $track_entry[$sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_subelement['data']);
+                                                                                                                                       break;
+
+                                                                                                                               case EBML_ID_FLAGINTERLACED:
+                                                                                                                                       $track_entry[$sub_subelement['id_name']] = (bool)getid3_lib::BigEndian2Int($sub_subelement['data']);
+                                                                                                                                       break;
+
+                                                                                                                               case EBML_ID_GAMMAVALUE:
+                                                                                                                                       $track_entry[$sub_subelement['id_name']] = getid3_lib::BigEndian2Float($sub_subelement['data']);
+                                                                                                                                       break;
+
+                                                                                                                               case EBML_ID_COLOURSPACE:
+                                                                                                                                       $track_entry[$sub_subelement['id_name']] = getid3_lib::trimNullByte($sub_subelement['data']);
+                                                                                                                                       break;
+
+                                                                                                                               default:
+                                                                                                                                       $this->unhandledElement('track.video', __LINE__, $sub_subelement);
+                                                                                                                       }
+                                                                                                               }
+                                                                                                               break;
+
+                                                                                                       case EBML_ID_AUDIO:
+
+                                                                                                               while ($this->getEBMLelement($sub_subelement, $subelement['end'], true)) {
+                                                                                                                       switch ($sub_subelement['id']) {
+
+                                                                                                                               case EBML_ID_CHANNELS:
+                                                                                                                               case EBML_ID_BITDEPTH:
+                                                                                                                                       $track_entry[$sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_subelement['data']);
+                                                                                                                                       break;
+
+                                                                                                                               case EBML_ID_SAMPLINGFREQUENCY:
+                                                                                                                               case EBML_ID_OUTPUTSAMPLINGFREQUENCY:
+                                                                                                                                       $track_entry[$sub_subelement['id_name']] = getid3_lib::BigEndian2Float($sub_subelement['data']);
+                                                                                                                                       break;
+
+                                                                                                                               case EBML_ID_CHANNELPOSITIONS:
+                                                                                                                                       $track_entry[$sub_subelement['id_name']] = getid3_lib::trimNullByte($sub_subelement['data']);
+                                                                                                                                       break;
+
+                                                                                                                               default:
+                                                                                                                                       $this->unhandledElement('track.audio', __LINE__, $sub_subelement);
+                                                                                                                       }
+                                                                                                               }
+                                                                                                               break;
+
+                                                                                                       case EBML_ID_CONTENTENCODINGS:
+
+                                                                                                               while ($this->getEBMLelement($sub_subelement, $subelement['end'])) {
+                                                                                                                       switch ($sub_subelement['id']) {
+
+                                                                                                                               case EBML_ID_CONTENTENCODING:
+
+                                                                                                                                       while ($this->getEBMLelement($sub_sub_subelement, $sub_subelement['end'], array(EBML_ID_CONTENTCOMPRESSION, EBML_ID_CONTENTENCRYPTION))) {
+                                                                                                                                               switch ($sub_sub_subelement['id']) {
+
+                                                                                                                                                       case EBML_ID_CONTENTENCODINGORDER:
+                                                                                                                                                       case EBML_ID_CONTENTENCODINGSCOPE:
+                                                                                                                                                       case EBML_ID_CONTENTENCODINGTYPE:
+                                                                                                                                                               $track_entry[$sub_subelement['id_name']][$sub_sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_sub_subelement['data']);
+                                                                                                                                                               break;
+
+                                                                                                                                                       case EBML_ID_CONTENTCOMPRESSION:
+
+                                                                                                                                                               while ($this->getEBMLelement($sub_sub_sub_subelement, $sub_sub_subelement['end'], true)) {
+                                                                                                                                                                       switch ($sub_sub_sub_subelement['id']) {
+
+                                                                                                                                                                               case EBML_ID_CONTENTCOMPALGO:
+                                                                                                                                                                                       $track_entry[$sub_subelement['id_name']][$sub_sub_subelement['id_name']][$sub_sub_sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_sub_sub_subelement['data']);
+                                                                                                                                                                                       break;
+
+                                                                                                                                                                               case EBML_ID_CONTENTCOMPSETTINGS:
+                                                                                                                                                                                       $track_entry[$sub_subelement['id_name']][$sub_sub_subelement['id_name']][$sub_sub_sub_subelement['id_name']] = $sub_sub_sub_subelement['data'];
+                                                                                                                                                                                       break;
+
+                                                                                                                                                                               default:
+                                                                                                                                                                                       $this->unhandledElement('track.contentencodings.contentencoding.contentcompression', __LINE__, $sub_sub_sub_subelement);
+                                                                                                                                                                       }
+                                                                                                                                                               }
+                                                                                                                                                               break;
+
+                                                                                                                                                       case EBML_ID_CONTENTENCRYPTION:
+
+                                                                                                                                                               while ($this->getEBMLelement($sub_sub_sub_subelement, $sub_sub_subelement['end'], true)) {
+                                                                                                                                                                       switch ($sub_sub_sub_subelement['id']) {
+
+                                                                                                                                                                               case EBML_ID_CONTENTENCALGO:
+                                                                                                                                                                               case EBML_ID_CONTENTSIGALGO:
+                                                                                                                                                                               case EBML_ID_CONTENTSIGHASHALGO:
+                                                                                                                                                                                       $track_entry[$sub_subelement['id_name']][$sub_sub_subelement['id_name']][$sub_sub_sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_sub_sub_subelement['data']);
+                                                                                                                                                                                       break;
+
+                                                                                                                                                                               case EBML_ID_CONTENTENCKEYID:
+                                                                                                                                                                               case EBML_ID_CONTENTSIGNATURE:
+                                                                                                                                                                               case EBML_ID_CONTENTSIGKEYID:
+                                                                                                                                                                                       $track_entry[$sub_subelement['id_name']][$sub_sub_subelement['id_name']][$sub_sub_sub_subelement['id_name']] = $sub_sub_sub_subelement['data'];
+                                                                                                                                                                                       break;
+
+                                                                                                                                                                               default:
+                                                                                                                                                                                       $this->unhandledElement('track.contentencodings.contentencoding.contentcompression', __LINE__, $sub_sub_sub_subelement);
+                                                                                                                                                                       }
+                                                                                                                                                               }
+                                                                                                                                                               break;
+
+                                                                                                                                                       default:
+                                                                                                                                                               $this->unhandledElement('track.contentencodings.contentencoding', __LINE__, $sub_sub_subelement);
+                                                                                                                                               }
+                                                                                                                                       }
+                                                                                                                                       break;
+
+                                                                                                                               default:
+                                                                                                                                       $this->unhandledElement('track.contentencodings', __LINE__, $sub_subelement);
+                                                                                                                       }
+                                                                                                               }
+                                                                                                               break;
+
+                                                                                                       default:
+                                                                                                               $this->unhandledElement('track', __LINE__, $subelement);
+                                                                                               }
+                                                                                       }
+
+                                                                                       $info['matroska']['tracks']['tracks'][] = $track_entry;
+                                                                                       break;
+
+                                                                               default:
+                                                                                       $this->unhandledElement('tracks', __LINE__, $track_entry);
+                                                                       }
+                                                               }
+                                                               break;
+
+                                                       case EBML_ID_INFO: // Contains miscellaneous general information and statistics on the file.
+                                                               $info_entry = array();
+
+                                                               while ($this->getEBMLelement($subelement, $element_data['end'], true)) {
+                                                                       switch ($subelement['id']) {
+
+                                                                               case EBML_ID_TIMECODESCALE:
+                                                                                       $info_entry[$subelement['id_name']] = getid3_lib::BigEndian2Int($subelement['data']);
+                                                                                       break;
+
+                                                                               case EBML_ID_DURATION:
+                                                                                       $info_entry[$subelement['id_name']] = getid3_lib::BigEndian2Float($subelement['data']);
+                                                                                       break;
+
+                                                                               case EBML_ID_DATEUTC:
+                                                                                       $info_entry[$subelement['id_name']]         = getid3_lib::BigEndian2Int($subelement['data']);
+                                                                                       $info_entry[$subelement['id_name'].'_unix'] = self::EBMLdate2unix($info_entry[$subelement['id_name']]);
+                                                                                       break;
+
+                                                                               case EBML_ID_SEGMENTUID:
+                                                                               case EBML_ID_PREVUID:
+                                                                               case EBML_ID_NEXTUID:
+                                                                                       $info_entry[$subelement['id_name']] = getid3_lib::trimNullByte($subelement['data']);
+                                                                                       break;
+
+                                                                               case EBML_ID_SEGMENTFAMILY:
+                                                                                       $info_entry[$subelement['id_name']][] = getid3_lib::trimNullByte($subelement['data']);
+                                                                                       break;
+
+                                                                               case EBML_ID_SEGMENTFILENAME:
+                                                                               case EBML_ID_PREVFILENAME:
+                                                                               case EBML_ID_NEXTFILENAME:
+                                                                               case EBML_ID_TITLE:
+                                                                               case EBML_ID_MUXINGAPP:
+                                                                               case EBML_ID_WRITINGAPP:
+                                                                                       $info_entry[$subelement['id_name']] = getid3_lib::trimNullByte($subelement['data']);
+                                                                                       $info['matroska']['comments'][strtolower($subelement['id_name'])][] = $info_entry[$subelement['id_name']];
+                                                                                       break;
+
+                                                                               case EBML_ID_CHAPTERTRANSLATE:
+                                                                                       $chaptertranslate_entry = array();
+
+                                                                                       while ($this->getEBMLelement($sub_subelement, $subelement['end'], true)) {
+                                                                                               switch ($sub_subelement['id']) {
+
+                                                                                                       case EBML_ID_CHAPTERTRANSLATEEDITIONUID:
+                                                                                                               $chaptertranslate_entry[$sub_subelement['id_name']][] = getid3_lib::BigEndian2Int($sub_subelement['data']);
+                                                                                                               break;
+
+                                                                                                       case EBML_ID_CHAPTERTRANSLATECODEC:
+                                                                                                               $chaptertranslate_entry[$sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_subelement['data']);
+                                                                                                               break;
+
+                                                                                                       case EBML_ID_CHAPTERTRANSLATEID:
+                                                                                                               $chaptertranslate_entry[$sub_subelement['id_name']] = getid3_lib::trimNullByte($sub_subelement['data']);
+                                                                                                               break;
+
+                                                                                                       default:
+                                                                                                               $this->unhandledElement('info.chaptertranslate', __LINE__, $sub_subelement);
+                                                                                               }
+                                                                                       }
+                                                                                       $info_entry[$subelement['id_name']] = $chaptertranslate_entry;
+                                                                                       break;
+
+                                                                               default:
+                                                                                       $this->unhandledElement('info', __LINE__, $subelement);
+                                                                       }
+                                                               }
+                                                               $info['matroska']['info'][] = $info_entry;
+                                                               break;
+
+                                                       case EBML_ID_CUES: // A top-level element to speed seeking access. All entries are local to the segment. Should be mandatory for non "live" streams.
+                                                               if (self::$hide_clusters) { // do not parse cues if hide clusters is "ON" till they point to clusters anyway
+                                                                       $this->current_offset = $element_data['end'];
+                                                                       break;
+                                                               }
+                                                               $cues_entry = array();
+
+                                                               while ($this->getEBMLelement($subelement, $element_data['end'])) {
+                                                                       switch ($subelement['id']) {
+
+                                                                               case EBML_ID_CUEPOINT:
+                                                                                       $cuepoint_entry = array();
+
+                                                                                       while ($this->getEBMLelement($sub_subelement, $subelement['end'], array(EBML_ID_CUETRACKPOSITIONS))) {
+                                                                                               switch ($sub_subelement['id']) {
+
+                                                                                                       case EBML_ID_CUETRACKPOSITIONS:
+                                                                                                               $cuetrackpositions_entry = array();
+
+                                                                                                               while ($this->getEBMLelement($sub_sub_subelement, $sub_subelement['end'], true)) {
+                                                                                                                       switch ($sub_sub_subelement['id']) {
+
+                                                                                                                               case EBML_ID_CUETRACK:
+                                                                                                                               case EBML_ID_CUECLUSTERPOSITION:
+                                                                                                                               case EBML_ID_CUEBLOCKNUMBER:
+                                                                                                                               case EBML_ID_CUECODECSTATE:
+                                                                                                                                       $cuetrackpositions_entry[$sub_sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_sub_subelement['data']);
+                                                                                                                                       break;
+
+                                                                                                                               default:
+                                                                                                                                       $this->unhandledElement('cues.cuepoint.cuetrackpositions', __LINE__, $sub_sub_subelement);
+                                                                                                                       }
+                                                                                                               }
+                                                                                                               $cuepoint_entry[$sub_subelement['id_name']][] = $cuetrackpositions_entry;
+                                                                                                               break;
+
+                                                                                                       case EBML_ID_CUETIME:
+                                                                                                               $cuepoint_entry[$sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_subelement['data']);
+                                                                                                               break;
+
+                                                                                                       default:
+                                                                                                               $this->unhandledElement('cues.cuepoint', __LINE__, $sub_subelement);
+                                                                                               }
+                                                                                       }
+                                                                                       $cues_entry[] = $cuepoint_entry;
+                                                                                       break;
+
+                                                                               default:
+                                                                                       $this->unhandledElement('cues', __LINE__, $subelement);
+                                                                       }
+                                                               }
+                                                               $info['matroska']['cues'] = $cues_entry;
+                                                               break;
+
+                                                       case EBML_ID_TAGS: // Element containing elements specific to Tracks/Chapters.
+                                                               $tags_entry = array();
+
+                                                               while ($this->getEBMLelement($subelement, $element_data['end'], false)) {
+                                                                       switch ($subelement['id']) {
+
+                                                                               case EBML_ID_TAG:
+                                                                                       $tag_entry = array();
+
+                                                                                       while ($this->getEBMLelement($sub_subelement, $subelement['end'], false)) {
+                                                                                               switch ($sub_subelement['id']) {
+
+                                                                                                       case EBML_ID_TARGETS:
+                                                                                                               $targets_entry = array();
+
+                                                                                                               while ($this->getEBMLelement($sub_sub_subelement, $sub_subelement['end'], true)) {
+                                                                                                                       switch ($sub_sub_subelement['id']) {
+
+                                                                                                                               case EBML_ID_TARGETTYPEVALUE:
+                                                                                                                                       $targets_entry[$sub_sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_sub_subelement['data']);
+                                                                                                                                       $targets_entry[strtolower($sub_sub_subelement['id_name']).'_long'] = self::TargetTypeValue($targets_entry[$sub_sub_subelement['id_name']]);
+                                                                                                                                       break;
+
+                                                                                                                               case EBML_ID_TARGETTYPE:
+                                                                                                                                       $targets_entry[$sub_sub_subelement['id_name']] = $sub_sub_subelement['data'];
+                                                                                                                                       break;
+
+                                                                                                                               case EBML_ID_TAGTRACKUID:
+                                                                                                                               case EBML_ID_TAGEDITIONUID:
+                                                                                                                               case EBML_ID_TAGCHAPTERUID:
+                                                                                                                               case EBML_ID_TAGATTACHMENTUID:
+                                                                                                                                       $targets_entry[$sub_sub_subelement['id_name']][] = getid3_lib::BigEndian2Int($sub_sub_subelement['data']);
+                                                                                                                                       break;
+
+                                                                                                                               default:
+                                                                                                                                       $this->unhandledElement('tags.tag.targets', __LINE__, $sub_sub_subelement);
+                                                                                                                       }
+                                                                                                               }
+                                                                                                               $tag_entry[$sub_subelement['id_name']] = $targets_entry;
+                                                                                                               break;
+
+                                                                                                       case EBML_ID_SIMPLETAG:
+                                                                                                               $tag_entry[$sub_subelement['id_name']][] = $this->HandleEMBLSimpleTag($sub_subelement['end']);
+                                                                                                               break;
+
+                                                                                                       default:
+                                                                                                               $this->unhandledElement('tags.tag', __LINE__, $sub_subelement);
+                                                                                               }
+                                                                                       }
+                                                                                       $tags_entry[] = $tag_entry;
+                                                                                       break;
+
+                                                                               default:
+                                                                                       $this->unhandledElement('tags', __LINE__, $subelement);
+                                                                       }
+                                                               }
+                                                               $info['matroska']['tags'] = $tags_entry;
+                                                               break;
+
+                                                       case EBML_ID_ATTACHMENTS: // Contain attached files.
+
+                                                               while ($this->getEBMLelement($subelement, $element_data['end'])) {
+                                                                       switch ($subelement['id']) {
+
+                                                                               case EBML_ID_ATTACHEDFILE:
+                                                                                       $attachedfile_entry = array();
+
+                                                                                       while ($this->getEBMLelement($sub_subelement, $subelement['end'], array(EBML_ID_FILEDATA))) {
+                                                                                               switch ($sub_subelement['id']) {
+
+                                                                                                       case EBML_ID_FILEDESCRIPTION:
+                                                                                                       case EBML_ID_FILENAME:
+                                                                                                       case EBML_ID_FILEMIMETYPE:
+                                                                                                               $attachedfile_entry[$sub_subelement['id_name']] = $sub_subelement['data'];
+                                                                                                               break;
+
+                                                                                                       case EBML_ID_FILEDATA:
+                                                                                                               $attachedfile_entry['data_offset'] = $this->current_offset;
+                                                                                                               $attachedfile_entry['data_length'] = $sub_subelement['length'];
+
+                                                                                                               $attachedfile_entry[$sub_subelement['id_name']] = $this->saveAttachment(
+                                                                                                                       $attachedfile_entry['FileName'],
+                                                                                                                       $attachedfile_entry['data_offset'],
+                                                                                                                       $attachedfile_entry['data_length']);
+
+                                                                                                               $this->current_offset = $sub_subelement['end'];
+                                                                                                               break;
+
+                                                                                                       case EBML_ID_FILEUID:
+                                                                                                               $attachedfile_entry[$sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_subelement['data']);
+                                                                                                               break;
+
+                                                                                                       default:
+                                                                                                               $this->unhandledElement('attachments.attachedfile', __LINE__, $sub_subelement);
+                                                                                               }
+                                                                                       }
+                                                                                       $info['matroska']['attachments'][] = $attachedfile_entry;
+                                                                                       break;
+
+                                                                               default:
+                                                                                       $this->unhandledElement('attachments', __LINE__, $subelement);
+                                                                       }
+                                                               }
+                                                               break;
+
+                                                       case EBML_ID_CHAPTERS:
+
+                                                               while ($this->getEBMLelement($subelement, $element_data['end'])) {
+                                                                       switch ($subelement['id']) {
+
+                                                                               case EBML_ID_EDITIONENTRY:
+                                                                                       $editionentry_entry = array();
+
+                                                                                       while ($this->getEBMLelement($sub_subelement, $subelement['end'], array(EBML_ID_CHAPTERATOM))) {
+                                                                                               switch ($sub_subelement['id']) {
+
+                                                                                                       case EBML_ID_EDITIONUID:
+                                                                                                               $editionentry_entry[$sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_subelement['data']);
+                                                                                                               break;
+
+                                                                                                       case EBML_ID_EDITIONFLAGHIDDEN:
+                                                                                                       case EBML_ID_EDITIONFLAGDEFAULT:
+                                                                                                       case EBML_ID_EDITIONFLAGORDERED:
+                                                                                                               $editionentry_entry[$sub_subelement['id_name']] = (bool)getid3_lib::BigEndian2Int($sub_subelement['data']);
+                                                                                                               break;
+
+                                                                                                       case EBML_ID_CHAPTERATOM:
+                                                                                                               $chapteratom_entry = array();
+
+                                                                                                               while ($this->getEBMLelement($sub_sub_subelement, $sub_subelement['end'], array(EBML_ID_CHAPTERTRACK, EBML_ID_CHAPTERDISPLAY))) {
+                                                                                                                       switch ($sub_sub_subelement['id']) {
+
+                                                                                                                               case EBML_ID_CHAPTERSEGMENTUID:
+                                                                                                                               case EBML_ID_CHAPTERSEGMENTEDITIONUID:
+                                                                                                                                       $chapteratom_entry[$sub_sub_subelement['id_name']] = $sub_sub_subelement['data'];
+                                                                                                                                       break;
+
+                                                                                                                               case EBML_ID_CHAPTERFLAGENABLED:
+                                                                                                                               case EBML_ID_CHAPTERFLAGHIDDEN:
+                                                                                                                                       $chapteratom_entry[$sub_sub_subelement['id_name']] = (bool)getid3_lib::BigEndian2Int($sub_sub_subelement['data']);
+                                                                                                                                       break;
+
+                                                                                                                               case EBML_ID_CHAPTERUID:
+                                                                                                                               case EBML_ID_CHAPTERTIMESTART:
+                                                                                                                               case EBML_ID_CHAPTERTIMEEND:
+                                                                                                                                       $chapteratom_entry[$sub_sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_sub_subelement['data']);
+                                                                                                                                       break;
+
+                                                                                                                               case EBML_ID_CHAPTERTRACK:
+                                                                                                                                       $chaptertrack_entry = array();
+
+                                                                                                                                       while ($this->getEBMLelement($sub_sub_sub_subelement, $sub_sub_subelement['end'], true)) {
+                                                                                                                                               switch ($sub_sub_sub_subelement['id']) {
+
+                                                                                                                                                       case EBML_ID_CHAPTERTRACKNUMBER:
+                                                                                                                                                               $chaptertrack_entry[$sub_sub_sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_sub_sub_subelement['data']);
+                                                                                                                                                               break;
+
+                                                                                                                                                       default:
+                                                                                                                                                               $this->unhandledElement('chapters.editionentry.chapteratom.chaptertrack', __LINE__, $sub_sub_sub_subelement);
+                                                                                                                                               }
+                                                                                                                                       }
+                                                                                                                                       $chapteratom_entry[$sub_sub_subelement['id_name']][] = $chaptertrack_entry;
+                                                                                                                                       break;
+
+                                                                                                                               case EBML_ID_CHAPTERDISPLAY:
+                                                                                                                                       $chapterdisplay_entry = array();
+
+                                                                                                                                       while ($this->getEBMLelement($sub_sub_sub_subelement, $sub_sub_subelement['end'], true)) {
+                                                                                                                                               switch ($sub_sub_sub_subelement['id']) {
+
+                                                                                                                                                       case EBML_ID_CHAPSTRING:
+                                                                                                                                                       case EBML_ID_CHAPLANGUAGE:
+                                                                                                                                                       case EBML_ID_CHAPCOUNTRY:
+                                                                                                                                                               $chapterdisplay_entry[$sub_sub_sub_subelement['id_name']] = $sub_sub_sub_subelement['data'];
+                                                                                                                                                               break;
+
+                                                                                                                                                       default:
+                                                                                                                                                               $this->unhandledElement('chapters.editionentry.chapteratom.chapterdisplay', __LINE__, $sub_sub_sub_subelement);
+                                                                                                                                               }
+                                                                                                                                       }
+                                                                                                                                       $chapteratom_entry[$sub_sub_subelement['id_name']][] = $chapterdisplay_entry;
+                                                                                                                                       break;
+
+                                                                                                                               default:
+                                                                                                                                       $this->unhandledElement('chapters.editionentry.chapteratom', __LINE__, $sub_sub_subelement);
+                                                                                                                       }
+                                                                                                               }
+                                                                                                               $editionentry_entry[$sub_subelement['id_name']][] = $chapteratom_entry;
+                                                                                                               break;
+
+                                                                                                       default:
+                                                                                                               $this->unhandledElement('chapters.editionentry', __LINE__, $sub_subelement);
+                                                                                               }
+                                                                                       }
+                                                                                       $info['matroska']['chapters'][] = $editionentry_entry;
+                                                                                       break;
+
+                                                                               default:
+                                                                                       $this->unhandledElement('chapters', __LINE__, $subelement);
+                                                                       }
+                                                               }
+                                                               break;
+
+                                                       case EBML_ID_CLUSTER: // The lower level element containing the (monolithic) Block structure.
+                                                               $cluster_entry = array();
+
+                                                               while ($this->getEBMLelement($subelement, $element_data['end'], array(EBML_ID_CLUSTERSILENTTRACKS, EBML_ID_CLUSTERBLOCKGROUP, EBML_ID_CLUSTERSIMPLEBLOCK))) {
+                                                                       switch ($subelement['id']) {
+
+                                                                               case EBML_ID_CLUSTERTIMECODE:
+                                                                               case EBML_ID_CLUSTERPOSITION:
+                                                                               case EBML_ID_CLUSTERPREVSIZE:
+                                                                                       $cluster_entry[$subelement['id_name']] = getid3_lib::BigEndian2Int($subelement['data']);
+                                                                                       break;
+
+                                                                               case EBML_ID_CLUSTERSILENTTRACKS:
+                                                                                       $cluster_silent_tracks = array();
+
+                                                                                       while ($this->getEBMLelement($sub_subelement, $subelement['end'], true)) {
+                                                                                               switch ($sub_subelement['id']) {
+
+                                                                                                       case EBML_ID_CLUSTERSILENTTRACKNUMBER:
+                                                                                                               $cluster_silent_tracks[] = getid3_lib::BigEndian2Int($sub_subelement['data']);
+                                                                                                               break;
+
+                                                                                                       default:
+                                                                                                               $this->unhandledElement('cluster.silenttracks', __LINE__, $sub_subelement);
+                                                                                               }
+                                                                                       }
+                                                                                       $cluster_entry[$subelement['id_name']][] = $cluster_silent_tracks;
+                                                                                       break;
+
+                                                                               case EBML_ID_CLUSTERBLOCKGROUP:
+                                                                                       $cluster_block_group = array('offset' => $this->current_offset);
+
+                                                                                       while ($this->getEBMLelement($sub_subelement, $subelement['end'], array(EBML_ID_CLUSTERBLOCK))) {
+                                                                                               switch ($sub_subelement['id']) {
+
+                                                                                                       case EBML_ID_CLUSTERBLOCK:
+                                                                                                               $cluster_block_group[$sub_subelement['id_name']] = $this->HandleEMBLClusterBlock($sub_subelement, EBML_ID_CLUSTERBLOCK, $info);
+                                                                                                               break;
+
+                                                                                                       case EBML_ID_CLUSTERREFERENCEPRIORITY: // unsigned-int
+                                                                                                       case EBML_ID_CLUSTERBLOCKDURATION:     // unsigned-int
+                                                                                                               $cluster_block_group[$sub_subelement['id_name']] = getid3_lib::BigEndian2Int($sub_subelement['data']);
+                                                                                                               break;
+
+                                                                                                       case EBML_ID_CLUSTERREFERENCEBLOCK:    // signed-int
+                                                                                                               $cluster_block_group[$sub_subelement['id_name']][] = getid3_lib::BigEndian2Int($sub_subelement['data'], false, true);
+                                                                                                               break;
+
+                                                                                                       case EBML_ID_CLUSTERCODECSTATE:
+                                                                                                               $cluster_block_group[$sub_subelement['id_name']] = getid3_lib::trimNullByte($sub_subelement['data']);
+                                                                                                               break;
+
+                                                                                                       default:
+                                                                                                               $this->unhandledElement('clusters.blockgroup', __LINE__, $sub_subelement);
+                                                                                               }
+                                                                                       }
+                                                                                       $cluster_entry[$subelement['id_name']][] = $cluster_block_group;
+                                                                                       break;
+
+                                                                               case EBML_ID_CLUSTERSIMPLEBLOCK:
+                                                                                       $cluster_entry[$subelement['id_name']][] = $this->HandleEMBLClusterBlock($subelement, EBML_ID_CLUSTERSIMPLEBLOCK, $info);
+                                                                                       break;
+
+                                                                               default:
+                                                                                       $this->unhandledElement('cluster', __LINE__, $subelement);
+                                                                       }
+                                                                       $this->current_offset = $subelement['end'];
+                                                               }
+                                                               if (!self::$hide_clusters) {
+                                                                       $info['matroska']['cluster'][] = $cluster_entry;
+                                                               }
+
+                                                               // check to see if all the data we need exists already, if so, break out of the loop
+                                                               if (!self::$parse_whole_file) {
+                                                                       if (isset($info['matroska']['info']) && is_array($info['matroska']['info'])) {
+                                                                               if (isset($info['matroska']['tracks']['tracks']) && is_array($info['matroska']['tracks']['tracks'])) {
+                                                                                       if (count($info['matroska']['track_data_offsets']) == count($info['matroska']['tracks']['tracks'])) {
+                                                                                               return;
+                                                                                       }
+                                                                               }
+                                                                       }
+                                                               }
+                                                               break;
+
+                                                       default:
+                                                               $this->unhandledElement('segment', __LINE__, $element_data);
+                                               }
+                                       }
+                                       break;
+
+                               default:
+                                       $this->unhandledElement('root', __LINE__, $top_element);
+                       }
+               }
+       }
+
+       private function EnsureBufferHasEnoughData($min_data=1024) {
+               if (($this->current_offset - $this->EBMLbuffer_offset) >= ($this->EBMLbuffer_length - $min_data)) {
+                       $read_bytes = max($min_data, $this->getid3->fread_buffer_size());
+
+                       try {
+                               $this->fseek($this->current_offset);
+                               $this->EBMLbuffer_offset = $this->current_offset;
+                               $this->EBMLbuffer        = $this->fread($read_bytes);
+                               $this->EBMLbuffer_length = strlen($this->EBMLbuffer);
+                       } catch (getid3_exception $e) {
+                               $this->warning('EBML parser: '.$e->getMessage());
+                               return false;
+                       }
+
+                       if ($this->EBMLbuffer_length == 0 && $this->feof()) {
+                               return $this->error('EBML parser: ran out of file at offset '.$this->current_offset);
+                       }
+               }
+               return true;
+       }
+
+       private function readEBMLint() {
+               $actual_offset = $this->current_offset - $this->EBMLbuffer_offset;
+
+               // get length of integer
+               $first_byte_int = ord($this->EBMLbuffer[$actual_offset]);
+               if       (0x80 & $first_byte_int) {
+                       $length = 1;
+               } elseif (0x40 & $first_byte_int) {
+                       $length = 2;
+               } elseif (0x20 & $first_byte_int) {
+                       $length = 3;
+               } elseif (0x10 & $first_byte_int) {
+                       $length = 4;
+               } elseif (0x08 & $first_byte_int) {
+                       $length = 5;
+               } elseif (0x04 & $first_byte_int) {
+                       $length = 6;
+               } elseif (0x02 & $first_byte_int) {
+                       $length = 7;
+               } elseif (0x01 & $first_byte_int) {
+                       $length = 8;
+               } else {
+                       throw new Exception('invalid EBML integer (leading 0x00) at '.$this->current_offset);
+               }
+
+               // read
+               $int_value = self::EBML2Int(substr($this->EBMLbuffer, $actual_offset, $length));
+               $this->current_offset += $length;
+
+               return $int_value;
+       }
+
+       private function readEBMLelementData($length, $check_buffer=false) {
+               if ($check_buffer && !$this->EnsureBufferHasEnoughData($length)) {
+                       return false;
+               }
+               $data = substr($this->EBMLbuffer, $this->current_offset - $this->EBMLbuffer_offset, $length);
+               $this->current_offset += $length;
+               return $data;
+       }
+
+       private function getEBMLelement(&$element, $parent_end, $get_data=false) {
+               if ($this->current_offset >= $parent_end) {
+                       return false;
+               }
+
+               if (!$this->EnsureBufferHasEnoughData()) {
+                       $this->current_offset = PHP_INT_MAX; // do not exit parser right now, allow to finish current loop to gather maximum information
+                       return false;
+               }
+
+               $element = array();
+
+               // set offset
+               $element['offset'] = $this->current_offset;
+
+               // get ID
+               $element['id'] = $this->readEBMLint();
+
+               // get name
+               $element['id_name'] = self::EBMLidName($element['id']);
+
+               // get length
+               $element['length'] = $this->readEBMLint();
+
+               // get end offset
+               $element['end'] = $this->current_offset + $element['length'];
+
+               // get raw data
+               $dont_parse = (in_array($element['id'], $this->unuseful_elements) || $element['id_name'] == dechex($element['id']));
+               if (($get_data === true || (is_array($get_data) && !in_array($element['id'], $get_data))) && !$dont_parse) {
+                       $element['data'] = $this->readEBMLelementData($element['length'], $element);
+               }
+
+               return true;
+       }
+
+       private function unhandledElement($type, $line, $element) {
+               // warn only about unknown and missed elements, not about unuseful
+               if (!in_array($element['id'], $this->unuseful_elements)) {
+                       $this->warning('Unhandled '.$type.' element ['.basename(__FILE__).':'.$line.'] ('.$element['id'].'::'.$element['id_name'].' ['.$element['length'].' bytes]) at '.$element['offset']);
+               }
+
+               // increase offset for unparsed elements
+               if (!isset($element['data'])) {
+                       $this->current_offset = $element['end'];
+               }
+       }
+
+       private function ExtractCommentsSimpleTag($SimpleTagArray) {
+               if (!empty($SimpleTagArray['SimpleTag'])) {
+                       foreach ($SimpleTagArray['SimpleTag'] as $SimpleTagKey => $SimpleTagData) {
+                               if (!empty($SimpleTagData['TagName']) && !empty($SimpleTagData['TagString'])) {
+                                       $this->getid3->info['matroska']['comments'][strtolower($SimpleTagData['TagName'])][] = $SimpleTagData['TagString'];
+                               }
+                               if (!empty($SimpleTagData['SimpleTag'])) {
+                                       $this->ExtractCommentsSimpleTag($SimpleTagData);
+                               }
+                       }
+               }
+
+               return true;
+       }
+
+       private function HandleEMBLSimpleTag($parent_end) {
+               $simpletag_entry = array();
+
+               while ($this->getEBMLelement($element, $parent_end, array(EBML_ID_SIMPLETAG))) {
+                       switch ($element['id']) {
+
+                               case EBML_ID_TAGNAME:
+                               case EBML_ID_TAGLANGUAGE:
+                               case EBML_ID_TAGSTRING:
+                               case EBML_ID_TAGBINARY:
+                                       $simpletag_entry[$element['id_name']] = $element['data'];
+                                       break;
+
+                               case EBML_ID_SIMPLETAG:
+                                       $simpletag_entry[$element['id_name']][] = $this->HandleEMBLSimpleTag($element['end']);
+                                       break;
+
+                               case EBML_ID_TAGDEFAULT:
+                                       $simpletag_entry[$element['id_name']] = (bool)getid3_lib::BigEndian2Int($element['data']);
+                                       break;
+
+                               default:
+                                       $this->unhandledElement('tag.simpletag', __LINE__, $element);
+                       }
+               }
+
+               return $simpletag_entry;
+       }
+
+       private function HandleEMBLClusterBlock($element, $block_type, &$info) {
+               // http://www.matroska.org/technical/specs/index.html#block_structure
+               // http://www.matroska.org/technical/specs/index.html#simpleblock_structure
+
+               $block_data = array();
+               $block_data['tracknumber'] = $this->readEBMLint();
+               $block_data['timecode']    = getid3_lib::BigEndian2Int($this->readEBMLelementData(2), false, true);
+               $block_data['flags_raw']   = getid3_lib::BigEndian2Int($this->readEBMLelementData(1));
+
+               if ($block_type == EBML_ID_CLUSTERSIMPLEBLOCK) {
+                       $block_data['flags']['keyframe']  = (($block_data['flags_raw'] & 0x80) >> 7);
+                       //$block_data['flags']['reserved1'] = (($block_data['flags_raw'] & 0x70) >> 4);
+               }
+               else {
+                       //$block_data['flags']['reserved1'] = (($block_data['flags_raw'] & 0xF0) >> 4);
+               }
+               $block_data['flags']['invisible'] = (bool)(($block_data['flags_raw'] & 0x08) >> 3);
+               $block_data['flags']['lacing']    =       (($block_data['flags_raw'] & 0x06) >> 1);  // 00=no lacing; 01=Xiph lacing; 11=EBML lacing; 10=fixed-size lacing
+               if ($block_type == EBML_ID_CLUSTERSIMPLEBLOCK) {
+                       $block_data['flags']['discardable'] = (($block_data['flags_raw'] & 0x01));
+               }
+               else {
+                       //$block_data['flags']['reserved2'] = (($block_data['flags_raw'] & 0x01) >> 0);
+               }
+               $block_data['flags']['lacing_type'] = self::BlockLacingType($block_data['flags']['lacing']);
+
+               // Lace (when lacing bit is set)
+               if ($block_data['flags']['lacing'] > 0) {
+                       $block_data['lace_frames'] = getid3_lib::BigEndian2Int($this->readEBMLelementData(1)) + 1; // Number of frames in the lace-1 (uint8)
+                       if ($block_data['flags']['lacing'] != 0x02) {
+                               for ($i = 1; $i < $block_data['lace_frames']; $i ++) { // Lace-coded size of each frame of the lace, except for the last one (multiple uint8). *This is not used with Fixed-size lacing as it is calculated automatically from (total size of lace) / (number of frames in lace).
+                                       if ($block_data['flags']['lacing'] == 0x03) { // EBML lacing
+                                               $block_data['lace_frames_size'][$i] = $this->readEBMLint(); // TODO: read size correctly, calc size for the last frame. For now offsets are deteminded OK with readEBMLint() and that's the most important thing.
+                                       }
+                                       else { // Xiph lacing
+                                               $block_data['lace_frames_size'][$i] = 0;
+                                               do {
+                                                       $size = getid3_lib::BigEndian2Int($this->readEBMLelementData(1));
+                                                       $block_data['lace_frames_size'][$i] += $size;
+                                               }
+                                               while ($size == 255);
+                                       }
+                               }
+                               if ($block_data['flags']['lacing'] == 0x01) { // calc size of the last frame only for Xiph lacing, till EBML sizes are now anyway determined incorrectly
+                                       $block_data['lace_frames_size'][] = $element['end'] - $this->current_offset - array_sum($block_data['lace_frames_size']);
+                               }
+                       }
+               }
+
+               if (!isset($info['matroska']['track_data_offsets'][$block_data['tracknumber']])) {
+                       $info['matroska']['track_data_offsets'][$block_data['tracknumber']]['offset'] = $this->current_offset;
+                       $info['matroska']['track_data_offsets'][$block_data['tracknumber']]['length'] = $element['end'] - $this->current_offset;
+                       //$info['matroska']['track_data_offsets'][$block_data['tracknumber']]['total_length'] = 0;
+               }
+               //$info['matroska']['track_data_offsets'][$block_data['tracknumber']]['total_length'] += $info['matroska']['track_data_offsets'][$block_data['tracknumber']]['length'];
+               //$info['matroska']['track_data_offsets'][$block_data['tracknumber']]['duration']      = $block_data['timecode'] * ((isset($info['matroska']['info'][0]['TimecodeScale']) ? $info['matroska']['info'][0]['TimecodeScale'] : 1000000) / 1000000000);
+
+               // set offset manually
+               $this->current_offset = $element['end'];
+
+               return $block_data;
+       }
+
+       private static function EBML2Int($EBMLstring) {
+               // http://matroska.org/specs/
+
+               // Element ID coded with an UTF-8 like system:
+               // 1xxx xxxx                                  - Class A IDs (2^7 -2 possible values) (base 0x8X)
+               // 01xx xxxx  xxxx xxxx                       - Class B IDs (2^14-2 possible values) (base 0x4X 0xXX)
+               // 001x xxxx  xxxx xxxx  xxxx xxxx            - Class C IDs (2^21-2 possible values) (base 0x2X 0xXX 0xXX)
+               // 0001 xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx - Class D IDs (2^28-2 possible values) (base 0x1X 0xXX 0xXX 0xXX)
+               // Values with all x at 0 and 1 are reserved (hence the -2).
+
+               // Data size, in octets, is also coded with an UTF-8 like system :
+               // 1xxx xxxx                                                                              - value 0 to  2^7-2
+               // 01xx xxxx  xxxx xxxx                                                                   - value 0 to 2^14-2
+               // 001x xxxx  xxxx xxxx  xxxx xxxx                                                        - value 0 to 2^21-2
+               // 0001 xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx                                             - value 0 to 2^28-2
+               // 0000 1xxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx                                  - value 0 to 2^35-2
+               // 0000 01xx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx                       - value 0 to 2^42-2
+               // 0000 001x  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx            - value 0 to 2^49-2
+               // 0000 0001  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx  xxxx xxxx - value 0 to 2^56-2
+
+               $first_byte_int = ord($EBMLstring[0]);
+               if (0x80 & $first_byte_int) {
+                       $EBMLstring[0] = chr($first_byte_int & 0x7F);
+               } elseif (0x40 & $first_byte_int) {
+                       $EBMLstring[0] = chr($first_byte_int & 0x3F);
+               } elseif (0x20 & $first_byte_int) {
+                       $EBMLstring[0] = chr($first_byte_int & 0x1F);
+               } elseif (0x10 & $first_byte_int) {
+                       $EBMLstring[0] = chr($first_byte_int & 0x0F);
+               } elseif (0x08 & $first_byte_int) {
+                       $EBMLstring[0] = chr($first_byte_int & 0x07);
+               } elseif (0x04 & $first_byte_int) {
+                       $EBMLstring[0] = chr($first_byte_int & 0x03);
+               } elseif (0x02 & $first_byte_int) {
+                       $EBMLstring[0] = chr($first_byte_int & 0x01);
+               } elseif (0x01 & $first_byte_int) {
+                       $EBMLstring[0] = chr($first_byte_int & 0x00);
+               }
+
+               return getid3_lib::BigEndian2Int($EBMLstring);
+       }
+
+       private static function EBMLdate2unix($EBMLdatestamp) {
+               // Date - signed 8 octets integer in nanoseconds with 0 indicating the precise beginning of the millennium (at 2001-01-01T00:00:00,000000000 UTC)
+               // 978307200 == mktime(0, 0, 0, 1, 1, 2001) == January 1, 2001 12:00:00am UTC
+               return round(($EBMLdatestamp / 1000000000) + 978307200);
+       }
+
+       public static function TargetTypeValue($target_type) {
+               // http://www.matroska.org/technical/specs/tagging/index.html
+               static $TargetTypeValue = array();
+               if (empty($TargetTypeValue)) {
+                       $TargetTypeValue[10] = 'A: ~ V:shot';                                           // the lowest hierarchy found in music or movies
+                       $TargetTypeValue[20] = 'A:subtrack/part/movement ~ V:scene';                    // corresponds to parts of a track for audio (like a movement)
+                       $TargetTypeValue[30] = 'A:track/song ~ V:chapter';                              // the common parts of an album or a movie
+                       $TargetTypeValue[40] = 'A:part/session ~ V:part/session';                       // when an album or episode has different logical parts
+                       $TargetTypeValue[50] = 'A:album/opera/concert ~ V:movie/episode/concert';       // the most common grouping level of music and video (equals to an episode for TV series)
+                       $TargetTypeValue[60] = 'A:edition/issue/volume/opus ~ V:season/sequel/volume';  // a list of lower levels grouped together
+                       $TargetTypeValue[70] = 'A:collection ~ V:collection';                           // the high hierarchy consisting of many different lower items
+               }
+               return (isset($TargetTypeValue[$target_type]) ? $TargetTypeValue[$target_type] : $target_type);
+       }
+
+       public static function BlockLacingType($lacingtype) {
+               // http://matroska.org/technical/specs/index.html#block_structure
+               static $BlockLacingType = array();
+               if (empty($BlockLacingType)) {
+                       $BlockLacingType[0x00] = 'no lacing';
+                       $BlockLacingType[0x01] = 'Xiph lacing';
+                       $BlockLacingType[0x02] = 'fixed-size lacing';
+                       $BlockLacingType[0x03] = 'EBML lacing';
+               }
+               return (isset($BlockLacingType[$lacingtype]) ? $BlockLacingType[$lacingtype] : $lacingtype);
+       }
+
+       public static function CodecIDtoCommonName($codecid) {
+               // http://www.matroska.org/technical/specs/codecid/index.html
+               static $CodecIDlist = array();
+               if (empty($CodecIDlist)) {
+                       $CodecIDlist['A_AAC']            = 'aac';
+                       $CodecIDlist['A_AAC/MPEG2/LC']   = 'aac';
+                       $CodecIDlist['A_AC3']            = 'ac3';
+                       $CodecIDlist['A_DTS']            = 'dts';
+                       $CodecIDlist['A_FLAC']           = 'flac';
+                       $CodecIDlist['A_MPEG/L1']        = 'mp1';
+                       $CodecIDlist['A_MPEG/L2']        = 'mp2';
+                       $CodecIDlist['A_MPEG/L3']        = 'mp3';
+                       $CodecIDlist['A_PCM/INT/LIT']    = 'pcm';       // PCM Integer Little Endian
+                       $CodecIDlist['A_PCM/INT/BIG']    = 'pcm';       // PCM Integer Big Endian
+                       $CodecIDlist['A_QUICKTIME/QDMC'] = 'quicktime'; // Quicktime: QDesign Music
+                       $CodecIDlist['A_QUICKTIME/QDM2'] = 'quicktime'; // Quicktime: QDesign Music v2
+                       $CodecIDlist['A_VORBIS']         = 'vorbis';
+                       $CodecIDlist['V_MPEG1']          = 'mpeg';
+                       $CodecIDlist['V_THEORA']         = 'theora';
+                       $CodecIDlist['V_REAL/RV40']      = 'real';
+                       $CodecIDlist['V_REAL/RV10']      = 'real';
+                       $CodecIDlist['V_REAL/RV20']      = 'real';
+                       $CodecIDlist['V_REAL/RV30']      = 'real';
+                       $CodecIDlist['V_QUICKTIME']      = 'quicktime'; // Quicktime
+                       $CodecIDlist['V_MPEG4/ISO/AP']   = 'mpeg4';
+                       $CodecIDlist['V_MPEG4/ISO/ASP']  = 'mpeg4';
+                       $CodecIDlist['V_MPEG4/ISO/AVC']  = 'h264';
+                       $CodecIDlist['V_MPEG4/ISO/SP']   = 'mpeg4';
+                       $CodecIDlist['V_VP8']            = 'vp8';
+                       $CodecIDlist['V_MS/VFW/FOURCC']  = 'riff';
+                       $CodecIDlist['A_MS/ACM']         = 'riff';
+               }
+               return (isset($CodecIDlist[$codecid]) ? $CodecIDlist[$codecid] : $codecid);
+       }
+
+       private static function EBMLidName($value) {
+               static $EBMLidList = array();
+               if (empty($EBMLidList)) {
+                       $EBMLidList[EBML_ID_ASPECTRATIOTYPE]            = 'AspectRatioType';
+                       $EBMLidList[EBML_ID_ATTACHEDFILE]               = 'AttachedFile';
+                       $EBMLidList[EBML_ID_ATTACHMENTLINK]             = 'AttachmentLink';
+                       $EBMLidList[EBML_ID_ATTACHMENTS]                = 'Attachments';
+                       $EBMLidList[EBML_ID_AUDIO]                      = 'Audio';
+                       $EBMLidList[EBML_ID_BITDEPTH]                   = 'BitDepth';
+                       $EBMLidList[EBML_ID_CHANNELPOSITIONS]           = 'ChannelPositions';
+                       $EBMLidList[EBML_ID_CHANNELS]                   = 'Channels';
+                       $EBMLidList[EBML_ID_CHAPCOUNTRY]                = 'ChapCountry';
+                       $EBMLidList[EBML_ID_CHAPLANGUAGE]               = 'ChapLanguage';
+                       $EBMLidList[EBML_ID_CHAPPROCESS]                = 'ChapProcess';
+                       $EBMLidList[EBML_ID_CHAPPROCESSCODECID]         = 'ChapProcessCodecID';
+                       $EBMLidList[EBML_ID_CHAPPROCESSCOMMAND]         = 'ChapProcessCommand';
+                       $EBMLidList[EBML_ID_CHAPPROCESSDATA]            = 'ChapProcessData';
+                       $EBMLidList[EBML_ID_CHAPPROCESSPRIVATE]         = 'ChapProcessPrivate';
+                       $EBMLidList[EBML_ID_CHAPPROCESSTIME]            = 'ChapProcessTime';
+                       $EBMLidList[EBML_ID_CHAPSTRING]                 = 'ChapString';
+                       $EBMLidList[EBML_ID_CHAPTERATOM]                = 'ChapterAtom';
+                       $EBMLidList[EBML_ID_CHAPTERDISPLAY]             = 'ChapterDisplay';
+                       $EBMLidList[EBML_ID_CHAPTERFLAGENABLED]         = 'ChapterFlagEnabled';
+                       $EBMLidList[EBML_ID_CHAPTERFLAGHIDDEN]          = 'ChapterFlagHidden';
+                       $EBMLidList[EBML_ID_CHAPTERPHYSICALEQUIV]       = 'ChapterPhysicalEquiv';
+                       $EBMLidList[EBML_ID_CHAPTERS]                   = 'Chapters';
+                       $EBMLidList[EBML_ID_CHAPTERSEGMENTEDITIONUID]   = 'ChapterSegmentEditionUID';
+                       $EBMLidList[EBML_ID_CHAPTERSEGMENTUID]          = 'ChapterSegmentUID';
+                       $EBMLidList[EBML_ID_CHAPTERTIMEEND]             = 'ChapterTimeEnd';
+                       $EBMLidList[EBML_ID_CHAPTERTIMESTART]           = 'ChapterTimeStart';
+                       $EBMLidList[EBML_ID_CHAPTERTRACK]               = 'ChapterTrack';
+                       $EBMLidList[EBML_ID_CHAPTERTRACKNUMBER]         = 'ChapterTrackNumber';
+                       $EBMLidList[EBML_ID_CHAPTERTRANSLATE]           = 'ChapterTranslate';
+                       $EBMLidList[EBML_ID_CHAPTERTRANSLATECODEC]      = 'ChapterTranslateCodec';
+                       $EBMLidList[EBML_ID_CHAPTERTRANSLATEEDITIONUID] = 'ChapterTranslateEditionUID';
+                       $EBMLidList[EBML_ID_CHAPTERTRANSLATEID]         = 'ChapterTranslateID';
+                       $EBMLidList[EBML_ID_CHAPTERUID]                 = 'ChapterUID';
+                       $EBMLidList[EBML_ID_CLUSTER]                    = 'Cluster';
+                       $EBMLidList[EBML_ID_CLUSTERBLOCK]               = 'ClusterBlock';
+                       $EBMLidList[EBML_ID_CLUSTERBLOCKADDID]          = 'ClusterBlockAddID';
+                       $EBMLidList[EBML_ID_CLUSTERBLOCKADDITIONAL]     = 'ClusterBlockAdditional';
+                       $EBMLidList[EBML_ID_CLUSTERBLOCKADDITIONID]     = 'ClusterBlockAdditionID';
+                       $EBMLidList[EBML_ID_CLUSTERBLOCKADDITIONS]      = 'ClusterBlockAdditions';
+                       $EBMLidList[EBML_ID_CLUSTERBLOCKDURATION]       = 'ClusterBlockDuration';
+                       $EBMLidList[EBML_ID_CLUSTERBLOCKGROUP]          = 'ClusterBlockGroup';
+                       $EBMLidList[EBML_ID_CLUSTERBLOCKMORE]           = 'ClusterBlockMore';
+                       $EBMLidList[EBML_ID_CLUSTERBLOCKVIRTUAL]        = 'ClusterBlockVirtual';
+                       $EBMLidList[EBML_ID_CLUSTERCODECSTATE]          = 'ClusterCodecState';
+                       $EBMLidList[EBML_ID_CLUSTERDELAY]               = 'ClusterDelay';
+                       $EBMLidList[EBML_ID_CLUSTERDURATION]            = 'ClusterDuration';
+                       $EBMLidList[EBML_ID_CLUSTERENCRYPTEDBLOCK]      = 'ClusterEncryptedBlock';
+                       $EBMLidList[EBML_ID_CLUSTERFRAMENUMBER]         = 'ClusterFrameNumber';
+                       $EBMLidList[EBML_ID_CLUSTERLACENUMBER]          = 'ClusterLaceNumber';
+                       $EBMLidList[EBML_ID_CLUSTERPOSITION]            = 'ClusterPosition';
+                       $EBMLidList[EBML_ID_CLUSTERPREVSIZE]            = 'ClusterPrevSize';
+                       $EBMLidList[EBML_ID_CLUSTERREFERENCEBLOCK]      = 'ClusterReferenceBlock';
+                       $EBMLidList[EBML_ID_CLUSTERREFERENCEPRIORITY]   = 'ClusterReferencePriority';
+                       $EBMLidList[EBML_ID_CLUSTERREFERENCEVIRTUAL]    = 'ClusterReferenceVirtual';
+                       $EBMLidList[EBML_ID_CLUSTERSILENTTRACKNUMBER]   = 'ClusterSilentTrackNumber';
+                       $EBMLidList[EBML_ID_CLUSTERSILENTTRACKS]        = 'ClusterSilentTracks';
+                       $EBMLidList[EBML_ID_CLUSTERSIMPLEBLOCK]         = 'ClusterSimpleBlock';
+                       $EBMLidList[EBML_ID_CLUSTERTIMECODE]            = 'ClusterTimecode';
+                       $EBMLidList[EBML_ID_CLUSTERTIMESLICE]           = 'ClusterTimeSlice';
+                       $EBMLidList[EBML_ID_CODECDECODEALL]             = 'CodecDecodeAll';
+                       $EBMLidList[EBML_ID_CODECDOWNLOADURL]           = 'CodecDownloadURL';
+                       $EBMLidList[EBML_ID_CODECID]                    = 'CodecID';
+                       $EBMLidList[EBML_ID_CODECINFOURL]               = 'CodecInfoURL';
+                       $EBMLidList[EBML_ID_CODECNAME]                  = 'CodecName';
+                       $EBMLidList[EBML_ID_CODECPRIVATE]               = 'CodecPrivate';
+                       $EBMLidList[EBML_ID_CODECSETTINGS]              = 'CodecSettings';
+                       $EBMLidList[EBML_ID_COLOURSPACE]                = 'ColourSpace';
+                       $EBMLidList[EBML_ID_CONTENTCOMPALGO]            = 'ContentCompAlgo';
+                       $EBMLidList[EBML_ID_CONTENTCOMPRESSION]         = 'ContentCompression';
+                       $EBMLidList[EBML_ID_CONTENTCOMPSETTINGS]        = 'ContentCompSettings';
+                       $EBMLidList[EBML_ID_CONTENTENCALGO]             = 'ContentEncAlgo';
+                       $EBMLidList[EBML_ID_CONTENTENCKEYID]            = 'ContentEncKeyID';
+                       $EBMLidList[EBML_ID_CONTENTENCODING]            = 'ContentEncoding';
+                       $EBMLidList[EBML_ID_CONTENTENCODINGORDER]       = 'ContentEncodingOrder';
+                       $EBMLidList[EBML_ID_CONTENTENCODINGS]           = 'ContentEncodings';
+                       $EBMLidList[EBML_ID_CONTENTENCODINGSCOPE]       = 'ContentEncodingScope';
+                       $EBMLidList[EBML_ID_CONTENTENCODINGTYPE]        = 'ContentEncodingType';
+                       $EBMLidList[EBML_ID_CONTENTENCRYPTION]          = 'ContentEncryption';
+                       $EBMLidList[EBML_ID_CONTENTSIGALGO]             = 'ContentSigAlgo';
+                       $EBMLidList[EBML_ID_CONTENTSIGHASHALGO]         = 'ContentSigHashAlgo';
+                       $EBMLidList[EBML_ID_CONTENTSIGKEYID]            = 'ContentSigKeyID';
+                       $EBMLidList[EBML_ID_CONTENTSIGNATURE]           = 'ContentSignature';
+                       $EBMLidList[EBML_ID_CRC32]                      = 'CRC32';
+                       $EBMLidList[EBML_ID_CUEBLOCKNUMBER]             = 'CueBlockNumber';
+                       $EBMLidList[EBML_ID_CUECLUSTERPOSITION]         = 'CueClusterPosition';
+                       $EBMLidList[EBML_ID_CUECODECSTATE]              = 'CueCodecState';
+                       $EBMLidList[EBML_ID_CUEPOINT]                   = 'CuePoint';
+                       $EBMLidList[EBML_ID_CUEREFCLUSTER]              = 'CueRefCluster';
+                       $EBMLidList[EBML_ID_CUEREFCODECSTATE]           = 'CueRefCodecState';
+                       $EBMLidList[EBML_ID_CUEREFERENCE]               = 'CueReference';
+                       $EBMLidList[EBML_ID_CUEREFNUMBER]               = 'CueRefNumber';
+                       $EBMLidList[EBML_ID_CUEREFTIME]                 = 'CueRefTime';
+                       $EBMLidList[EBML_ID_CUES]                       = 'Cues';
+                       $EBMLidList[EBML_ID_CUETIME]                    = 'CueTime';
+                       $EBMLidList[EBML_ID_CUETRACK]                   = 'CueTrack';
+                       $EBMLidList[EBML_ID_CUETRACKPOSITIONS]          = 'CueTrackPositions';
+                       $EBMLidList[EBML_ID_DATEUTC]                    = 'DateUTC';
+                       $EBMLidList[EBML_ID_DEFAULTDURATION]            = 'DefaultDuration';
+                       $EBMLidList[EBML_ID_DISPLAYHEIGHT]              = 'DisplayHeight';
+                       $EBMLidList[EBML_ID_DISPLAYUNIT]                = 'DisplayUnit';
+                       $EBMLidList[EBML_ID_DISPLAYWIDTH]               = 'DisplayWidth';
+                       $EBMLidList[EBML_ID_DOCTYPE]                    = 'DocType';
+                       $EBMLidList[EBML_ID_DOCTYPEREADVERSION]         = 'DocTypeReadVersion';
+                       $EBMLidList[EBML_ID_DOCTYPEVERSION]             = 'DocTypeVersion';
+                       $EBMLidList[EBML_ID_DURATION]                   = 'Duration';
+                       $EBMLidList[EBML_ID_EBML]                       = 'EBML';
+                       $EBMLidList[EBML_ID_EBMLMAXIDLENGTH]            = 'EBMLMaxIDLength';
+                       $EBMLidList[EBML_ID_EBMLMAXSIZELENGTH]          = 'EBMLMaxSizeLength';
+                       $EBMLidList[EBML_ID_EBMLREADVERSION]            = 'EBMLReadVersion';
+                       $EBMLidList[EBML_ID_EBMLVERSION]                = 'EBMLVersion';
+                       $EBMLidList[EBML_ID_EDITIONENTRY]               = 'EditionEntry';
+                       $EBMLidList[EBML_ID_EDITIONFLAGDEFAULT]         = 'EditionFlagDefault';
+                       $EBMLidList[EBML_ID_EDITIONFLAGHIDDEN]          = 'EditionFlagHidden';
+                       $EBMLidList[EBML_ID_EDITIONFLAGORDERED]         = 'EditionFlagOrdered';
+                       $EBMLidList[EBML_ID_EDITIONUID]                 = 'EditionUID';
+                       $EBMLidList[EBML_ID_FILEDATA]                   = 'FileData';
+                       $EBMLidList[EBML_ID_FILEDESCRIPTION]            = 'FileDescription';
+                       $EBMLidList[EBML_ID_FILEMIMETYPE]               = 'FileMimeType';
+                       $EBMLidList[EBML_ID_FILENAME]                   = 'FileName';
+                       $EBMLidList[EBML_ID_FILEREFERRAL]               = 'FileReferral';
+                       $EBMLidList[EBML_ID_FILEUID]                    = 'FileUID';
+                       $EBMLidList[EBML_ID_FLAGDEFAULT]                = 'FlagDefault';
+                       $EBMLidList[EBML_ID_FLAGENABLED]                = 'FlagEnabled';
+                       $EBMLidList[EBML_ID_FLAGFORCED]                 = 'FlagForced';
+                       $EBMLidList[EBML_ID_FLAGINTERLACED]             = 'FlagInterlaced';
+                       $EBMLidList[EBML_ID_FLAGLACING]                 = 'FlagLacing';
+                       $EBMLidList[EBML_ID_GAMMAVALUE]                 = 'GammaValue';
+                       $EBMLidList[EBML_ID_INFO]                       = 'Info';
+                       $EBMLidList[EBML_ID_LANGUAGE]                   = 'Language';
+                       $EBMLidList[EBML_ID_MAXBLOCKADDITIONID]         = 'MaxBlockAdditionID';
+                       $EBMLidList[EBML_ID_MAXCACHE]                   = 'MaxCache';
+                       $EBMLidList[EBML_ID_MINCACHE]                   = 'MinCache';
+                       $EBMLidList[EBML_ID_MUXINGAPP]                  = 'MuxingApp';
+                       $EBMLidList[EBML_ID_NAME]                       = 'Name';
+                       $EBMLidList[EBML_ID_NEXTFILENAME]               = 'NextFilename';
+                       $EBMLidList[EBML_ID_NEXTUID]                    = 'NextUID';
+                       $EBMLidList[EBML_ID_OUTPUTSAMPLINGFREQUENCY]    = 'OutputSamplingFrequency';
+                       $EBMLidList[EBML_ID_PIXELCROPBOTTOM]            = 'PixelCropBottom';
+                       $EBMLidList[EBML_ID_PIXELCROPLEFT]              = 'PixelCropLeft';
+                       $EBMLidList[EBML_ID_PIXELCROPRIGHT]             = 'PixelCropRight';
+                       $EBMLidList[EBML_ID_PIXELCROPTOP]               = 'PixelCropTop';
+                       $EBMLidList[EBML_ID_PIXELHEIGHT]                = 'PixelHeight';
+                       $EBMLidList[EBML_ID_PIXELWIDTH]                 = 'PixelWidth';
+                       $EBMLidList[EBML_ID_PREVFILENAME]               = 'PrevFilename';
+                       $EBMLidList[EBML_ID_PREVUID]                    = 'PrevUID';
+                       $EBMLidList[EBML_ID_SAMPLINGFREQUENCY]          = 'SamplingFrequency';
+                       $EBMLidList[EBML_ID_SEEK]                       = 'Seek';
+                       $EBMLidList[EBML_ID_SEEKHEAD]                   = 'SeekHead';
+                       $EBMLidList[EBML_ID_SEEKID]                     = 'SeekID';
+                       $EBMLidList[EBML_ID_SEEKPOSITION]               = 'SeekPosition';
+                       $EBMLidList[EBML_ID_SEGMENT]                    = 'Segment';
+                       $EBMLidList[EBML_ID_SEGMENTFAMILY]              = 'SegmentFamily';
+                       $EBMLidList[EBML_ID_SEGMENTFILENAME]            = 'SegmentFilename';
+                       $EBMLidList[EBML_ID_SEGMENTUID]                 = 'SegmentUID';
+                       $EBMLidList[EBML_ID_SIMPLETAG]                  = 'SimpleTag';
+                       $EBMLidList[EBML_ID_CLUSTERSLICES]              = 'ClusterSlices';
+                       $EBMLidList[EBML_ID_STEREOMODE]                 = 'StereoMode';
+                       $EBMLidList[EBML_ID_OLDSTEREOMODE]              = 'OldStereoMode';
+                       $EBMLidList[EBML_ID_TAG]                        = 'Tag';
+                       $EBMLidList[EBML_ID_TAGATTACHMENTUID]           = 'TagAttachmentUID';
+                       $EBMLidList[EBML_ID_TAGBINARY]                  = 'TagBinary';
+                       $EBMLidList[EBML_ID_TAGCHAPTERUID]              = 'TagChapterUID';
+                       $EBMLidList[EBML_ID_TAGDEFAULT]                 = 'TagDefault';
+                       $EBMLidList[EBML_ID_TAGEDITIONUID]              = 'TagEditionUID';
+                       $EBMLidList[EBML_ID_TAGLANGUAGE]                = 'TagLanguage';
+                       $EBMLidList[EBML_ID_TAGNAME]                    = 'TagName';
+                       $EBMLidList[EBML_ID_TAGTRACKUID]                = 'TagTrackUID';
+                       $EBMLidList[EBML_ID_TAGS]                       = 'Tags';
+                       $EBMLidList[EBML_ID_TAGSTRING]                  = 'TagString';
+                       $EBMLidList[EBML_ID_TARGETS]                    = 'Targets';
+                       $EBMLidList[EBML_ID_TARGETTYPE]                 = 'TargetType';
+                       $EBMLidList[EBML_ID_TARGETTYPEVALUE]            = 'TargetTypeValue';
+                       $EBMLidList[EBML_ID_TIMECODESCALE]              = 'TimecodeScale';
+                       $EBMLidList[EBML_ID_TITLE]                      = 'Title';
+                       $EBMLidList[EBML_ID_TRACKENTRY]                 = 'TrackEntry';
+                       $EBMLidList[EBML_ID_TRACKNUMBER]                = 'TrackNumber';
+                       $EBMLidList[EBML_ID_TRACKOFFSET]                = 'TrackOffset';
+                       $EBMLidList[EBML_ID_TRACKOVERLAY]               = 'TrackOverlay';
+                       $EBMLidList[EBML_ID_TRACKS]                     = 'Tracks';
+                       $EBMLidList[EBML_ID_TRACKTIMECODESCALE]         = 'TrackTimecodeScale';
+                       $EBMLidList[EBML_ID_TRACKTRANSLATE]             = 'TrackTranslate';
+                       $EBMLidList[EBML_ID_TRACKTRANSLATECODEC]        = 'TrackTranslateCodec';
+                       $EBMLidList[EBML_ID_TRACKTRANSLATEEDITIONUID]   = 'TrackTranslateEditionUID';
+                       $EBMLidList[EBML_ID_TRACKTRANSLATETRACKID]      = 'TrackTranslateTrackID';
+                       $EBMLidList[EBML_ID_TRACKTYPE]                  = 'TrackType';
+                       $EBMLidList[EBML_ID_TRACKUID]                   = 'TrackUID';
+                       $EBMLidList[EBML_ID_VIDEO]                      = 'Video';
+                       $EBMLidList[EBML_ID_VOID]                       = 'Void';
+                       $EBMLidList[EBML_ID_WRITINGAPP]                 = 'WritingApp';
+               }
+
+               return (isset($EBMLidList[$value]) ? $EBMLidList[$value] : dechex($value));
+       }
+
+       public static function displayUnit($value) {
+               // http://www.matroska.org/technical/specs/index.html#DisplayUnit
+               static $units = array(
+                       0 => 'pixels',
+                       1 => 'centimeters',
+                       2 => 'inches',
+                       3 => 'Display Aspect Ratio');
+
+               return (isset($units[$value]) ? $units[$value] : 'unknown');
+       }
+
+       private static function getDefaultStreamInfo($streams)
+       {
+               foreach (array_reverse($streams) as $stream) {
+                       if ($stream['default']) {
+                               break;
+                       }
+               }
+
+               $unset = array('default', 'name');
+               foreach ($unset as $u) {
+                       if (isset($stream[$u])) {
+                               unset($stream[$u]);
+                       }
+               }
+
+               $info = $stream;
+               $info['streams'] = $streams;
+
+               return $info;
+       }
+
+}
diff --git a/wp-includes/ID3/module.audio-video.quicktime.php b/wp-includes/ID3/module.audio-video.quicktime.php
new file mode 100644 (file)
index 0000000..1b5ad5f
--- /dev/null
@@ -0,0 +1,2221 @@
+<?php
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org>               //
+//  available at http://getid3.sourceforge.net                 //
+//            or http://www.getid3.org                         //
+/////////////////////////////////////////////////////////////////
+// See readme.txt for more details                             //
+/////////////////////////////////////////////////////////////////
+//                                                             //
+// module.audio-video.quicktime.php                            //
+// module for analyzing Quicktime and MP3-in-MP4 files         //
+// dependencies: module.audio.mp3.php                          //
+// dependencies: module.tag.id3v2.php                          //
+//                                                            ///
+/////////////////////////////////////////////////////////////////
+
+getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.mp3.php', __FILE__, true);
+getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE__, true); // needed for ISO 639-2 language code lookup
+
+class getid3_quicktime extends getid3_handler
+{
+
+       public $ReturnAtomData        = true;
+       public $ParseAllPossibleAtoms = false;
+
+       public function Analyze() {
+               $info = &$this->getid3->info;
+
+               $info['fileformat'] = 'quicktime';
+               $info['quicktime']['hinting']    = false;
+               $info['quicktime']['controller'] = 'standard'; // may be overridden if 'ctyp' atom is present
+
+               fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET);
+
+               $offset      = 0;
+               $atomcounter = 0;
+
+               while ($offset < $info['avdataend']) {
+                       if (!getid3_lib::intValueSupported($offset)) {
+                               $info['error'][] = 'Unable to parse atom at offset '.$offset.' because beyond '.round(PHP_INT_MAX / 1073741824).'GB limit of PHP filesystem functions';
+                               break;
+                       }
+                       fseek($this->getid3->fp, $offset, SEEK_SET);
+                       $AtomHeader = fread($this->getid3->fp, 8);
+
+                       $atomsize = getid3_lib::BigEndian2Int(substr($AtomHeader, 0, 4));
+                       $atomname = substr($AtomHeader, 4, 4);
+
+                       // 64-bit MOV patch by jlegateØktnc*com
+                       if ($atomsize == 1) {
+                               $atomsize = getid3_lib::BigEndian2Int(fread($this->getid3->fp, 8));
+                       }
+
+                       $info['quicktime'][$atomname]['name']   = $atomname;
+                       $info['quicktime'][$atomname]['size']   = $atomsize;
+                       $info['quicktime'][$atomname]['offset'] = $offset;
+
+                       if (($offset + $atomsize) > $info['avdataend']) {
+                               $info['error'][] = 'Atom at offset '.$offset.' claims to go beyond end-of-file (length: '.$atomsize.' bytes)';
+                               return false;
+                       }
+
+                       if ($atomsize == 0) {
+                               // Furthermore, for historical reasons the list of atoms is optionally
+                               // terminated by a 32-bit integer set to 0. If you are writing a program
+                               // to read user data atoms, you should allow for the terminating 0.
+                               break;
+                       }
+                       switch ($atomname) {
+                               case 'mdat': // Media DATa atom
+                                       // 'mdat' contains the actual data for the audio/video
+                                       if (($atomsize > 8) && (!isset($info['avdataend_tmp']) || ($info['quicktime'][$atomname]['size'] > ($info['avdataend_tmp'] - $info['avdataoffset'])))) {
+
+                                               $info['avdataoffset'] = $info['quicktime'][$atomname]['offset'] + 8;
+                                               $OldAVDataEnd         = $info['avdataend'];
+                                               $info['avdataend']    = $info['quicktime'][$atomname]['offset'] + $info['quicktime'][$atomname]['size'];
+
+                                               $getid3_temp = new getID3();
+                                               $getid3_temp->openfile($this->getid3->filename);
+                                               $getid3_temp->info['avdataoffset'] = $info['avdataoffset'];
+                                               $getid3_temp->info['avdataend']    = $info['avdataend'];
+                                               $getid3_mp3 = new getid3_mp3($getid3_temp);
+                                               if ($getid3_mp3->MPEGaudioHeaderValid($getid3_mp3->MPEGaudioHeaderDecode(fread($this->getid3->fp, 4)))) {
+                                                       $getid3_mp3->getOnlyMPEGaudioInfo($getid3_temp->info['avdataoffset'], false);
+                                                       if (!empty($getid3_temp->info['warning'])) {
+                                                               foreach ($getid3_temp->info['warning'] as $value) {
+                                                                       $info['warning'][] = $value;
+                                                               }
+                                                       }
+                                                       if (!empty($getid3_temp->info['mpeg'])) {
+                                                               $info['mpeg'] = $getid3_temp->info['mpeg'];
+                                                               if (isset($info['mpeg']['audio'])) {
+                                                                       $info['audio']['dataformat']   = 'mp3';
+                                                                       $info['audio']['codec']        = (!empty($info['mpeg']['audio']['encoder']) ? $info['mpeg']['audio']['encoder'] : (!empty($info['mpeg']['audio']['codec']) ? $info['mpeg']['audio']['codec'] : (!empty($info['mpeg']['audio']['LAME']) ? 'LAME' :'mp3')));
+                                                                       $info['audio']['sample_rate']  = $info['mpeg']['audio']['sample_rate'];
+                                                                       $info['audio']['channels']     = $info['mpeg']['audio']['channels'];
+                                                                       $info['audio']['bitrate']      = $info['mpeg']['audio']['bitrate'];
+                                                                       $info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']);
+                                                                       $info['bitrate']               = $info['audio']['bitrate'];
+                                                               }
+                                                       }
+                                               }
+                                               unset($getid3_mp3, $getid3_temp);
+                                               $info['avdataend'] = $OldAVDataEnd;
+                                               unset($OldAVDataEnd);
+
+                                       }
+                                       break;
+
+                               case 'free': // FREE space atom
+                               case 'skip': // SKIP atom
+                               case 'wide': // 64-bit expansion placeholder atom
+                                       // 'free', 'skip' and 'wide' are just padding, contains no useful data at all
+                                       break;
+
+                               default:
+                                       $atomHierarchy = array();
+                                       $info['quicktime'][$atomname] = $this->QuicktimeParseAtom($atomname, $atomsize, fread($this->getid3->fp, $atomsize), $offset, $atomHierarchy, $this->ParseAllPossibleAtoms);
+                                       break;
+                       }
+
+                       $offset += $atomsize;
+                       $atomcounter++;
+               }
+
+               if (!empty($info['avdataend_tmp'])) {
+                       // this value is assigned to a temp value and then erased because
+                       // otherwise any atoms beyond the 'mdat' atom would not get parsed
+                       $info['avdataend'] = $info['avdataend_tmp'];
+                       unset($info['avdataend_tmp']);
+               }
+
+               if (!isset($info['bitrate']) && isset($info['playtime_seconds'])) {
+                       $info['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds'];
+               }
+               if (isset($info['bitrate']) && !isset($info['audio']['bitrate']) && !isset($info['quicktime']['video'])) {
+                       $info['audio']['bitrate'] = $info['bitrate'];
+               }
+               if (!empty($info['playtime_seconds']) && !isset($info['video']['frame_rate']) && !empty($info['quicktime']['stts_framecount'])) {
+                       foreach ($info['quicktime']['stts_framecount'] as $key => $samples_count) {
+                               $samples_per_second = $samples_count / $info['playtime_seconds'];
+                               if ($samples_per_second > 240) {
+                                       // has to be audio samples
+                               } else {
+                                       $info['video']['frame_rate'] = $samples_per_second;
+                                       break;
+                               }
+                       }
+               }
+               if (($info['audio']['dataformat'] == 'mp4') && empty($info['video']['resolution_x'])) {
+                       $info['fileformat'] = 'mp4';
+                       $info['mime_type']  = 'audio/mp4';
+                       unset($info['video']['dataformat']);
+               }
+
+               if (!$this->ReturnAtomData) {
+                       unset($info['quicktime']['moov']);
+               }
+
+               if (empty($info['audio']['dataformat']) && !empty($info['quicktime']['audio'])) {
+                       $info['audio']['dataformat'] = 'quicktime';
+               }
+               if (empty($info['video']['dataformat']) && !empty($info['quicktime']['video'])) {
+                       $info['video']['dataformat'] = 'quicktime';
+               }
+
+               return true;
+       }
+
+       public function QuicktimeParseAtom($atomname, $atomsize, $atom_data, $baseoffset, &$atomHierarchy, $ParseAllPossibleAtoms) {
+               // http://developer.apple.com/techpubs/quicktime/qtdevdocs/APIREF/INDEX/atomalphaindex.htm
+
+               $info = &$this->getid3->info;
+
+               //$atom_parent = array_pop($atomHierarchy);
+               $atom_parent = end($atomHierarchy); // http://www.getid3.org/phpBB3/viewtopic.php?t=1717
+               array_push($atomHierarchy, $atomname);
+               $atom_structure['hierarchy'] = implode(' ', $atomHierarchy);
+               $atom_structure['name']      = $atomname;
+               $atom_structure['size']      = $atomsize;
+               $atom_structure['offset']    = $baseoffset;
+//echo getid3_lib::PrintHexBytes(substr($atom_data, 0, 8)).'<br>';
+//echo getid3_lib::PrintHexBytes(substr($atom_data, 0, 8), false).'<br><br>';
+               switch ($atomname) {
+                       case 'moov': // MOVie container atom
+                       case 'trak': // TRAcK container atom
+                       case 'clip': // CLIPping container atom
+                       case 'matt': // track MATTe container atom
+                       case 'edts': // EDiTS container atom
+                       case 'tref': // Track REFerence container atom
+                       case 'mdia': // MeDIA container atom
+                       case 'minf': // Media INFormation container atom
+                       case 'dinf': // Data INFormation container atom
+                       case 'udta': // User DaTA container atom
+                       case 'cmov': // Compressed MOVie container atom
+                       case 'rmra': // Reference Movie Record Atom
+                       case 'rmda': // Reference Movie Descriptor Atom
+                       case 'gmhd': // Generic Media info HeaDer atom (seen on QTVR)
+                               $atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 8, $atomHierarchy, $ParseAllPossibleAtoms);
+                               break;
+
+                       case 'ilst': // Item LiST container atom
+                               $atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 8, $atomHierarchy, $ParseAllPossibleAtoms);
+
+                               // some "ilst" atoms contain data atoms that have a numeric name, and the data is far more accessible if the returned array is compacted
+                               $allnumericnames = true;
+                               foreach ($atom_structure['subatoms'] as $subatomarray) {
+                                       if (!is_integer($subatomarray['name']) || (count($subatomarray['subatoms']) != 1)) {
+                                               $allnumericnames = false;
+                                               break;
+                                       }
+                               }
+                               if ($allnumericnames) {
+                                       $newData = array();
+                                       foreach ($atom_structure['subatoms'] as $subatomarray) {
+                                               foreach ($subatomarray['subatoms'] as $newData_subatomarray) {
+                                                       unset($newData_subatomarray['hierarchy'], $newData_subatomarray['name']);
+                                                       $newData[$subatomarray['name']] = $newData_subatomarray;
+                                                       break;
+                                               }
+                                       }
+                                       $atom_structure['data'] = $newData;
+                                       unset($atom_structure['subatoms']);
+                               }
+                               break;
+
+                       case "\x00\x00\x00\x01":
+                       case "\x00\x00\x00\x02":
+                       case "\x00\x00\x00\x03":
+                       case "\x00\x00\x00\x04":
+                       case "\x00\x00\x00\x05":
+                               $atomname = getid3_lib::BigEndian2Int($atomname);
+                               $atom_structure['name'] = $atomname;
+                               $atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 8, $atomHierarchy, $ParseAllPossibleAtoms);
+                               break;
+
+                       case 'stbl': // Sample TaBLe container atom
+                               $atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 8, $atomHierarchy, $ParseAllPossibleAtoms);
+                               $isVideo = false;
+                               $framerate  = 0;
+                               $framecount = 0;
+                               foreach ($atom_structure['subatoms'] as $key => $value_array) {
+                                       if (isset($value_array['sample_description_table'])) {
+                                               foreach ($value_array['sample_description_table'] as $key2 => $value_array2) {
+                                                       if (isset($value_array2['data_format'])) {
+                                                               switch ($value_array2['data_format']) {
+                                                                       case 'avc1':
+                                                                       case 'mp4v':
+                                                                               // video data
+                                                                               $isVideo = true;
+                                                                               break;
+                                                                       case 'mp4a':
+                                                                               // audio data
+                                                                               break;
+                                                               }
+                                                       }
+                                               }
+                                       } elseif (isset($value_array['time_to_sample_table'])) {
+                                               foreach ($value_array['time_to_sample_table'] as $key2 => $value_array2) {
+                                                       if (isset($value_array2['sample_count']) && isset($value_array2['sample_duration']) && ($value_array2['sample_duration'] > 0)) {
+                                                               $framerate  = round($info['quicktime']['time_scale'] / $value_array2['sample_duration'], 3);
+                                                               $framecount = $value_array2['sample_count'];
+                                                       }
+                                               }
+                                       }
+                               }
+                               if ($isVideo && $framerate) {
+                                       $info['quicktime']['video']['frame_rate'] = $framerate;
+                                       $info['video']['frame_rate'] = $info['quicktime']['video']['frame_rate'];
+                               }
+                               if ($isVideo && $framecount) {
+                                       $info['quicktime']['video']['frame_count'] = $framecount;
+                               }
+                               break;
+
+
+                       case 'aART': // Album ARTist
+                       case 'catg': // CaTeGory
+                       case 'covr': // COVeR artwork
+                       case 'cpil': // ComPILation
+                       case 'cprt': // CoPyRighT
+                       case 'desc': // DESCription
+                       case 'disk': // DISK number
+                       case 'egid': // Episode Global ID
+                       case 'gnre': // GeNRE
+                       case 'keyw': // KEYWord
+                       case 'ldes':
+                       case 'pcst': // PodCaST
+                       case 'pgap': // GAPless Playback
+                       case 'purd': // PURchase Date
+                       case 'purl': // Podcast URL
+                       case 'rati':
+                       case 'rndu':
+                       case 'rpdu':
+                       case 'rtng': // RaTiNG
+                       case 'stik':
+                       case 'tmpo': // TeMPO (BPM)
+                       case 'trkn': // TRacK Number
+                       case 'tves': // TV EpiSode
+                       case 'tvnn': // TV Network Name
+                       case 'tvsh': // TV SHow Name
+                       case 'tvsn': // TV SeasoN
+                       case 'akID': // iTunes store account type
+                       case 'apID':
+                       case 'atID':
+                       case 'cmID':
+                       case 'cnID':
+                       case 'geID':
+                       case 'plID':
+                       case 'sfID': // iTunes store country
+                       case '©alb': // ALBum
+                       case '©art': // ARTist
+                       case '©ART':
+                       case '©aut':
+                       case '©cmt': // CoMmenT
+                       case '©com': // COMposer
+                       case '©cpy':
+                       case '©day': // content created year
+                       case '©dir':
+                       case '©ed1':
+                       case '©ed2':
+                       case '©ed3':
+                       case '©ed4':
+                       case '©ed5':
+                       case '©ed6':
+                       case '©ed7':
+                       case '©ed8':
+                       case '©ed9':
+                       case '©enc':
+                       case '©fmt':
+                       case '©gen': // GENre
+                       case '©grp': // GRouPing
+                       case '©hst':
+                       case '©inf':
+                       case '©lyr': // LYRics
+                       case '©mak':
+                       case '©mod':
+                       case '©nam': // full NAMe
+                       case '©ope':
+                       case '©PRD':
+                       case '©prd':
+                       case '©prf':
+                       case '©req':
+                       case '©src':
+                       case '©swr':
+                       case '©too': // encoder
+                       case '©trk': // TRacK
+                       case '©url':
+                       case '©wrn':
+                       case '©wrt': // WRiTer
+                       case '----': // itunes specific
+                               if ($atom_parent == 'udta') {
+                                       // User data atom handler
+                                       $atom_structure['data_length'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 2));
+                                       $atom_structure['language_id'] = getid3_lib::BigEndian2Int(substr($atom_data, 2, 2));
+                                       $atom_structure['data']        =                           substr($atom_data, 4);
+
+                                       $atom_structure['language']    = $this->QuicktimeLanguageLookup($atom_structure['language_id']);
+                                       if (empty($info['comments']['language']) || (!in_array($atom_structure['language'], $info['comments']['language']))) {
+                                               $info['comments']['language'][] = $atom_structure['language'];
+                                       }
+                               } else {
+                                       // Apple item list box atom handler
+                                       $atomoffset = 0;
+                                       if (substr($atom_data, 2, 2) == "\x10\xB5") {
+                                               // not sure what it means, but observed on iPhone4 data.
+                                               // Each $atom_data has 2 bytes of datasize, plus 0x10B5, then data
+                                               while ($atomoffset < strlen($atom_data)) {
+                                                       $boxsmallsize = getid3_lib::BigEndian2Int(substr($atom_data, $atomoffset,     2));
+                                                       $boxsmalltype =                           substr($atom_data, $atomoffset + 2, 2);
+                                                       $boxsmalldata =                           substr($atom_data, $atomoffset + 4, $boxsmallsize);
+                                                       if ($boxsmallsize <= 1) {
+                                                               $info['warning'][] = 'Invalid QuickTime atom smallbox size "'.$boxsmallsize.'" in atom "'.$atomname.'" at offset: '.($atom_structure['offset'] + $atomoffset);
+                                                               $atom_structure['data'] = null;
+                                                               $atomoffset = strlen($atom_data);
+                                                               break;
+                                                       }
+                                                       switch ($boxsmalltype) {
+                                                               case "\x10\xB5":
+                                                                       $atom_structure['data'] = $boxsmalldata;
+                                                                       break;
+                                                               default:
+                                                                       $info['warning'][] = 'Unknown QuickTime smallbox type: "'.getid3_lib::PrintHexBytes($boxsmalltype).'" at offset '.$baseoffset;
+                                                                       $atom_structure['data'] = $atom_data;
+                                                                       break;
+                                                       }
+                                                       $atomoffset += (4 + $boxsmallsize);
+                                               }
+                                       } else {
+                                               while ($atomoffset < strlen($atom_data)) {
+                                                       $boxsize = getid3_lib::BigEndian2Int(substr($atom_data, $atomoffset, 4));
+                                                       $boxtype =                           substr($atom_data, $atomoffset + 4, 4);
+                                                       $boxdata =                           substr($atom_data, $atomoffset + 8, $boxsize - 8);
+                                                       if ($boxsize <= 1) {
+                                                               $info['warning'][] = 'Invalid QuickTime atom box size "'.$boxsize.'" in atom "'.$atomname.'" at offset: '.($atom_structure['offset'] + $atomoffset);
+                                                               $atom_structure['data'] = null;
+                                                               $atomoffset = strlen($atom_data);
+                                                               break;
+                                                       }
+                                                       $atomoffset += $boxsize;
+
+                                                       switch ($boxtype) {
+                                                               case 'mean':
+                                                               case 'name':
+                                                                       $atom_structure[$boxtype] = substr($boxdata, 4);
+                                                                       break;
+
+                                                               case 'data':
+                                                                       $atom_structure['version']   = getid3_lib::BigEndian2Int(substr($boxdata,  0, 1));
+                                                                       $atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($boxdata,  1, 3));
+                                                                       switch ($atom_structure['flags_raw']) {
+                                                                               case 0:  // data flag
+                                                                               case 21: // tmpo/cpil flag
+                                                                                       switch ($atomname) {
+                                                                                               case 'cpil':
+                                                                                               case 'pcst':
+                                                                                               case 'pgap':
+                                                                                                       $atom_structure['data'] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 1));
+                                                                                                       break;
+
+                                                                                               case 'tmpo':
+                                                                                                       $atom_structure['data'] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 2));
+                                                                                                       break;
+
+                                                                                               case 'disk':
+                                                                                               case 'trkn':
+                                                                                                       $num       = getid3_lib::BigEndian2Int(substr($boxdata, 10, 2));
+                                                                                                       $num_total = getid3_lib::BigEndian2Int(substr($boxdata, 12, 2));
+                                                                                                       $atom_structure['data']  = empty($num) ? '' : $num;
+                                                                                                       $atom_structure['data'] .= empty($num_total) ? '' : '/'.$num_total;
+                                                                                                       break;
+
+                                                                                               case 'gnre':
+                                                                                                       $GenreID = getid3_lib::BigEndian2Int(substr($boxdata, 8, 4));
+                                                                                                       $atom_structure['data']    = getid3_id3v1::LookupGenreName($GenreID - 1);
+                                                                                                       break;
+
+                                                                                               case 'rtng':
+                                                                                                       $atom_structure[$atomname] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 1));
+                                                                                                       $atom_structure['data']    = $this->QuicktimeContentRatingLookup($atom_structure[$atomname]);
+                                                                                                       break;
+
+                                                                                               case 'stik':
+                                                                                                       $atom_structure[$atomname] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 1));
+                                                                                                       $atom_structure['data']    = $this->QuicktimeSTIKLookup($atom_structure[$atomname]);
+                                                                                                       break;
+
+                                                                                               case 'sfID':
+                                                                                                       $atom_structure[$atomname] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 4));
+                                                                                                       $atom_structure['data']    = $this->QuicktimeStoreFrontCodeLookup($atom_structure[$atomname]);
+                                                                                                       break;
+
+                                                                                               case 'egid':
+                                                                                               case 'purl':
+                                                                                                       $atom_structure['data'] = substr($boxdata, 8);
+                                                                                                       break;
+
+                                                                                               default:
+                                                                                                       $atom_structure['data'] = getid3_lib::BigEndian2Int(substr($boxdata, 8, 4));
+                                                                                       }
+                                                                                       break;
+
+                                                                               case 1:  // text flag
+                                                                               case 13: // image flag
+                                                                               default:
+                                                                                       $atom_structure['data'] = substr($boxdata, 8);
+                                                                                       break;
+
+                                                                       }
+                                                                       break;
+
+                                                               default:
+                                                                       $info['warning'][] = 'Unknown QuickTime box type: "'.getid3_lib::PrintHexBytes($boxtype).'" at offset '.$baseoffset;
+                                                                       $atom_structure['data'] = $atom_data;
+
+                                                       }
+                                               }
+                                       }
+                               }
+                               $this->CopyToAppropriateCommentsSection($atomname, $atom_structure['data'], $atom_structure['name']);
+                               break;
+
+
+                       case 'play': // auto-PLAY atom
+                               $atom_structure['autoplay'] = (bool) getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+
+                               $info['quicktime']['autoplay'] = $atom_structure['autoplay'];
+                               break;
+
+
+                       case 'WLOC': // Window LOCation atom
+                               $atom_structure['location_x']  = getid3_lib::BigEndian2Int(substr($atom_data,  0, 2));
+                               $atom_structure['location_y']  = getid3_lib::BigEndian2Int(substr($atom_data,  2, 2));
+                               break;
+
+
+                       case 'LOOP': // LOOPing atom
+                       case 'SelO': // play SELection Only atom
+                       case 'AllF': // play ALL Frames atom
+                               $atom_structure['data'] = getid3_lib::BigEndian2Int($atom_data);
+                               break;
+
+
+                       case 'name': //
+                       case 'MCPS': // Media Cleaner PRo
+                       case '@PRM': // adobe PReMiere version
+                       case '@PRQ': // adobe PRemiere Quicktime version
+                               $atom_structure['data'] = $atom_data;
+                               break;
+
+
+                       case 'cmvd': // Compressed MooV Data atom
+                               // Code by ubergeekØubergeek*tv based on information from
+                               // http://developer.apple.com/quicktime/icefloe/dispatch012.html
+                               $atom_structure['unCompressedSize'] = getid3_lib::BigEndian2Int(substr($atom_data, 0, 4));
+
+                               $CompressedFileData = substr($atom_data, 4);
+                               if ($UncompressedHeader = @gzuncompress($CompressedFileData)) {
+                                       $atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($UncompressedHeader, 0, $atomHierarchy, $ParseAllPossibleAtoms);
+                               } else {
+                                       $info['warning'][] = 'Error decompressing compressed MOV atom at offset '.$atom_structure['offset'];
+                               }
+                               break;
+
+
+                       case 'dcom': // Data COMpression atom
+                               $atom_structure['compression_id']   = $atom_data;
+                               $atom_structure['compression_text'] = $this->QuicktimeDCOMLookup($atom_data);
+                               break;
+
+
+                       case 'rdrf': // Reference movie Data ReFerence atom
+                               $atom_structure['version']                = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                               $atom_structure['flags_raw']              = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3));
+                               $atom_structure['flags']['internal_data'] = (bool) ($atom_structure['flags_raw'] & 0x000001);
+
+                               $atom_structure['reference_type_name']    =                           substr($atom_data,  4, 4);
+                               $atom_structure['reference_length']       = getid3_lib::BigEndian2Int(substr($atom_data,  8, 4));
+                               switch ($atom_structure['reference_type_name']) {
+                                       case 'url ':
+                                               $atom_structure['url']            =       $this->NoNullString(substr($atom_data, 12));
+                                               break;
+
+                                       case 'alis':
+                                               $atom_structure['file_alias']     =                           substr($atom_data, 12);
+                                               break;
+
+                                       case 'rsrc':
+                                               $atom_structure['resource_alias'] =                           substr($atom_data, 12);
+                                               break;
+
+                                       default:
+                                               $atom_structure['data']           =                           substr($atom_data, 12);
+                                               break;
+                               }
+                               break;
+
+
+                       case 'rmqu': // Reference Movie QUality atom
+                               $atom_structure['movie_quality'] = getid3_lib::BigEndian2Int($atom_data);
+                               break;
+
+
+                       case 'rmcs': // Reference Movie Cpu Speed atom
+                               $atom_structure['version']          = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                               $atom_structure['flags_raw']        = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
+                               $atom_structure['cpu_speed_rating'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 2));
+                               break;
+
+
+                       case 'rmvc': // Reference Movie Version Check atom
+                               $atom_structure['version']            = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                               $atom_structure['flags_raw']          = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
+                               $atom_structure['gestalt_selector']   =                           substr($atom_data,  4, 4);
+                               $atom_structure['gestalt_value_mask'] = getid3_lib::BigEndian2Int(substr($atom_data,  8, 4));
+                               $atom_structure['gestalt_value']      = getid3_lib::BigEndian2Int(substr($atom_data, 12, 4));
+                               $atom_structure['gestalt_check_type'] = getid3_lib::BigEndian2Int(substr($atom_data, 14, 2));
+                               break;
+
+
+                       case 'rmcd': // Reference Movie Component check atom
+                               $atom_structure['version']                = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                               $atom_structure['flags_raw']              = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
+                               $atom_structure['component_type']         =                           substr($atom_data,  4, 4);
+                               $atom_structure['component_subtype']      =                           substr($atom_data,  8, 4);
+                               $atom_structure['component_manufacturer'] =                           substr($atom_data, 12, 4);
+                               $atom_structure['component_flags_raw']    = getid3_lib::BigEndian2Int(substr($atom_data, 16, 4));
+                               $atom_structure['component_flags_mask']   = getid3_lib::BigEndian2Int(substr($atom_data, 20, 4));
+                               $atom_structure['component_min_version']  = getid3_lib::BigEndian2Int(substr($atom_data, 24, 4));
+                               break;
+
+
+                       case 'rmdr': // Reference Movie Data Rate atom
+                               $atom_structure['version']       = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                               $atom_structure['flags_raw']     = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
+                               $atom_structure['data_rate']     = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));
+
+                               $atom_structure['data_rate_bps'] = $atom_structure['data_rate'] * 10;
+                               break;
+
+
+                       case 'rmla': // Reference Movie Language Atom
+                               $atom_structure['version']     = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                               $atom_structure['flags_raw']   = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
+                               $atom_structure['language_id'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 2));
+
+                               $atom_structure['language']    = $this->QuicktimeLanguageLookup($atom_structure['language_id']);
+                               if (empty($info['comments']['language']) || (!in_array($atom_structure['language'], $info['comments']['language']))) {
+                                       $info['comments']['language'][] = $atom_structure['language'];
+                               }
+                               break;
+
+
+                       case 'rmla': // Reference Movie Language Atom
+                               $atom_structure['version']   = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                               $atom_structure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
+                               $atom_structure['track_id']  = getid3_lib::BigEndian2Int(substr($atom_data,  4, 2));
+                               break;
+
+
+                       case 'ptv ': // Print To Video - defines a movie's full screen mode
+                               // http://developer.apple.com/documentation/QuickTime/APIREF/SOURCESIV/at_ptv-_pg.htm
+                               $atom_structure['display_size_raw']  = getid3_lib::BigEndian2Int(substr($atom_data, 0, 2));
+                               $atom_structure['reserved_1']        = getid3_lib::BigEndian2Int(substr($atom_data, 2, 2)); // hardcoded: 0x0000
+                               $atom_structure['reserved_2']        = getid3_lib::BigEndian2Int(substr($atom_data, 4, 2)); // hardcoded: 0x0000
+                               $atom_structure['slide_show_flag']   = getid3_lib::BigEndian2Int(substr($atom_data, 6, 1));
+                               $atom_structure['play_on_open_flag'] = getid3_lib::BigEndian2Int(substr($atom_data, 7, 1));
+
+                               $atom_structure['flags']['play_on_open'] = (bool) $atom_structure['play_on_open_flag'];
+                               $atom_structure['flags']['slide_show']   = (bool) $atom_structure['slide_show_flag'];
+
+                               $ptv_lookup[0] = 'normal';
+                               $ptv_lookup[1] = 'double';
+                               $ptv_lookup[2] = 'half';
+                               $ptv_lookup[3] = 'full';
+                               $ptv_lookup[4] = 'current';
+                               if (isset($ptv_lookup[$atom_structure['display_size_raw']])) {
+                                       $atom_structure['display_size'] = $ptv_lookup[$atom_structure['display_size_raw']];
+                               } else {
+                                       $info['warning'][] = 'unknown "ptv " display constant ('.$atom_structure['display_size_raw'].')';
+                               }
+                               break;
+
+
+                       case 'stsd': // Sample Table Sample Description atom
+                               $atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                               $atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
+                               $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));
+                               $stsdEntriesDataOffset = 8;
+                               for ($i = 0; $i < $atom_structure['number_entries']; $i++) {
+                                       $atom_structure['sample_description_table'][$i]['size']             = getid3_lib::BigEndian2Int(substr($atom_data, $stsdEntriesDataOffset, 4));
+                                       $stsdEntriesDataOffset += 4;
+                                       $atom_structure['sample_description_table'][$i]['data_format']      =                           substr($atom_data, $stsdEntriesDataOffset, 4);
+                                       $stsdEntriesDataOffset += 4;
+                                       $atom_structure['sample_description_table'][$i]['reserved']         = getid3_lib::BigEndian2Int(substr($atom_data, $stsdEntriesDataOffset, 6));
+                                       $stsdEntriesDataOffset += 6;
+                                       $atom_structure['sample_description_table'][$i]['reference_index']  = getid3_lib::BigEndian2Int(substr($atom_data, $stsdEntriesDataOffset, 2));
+                                       $stsdEntriesDataOffset += 2;
+                                       $atom_structure['sample_description_table'][$i]['data']             =                           substr($atom_data, $stsdEntriesDataOffset, ($atom_structure['sample_description_table'][$i]['size'] - 4 - 4 - 6 - 2));
+                                       $stsdEntriesDataOffset += ($atom_structure['sample_description_table'][$i]['size'] - 4 - 4 - 6 - 2);
+
+                                       $atom_structure['sample_description_table'][$i]['encoder_version']  = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'],  0, 2));
+                                       $atom_structure['sample_description_table'][$i]['encoder_revision'] = getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'],  2, 2));
+                                       $atom_structure['sample_description_table'][$i]['encoder_vendor']   =                           substr($atom_structure['sample_description_table'][$i]['data'],  4, 4);
+
+                                       switch ($atom_structure['sample_description_table'][$i]['encoder_vendor']) {
+
+                                               case "\x00\x00\x00\x00":
+                                                       // audio tracks
+                                                       $atom_structure['sample_description_table'][$i]['audio_channels']       =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'],  8,  2));
+                                                       $atom_structure['sample_description_table'][$i]['audio_bit_depth']      =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 10,  2));
+                                                       $atom_structure['sample_description_table'][$i]['audio_compression_id'] =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 12,  2));
+                                                       $atom_structure['sample_description_table'][$i]['audio_packet_size']    =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 14,  2));
+                                                       $atom_structure['sample_description_table'][$i]['audio_sample_rate']    = getid3_lib::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 16,  4));
+
+                                                       // video tracks
+                                                       // http://developer.apple.com/library/mac/#documentation/QuickTime/QTFF/QTFFChap3/qtff3.html
+                                                       $atom_structure['sample_description_table'][$i]['temporal_quality'] =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'],  8,  4));
+                                                       $atom_structure['sample_description_table'][$i]['spatial_quality']  =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 12,  4));
+                                                       $atom_structure['sample_description_table'][$i]['width']            =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 16,  2));
+                                                       $atom_structure['sample_description_table'][$i]['height']           =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 18,  2));
+                                                       $atom_structure['sample_description_table'][$i]['resolution_x']     = getid3_lib::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 24,  4));
+                                                       $atom_structure['sample_description_table'][$i]['resolution_y']     = getid3_lib::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 28,  4));
+                                                       $atom_structure['sample_description_table'][$i]['data_size']        =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 32,  4));
+                                                       $atom_structure['sample_description_table'][$i]['frame_count']      =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 36,  2));
+                                                       $atom_structure['sample_description_table'][$i]['compressor_name']  =                             substr($atom_structure['sample_description_table'][$i]['data'], 38,  4);
+                                                       $atom_structure['sample_description_table'][$i]['pixel_depth']      =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 42,  2));
+                                                       $atom_structure['sample_description_table'][$i]['color_table_id']   =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 44,  2));
+
+                                                       switch ($atom_structure['sample_description_table'][$i]['data_format']) {
+                                                               case '2vuY':
+                                                               case 'avc1':
+                                                               case 'cvid':
+                                                               case 'dvc ':
+                                                               case 'dvcp':
+                                                               case 'gif ':
+                                                               case 'h263':
+                                                               case 'jpeg':
+                                                               case 'kpcd':
+                                                               case 'mjpa':
+                                                               case 'mjpb':
+                                                               case 'mp4v':
+                                                               case 'png ':
+                                                               case 'raw ':
+                                                               case 'rle ':
+                                                               case 'rpza':
+                                                               case 'smc ':
+                                                               case 'SVQ1':
+                                                               case 'SVQ3':
+                                                               case 'tiff':
+                                                               case 'v210':
+                                                               case 'v216':
+                                                               case 'v308':
+                                                               case 'v408':
+                                                               case 'v410':
+                                                               case 'yuv2':
+                                                                       $info['fileformat'] = 'mp4';
+                                                                       $info['video']['fourcc'] = $atom_structure['sample_description_table'][$i]['data_format'];
+// http://www.getid3.org/phpBB3/viewtopic.php?t=1550
+//if ((!empty($atom_structure['sample_description_table'][$i]['width']) && !empty($atom_structure['sample_description_table'][$i]['width'])) && (empty($info['video']['resolution_x']) || empty($info['video']['resolution_y']) || (number_format($info['video']['resolution_x'], 6) != number_format(round($info['video']['resolution_x']), 6)) || (number_format($info['video']['resolution_y'], 6) != number_format(round($info['video']['resolution_y']), 6)))) { // ugly check for floating point numbers
+if (!empty($atom_structure['sample_description_table'][$i]['width']) && !empty($atom_structure['sample_description_table'][$i]['height'])) {
+       // assume that values stored here are more important than values stored in [tkhd] atom
+       $info['video']['resolution_x'] = $atom_structure['sample_description_table'][$i]['width'];
+       $info['video']['resolution_y'] = $atom_structure['sample_description_table'][$i]['height'];
+       $info['quicktime']['video']['resolution_x'] = $info['video']['resolution_x'];
+       $info['quicktime']['video']['resolution_y'] = $info['video']['resolution_y'];
+}
+                                                                       break;
+
+                                                               case 'qtvr':
+                                                                       $info['video']['dataformat'] = 'quicktimevr';
+                                                                       break;
+
+                                                               case 'mp4a':
+                                                               default:
+                                                                       $info['quicktime']['audio']['codec']       = $this->QuicktimeAudioCodecLookup($atom_structure['sample_description_table'][$i]['data_format']);
+                                                                       $info['quicktime']['audio']['sample_rate'] = $atom_structure['sample_description_table'][$i]['audio_sample_rate'];
+                                                                       $info['quicktime']['audio']['channels']    = $atom_structure['sample_description_table'][$i]['audio_channels'];
+                                                                       $info['quicktime']['audio']['bit_depth']   = $atom_structure['sample_description_table'][$i]['audio_bit_depth'];
+                                                                       $info['audio']['codec']                    = $info['quicktime']['audio']['codec'];
+                                                                       $info['audio']['sample_rate']              = $info['quicktime']['audio']['sample_rate'];
+                                                                       $info['audio']['channels']                 = $info['quicktime']['audio']['channels'];
+                                                                       $info['audio']['bits_per_sample']          = $info['quicktime']['audio']['bit_depth'];
+                                                                       switch ($atom_structure['sample_description_table'][$i]['data_format']) {
+                                                                               case 'raw ': // PCM
+                                                                               case 'alac': // Apple Lossless Audio Codec
+                                                                                       $info['audio']['lossless'] = true;
+                                                                                       break;
+                                                                               default:
+                                                                                       $info['audio']['lossless'] = false;
+                                                                                       break;
+                                                                       }
+                                                                       break;
+                                                       }
+                                                       break;
+
+                                               default:
+                                                       switch ($atom_structure['sample_description_table'][$i]['data_format']) {
+                                                               case 'mp4s':
+                                                                       $info['fileformat'] = 'mp4';
+                                                                       break;
+
+                                                               default:
+                                                                       // video atom
+                                                                       $atom_structure['sample_description_table'][$i]['video_temporal_quality']  =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'],  8,  4));
+                                                                       $atom_structure['sample_description_table'][$i]['video_spatial_quality']   =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 12,  4));
+                                                                       $atom_structure['sample_description_table'][$i]['video_frame_width']       =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 16,  2));
+                                                                       $atom_structure['sample_description_table'][$i]['video_frame_height']      =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 18,  2));
+                                                                       $atom_structure['sample_description_table'][$i]['video_resolution_x']      = getid3_lib::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 20,  4));
+                                                                       $atom_structure['sample_description_table'][$i]['video_resolution_y']      = getid3_lib::FixedPoint16_16(substr($atom_structure['sample_description_table'][$i]['data'], 24,  4));
+                                                                       $atom_structure['sample_description_table'][$i]['video_data_size']         =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 28,  4));
+                                                                       $atom_structure['sample_description_table'][$i]['video_frame_count']       =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 32,  2));
+                                                                       $atom_structure['sample_description_table'][$i]['video_encoder_name_len']  =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 34,  1));
+                                                                       $atom_structure['sample_description_table'][$i]['video_encoder_name']      =                             substr($atom_structure['sample_description_table'][$i]['data'], 35, $atom_structure['sample_description_table'][$i]['video_encoder_name_len']);
+                                                                       $atom_structure['sample_description_table'][$i]['video_pixel_color_depth'] =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 66,  2));
+                                                                       $atom_structure['sample_description_table'][$i]['video_color_table_id']    =   getid3_lib::BigEndian2Int(substr($atom_structure['sample_description_table'][$i]['data'], 68,  2));
+
+                                                                       $atom_structure['sample_description_table'][$i]['video_pixel_color_type']  = (($atom_structure['sample_description_table'][$i]['video_pixel_color_depth'] > 32) ? 'grayscale' : 'color');
+                                                                       $atom_structure['sample_description_table'][$i]['video_pixel_color_name']  = $this->QuicktimeColorNameLookup($atom_structure['sample_description_table'][$i]['video_pixel_color_depth']);
+
+                                                                       if ($atom_structure['sample_description_table'][$i]['video_pixel_color_name'] != 'invalid') {
+                                                                               $info['quicktime']['video']['codec_fourcc']        = $atom_structure['sample_description_table'][$i]['data_format'];
+                                                                               $info['quicktime']['video']['codec_fourcc_lookup'] = $this->QuicktimeVideoCodecLookup($atom_structure['sample_description_table'][$i]['data_format']);
+                                                                               $info['quicktime']['video']['codec']               = (($atom_structure['sample_description_table'][$i]['video_encoder_name_len'] > 0) ? $atom_structure['sample_description_table'][$i]['video_encoder_name'] : $atom_structure['sample_description_table'][$i]['data_format']);
+                                                                               $info['quicktime']['video']['color_depth']         = $atom_structure['sample_description_table'][$i]['video_pixel_color_depth'];
+                                                                               $info['quicktime']['video']['color_depth_name']    = $atom_structure['sample_description_table'][$i]['video_pixel_color_name'];
+
+                                                                               $info['video']['codec']           = $info['quicktime']['video']['codec'];
+                                                                               $info['video']['bits_per_sample'] = $info['quicktime']['video']['color_depth'];
+                                                                       }
+                                                                       $info['video']['lossless']           = false;
+                                                                       $info['video']['pixel_aspect_ratio'] = (float) 1;
+                                                                       break;
+                                                       }
+                                                       break;
+                                       }
+                                       switch (strtolower($atom_structure['sample_description_table'][$i]['data_format'])) {
+                                               case 'mp4a':
+                                                       $info['audio']['dataformat']         = 'mp4';
+                                                       $info['quicktime']['audio']['codec'] = 'mp4';
+                                                       break;
+
+                                               case '3ivx':
+                                               case '3iv1':
+                                               case '3iv2':
+                                                       $info['video']['dataformat'] = '3ivx';
+                                                       break;
+
+                                               case 'xvid':
+                                                       $info['video']['dataformat'] = 'xvid';
+                                                       break;
+
+                                               case 'mp4v':
+                                                       $info['video']['dataformat'] = 'mpeg4';
+                                                       break;
+
+                                               case 'divx':
+                                               case 'div1':
+                                               case 'div2':
+                                               case 'div3':
+                                               case 'div4':
+                                               case 'div5':
+                                               case 'div6':
+                                                       $info['video']['dataformat'] = 'divx';
+                                                       break;
+
+                                               default:
+                                                       // do nothing
+                                                       break;
+                                       }
+                                       unset($atom_structure['sample_description_table'][$i]['data']);
+                               }
+                               break;
+
+
+                       case 'stts': // Sample Table Time-to-Sample atom
+                               $atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                               $atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
+                               $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));
+                               $sttsEntriesDataOffset = 8;
+                               //$FrameRateCalculatorArray = array();
+                               $frames_count = 0;
+                               for ($i = 0; $i < $atom_structure['number_entries']; $i++) {
+                                       $atom_structure['time_to_sample_table'][$i]['sample_count']    = getid3_lib::BigEndian2Int(substr($atom_data, $sttsEntriesDataOffset, 4));
+                                       $sttsEntriesDataOffset += 4;
+                                       $atom_structure['time_to_sample_table'][$i]['sample_duration'] = getid3_lib::BigEndian2Int(substr($atom_data, $sttsEntriesDataOffset, 4));
+                                       $sttsEntriesDataOffset += 4;
+
+                                       $frames_count += $atom_structure['time_to_sample_table'][$i]['sample_count'];
+
+                                       // THIS SECTION REPLACED WITH CODE IN "stbl" ATOM
+                                       //if (!empty($info['quicktime']['time_scale']) && ($atom_structure['time_to_sample_table'][$i]['sample_duration'] > 0)) {
+                                       //      $stts_new_framerate = $info['quicktime']['time_scale'] / $atom_structure['time_to_sample_table'][$i]['sample_duration'];
+                                       //      if ($stts_new_framerate <= 60) {
+                                       //              // some atoms have durations of "1" giving a very large framerate, which probably is not right
+                                       //              $info['video']['frame_rate'] = max($info['video']['frame_rate'], $stts_new_framerate);
+                                       //      }
+                                       //}
+                                       //
+                                       //$FrameRateCalculatorArray[($info['quicktime']['time_scale'] / $atom_structure['time_to_sample_table'][$i]['sample_duration'])] += $atom_structure['time_to_sample_table'][$i]['sample_count'];
+                               }
+                               $info['quicktime']['stts_framecount'][] = $frames_count;
+                               //$sttsFramesTotal  = 0;
+                               //$sttsSecondsTotal = 0;
+                               //foreach ($FrameRateCalculatorArray as $frames_per_second => $frame_count) {
+                               //      if (($frames_per_second > 60) || ($frames_per_second < 1)) {
+                               //              // not video FPS information, probably audio information
+                               //              $sttsFramesTotal  = 0;
+                               //              $sttsSecondsTotal = 0;
+                               //              break;
+                               //      }
+                               //      $sttsFramesTotal  += $frame_count;
+                               //      $sttsSecondsTotal += $frame_count / $frames_per_second;
+                               //}
+                               //if (($sttsFramesTotal > 0) && ($sttsSecondsTotal > 0)) {
+                               //      if (($sttsFramesTotal / $sttsSecondsTotal) > $info['video']['frame_rate']) {
+                               //              $info['video']['frame_rate'] = $sttsFramesTotal / $sttsSecondsTotal;
+                               //      }
+                               //}
+                               break;
+
+
+                       case 'stss': // Sample Table Sync Sample (key frames) atom
+                               if ($ParseAllPossibleAtoms) {
+                                       $atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                                       $atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
+                                       $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));
+                                       $stssEntriesDataOffset = 8;
+                                       for ($i = 0; $i < $atom_structure['number_entries']; $i++) {
+                                               $atom_structure['time_to_sample_table'][$i] = getid3_lib::BigEndian2Int(substr($atom_data, $stssEntriesDataOffset, 4));
+                                               $stssEntriesDataOffset += 4;
+                                       }
+                               }
+                               break;
+
+
+                       case 'stsc': // Sample Table Sample-to-Chunk atom
+                               if ($ParseAllPossibleAtoms) {
+                                       $atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                                       $atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
+                                       $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));
+                                       $stscEntriesDataOffset = 8;
+                                       for ($i = 0; $i < $atom_structure['number_entries']; $i++) {
+                                               $atom_structure['sample_to_chunk_table'][$i]['first_chunk']        = getid3_lib::BigEndian2Int(substr($atom_data, $stscEntriesDataOffset, 4));
+                                               $stscEntriesDataOffset += 4;
+                                               $atom_structure['sample_to_chunk_table'][$i]['samples_per_chunk']  = getid3_lib::BigEndian2Int(substr($atom_data, $stscEntriesDataOffset, 4));
+                                               $stscEntriesDataOffset += 4;
+                                               $atom_structure['sample_to_chunk_table'][$i]['sample_description'] = getid3_lib::BigEndian2Int(substr($atom_data, $stscEntriesDataOffset, 4));
+                                               $stscEntriesDataOffset += 4;
+                                       }
+                               }
+                               break;
+
+
+                       case 'stsz': // Sample Table SiZe atom
+                               if ($ParseAllPossibleAtoms) {
+                                       $atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                                       $atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
+                                       $atom_structure['sample_size']    = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));
+                                       $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  8, 4));
+                                       $stszEntriesDataOffset = 12;
+                                       if ($atom_structure['sample_size'] == 0) {
+                                               for ($i = 0; $i < $atom_structure['number_entries']; $i++) {
+                                                       $atom_structure['sample_size_table'][$i] = getid3_lib::BigEndian2Int(substr($atom_data, $stszEntriesDataOffset, 4));
+                                                       $stszEntriesDataOffset += 4;
+                                               }
+                                       }
+                               }
+                               break;
+
+
+                       case 'stco': // Sample Table Chunk Offset atom
+                               if ($ParseAllPossibleAtoms) {
+                                       $atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                                       $atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
+                                       $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));
+                                       $stcoEntriesDataOffset = 8;
+                                       for ($i = 0; $i < $atom_structure['number_entries']; $i++) {
+                                               $atom_structure['chunk_offset_table'][$i] = getid3_lib::BigEndian2Int(substr($atom_data, $stcoEntriesDataOffset, 4));
+                                               $stcoEntriesDataOffset += 4;
+                                       }
+                               }
+                               break;
+
+
+                       case 'co64': // Chunk Offset 64-bit (version of "stco" that supports > 2GB files)
+                               if ($ParseAllPossibleAtoms) {
+                                       $atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                                       $atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
+                                       $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));
+                                       $stcoEntriesDataOffset = 8;
+                                       for ($i = 0; $i < $atom_structure['number_entries']; $i++) {
+                                               $atom_structure['chunk_offset_table'][$i] = getid3_lib::BigEndian2Int(substr($atom_data, $stcoEntriesDataOffset, 8));
+                                               $stcoEntriesDataOffset += 8;
+                                       }
+                               }
+                               break;
+
+
+                       case 'dref': // Data REFerence atom
+                               $atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                               $atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
+                               $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));
+                               $drefDataOffset = 8;
+                               for ($i = 0; $i < $atom_structure['number_entries']; $i++) {
+                                       $atom_structure['data_references'][$i]['size']                    = getid3_lib::BigEndian2Int(substr($atom_data, $drefDataOffset, 4));
+                                       $drefDataOffset += 4;
+                                       $atom_structure['data_references'][$i]['type']                    =               substr($atom_data, $drefDataOffset, 4);
+                                       $drefDataOffset += 4;
+                                       $atom_structure['data_references'][$i]['version']                 = getid3_lib::BigEndian2Int(substr($atom_data,  $drefDataOffset, 1));
+                                       $drefDataOffset += 1;
+                                       $atom_structure['data_references'][$i]['flags_raw']               = getid3_lib::BigEndian2Int(substr($atom_data,  $drefDataOffset, 3)); // hardcoded: 0x0000
+                                       $drefDataOffset += 3;
+                                       $atom_structure['data_references'][$i]['data']                    =               substr($atom_data, $drefDataOffset, ($atom_structure['data_references'][$i]['size'] - 4 - 4 - 1 - 3));
+                                       $drefDataOffset += ($atom_structure['data_references'][$i]['size'] - 4 - 4 - 1 - 3);
+
+                                       $atom_structure['data_references'][$i]['flags']['self_reference'] = (bool) ($atom_structure['data_references'][$i]['flags_raw'] & 0x001);
+                               }
+                               break;
+
+
+                       case 'gmin': // base Media INformation atom
+                               $atom_structure['version']                = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                               $atom_structure['flags_raw']              = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
+                               $atom_structure['graphics_mode']          = getid3_lib::BigEndian2Int(substr($atom_data,  4, 2));
+                               $atom_structure['opcolor_red']            = getid3_lib::BigEndian2Int(substr($atom_data,  6, 2));
+                               $atom_structure['opcolor_green']          = getid3_lib::BigEndian2Int(substr($atom_data,  8, 2));
+                               $atom_structure['opcolor_blue']           = getid3_lib::BigEndian2Int(substr($atom_data, 10, 2));
+                               $atom_structure['balance']                = getid3_lib::BigEndian2Int(substr($atom_data, 12, 2));
+                               $atom_structure['reserved']               = getid3_lib::BigEndian2Int(substr($atom_data, 14, 2));
+                               break;
+
+
+                       case 'smhd': // Sound Media information HeaDer atom
+                               $atom_structure['version']                = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                               $atom_structure['flags_raw']              = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
+                               $atom_structure['balance']                = getid3_lib::BigEndian2Int(substr($atom_data,  4, 2));
+                               $atom_structure['reserved']               = getid3_lib::BigEndian2Int(substr($atom_data,  6, 2));
+                               break;
+
+
+                       case 'vmhd': // Video Media information HeaDer atom
+                               $atom_structure['version']                = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                               $atom_structure['flags_raw']              = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3));
+                               $atom_structure['graphics_mode']          = getid3_lib::BigEndian2Int(substr($atom_data,  4, 2));
+                               $atom_structure['opcolor_red']            = getid3_lib::BigEndian2Int(substr($atom_data,  6, 2));
+                               $atom_structure['opcolor_green']          = getid3_lib::BigEndian2Int(substr($atom_data,  8, 2));
+                               $atom_structure['opcolor_blue']           = getid3_lib::BigEndian2Int(substr($atom_data, 10, 2));
+
+                               $atom_structure['flags']['no_lean_ahead'] = (bool) ($atom_structure['flags_raw'] & 0x001);
+                               break;
+
+
+                       case 'hdlr': // HanDLeR reference atom
+                               $atom_structure['version']                = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                               $atom_structure['flags_raw']              = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
+                               $atom_structure['component_type']         =                           substr($atom_data,  4, 4);
+                               $atom_structure['component_subtype']      =                           substr($atom_data,  8, 4);
+                               $atom_structure['component_manufacturer'] =                           substr($atom_data, 12, 4);
+                               $atom_structure['component_flags_raw']    = getid3_lib::BigEndian2Int(substr($atom_data, 16, 4));
+                               $atom_structure['component_flags_mask']   = getid3_lib::BigEndian2Int(substr($atom_data, 20, 4));
+                               $atom_structure['component_name']         =      $this->Pascal2String(substr($atom_data, 24));
+
+                               if (($atom_structure['component_subtype'] == 'STpn') && ($atom_structure['component_manufacturer'] == 'zzzz')) {
+                                       $info['video']['dataformat'] = 'quicktimevr';
+                               }
+                               break;
+
+
+                       case 'mdhd': // MeDia HeaDer atom
+                               $atom_structure['version']               = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                               $atom_structure['flags_raw']             = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
+                               $atom_structure['creation_time']         = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));
+                               $atom_structure['modify_time']           = getid3_lib::BigEndian2Int(substr($atom_data,  8, 4));
+                               $atom_structure['time_scale']            = getid3_lib::BigEndian2Int(substr($atom_data, 12, 4));
+                               $atom_structure['duration']              = getid3_lib::BigEndian2Int(substr($atom_data, 16, 4));
+                               $atom_structure['language_id']           = getid3_lib::BigEndian2Int(substr($atom_data, 20, 2));
+                               $atom_structure['quality']               = getid3_lib::BigEndian2Int(substr($atom_data, 22, 2));
+
+                               if ($atom_structure['time_scale'] == 0) {
+                                       $info['error'][] = 'Corrupt Quicktime file: mdhd.time_scale == zero';
+                                       return false;
+                               }
+                               $info['quicktime']['time_scale'] = (isset($info['quicktime']['time_scale']) ? max($info['quicktime']['time_scale'], $atom_structure['time_scale']) : $atom_structure['time_scale']);
+
+                               $atom_structure['creation_time_unix']    = getid3_lib::DateMac2Unix($atom_structure['creation_time']);
+                               $atom_structure['modify_time_unix']      = getid3_lib::DateMac2Unix($atom_structure['modify_time']);
+                               $atom_structure['playtime_seconds']      = $atom_structure['duration'] / $atom_structure['time_scale'];
+                               $atom_structure['language']              = $this->QuicktimeLanguageLookup($atom_structure['language_id']);
+                               if (empty($info['comments']['language']) || (!in_array($atom_structure['language'], $info['comments']['language']))) {
+                                       $info['comments']['language'][] = $atom_structure['language'];
+                               }
+                               break;
+
+
+                       case 'pnot': // Preview atom
+                               $atom_structure['modification_date']      = getid3_lib::BigEndian2Int(substr($atom_data,  0, 4)); // "standard Macintosh format"
+                               $atom_structure['version_number']         = getid3_lib::BigEndian2Int(substr($atom_data,  4, 2)); // hardcoded: 0x00
+                               $atom_structure['atom_type']              =               substr($atom_data,  6, 4);        // usually: 'PICT'
+                               $atom_structure['atom_index']             = getid3_lib::BigEndian2Int(substr($atom_data, 10, 2)); // usually: 0x01
+
+                               $atom_structure['modification_date_unix'] = getid3_lib::DateMac2Unix($atom_structure['modification_date']);
+                               break;
+
+
+                       case 'crgn': // Clipping ReGioN atom
+                               $atom_structure['region_size']   = getid3_lib::BigEndian2Int(substr($atom_data,  0, 2)); // The Region size, Region boundary box,
+                               $atom_structure['boundary_box']  = getid3_lib::BigEndian2Int(substr($atom_data,  2, 8)); // and Clipping region data fields
+                               $atom_structure['clipping_data'] =               substr($atom_data, 10);           // constitute a QuickDraw region.
+                               break;
+
+
+                       case 'load': // track LOAD settings atom
+                               $atom_structure['preload_start_time'] = getid3_lib::BigEndian2Int(substr($atom_data,  0, 4));
+                               $atom_structure['preload_duration']   = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));
+                               $atom_structure['preload_flags_raw']  = getid3_lib::BigEndian2Int(substr($atom_data,  8, 4));
+                               $atom_structure['default_hints_raw']  = getid3_lib::BigEndian2Int(substr($atom_data, 12, 4));
+
+                               $atom_structure['default_hints']['double_buffer'] = (bool) ($atom_structure['default_hints_raw'] & 0x0020);
+                               $atom_structure['default_hints']['high_quality']  = (bool) ($atom_structure['default_hints_raw'] & 0x0100);
+                               break;
+
+
+                       case 'tmcd': // TiMe CoDe atom
+                       case 'chap': // CHAPter list atom
+                       case 'sync': // SYNChronization atom
+                       case 'scpt': // tranSCriPT atom
+                       case 'ssrc': // non-primary SouRCe atom
+                               for ($i = 0; $i < (strlen($atom_data) % 4); $i++) {
+                                       $atom_structure['track_id'][$i] = getid3_lib::BigEndian2Int(substr($atom_data, $i * 4, 4));
+                               }
+                               break;
+
+
+                       case 'elst': // Edit LiST atom
+                               $atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                               $atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
+                               $atom_structure['number_entries'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));
+                               for ($i = 0; $i < $atom_structure['number_entries']; $i++ ) {
+                                       $atom_structure['edit_list'][$i]['track_duration'] =   getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($i * 12) + 0, 4));
+                                       $atom_structure['edit_list'][$i]['media_time']     =   getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($i * 12) + 4, 4));
+                                       $atom_structure['edit_list'][$i]['media_rate']     = getid3_lib::FixedPoint16_16(substr($atom_data, 8 + ($i * 12) + 8, 4));
+                               }
+                               break;
+
+
+                       case 'kmat': // compressed MATte atom
+                               $atom_structure['version']        = getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                               $atom_structure['flags_raw']      = getid3_lib::BigEndian2Int(substr($atom_data,  1, 3)); // hardcoded: 0x0000
+                               $atom_structure['matte_data_raw'] =               substr($atom_data,  4);
+                               break;
+
+
+                       case 'ctab': // Color TABle atom
+                               $atom_structure['color_table_seed']   = getid3_lib::BigEndian2Int(substr($atom_data,  0, 4)); // hardcoded: 0x00000000
+                               $atom_structure['color_table_flags']  = getid3_lib::BigEndian2Int(substr($atom_data,  4, 2)); // hardcoded: 0x8000
+                               $atom_structure['color_table_size']   = getid3_lib::BigEndian2Int(substr($atom_data,  6, 2)) + 1;
+                               for ($colortableentry = 0; $colortableentry < $atom_structure['color_table_size']; $colortableentry++) {
+                                       $atom_structure['color_table'][$colortableentry]['alpha'] = getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($colortableentry * 8) + 0, 2));
+                                       $atom_structure['color_table'][$colortableentry]['red']   = getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($colortableentry * 8) + 2, 2));
+                                       $atom_structure['color_table'][$colortableentry]['green'] = getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($colortableentry * 8) + 4, 2));
+                                       $atom_structure['color_table'][$colortableentry]['blue']  = getid3_lib::BigEndian2Int(substr($atom_data, 8 + ($colortableentry * 8) + 6, 2));
+                               }
+                               break;
+
+
+                       case 'mvhd': // MoVie HeaDer atom
+                               $atom_structure['version']            =   getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                               $atom_structure['flags_raw']          =   getid3_lib::BigEndian2Int(substr($atom_data,  1, 3));
+                               $atom_structure['creation_time']      =   getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));
+                               $atom_structure['modify_time']        =   getid3_lib::BigEndian2Int(substr($atom_data,  8, 4));
+                               $atom_structure['time_scale']         =   getid3_lib::BigEndian2Int(substr($atom_data, 12, 4));
+                               $atom_structure['duration']           =   getid3_lib::BigEndian2Int(substr($atom_data, 16, 4));
+                               $atom_structure['preferred_rate']     = getid3_lib::FixedPoint16_16(substr($atom_data, 20, 4));
+                               $atom_structure['preferred_volume']   =   getid3_lib::FixedPoint8_8(substr($atom_data, 24, 2));
+                               $atom_structure['reserved']           =                             substr($atom_data, 26, 10);
+                               $atom_structure['matrix_a']           = getid3_lib::FixedPoint16_16(substr($atom_data, 36, 4));
+                               $atom_structure['matrix_b']           = getid3_lib::FixedPoint16_16(substr($atom_data, 40, 4));
+                               $atom_structure['matrix_u']           =  getid3_lib::FixedPoint2_30(substr($atom_data, 44, 4));
+                               $atom_structure['matrix_c']           = getid3_lib::FixedPoint16_16(substr($atom_data, 48, 4));
+                               $atom_structure['matrix_d']           = getid3_lib::FixedPoint16_16(substr($atom_data, 52, 4));
+                               $atom_structure['matrix_v']           =  getid3_lib::FixedPoint2_30(substr($atom_data, 56, 4));
+                               $atom_structure['matrix_x']           = getid3_lib::FixedPoint16_16(substr($atom_data, 60, 4));
+                               $atom_structure['matrix_y']           = getid3_lib::FixedPoint16_16(substr($atom_data, 64, 4));
+                               $atom_structure['matrix_w']           =  getid3_lib::FixedPoint2_30(substr($atom_data, 68, 4));
+                               $atom_structure['preview_time']       =   getid3_lib::BigEndian2Int(substr($atom_data, 72, 4));
+                               $atom_structure['preview_duration']   =   getid3_lib::BigEndian2Int(substr($atom_data, 76, 4));
+                               $atom_structure['poster_time']        =   getid3_lib::BigEndian2Int(substr($atom_data, 80, 4));
+                               $atom_structure['selection_time']     =   getid3_lib::BigEndian2Int(substr($atom_data, 84, 4));
+                               $atom_structure['selection_duration'] =   getid3_lib::BigEndian2Int(substr($atom_data, 88, 4));
+                               $atom_structure['current_time']       =   getid3_lib::BigEndian2Int(substr($atom_data, 92, 4));
+                               $atom_structure['next_track_id']      =   getid3_lib::BigEndian2Int(substr($atom_data, 96, 4));
+
+                               if ($atom_structure['time_scale'] == 0) {
+                                       $info['error'][] = 'Corrupt Quicktime file: mvhd.time_scale == zero';
+                                       return false;
+                               }
+                               $atom_structure['creation_time_unix']        = getid3_lib::DateMac2Unix($atom_structure['creation_time']);
+                               $atom_structure['modify_time_unix']          = getid3_lib::DateMac2Unix($atom_structure['modify_time']);
+                               $info['quicktime']['time_scale']    = (isset($info['quicktime']['time_scale']) ? max($info['quicktime']['time_scale'], $atom_structure['time_scale']) : $atom_structure['time_scale']);
+                               $info['quicktime']['display_scale'] = $atom_structure['matrix_a'];
+                               $info['playtime_seconds']           = $atom_structure['duration'] / $atom_structure['time_scale'];
+                               break;
+
+
+                       case 'tkhd': // TracK HeaDer atom
+                               $atom_structure['version']             =   getid3_lib::BigEndian2Int(substr($atom_data,  0, 1));
+                               $atom_structure['flags_raw']           =   getid3_lib::BigEndian2Int(substr($atom_data,  1, 3));
+                               $atom_structure['creation_time']       =   getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));
+                               $atom_structure['modify_time']         =   getid3_lib::BigEndian2Int(substr($atom_data,  8, 4));
+                               $atom_structure['trackid']             =   getid3_lib::BigEndian2Int(substr($atom_data, 12, 4));
+                               $atom_structure['reserved1']           =   getid3_lib::BigEndian2Int(substr($atom_data, 16, 4));
+                               $atom_structure['duration']            =   getid3_lib::BigEndian2Int(substr($atom_data, 20, 4));
+                               $atom_structure['reserved2']           =   getid3_lib::BigEndian2Int(substr($atom_data, 24, 8));
+                               $atom_structure['layer']               =   getid3_lib::BigEndian2Int(substr($atom_data, 32, 2));
+                               $atom_structure['alternate_group']     =   getid3_lib::BigEndian2Int(substr($atom_data, 34, 2));
+                               $atom_structure['volume']              =   getid3_lib::FixedPoint8_8(substr($atom_data, 36, 2));
+                               $atom_structure['reserved3']           =   getid3_lib::BigEndian2Int(substr($atom_data, 38, 2));
+// http://developer.apple.com/library/mac/#documentation/QuickTime/RM/MovieBasics/MTEditing/K-Chapter/11MatrixFunctions.html
+// http://developer.apple.com/library/mac/#documentation/QuickTime/qtff/QTFFChap4/qtff4.html#//apple_ref/doc/uid/TP40000939-CH206-18737
+                               $atom_structure['matrix_a']            = getid3_lib::FixedPoint16_16(substr($atom_data, 40, 4));
+                               $atom_structure['matrix_b']            = getid3_lib::FixedPoint16_16(substr($atom_data, 44, 4));
+                               $atom_structure['matrix_u']            =  getid3_lib::FixedPoint2_30(substr($atom_data, 48, 4));
+                               $atom_structure['matrix_c']            = getid3_lib::FixedPoint16_16(substr($atom_data, 52, 4));
+                               $atom_structure['matrix_d']            = getid3_lib::FixedPoint16_16(substr($atom_data, 56, 4));
+                               $atom_structure['matrix_v']            =  getid3_lib::FixedPoint2_30(substr($atom_data, 60, 4));
+                               $atom_structure['matrix_x']            = getid3_lib::FixedPoint16_16(substr($atom_data, 64, 4));
+                               $atom_structure['matrix_y']            = getid3_lib::FixedPoint16_16(substr($atom_data, 68, 4));
+                               $atom_structure['matrix_w']            =  getid3_lib::FixedPoint2_30(substr($atom_data, 72, 4));
+                               $atom_structure['width']               = getid3_lib::FixedPoint16_16(substr($atom_data, 76, 4));
+                               $atom_structure['height']              = getid3_lib::FixedPoint16_16(substr($atom_data, 80, 4));
+                               $atom_structure['flags']['enabled']    = (bool) ($atom_structure['flags_raw'] & 0x0001);
+                               $atom_structure['flags']['in_movie']   = (bool) ($atom_structure['flags_raw'] & 0x0002);
+                               $atom_structure['flags']['in_preview'] = (bool) ($atom_structure['flags_raw'] & 0x0004);
+                               $atom_structure['flags']['in_poster']  = (bool) ($atom_structure['flags_raw'] & 0x0008);
+                               $atom_structure['creation_time_unix']  = getid3_lib::DateMac2Unix($atom_structure['creation_time']);
+                               $atom_structure['modify_time_unix']    = getid3_lib::DateMac2Unix($atom_structure['modify_time']);
+
+                               if ($atom_structure['flags']['enabled'] == 1) {
+                                       if (!isset($info['video']['resolution_x']) || !isset($info['video']['resolution_y'])) {
+                                               $info['video']['resolution_x'] = $atom_structure['width'];
+                                               $info['video']['resolution_y'] = $atom_structure['height'];
+                                       }
+                                       $info['video']['resolution_x'] = max($info['video']['resolution_x'], $atom_structure['width']);
+                                       $info['video']['resolution_y'] = max($info['video']['resolution_y'], $atom_structure['height']);
+                                       $info['quicktime']['video']['resolution_x'] = $info['video']['resolution_x'];
+                                       $info['quicktime']['video']['resolution_y'] = $info['video']['resolution_y'];
+                               } else {
+                                       // see: http://www.getid3.org/phpBB3/viewtopic.php?t=1295
+                                       //if (isset($info['video']['resolution_x'])) { unset($info['video']['resolution_x']); }
+                                       //if (isset($info['video']['resolution_y'])) { unset($info['video']['resolution_y']); }
+                                       //if (isset($info['quicktime']['video']))    { unset($info['quicktime']['video']);    }
+                               }
+                               break;
+
+
+                       case 'iods': // Initial Object DeScriptor atom
+                               // http://www.koders.com/c/fid1FAB3E762903DC482D8A246D4A4BF9F28E049594.aspx?s=windows.h
+                               // http://libquicktime.sourcearchive.com/documentation/1.0.2plus-pdebian/iods_8c-source.html
+                               $offset = 0;
+                               $atom_structure['version']                =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 1));
+                               $offset += 1;
+                               $atom_structure['flags_raw']              =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 3));
+                               $offset += 3;
+                               $atom_structure['mp4_iod_tag']            =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 1));
+                               $offset += 1;
+                               $atom_structure['length']                 = $this->quicktime_read_mp4_descr_length($atom_data, $offset);
+                               //$offset already adjusted by quicktime_read_mp4_descr_length()
+                               $atom_structure['object_descriptor_id']   =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 2));
+                               $offset += 2;
+                               $atom_structure['od_profile_level']       =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 1));
+                               $offset += 1;
+                               $atom_structure['scene_profile_level']    =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 1));
+                               $offset += 1;
+                               $atom_structure['audio_profile_id']       =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 1));
+                               $offset += 1;
+                               $atom_structure['video_profile_id']       =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 1));
+                               $offset += 1;
+                               $atom_structure['graphics_profile_level'] =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 1));
+                               $offset += 1;
+
+                               $atom_structure['num_iods_tracks'] = ($atom_structure['length'] - 7) / 6; // 6 bytes would only be right if all tracks use 1-byte length fields
+                               for ($i = 0; $i < $atom_structure['num_iods_tracks']; $i++) {
+                                       $atom_structure['track'][$i]['ES_ID_IncTag'] =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 1));
+                                       $offset += 1;
+                                       $atom_structure['track'][$i]['length']       = $this->quicktime_read_mp4_descr_length($atom_data, $offset);
+                                       //$offset already adjusted by quicktime_read_mp4_descr_length()
+                                       $atom_structure['track'][$i]['track_id']     =       getid3_lib::BigEndian2Int(substr($atom_data, $offset, 4));
+                                       $offset += 4;
+                               }
+
+                               $atom_structure['audio_profile_name'] = $this->QuicktimeIODSaudioProfileName($atom_structure['audio_profile_id']);
+                               $atom_structure['video_profile_name'] = $this->QuicktimeIODSvideoProfileName($atom_structure['video_profile_id']);
+                               break;
+
+                       case 'ftyp': // FileTYPe (?) atom (for MP4 it seems)
+                               $atom_structure['signature'] =                           substr($atom_data,  0, 4);
+                               $atom_structure['unknown_1'] = getid3_lib::BigEndian2Int(substr($atom_data,  4, 4));
+                               $atom_structure['fourcc']    =                           substr($atom_data,  8, 4);
+                               break;
+
+                       case 'mdat': // Media DATa atom
+                       case 'free': // FREE space atom
+                       case 'skip': // SKIP atom
+                       case 'wide': // 64-bit expansion placeholder atom
+                               // 'mdat' data is too big to deal with, contains no useful metadata
+                               // 'free', 'skip' and 'wide' are just padding, contains no useful data at all
+
+                               // When writing QuickTime files, it is sometimes necessary to update an atom's size.
+                               // It is impossible to update a 32-bit atom to a 64-bit atom since the 32-bit atom
+                               // is only 8 bytes in size, and the 64-bit atom requires 16 bytes. Therefore, QuickTime
+                               // puts an 8-byte placeholder atom before any atoms it may have to update the size of.
+                               // In this way, if the atom needs to be converted from a 32-bit to a 64-bit atom, the
+                               // placeholder atom can be overwritten to obtain the necessary 8 extra bytes.
+                               // The placeholder atom has a type of kWideAtomPlaceholderType ( 'wide' ).
+                               break;
+
+
+                       case 'nsav': // NoSAVe atom
+                               // http://developer.apple.com/technotes/tn/tn2038.html
+                               $atom_structure['data'] = getid3_lib::BigEndian2Int(substr($atom_data,  0, 4));
+                               break;
+
+                       case 'ctyp': // Controller TYPe atom (seen on QTVR)
+                               // http://homepages.slingshot.co.nz/~helmboy/quicktime/formats/qtm-layout.txt
+                               // some controller names are:
+                               //   0x00 + 'std' for linear movie
+                               //   'none' for no controls
+                               $atom_structure['ctyp'] = substr($atom_data, 0, 4);
+                               $info['quicktime']['controller'] = $atom_structure['ctyp'];
+                               switch ($atom_structure['ctyp']) {
+                                       case 'qtvr':
+                                               $info['video']['dataformat'] = 'quicktimevr';
+                                               break;
+                               }
+                               break;
+
+                       case 'pano': // PANOrama track (seen on QTVR)
+                               $atom_structure['pano'] = getid3_lib::BigEndian2Int(substr($atom_data,  0, 4));
+                               break;
+
+                       case 'hint': // HINT track
+                       case 'hinf': //
+                       case 'hinv': //
+                       case 'hnti': //
+                               $info['quicktime']['hinting'] = true;
+                               break;
+
+                       case 'imgt': // IMaGe Track reference (kQTVRImageTrackRefType) (seen on QTVR)
+                               for ($i = 0; $i < ($atom_structure['size'] - 8); $i += 4) {
+                                       $atom_structure['imgt'][] = getid3_lib::BigEndian2Int(substr($atom_data, $i, 4));
+                               }
+                               break;
+
+
+                       // Observed-but-not-handled atom types are just listed here to prevent warnings being generated
+                       case 'FXTC': // Something to do with Adobe After Effects (?)
+                       case 'PrmA':
+                       case 'code':
+                       case 'FIEL': // this is NOT "fiel" (Field Ordering) as describe here: http://developer.apple.com/documentation/QuickTime/QTFF/QTFFChap3/chapter_4_section_2.html
+                       case 'tapt': // TrackApertureModeDimensionsAID - http://developer.apple.com/documentation/QuickTime/Reference/QT7-1_Update_Reference/Constants/Constants.html
+                                               // tapt seems to be used to compute the video size [http://www.getid3.org/phpBB3/viewtopic.php?t=838]
+                                               // * http://lists.apple.com/archives/quicktime-api/2006/Aug/msg00014.html
+                                               // * http://handbrake.fr/irclogs/handbrake-dev/handbrake-dev20080128_pg2.html
+                       case 'ctts'://  STCompositionOffsetAID             - http://developer.apple.com/documentation/QuickTime/Reference/QTRef_Constants/Reference/reference.html
+                       case 'cslg'://  STCompositionShiftLeastGreatestAID - http://developer.apple.com/documentation/QuickTime/Reference/QTRef_Constants/Reference/reference.html
+                       case 'sdtp'://  STSampleDependencyAID              - http://developer.apple.com/documentation/QuickTime/Reference/QTRef_Constants/Reference/reference.html
+                       case 'stps'://  STPartialSyncSampleAID             - http://developer.apple.com/documentation/QuickTime/Reference/QTRef_Constants/Reference/reference.html
+                               //$atom_structure['data'] = $atom_data;
+                               break;
+
+                       case '©xyz':  // GPS latitude+longitude+altitude
+                               $atom_structure['data'] = $atom_data;
+                               if (preg_match('#([\\+\\-][0-9\\.]+)([\\+\\-][0-9\\.]+)([\\+\\-][0-9\\.]+)?/$#i', $atom_data, $matches)) {
+                                       @list($all, $latitude, $longitude, $altitude) = $matches;
+                                       $info['quicktime']['comments']['gps_latitude'][]  = floatval($latitude);
+                                       $info['quicktime']['comments']['gps_longitude'][] = floatval($longitude);
+                                       if (!empty($altitude)) {
+                                               $info['quicktime']['comments']['gps_altitude'][] = floatval($altitude);
+                                       }
+                               } else {
+                                       $info['warning'][] = 'QuickTime atom "©xyz" data does not match expected data pattern at offset '.$baseoffset.'. Please report as getID3() bug.';
+                               }
+                               break;
+
+                       case 'NCDT':
+                               // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html
+                               // Nikon-specific QuickTime tags found in the NCDT atom of MOV videos from some Nikon cameras such as the Coolpix S8000 and D5100
+                               $atom_structure['subatoms'] = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 4, $atomHierarchy, $ParseAllPossibleAtoms);
+                               break;
+                       case 'NCTH': // Nikon Camera THumbnail image
+                       case 'NCVW': // Nikon Camera preVieW image
+                               // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html
+                               if (preg_match('/^\xFF\xD8\xFF/', $atom_data)) {
+                                       $atom_structure['data'] = $atom_data;
+                                       $atom_structure['image_mime'] = 'image/jpeg';
+                                       $atom_structure['description'] = (($atomname == 'NCTH') ? 'Nikon Camera Thumbnail Image' : (($atomname == 'NCVW') ? 'Nikon Camera Preview Image' : 'Nikon preview image'));
+                                       $info['quicktime']['comments']['picture'][] = array('image_mime'=>$atom_structure['image_mime'], 'data'=>$atom_data, 'description'=>$atom_structure['description']);
+                               }
+                               break;
+                       case 'NCHD': // MakerNoteVersion
+                               // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html
+                               $atom_structure['data'] = $atom_data;
+                               break;
+                       case 'NCTG': // NikonTags
+                               // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#NCTG
+                               $atom_structure['data'] = $this->QuicktimeParseNikonNCTG($atom_data);
+                               break;
+                       case 'NCDB': // NikonTags
+                               // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html
+                               $atom_structure['data'] = $atom_data;
+                               break;
+
+                       case "\x00\x00\x00\x00":
+                       case 'meta': // METAdata atom
+                               // some kind of metacontainer, may contain a big data dump such as:
+                               // mdta keys \ 5 mdtacom.apple.quicktime.make (mdtacom.apple.quicktime.creationdate ,mdtacom.apple.quicktime.location.ISO6709 $mdtacom.apple.quicktime.software !mdtacom.apple.quicktime.model ilst \1d \ 1 \15data \ 1DE\10Apple 0 \ 2 (data \ 1DE\102011-05-11T17:54:04+0200 2 \ 3 *data \ 1DE\10+52.4936+013.3897+040.247/ \1d \ 4 \15data \ 1DE\104.3.1 \ 5 \18data \ 1DE\10iPhone 4
+                               // http://www.geocities.com/xhelmboyx/quicktime/formats/qti-layout.txt
+
+                   $atom_structure['version']   =          getid3_lib::BigEndian2Int(substr($atom_data, 0, 1));
+                   $atom_structure['flags_raw'] =          getid3_lib::BigEndian2Int(substr($atom_data, 1, 3));
+                   $atom_structure['subatoms']  = $this->QuicktimeParseContainerAtom(substr($atom_data, 4), $baseoffset + 8, $atomHierarchy, $ParseAllPossibleAtoms);
+                               //$atom_structure['subatoms']  = $this->QuicktimeParseContainerAtom($atom_data, $baseoffset + 8, $atomHierarchy, $ParseAllPossibleAtoms);
+                               break;
+
+                       case 'data': // metaDATA atom
+                               // seems to be 2 bytes language code (ASCII), 2 bytes unknown (set to 0x10B5 in sample I have), remainder is useful data
+                               $atom_structure['language'] =                           substr($atom_data, 4 + 0, 2);
+                               $atom_structure['unknown']  = getid3_lib::BigEndian2Int(substr($atom_data, 4 + 2, 2));
+                               $atom_structure['data']     =                           substr($atom_data, 4 + 4);
+                               break;
+
+                       default:
+                               $info['warning'][] = 'Unknown QuickTime atom type: "'.$atomname.'" ('.trim(getid3_lib::PrintHexBytes($atomname)).') at offset '.$baseoffset;
+                               $atom_structure['data'] = $atom_data;
+                               break;
+               }
+               array_pop($atomHierarchy);
+               return $atom_structure;
+       }
+
+       public function QuicktimeParseContainerAtom($atom_data, $baseoffset, &$atomHierarchy, $ParseAllPossibleAtoms) {
+//echo 'QuicktimeParseContainerAtom('.substr($atom_data, 4, 4).') @ '.$baseoffset.'<br><br>';
+               $atom_structure  = false;
+               $subatomoffset  = 0;
+               $subatomcounter = 0;
+               if ((strlen($atom_data) == 4) && (getid3_lib::BigEndian2Int($atom_data) == 0x00000000)) {
+                       return false;
+               }
+               while ($subatomoffset < strlen($atom_data)) {
+                       $subatomsize = getid3_lib::BigEndian2Int(substr($atom_data, $subatomoffset + 0, 4));
+                       $subatomname =                           substr($atom_data, $subatomoffset + 4, 4);
+                       $subatomdata =                           substr($atom_data, $subatomoffset + 8, $subatomsize - 8);
+                       if ($subatomsize == 0) {
+                               // Furthermore, for historical reasons the list of atoms is optionally
+                               // terminated by a 32-bit integer set to 0. If you are writing a program
+                               // to read user data atoms, you should allow for the terminating 0.
+                               return $atom_structure;
+                       }
+
+                       $atom_structure[$subatomcounter] = $this->QuicktimeParseAtom($subatomname, $subatomsize, $subatomdata, $baseoffset + $subatomoffset, $atomHierarchy, $ParseAllPossibleAtoms);
+
+                       $subatomoffset += $subatomsize;
+                       $subatomcounter++;
+               }
+               return $atom_structure;
+       }
+
+
+       public function quicktime_read_mp4_descr_length($data, &$offset) {
+               // http://libquicktime.sourcearchive.com/documentation/2:1.0.2plus-pdebian-2build1/esds_8c-source.html
+               $num_bytes = 0;
+               $length    = 0;
+               do {
+                       $b = ord(substr($data, $offset++, 1));
+                       $length = ($length << 7) | ($b & 0x7F);
+               } while (($b & 0x80) && ($num_bytes++ < 4));
+               return $length;
+       }
+
+
+       public function QuicktimeLanguageLookup($languageid) {
+               // http://developer.apple.com/library/mac/#documentation/QuickTime/QTFF/QTFFChap4/qtff4.html#//apple_ref/doc/uid/TP40000939-CH206-34353
+               static $QuicktimeLanguageLookup = array();
+               if (empty($QuicktimeLanguageLookup)) {
+                       $QuicktimeLanguageLookup[0]     = 'English';
+                       $QuicktimeLanguageLookup[1]     = 'French';
+                       $QuicktimeLanguageLookup[2]     = 'German';
+                       $QuicktimeLanguageLookup[3]     = 'Italian';
+                       $QuicktimeLanguageLookup[4]     = 'Dutch';
+                       $QuicktimeLanguageLookup[5]     = 'Swedish';
+                       $QuicktimeLanguageLookup[6]     = 'Spanish';
+                       $QuicktimeLanguageLookup[7]     = 'Danish';
+                       $QuicktimeLanguageLookup[8]     = 'Portuguese';
+                       $QuicktimeLanguageLookup[9]     = 'Norwegian';
+                       $QuicktimeLanguageLookup[10]    = 'Hebrew';
+                       $QuicktimeLanguageLookup[11]    = 'Japanese';
+                       $QuicktimeLanguageLookup[12]    = 'Arabic';
+                       $QuicktimeLanguageLookup[13]    = 'Finnish';
+                       $QuicktimeLanguageLookup[14]    = 'Greek';
+                       $QuicktimeLanguageLookup[15]    = 'Icelandic';
+                       $QuicktimeLanguageLookup[16]    = 'Maltese';
+                       $QuicktimeLanguageLookup[17]    = 'Turkish';
+                       $QuicktimeLanguageLookup[18]    = 'Croatian';
+                       $QuicktimeLanguageLookup[19]    = 'Chinese (Traditional)';
+                       $QuicktimeLanguageLookup[20]    = 'Urdu';
+                       $QuicktimeLanguageLookup[21]    = 'Hindi';
+                       $QuicktimeLanguageLookup[22]    = 'Thai';
+                       $QuicktimeLanguageLookup[23]    = 'Korean';
+                       $QuicktimeLanguageLookup[24]    = 'Lithuanian';
+                       $QuicktimeLanguageLookup[25]    = 'Polish';
+                       $QuicktimeLanguageLookup[26]    = 'Hungarian';
+                       $QuicktimeLanguageLookup[27]    = 'Estonian';
+                       $QuicktimeLanguageLookup[28]    = 'Lettish';
+                       $QuicktimeLanguageLookup[28]    = 'Latvian';
+                       $QuicktimeLanguageLookup[29]    = 'Saamisk';
+                       $QuicktimeLanguageLookup[29]    = 'Lappish';
+                       $QuicktimeLanguageLookup[30]    = 'Faeroese';
+                       $QuicktimeLanguageLookup[31]    = 'Farsi';
+                       $QuicktimeLanguageLookup[31]    = 'Persian';
+                       $QuicktimeLanguageLookup[32]    = 'Russian';
+                       $QuicktimeLanguageLookup[33]    = 'Chinese (Simplified)';
+                       $QuicktimeLanguageLookup[34]    = 'Flemish';
+                       $QuicktimeLanguageLookup[35]    = 'Irish';
+                       $QuicktimeLanguageLookup[36]    = 'Albanian';
+                       $QuicktimeLanguageLookup[37]    = 'Romanian';
+                       $QuicktimeLanguageLookup[38]    = 'Czech';
+                       $QuicktimeLanguageLookup[39]    = 'Slovak';
+                       $QuicktimeLanguageLookup[40]    = 'Slovenian';
+                       $QuicktimeLanguageLookup[41]    = 'Yiddish';
+                       $QuicktimeLanguageLookup[42]    = 'Serbian';
+                       $QuicktimeLanguageLookup[43]    = 'Macedonian';
+                       $QuicktimeLanguageLookup[44]    = 'Bulgarian';
+                       $QuicktimeLanguageLookup[45]    = 'Ukrainian';
+                       $QuicktimeLanguageLookup[46]    = 'Byelorussian';
+                       $QuicktimeLanguageLookup[47]    = 'Uzbek';
+                       $QuicktimeLanguageLookup[48]    = 'Kazakh';
+                       $QuicktimeLanguageLookup[49]    = 'Azerbaijani';
+                       $QuicktimeLanguageLookup[50]    = 'AzerbaijanAr';
+                       $QuicktimeLanguageLookup[51]    = 'Armenian';
+                       $QuicktimeLanguageLookup[52]    = 'Georgian';
+                       $QuicktimeLanguageLookup[53]    = 'Moldavian';
+                       $QuicktimeLanguageLookup[54]    = 'Kirghiz';
+                       $QuicktimeLanguageLookup[55]    = 'Tajiki';
+                       $QuicktimeLanguageLookup[56]    = 'Turkmen';
+                       $QuicktimeLanguageLookup[57]    = 'Mongolian';
+                       $QuicktimeLanguageLookup[58]    = 'MongolianCyr';
+                       $QuicktimeLanguageLookup[59]    = 'Pashto';
+                       $QuicktimeLanguageLookup[60]    = 'Kurdish';
+                       $QuicktimeLanguageLookup[61]    = 'Kashmiri';
+                       $QuicktimeLanguageLookup[62]    = 'Sindhi';
+                       $QuicktimeLanguageLookup[63]    = 'Tibetan';
+                       $QuicktimeLanguageLookup[64]    = 'Nepali';
+                       $QuicktimeLanguageLookup[65]    = 'Sanskrit';
+                       $QuicktimeLanguageLookup[66]    = 'Marathi';
+                       $QuicktimeLanguageLookup[67]    = 'Bengali';
+                       $QuicktimeLanguageLookup[68]    = 'Assamese';
+                       $QuicktimeLanguageLookup[69]    = 'Gujarati';
+                       $QuicktimeLanguageLookup[70]    = 'Punjabi';
+                       $QuicktimeLanguageLookup[71]    = 'Oriya';
+                       $QuicktimeLanguageLookup[72]    = 'Malayalam';
+                       $QuicktimeLanguageLookup[73]    = 'Kannada';
+                       $QuicktimeLanguageLookup[74]    = 'Tamil';
+                       $QuicktimeLanguageLookup[75]    = 'Telugu';
+                       $QuicktimeLanguageLookup[76]    = 'Sinhalese';
+                       $QuicktimeLanguageLookup[77]    = 'Burmese';
+                       $QuicktimeLanguageLookup[78]    = 'Khmer';
+                       $QuicktimeLanguageLookup[79]    = 'Lao';
+                       $QuicktimeLanguageLookup[80]    = 'Vietnamese';
+                       $QuicktimeLanguageLookup[81]    = 'Indonesian';
+                       $QuicktimeLanguageLookup[82]    = 'Tagalog';
+                       $QuicktimeLanguageLookup[83]    = 'MalayRoman';
+                       $QuicktimeLanguageLookup[84]    = 'MalayArabic';
+                       $QuicktimeLanguageLookup[85]    = 'Amharic';
+                       $QuicktimeLanguageLookup[86]    = 'Tigrinya';
+                       $QuicktimeLanguageLookup[87]    = 'Galla';
+                       $QuicktimeLanguageLookup[87]    = 'Oromo';
+                       $QuicktimeLanguageLookup[88]    = 'Somali';
+                       $QuicktimeLanguageLookup[89]    = 'Swahili';
+                       $QuicktimeLanguageLookup[90]    = 'Ruanda';
+                       $QuicktimeLanguageLookup[91]    = 'Rundi';
+                       $QuicktimeLanguageLookup[92]    = 'Chewa';
+                       $QuicktimeLanguageLookup[93]    = 'Malagasy';
+                       $QuicktimeLanguageLookup[94]    = 'Esperanto';
+                       $QuicktimeLanguageLookup[128]   = 'Welsh';
+                       $QuicktimeLanguageLookup[129]   = 'Basque';
+                       $QuicktimeLanguageLookup[130]   = 'Catalan';
+                       $QuicktimeLanguageLookup[131]   = 'Latin';
+                       $QuicktimeLanguageLookup[132]   = 'Quechua';
+                       $QuicktimeLanguageLookup[133]   = 'Guarani';
+                       $QuicktimeLanguageLookup[134]   = 'Aymara';
+                       $QuicktimeLanguageLookup[135]   = 'Tatar';
+                       $QuicktimeLanguageLookup[136]   = 'Uighur';
+                       $QuicktimeLanguageLookup[137]   = 'Dzongkha';
+                       $QuicktimeLanguageLookup[138]   = 'JavaneseRom';
+                       $QuicktimeLanguageLookup[32767] = 'Unspecified';
+               }
+               if (($languageid > 138) && ($languageid < 32767)) {
+                       /*
+                       ISO Language Codes - http://www.loc.gov/standards/iso639-2/php/code_list.php
+                       Because the language codes specified by ISO 639-2/T are three characters long, they must be packed to fit into a 16-bit field.
+                       The packing algorithm must map each of the three characters, which are always lowercase, into a 5-bit integer and then concatenate
+                       these integers into the least significant 15 bits of a 16-bit integer, leaving the 16-bit integer's most significant bit set to zero.
+
+                       One algorithm for performing this packing is to treat each ISO character as a 16-bit integer. Subtract 0x60 from the first character
+                       and multiply by 2^10 (0x400), subtract 0x60 from the second character and multiply by 2^5 (0x20), subtract 0x60 from the third character,
+                       and add the three 16-bit values. This will result in a single 16-bit value with the three codes correctly packed into the 15 least
+                       significant bits and the most significant bit set to zero.
+                       */
+                       $iso_language_id  = '';
+                       $iso_language_id .= chr((($languageid & 0x7C00) >> 10) + 0x60);
+                       $iso_language_id .= chr((($languageid & 0x03E0) >>  5) + 0x60);
+                       $iso_language_id .= chr((($languageid & 0x001F) >>  0) + 0x60);
+                       $QuicktimeLanguageLookup[$languageid] = getid3_id3v2::LanguageLookup($iso_language_id);
+               }
+               return (isset($QuicktimeLanguageLookup[$languageid]) ? $QuicktimeLanguageLookup[$languageid] : 'invalid');
+       }
+
+       public function QuicktimeVideoCodecLookup($codecid) {
+               static $QuicktimeVideoCodecLookup = array();
+               if (empty($QuicktimeVideoCodecLookup)) {
+                       $QuicktimeVideoCodecLookup['.SGI'] = 'SGI';
+                       $QuicktimeVideoCodecLookup['3IV1'] = '3ivx MPEG-4 v1';
+                       $QuicktimeVideoCodecLookup['3IV2'] = '3ivx MPEG-4 v2';
+                       $QuicktimeVideoCodecLookup['3IVX'] = '3ivx MPEG-4';
+                       $QuicktimeVideoCodecLookup['8BPS'] = 'Planar RGB';
+                       $QuicktimeVideoCodecLookup['avc1'] = 'H.264/MPEG-4 AVC';
+                       $QuicktimeVideoCodecLookup['avr '] = 'AVR-JPEG';
+                       $QuicktimeVideoCodecLookup['b16g'] = '16Gray';
+                       $QuicktimeVideoCodecLookup['b32a'] = '32AlphaGray';
+                       $QuicktimeVideoCodecLookup['b48r'] = '48RGB';
+                       $QuicktimeVideoCodecLookup['b64a'] = '64ARGB';
+                       $QuicktimeVideoCodecLookup['base'] = 'Base';
+                       $QuicktimeVideoCodecLookup['clou'] = 'Cloud';
+                       $QuicktimeVideoCodecLookup['cmyk'] = 'CMYK';
+                       $QuicktimeVideoCodecLookup['cvid'] = 'Cinepak';
+                       $QuicktimeVideoCodecLookup['dmb1'] = 'OpenDML JPEG';
+                       $QuicktimeVideoCodecLookup['dvc '] = 'DVC-NTSC';
+                       $QuicktimeVideoCodecLookup['dvcp'] = 'DVC-PAL';
+                       $QuicktimeVideoCodecLookup['dvpn'] = 'DVCPro-NTSC';
+                       $QuicktimeVideoCodecLookup['dvpp'] = 'DVCPro-PAL';
+                       $QuicktimeVideoCodecLookup['fire'] = 'Fire';
+                       $QuicktimeVideoCodecLookup['flic'] = 'FLC';
+                       $QuicktimeVideoCodecLookup['gif '] = 'GIF';
+                       $QuicktimeVideoCodecLookup['h261'] = 'H261';
+                       $QuicktimeVideoCodecLookup['h263'] = 'H263';
+                       $QuicktimeVideoCodecLookup['IV41'] = 'Indeo4';
+                       $QuicktimeVideoCodecLookup['jpeg'] = 'JPEG';
+                       $QuicktimeVideoCodecLookup['kpcd'] = 'PhotoCD';
+                       $QuicktimeVideoCodecLookup['mjpa'] = 'Motion JPEG-A';
+                       $QuicktimeVideoCodecLookup['mjpb'] = 'Motion JPEG-B';
+                       $QuicktimeVideoCodecLookup['msvc'] = 'Microsoft Video1';
+                       $QuicktimeVideoCodecLookup['myuv'] = 'MPEG YUV420';
+                       $QuicktimeVideoCodecLookup['path'] = 'Vector';
+                       $QuicktimeVideoCodecLookup['png '] = 'PNG';
+                       $QuicktimeVideoCodecLookup['PNTG'] = 'MacPaint';
+                       $QuicktimeVideoCodecLookup['qdgx'] = 'QuickDrawGX';
+                       $QuicktimeVideoCodecLookup['qdrw'] = 'QuickDraw';
+                       $QuicktimeVideoCodecLookup['raw '] = 'RAW';
+                       $QuicktimeVideoCodecLookup['ripl'] = 'WaterRipple';
+                       $QuicktimeVideoCodecLookup['rpza'] = 'Video';
+                       $QuicktimeVideoCodecLookup['smc '] = 'Graphics';
+                       $QuicktimeVideoCodecLookup['SVQ1'] = 'Sorenson Video 1';
+                       $QuicktimeVideoCodecLookup['SVQ1'] = 'Sorenson Video 3';
+                       $QuicktimeVideoCodecLookup['syv9'] = 'Sorenson YUV9';
+                       $QuicktimeVideoCodecLookup['tga '] = 'Targa';
+                       $QuicktimeVideoCodecLookup['tiff'] = 'TIFF';
+                       $QuicktimeVideoCodecLookup['WRAW'] = 'Windows RAW';
+                       $QuicktimeVideoCodecLookup['WRLE'] = 'BMP';
+                       $QuicktimeVideoCodecLookup['y420'] = 'YUV420';
+                       $QuicktimeVideoCodecLookup['yuv2'] = 'ComponentVideo';
+                       $QuicktimeVideoCodecLookup['yuvs'] = 'ComponentVideoUnsigned';
+                       $QuicktimeVideoCodecLookup['yuvu'] = 'ComponentVideoSigned';
+               }
+               return (isset($QuicktimeVideoCodecLookup[$codecid]) ? $QuicktimeVideoCodecLookup[$codecid] : '');
+       }
+
+       public function QuicktimeAudioCodecLookup($codecid) {
+               static $QuicktimeAudioCodecLookup = array();
+               if (empty($QuicktimeAudioCodecLookup)) {
+                       $QuicktimeAudioCodecLookup['.mp3']          = 'Fraunhofer MPEG Layer-III alias';
+                       $QuicktimeAudioCodecLookup['aac ']          = 'ISO/IEC 14496-3 AAC';
+                       $QuicktimeAudioCodecLookup['agsm']          = 'Apple GSM 10:1';
+                       $QuicktimeAudioCodecLookup['alac']          = 'Apple Lossless Audio Codec';
+                       $QuicktimeAudioCodecLookup['alaw']          = 'A-law 2:1';
+                       $QuicktimeAudioCodecLookup['conv']          = 'Sample Format';
+                       $QuicktimeAudioCodecLookup['dvca']          = 'DV';
+                       $QuicktimeAudioCodecLookup['dvi ']          = 'DV 4:1';
+                       $QuicktimeAudioCodecLookup['eqal']          = 'Frequency Equalizer';
+                       $QuicktimeAudioCodecLookup['fl32']          = '32-bit Floating Point';
+                       $QuicktimeAudioCodecLookup['fl64']          = '64-bit Floating Point';
+                       $QuicktimeAudioCodecLookup['ima4']          = 'Interactive Multimedia Association 4:1';
+                       $QuicktimeAudioCodecLookup['in24']          = '24-bit Integer';
+                       $QuicktimeAudioCodecLookup['in32']          = '32-bit Integer';
+                       $QuicktimeAudioCodecLookup['lpc ']          = 'LPC 23:1';
+                       $QuicktimeAudioCodecLookup['MAC3']          = 'Macintosh Audio Compression/Expansion (MACE) 3:1';
+                       $QuicktimeAudioCodecLookup['MAC6']          = 'Macintosh Audio Compression/Expansion (MACE) 6:1';
+                       $QuicktimeAudioCodecLookup['mixb']          = '8-bit Mixer';
+                       $QuicktimeAudioCodecLookup['mixw']          = '16-bit Mixer';
+                       $QuicktimeAudioCodecLookup['mp4a']          = 'ISO/IEC 14496-3 AAC';
+                       $QuicktimeAudioCodecLookup['MS'."\x00\x02"] = 'Microsoft ADPCM';
+                       $QuicktimeAudioCodecLookup['MS'."\x00\x11"] = 'DV IMA';
+                       $QuicktimeAudioCodecLookup['MS'."\x00\x55"] = 'Fraunhofer MPEG Layer III';
+                       $QuicktimeAudioCodecLookup['NONE']          = 'No Encoding';
+                       $QuicktimeAudioCodecLookup['Qclp']          = 'Qualcomm PureVoice';
+                       $QuicktimeAudioCodecLookup['QDM2']          = 'QDesign Music 2';
+                       $QuicktimeAudioCodecLookup['QDMC']          = 'QDesign Music 1';
+                       $QuicktimeAudioCodecLookup['ratb']          = '8-bit Rate';
+                       $QuicktimeAudioCodecLookup['ratw']          = '16-bit Rate';
+                       $QuicktimeAudioCodecLookup['raw ']          = 'raw PCM';
+                       $QuicktimeAudioCodecLookup['sour']          = 'Sound Source';
+                       $QuicktimeAudioCodecLookup['sowt']          = 'signed/two\'s complement (Little Endian)';
+                       $QuicktimeAudioCodecLookup['str1']          = 'Iomega MPEG layer II';
+                       $QuicktimeAudioCodecLookup['str2']          = 'Iomega MPEG *layer II';
+                       $QuicktimeAudioCodecLookup['str3']          = 'Iomega MPEG **layer II';
+                       $QuicktimeAudioCodecLookup['str4']          = 'Iomega MPEG ***layer II';
+                       $QuicktimeAudioCodecLookup['twos']          = 'signed/two\'s complement (Big Endian)';
+                       $QuicktimeAudioCodecLookup['ulaw']          = 'mu-law 2:1';
+               }
+               return (isset($QuicktimeAudioCodecLookup[$codecid]) ? $QuicktimeAudioCodecLookup[$codecid] : '');
+       }
+
+       public function QuicktimeDCOMLookup($compressionid) {
+               static $QuicktimeDCOMLookup = array();
+               if (empty($QuicktimeDCOMLookup)) {
+                       $QuicktimeDCOMLookup['zlib'] = 'ZLib Deflate';
+                       $QuicktimeDCOMLookup['adec'] = 'Apple Compression';
+               }
+               return (isset($QuicktimeDCOMLookup[$compressionid]) ? $QuicktimeDCOMLookup[$compressionid] : '');
+       }
+
+       public function QuicktimeColorNameLookup($colordepthid) {
+               static $QuicktimeColorNameLookup = array();
+               if (empty($QuicktimeColorNameLookup)) {
+                       $QuicktimeColorNameLookup[1]  = '2-color (monochrome)';
+                       $QuicktimeColorNameLookup[2]  = '4-color';
+                       $QuicktimeColorNameLookup[4]  = '16-color';
+                       $QuicktimeColorNameLookup[8]  = '256-color';
+                       $QuicktimeColorNameLookup[16] = 'thousands (16-bit color)';
+                       $QuicktimeColorNameLookup[24] = 'millions (24-bit color)';
+                       $QuicktimeColorNameLookup[32] = 'millions+ (32-bit color)';
+                       $QuicktimeColorNameLookup[33] = 'black & white';
+                       $QuicktimeColorNameLookup[34] = '4-gray';
+                       $QuicktimeColorNameLookup[36] = '16-gray';
+                       $QuicktimeColorNameLookup[40] = '256-gray';
+               }
+               return (isset($QuicktimeColorNameLookup[$colordepthid]) ? $QuicktimeColorNameLookup[$colordepthid] : 'invalid');
+       }
+
+       public function QuicktimeSTIKLookup($stik) {
+               static $QuicktimeSTIKLookup = array();
+               if (empty($QuicktimeSTIKLookup)) {
+                       $QuicktimeSTIKLookup[0]  = 'Movie';
+                       $QuicktimeSTIKLookup[1]  = 'Normal';
+                       $QuicktimeSTIKLookup[2]  = 'Audiobook';
+                       $QuicktimeSTIKLookup[5]  = 'Whacked Bookmark';
+                       $QuicktimeSTIKLookup[6]  = 'Music Video';
+                       $QuicktimeSTIKLookup[9]  = 'Short Film';
+                       $QuicktimeSTIKLookup[10] = 'TV Show';
+                       $QuicktimeSTIKLookup[11] = 'Booklet';
+                       $QuicktimeSTIKLookup[14] = 'Ringtone';
+                       $QuicktimeSTIKLookup[21] = 'Podcast';
+               }
+               return (isset($QuicktimeSTIKLookup[$stik]) ? $QuicktimeSTIKLookup[$stik] : 'invalid');
+       }
+
+       public function QuicktimeIODSaudioProfileName($audio_profile_id) {
+               static $QuicktimeIODSaudioProfileNameLookup = array();
+               if (empty($QuicktimeIODSaudioProfileNameLookup)) {
+                       $QuicktimeIODSaudioProfileNameLookup = array(
+                           0x00 => 'ISO Reserved (0x00)',
+                           0x01 => 'Main Audio Profile @ Level 1',
+                           0x02 => 'Main Audio Profile @ Level 2',
+                           0x03 => 'Main Audio Profile @ Level 3',
+                           0x04 => 'Main Audio Profile @ Level 4',
+                           0x05 => 'Scalable Audio Profile @ Level 1',
+                           0x06 => 'Scalable Audio Profile @ Level 2',
+                           0x07 => 'Scalable Audio Profile @ Level 3',
+                           0x08 => 'Scalable Audio Profile @ Level 4',
+                           0x09 => 'Speech Audio Profile @ Level 1',
+                           0x0A => 'Speech Audio Profile @ Level 2',
+                           0x0B => 'Synthetic Audio Profile @ Level 1',
+                           0x0C => 'Synthetic Audio Profile @ Level 2',
+                           0x0D => 'Synthetic Audio Profile @ Level 3',
+                           0x0E => 'High Quality Audio Profile @ Level 1',
+                           0x0F => 'High Quality Audio Profile @ Level 2',
+                           0x10 => 'High Quality Audio Profile @ Level 3',
+                           0x11 => 'High Quality Audio Profile @ Level 4',
+                           0x12 => 'High Quality Audio Profile @ Level 5',
+                           0x13 => 'High Quality Audio Profile @ Level 6',
+                           0x14 => 'High Quality Audio Profile @ Level 7',
+                           0x15 => 'High Quality Audio Profile @ Level 8',
+                           0x16 => 'Low Delay Audio Profile @ Level 1',
+                           0x17 => 'Low Delay Audio Profile @ Level 2',
+                           0x18 => 'Low Delay Audio Profile @ Level 3',
+                           0x19 => 'Low Delay Audio Profile @ Level 4',
+                           0x1A => 'Low Delay Audio Profile @ Level 5',
+                           0x1B => 'Low Delay Audio Profile @ Level 6',
+                           0x1C => 'Low Delay Audio Profile @ Level 7',
+                           0x1D => 'Low Delay Audio Profile @ Level 8',
+                           0x1E => 'Natural Audio Profile @ Level 1',
+                           0x1F => 'Natural Audio Profile @ Level 2',
+                           0x20 => 'Natural Audio Profile @ Level 3',
+                           0x21 => 'Natural Audio Profile @ Level 4',
+                           0x22 => 'Mobile Audio Internetworking Profile @ Level 1',
+                           0x23 => 'Mobile Audio Internetworking Profile @ Level 2',
+                           0x24 => 'Mobile Audio Internetworking Profile @ Level 3',
+                           0x25 => 'Mobile Audio Internetworking Profile @ Level 4',
+                           0x26 => 'Mobile Audio Internetworking Profile @ Level 5',
+                           0x27 => 'Mobile Audio Internetworking Profile @ Level 6',
+                           0x28 => 'AAC Profile @ Level 1',
+                           0x29 => 'AAC Profile @ Level 2',
+                           0x2A => 'AAC Profile @ Level 4',
+                           0x2B => 'AAC Profile @ Level 5',
+                           0x2C => 'High Efficiency AAC Profile @ Level 2',
+                           0x2D => 'High Efficiency AAC Profile @ Level 3',
+                           0x2E => 'High Efficiency AAC Profile @ Level 4',
+                           0x2F => 'High Efficiency AAC Profile @ Level 5',
+                           0xFE => 'Not part of MPEG-4 audio profiles',
+                           0xFF => 'No audio capability required',
+                       );
+               }
+               return (isset($QuicktimeIODSaudioProfileNameLookup[$audio_profile_id]) ? $QuicktimeIODSaudioProfileNameLookup[$audio_profile_id] : 'ISO Reserved / User Private');
+       }
+
+
+       public function QuicktimeIODSvideoProfileName($video_profile_id) {
+               static $QuicktimeIODSvideoProfileNameLookup = array();
+               if (empty($QuicktimeIODSvideoProfileNameLookup)) {
+                       $QuicktimeIODSvideoProfileNameLookup = array(
+                               0x00 => 'Reserved (0x00) Profile',
+                               0x01 => 'Simple Profile @ Level 1',
+                               0x02 => 'Simple Profile @ Level 2',
+                               0x03 => 'Simple Profile @ Level 3',
+                               0x08 => 'Simple Profile @ Level 0',
+                               0x10 => 'Simple Scalable Profile @ Level 0',
+                               0x11 => 'Simple Scalable Profile @ Level 1',
+                               0x12 => 'Simple Scalable Profile @ Level 2',
+                               0x15 => 'AVC/H264 Profile',
+                               0x21 => 'Core Profile @ Level 1',
+                               0x22 => 'Core Profile @ Level 2',
+                               0x32 => 'Main Profile @ Level 2',
+                               0x33 => 'Main Profile @ Level 3',
+                               0x34 => 'Main Profile @ Level 4',
+                               0x42 => 'N-bit Profile @ Level 2',
+                               0x51 => 'Scalable Texture Profile @ Level 1',
+                               0x61 => 'Simple Face Animation Profile @ Level 1',
+                               0x62 => 'Simple Face Animation Profile @ Level 2',
+                               0x63 => 'Simple FBA Profile @ Level 1',
+                               0x64 => 'Simple FBA Profile @ Level 2',
+                               0x71 => 'Basic Animated Texture Profile @ Level 1',
+                               0x72 => 'Basic Animated Texture Profile @ Level 2',
+                               0x81 => 'Hybrid Profile @ Level 1',
+                               0x82 => 'Hybrid Profile @ Level 2',
+                               0x91 => 'Advanced Real Time Simple Profile @ Level 1',
+                               0x92 => 'Advanced Real Time Simple Profile @ Level 2',
+                               0x93 => 'Advanced Real Time Simple Profile @ Level 3',
+                               0x94 => 'Advanced Real Time Simple Profile @ Level 4',
+                               0xA1 => 'Core Scalable Profile @ Level1',
+                               0xA2 => 'Core Scalable Profile @ Level2',
+                               0xA3 => 'Core Scalable Profile @ Level3',
+                               0xB1 => 'Advanced Coding Efficiency Profile @ Level 1',
+                               0xB2 => 'Advanced Coding Efficiency Profile @ Level 2',
+                               0xB3 => 'Advanced Coding Efficiency Profile @ Level 3',
+                               0xB4 => 'Advanced Coding Efficiency Profile @ Level 4',
+                               0xC1 => 'Advanced Core Profile @ Level 1',
+                               0xC2 => 'Advanced Core Profile @ Level 2',
+                               0xD1 => 'Advanced Scalable Texture @ Level1',
+                               0xD2 => 'Advanced Scalable Texture @ Level2',
+                               0xE1 => 'Simple Studio Profile @ Level 1',
+                               0xE2 => 'Simple Studio Profile @ Level 2',
+                               0xE3 => 'Simple Studio Profile @ Level 3',
+                               0xE4 => 'Simple Studio Profile @ Level 4',
+                               0xE5 => 'Core Studio Profile @ Level 1',
+                               0xE6 => 'Core Studio Profile @ Level 2',
+                               0xE7 => 'Core Studio Profile @ Level 3',
+                               0xE8 => 'Core Studio Profile @ Level 4',
+                               0xF0 => 'Advanced Simple Profile @ Level 0',
+                               0xF1 => 'Advanced Simple Profile @ Level 1',
+                               0xF2 => 'Advanced Simple Profile @ Level 2',
+                               0xF3 => 'Advanced Simple Profile @ Level 3',
+                               0xF4 => 'Advanced Simple Profile @ Level 4',
+                               0xF5 => 'Advanced Simple Profile @ Level 5',
+                               0xF7 => 'Advanced Simple Profile @ Level 3b',
+                               0xF8 => 'Fine Granularity Scalable Profile @ Level 0',
+                               0xF9 => 'Fine Granularity Scalable Profile @ Level 1',
+                               0xFA => 'Fine Granularity Scalable Profile @ Level 2',
+                               0xFB => 'Fine Granularity Scalable Profile @ Level 3',
+                               0xFC => 'Fine Granularity Scalable Profile @ Level 4',
+                               0xFD => 'Fine Granularity Scalable Profile @ Level 5',
+                               0xFE => 'Not part of MPEG-4 Visual profiles',
+                               0xFF => 'No visual capability required',
+                       );
+               }
+               return (isset($QuicktimeIODSvideoProfileNameLookup[$video_profile_id]) ? $QuicktimeIODSvideoProfileNameLookup[$video_profile_id] : 'ISO Reserved Profile');
+       }
+
+
+       public function QuicktimeContentRatingLookup($rtng) {
+               static $QuicktimeContentRatingLookup = array();
+               if (empty($QuicktimeContentRatingLookup)) {
+                       $QuicktimeContentRatingLookup[0]  = 'None';
+                       $QuicktimeContentRatingLookup[2]  = 'Clean';
+                       $QuicktimeContentRatingLookup[4]  = 'Explicit';
+               }
+               return (isset($QuicktimeContentRatingLookup[$rtng]) ? $QuicktimeContentRatingLookup[$rtng] : 'invalid');
+       }
+
+       public function QuicktimeStoreAccountTypeLookup($akid) {
+               static $QuicktimeStoreAccountTypeLookup = array();
+               if (empty($QuicktimeStoreAccountTypeLookup)) {
+                       $QuicktimeStoreAccountTypeLookup[0] = 'iTunes';
+                       $QuicktimeStoreAccountTypeLookup[1] = 'AOL';
+               }
+               return (isset($QuicktimeStoreAccountTypeLookup[$akid]) ? $QuicktimeStoreAccountTypeLookup[$akid] : 'invalid');
+       }
+
+       public function QuicktimeStoreFrontCodeLookup($sfid) {
+               static $QuicktimeStoreFrontCodeLookup = array();
+               if (empty($QuicktimeStoreFrontCodeLookup)) {
+                       $QuicktimeStoreFrontCodeLookup[143460] = 'Australia';
+                       $QuicktimeStoreFrontCodeLookup[143445] = 'Austria';
+                       $QuicktimeStoreFrontCodeLookup[143446] = 'Belgium';
+                       $QuicktimeStoreFrontCodeLookup[143455] = 'Canada';
+                       $QuicktimeStoreFrontCodeLookup[143458] = 'Denmark';
+                       $QuicktimeStoreFrontCodeLookup[143447] = 'Finland';
+                       $QuicktimeStoreFrontCodeLookup[143442] = 'France';
+                       $QuicktimeStoreFrontCodeLookup[143443] = 'Germany';
+                       $QuicktimeStoreFrontCodeLookup[143448] = 'Greece';
+                       $QuicktimeStoreFrontCodeLookup[143449] = 'Ireland';
+                       $QuicktimeStoreFrontCodeLookup[143450] = 'Italy';
+                       $QuicktimeStoreFrontCodeLookup[143462] = 'Japan';
+                       $QuicktimeStoreFrontCodeLookup[143451] = 'Luxembourg';
+                       $QuicktimeStoreFrontCodeLookup[143452] = 'Netherlands';
+                       $QuicktimeStoreFrontCodeLookup[143461] = 'New Zealand';
+                       $QuicktimeStoreFrontCodeLookup[143457] = 'Norway';
+                       $QuicktimeStoreFrontCodeLookup[143453] = 'Portugal';
+                       $QuicktimeStoreFrontCodeLookup[143454] = 'Spain';
+                       $QuicktimeStoreFrontCodeLookup[143456] = 'Sweden';
+                       $QuicktimeStoreFrontCodeLookup[143459] = 'Switzerland';
+                       $QuicktimeStoreFrontCodeLookup[143444] = 'United Kingdom';
+                       $QuicktimeStoreFrontCodeLookup[143441] = 'United States';
+               }
+               return (isset($QuicktimeStoreFrontCodeLookup[$sfid]) ? $QuicktimeStoreFrontCodeLookup[$sfid] : 'invalid');
+       }
+
+       public function QuicktimeParseNikonNCTG($atom_data) {
+               // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#NCTG
+               // Nikon-specific QuickTime tags found in the NCDT atom of MOV videos from some Nikon cameras such as the Coolpix S8000 and D5100
+               // Data is stored as records of:
+               // * 4 bytes record type
+               // * 2 bytes size of data field type:
+               //     0x0001 = flag   (size field *= 1-byte)
+               //     0x0002 = char   (size field *= 1-byte)
+               //     0x0003 = DWORD+ (size field *= 2-byte), values are stored CDAB
+               //     0x0004 = QWORD+ (size field *= 4-byte), values are stored EFGHABCD
+               //     0x0005 = float  (size field *= 8-byte), values are stored aaaabbbb where value is aaaa/bbbb; possibly multiple sets of values appended together
+               //     0x0007 = bytes  (size field *= 1-byte), values are stored as ??????
+               //     0x0008 = ?????  (size field *= 2-byte), values are stored as ??????
+               // * 2 bytes data size field
+               // * ? bytes data (string data may be null-padded; datestamp fields are in the format "2011:05:25 20:24:15")
+               // all integers are stored BigEndian
+
+               $NCTGtagName = array(
+                       0x00000001 => 'Make',
+                       0x00000002 => 'Model',
+                       0x00000003 => 'Software',
+                       0x00000011 => 'CreateDate',
+                       0x00000012 => 'DateTimeOriginal',
+                       0x00000013 => 'FrameCount',
+                       0x00000016 => 'FrameRate',
+                       0x00000022 => 'FrameWidth',
+                       0x00000023 => 'FrameHeight',
+                       0x00000032 => 'AudioChannels',
+                       0x00000033 => 'AudioBitsPerSample',
+                       0x00000034 => 'AudioSampleRate',
+                       0x02000001 => 'MakerNoteVersion',
+                       0x02000005 => 'WhiteBalance',
+                       0x0200000b => 'WhiteBalanceFineTune',
+                       0x0200001e => 'ColorSpace',
+                       0x02000023 => 'PictureControlData',
+                       0x02000024 => 'WorldTime',
+                       0x02000032 => 'UnknownInfo',
+                       0x02000083 => 'LensType',
+                       0x02000084 => 'Lens',
+               );
+
+               $offset = 0;
+               $datalength = strlen($atom_data);
+               $parsed = array();
+               while ($offset < $datalength) {
+//echo getid3_lib::PrintHexBytes(substr($atom_data, $offset, 4)).'<br>';
+                       $record_type       = getid3_lib::BigEndian2Int(substr($atom_data, $offset, 4));  $offset += 4;
+                       $data_size_type    = getid3_lib::BigEndian2Int(substr($atom_data, $offset, 2));  $offset += 2;
+                       $data_size         = getid3_lib::BigEndian2Int(substr($atom_data, $offset, 2));  $offset += 2;
+                       switch ($data_size_type) {
+                               case 0x0001: // 0x0001 = flag   (size field *= 1-byte)
+                                       $data = getid3_lib::BigEndian2Int(substr($atom_data, $offset, $data_size * 1));
+                                       $offset += ($data_size * 1);
+                                       break;
+                               case 0x0002: // 0x0002 = char   (size field *= 1-byte)
+                                       $data = substr($atom_data, $offset, $data_size * 1);
+                                       $offset += ($data_size * 1);
+                                       $data = rtrim($data, "\x00");
+                                       break;
+                               case 0x0003: // 0x0003 = DWORD+ (size field *= 2-byte), values are stored CDAB
+                                       $data = '';
+                                       for ($i = $data_size - 1; $i >= 0; $i--) {
+                                               $data .= substr($atom_data, $offset + ($i * 2), 2);
+                                       }
+                                       $data = getid3_lib::BigEndian2Int($data);
+                                       $offset += ($data_size * 2);
+                                       break;
+                               case 0x0004: // 0x0004 = QWORD+ (size field *= 4-byte), values are stored EFGHABCD
+                                       $data = '';
+                                       for ($i = $data_size - 1; $i >= 0; $i--) {
+                                               $data .= substr($atom_data, $offset + ($i * 4), 4);
+                                       }
+                                       $data = getid3_lib::BigEndian2Int($data);
+                                       $offset += ($data_size * 4);
+                                       break;
+                               case 0x0005: // 0x0005 = float  (size field *= 8-byte), values are stored aaaabbbb where value is aaaa/bbbb; possibly multiple sets of values appended together
+                                       $data = array();
+                                       for ($i = 0; $i < $data_size; $i++) {
+                                               $numerator    = getid3_lib::BigEndian2Int(substr($atom_data, $offset + ($i * 8) + 0, 4));
+                                               $denomninator = getid3_lib::BigEndian2Int(substr($atom_data, $offset + ($i * 8) + 4, 4));
+                                               if ($denomninator == 0) {
+                                                       $data[$i] = false;
+                                               } else {
+                                                       $data[$i] = (double) $numerator / $denomninator;
+                                               }
+                                       }
+                                       $offset += (8 * $data_size);
+                                       if (count($data) == 1) {
+                                               $data = $data[0];
+                                       }
+                                       break;
+                               case 0x0007: // 0x0007 = bytes  (size field *= 1-byte), values are stored as ??????
+                                       $data = substr($atom_data, $offset, $data_size * 1);
+                                       $offset += ($data_size * 1);
+                                       break;
+                               case 0x0008: // 0x0008 = ?????  (size field *= 2-byte), values are stored as ??????
+                                       $data = substr($atom_data, $offset, $data_size * 2);
+                                       $offset += ($data_size * 2);
+                                       break;
+                               default:
+echo 'QuicktimeParseNikonNCTG()::unknown $data_size_type: '.$data_size_type.'<br>';
+                                       break 2;
+                       }
+
+                       switch ($record_type) {
+                               case 0x00000011: // CreateDate
+                               case 0x00000012: // DateTimeOriginal
+                                       $data = strtotime($data);
+                                       break;
+                               case 0x0200001e: // ColorSpace
+                                       switch ($data) {
+                                               case 1:
+                                                       $data = 'sRGB';
+                                                       break;
+                                               case 2:
+                                                       $data = 'Adobe RGB';
+                                                       break;
+                                       }
+                                       break;
+                               case 0x02000023: // PictureControlData
+                                       $PictureControlAdjust = array(0=>'default', 1=>'quick', 2=>'full');
+                                       $FilterEffect = array(0x80=>'off', 0x81=>'yellow', 0x82=>'orange',    0x83=>'red', 0x84=>'green',  0xff=>'n/a');
+                                       $ToningEffect = array(0x80=>'b&w', 0x81=>'sepia',  0x82=>'cyanotype', 0x83=>'red', 0x84=>'yellow', 0x85=>'green', 0x86=>'blue-green', 0x87=>'blue', 0x88=>'purple-blue', 0x89=>'red-purple', 0xff=>'n/a');
+                                       $data = array(
+                                               'PictureControlVersion'     =>                           substr($data,  0,  4),
+                                               'PictureControlName'        =>                     rtrim(substr($data,  4, 20), "\x00"),
+                                               'PictureControlBase'        =>                     rtrim(substr($data, 24, 20), "\x00"),
+                                               //'?'                       =>                           substr($data, 44,  4),
+                                               'PictureControlAdjust'      => $PictureControlAdjust[ord(substr($data, 48,  1))],
+                                               'PictureControlQuickAdjust' =>                       ord(substr($data, 49,  1)),
+                                               'Sharpness'                 =>                       ord(substr($data, 50,  1)),
+                                               'Contrast'                  =>                       ord(substr($data, 51,  1)),
+                                               'Brightness'                =>                       ord(substr($data, 52,  1)),
+                                               'Saturation'                =>                       ord(substr($data, 53,  1)),
+                                               'HueAdjustment'             =>                       ord(substr($data, 54,  1)),
+                                               'FilterEffect'              =>         $FilterEffect[ord(substr($data, 55,  1))],
+                                               'ToningEffect'              =>         $ToningEffect[ord(substr($data, 56,  1))],
+                                               'ToningSaturation'          =>                       ord(substr($data, 57,  1)),
+                                       );
+                                       break;
+                               case 0x02000024: // WorldTime
+                                       // http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html#WorldTime
+                                       // timezone is stored as offset from GMT in minutes
+                                       $timezone = getid3_lib::BigEndian2Int(substr($data, 0, 2));
+                                       if ($timezone & 0x8000) {
+                                               $timezone = 0 - (0x10000 - $timezone);
+                                       }
+                                       $timezone /= 60;
+
+                                       $dst = (bool) getid3_lib::BigEndian2Int(substr($data, 2, 1));
+                                       switch (getid3_lib::BigEndian2Int(substr($data, 3, 1))) {
+                                               case 2:
+                                                       $datedisplayformat = 'D/M/Y'; break;
+                                               case 1:
+                                                       $datedisplayformat = 'M/D/Y'; break;
+                                               case 0:
+                                               default:
+                                                       $datedisplayformat = 'Y/M/D'; break;
+                                       }
+
+                                       $data = array('timezone'=>floatval($timezone), 'dst'=>$dst, 'display'=>$datedisplayformat);
+                                       break;
+                               case 0x02000083: // LensType
+                                       $data = array(
+                                               //'_'  => $data,
+                                               'mf' => (bool) ($data & 0x01),
+                                               'd'  => (bool) ($data & 0x02),
+                                               'g'  => (bool) ($data & 0x04),
+                                               'vr' => (bool) ($data & 0x08),
+                                       );
+                                       break;
+                       }
+                       $tag_name = (isset($NCTGtagName[$record_type]) ? $NCTGtagName[$record_type] : '0x'.str_pad(dechex($record_type), 8, '0', STR_PAD_LEFT));
+                       $parsed[$tag_name] = $data;
+               }
+               return $parsed;
+       }
+
+
+       public function CopyToAppropriateCommentsSection($keyname, $data, $boxname='') {
+               static $handyatomtranslatorarray = array();
+               if (empty($handyatomtranslatorarray)) {
+                       $handyatomtranslatorarray['©cpy'] = 'copyright';
+                       $handyatomtranslatorarray['©day'] = 'creation_date';    // iTunes 4.0
+                       $handyatomtranslatorarray['©dir'] = 'director';
+                       $handyatomtranslatorarray['©ed1'] = 'edit1';
+                       $handyatomtranslatorarray['©ed2'] = 'edit2';
+                       $handyatomtranslatorarray['©ed3'] = 'edit3';
+                       $handyatomtranslatorarray['©ed4'] = 'edit4';
+                       $handyatomtranslatorarray['©ed5'] = 'edit5';
+                       $handyatomtranslatorarray['©ed6'] = 'edit6';
+                       $handyatomtranslatorarray['©ed7'] = 'edit7';
+                       $handyatomtranslatorarray['©ed8'] = 'edit8';
+                       $handyatomtranslatorarray['©ed9'] = 'edit9';
+                       $handyatomtranslatorarray['©fmt'] = 'format';
+                       $handyatomtranslatorarray['©inf'] = 'information';
+                       $handyatomtranslatorarray['©prd'] = 'producer';
+                       $handyatomtranslatorarray['©prf'] = 'performers';
+                       $handyatomtranslatorarray['©req'] = 'system_requirements';
+                       $handyatomtranslatorarray['©src'] = 'source_credit';
+                       $handyatomtranslatorarray['©wrt'] = 'writer';
+
+                       // http://www.geocities.com/xhelmboyx/quicktime/formats/qtm-layout.txt
+                       $handyatomtranslatorarray['©nam'] = 'title';           // iTunes 4.0
+                       $handyatomtranslatorarray['©cmt'] = 'comment';         // iTunes 4.0
+                       $handyatomtranslatorarray['©wrn'] = 'warning';
+                       $handyatomtranslatorarray['©hst'] = 'host_computer';
+                       $handyatomtranslatorarray['©mak'] = 'make';
+                       $handyatomtranslatorarray['©mod'] = 'model';
+                       $handyatomtranslatorarray['©PRD'] = 'product';
+                       $handyatomtranslatorarray['©swr'] = 'software';
+                       $handyatomtranslatorarray['©aut'] = 'author';
+                       $handyatomtranslatorarray['©ART'] = 'artist';
+                       $handyatomtranslatorarray['©trk'] = 'track';
+                       $handyatomtranslatorarray['©alb'] = 'album';           // iTunes 4.0
+                       $handyatomtranslatorarray['©com'] = 'comment';
+                       $handyatomtranslatorarray['©gen'] = 'genre';           // iTunes 4.0
+                       $handyatomtranslatorarray['©ope'] = 'composer';
+                       $handyatomtranslatorarray['©url'] = 'url';
+                       $handyatomtranslatorarray['©enc'] = 'encoder';
+
+                       // http://atomicparsley.sourceforge.net/mpeg-4files.html
+                       $handyatomtranslatorarray['©art'] = 'artist';           // iTunes 4.0
+                       $handyatomtranslatorarray['aART'] = 'album_artist';
+                       $handyatomtranslatorarray['trkn'] = 'track_number';     // iTunes 4.0
+                       $handyatomtranslatorarray['disk'] = 'disc_number';      // iTunes 4.0
+                       $handyatomtranslatorarray['gnre'] = 'genre';            // iTunes 4.0
+                       $handyatomtranslatorarray['©too'] = 'encoder';          // iTunes 4.0
+                       $handyatomtranslatorarray['tmpo'] = 'bpm';              // iTunes 4.0
+                       $handyatomtranslatorarray['cprt'] = 'copyright';        // iTunes 4.0?
+                       $handyatomtranslatorarray['cpil'] = 'compilation';      // iTunes 4.0
+                       $handyatomtranslatorarray['covr'] = 'picture';          // iTunes 4.0
+                       $handyatomtranslatorarray['rtng'] = 'rating';           // iTunes 4.0
+                       $handyatomtranslatorarray['©grp'] = 'grouping';         // iTunes 4.2
+                       $handyatomtranslatorarray['stik'] = 'stik';             // iTunes 4.9
+                       $handyatomtranslatorarray['pcst'] = 'podcast';          // iTunes 4.9
+                       $handyatomtranslatorarray['catg'] = 'category';         // iTunes 4.9
+                       $handyatomtranslatorarray['keyw'] = 'keyword';          // iTunes 4.9
+                       $handyatomtranslatorarray['purl'] = 'podcast_url';      // iTunes 4.9
+                       $handyatomtranslatorarray['egid'] = 'episode_guid';     // iTunes 4.9
+                       $handyatomtranslatorarray['desc'] = 'description';      // iTunes 5.0
+                       $handyatomtranslatorarray['©lyr'] = 'lyrics';           // iTunes 5.0
+                       $handyatomtranslatorarray['tvnn'] = 'tv_network_name';  // iTunes 6.0
+                       $handyatomtranslatorarray['tvsh'] = 'tv_show_name';     // iTunes 6.0
+                       $handyatomtranslatorarray['tvsn'] = 'tv_season';        // iTunes 6.0
+                       $handyatomtranslatorarray['tves'] = 'tv_episode';       // iTunes 6.0
+                       $handyatomtranslatorarray['purd'] = 'purchase_date';    // iTunes 6.0.2
+                       $handyatomtranslatorarray['pgap'] = 'gapless_playback'; // iTunes 7.0
+
+                       // http://www.geocities.com/xhelmboyx/quicktime/formats/mp4-layout.txt
+
+
+
+                       // boxnames:
+                       /*
+                       $handyatomtranslatorarray['iTunSMPB']                    = 'iTunSMPB';
+                       $handyatomtranslatorarray['iTunNORM']                    = 'iTunNORM';
+                       $handyatomtranslatorarray['Encoding Params']             = 'Encoding Params';
+                       $handyatomtranslatorarray['replaygain_track_gain']       = 'replaygain_track_gain';
+                       $handyatomtranslatorarray['replaygain_track_peak']       = 'replaygain_track_peak';
+                       $handyatomtranslatorarray['replaygain_track_minmax']     = 'replaygain_track_minmax';
+                       $handyatomtranslatorarray['MusicIP PUID']                = 'MusicIP PUID';
+                       $handyatomtranslatorarray['MusicBrainz Artist Id']       = 'MusicBrainz Artist Id';
+                       $handyatomtranslatorarray['MusicBrainz Album Id']        = 'MusicBrainz Album Id';
+                       $handyatomtranslatorarray['MusicBrainz Album Artist Id'] = 'MusicBrainz Album Artist Id';
+                       $handyatomtranslatorarray['MusicBrainz Track Id']        = 'MusicBrainz Track Id';
+                       $handyatomtranslatorarray['MusicBrainz Disc Id']         = 'MusicBrainz Disc Id';
+
+                       // http://age.hobba.nl/audio/tag_frame_reference.html
+                       $handyatomtranslatorarray['PLAY_COUNTER']                = 'play_counter'; // Foobar2000 - http://www.getid3.org/phpBB3/viewtopic.php?t=1355
+                       $handyatomtranslatorarray['MEDIATYPE']                   = 'mediatype';    // Foobar2000 - http://www.getid3.org/phpBB3/viewtopic.php?t=1355
+                       */
+               }
+               $info = &$this->getid3->info;
+               $comment_key = '';
+               if ($boxname && ($boxname != $keyname)) {
+                       $comment_key = (isset($handyatomtranslatorarray[$boxname]) ? $handyatomtranslatorarray[$boxname] : $boxname);
+               } elseif (isset($handyatomtranslatorarray[$keyname])) {
+                       $comment_key = $handyatomtranslatorarray[$keyname];
+               }
+               if ($comment_key) {
+                       if ($comment_key == 'picture') {
+                               if (!is_array($data)) {
+                                       $image_mime = '';
+                                       if (preg_match('#^\x89\x50\x4E\x47\x0D\x0A\x1A\x0A#', $data)) {
+                                               $image_mime = 'image/png';
+                                       } elseif (preg_match('#^\xFF\xD8\xFF#', $data)) {
+                                               $image_mime = 'image/jpeg';
+                                       } elseif (preg_match('#^GIF#', $data)) {
+                                               $image_mime = 'image/gif';
+                                       } elseif (preg_match('#^BM#', $data)) {
+                                               $image_mime = 'image/bmp';
+                                       }
+                                       $data = array('data'=>$data, 'image_mime'=>$image_mime);
+                               }
+                       }
+                       $info['quicktime']['comments'][$comment_key][] = $data;
+               }
+               return true;
+       }
+
+       public function NoNullString($nullterminatedstring) {
+               // remove the single null terminator on null terminated strings
+               if (substr($nullterminatedstring, strlen($nullterminatedstring) - 1, 1) === "\x00") {
+                       return substr($nullterminatedstring, 0, strlen($nullterminatedstring) - 1);
+               }
+               return $nullterminatedstring;
+       }
+
+       public function Pascal2String($pascalstring) {
+               // Pascal strings have 1 unsigned byte at the beginning saying how many chars (1-255) are in the string
+               return substr($pascalstring, 1);
+       }
+
+}
diff --git a/wp-includes/ID3/module.audio-video.riff.php b/wp-includes/ID3/module.audio-video.riff.php
new file mode 100644 (file)
index 0000000..8f43100
--- /dev/null
@@ -0,0 +1,2435 @@
+<?php
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org>               //
+//  available at http://getid3.sourceforge.net                 //
+//            or http://www.getid3.org                         //
+/////////////////////////////////////////////////////////////////
+// See readme.txt for more details                             //
+/////////////////////////////////////////////////////////////////
+//                                                             //
+// module.audio-video.riff.php                                 //
+// module for analyzing RIFF files                             //
+// multiple formats supported by this module:                  //
+//    Wave, AVI, AIFF/AIFC, (MP3,AC3)/RIFF, Wavpack v3, 8SVX   //
+// dependencies: module.audio.mp3.php                          //
+//               module.audio.ac3.php                          //
+//               module.audio.dts.php                          //
+//                                                            ///
+/////////////////////////////////////////////////////////////////
+
+/**
+* @todo Parse AC-3/DTS audio inside WAVE correctly
+* @todo Rewrite RIFF parser totally
+*/
+
+getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.mp3.php', __FILE__, true);
+getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ac3.php', __FILE__, true);
+getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.dts.php', __FILE__, true);
+
+class getid3_riff extends getid3_handler
+{
+
+       public function Analyze() {
+               $info = &$this->getid3->info;
+
+               // initialize these values to an empty array, otherwise they default to NULL
+               // and you can't append array values to a NULL value
+               $info['riff'] = array('raw'=>array());
+
+               // Shortcuts
+               $thisfile_riff             = &$info['riff'];
+               $thisfile_riff_raw         = &$thisfile_riff['raw'];
+               $thisfile_audio            = &$info['audio'];
+               $thisfile_video            = &$info['video'];
+               $thisfile_audio_dataformat = &$thisfile_audio['dataformat'];
+               $thisfile_riff_audio       = &$thisfile_riff['audio'];
+               $thisfile_riff_video       = &$thisfile_riff['video'];
+
+               $Original['avdataoffset'] = $info['avdataoffset'];
+               $Original['avdataend']    = $info['avdataend'];
+
+               $this->fseek($info['avdataoffset']);
+               $RIFFheader = $this->fread(12);
+               $offset = $this->ftell();
+               $RIFFtype    = substr($RIFFheader, 0, 4);
+               $RIFFsize    = substr($RIFFheader, 4, 4);
+               $RIFFsubtype = substr($RIFFheader, 8, 4);
+
+               switch ($RIFFtype) {
+
+                       case 'FORM':  // AIFF, AIFC
+                               $info['fileformat']   = 'aiff';
+                               $thisfile_riff['header_size'] = $this->EitherEndian2Int($RIFFsize);
+                               $thisfile_riff[$RIFFsubtype]  = $this->ParseRIFF($offset, ($offset + $thisfile_riff['header_size'] - 4));
+                               break;
+
+                       case 'RIFF':  // AVI, WAV, etc
+                       case 'SDSS':  // SDSS is identical to RIFF, just renamed. Used by SmartSound QuickTracks (www.smartsound.com)
+                       case 'RMP3':  // RMP3 is identical to RIFF, just renamed. Used by [unknown program] when creating RIFF-MP3s
+                               $info['fileformat']   = 'riff';
+                               $thisfile_riff['header_size'] = $this->EitherEndian2Int($RIFFsize);
+                               if ($RIFFsubtype == 'RMP3') {
+                                       // RMP3 is identical to WAVE, just renamed. Used by [unknown program] when creating RIFF-MP3s
+                                       $RIFFsubtype = 'WAVE';
+                               }
+                               $thisfile_riff[$RIFFsubtype]  = $this->ParseRIFF($offset, ($offset + $thisfile_riff['header_size'] - 4));
+                               if (($info['avdataend'] - $info['filesize']) == 1) {
+                                       // LiteWave appears to incorrectly *not* pad actual output file
+                                       // to nearest WORD boundary so may appear to be short by one
+                                       // byte, in which case - skip warning
+                                       $info['avdataend'] = $info['filesize'];
+                               }
+
+                               $nextRIFFoffset = $Original['avdataoffset'] + 8 + $thisfile_riff['header_size']; // 8 = "RIFF" + 32-bit offset
+                               while ($nextRIFFoffset < min($info['filesize'], $info['avdataend'])) {
+                                       try {
+                                               $this->fseek($nextRIFFoffset);
+                                       } catch (getid3_exception $e) {
+                                               if ($e->getCode() == 10) {
+                                                       //$this->warning('RIFF parser: '.$e->getMessage());
+                                                       $this->error('AVI extends beyond '.round(PHP_INT_MAX / 1073741824).'GB and PHP filesystem functions cannot read that far, playtime may be wrong');
+                                                       $this->warning('[avdataend] value may be incorrect, multiple AVIX chunks may be present');
+                                                       break;
+                                               } else {
+                                                       throw $e;
+                                               }
+                                       }
+                                       $nextRIFFheader = $this->fread(12);
+                                       if ($nextRIFFoffset == ($info['avdataend'] - 1)) {
+                                               if (substr($nextRIFFheader, 0, 1) == "\x00") {
+                                                       // RIFF padded to WORD boundary, we're actually already at the end
+                                                       break;
+                                               }
+                                       }
+                                       $nextRIFFheaderID =                         substr($nextRIFFheader, 0, 4);
+                                       $nextRIFFsize     = $this->EitherEndian2Int(substr($nextRIFFheader, 4, 4));
+                                       $nextRIFFtype     =                         substr($nextRIFFheader, 8, 4);
+                                       $chunkdata = array();
+                                       $chunkdata['offset'] = $nextRIFFoffset + 8;
+                                       $chunkdata['size']   = $nextRIFFsize;
+                                       $nextRIFFoffset = $chunkdata['offset'] + $chunkdata['size'];
+
+                                       switch ($nextRIFFheaderID) {
+
+                                               case 'RIFF':
+                                                       $chunkdata['chunks'] = $this->ParseRIFF($chunkdata['offset'] + 4, $nextRIFFoffset);
+
+                                                       if (!isset($thisfile_riff[$nextRIFFtype])) {
+                                                               $thisfile_riff[$nextRIFFtype] = array();
+                                                       }
+                                                       $thisfile_riff[$nextRIFFtype][] = $chunkdata;
+                                                       break;
+
+                                               case 'JUNK':
+                                                       // ignore
+                                                       $thisfile_riff[$nextRIFFheaderID][] = $chunkdata;
+                                                       break;
+
+                                               case 'IDVX':
+                                                       $info['divxtag']['comments'] = self::ParseDIVXTAG($this->fread($chunkdata['size']));
+                                                       break;
+
+                                               default:
+                                                       if ($info['filesize'] == ($chunkdata['offset'] - 8 + 128)) {
+                                                               $DIVXTAG = $nextRIFFheader.$this->fread(128 - 12);
+                                                               if (substr($DIVXTAG, -7) == 'DIVXTAG') {
+                                                                       // DIVXTAG is supposed to be inside an IDVX chunk in a LIST chunk, but some bad encoders just slap it on the end of a file
+                                                                       $this->warning('Found wrongly-structured DIVXTAG at offset '.($this->ftell() - 128).', parsing anyway');
+                                                                       $info['divxtag']['comments'] = self::ParseDIVXTAG($DIVXTAG);
+                                                                       break 2;
+                                                               }
+                                                       }
+                                                       $this->warning('Expecting "RIFF|JUNK|IDVX" at '.$nextRIFFoffset.', found "'.$nextRIFFheaderID.'" ('.getid3_lib::PrintHexBytes($nextRIFFheaderID).') - skipping rest of file');
+                                                       break 2;
+
+                                       }
+
+                               }
+                               if ($RIFFsubtype == 'WAVE') {
+                                       $thisfile_riff_WAVE = &$thisfile_riff['WAVE'];
+                               }
+                               break;
+
+                       default:
+                               $this->error('Cannot parse RIFF (this is maybe not a RIFF / WAV / AVI file?) - expecting "FORM|RIFF|SDSS|RMP3" found "'.$RIFFsubtype.'" instead');
+                               unset($info['fileformat']);
+                               return false;
+               }
+
+               $streamindex = 0;
+               switch ($RIFFsubtype) {
+                       case 'WAVE':
+                               if (empty($thisfile_audio['bitrate_mode'])) {
+                                       $thisfile_audio['bitrate_mode'] = 'cbr';
+                               }
+                               if (empty($thisfile_audio_dataformat)) {
+                                       $thisfile_audio_dataformat = 'wav';
+                               }
+
+                               if (isset($thisfile_riff_WAVE['data'][0]['offset'])) {
+                                       $info['avdataoffset'] = $thisfile_riff_WAVE['data'][0]['offset'] + 8;
+                                       $info['avdataend']    = $info['avdataoffset'] + $thisfile_riff_WAVE['data'][0]['size'];
+                               }
+                               if (isset($thisfile_riff_WAVE['fmt '][0]['data'])) {
+
+                                       $thisfile_riff_audio[$streamindex] = self::parseWAVEFORMATex($thisfile_riff_WAVE['fmt '][0]['data']);
+                                       $thisfile_audio['wformattag'] = $thisfile_riff_audio[$streamindex]['raw']['wFormatTag'];
+                                       if (!isset($thisfile_riff_audio[$streamindex]['bitrate']) || ($thisfile_riff_audio[$streamindex]['bitrate'] == 0)) {
+                                               $info['error'][] = 'Corrupt RIFF file: bitrate_audio == zero';
+                                               return false;
+                                       }
+                                       $thisfile_riff_raw['fmt '] = $thisfile_riff_audio[$streamindex]['raw'];
+                                       unset($thisfile_riff_audio[$streamindex]['raw']);
+                                       $thisfile_audio['streams'][$streamindex] = $thisfile_riff_audio[$streamindex];
+
+                                       $thisfile_audio = getid3_lib::array_merge_noclobber($thisfile_audio, $thisfile_riff_audio[$streamindex]);
+                                       if (substr($thisfile_audio['codec'], 0, strlen('unknown: 0x')) == 'unknown: 0x') {
+                                               $info['warning'][] = 'Audio codec = '.$thisfile_audio['codec'];
+                                       }
+                                       $thisfile_audio['bitrate'] = $thisfile_riff_audio[$streamindex]['bitrate'];
+
+                                       if (empty($info['playtime_seconds'])) { // may already be set (e.g. DTS-WAV)
+                                               $info['playtime_seconds'] = (float) ((($info['avdataend'] - $info['avdataoffset']) * 8) / $thisfile_audio['bitrate']);
+                                       }
+
+                                       $thisfile_audio['lossless'] = false;
+                                       if (isset($thisfile_riff_WAVE['data'][0]['offset']) && isset($thisfile_riff_raw['fmt ']['wFormatTag'])) {
+                                               switch ($thisfile_riff_raw['fmt ']['wFormatTag']) {
+
+                                                       case 0x0001:  // PCM
+                                                               $thisfile_audio['lossless'] = true;
+                                                               break;
+
+                                                       case 0x2000:  // AC-3
+                                                               $thisfile_audio_dataformat = 'ac3';
+                                                               break;
+
+                                                       default:
+                                                               // do nothing
+                                                               break;
+
+                                               }
+                                       }
+                                       $thisfile_audio['streams'][$streamindex]['wformattag']   = $thisfile_audio['wformattag'];
+                                       $thisfile_audio['streams'][$streamindex]['bitrate_mode'] = $thisfile_audio['bitrate_mode'];
+                                       $thisfile_audio['streams'][$streamindex]['lossless']     = $thisfile_audio['lossless'];
+                                       $thisfile_audio['streams'][$streamindex]['dataformat']   = $thisfile_audio_dataformat;
+                               }
+
+                               if (isset($thisfile_riff_WAVE['rgad'][0]['data'])) {
+
+                                       // shortcuts
+                                       $rgadData = &$thisfile_riff_WAVE['rgad'][0]['data'];
+                                       $thisfile_riff_raw['rgad']    = array('track'=>array(), 'album'=>array());
+                                       $thisfile_riff_raw_rgad       = &$thisfile_riff_raw['rgad'];
+                                       $thisfile_riff_raw_rgad_track = &$thisfile_riff_raw_rgad['track'];
+                                       $thisfile_riff_raw_rgad_album = &$thisfile_riff_raw_rgad['album'];
+
+                                       $thisfile_riff_raw_rgad['fPeakAmplitude']      = getid3_lib::LittleEndian2Float(substr($rgadData, 0, 4));
+                                       $thisfile_riff_raw_rgad['nRadioRgAdjust']      =        $this->EitherEndian2Int(substr($rgadData, 4, 2));
+                                       $thisfile_riff_raw_rgad['nAudiophileRgAdjust'] =        $this->EitherEndian2Int(substr($rgadData, 6, 2));
+
+                                       $nRadioRgAdjustBitstring      = str_pad(getid3_lib::Dec2Bin($thisfile_riff_raw_rgad['nRadioRgAdjust']), 16, '0', STR_PAD_LEFT);
+                                       $nAudiophileRgAdjustBitstring = str_pad(getid3_lib::Dec2Bin($thisfile_riff_raw_rgad['nAudiophileRgAdjust']), 16, '0', STR_PAD_LEFT);
+                                       $thisfile_riff_raw_rgad_track['name']       = getid3_lib::Bin2Dec(substr($nRadioRgAdjustBitstring, 0, 3));
+                                       $thisfile_riff_raw_rgad_track['originator'] = getid3_lib::Bin2Dec(substr($nRadioRgAdjustBitstring, 3, 3));
+                                       $thisfile_riff_raw_rgad_track['signbit']    = getid3_lib::Bin2Dec(substr($nRadioRgAdjustBitstring, 6, 1));
+                                       $thisfile_riff_raw_rgad_track['adjustment'] = getid3_lib::Bin2Dec(substr($nRadioRgAdjustBitstring, 7, 9));
+                                       $thisfile_riff_raw_rgad_album['name']       = getid3_lib::Bin2Dec(substr($nAudiophileRgAdjustBitstring, 0, 3));
+                                       $thisfile_riff_raw_rgad_album['originator'] = getid3_lib::Bin2Dec(substr($nAudiophileRgAdjustBitstring, 3, 3));
+                                       $thisfile_riff_raw_rgad_album['signbit']    = getid3_lib::Bin2Dec(substr($nAudiophileRgAdjustBitstring, 6, 1));
+                                       $thisfile_riff_raw_rgad_album['adjustment'] = getid3_lib::Bin2Dec(substr($nAudiophileRgAdjustBitstring, 7, 9));
+
+                                       $thisfile_riff['rgad']['peakamplitude'] = $thisfile_riff_raw_rgad['fPeakAmplitude'];
+                                       if (($thisfile_riff_raw_rgad_track['name'] != 0) && ($thisfile_riff_raw_rgad_track['originator'] != 0)) {
+                                               $thisfile_riff['rgad']['track']['name']            = getid3_lib::RGADnameLookup($thisfile_riff_raw_rgad_track['name']);
+                                               $thisfile_riff['rgad']['track']['originator']      = getid3_lib::RGADoriginatorLookup($thisfile_riff_raw_rgad_track['originator']);
+                                               $thisfile_riff['rgad']['track']['adjustment']      = getid3_lib::RGADadjustmentLookup($thisfile_riff_raw_rgad_track['adjustment'], $thisfile_riff_raw_rgad_track['signbit']);
+                                       }
+                                       if (($thisfile_riff_raw_rgad_album['name'] != 0) && ($thisfile_riff_raw_rgad_album['originator'] != 0)) {
+                                               $thisfile_riff['rgad']['album']['name']       = getid3_lib::RGADnameLookup($thisfile_riff_raw_rgad_album['name']);
+                                               $thisfile_riff['rgad']['album']['originator'] = getid3_lib::RGADoriginatorLookup($thisfile_riff_raw_rgad_album['originator']);
+                                               $thisfile_riff['rgad']['album']['adjustment'] = getid3_lib::RGADadjustmentLookup($thisfile_riff_raw_rgad_album['adjustment'], $thisfile_riff_raw_rgad_album['signbit']);
+                                       }
+                               }
+
+                               if (isset($thisfile_riff_WAVE['fact'][0]['data'])) {
+                                       $thisfile_riff_raw['fact']['NumberOfSamples'] = $this->EitherEndian2Int(substr($thisfile_riff_WAVE['fact'][0]['data'], 0, 4));
+
+                                       // This should be a good way of calculating exact playtime,
+                                       // but some sample files have had incorrect number of samples,
+                                       // so cannot use this method
+
+                                       // if (!empty($thisfile_riff_raw['fmt ']['nSamplesPerSec'])) {
+                                       //     $info['playtime_seconds'] = (float) $thisfile_riff_raw['fact']['NumberOfSamples'] / $thisfile_riff_raw['fmt ']['nSamplesPerSec'];
+                                       // }
+                               }
+                               if (!empty($thisfile_riff_raw['fmt ']['nAvgBytesPerSec'])) {
+                                       $thisfile_audio['bitrate'] = getid3_lib::CastAsInt($thisfile_riff_raw['fmt ']['nAvgBytesPerSec'] * 8);
+                               }
+
+                               if (isset($thisfile_riff_WAVE['bext'][0]['data'])) {
+                                       // shortcut
+                                       $thisfile_riff_WAVE_bext_0 = &$thisfile_riff_WAVE['bext'][0];
+
+                                       $thisfile_riff_WAVE_bext_0['title']          =                         trim(substr($thisfile_riff_WAVE_bext_0['data'],   0, 256));
+                                       $thisfile_riff_WAVE_bext_0['author']         =                         trim(substr($thisfile_riff_WAVE_bext_0['data'], 256,  32));
+                                       $thisfile_riff_WAVE_bext_0['reference']      =                         trim(substr($thisfile_riff_WAVE_bext_0['data'], 288,  32));
+                                       $thisfile_riff_WAVE_bext_0['origin_date']    =                              substr($thisfile_riff_WAVE_bext_0['data'], 320,  10);
+                                       $thisfile_riff_WAVE_bext_0['origin_time']    =                              substr($thisfile_riff_WAVE_bext_0['data'], 330,   8);
+                                       $thisfile_riff_WAVE_bext_0['time_reference'] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_bext_0['data'], 338,   8));
+                                       $thisfile_riff_WAVE_bext_0['bwf_version']    = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_bext_0['data'], 346,   1));
+                                       $thisfile_riff_WAVE_bext_0['reserved']       =                              substr($thisfile_riff_WAVE_bext_0['data'], 347, 254);
+                                       $thisfile_riff_WAVE_bext_0['coding_history'] =         explode("\r\n", trim(substr($thisfile_riff_WAVE_bext_0['data'], 601)));
+                                       if (preg_match('#^([0-9]{4}).([0-9]{2}).([0-9]{2})$#', $thisfile_riff_WAVE_bext_0['origin_date'], $matches_bext_date)) {
+                                               if (preg_match('#^([0-9]{2}).([0-9]{2}).([0-9]{2})$#', $thisfile_riff_WAVE_bext_0['origin_time'], $matches_bext_time)) {
+                                                       list($dummy, $bext_timestamp['year'], $bext_timestamp['month'],  $bext_timestamp['day'])    = $matches_bext_date;
+                                                       list($dummy, $bext_timestamp['hour'], $bext_timestamp['minute'], $bext_timestamp['second']) = $matches_bext_time;
+                                                       $thisfile_riff_WAVE_bext_0['origin_date_unix'] = gmmktime($bext_timestamp['hour'], $bext_timestamp['minute'], $bext_timestamp['second'], $bext_timestamp['month'], $bext_timestamp['day'], $bext_timestamp['year']);
+                                               } else {
+                                                       $info['warning'][] = 'RIFF.WAVE.BEXT.origin_time is invalid';
+                                               }
+                                       } else {
+                                               $info['warning'][] = 'RIFF.WAVE.BEXT.origin_date is invalid';
+                                       }
+                                       $thisfile_riff['comments']['author'][] = $thisfile_riff_WAVE_bext_0['author'];
+                                       $thisfile_riff['comments']['title'][]  = $thisfile_riff_WAVE_bext_0['title'];
+                               }
+
+                               if (isset($thisfile_riff_WAVE['MEXT'][0]['data'])) {
+                                       // shortcut
+                                       $thisfile_riff_WAVE_MEXT_0 = &$thisfile_riff_WAVE['MEXT'][0];
+
+                                       $thisfile_riff_WAVE_MEXT_0['raw']['sound_information']      = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_MEXT_0['data'], 0, 2));
+                                       $thisfile_riff_WAVE_MEXT_0['flags']['homogenous']           = (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['sound_information'] & 0x0001);
+                                       if ($thisfile_riff_WAVE_MEXT_0['flags']['homogenous']) {
+                                               $thisfile_riff_WAVE_MEXT_0['flags']['padding']          = ($thisfile_riff_WAVE_MEXT_0['raw']['sound_information'] & 0x0002) ? false : true;
+                                               $thisfile_riff_WAVE_MEXT_0['flags']['22_or_44']         =        (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['sound_information'] & 0x0004);
+                                               $thisfile_riff_WAVE_MEXT_0['flags']['free_format']      =        (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['sound_information'] & 0x0008);
+
+                                               $thisfile_riff_WAVE_MEXT_0['nominal_frame_size']        = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_MEXT_0['data'], 2, 2));
+                                       }
+                                       $thisfile_riff_WAVE_MEXT_0['anciliary_data_length']         = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_MEXT_0['data'], 6, 2));
+                                       $thisfile_riff_WAVE_MEXT_0['raw']['anciliary_data_def']     = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_MEXT_0['data'], 8, 2));
+                                       $thisfile_riff_WAVE_MEXT_0['flags']['anciliary_data_left']  = (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['anciliary_data_def'] & 0x0001);
+                                       $thisfile_riff_WAVE_MEXT_0['flags']['anciliary_data_free']  = (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['anciliary_data_def'] & 0x0002);
+                                       $thisfile_riff_WAVE_MEXT_0['flags']['anciliary_data_right'] = (bool) ($thisfile_riff_WAVE_MEXT_0['raw']['anciliary_data_def'] & 0x0004);
+                               }
+
+                               if (isset($thisfile_riff_WAVE['cart'][0]['data'])) {
+                                       // shortcut
+                                       $thisfile_riff_WAVE_cart_0 = &$thisfile_riff_WAVE['cart'][0];
+
+                                       $thisfile_riff_WAVE_cart_0['version']              =                              substr($thisfile_riff_WAVE_cart_0['data'],   0,  4);
+                                       $thisfile_riff_WAVE_cart_0['title']                =                         trim(substr($thisfile_riff_WAVE_cart_0['data'],   4, 64));
+                                       $thisfile_riff_WAVE_cart_0['artist']               =                         trim(substr($thisfile_riff_WAVE_cart_0['data'],  68, 64));
+                                       $thisfile_riff_WAVE_cart_0['cut_id']               =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 132, 64));
+                                       $thisfile_riff_WAVE_cart_0['client_id']            =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 196, 64));
+                                       $thisfile_riff_WAVE_cart_0['category']             =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 260, 64));
+                                       $thisfile_riff_WAVE_cart_0['classification']       =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 324, 64));
+                                       $thisfile_riff_WAVE_cart_0['out_cue']              =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 388, 64));
+                                       $thisfile_riff_WAVE_cart_0['start_date']           =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 452, 10));
+                                       $thisfile_riff_WAVE_cart_0['start_time']           =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 462,  8));
+                                       $thisfile_riff_WAVE_cart_0['end_date']             =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 470, 10));
+                                       $thisfile_riff_WAVE_cart_0['end_time']             =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 480,  8));
+                                       $thisfile_riff_WAVE_cart_0['producer_app_id']      =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 488, 64));
+                                       $thisfile_riff_WAVE_cart_0['producer_app_version'] =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 552, 64));
+                                       $thisfile_riff_WAVE_cart_0['user_defined_text']    =                         trim(substr($thisfile_riff_WAVE_cart_0['data'], 616, 64));
+                                       $thisfile_riff_WAVE_cart_0['zero_db_reference']    = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_cart_0['data'], 680,  4), true);
+                                       for ($i = 0; $i < 8; $i++) {
+                                               $thisfile_riff_WAVE_cart_0['post_time'][$i]['usage_fourcc'] =                  substr($thisfile_riff_WAVE_cart_0['data'], 684 + ($i * 8), 4);
+                                               $thisfile_riff_WAVE_cart_0['post_time'][$i]['timer_value']  = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE_cart_0['data'], 684 + ($i * 8) + 4, 4));
+                                       }
+                                       $thisfile_riff_WAVE_cart_0['url']              =                 trim(substr($thisfile_riff_WAVE_cart_0['data'],  748, 1024));
+                                       $thisfile_riff_WAVE_cart_0['tag_text']         = explode("\r\n", trim(substr($thisfile_riff_WAVE_cart_0['data'], 1772)));
+
+                                       $thisfile_riff['comments']['artist'][] = $thisfile_riff_WAVE_cart_0['artist'];
+                                       $thisfile_riff['comments']['title'][]  = $thisfile_riff_WAVE_cart_0['title'];
+                               }
+
+                               if (isset($thisfile_riff_WAVE['SNDM'][0]['data'])) {
+                                       // SoundMiner metadata
+
+                                       // shortcuts
+                                       $thisfile_riff_WAVE_SNDM_0      = &$thisfile_riff_WAVE['SNDM'][0];
+                                       $thisfile_riff_WAVE_SNDM_0_data = &$thisfile_riff_WAVE_SNDM_0['data'];
+                                       $SNDM_startoffset = 0;
+                                       $SNDM_endoffset   = $thisfile_riff_WAVE_SNDM_0['size'];
+
+                                       while ($SNDM_startoffset < $SNDM_endoffset) {
+                                               $SNDM_thisTagOffset = 0;
+                                               $SNDM_thisTagSize      = getid3_lib::BigEndian2Int(substr($thisfile_riff_WAVE_SNDM_0_data, $SNDM_startoffset + $SNDM_thisTagOffset, 4));
+                                               $SNDM_thisTagOffset += 4;
+                                               $SNDM_thisTagKey       =                           substr($thisfile_riff_WAVE_SNDM_0_data, $SNDM_startoffset + $SNDM_thisTagOffset, 4);
+                                               $SNDM_thisTagOffset += 4;
+                                               $SNDM_thisTagDataSize  = getid3_lib::BigEndian2Int(substr($thisfile_riff_WAVE_SNDM_0_data, $SNDM_startoffset + $SNDM_thisTagOffset, 2));
+                                               $SNDM_thisTagOffset += 2;
+                                               $SNDM_thisTagDataFlags = getid3_lib::BigEndian2Int(substr($thisfile_riff_WAVE_SNDM_0_data, $SNDM_startoffset + $SNDM_thisTagOffset, 2));
+                                               $SNDM_thisTagOffset += 2;
+                                               $SNDM_thisTagDataText =                            substr($thisfile_riff_WAVE_SNDM_0_data, $SNDM_startoffset + $SNDM_thisTagOffset, $SNDM_thisTagDataSize);
+                                               $SNDM_thisTagOffset += $SNDM_thisTagDataSize;
+
+                                               if ($SNDM_thisTagSize != (4 + 4 + 2 + 2 + $SNDM_thisTagDataSize)) {
+                                                       $info['warning'][] = 'RIFF.WAVE.SNDM.data contains tag not expected length (expected: '.$SNDM_thisTagSize.', found: '.(4 + 4 + 2 + 2 + $SNDM_thisTagDataSize).') at offset '.$SNDM_startoffset.' (file offset '.($thisfile_riff_WAVE_SNDM_0['offset'] + $SNDM_startoffset).')';
+                                                       break;
+                                               } elseif ($SNDM_thisTagSize <= 0) {
+                                                       $info['warning'][] = 'RIFF.WAVE.SNDM.data contains zero-size tag at offset '.$SNDM_startoffset.' (file offset '.($thisfile_riff_WAVE_SNDM_0['offset'] + $SNDM_startoffset).')';
+                                                       break;
+                                               }
+                                               $SNDM_startoffset += $SNDM_thisTagSize;
+
+                                               $thisfile_riff_WAVE_SNDM_0['parsed_raw'][$SNDM_thisTagKey] = $SNDM_thisTagDataText;
+                                               if ($parsedkey = self::waveSNDMtagLookup($SNDM_thisTagKey)) {
+                                                       $thisfile_riff_WAVE_SNDM_0['parsed'][$parsedkey] = $SNDM_thisTagDataText;
+                                               } else {
+                                                       $info['warning'][] = 'RIFF.WAVE.SNDM contains unknown tag "'.$SNDM_thisTagKey.'" at offset '.$SNDM_startoffset.' (file offset '.($thisfile_riff_WAVE_SNDM_0['offset'] + $SNDM_startoffset).')';
+                                               }
+                                       }
+
+                                       $tagmapping = array(
+                                               'tracktitle'=>'title',
+                                               'category'  =>'genre',
+                                               'cdtitle'   =>'album',
+                                               'tracktitle'=>'title',
+                                       );
+                                       foreach ($tagmapping as $fromkey => $tokey) {
+                                               if (isset($thisfile_riff_WAVE_SNDM_0['parsed'][$fromkey])) {
+                                                       $thisfile_riff['comments'][$tokey][] = $thisfile_riff_WAVE_SNDM_0['parsed'][$fromkey];
+                                               }
+                                       }
+                               }
+
+                               if (isset($thisfile_riff_WAVE['iXML'][0]['data'])) {
+                                       // requires functions simplexml_load_string and get_object_vars
+                                       if ($parsedXML = getid3_lib::XML2array($thisfile_riff_WAVE['iXML'][0]['data'])) {
+                                               $thisfile_riff_WAVE['iXML'][0]['parsed'] = $parsedXML;
+                                               if (isset($parsedXML['SPEED']['MASTER_SPEED'])) {
+                                                       @list($numerator, $denominator) = explode('/', $parsedXML['SPEED']['MASTER_SPEED']);
+                                                       $thisfile_riff_WAVE['iXML'][0]['master_speed'] = $numerator / ($denominator ? $denominator : 1000);
+                                               }
+                                               if (isset($parsedXML['SPEED']['TIMECODE_RATE'])) {
+                                                       @list($numerator, $denominator) = explode('/', $parsedXML['SPEED']['TIMECODE_RATE']);
+                                                       $thisfile_riff_WAVE['iXML'][0]['timecode_rate'] = $numerator / ($denominator ? $denominator : 1000);
+                                               }
+                                               if (isset($parsedXML['SPEED']['TIMESTAMP_SAMPLES_SINCE_MIDNIGHT_LO']) && !empty($parsedXML['SPEED']['TIMESTAMP_SAMPLE_RATE']) && !empty($thisfile_riff_WAVE['iXML'][0]['timecode_rate'])) {
+                                                       $samples_since_midnight = floatval(ltrim($parsedXML['SPEED']['TIMESTAMP_SAMPLES_SINCE_MIDNIGHT_HI'].$parsedXML['SPEED']['TIMESTAMP_SAMPLES_SINCE_MIDNIGHT_LO'], '0'));
+                                                       $thisfile_riff_WAVE['iXML'][0]['timecode_seconds'] = $samples_since_midnight / $parsedXML['SPEED']['TIMESTAMP_SAMPLE_RATE'];
+                                                       $h = floor( $thisfile_riff_WAVE['iXML'][0]['timecode_seconds']       / 3600);
+                                                       $m = floor(($thisfile_riff_WAVE['iXML'][0]['timecode_seconds'] - ($h * 3600))      / 60);
+                                                       $s = floor( $thisfile_riff_WAVE['iXML'][0]['timecode_seconds'] - ($h * 3600) - ($m * 60));
+                                                       $f =       ($thisfile_riff_WAVE['iXML'][0]['timecode_seconds'] - ($h * 3600) - ($m * 60) - $s) * $thisfile_riff_WAVE['iXML'][0]['timecode_rate'];
+                                                       $thisfile_riff_WAVE['iXML'][0]['timecode_string']       = sprintf('%02d:%02d:%02d:%05.2f', $h, $m, $s,       $f);
+                                                       $thisfile_riff_WAVE['iXML'][0]['timecode_string_round'] = sprintf('%02d:%02d:%02d:%02d',   $h, $m, $s, round($f));
+                                               }
+                                               unset($parsedXML);
+                                       }
+                               }
+
+
+
+                               if (!isset($thisfile_audio['bitrate']) && isset($thisfile_riff_audio[$streamindex]['bitrate'])) {
+                                       $thisfile_audio['bitrate'] = $thisfile_riff_audio[$streamindex]['bitrate'];
+                                       $info['playtime_seconds'] = (float) ((($info['avdataend'] - $info['avdataoffset']) * 8) / $thisfile_audio['bitrate']);
+                               }
+
+                               if (!empty($info['wavpack'])) {
+                                       $thisfile_audio_dataformat = 'wavpack';
+                                       $thisfile_audio['bitrate_mode'] = 'vbr';
+                                       $thisfile_audio['encoder']      = 'WavPack v'.$info['wavpack']['version'];
+
+                                       // Reset to the way it was - RIFF parsing will have messed this up
+                                       $info['avdataend']        = $Original['avdataend'];
+                                       $thisfile_audio['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds'];
+
+                                       $this->fseek($info['avdataoffset'] - 44);
+                                       $RIFFdata = $this->fread(44);
+                                       $OrignalRIFFheaderSize = getid3_lib::LittleEndian2Int(substr($RIFFdata,  4, 4)) +  8;
+                                       $OrignalRIFFdataSize   = getid3_lib::LittleEndian2Int(substr($RIFFdata, 40, 4)) + 44;
+
+                                       if ($OrignalRIFFheaderSize > $OrignalRIFFdataSize) {
+                                               $info['avdataend'] -= ($OrignalRIFFheaderSize - $OrignalRIFFdataSize);
+                                               $this->fseek($info['avdataend']);
+                                               $RIFFdata .= $this->fread($OrignalRIFFheaderSize - $OrignalRIFFdataSize);
+                                       }
+
+                                       // move the data chunk after all other chunks (if any)
+                                       // so that the RIFF parser doesn't see EOF when trying
+                                       // to skip over the data chunk
+                                       $RIFFdata = substr($RIFFdata, 0, 36).substr($RIFFdata, 44).substr($RIFFdata, 36, 8);
+                                       $getid3_riff = new getid3_riff($this->getid3);
+                                       $getid3_riff->ParseRIFFdata($RIFFdata);
+                                       unset($getid3_riff);
+                               }
+
+                               if (isset($thisfile_riff_raw['fmt ']['wFormatTag'])) {
+                                       switch ($thisfile_riff_raw['fmt ']['wFormatTag']) {
+                                               case 0x0001: // PCM
+                                                       if (!empty($info['ac3'])) {
+                                                               // Dolby Digital WAV files masquerade as PCM-WAV, but they're not
+                                                               $thisfile_audio['wformattag']  = 0x2000;
+                                                               $thisfile_audio['codec']       = self::wFormatTagLookup($thisfile_audio['wformattag']);
+                                                               $thisfile_audio['lossless']    = false;
+                                                               $thisfile_audio['bitrate']     = $info['ac3']['bitrate'];
+                                                               $thisfile_audio['sample_rate'] = $info['ac3']['sample_rate'];
+                                                       }
+                                                       if (!empty($info['dts'])) {
+                                                               // Dolby DTS files masquerade as PCM-WAV, but they're not
+                                                               $thisfile_audio['wformattag']  = 0x2001;
+                                                               $thisfile_audio['codec']       = self::wFormatTagLookup($thisfile_audio['wformattag']);
+                                                               $thisfile_audio['lossless']    = false;
+                                                               $thisfile_audio['bitrate']     = $info['dts']['bitrate'];
+                                                               $thisfile_audio['sample_rate'] = $info['dts']['sample_rate'];
+                                                       }
+                                                       break;
+                                               case 0x08AE: // ClearJump LiteWave
+                                                       $thisfile_audio['bitrate_mode'] = 'vbr';
+                                                       $thisfile_audio_dataformat   = 'litewave';
+
+                                                       //typedef struct tagSLwFormat {
+                                                       //  WORD    m_wCompFormat;     // low byte defines compression method, high byte is compression flags
+                                                       //  DWORD   m_dwScale;         // scale factor for lossy compression
+                                                       //  DWORD   m_dwBlockSize;     // number of samples in encoded blocks
+                                                       //  WORD    m_wQuality;        // alias for the scale factor
+                                                       //  WORD    m_wMarkDistance;   // distance between marks in bytes
+                                                       //  WORD    m_wReserved;
+                                                       //
+                                                       //  //following paramters are ignored if CF_FILESRC is not set
+                                                       //  DWORD   m_dwOrgSize;       // original file size in bytes
+                                                       //  WORD    m_bFactExists;     // indicates if 'fact' chunk exists in the original file
+                                                       //  DWORD   m_dwRiffChunkSize; // riff chunk size in the original file
+                                                       //
+                                                       //  PCMWAVEFORMAT m_OrgWf;     // original wave format
+                                                       // }SLwFormat, *PSLwFormat;
+
+                                                       // shortcut
+                                                       $thisfile_riff['litewave']['raw'] = array();
+                                                       $riff_litewave     = &$thisfile_riff['litewave'];
+                                                       $riff_litewave_raw = &$riff_litewave['raw'];
+
+                                                       $flags = array(
+                                                               'compression_method' => 1,
+                                                               'compression_flags'  => 1,
+                                                               'm_dwScale'          => 4,
+                                                               'm_dwBlockSize'      => 4,
+                                                               'm_wQuality'         => 2,
+                                                               'm_wMarkDistance'    => 2,
+                                                               'm_wReserved'        => 2,
+                                                               'm_dwOrgSize'        => 4,
+                                                               'm_bFactExists'      => 2,
+                                                               'm_dwRiffChunkSize'  => 4,
+                                                       );
+                                                       $litewave_offset = 18;
+                                                       foreach ($flags as $flag => $length) {
+                                                               $riff_litewave_raw[$flag] = getid3_lib::LittleEndian2Int(substr($thisfile_riff_WAVE['fmt '][0]['data'], $litewave_offset, $length));
+                                                               $litewave_offset += $length;
+                                                       }
+
+                                                       //$riff_litewave['quality_factor'] = intval(round((2000 - $riff_litewave_raw['m_dwScale']) / 20));
+                                                       $riff_litewave['quality_factor'] = $riff_litewave_raw['m_wQuality'];
+
+                                                       $riff_litewave['flags']['raw_source']    = ($riff_litewave_raw['compression_flags'] & 0x01) ? false : true;
+                                                       $riff_litewave['flags']['vbr_blocksize'] = ($riff_litewave_raw['compression_flags'] & 0x02) ? false : true;
+                                                       $riff_litewave['flags']['seekpoints']    =        (bool) ($riff_litewave_raw['compression_flags'] & 0x04);
+
+                                                       $thisfile_audio['lossless']        = (($riff_litewave_raw['m_wQuality'] == 100) ? true : false);
+                                                       $thisfile_audio['encoder_options'] = '-q'.$riff_litewave['quality_factor'];
+                                                       break;
+
+                                               default:
+                                                       break;
+                                       }
+                               }
+                               if ($info['avdataend'] > $info['filesize']) {
+                                       switch (!empty($thisfile_audio_dataformat) ? $thisfile_audio_dataformat : '') {
+                                               case 'wavpack': // WavPack
+                                               case 'lpac':    // LPAC
+                                               case 'ofr':     // OptimFROG
+                                               case 'ofs':     // OptimFROG DualStream
+                                                       // lossless compressed audio formats that keep original RIFF headers - skip warning
+                                                       break;
+
+                                               case 'litewave':
+                                                       if (($info['avdataend'] - $info['filesize']) == 1) {
+                                                               // LiteWave appears to incorrectly *not* pad actual output file
+                                                               // to nearest WORD boundary so may appear to be short by one
+                                                               // byte, in which case - skip warning
+                                                       } else {
+                                                               // Short by more than one byte, throw warning
+                                                               $info['warning'][] = 'Probably truncated file - expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)';
+                                                               $info['avdataend'] = $info['filesize'];
+                                                       }
+                                                       break;
+
+                                               default:
+                                                       if ((($info['avdataend'] - $info['filesize']) == 1) && (($thisfile_riff[$RIFFsubtype]['data'][0]['size'] % 2) == 0) && ((($info['filesize'] - $info['avdataoffset']) % 2) == 1)) {
+                                                               // output file appears to be incorrectly *not* padded to nearest WORD boundary
+                                                               // Output less severe warning
+                                                               $info['warning'][] = 'File should probably be padded to nearest WORD boundary, but it is not (expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' therefore short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)';
+                                                               $info['avdataend'] = $info['filesize'];
+                                                       } else {
+                                                               // Short by more than one byte, throw warning
+                                                               $info['warning'][] = 'Probably truncated file - expecting '.$thisfile_riff[$RIFFsubtype]['data'][0]['size'].' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($thisfile_riff[$RIFFsubtype]['data'][0]['size'] - ($info['filesize'] - $info['avdataoffset'])).' bytes)';
+                                                               $info['avdataend'] = $info['filesize'];
+                                                       }
+                                                       break;
+                                       }
+                               }
+                               if (!empty($info['mpeg']['audio']['LAME']['audio_bytes'])) {
+                                       if ((($info['avdataend'] - $info['avdataoffset']) - $info['mpeg']['audio']['LAME']['audio_bytes']) == 1) {
+                                               $info['avdataend']--;
+                                               $info['warning'][] = 'Extra null byte at end of MP3 data assumed to be RIFF padding and therefore ignored';
+                                       }
+                               }
+                               if (isset($thisfile_audio_dataformat) && ($thisfile_audio_dataformat == 'ac3')) {
+                                       unset($thisfile_audio['bits_per_sample']);
+                                       if (!empty($info['ac3']['bitrate']) && ($info['ac3']['bitrate'] != $thisfile_audio['bitrate'])) {
+                                               $thisfile_audio['bitrate'] = $info['ac3']['bitrate'];
+                                       }
+                               }
+                               break;
+
+                       case 'AVI ':
+                               $thisfile_video['bitrate_mode'] = 'vbr'; // maybe not, but probably
+                               $thisfile_video['dataformat']   = 'avi';
+                               $info['mime_type']      = 'video/avi';
+
+                               if (isset($thisfile_riff[$RIFFsubtype]['movi']['offset'])) {
+                                       $info['avdataoffset'] = $thisfile_riff[$RIFFsubtype]['movi']['offset'] + 8;
+                                       if (isset($thisfile_riff['AVIX'])) {
+                                               $info['avdataend'] = $thisfile_riff['AVIX'][(count($thisfile_riff['AVIX']) - 1)]['chunks']['movi']['offset'] + $thisfile_riff['AVIX'][(count($thisfile_riff['AVIX']) - 1)]['chunks']['movi']['size'];
+                                       } else {
+                                               $info['avdataend'] = $thisfile_riff['AVI ']['movi']['offset'] + $thisfile_riff['AVI ']['movi']['size'];
+                                       }
+                                       if ($info['avdataend'] > $info['filesize']) {
+                                               $info['warning'][] = 'Probably truncated file - expecting '.($info['avdataend'] - $info['avdataoffset']).' bytes of data, only found '.($info['filesize'] - $info['avdataoffset']).' (short by '.($info['avdataend'] - $info['filesize']).' bytes)';
+                                               $info['avdataend'] = $info['filesize'];
+                                       }
+                               }
+
+                               if (isset($thisfile_riff['AVI ']['hdrl']['strl']['indx'])) {
+                                       //$bIndexType = array(
+                                       //      0x00 => 'AVI_INDEX_OF_INDEXES',
+                                       //      0x01 => 'AVI_INDEX_OF_CHUNKS',
+                                       //      0x80 => 'AVI_INDEX_IS_DATA',
+                                       //);
+                                       //$bIndexSubtype = array(
+                                       //      0x01 => array(
+                                       //              0x01 => 'AVI_INDEX_2FIELD',
+                                       //      ),
+                                       //);
+                                       foreach ($thisfile_riff['AVI ']['hdrl']['strl']['indx'] as $streamnumber => $steamdataarray) {
+                                               $ahsisd = &$thisfile_riff['AVI ']['hdrl']['strl']['indx'][$streamnumber]['data'];
+
+                                               $thisfile_riff_raw['indx'][$streamnumber]['wLongsPerEntry'] = $this->EitherEndian2Int(substr($ahsisd,  0, 2));
+                                               $thisfile_riff_raw['indx'][$streamnumber]['bIndexSubType']  = $this->EitherEndian2Int(substr($ahsisd,  2, 1));
+                                               $thisfile_riff_raw['indx'][$streamnumber]['bIndexType']     = $this->EitherEndian2Int(substr($ahsisd,  3, 1));
+                                               $thisfile_riff_raw['indx'][$streamnumber]['nEntriesInUse']  = $this->EitherEndian2Int(substr($ahsisd,  4, 4));
+                                               $thisfile_riff_raw['indx'][$streamnumber]['dwChunkId']      =                         substr($ahsisd,  8, 4);
+                                               $thisfile_riff_raw['indx'][$streamnumber]['dwReserved']     = $this->EitherEndian2Int(substr($ahsisd, 12, 4));
+
+                                               //$thisfile_riff_raw['indx'][$streamnumber]['bIndexType_name']    =    $bIndexType[$thisfile_riff_raw['indx'][$streamnumber]['bIndexType']];
+                                               //$thisfile_riff_raw['indx'][$streamnumber]['bIndexSubType_name'] = $bIndexSubtype[$thisfile_riff_raw['indx'][$streamnumber]['bIndexType']][$thisfile_riff_raw['indx'][$streamnumber]['bIndexSubType']];
+
+                                               unset($ahsisd);
+                                       }
+                               }
+                               if (isset($thisfile_riff['AVI ']['hdrl']['avih'][$streamindex]['data'])) {
+                                       $avihData = $thisfile_riff['AVI ']['hdrl']['avih'][$streamindex]['data'];
+
+                                       // shortcut
+                                       $thisfile_riff_raw['avih'] = array();
+                                       $thisfile_riff_raw_avih = &$thisfile_riff_raw['avih'];
+
+                                       $thisfile_riff_raw_avih['dwMicroSecPerFrame']    = $this->EitherEndian2Int(substr($avihData,  0, 4)); // frame display rate (or 0L)
+                                       if ($thisfile_riff_raw_avih['dwMicroSecPerFrame'] == 0) {
+                                               $info['error'][] = 'Corrupt RIFF file: avih.dwMicroSecPerFrame == zero';
+                                               return false;
+                                       }
+
+                                       $flags = array(
+                                               'dwMaxBytesPerSec',       // max. transfer rate
+                                               'dwPaddingGranularity',   // pad to multiples of this size; normally 2K.
+                                               'dwFlags',                // the ever-present flags
+                                               'dwTotalFrames',          // # frames in file
+                                               'dwInitialFrames',        //
+                                               'dwStreams',              //
+                                               'dwSuggestedBufferSize',  //
+                                               'dwWidth',                //
+                                               'dwHeight',               //
+                                               'dwScale',                //
+                                               'dwRate',                 //
+                                               'dwStart',                //
+                                               'dwLength',               //
+                                       );
+                                       $avih_offset = 4;
+                                       foreach ($flags as $flag) {
+                                               $thisfile_riff_raw_avih[$flag] = $this->EitherEndian2Int(substr($avihData, $avih_offset, 4));
+                                               $avih_offset += 4;
+                                       }
+
+                                       $flags = array(
+                                               'hasindex'     => 0x00000010,
+                                               'mustuseindex' => 0x00000020,
+                                               'interleaved'  => 0x00000100,
+                                               'trustcktype'  => 0x00000800,
+                                               'capturedfile' => 0x00010000,
+                                               'copyrighted'  => 0x00020010,
+                                       );
+                    foreach ($flags as $flag => $value) {
+                                               $thisfile_riff_raw_avih['flags'][$flag] = (bool) ($thisfile_riff_raw_avih['dwFlags'] & $value);
+                                       }
+
+                                       // shortcut
+                                       $thisfile_riff_video[$streamindex] = array();
+                                       $thisfile_riff_video_current = &$thisfile_riff_video[$streamindex];
+
+                                       if ($thisfile_riff_raw_avih['dwWidth'] > 0) {
+                                               $thisfile_riff_video_current['frame_width'] = $thisfile_riff_raw_avih['dwWidth'];
+                                               $thisfile_video['resolution_x']             = $thisfile_riff_video_current['frame_width'];
+                                       }
+                                       if ($thisfile_riff_raw_avih['dwHeight'] > 0) {
+                                               $thisfile_riff_video_current['frame_height'] = $thisfile_riff_raw_avih['dwHeight'];
+                                               $thisfile_video['resolution_y']              = $thisfile_riff_video_current['frame_height'];
+                                       }
+                                       if ($thisfile_riff_raw_avih['dwTotalFrames'] > 0) {
+                                               $thisfile_riff_video_current['total_frames'] = $thisfile_riff_raw_avih['dwTotalFrames'];
+                                               $thisfile_video['total_frames']              = $thisfile_riff_video_current['total_frames'];
+                                       }
+
+                                       $thisfile_riff_video_current['frame_rate'] = round(1000000 / $thisfile_riff_raw_avih['dwMicroSecPerFrame'], 3);
+                                       $thisfile_video['frame_rate'] = $thisfile_riff_video_current['frame_rate'];
+                               }
+                               if (isset($thisfile_riff['AVI ']['hdrl']['strl']['strh'][0]['data'])) {
+                                       if (is_array($thisfile_riff['AVI ']['hdrl']['strl']['strh'])) {
+                                               for ($i = 0; $i < count($thisfile_riff['AVI ']['hdrl']['strl']['strh']); $i++) {
+                                                       if (isset($thisfile_riff['AVI ']['hdrl']['strl']['strh'][$i]['data'])) {
+                                                               $strhData = $thisfile_riff['AVI ']['hdrl']['strl']['strh'][$i]['data'];
+                                                               $strhfccType = substr($strhData,  0, 4);
+
+                                                               if (isset($thisfile_riff['AVI ']['hdrl']['strl']['strf'][$i]['data'])) {
+                                                                       $strfData = $thisfile_riff['AVI ']['hdrl']['strl']['strf'][$i]['data'];
+
+                                                                       // shortcut
+                                                                       $thisfile_riff_raw_strf_strhfccType_streamindex = &$thisfile_riff_raw['strf'][$strhfccType][$streamindex];
+
+                                                                       switch ($strhfccType) {
+                                                                               case 'auds':
+                                                                                       $thisfile_audio['bitrate_mode'] = 'cbr';
+                                                                                       $thisfile_audio_dataformat      = 'wav';
+                                                                                       if (isset($thisfile_riff_audio) && is_array($thisfile_riff_audio)) {
+                                                                                               $streamindex = count($thisfile_riff_audio);
+                                                                                       }
+
+                                                                                       $thisfile_riff_audio[$streamindex] = self::parseWAVEFORMATex($strfData);
+                                                                                       $thisfile_audio['wformattag'] = $thisfile_riff_audio[$streamindex]['raw']['wFormatTag'];
+
+                                                                                       // shortcut
+                                                                                       $thisfile_audio['streams'][$streamindex] = $thisfile_riff_audio[$streamindex];
+                                                                                       $thisfile_audio_streams_currentstream = &$thisfile_audio['streams'][$streamindex];
+
+                                                                                       if ($thisfile_audio_streams_currentstream['bits_per_sample'] == 0) {
+                                                                                               unset($thisfile_audio_streams_currentstream['bits_per_sample']);
+                                                                                       }
+                                                                                       $thisfile_audio_streams_currentstream['wformattag'] = $thisfile_audio_streams_currentstream['raw']['wFormatTag'];
+                                                                                       unset($thisfile_audio_streams_currentstream['raw']);
+
+                                                                                       // shortcut
+                                                                                       $thisfile_riff_raw['strf'][$strhfccType][$streamindex] = $thisfile_riff_audio[$streamindex]['raw'];
+
+                                                                                       unset($thisfile_riff_audio[$streamindex]['raw']);
+                                                                                       $thisfile_audio = getid3_lib::array_merge_noclobber($thisfile_audio, $thisfile_riff_audio[$streamindex]);
+
+                                                                                       $thisfile_audio['lossless'] = false;
+                                                                                       switch ($thisfile_riff_raw_strf_strhfccType_streamindex['wFormatTag']) {
+                                                                                               case 0x0001:  // PCM
+                                                                                                       $thisfile_audio_dataformat  = 'wav';
+                                                                                                       $thisfile_audio['lossless'] = true;
+                                                                                                       break;
+
+                                                                                               case 0x0050: // MPEG Layer 2 or Layer 1
+                                                                                                       $thisfile_audio_dataformat = 'mp2'; // Assume Layer-2
+                                                                                                       break;
+
+                                                                                               case 0x0055: // MPEG Layer 3
+                                                                                                       $thisfile_audio_dataformat = 'mp3';
+                                                                                                       break;
+
+                                                                                               case 0x00FF: // AAC
+                                                                                                       $thisfile_audio_dataformat = 'aac';
+                                                                                                       break;
+
+                                                                                               case 0x0161: // Windows Media v7 / v8 / v9
+                                                                                               case 0x0162: // Windows Media Professional v9
+                                                                                               case 0x0163: // Windows Media Lossess v9
+                                                                                                       $thisfile_audio_dataformat = 'wma';
+                                                                                                       break;
+
+                                                                                               case 0x2000: // AC-3
+                                                                                                       $thisfile_audio_dataformat = 'ac3';
+                                                                                                       break;
+
+                                                                                               case 0x2001: // DTS
+                                                                                                       $thisfile_audio_dataformat = 'dts';
+                                                                                                       break;
+
+                                                                                               default:
+                                                                                                       $thisfile_audio_dataformat = 'wav';
+                                                                                                       break;
+                                                                                       }
+                                                                                       $thisfile_audio_streams_currentstream['dataformat']   = $thisfile_audio_dataformat;
+                                                                                       $thisfile_audio_streams_currentstream['lossless']     = $thisfile_audio['lossless'];
+                                                                                       $thisfile_audio_streams_currentstream['bitrate_mode'] = $thisfile_audio['bitrate_mode'];
+                                                                                       break;
+
+
+                                                                               case 'iavs':
+                                                                               case 'vids':
+                                                                                       // shortcut
+                                                                                       $thisfile_riff_raw['strh'][$i]                  = array();
+                                                                                       $thisfile_riff_raw_strh_current                 = &$thisfile_riff_raw['strh'][$i];
+
+                                                                                       $thisfile_riff_raw_strh_current['fccType']               =                         substr($strhData,  0, 4);  // same as $strhfccType;
+                                                                                       $thisfile_riff_raw_strh_current['fccHandler']            =                         substr($strhData,  4, 4);
+                                                                                       $thisfile_riff_raw_strh_current['dwFlags']               = $this->EitherEndian2Int(substr($strhData,  8, 4)); // Contains AVITF_* flags
+                                                                                       $thisfile_riff_raw_strh_current['wPriority']             = $this->EitherEndian2Int(substr($strhData, 12, 2));
+                                                                                       $thisfile_riff_raw_strh_current['wLanguage']             = $this->EitherEndian2Int(substr($strhData, 14, 2));
+                                                                                       $thisfile_riff_raw_strh_current['dwInitialFrames']       = $this->EitherEndian2Int(substr($strhData, 16, 4));
+                                                                                       $thisfile_riff_raw_strh_current['dwScale']               = $this->EitherEndian2Int(substr($strhData, 20, 4));
+                                                                                       $thisfile_riff_raw_strh_current['dwRate']                = $this->EitherEndian2Int(substr($strhData, 24, 4));
+                                                                                       $thisfile_riff_raw_strh_current['dwStart']               = $this->EitherEndian2Int(substr($strhData, 28, 4));
+                                                                                       $thisfile_riff_raw_strh_current['dwLength']              = $this->EitherEndian2Int(substr($strhData, 32, 4));
+                                                                                       $thisfile_riff_raw_strh_current['dwSuggestedBufferSize'] = $this->EitherEndian2Int(substr($strhData, 36, 4));
+                                                                                       $thisfile_riff_raw_strh_current['dwQuality']             = $this->EitherEndian2Int(substr($strhData, 40, 4));
+                                                                                       $thisfile_riff_raw_strh_current['dwSampleSize']          = $this->EitherEndian2Int(substr($strhData, 44, 4));
+                                                                                       $thisfile_riff_raw_strh_current['rcFrame']               = $this->EitherEndian2Int(substr($strhData, 48, 4));
+
+                                                                                       $thisfile_riff_video_current['codec'] = self::fourccLookup($thisfile_riff_raw_strh_current['fccHandler']);
+                                                                                       $thisfile_video['fourcc']             = $thisfile_riff_raw_strh_current['fccHandler'];
+                                                                                       if (!$thisfile_riff_video_current['codec'] && isset($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc']) && self::fourccLookup($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc'])) {
+                                                                                               $thisfile_riff_video_current['codec'] = self::fourccLookup($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc']);
+                                                                                               $thisfile_video['fourcc']             = $thisfile_riff_raw_strf_strhfccType_streamindex['fourcc'];
+                                                                                       }
+                                                                                       $thisfile_video['codec']              = $thisfile_riff_video_current['codec'];
+                                                                                       $thisfile_video['pixel_aspect_ratio'] = (float) 1;
+                                                                                       switch ($thisfile_riff_raw_strh_current['fccHandler']) {
+                                                                                               case 'HFYU': // Huffman Lossless Codec
+                                                                                               case 'IRAW': // Intel YUV Uncompressed
+                                                                                               case 'YUY2': // Uncompressed YUV 4:2:2
+                                                                                                       $thisfile_video['lossless'] = true;
+                                                                                                       break;
+
+                                                                                               default:
+                                                                                                       $thisfile_video['lossless'] = false;
+                                                                                                       break;
+                                                                                       }
+
+                                                                                       switch ($strhfccType) {
+                                                                                               case 'vids':
+                                                                                                       $thisfile_riff_raw_strf_strhfccType_streamindex = self::ParseBITMAPINFOHEADER(substr($strfData, 0, 40), ($info['fileformat'] == 'riff'));
+                                                                                                       $thisfile_video['bits_per_sample'] = $thisfile_riff_raw_strf_strhfccType_streamindex['biBitCount'];
+
+                                                                                                       if ($thisfile_riff_video_current['codec'] == 'DV') {
+                                                                                                               $thisfile_riff_video_current['dv_type'] = 2;
+                                                                                                       }
+                                                                                                       break;
+
+                                                                                               case 'iavs':
+                                                                                                       $thisfile_riff_video_current['dv_type'] = 1;
+                                                                                                       break;
+                                                                                       }
+                                                                                       break;
+
+                                                                               default:
+                                                                                       $info['warning'][] = 'Unhandled fccType for stream ('.$i.'): "'.$strhfccType.'"';
+                                                                                       break;
+
+                                                                       }
+                                                               }
+                                                       }
+
+                                                       if (isset($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc'])) {
+
+                                                               $thisfile_video['fourcc'] = $thisfile_riff_raw_strf_strhfccType_streamindex['fourcc'];
+                                                               if (self::fourccLookup($thisfile_video['fourcc'])) {
+                                                                       $thisfile_riff_video_current['codec'] = self::fourccLookup($thisfile_video['fourcc']);
+                                                                       $thisfile_video['codec']              = $thisfile_riff_video_current['codec'];
+                                                               }
+
+                                                               switch ($thisfile_riff_raw_strf_strhfccType_streamindex['fourcc']) {
+                                                                       case 'HFYU': // Huffman Lossless Codec
+                                                                       case 'IRAW': // Intel YUV Uncompressed
+                                                                       case 'YUY2': // Uncompressed YUV 4:2:2
+                                                                               $thisfile_video['lossless']        = true;
+                                                                               //$thisfile_video['bits_per_sample'] = 24;
+                                                                               break;
+
+                                                                       default:
+                                                                               $thisfile_video['lossless']        = false;
+                                                                               //$thisfile_video['bits_per_sample'] = 24;
+                                                                               break;
+                                                               }
+
+                                                       }
+                                               }
+                                       }
+                               }
+                               break;
+
+                       case 'CDDA':
+                               $thisfile_audio['bitrate_mode'] = 'cbr';
+                               $thisfile_audio_dataformat      = 'cda';
+                               $thisfile_audio['lossless']     = true;
+                               unset($info['mime_type']);
+
+                               $info['avdataoffset'] = 44;
+
+                               if (isset($thisfile_riff['CDDA']['fmt '][0]['data'])) {
+                                       // shortcut
+                                       $thisfile_riff_CDDA_fmt_0 = &$thisfile_riff['CDDA']['fmt '][0];
+
+                                       $thisfile_riff_CDDA_fmt_0['unknown1']           = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'],  0, 2));
+                                       $thisfile_riff_CDDA_fmt_0['track_num']          = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'],  2, 2));
+                                       $thisfile_riff_CDDA_fmt_0['disc_id']            = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'],  4, 4));
+                                       $thisfile_riff_CDDA_fmt_0['start_offset_frame'] = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'],  8, 4));
+                                       $thisfile_riff_CDDA_fmt_0['playtime_frames']    = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'], 12, 4));
+                                       $thisfile_riff_CDDA_fmt_0['unknown6']           = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'], 16, 4));
+                                       $thisfile_riff_CDDA_fmt_0['unknown7']           = $this->EitherEndian2Int(substr($thisfile_riff_CDDA_fmt_0['data'], 20, 4));
+
+                                       $thisfile_riff_CDDA_fmt_0['start_offset_seconds'] = (float) $thisfile_riff_CDDA_fmt_0['start_offset_frame'] / 75;
+                                       $thisfile_riff_CDDA_fmt_0['playtime_seconds']     = (float) $thisfile_riff_CDDA_fmt_0['playtime_frames'] / 75;
+                                       $info['comments']['track']                = $thisfile_riff_CDDA_fmt_0['track_num'];
+                                       $info['playtime_seconds']                 = $thisfile_riff_CDDA_fmt_0['playtime_seconds'];
+
+                                       // hardcoded data for CD-audio
+                                       $thisfile_audio['sample_rate']     = 44100;
+                                       $thisfile_audio['channels']        = 2;
+                                       $thisfile_audio['bits_per_sample'] = 16;
+                                       $thisfile_audio['bitrate']         = $thisfile_audio['sample_rate'] * $thisfile_audio['channels'] * $thisfile_audio['bits_per_sample'];
+                                       $thisfile_audio['bitrate_mode']    = 'cbr';
+                               }
+                               break;
+
+
+                       case 'AIFF':
+                       case 'AIFC':
+                               $thisfile_audio['bitrate_mode'] = 'cbr';
+                               $thisfile_audio_dataformat      = 'aiff';
+                               $thisfile_audio['lossless']     = true;
+                               $info['mime_type']      = 'audio/x-aiff';
+
+                               if (isset($thisfile_riff[$RIFFsubtype]['SSND'][0]['offset'])) {
+                                       $info['avdataoffset'] = $thisfile_riff[$RIFFsubtype]['SSND'][0]['offset'] + 8;
+                                       $info['avdataend']    = $info['avdataoffset'] + $thisfile_riff[$RIFFsubtype]['SSND'][0]['size'];
+                                       if ($info['avdataend'] > $info['filesize']) {
+                                               if (($info['avdataend'] == ($info['filesize'] + 1)) && (($info['filesize'] % 2) == 1)) {
+                                                       // structures rounded to 2-byte boundary, but dumb encoders
+                                                       // forget to pad end of file to make this actually work
+                                               } else {
+                                                       $info['warning'][] = 'Probable truncated AIFF file: expecting '.$thisfile_riff[$RIFFsubtype]['SSND'][0]['size'].' bytes of audio data, only '.($info['filesize'] - $info['avdataoffset']).' bytes found';
+                                               }
+                                               $info['avdataend'] = $info['filesize'];
+                                       }
+                               }
+
+                               if (isset($thisfile_riff[$RIFFsubtype]['COMM'][0]['data'])) {
+
+                                       // shortcut
+                                       $thisfile_riff_RIFFsubtype_COMM_0_data = &$thisfile_riff[$RIFFsubtype]['COMM'][0]['data'];
+
+                                       $thisfile_riff_audio['channels']         =         getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_COMM_0_data,  0,  2), true);
+                                       $thisfile_riff_audio['total_samples']    =         getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_COMM_0_data,  2,  4), false);
+                                       $thisfile_riff_audio['bits_per_sample']  =         getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_COMM_0_data,  6,  2), true);
+                                       $thisfile_riff_audio['sample_rate']      = (int) getid3_lib::BigEndian2Float(substr($thisfile_riff_RIFFsubtype_COMM_0_data,  8, 10));
+
+                                       if ($thisfile_riff[$RIFFsubtype]['COMM'][0]['size'] > 18) {
+                                               $thisfile_riff_audio['codec_fourcc'] =                                   substr($thisfile_riff_RIFFsubtype_COMM_0_data, 18,  4);
+                                               $CodecNameSize                       =         getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_COMM_0_data, 22,  1), false);
+                                               $thisfile_riff_audio['codec_name']   =                                   substr($thisfile_riff_RIFFsubtype_COMM_0_data, 23,  $CodecNameSize);
+                                               switch ($thisfile_riff_audio['codec_name']) {
+                                                       case 'NONE':
+                                                               $thisfile_audio['codec']    = 'Pulse Code Modulation (PCM)';
+                                                               $thisfile_audio['lossless'] = true;
+                                                               break;
+
+                                                       case '':
+                                                               switch ($thisfile_riff_audio['codec_fourcc']) {
+                                                                       // http://developer.apple.com/qa/snd/snd07.html
+                                                                       case 'sowt':
+                                                                               $thisfile_riff_audio['codec_name'] = 'Two\'s Compliment Little-Endian PCM';
+                                                                               $thisfile_audio['lossless'] = true;
+                                                                               break;
+
+                                                                       case 'twos':
+                                                                               $thisfile_riff_audio['codec_name'] = 'Two\'s Compliment Big-Endian PCM';
+                                                                               $thisfile_audio['lossless'] = true;
+                                                                               break;
+
+                                                                       default:
+                                                                               break;
+                                                               }
+                                                               break;
+
+                                                       default:
+                                                               $thisfile_audio['codec']    = $thisfile_riff_audio['codec_name'];
+                                                               $thisfile_audio['lossless'] = false;
+                                                               break;
+                                               }
+                                       }
+
+                                       $thisfile_audio['channels']        = $thisfile_riff_audio['channels'];
+                                       if ($thisfile_riff_audio['bits_per_sample'] > 0) {
+                                               $thisfile_audio['bits_per_sample'] = $thisfile_riff_audio['bits_per_sample'];
+                                       }
+                                       $thisfile_audio['sample_rate']     = $thisfile_riff_audio['sample_rate'];
+                                       if ($thisfile_audio['sample_rate'] == 0) {
+                                               $info['error'][] = 'Corrupted AIFF file: sample_rate == zero';
+                                               return false;
+                                       }
+                                       $info['playtime_seconds'] = $thisfile_riff_audio['total_samples'] / $thisfile_audio['sample_rate'];
+                               }
+
+                               if (isset($thisfile_riff[$RIFFsubtype]['COMT'])) {
+                                       $offset = 0;
+                                       $CommentCount                                   = getid3_lib::BigEndian2Int(substr($thisfile_riff[$RIFFsubtype]['COMT'][0]['data'], $offset, 2), false);
+                                       $offset += 2;
+                                       for ($i = 0; $i < $CommentCount; $i++) {
+                                               $info['comments_raw'][$i]['timestamp']      = getid3_lib::BigEndian2Int(substr($thisfile_riff[$RIFFsubtype]['COMT'][0]['data'], $offset, 4), false);
+                                               $offset += 4;
+                                               $info['comments_raw'][$i]['marker_id']      = getid3_lib::BigEndian2Int(substr($thisfile_riff[$RIFFsubtype]['COMT'][0]['data'], $offset, 2), true);
+                                               $offset += 2;
+                                               $CommentLength                              = getid3_lib::BigEndian2Int(substr($thisfile_riff[$RIFFsubtype]['COMT'][0]['data'], $offset, 2), false);
+                                               $offset += 2;
+                                               $info['comments_raw'][$i]['comment']        =                           substr($thisfile_riff[$RIFFsubtype]['COMT'][0]['data'], $offset, $CommentLength);
+                                               $offset += $CommentLength;
+
+                                               $info['comments_raw'][$i]['timestamp_unix'] = getid3_lib::DateMac2Unix($info['comments_raw'][$i]['timestamp']);
+                                               $thisfile_riff['comments']['comment'][] = $info['comments_raw'][$i]['comment'];
+                                       }
+                               }
+
+                               $CommentsChunkNames = array('NAME'=>'title', 'author'=>'artist', '(c) '=>'copyright', 'ANNO'=>'comment');
+                               foreach ($CommentsChunkNames as $key => $value) {
+                                       if (isset($thisfile_riff[$RIFFsubtype][$key][0]['data'])) {
+                                               $thisfile_riff['comments'][$value][] = $thisfile_riff[$RIFFsubtype][$key][0]['data'];
+                                       }
+                               }
+/*
+                               if (isset($thisfile_riff[$RIFFsubtype]['ID3 '])) {
+                                       getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE__, true);
+                                       $getid3_temp = new getID3();
+                                       $getid3_temp->openfile($this->getid3->filename);
+                                       $getid3_id3v2 = new getid3_id3v2($getid3_temp);
+                                       $getid3_id3v2->StartingOffset = $thisfile_riff[$RIFFsubtype]['ID3 '][0]['offset'] + 8;
+                                       if ($thisfile_riff[$RIFFsubtype]['ID3 '][0]['valid'] = $getid3_id3v2->Analyze()) {
+                                               $info['id3v2'] = $getid3_temp->info['id3v2'];
+                                       }
+                                       unset($getid3_temp, $getid3_id3v2);
+                               }
+*/
+                               break;
+
+                       case '8SVX':
+                               $thisfile_audio['bitrate_mode']    = 'cbr';
+                               $thisfile_audio_dataformat         = '8svx';
+                               $thisfile_audio['bits_per_sample'] = 8;
+                               $thisfile_audio['channels']        = 1; // overridden below, if need be
+                               $info['mime_type']                = 'audio/x-aiff';
+
+                               if (isset($thisfile_riff[$RIFFsubtype]['BODY'][0]['offset'])) {
+                                       $info['avdataoffset'] = $thisfile_riff[$RIFFsubtype]['BODY'][0]['offset'] + 8;
+                                       $info['avdataend']    = $info['avdataoffset'] + $thisfile_riff[$RIFFsubtype]['BODY'][0]['size'];
+                                       if ($info['avdataend'] > $info['filesize']) {
+                                               $info['warning'][] = 'Probable truncated AIFF file: expecting '.$thisfile_riff[$RIFFsubtype]['BODY'][0]['size'].' bytes of audio data, only '.($info['filesize'] - $info['avdataoffset']).' bytes found';
+                                       }
+                               }
+
+                               if (isset($thisfile_riff[$RIFFsubtype]['VHDR'][0]['offset'])) {
+                                       // shortcut
+                                       $thisfile_riff_RIFFsubtype_VHDR_0 = &$thisfile_riff[$RIFFsubtype]['VHDR'][0];
+
+                                       $thisfile_riff_RIFFsubtype_VHDR_0['oneShotHiSamples']  =   getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'],  0, 4));
+                                       $thisfile_riff_RIFFsubtype_VHDR_0['repeatHiSamples']   =   getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'],  4, 4));
+                                       $thisfile_riff_RIFFsubtype_VHDR_0['samplesPerHiCycle'] =   getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'],  8, 4));
+                                       $thisfile_riff_RIFFsubtype_VHDR_0['samplesPerSec']     =   getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 12, 2));
+                                       $thisfile_riff_RIFFsubtype_VHDR_0['ctOctave']          =   getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 14, 1));
+                                       $thisfile_riff_RIFFsubtype_VHDR_0['sCompression']      =   getid3_lib::BigEndian2Int(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 15, 1));
+                                       $thisfile_riff_RIFFsubtype_VHDR_0['Volume']            = getid3_lib::FixedPoint16_16(substr($thisfile_riff_RIFFsubtype_VHDR_0['data'], 16, 4));
+
+                                       $thisfile_audio['sample_rate'] = $thisfile_riff_RIFFsubtype_VHDR_0['samplesPerSec'];
+
+                                       switch ($thisfile_riff_RIFFsubtype_VHDR_0['sCompression']) {
+                                               case 0:
+                                                       $thisfile_audio['codec']    = 'Pulse Code Modulation (PCM)';
+                                                       $thisfile_audio['lossless'] = true;
+                                                       $ActualBitsPerSample        = 8;
+                                                       break;
+
+                                               case 1:
+                                                       $thisfile_audio['codec']    = 'Fibonacci-delta encoding';
+                                                       $thisfile_audio['lossless'] = false;
+                                                       $ActualBitsPerSample        = 4;
+                                                       break;
+
+                                               default:
+                                                       $info['warning'][] = 'Unexpected sCompression value in 8SVX.VHDR chunk - expecting 0 or 1, found "'.sCompression.'"';
+                                                       break;
+                                       }
+                               }
+
+                               if (isset($thisfile_riff[$RIFFsubtype]['CHAN'][0]['data'])) {
+                                       $ChannelsIndex = getid3_lib::BigEndian2Int(substr($thisfile_riff[$RIFFsubtype]['CHAN'][0]['data'], 0, 4));
+                                       switch ($ChannelsIndex) {
+                                               case 6: // Stereo
+                                                       $thisfile_audio['channels'] = 2;
+                                                       break;
+
+                                               case 2: // Left channel only
+                                               case 4: // Right channel only
+                                                       $thisfile_audio['channels'] = 1;
+                                                       break;
+
+                                               default:
+                                                       $info['warning'][] = 'Unexpected value in 8SVX.CHAN chunk - expecting 2 or 4 or 6, found "'.$ChannelsIndex.'"';
+                                                       break;
+                                       }
+
+                               }
+
+                               $CommentsChunkNames = array('NAME'=>'title', 'author'=>'artist', '(c) '=>'copyright', 'ANNO'=>'comment');
+                               foreach ($CommentsChunkNames as $key => $value) {
+                                       if (isset($thisfile_riff[$RIFFsubtype][$key][0]['data'])) {
+                                               $thisfile_riff['comments'][$value][] = $thisfile_riff[$RIFFsubtype][$key][0]['data'];
+                                       }
+                               }
+
+                               $thisfile_audio['bitrate'] = $thisfile_audio['sample_rate'] * $ActualBitsPerSample * $thisfile_audio['channels'];
+                               if (!empty($thisfile_audio['bitrate'])) {
+                                       $info['playtime_seconds'] = ($info['avdataend'] - $info['avdataoffset']) / ($thisfile_audio['bitrate'] / 8);
+                               }
+                               break;
+
+
+                       case 'CDXA':
+                               $info['mime_type'] = 'video/mpeg';
+                               if (!empty($thisfile_riff['CDXA']['data'][0]['size'])) {
+                                       if (getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.mpeg.php', __FILE__, false)) {
+                                               $getid3_temp = new getID3();
+                                               $getid3_temp->openfile($this->getid3->filename);
+                                               $getid3_mpeg = new getid3_mpeg($getid3_temp);
+                                               $getid3_mpeg->Analyze();
+                                               if (empty($getid3_temp->info['error'])) {
+                                                       $info['audio']   = $getid3_temp->info['audio'];
+                                                       $info['video']   = $getid3_temp->info['video'];
+                                                       $info['mpeg']    = $getid3_temp->info['mpeg'];
+                                                       $info['warning'] = $getid3_temp->info['warning'];
+                                               }
+                                               unset($getid3_temp, $getid3_mpeg);
+                                       }
+                               }
+                               break;
+
+
+                       default:
+                               $info['error'][] = 'Unknown RIFF type: expecting one of (WAVE|RMP3|AVI |CDDA|AIFF|AIFC|8SVX|CDXA), found "'.$RIFFsubtype.'" instead';
+                               unset($info['fileformat']);
+                               break;
+               }
+
+               switch ($RIFFsubtype) {
+                       case 'WAVE':
+                       case 'AIFF':
+                       case 'AIFC':
+                               $ID3v2_key_good = 'id3 ';
+                               $ID3v2_keys_bad = array('ID3 ', 'tag ');
+                               foreach ($ID3v2_keys_bad as $ID3v2_key_bad) {
+                                       if (isset($thisfile_riff[$RIFFsubtype][$ID3v2_key_bad]) && !array_key_exists($ID3v2_key_good, $thisfile_riff[$RIFFsubtype])) {
+                                               $thisfile_riff[$RIFFsubtype][$ID3v2_key_good] = $thisfile_riff[$RIFFsubtype][$ID3v2_key_bad];
+                                               $info['warning'][] = 'mapping "'.$ID3v2_key_bad.'" chunk to "'.$ID3v2_key_good.'"';
+                                       }
+                               }
+
+                               if (isset($thisfile_riff[$RIFFsubtype]['id3 '])) {
+                                       getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v2.php', __FILE__, true);
+                                       $getid3_temp = new getID3();
+                                       $getid3_temp->openfile($this->getid3->filename);
+                                       $getid3_id3v2 = new getid3_id3v2($getid3_temp);
+                                       $getid3_id3v2->StartingOffset = $thisfile_riff[$RIFFsubtype]['id3 '][0]['offset'] + 8;
+                                       if ($thisfile_riff[$RIFFsubtype]['id3 '][0]['valid'] = $getid3_id3v2->Analyze()) {
+                                               $info['id3v2'] = $getid3_temp->info['id3v2'];
+                                       }
+                                       unset($getid3_temp, $getid3_id3v2);
+                               }
+                               break;
+               }
+
+               if (isset($thisfile_riff_WAVE['DISP']) && is_array($thisfile_riff_WAVE['DISP'])) {
+                       $thisfile_riff['comments']['title'][] = trim(substr($thisfile_riff_WAVE['DISP'][count($thisfile_riff_WAVE['DISP']) - 1]['data'], 4));
+               }
+               if (isset($thisfile_riff_WAVE['INFO']) && is_array($thisfile_riff_WAVE['INFO'])) {
+                       self::parseComments($thisfile_riff_WAVE['INFO'], $thisfile_riff['comments']);
+               }
+               if (isset($thisfile_riff['AVI ']['INFO']) && is_array($thisfile_riff['AVI ']['INFO'])) {
+                       self::parseComments($thisfile_riff['AVI ']['INFO'], $thisfile_riff['comments']);
+               }
+
+               if (empty($thisfile_audio['encoder']) && !empty($info['mpeg']['audio']['LAME']['short_version'])) {
+                       $thisfile_audio['encoder'] = $info['mpeg']['audio']['LAME']['short_version'];
+               }
+
+               if (!isset($info['playtime_seconds'])) {
+                       $info['playtime_seconds'] = 0;
+               }
+               if (isset($thisfile_riff_raw['strh'][0]['dwLength']) && isset($thisfile_riff_raw['avih']['dwMicroSecPerFrame'])) {
+                       // needed for >2GB AVIs where 'avih' chunk only lists number of frames in that chunk, not entire movie
+                       $info['playtime_seconds'] = $thisfile_riff_raw['strh'][0]['dwLength'] * ($thisfile_riff_raw['avih']['dwMicroSecPerFrame'] / 1000000);
+               } elseif (isset($thisfile_riff_raw['avih']['dwTotalFrames']) && isset($thisfile_riff_raw['avih']['dwMicroSecPerFrame'])) {
+                       $info['playtime_seconds'] = $thisfile_riff_raw['avih']['dwTotalFrames'] * ($thisfile_riff_raw['avih']['dwMicroSecPerFrame'] / 1000000);
+               }
+
+               if ($info['playtime_seconds'] > 0) {
+                       if (isset($thisfile_riff_audio) && isset($thisfile_riff_video)) {
+
+                               if (!isset($info['bitrate'])) {
+                                       $info['bitrate'] = ((($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds']) * 8);
+                               }
+
+                       } elseif (isset($thisfile_riff_audio) && !isset($thisfile_riff_video)) {
+
+                               if (!isset($thisfile_audio['bitrate'])) {
+                                       $thisfile_audio['bitrate'] = ((($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds']) * 8);
+                               }
+
+                       } elseif (!isset($thisfile_riff_audio) && isset($thisfile_riff_video)) {
+
+                               if (!isset($thisfile_video['bitrate'])) {
+                                       $thisfile_video['bitrate'] = ((($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds']) * 8);
+                               }
+
+                       }
+               }
+
+
+               if (isset($thisfile_riff_video) && isset($thisfile_audio['bitrate']) && ($thisfile_audio['bitrate'] > 0) && ($info['playtime_seconds'] > 0)) {
+
+                       $info['bitrate'] = ((($info['avdataend'] - $info['avdataoffset']) / $info['playtime_seconds']) * 8);
+                       $thisfile_audio['bitrate'] = 0;
+                       $thisfile_video['bitrate'] = $info['bitrate'];
+                       foreach ($thisfile_riff_audio as $channelnumber => $audioinfoarray) {
+                               $thisfile_video['bitrate'] -= $audioinfoarray['bitrate'];
+                               $thisfile_audio['bitrate'] += $audioinfoarray['bitrate'];
+                       }
+                       if ($thisfile_video['bitrate'] <= 0) {
+                               unset($thisfile_video['bitrate']);
+                       }
+                       if ($thisfile_audio['bitrate'] <= 0) {
+                               unset($thisfile_audio['bitrate']);
+                       }
+               }
+
+               if (isset($info['mpeg']['audio'])) {
+                       $thisfile_audio_dataformat      = 'mp'.$info['mpeg']['audio']['layer'];
+                       $thisfile_audio['sample_rate']  = $info['mpeg']['audio']['sample_rate'];
+                       $thisfile_audio['channels']     = $info['mpeg']['audio']['channels'];
+                       $thisfile_audio['bitrate']      = $info['mpeg']['audio']['bitrate'];
+                       $thisfile_audio['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']);
+                       if (!empty($info['mpeg']['audio']['codec'])) {
+                               $thisfile_audio['codec'] = $info['mpeg']['audio']['codec'].' '.$thisfile_audio['codec'];
+                       }
+                       if (!empty($thisfile_audio['streams'])) {
+                               foreach ($thisfile_audio['streams'] as $streamnumber => $streamdata) {
+                                       if ($streamdata['dataformat'] == $thisfile_audio_dataformat) {
+                                               $thisfile_audio['streams'][$streamnumber]['sample_rate']  = $thisfile_audio['sample_rate'];
+                                               $thisfile_audio['streams'][$streamnumber]['channels']     = $thisfile_audio['channels'];
+                                               $thisfile_audio['streams'][$streamnumber]['bitrate']      = $thisfile_audio['bitrate'];
+                                               $thisfile_audio['streams'][$streamnumber]['bitrate_mode'] = $thisfile_audio['bitrate_mode'];
+                                               $thisfile_audio['streams'][$streamnumber]['codec']        = $thisfile_audio['codec'];
+                                       }
+                               }
+                       }
+                       $getid3_mp3 = new getid3_mp3($this->getid3);
+                       $thisfile_audio['encoder_options'] = $getid3_mp3->GuessEncoderOptions();
+                       unset($getid3_mp3);
+               }
+
+
+               if (!empty($thisfile_riff_raw['fmt ']['wBitsPerSample']) && ($thisfile_riff_raw['fmt ']['wBitsPerSample'] > 0)) {
+                       switch ($thisfile_audio_dataformat) {
+                               case 'ac3':
+                                       // ignore bits_per_sample
+                                       break;
+
+                               default:
+                                       $thisfile_audio['bits_per_sample'] = $thisfile_riff_raw['fmt ']['wBitsPerSample'];
+                                       break;
+                       }
+               }
+
+
+               if (empty($thisfile_riff_raw)) {
+                       unset($thisfile_riff['raw']);
+               }
+               if (empty($thisfile_riff_audio)) {
+                       unset($thisfile_riff['audio']);
+               }
+               if (empty($thisfile_riff_video)) {
+                       unset($thisfile_riff['video']);
+               }
+
+               return true;
+       }
+
+       public function ParseRIFF($startoffset, $maxoffset) {
+               $info = &$this->getid3->info;
+
+               $RIFFchunk = false;
+               $FoundAllChunksWeNeed = false;
+
+               try {
+                       $this->fseek($startoffset);
+                       $maxoffset = min($maxoffset, $info['avdataend']);
+                       while ($this->ftell() < $maxoffset) {
+                               $chunknamesize = $this->fread(8);
+                               //$chunkname =                          substr($chunknamesize, 0, 4);
+                               $chunkname = str_replace("\x00", '_', substr($chunknamesize, 0, 4));  // note: chunk names of 4 null bytes do appear to be legal (has been observed inside INFO and PRMI chunks, for example), but makes traversing array keys more difficult
+                               $chunksize =  $this->EitherEndian2Int(substr($chunknamesize, 4, 4));
+                               //if (strlen(trim($chunkname, "\x00")) < 4) {
+                               if (strlen($chunkname) < 4) {
+                                       $this->error('Expecting chunk name at offset '.($this->ftell() - 8).' but found nothing. Aborting RIFF parsing.');
+                                       break;
+                               }
+                               if (($chunksize == 0) && ($chunkname != 'JUNK')) {
+                                       $this->warning('Chunk ('.$chunkname.') size at offset '.($this->ftell() - 4).' is zero. Aborting RIFF parsing.');
+                                       break;
+                               }
+                               if (($chunksize % 2) != 0) {
+                                       // all structures are packed on word boundaries
+                                       $chunksize++;
+                               }
+
+                               switch ($chunkname) {
+                                       case 'LIST':
+                                               $listname = $this->fread(4);
+                                               if (preg_match('#^(movi|rec )$#i', $listname)) {
+                                                       $RIFFchunk[$listname]['offset'] = $this->ftell() - 4;
+                                                       $RIFFchunk[$listname]['size']   = $chunksize;
+
+                                                       if (!$FoundAllChunksWeNeed) {
+                                                               $WhereWeWere      = $this->ftell();
+                                                               $AudioChunkHeader = $this->fread(12);
+                                                               $AudioChunkStreamNum  =                              substr($AudioChunkHeader, 0, 2);
+                                                               $AudioChunkStreamType =                              substr($AudioChunkHeader, 2, 2);
+                                                               $AudioChunkSize       = getid3_lib::LittleEndian2Int(substr($AudioChunkHeader, 4, 4));
+
+                                                               if ($AudioChunkStreamType == 'wb') {
+                                                                       $FirstFourBytes = substr($AudioChunkHeader, 8, 4);
+                                                                       if (preg_match('/^\xFF[\xE2-\xE7\xF2-\xF7\xFA-\xFF][\x00-\xEB]/s', $FirstFourBytes)) {
+                                                                               // MP3
+                                                                               if (getid3_mp3::MPEGaudioHeaderBytesValid($FirstFourBytes)) {
+                                                                                       $getid3_temp = new getID3();
+                                                                                       $getid3_temp->openfile($this->getid3->filename);
+                                                                                       $getid3_temp->info['avdataoffset'] = $this->ftell() - 4;
+                                                                                       $getid3_temp->info['avdataend']    = $this->ftell() + $AudioChunkSize;
+                                                                                       $getid3_mp3 = new getid3_mp3($getid3_temp);
+                                                                                       $getid3_mp3->getOnlyMPEGaudioInfo($getid3_temp->info['avdataoffset'], false);
+                                                                                       if (isset($getid3_temp->info['mpeg']['audio'])) {
+                                                                                               $info['mpeg']['audio']         = $getid3_temp->info['mpeg']['audio'];
+                                                                                               $info['audio']                 = $getid3_temp->info['audio'];
+                                                                                               $info['audio']['dataformat']   = 'mp'.$info['mpeg']['audio']['layer'];
+                                                                                               $info['audio']['sample_rate']  = $info['mpeg']['audio']['sample_rate'];
+                                                                                               $info['audio']['channels']     = $info['mpeg']['audio']['channels'];
+                                                                                               $info['audio']['bitrate']      = $info['mpeg']['audio']['bitrate'];
+                                                                                               $info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']);
+                                                                                               //$info['bitrate']               = $info['audio']['bitrate'];
+                                                                                       }
+                                                                                       unset($getid3_temp, $getid3_mp3);
+                                                                               }
+
+                                                                       } elseif (strpos($FirstFourBytes, getid3_ac3::syncword) === 0) {
+
+                                                                               // AC3
+                                                                               $getid3_temp = new getID3();
+                                                                               $getid3_temp->openfile($this->getid3->filename);
+                                                                               $getid3_temp->info['avdataoffset'] = $this->ftell() - 4;
+                                                                               $getid3_temp->info['avdataend']    = $this->ftell() + $AudioChunkSize;
+                                                                               $getid3_ac3 = new getid3_ac3($getid3_temp);
+                                                                               $getid3_ac3->Analyze();
+                                                                               if (empty($getid3_temp->info['error'])) {
+                                                                                       $info['audio']   = $getid3_temp->info['audio'];
+                                                                                       $info['ac3']     = $getid3_temp->info['ac3'];
+                                                                                       if (!empty($getid3_temp->info['warning'])) {
+                                                                                               foreach ($getid3_temp->info['warning'] as $key => $value) {
+                                                                                                       $info['warning'][] = $value;
+                                                                                               }
+                                                                                       }
+                                                                               }
+                                                                               unset($getid3_temp, $getid3_ac3);
+                                                                       }
+                                                               }
+                                                               $FoundAllChunksWeNeed = true;
+                                                               $this->fseek($WhereWeWere);
+                                                       }
+                                                       $this->fseek($chunksize - 4, SEEK_CUR);
+
+                                               } else {
+
+                                                       if (!isset($RIFFchunk[$listname])) {
+                                                               $RIFFchunk[$listname] = array();
+                                                       }
+                                                       $LISTchunkParent    = $listname;
+                                                       $LISTchunkMaxOffset = $this->ftell() - 4 + $chunksize;
+                                                       if ($parsedChunk = $this->ParseRIFF($this->ftell(), $LISTchunkMaxOffset)) {
+                                                               $RIFFchunk[$listname] = array_merge_recursive($RIFFchunk[$listname], $parsedChunk);
+                                                       }
+
+                                               }
+                                               break;
+
+                                       default:
+                                               if (preg_match('#^[0-9]{2}(wb|pc|dc|db)$#', $chunkname)) {
+                                                       $this->fseek($chunksize, SEEK_CUR);
+                                                       break;
+                                               }
+                                               $thisindex = 0;
+                                               if (isset($RIFFchunk[$chunkname]) && is_array($RIFFchunk[$chunkname])) {
+                                                       $thisindex = count($RIFFchunk[$chunkname]);
+                                               }
+                                               $RIFFchunk[$chunkname][$thisindex]['offset'] = $this->ftell() - 8;
+                                               $RIFFchunk[$chunkname][$thisindex]['size']   = $chunksize;
+                                               switch ($chunkname) {
+                                                       case 'data':
+                                                               $info['avdataoffset'] = $this->ftell();
+                                                               $info['avdataend']    = $info['avdataoffset'] + $chunksize;
+
+                                                               $testData = $this->fread(36);
+                                                               if ($testData === '') {
+                                                                       break;
+                                                               }
+                                                               if (preg_match('/^\xFF[\xE2-\xE7\xF2-\xF7\xFA-\xFF][\x00-\xEB]/s', substr($testData, 0, 4))) {
+
+                                                                       // Probably is MP3 data
+                                                                       if (getid3_mp3::MPEGaudioHeaderBytesValid(substr($testData, 0, 4))) {
+                                                                               $getid3_temp = new getID3();
+                                                                               $getid3_temp->openfile($this->getid3->filename);
+                                                                               $getid3_temp->info['avdataoffset'] = $info['avdataoffset'];
+                                                                               $getid3_temp->info['avdataend']    = $info['avdataend'];
+                                                                               $getid3_mp3 = new getid3_mp3($getid3_temp);
+                                                                               $getid3_mp3->getOnlyMPEGaudioInfo($info['avdataoffset'], false);
+                                                                               if (empty($getid3_temp->info['error'])) {
+                                                                                       $info['audio'] = $getid3_temp->info['audio'];
+                                                                                       $info['mpeg']  = $getid3_temp->info['mpeg'];
+                                                                               }
+                                                                               unset($getid3_temp, $getid3_mp3);
+                                                                       }
+
+                                                               } elseif (($isRegularAC3 = (substr($testData, 0, 2) == getid3_ac3::syncword)) || substr($testData, 8, 2) == strrev(getid3_ac3::syncword)) {
+
+                                                                       // This is probably AC-3 data
+                                                                       $getid3_temp = new getID3();
+                                                                       if ($isRegularAC3) {
+                                                                               $getid3_temp->openfile($this->getid3->filename);
+                                                                               $getid3_temp->info['avdataoffset'] = $info['avdataoffset'];
+                                                                               $getid3_temp->info['avdataend']    = $info['avdataend'];
+                                                                       }
+                                                                       $getid3_ac3 = new getid3_ac3($getid3_temp);
+                                                                       if ($isRegularAC3) {
+                                                                               $getid3_ac3->Analyze();
+                                                                       } else {
+                                                                               // Dolby Digital WAV
+                                                                               // AC-3 content, but not encoded in same format as normal AC-3 file
+                                                                               // For one thing, byte order is swapped
+                                                                               $ac3_data = '';
+                                                                               for ($i = 0; $i < 28; $i += 2) {
+                                                                                       $ac3_data .= substr($testData, 8 + $i + 1, 1);
+                                                                                       $ac3_data .= substr($testData, 8 + $i + 0, 1);
+                                                                               }
+                                                                               $getid3_ac3->AnalyzeString($ac3_data);
+                                                                       }
+
+                                                                       if (empty($getid3_temp->info['error'])) {
+                                                                               $info['audio'] = $getid3_temp->info['audio'];
+                                                                               $info['ac3']   = $getid3_temp->info['ac3'];
+                                                                               if (!empty($getid3_temp->info['warning'])) {
+                                                                                       foreach ($getid3_temp->info['warning'] as $newerror) {
+                                                                                               $this->warning('getid3_ac3() says: ['.$newerror.']');
+                                                                                       }
+                                                                               }
+                                                                       }
+                                                                       unset($getid3_temp, $getid3_ac3);
+
+                                                               } elseif (preg_match('/^('.implode('|', array_map('preg_quote', getid3_dts::$syncwords)).')/', $testData)) {
+
+                                                                       // This is probably DTS data
+                                                                       $getid3_temp = new getID3();
+                                                                       $getid3_temp->openfile($this->getid3->filename);
+                                                                       $getid3_temp->info['avdataoffset'] = $info['avdataoffset'];
+                                                                       $getid3_dts = new getid3_dts($getid3_temp);
+                                                                       $getid3_dts->Analyze();
+                                                                       if (empty($getid3_temp->info['error'])) {
+                                                                               $info['audio']            = $getid3_temp->info['audio'];
+                                                                               $info['dts']              = $getid3_temp->info['dts'];
+                                                                               $info['playtime_seconds'] = $getid3_temp->info['playtime_seconds']; // may not match RIFF calculations since DTS-WAV often used 14/16 bit-word packing
+                                                                               if (!empty($getid3_temp->info['warning'])) {
+                                                                                       foreach ($getid3_temp->info['warning'] as $newerror) {
+                                                                                               $this->warning('getid3_dts() says: ['.$newerror.']');
+                                                                                       }
+                                                                               }
+                                                                       }
+
+                                                                       unset($getid3_temp, $getid3_dts);
+
+                                                               } elseif (substr($testData, 0, 4) == 'wvpk') {
+
+                                                                       // This is WavPack data
+                                                                       $info['wavpack']['offset'] = $info['avdataoffset'];
+                                                                       $info['wavpack']['size']   = getid3_lib::LittleEndian2Int(substr($testData, 4, 4));
+                                                                       $this->parseWavPackHeader(substr($testData, 8, 28));
+
+                                                               } else {
+                                                                       // This is some other kind of data (quite possibly just PCM)
+                                                                       // do nothing special, just skip it
+                                                               }
+                                                               $nextoffset = $info['avdataend'];
+                                                               $this->fseek($nextoffset);
+                                                               break;
+
+                                                       case 'iXML':
+                                                       case 'bext':
+                                                       case 'cart':
+                                                       case 'fmt ':
+                                                       case 'strh':
+                                                       case 'strf':
+                                                       case 'indx':
+                                                       case 'MEXT':
+                                                       case 'DISP':
+                                                               // always read data in
+                                                       case 'JUNK':
+                                                               // should be: never read data in
+                                                               // but some programs write their version strings in a JUNK chunk (e.g. VirtualDub, AVIdemux, etc)
+                                                               if ($chunksize < 1048576) {
+                                                                       if ($chunksize > 0) {
+                                                                               $RIFFchunk[$chunkname][$thisindex]['data'] = $this->fread($chunksize);
+                                                                               if ($chunkname == 'JUNK') {
+                                                                                       if (preg_match('#^([\\x20-\\x7F]+)#', $RIFFchunk[$chunkname][$thisindex]['data'], $matches)) {
+                                                                                               // only keep text characters [chr(32)-chr(127)]
+                                                                                               $info['riff']['comments']['junk'][] = trim($matches[1]);
+                                                                                       }
+                                                                                       // but if nothing there, ignore
+                                                                                       // remove the key in either case
+                                                                                       unset($RIFFchunk[$chunkname][$thisindex]['data']);
+                                                                               }
+                                                                       }
+                                                               } else {
+                                                                       $this->warning('Chunk "'.$chunkname.'" at offset '.$this->ftell().' is unexpectedly larger than 1MB (claims to be '.number_format($chunksize).' bytes), skipping data');
+                                                                       $this->fseek($chunksize, SEEK_CUR);
+                                                               }
+                                                               break;
+
+                                                       //case 'IDVX':
+                                                       //      $info['divxtag']['comments'] = self::ParseDIVXTAG($this->fread($chunksize));
+                                                       //      break;
+
+                                                       default:
+                                                               if (!empty($LISTchunkParent) && (($RIFFchunk[$chunkname][$thisindex]['offset'] + $RIFFchunk[$chunkname][$thisindex]['size']) <= $LISTchunkMaxOffset)) {
+                                                                       $RIFFchunk[$LISTchunkParent][$chunkname][$thisindex]['offset'] = $RIFFchunk[$chunkname][$thisindex]['offset'];
+                                                                       $RIFFchunk[$LISTchunkParent][$chunkname][$thisindex]['size']   = $RIFFchunk[$chunkname][$thisindex]['size'];
+                                                                       unset($RIFFchunk[$chunkname][$thisindex]['offset']);
+                                                                       unset($RIFFchunk[$chunkname][$thisindex]['size']);
+                                                                       if (isset($RIFFchunk[$chunkname][$thisindex]) && empty($RIFFchunk[$chunkname][$thisindex])) {
+                                                                               unset($RIFFchunk[$chunkname][$thisindex]);
+                                                                       }
+                                                                       if (isset($RIFFchunk[$chunkname]) && empty($RIFFchunk[$chunkname])) {
+                                                                               unset($RIFFchunk[$chunkname]);
+                                                                       }
+                                                                       $RIFFchunk[$LISTchunkParent][$chunkname][$thisindex]['data'] = $this->fread($chunksize);
+                                                               } elseif ($chunksize < 2048) {
+                                                                       // only read data in if smaller than 2kB
+                                                                       $RIFFchunk[$chunkname][$thisindex]['data'] = $this->fread($chunksize);
+                                                               } else {
+                                                                       $this->fseek($chunksize, SEEK_CUR);
+                                                               }
+                                                               break;
+                                               }
+                                               break;
+                               }
+                       }
+
+               } catch (getid3_exception $e) {
+                       if ($e->getCode() == 10) {
+                               $this->warning('RIFF parser: '.$e->getMessage());
+                       } else {
+                               throw $e;
+                       }
+               }
+
+               return $RIFFchunk;
+       }
+
+       public function ParseRIFFdata(&$RIFFdata) {
+               $info = &$this->getid3->info;
+               if ($RIFFdata) {
+                       $tempfile = tempnam(GETID3_TEMP_DIR, 'getID3');
+                       $fp_temp  = fopen($tempfile, 'wb');
+                       $RIFFdataLength = strlen($RIFFdata);
+                       $NewLengthString = getid3_lib::LittleEndian2String($RIFFdataLength, 4);
+                       for ($i = 0; $i < 4; $i++) {
+                               $RIFFdata[($i + 4)] = $NewLengthString[$i];
+                       }
+                       fwrite($fp_temp, $RIFFdata);
+                       fclose($fp_temp);
+
+                       $getid3_temp = new getID3();
+                       $getid3_temp->openfile($tempfile);
+                       $getid3_temp->info['filesize']     = $RIFFdataLength;
+                       $getid3_temp->info['filenamepath'] = $info['filenamepath'];
+                       $getid3_temp->info['tags']         = $info['tags'];
+                       $getid3_temp->info['warning']      = $info['warning'];
+                       $getid3_temp->info['error']        = $info['error'];
+                       $getid3_temp->info['comments']     = $info['comments'];
+                       $getid3_temp->info['audio']        = (isset($info['audio']) ? $info['audio'] : array());
+                       $getid3_temp->info['video']        = (isset($info['video']) ? $info['video'] : array());
+                       $getid3_riff = new getid3_riff($getid3_temp);
+                       $getid3_riff->Analyze();
+
+                       $info['riff']     = $getid3_temp->info['riff'];
+                       $info['warning']  = $getid3_temp->info['warning'];
+                       $info['error']    = $getid3_temp->info['error'];
+                       $info['tags']     = $getid3_temp->info['tags'];
+                       $info['comments'] = $getid3_temp->info['comments'];
+                       unset($getid3_riff, $getid3_temp);
+                       unlink($tempfile);
+               }
+               return false;
+       }
+
+       public static function parseComments(&$RIFFinfoArray, &$CommentsTargetArray) {
+               $RIFFinfoKeyLookup = array(
+                       'IARL'=>'archivallocation',
+                       'IART'=>'artist',
+                       'ICDS'=>'costumedesigner',
+                       'ICMS'=>'commissionedby',
+                       'ICMT'=>'comment',
+                       'ICNT'=>'country',
+                       'ICOP'=>'copyright',
+                       'ICRD'=>'creationdate',
+                       'IDIM'=>'dimensions',
+                       'IDIT'=>'digitizationdate',
+                       'IDPI'=>'resolution',
+                       'IDST'=>'distributor',
+                       'IEDT'=>'editor',
+                       'IENG'=>'engineers',
+                       'IFRM'=>'accountofparts',
+                       'IGNR'=>'genre',
+                       'IKEY'=>'keywords',
+                       'ILGT'=>'lightness',
+                       'ILNG'=>'language',
+                       'IMED'=>'orignalmedium',
+                       'IMUS'=>'composer',
+                       'INAM'=>'title',
+                       'IPDS'=>'productiondesigner',
+                       'IPLT'=>'palette',
+                       'IPRD'=>'product',
+                       'IPRO'=>'producer',
+                       'IPRT'=>'part',
+                       'IRTD'=>'rating',
+                       'ISBJ'=>'subject',
+                       'ISFT'=>'software',
+                       'ISGN'=>'secondarygenre',
+                       'ISHP'=>'sharpness',
+                       'ISRC'=>'sourcesupplier',
+                       'ISRF'=>'digitizationsource',
+                       'ISTD'=>'productionstudio',
+                       'ISTR'=>'starring',
+                       'ITCH'=>'encoded_by',
+                       'IWEB'=>'url',
+                       'IWRI'=>'writer',
+                       '____'=>'comment',
+               );
+               foreach ($RIFFinfoKeyLookup as $key => $value) {
+                       if (isset($RIFFinfoArray[$key])) {
+                               foreach ($RIFFinfoArray[$key] as $commentid => $commentdata) {
+                                       if (trim($commentdata['data']) != '') {
+                                               if (isset($CommentsTargetArray[$value])) {
+                                                       $CommentsTargetArray[$value][] =     trim($commentdata['data']);
+                                               } else {
+                                                       $CommentsTargetArray[$value] = array(trim($commentdata['data']));
+                                               }
+                                       }
+                               }
+                       }
+               }
+               return true;
+       }
+
+       public static function parseWAVEFORMATex($WaveFormatExData) {
+               // shortcut
+               $WaveFormatEx['raw'] = array();
+               $WaveFormatEx_raw    = &$WaveFormatEx['raw'];
+
+               $WaveFormatEx_raw['wFormatTag']      = substr($WaveFormatExData,  0, 2);
+               $WaveFormatEx_raw['nChannels']       = substr($WaveFormatExData,  2, 2);
+               $WaveFormatEx_raw['nSamplesPerSec']  = substr($WaveFormatExData,  4, 4);
+               $WaveFormatEx_raw['nAvgBytesPerSec'] = substr($WaveFormatExData,  8, 4);
+               $WaveFormatEx_raw['nBlockAlign']     = substr($WaveFormatExData, 12, 2);
+               $WaveFormatEx_raw['wBitsPerSample']  = substr($WaveFormatExData, 14, 2);
+               if (strlen($WaveFormatExData) > 16) {
+                       $WaveFormatEx_raw['cbSize']      = substr($WaveFormatExData, 16, 2);
+               }
+               $WaveFormatEx_raw = array_map('getid3_lib::LittleEndian2Int', $WaveFormatEx_raw);
+
+               $WaveFormatEx['codec']           = self::wFormatTagLookup($WaveFormatEx_raw['wFormatTag']);
+               $WaveFormatEx['channels']        = $WaveFormatEx_raw['nChannels'];
+               $WaveFormatEx['sample_rate']     = $WaveFormatEx_raw['nSamplesPerSec'];
+               $WaveFormatEx['bitrate']         = $WaveFormatEx_raw['nAvgBytesPerSec'] * 8;
+               $WaveFormatEx['bits_per_sample'] = $WaveFormatEx_raw['wBitsPerSample'];
+
+               return $WaveFormatEx;
+       }
+
+       public function parseWavPackHeader($WavPackChunkData) {
+               // typedef struct {
+               //     char ckID [4];
+               //     long ckSize;
+               //     short version;
+               //     short bits;                // added for version 2.00
+               //     short flags, shift;        // added for version 3.00
+               //     long total_samples, crc, crc2;
+               //     char extension [4], extra_bc, extras [3];
+               // } WavpackHeader;
+
+               // shortcut
+               $info = &$this->getid3->info;
+               $info['wavpack']  = array();
+               $thisfile_wavpack = &$info['wavpack'];
+
+               $thisfile_wavpack['version']           = getid3_lib::LittleEndian2Int(substr($WavPackChunkData,  0, 2));
+               if ($thisfile_wavpack['version'] >= 2) {
+                       $thisfile_wavpack['bits']          = getid3_lib::LittleEndian2Int(substr($WavPackChunkData,  2, 2));
+               }
+               if ($thisfile_wavpack['version'] >= 3) {
+                       $thisfile_wavpack['flags_raw']     = getid3_lib::LittleEndian2Int(substr($WavPackChunkData,  4, 2));
+                       $thisfile_wavpack['shift']         = getid3_lib::LittleEndian2Int(substr($WavPackChunkData,  6, 2));
+                       $thisfile_wavpack['total_samples'] = getid3_lib::LittleEndian2Int(substr($WavPackChunkData,  8, 4));
+                       $thisfile_wavpack['crc1']          = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 12, 4));
+                       $thisfile_wavpack['crc2']          = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 16, 4));
+                       $thisfile_wavpack['extension']     =                              substr($WavPackChunkData, 20, 4);
+                       $thisfile_wavpack['extra_bc']      = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 24, 1));
+                       for ($i = 0; $i <= 2; $i++) {
+                               $thisfile_wavpack['extras'][]  = getid3_lib::LittleEndian2Int(substr($WavPackChunkData, 25 + $i, 1));
+                       }
+
+                       // shortcut
+                       $thisfile_wavpack['flags'] = array();
+                       $thisfile_wavpack_flags = &$thisfile_wavpack['flags'];
+
+                       $thisfile_wavpack_flags['mono']                 = (bool) ($thisfile_wavpack['flags_raw'] & 0x000001);
+                       $thisfile_wavpack_flags['fast_mode']            = (bool) ($thisfile_wavpack['flags_raw'] & 0x000002);
+                       $thisfile_wavpack_flags['raw_mode']             = (bool) ($thisfile_wavpack['flags_raw'] & 0x000004);
+                       $thisfile_wavpack_flags['calc_noise']           = (bool) ($thisfile_wavpack['flags_raw'] & 0x000008);
+                       $thisfile_wavpack_flags['high_quality']         = (bool) ($thisfile_wavpack['flags_raw'] & 0x000010);
+                       $thisfile_wavpack_flags['3_byte_samples']       = (bool) ($thisfile_wavpack['flags_raw'] & 0x000020);
+                       $thisfile_wavpack_flags['over_20_bits']         = (bool) ($thisfile_wavpack['flags_raw'] & 0x000040);
+                       $thisfile_wavpack_flags['use_wvc']              = (bool) ($thisfile_wavpack['flags_raw'] & 0x000080);
+                       $thisfile_wavpack_flags['noiseshaping']         = (bool) ($thisfile_wavpack['flags_raw'] & 0x000100);
+                       $thisfile_wavpack_flags['very_fast_mode']       = (bool) ($thisfile_wavpack['flags_raw'] & 0x000200);
+                       $thisfile_wavpack_flags['new_high_quality']     = (bool) ($thisfile_wavpack['flags_raw'] & 0x000400);
+                       $thisfile_wavpack_flags['cancel_extreme']       = (bool) ($thisfile_wavpack['flags_raw'] & 0x000800);
+                       $thisfile_wavpack_flags['cross_decorrelation']  = (bool) ($thisfile_wavpack['flags_raw'] & 0x001000);
+                       $thisfile_wavpack_flags['new_decorrelation']    = (bool) ($thisfile_wavpack['flags_raw'] & 0x002000);
+                       $thisfile_wavpack_flags['joint_stereo']         = (bool) ($thisfile_wavpack['flags_raw'] & 0x004000);
+                       $thisfile_wavpack_flags['extra_decorrelation']  = (bool) ($thisfile_wavpack['flags_raw'] & 0x008000);
+                       $thisfile_wavpack_flags['override_noiseshape']  = (bool) ($thisfile_wavpack['flags_raw'] & 0x010000);
+                       $thisfile_wavpack_flags['override_jointstereo'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x020000);
+                       $thisfile_wavpack_flags['copy_source_filetime'] = (bool) ($thisfile_wavpack['flags_raw'] & 0x040000);
+                       $thisfile_wavpack_flags['create_exe']           = (bool) ($thisfile_wavpack['flags_raw'] & 0x080000);
+               }
+
+               return true;
+       }
+
+       public static function ParseBITMAPINFOHEADER($BITMAPINFOHEADER, $littleEndian=true) {
+
+               $parsed['biSize']          = substr($BITMAPINFOHEADER,  0, 4); // number of bytes required by the BITMAPINFOHEADER structure
+               $parsed['biWidth']         = substr($BITMAPINFOHEADER,  4, 4); // width of the bitmap in pixels
+               $parsed['biHeight']        = substr($BITMAPINFOHEADER,  8, 4); // height of the bitmap in pixels. If biHeight is positive, the bitmap is a 'bottom-up' DIB and its origin is the lower left corner. If biHeight is negative, the bitmap is a 'top-down' DIB and its origin is the upper left corner
+               $parsed['biPlanes']        = substr($BITMAPINFOHEADER, 12, 2); // number of color planes on the target device. In most cases this value must be set to 1
+               $parsed['biBitCount']      = substr($BITMAPINFOHEADER, 14, 2); // Specifies the number of bits per pixels
+               $parsed['biSizeImage']     = substr($BITMAPINFOHEADER, 20, 4); // size of the bitmap data section of the image (the actual pixel data, excluding BITMAPINFOHEADER and RGBQUAD structures)
+               $parsed['biXPelsPerMeter'] = substr($BITMAPINFOHEADER, 24, 4); // horizontal resolution, in pixels per metre, of the target device
+               $parsed['biYPelsPerMeter'] = substr($BITMAPINFOHEADER, 28, 4); // vertical resolution, in pixels per metre, of the target device
+               $parsed['biClrUsed']       = substr($BITMAPINFOHEADER, 32, 4); // actual number of color indices in the color table used by the bitmap. If this value is zero, the bitmap uses the maximum number of colors corresponding to the value of the biBitCount member for the compression mode specified by biCompression
+               $parsed['biClrImportant']  = substr($BITMAPINFOHEADER, 36, 4); // number of color indices that are considered important for displaying the bitmap. If this value is zero, all colors are important
+               $parsed = array_map('getid3_lib::'.($littleEndian ? 'Little' : 'Big').'Endian2Int', $parsed);
+
+               $parsed['fourcc']          = substr($BITMAPINFOHEADER, 16, 4);  // compression identifier
+
+               return $parsed;
+       }
+
+       public static function ParseDIVXTAG($DIVXTAG, $raw=false) {
+               // structure from "IDivX" source, Form1.frm, by "Greg Frazier of Daemonic Software Group", email: gfrazier@icestorm.net, web: http://dsg.cjb.net/
+               // source available at http://files.divx-digest.com/download/c663efe7ef8ad2e90bf4af4d3ea6188a/on0SWN2r/edit/IDivX.zip
+               // 'Byte Layout:                   '1111111111111111
+               // '32 for Movie - 1               '1111111111111111
+               // '28 for Author - 6              '6666666666666666
+               // '4  for year - 2                '6666666666662222
+               // '3  for genre - 3               '7777777777777777
+               // '48 for Comments - 7            '7777777777777777
+               // '1  for Rating - 4              '7777777777777777
+               // '5  for Future Additions - 0    '333400000DIVXTAG
+               // '128 bytes total
+
+               static $DIVXTAGgenre  = array(
+                        0 => 'Action',
+                        1 => 'Action/Adventure',
+                        2 => 'Adventure',
+                        3 => 'Adult',
+                        4 => 'Anime',
+                        5 => 'Cartoon',
+                        6 => 'Claymation',
+                        7 => 'Comedy',
+                        8 => 'Commercial',
+                        9 => 'Documentary',
+                       10 => 'Drama',
+                       11 => 'Home Video',
+                       12 => 'Horror',
+                       13 => 'Infomercial',
+                       14 => 'Interactive',
+                       15 => 'Mystery',
+                       16 => 'Music Video',
+                       17 => 'Other',
+                       18 => 'Religion',
+                       19 => 'Sci Fi',
+                       20 => 'Thriller',
+                       21 => 'Western',
+               ),
+               $DIVXTAGrating = array(
+                        0 => 'Unrated',
+                        1 => 'G',
+                        2 => 'PG',
+                        3 => 'PG-13',
+                        4 => 'R',
+                        5 => 'NC-17',
+               );
+
+               $parsed['title']     =        trim(substr($DIVXTAG,   0, 32));
+               $parsed['artist']    =        trim(substr($DIVXTAG,  32, 28));
+               $parsed['year']      = intval(trim(substr($DIVXTAG,  60,  4)));
+               $parsed['comment']   =        trim(substr($DIVXTAG,  64, 48));
+               $parsed['genre_id']  = intval(trim(substr($DIVXTAG, 112,  3)));
+               $parsed['rating_id'] =         ord(substr($DIVXTAG, 115,  1));
+               //$parsed['padding'] =             substr($DIVXTAG, 116,  5);  // 5-byte null
+               //$parsed['magic']   =             substr($DIVXTAG, 121,  7);  // "DIVXTAG"
+
+               $parsed['genre']  = (isset($DIVXTAGgenre[$parsed['genre_id']])   ? $DIVXTAGgenre[$parsed['genre_id']]   : $parsed['genre_id']);
+               $parsed['rating'] = (isset($DIVXTAGrating[$parsed['rating_id']]) ? $DIVXTAGrating[$parsed['rating_id']] : $parsed['rating_id']);
+
+               if (!$raw) {
+                       unset($parsed['genre_id'], $parsed['rating_id']);
+                       foreach ($parsed as $key => $value) {
+                               if (!$value === '') {
+                                       unset($parsed['key']);
+                               }
+                       }
+               }
+
+               foreach ($parsed as $tag => $value) {
+                       $parsed[$tag] = array($value);
+               }
+
+               return $parsed;
+       }
+
+       public static function waveSNDMtagLookup($tagshortname) {
+               $begin = __LINE__;
+
+               /** This is not a comment!
+
+                       Â©kwd   keywords
+                       Â©BPM   bpm
+                       Â©trt   tracktitle
+                       Â©des   description
+                       Â©gen   category
+                       Â©fin   featuredinstrument
+                       Â©LID   longid
+                       Â©bex   bwdescription
+                       Â©pub   publisher
+                       Â©cdt   cdtitle
+                       Â©alb   library
+                       Â©com   composer
+
+               */
+
+               return getid3_lib::EmbeddedLookup($tagshortname, $begin, __LINE__, __FILE__, 'riff-sndm');
+       }
+
+       public static function wFormatTagLookup($wFormatTag) {
+
+               $begin = __LINE__;
+
+               /** This is not a comment!
+
+                       0x0000  Microsoft Unknown Wave Format
+                       0x0001  Pulse Code Modulation (PCM)
+                       0x0002  Microsoft ADPCM
+                       0x0003  IEEE Float
+                       0x0004  Compaq Computer VSELP
+                       0x0005  IBM CVSD
+                       0x0006  Microsoft A-Law
+                       0x0007  Microsoft mu-Law
+                       0x0008  Microsoft DTS
+                       0x0010  OKI ADPCM
+                       0x0011  Intel DVI/IMA ADPCM
+                       0x0012  Videologic MediaSpace ADPCM
+                       0x0013  Sierra Semiconductor ADPCM
+                       0x0014  Antex Electronics G.723 ADPCM
+                       0x0015  DSP Solutions DigiSTD
+                       0x0016  DSP Solutions DigiFIX
+                       0x0017  Dialogic OKI ADPCM
+                       0x0018  MediaVision ADPCM
+                       0x0019  Hewlett-Packard CU
+                       0x0020  Yamaha ADPCM
+                       0x0021  Speech Compression Sonarc
+                       0x0022  DSP Group TrueSpeech
+                       0x0023  Echo Speech EchoSC1
+                       0x0024  Audiofile AF36
+                       0x0025  Audio Processing Technology APTX
+                       0x0026  AudioFile AF10
+                       0x0027  Prosody 1612
+                       0x0028  LRC
+                       0x0030  Dolby AC2
+                       0x0031  Microsoft GSM 6.10
+                       0x0032  MSNAudio
+                       0x0033  Antex Electronics ADPCME
+                       0x0034  Control Resources VQLPC
+                       0x0035  DSP Solutions DigiREAL
+                       0x0036  DSP Solutions DigiADPCM
+                       0x0037  Control Resources CR10
+                       0x0038  Natural MicroSystems VBXADPCM
+                       0x0039  Crystal Semiconductor IMA ADPCM
+                       0x003A  EchoSC3
+                       0x003B  Rockwell ADPCM
+                       0x003C  Rockwell Digit LK
+                       0x003D  Xebec
+                       0x0040  Antex Electronics G.721 ADPCM
+                       0x0041  G.728 CELP
+                       0x0042  MSG723
+                       0x0050  MPEG Layer-2 or Layer-1
+                       0x0052  RT24
+                       0x0053  PAC
+                       0x0055  MPEG Layer-3
+                       0x0059  Lucent G.723
+                       0x0060  Cirrus
+                       0x0061  ESPCM
+                       0x0062  Voxware
+                       0x0063  Canopus Atrac
+                       0x0064  G.726 ADPCM
+                       0x0065  G.722 ADPCM
+                       0x0066  DSAT
+                       0x0067  DSAT Display
+                       0x0069  Voxware Byte Aligned
+                       0x0070  Voxware AC8
+                       0x0071  Voxware AC10
+                       0x0072  Voxware AC16
+                       0x0073  Voxware AC20
+                       0x0074  Voxware MetaVoice
+                       0x0075  Voxware MetaSound
+                       0x0076  Voxware RT29HW
+                       0x0077  Voxware VR12
+                       0x0078  Voxware VR18
+                       0x0079  Voxware TQ40
+                       0x0080  Softsound
+                       0x0081  Voxware TQ60
+                       0x0082  MSRT24
+                       0x0083  G.729A
+                       0x0084  MVI MV12
+                       0x0085  DF G.726
+                       0x0086  DF GSM610
+                       0x0088  ISIAudio
+                       0x0089  Onlive
+                       0x0091  SBC24
+                       0x0092  Dolby AC3 SPDIF
+                       0x0093  MediaSonic G.723
+                       0x0094  Aculab PLC    Prosody 8kbps
+                       0x0097  ZyXEL ADPCM
+                       0x0098  Philips LPCBB
+                       0x0099  Packed
+                       0x00FF  AAC
+                       0x0100  Rhetorex ADPCM
+                       0x0101  IBM mu-law
+                       0x0102  IBM A-law
+                       0x0103  IBM AVC Adaptive Differential Pulse Code Modulation (ADPCM)
+                       0x0111  Vivo G.723
+                       0x0112  Vivo Siren
+                       0x0123  Digital G.723
+                       0x0125  Sanyo LD ADPCM
+                       0x0130  Sipro Lab Telecom ACELP NET
+                       0x0131  Sipro Lab Telecom ACELP 4800
+                       0x0132  Sipro Lab Telecom ACELP 8V3
+                       0x0133  Sipro Lab Telecom G.729
+                       0x0134  Sipro Lab Telecom G.729A
+                       0x0135  Sipro Lab Telecom Kelvin
+                       0x0140  Windows Media Video V8
+                       0x0150  Qualcomm PureVoice
+                       0x0151  Qualcomm HalfRate
+                       0x0155  Ring Zero Systems TUB GSM
+                       0x0160  Microsoft Audio 1
+                       0x0161  Windows Media Audio V7 / V8 / V9
+                       0x0162  Windows Media Audio Professional V9
+                       0x0163  Windows Media Audio Lossless V9
+                       0x0200  Creative Labs ADPCM
+                       0x0202  Creative Labs Fastspeech8
+                       0x0203  Creative Labs Fastspeech10
+                       0x0210  UHER Informatic GmbH ADPCM
+                       0x0220  Quarterdeck
+                       0x0230  I-link Worldwide VC
+                       0x0240  Aureal RAW Sport
+                       0x0250  Interactive Products HSX
+                       0x0251  Interactive Products RPELP
+                       0x0260  Consistent Software CS2
+                       0x0270  Sony SCX
+                       0x0300  Fujitsu FM Towns Snd
+                       0x0400  BTV Digital
+                       0x0401  Intel Music Coder
+                       0x0450  QDesign Music
+                       0x0680  VME VMPCM
+                       0x0681  AT&T Labs TPC
+                       0x08AE  ClearJump LiteWave
+                       0x1000  Olivetti GSM
+                       0x1001  Olivetti ADPCM
+                       0x1002  Olivetti CELP
+                       0x1003  Olivetti SBC
+                       0x1004  Olivetti OPR
+                       0x1100  Lernout & Hauspie Codec (0x1100)
+                       0x1101  Lernout & Hauspie CELP Codec (0x1101)
+                       0x1102  Lernout & Hauspie SBC Codec (0x1102)
+                       0x1103  Lernout & Hauspie SBC Codec (0x1103)
+                       0x1104  Lernout & Hauspie SBC Codec (0x1104)
+                       0x1400  Norris
+                       0x1401  AT&T ISIAudio
+                       0x1500  Soundspace Music Compression
+                       0x181C  VoxWare RT24 Speech
+                       0x1FC4  NCT Soft ALF2CD (www.nctsoft.com)
+                       0x2000  Dolby AC3
+                       0x2001  Dolby DTS
+                       0x2002  WAVE_FORMAT_14_4
+                       0x2003  WAVE_FORMAT_28_8
+                       0x2004  WAVE_FORMAT_COOK
+                       0x2005  WAVE_FORMAT_DNET
+                       0x674F  Ogg Vorbis 1
+                       0x6750  Ogg Vorbis 2
+                       0x6751  Ogg Vorbis 3
+                       0x676F  Ogg Vorbis 1+
+                       0x6770  Ogg Vorbis 2+
+                       0x6771  Ogg Vorbis 3+
+                       0x7A21  GSM-AMR (CBR, no SID)
+                       0x7A22  GSM-AMR (VBR, including SID)
+                       0xFFFE  WAVE_FORMAT_EXTENSIBLE
+                       0xFFFF  WAVE_FORMAT_DEVELOPMENT
+
+               */
+
+               return getid3_lib::EmbeddedLookup('0x'.str_pad(strtoupper(dechex($wFormatTag)), 4, '0', STR_PAD_LEFT), $begin, __LINE__, __FILE__, 'riff-wFormatTag');
+       }
+
+       public static function fourccLookup($fourcc) {
+
+               $begin = __LINE__;
+
+               /** This is not a comment!
+
+                       swot    http://developer.apple.com/qa/snd/snd07.html
+                       ____    No Codec (____)
+                       _BIT    BI_BITFIELDS (Raw RGB)
+                       _JPG    JPEG compressed
+                       _PNG    PNG compressed W3C/ISO/IEC (RFC-2083)
+                       _RAW    Full Frames (Uncompressed)
+                       _RGB    Raw RGB Bitmap
+                       _RL4    RLE 4bpp RGB
+                       _RL8    RLE 8bpp RGB
+                       3IV1    3ivx MPEG-4 v1
+                       3IV2    3ivx MPEG-4 v2
+                       3IVX    3ivx MPEG-4
+                       AASC    Autodesk Animator
+                       ABYR    Kensington ?ABYR?
+                       AEMI    Array Microsystems VideoONE MPEG1-I Capture
+                       AFLC    Autodesk Animator FLC
+                       AFLI    Autodesk Animator FLI
+                       AMPG    Array Microsystems VideoONE MPEG
+                       ANIM    Intel RDX (ANIM)
+                       AP41    AngelPotion Definitive
+                       ASV1    Asus Video v1
+                       ASV2    Asus Video v2
+                       ASVX    Asus Video 2.0 (audio)
+                       AUR2    AuraVision Aura 2 Codec - YUV 4:2:2
+                       AURA    AuraVision Aura 1 Codec - YUV 4:1:1
+                       AVDJ    Independent JPEG Group\'s codec (AVDJ)
+                       AVRN    Independent JPEG Group\'s codec (AVRN)
+                       AYUV    4:4:4 YUV (AYUV)
+                       AZPR    Quicktime Apple Video (AZPR)
+                       BGR     Raw RGB32
+                       BLZ0    Blizzard DivX MPEG-4
+                       BTVC    Conexant Composite Video
+                       BINK    RAD Game Tools Bink Video
+                       BT20    Conexant Prosumer Video
+                       BTCV    Conexant Composite Video Codec
+                       BW10    Data Translation Broadway MPEG Capture
+                       CC12    Intel YUV12
+                       CDVC    Canopus DV
+                       CFCC    Digital Processing Systems DPS Perception
+                       CGDI    Microsoft Office 97 Camcorder Video
+                       CHAM    Winnov Caviara Champagne
+                       CJPG    Creative WebCam JPEG
+                       CLJR    Cirrus Logic YUV 4:1:1
+                       CMYK    Common Data Format in Printing (Colorgraph)
+                       CPLA    Weitek 4:2:0 YUV Planar
+                       CRAM    Microsoft Video 1 (CRAM)
+                       cvid    Radius Cinepak
+                       CVID    Radius Cinepak
+                       CWLT    Microsoft Color WLT DIB
+                       CYUV    Creative Labs YUV
+                       CYUY    ATI YUV
+                       D261    H.261
+                       D263    H.263
+                       DIB     Device Independent Bitmap
+                       DIV1    FFmpeg OpenDivX
+                       DIV2    Microsoft MPEG-4 v1/v2
+                       DIV3    DivX ;-) MPEG-4 v3.x Low-Motion
+                       DIV4    DivX ;-) MPEG-4 v3.x Fast-Motion
+                       DIV5    DivX MPEG-4 v5.x
+                       DIV6    DivX ;-) (MS MPEG-4 v3.x)
+                       DIVX    DivX MPEG-4 v4 (OpenDivX / Project Mayo)
+                       divx    DivX MPEG-4
+                       DMB1    Matrox Rainbow Runner hardware MJPEG
+                       DMB2    Paradigm MJPEG
+                       DSVD    ?DSVD?
+                       DUCK    Duck TrueMotion 1.0
+                       DPS0    DPS/Leitch Reality Motion JPEG
+                       DPSC    DPS/Leitch PAR Motion JPEG
+                       DV25    Matrox DVCPRO codec
+                       DV50    Matrox DVCPRO50 codec
+                       DVC     IEC 61834 and SMPTE 314M (DVC/DV Video)
+                       DVCP    IEC 61834 and SMPTE 314M (DVC/DV Video)
+                       DVHD    IEC Standard DV 1125 lines @ 30fps / 1250 lines @ 25fps
+                       DVMA    Darim Vision DVMPEG (dummy for MPEG compressor) (www.darvision.com)
+                       DVSL    IEC Standard DV compressed in SD (SDL)
+                       DVAN    ?DVAN?
+                       DVE2    InSoft DVE-2 Videoconferencing
+                       dvsd    IEC 61834 and SMPTE 314M DVC/DV Video
+                       DVSD    IEC 61834 and SMPTE 314M DVC/DV Video
+                       DVX1    Lucent DVX1000SP Video Decoder
+                       DVX2    Lucent DVX2000S Video Decoder
+                       DVX3    Lucent DVX3000S Video Decoder
+                       DX50    DivX v5
+                       DXT1    Microsoft DirectX Compressed Texture (DXT1)
+                       DXT2    Microsoft DirectX Compressed Texture (DXT2)
+                       DXT3    Microsoft DirectX Compressed Texture (DXT3)
+                       DXT4    Microsoft DirectX Compressed Texture (DXT4)
+                       DXT5    Microsoft DirectX Compressed Texture (DXT5)
+                       DXTC    Microsoft DirectX Compressed Texture (DXTC)
+                       DXTn    Microsoft DirectX Compressed Texture (DXTn)
+                       EM2V    Etymonix MPEG-2 I-frame (www.etymonix.com)
+                       EKQ0    Elsa ?EKQ0?
+                       ELK0    Elsa ?ELK0?
+                       ESCP    Eidos Escape
+                       ETV1    eTreppid Video ETV1
+                       ETV2    eTreppid Video ETV2
+                       ETVC    eTreppid Video ETVC
+                       FLIC    Autodesk FLI/FLC Animation
+                       FLV1    Sorenson Spark
+                       FLV4    On2 TrueMotion VP6
+                       FRWT    Darim Vision Forward Motion JPEG (www.darvision.com)
+                       FRWU    Darim Vision Forward Uncompressed (www.darvision.com)
+                       FLJP    D-Vision Field Encoded Motion JPEG
+                       FPS1    FRAPS v1
+                       FRWA    SoftLab-Nsk Forward Motion JPEG w/ alpha channel
+                       FRWD    SoftLab-Nsk Forward Motion JPEG
+                       FVF1    Iterated Systems Fractal Video Frame
+                       GLZW    Motion LZW (gabest@freemail.hu)
+                       GPEG    Motion JPEG (gabest@freemail.hu)
+                       GWLT    Microsoft Greyscale WLT DIB
+                       H260    Intel ITU H.260 Videoconferencing
+                       H261    Intel ITU H.261 Videoconferencing
+                       H262    Intel ITU H.262 Videoconferencing
+                       H263    Intel ITU H.263 Videoconferencing
+                       H264    Intel ITU H.264 Videoconferencing
+                       H265    Intel ITU H.265 Videoconferencing
+                       H266    Intel ITU H.266 Videoconferencing
+                       H267    Intel ITU H.267 Videoconferencing
+                       H268    Intel ITU H.268 Videoconferencing
+                       H269    Intel ITU H.269 Videoconferencing
+                       HFYU    Huffman Lossless Codec
+                       HMCR    Rendition Motion Compensation Format (HMCR)
+                       HMRR    Rendition Motion Compensation Format (HMRR)
+                       I263    FFmpeg I263 decoder
+                       IF09    Indeo YVU9 ("YVU9 with additional delta-frame info after the U plane")
+                       IUYV    Interlaced version of UYVY (www.leadtools.com)
+                       IY41    Interlaced version of Y41P (www.leadtools.com)
+                       IYU1    12 bit format used in mode 2 of the IEEE 1394 Digital Camera 1.04 spec    IEEE standard
+                       IYU2    24 bit format used in mode 2 of the IEEE 1394 Digital Camera 1.04 spec    IEEE standard
+                       IYUV    Planar YUV format (8-bpp Y plane, followed by 8-bpp 2×2 U and V planes)
+                       i263    Intel ITU H.263 Videoconferencing (i263)
+                       I420    Intel Indeo 4
+                       IAN     Intel Indeo 4 (RDX)
+                       ICLB    InSoft CellB Videoconferencing
+                       IGOR    Power DVD
+                       IJPG    Intergraph JPEG
+                       ILVC    Intel Layered Video
+                       ILVR    ITU-T H.263+
+                       IPDV    I-O Data Device Giga AVI DV Codec
+                       IR21    Intel Indeo 2.1
+                       IRAW    Intel YUV Uncompressed
+                       IV30    Intel Indeo 3.0
+                       IV31    Intel Indeo 3.1
+                       IV32    Ligos Indeo 3.2
+                       IV33    Ligos Indeo 3.3
+                       IV34    Ligos Indeo 3.4
+                       IV35    Ligos Indeo 3.5
+                       IV36    Ligos Indeo 3.6
+                       IV37    Ligos Indeo 3.7
+                       IV38    Ligos Indeo 3.8
+                       IV39    Ligos Indeo 3.9
+                       IV40    Ligos Indeo Interactive 4.0
+                       IV41    Ligos Indeo Interactive 4.1
+                       IV42    Ligos Indeo Interactive 4.2
+                       IV43    Ligos Indeo Interactive 4.3
+                       IV44    Ligos Indeo Interactive 4.4
+                       IV45    Ligos Indeo Interactive 4.5
+                       IV46    Ligos Indeo Interactive 4.6
+                       IV47    Ligos Indeo Interactive 4.7
+                       IV48    Ligos Indeo Interactive 4.8
+                       IV49    Ligos Indeo Interactive 4.9
+                       IV50    Ligos Indeo Interactive 5.0
+                       JBYR    Kensington ?JBYR?
+                       JPEG    Still Image JPEG DIB
+                       JPGL    Pegasus Lossless Motion JPEG
+                       KMVC    Team17 Software Karl Morton\'s Video Codec
+                       LSVM    Vianet Lighting Strike Vmail (Streaming) (www.vianet.com)
+                       LEAD    LEAD Video Codec
+                       Ljpg    LEAD MJPEG Codec
+                       MDVD    Alex MicroDVD Video (hacked MS MPEG-4) (www.tiasoft.de)
+                       MJPA    Morgan Motion JPEG (MJPA) (www.morgan-multimedia.com)
+                       MJPB    Morgan Motion JPEG (MJPB) (www.morgan-multimedia.com)
+                       MMES    Matrox MPEG-2 I-frame
+                       MP2v    Microsoft S-Mpeg 4 version 1 (MP2v)
+                       MP42    Microsoft S-Mpeg 4 version 2 (MP42)
+                       MP43    Microsoft S-Mpeg 4 version 3 (MP43)
+                       MP4S    Microsoft S-Mpeg 4 version 3 (MP4S)
+                       MP4V    FFmpeg MPEG-4
+                       MPG1    FFmpeg MPEG 1/2
+                       MPG2    FFmpeg MPEG 1/2
+                       MPG3    FFmpeg DivX ;-) (MS MPEG-4 v3)
+                       MPG4    Microsoft MPEG-4
+                       MPGI    Sigma Designs MPEG
+                       MPNG    PNG images decoder
+                       MSS1    Microsoft Windows Screen Video
+                       MSZH    LCL (Lossless Codec Library) (www.geocities.co.jp/Playtown-Denei/2837/LRC.htm)
+                       M261    Microsoft H.261
+                       M263    Microsoft H.263
+                       M4S2    Microsoft Fully Compliant MPEG-4 v2 simple profile (M4S2)
+                       m4s2    Microsoft Fully Compliant MPEG-4 v2 simple profile (m4s2)
+                       MC12    ATI Motion Compensation Format (MC12)
+                       MCAM    ATI Motion Compensation Format (MCAM)
+                       MJ2C    Morgan Multimedia Motion JPEG2000
+                       mJPG    IBM Motion JPEG w/ Huffman Tables
+                       MJPG    Microsoft Motion JPEG DIB
+                       MP42    Microsoft MPEG-4 (low-motion)
+                       MP43    Microsoft MPEG-4 (fast-motion)
+                       MP4S    Microsoft MPEG-4 (MP4S)
+                       mp4s    Microsoft MPEG-4 (mp4s)
+                       MPEG    Chromatic Research MPEG-1 Video I-Frame
+                       MPG4    Microsoft MPEG-4 Video High Speed Compressor
+                       MPGI    Sigma Designs MPEG
+                       MRCA    FAST Multimedia Martin Regen Codec
+                       MRLE    Microsoft Run Length Encoding
+                       MSVC    Microsoft Video 1
+                       MTX1    Matrox ?MTX1?
+                       MTX2    Matrox ?MTX2?
+                       MTX3    Matrox ?MTX3?
+                       MTX4    Matrox ?MTX4?
+                       MTX5    Matrox ?MTX5?
+                       MTX6    Matrox ?MTX6?
+                       MTX7    Matrox ?MTX7?
+                       MTX8    Matrox ?MTX8?
+                       MTX9    Matrox ?MTX9?
+                       MV12    Motion Pixels Codec (old)
+                       MWV1    Aware Motion Wavelets
+                       nAVI    SMR Codec (hack of Microsoft MPEG-4) (IRC #shadowrealm)
+                       NT00    NewTek LightWave HDTV YUV w/ Alpha (www.newtek.com)
+                       NUV1    NuppelVideo
+                       NTN1    Nogatech Video Compression 1
+                       NVS0    nVidia GeForce Texture (NVS0)
+                       NVS1    nVidia GeForce Texture (NVS1)
+                       NVS2    nVidia GeForce Texture (NVS2)
+                       NVS3    nVidia GeForce Texture (NVS3)
+                       NVS4    nVidia GeForce Texture (NVS4)
+                       NVS5    nVidia GeForce Texture (NVS5)
+                       NVT0    nVidia GeForce Texture (NVT0)
+                       NVT1    nVidia GeForce Texture (NVT1)
+                       NVT2    nVidia GeForce Texture (NVT2)
+                       NVT3    nVidia GeForce Texture (NVT3)
+                       NVT4    nVidia GeForce Texture (NVT4)
+                       NVT5    nVidia GeForce Texture (NVT5)
+                       PIXL    MiroXL, Pinnacle PCTV
+                       PDVC    I-O Data Device Digital Video Capture DV codec
+                       PGVV    Radius Video Vision
+                       PHMO    IBM Photomotion
+                       PIM1    MPEG Realtime (Pinnacle Cards)
+                       PIM2    Pegasus Imaging ?PIM2?
+                       PIMJ    Pegasus Imaging Lossless JPEG
+                       PVEZ    Horizons Technology PowerEZ
+                       PVMM    PacketVideo Corporation MPEG-4
+                       PVW2    Pegasus Imaging Wavelet Compression
+                       Q1.0    Q-Team\'s QPEG 1.0 (www.q-team.de)
+                       Q1.1    Q-Team\'s QPEG 1.1 (www.q-team.de)
+                       QPEG    Q-Team QPEG 1.0
+                       qpeq    Q-Team QPEG 1.1
+                       RGB     Raw BGR32
+                       RGBA    Raw RGB w/ Alpha
+                       RMP4    REALmagic MPEG-4 (unauthorized XVID copy) (www.sigmadesigns.com)
+                       ROQV    Id RoQ File Video Decoder
+                       RPZA    Quicktime Apple Video (RPZA)
+                       RUD0    Rududu video codec (http://rududu.ifrance.com/rududu/)
+                       RV10    RealVideo 1.0 (aka RealVideo 5.0)
+                       RV13    RealVideo 1.0 (RV13)
+                       RV20    RealVideo G2
+                       RV30    RealVideo 8
+                       RV40    RealVideo 9
+                       RGBT    Raw RGB w/ Transparency
+                       RLE     Microsoft Run Length Encoder
+                       RLE4    Run Length Encoded (4bpp, 16-color)
+                       RLE8    Run Length Encoded (8bpp, 256-color)
+                       RT21    Intel Indeo RealTime Video 2.1
+                       rv20    RealVideo G2
+                       rv30    RealVideo 8
+                       RVX     Intel RDX (RVX )
+                       SMC     Apple Graphics (SMC )
+                       SP54    Logitech Sunplus Sp54 Codec for Mustek GSmart Mini 2
+                       SPIG    Radius Spigot
+                       SVQ3    Sorenson Video 3 (Apple Quicktime 5)
+                       s422    Tekram VideoCap C210 YUV 4:2:2
+                       SDCC    Sun Communication Digital Camera Codec
+                       SFMC    CrystalNet Surface Fitting Method
+                       SMSC    Radius SMSC
+                       SMSD    Radius SMSD
+                       smsv    WorldConnect Wavelet Video
+                       SPIG    Radius Spigot
+                       SPLC    Splash Studios ACM Audio Codec (www.splashstudios.net)
+                       SQZ2    Microsoft VXTreme Video Codec V2
+                       STVA    ST Microelectronics CMOS Imager Data (Bayer)
+                       STVB    ST Microelectronics CMOS Imager Data (Nudged Bayer)
+                       STVC    ST Microelectronics CMOS Imager Data (Bunched)
+                       STVX    ST Microelectronics CMOS Imager Data (Extended CODEC Data Format)
+                       STVY    ST Microelectronics CMOS Imager Data (Extended CODEC Data Format with Correction Data)
+                       SV10    Sorenson Video R1
+                       SVQ1    Sorenson Video
+                       T420    Toshiba YUV 4:2:0
+                       TM2A    Duck TrueMotion Archiver 2.0 (www.duck.com)
+                       TVJP    Pinnacle/Truevision Targa 2000 board (TVJP)
+                       TVMJ    Pinnacle/Truevision Targa 2000 board (TVMJ)
+                       TY0N    Tecomac Low-Bit Rate Codec (www.tecomac.com)
+                       TY2C    Trident Decompression Driver
+                       TLMS    TeraLogic Motion Intraframe Codec (TLMS)
+                       TLST    TeraLogic Motion Intraframe Codec (TLST)
+                       TM20    Duck TrueMotion 2.0
+                       TM2X    Duck TrueMotion 2X
+                       TMIC    TeraLogic Motion Intraframe Codec (TMIC)
+                       TMOT    Horizons Technology TrueMotion S
+                       tmot    Horizons TrueMotion Video Compression
+                       TR20    Duck TrueMotion RealTime 2.0
+                       TSCC    TechSmith Screen Capture Codec
+                       TV10    Tecomac Low-Bit Rate Codec
+                       TY2N    Trident ?TY2N?
+                       U263    UB Video H.263/H.263+/H.263++ Decoder
+                       UMP4    UB Video MPEG 4 (www.ubvideo.com)
+                       UYNV    Nvidia UYVY packed 4:2:2
+                       UYVP    Evans & Sutherland YCbCr 4:2:2 extended precision
+                       UCOD    eMajix.com ClearVideo
+                       ULTI    IBM Ultimotion
+                       UYVY    UYVY packed 4:2:2
+                       V261    Lucent VX2000S
+                       VIFP    VFAPI Reader Codec (www.yks.ne.jp/~hori/)
+                       VIV1    FFmpeg H263+ decoder
+                       VIV2    Vivo H.263
+                       VQC2    Vector-quantised codec 2 (research) http://eprints.ecs.soton.ac.uk/archive/00001310/01/VTC97-js.pdf)
+                       VTLP    Alaris VideoGramPiX
+                       VYU9    ATI YUV (VYU9)
+                       VYUY    ATI YUV (VYUY)
+                       V261    Lucent VX2000S
+                       V422    Vitec Multimedia 24-bit YUV 4:2:2 Format
+                       V655    Vitec Multimedia 16-bit YUV 4:2:2 Format
+                       VCR1    ATI Video Codec 1
+                       VCR2    ATI Video Codec 2
+                       VCR3    ATI VCR 3.0
+                       VCR4    ATI VCR 4.0
+                       VCR5    ATI VCR 5.0
+                       VCR6    ATI VCR 6.0
+                       VCR7    ATI VCR 7.0
+                       VCR8    ATI VCR 8.0
+                       VCR9    ATI VCR 9.0
+                       VDCT    Vitec Multimedia Video Maker Pro DIB
+                       VDOM    VDOnet VDOWave
+                       VDOW    VDOnet VDOLive (H.263)
+                       VDTZ    Darim Vison VideoTizer YUV
+                       VGPX    Alaris VideoGramPiX
+                       VIDS    Vitec Multimedia YUV 4:2:2 CCIR 601 for V422
+                       VIVO    Vivo H.263 v2.00
+                       vivo    Vivo H.263
+                       VIXL    Miro/Pinnacle Video XL
+                       VLV1    VideoLogic/PURE Digital Videologic Capture
+                       VP30    On2 VP3.0
+                       VP31    On2 VP3.1
+                       VP6F    On2 TrueMotion VP6
+                       VX1K    Lucent VX1000S Video Codec
+                       VX2K    Lucent VX2000S Video Codec
+                       VXSP    Lucent VX1000SP Video Codec
+                       WBVC    Winbond W9960
+                       WHAM    Microsoft Video 1 (WHAM)
+                       WINX    Winnov Software Compression
+                       WJPG    AverMedia Winbond JPEG
+                       WMV1    Windows Media Video V7
+                       WMV2    Windows Media Video V8
+                       WMV3    Windows Media Video V9
+                       WNV1    Winnov Hardware Compression
+                       XYZP    Extended PAL format XYZ palette (www.riff.org)
+                       x263    Xirlink H.263
+                       XLV0    NetXL Video Decoder
+                       XMPG    Xing MPEG (I-Frame only)
+                       XVID    XviD MPEG-4 (www.xvid.org)
+                       XXAN    ?XXAN?
+                       YU92    Intel YUV (YU92)
+                       YUNV    Nvidia Uncompressed YUV 4:2:2
+                       YUVP    Extended PAL format YUV palette (www.riff.org)
+                       Y211    YUV 2:1:1 Packed
+                       Y411    YUV 4:1:1 Packed
+                       Y41B    Weitek YUV 4:1:1 Planar
+                       Y41P    Brooktree PC1 YUV 4:1:1 Packed
+                       Y41T    Brooktree PC1 YUV 4:1:1 with transparency
+                       Y42B    Weitek YUV 4:2:2 Planar
+                       Y42T    Brooktree UYUV 4:2:2 with transparency
+                       Y422    ADS Technologies Copy of UYVY used in Pyro WebCam firewire camera
+                       Y800    Simple, single Y plane for monochrome images
+                       Y8      Grayscale video
+                       YC12    Intel YUV 12 codec
+                       YUV8    Winnov Caviar YUV8
+                       YUV9    Intel YUV9
+                       YUY2    Uncompressed YUV 4:2:2
+                       YUYV    Canopus YUV
+                       YV12    YVU12 Planar
+                       YVU9    Intel YVU9 Planar (8-bpp Y plane, followed by 8-bpp 4x4 U and V planes)
+                       YVYU    YVYU 4:2:2 Packed
+                       ZLIB    Lossless Codec Library zlib compression (www.geocities.co.jp/Playtown-Denei/2837/LRC.htm)
+                       ZPEG    Metheus Video Zipper
+
+               */
+
+               return getid3_lib::EmbeddedLookup($fourcc, $begin, __LINE__, __FILE__, 'riff-fourcc');
+       }
+
+       private function EitherEndian2Int($byteword, $signed=false) {
+               if ($this->getid3->info['fileformat'] == 'riff') {
+                       return getid3_lib::LittleEndian2Int($byteword, $signed);
+               }
+               return getid3_lib::BigEndian2Int($byteword, false, $signed);
+       }
+
+}
diff --git a/wp-includes/ID3/module.audio.ac3.php b/wp-includes/ID3/module.audio.ac3.php
new file mode 100644 (file)
index 0000000..9834feb
--- /dev/null
@@ -0,0 +1,473 @@
+<?php
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org>               //
+//  available at http://getid3.sourceforge.net                 //
+//            or http://www.getid3.org                         //
+/////////////////////////////////////////////////////////////////
+// See readme.txt for more details                             //
+/////////////////////////////////////////////////////////////////
+//                                                             //
+// module.audio.ac3.php                                        //
+// module for analyzing AC-3 (aka Dolby Digital) audio files   //
+// dependencies: NONE                                          //
+//                                                            ///
+/////////////////////////////////////////////////////////////////
+
+
+class getid3_ac3 extends getid3_handler
+{
+    private $AC3header = array();
+    private $BSIoffset = 0;
+
+    const syncword = "\x0B\x77";
+
+       public function Analyze() {
+               $info = &$this->getid3->info;
+
+               ///AH
+               $info['ac3']['raw']['bsi'] = array();
+               $thisfile_ac3              = &$info['ac3'];
+               $thisfile_ac3_raw          = &$thisfile_ac3['raw'];
+               $thisfile_ac3_raw_bsi      = &$thisfile_ac3_raw['bsi'];
+
+
+               // http://www.atsc.org/standards/a_52a.pdf
+
+               $info['fileformat'] = 'ac3';
+
+               // An AC-3 serial coded audio bit stream is made up of a sequence of synchronization frames
+               // Each synchronization frame contains 6 coded audio blocks (AB), each of which represent 256
+               // new audio samples per channel. A synchronization information (SI) header at the beginning
+               // of each frame contains information needed to acquire and maintain synchronization. A
+               // bit stream information (BSI) header follows SI, and contains parameters describing the coded
+               // audio service. The coded audio blocks may be followed by an auxiliary data (Aux) field. At the
+               // end of each frame is an error check field that includes a CRC word for error detection. An
+               // additional CRC word is located in the SI header, the use of which, by a decoder, is optional.
+               //
+               // syncinfo() | bsi() | AB0 | AB1 | AB2 | AB3 | AB4 | AB5 | Aux | CRC
+
+               // syncinfo() {
+               //       syncword    16
+               //       crc1        16
+               //       fscod        2
+               //       frmsizecod   6
+               // } /* end of syncinfo */
+
+               $this->fseek($info['avdataoffset']);
+               $this->AC3header['syncinfo'] = $this->fread(5);
+
+               if (strpos($this->AC3header['syncinfo'], self::syncword) === 0) {
+                       $thisfile_ac3_raw['synchinfo']['synchword'] = self::syncword;
+                       $offset = 2;
+               } else {
+                       if (!$this->isDependencyFor('matroska')) {
+                               unset($info['fileformat'], $info['ac3']);
+                               return $this->error('Expecting "'.getid3_lib::PrintHexBytes(self::syncword).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes(substr($this->AC3header['syncinfo'], 0, 2)).'"');
+                       }
+                       $offset = 0;
+                       $this->fseek(-2, SEEK_CUR);
+               }
+
+               $info['audio']['dataformat']   = 'ac3';
+               $info['audio']['bitrate_mode'] = 'cbr';
+               $info['audio']['lossless']     = false;
+
+               $thisfile_ac3_raw['synchinfo']['crc1']       = getid3_lib::LittleEndian2Int(substr($this->AC3header['syncinfo'], $offset, 2));
+               $ac3_synchinfo_fscod_frmsizecod              = getid3_lib::LittleEndian2Int(substr($this->AC3header['syncinfo'], ($offset + 2), 1));
+               $thisfile_ac3_raw['synchinfo']['fscod']      = ($ac3_synchinfo_fscod_frmsizecod & 0xC0) >> 6;
+               $thisfile_ac3_raw['synchinfo']['frmsizecod'] = ($ac3_synchinfo_fscod_frmsizecod & 0x3F);
+
+               $thisfile_ac3['sample_rate'] = self::sampleRateCodeLookup($thisfile_ac3_raw['synchinfo']['fscod']);
+               if ($thisfile_ac3_raw['synchinfo']['fscod'] <= 3) {
+                       $info['audio']['sample_rate'] = $thisfile_ac3['sample_rate'];
+               }
+
+               $thisfile_ac3['frame_length'] = self::frameSizeLookup($thisfile_ac3_raw['synchinfo']['frmsizecod'], $thisfile_ac3_raw['synchinfo']['fscod']);
+               $thisfile_ac3['bitrate']      = self::bitrateLookup($thisfile_ac3_raw['synchinfo']['frmsizecod']);
+               $info['audio']['bitrate'] = $thisfile_ac3['bitrate'];
+
+               $this->AC3header['bsi'] = getid3_lib::BigEndian2Bin($this->fread(15));
+               $ac3_bsi_offset = 0;
+
+               $thisfile_ac3_raw_bsi['bsid'] = $this->readHeaderBSI(5);
+               if ($thisfile_ac3_raw_bsi['bsid'] > 8) {
+                       // Decoders which can decode version 8 will thus be able to decode version numbers less than 8.
+                       // If this standard is extended by the addition of additional elements or features, a value of bsid greater than 8 will be used.
+                       // Decoders built to this version of the standard will not be able to decode versions with bsid greater than 8.
+                       $this->error('Bit stream identification is version '.$thisfile_ac3_raw_bsi['bsid'].', but getID3() only understands up to version 8');
+                   unset($info['ac3']);
+                       return false;
+               }
+
+               $thisfile_ac3_raw_bsi['bsmod'] = $this->readHeaderBSI(3);
+               $thisfile_ac3_raw_bsi['acmod'] = $this->readHeaderBSI(3);
+
+               $thisfile_ac3['service_type'] = self::serviceTypeLookup($thisfile_ac3_raw_bsi['bsmod'], $thisfile_ac3_raw_bsi['acmod']);
+               $ac3_coding_mode = self::audioCodingModeLookup($thisfile_ac3_raw_bsi['acmod']);
+               foreach($ac3_coding_mode as $key => $value) {
+                       $thisfile_ac3[$key] = $value;
+               }
+               switch ($thisfile_ac3_raw_bsi['acmod']) {
+                       case 0:
+                       case 1:
+                               $info['audio']['channelmode'] = 'mono';
+                               break;
+                       case 3:
+                       case 4:
+                               $info['audio']['channelmode'] = 'stereo';
+                               break;
+                       default:
+                               $info['audio']['channelmode'] = 'surround';
+                               break;
+               }
+               $info['audio']['channels'] = $thisfile_ac3['num_channels'];
+
+               if ($thisfile_ac3_raw_bsi['acmod'] & 0x01) {
+                       // If the lsb of acmod is a 1, center channel is in use and cmixlev follows in the bit stream.
+                       $thisfile_ac3_raw_bsi['cmixlev'] = $this->readHeaderBSI(2);
+                       $thisfile_ac3['center_mix_level'] = self::centerMixLevelLookup($thisfile_ac3_raw_bsi['cmixlev']);
+               }
+
+               if ($thisfile_ac3_raw_bsi['acmod'] & 0x04) {
+                       // If the msb of acmod is a 1, surround channels are in use and surmixlev follows in the bit stream.
+                       $thisfile_ac3_raw_bsi['surmixlev'] = $this->readHeaderBSI(2);
+                       $thisfile_ac3['surround_mix_level'] = self::surroundMixLevelLookup($thisfile_ac3_raw_bsi['surmixlev']);
+               }
+
+               if ($thisfile_ac3_raw_bsi['acmod'] == 0x02) {
+                       // When operating in the two channel mode, this 2-bit code indicates whether or not the program has been encoded in Dolby Surround.
+                       $thisfile_ac3_raw_bsi['dsurmod'] = $this->readHeaderBSI(2);
+                       $thisfile_ac3['dolby_surround_mode'] = self::dolbySurroundModeLookup($thisfile_ac3_raw_bsi['dsurmod']);
+               }
+
+               $thisfile_ac3_raw_bsi['lfeon'] = (bool) $this->readHeaderBSI(1);
+               $thisfile_ac3['lfe_enabled'] = $thisfile_ac3_raw_bsi['lfeon'];
+               if ($thisfile_ac3_raw_bsi['lfeon']) {
+                       //$info['audio']['channels']++;
+                       $info['audio']['channels'] .= '.1';
+               }
+
+               $thisfile_ac3['channels_enabled'] = self::channelsEnabledLookup($thisfile_ac3_raw_bsi['acmod'], $thisfile_ac3_raw_bsi['lfeon']);
+
+               // This indicates how far the average dialogue level is below digital 100 percent. Valid values are 1-31.
+               // The value of 0 is reserved. The values of 1 to 31 are interpreted as -1 dB to -31 dB with respect to digital 100 percent.
+               $thisfile_ac3_raw_bsi['dialnorm'] = $this->readHeaderBSI(5);
+               $thisfile_ac3['dialogue_normalization'] = '-'.$thisfile_ac3_raw_bsi['dialnorm'].'dB';
+
+               $thisfile_ac3_raw_bsi['compre_flag'] = (bool) $this->readHeaderBSI(1);
+               if ($thisfile_ac3_raw_bsi['compre_flag']) {
+                       $thisfile_ac3_raw_bsi['compr'] = $this->readHeaderBSI(8);
+                       $thisfile_ac3['heavy_compression'] = self::heavyCompression($thisfile_ac3_raw_bsi['compr']);
+               }
+
+               $thisfile_ac3_raw_bsi['langcode_flag'] = (bool) $this->readHeaderBSI(1);
+               if ($thisfile_ac3_raw_bsi['langcode_flag']) {
+                       $thisfile_ac3_raw_bsi['langcod'] = $this->readHeaderBSI(8);
+               }
+
+               $thisfile_ac3_raw_bsi['audprodie'] = (bool) $this->readHeaderBSI(1);
+               if ($thisfile_ac3_raw_bsi['audprodie']) {
+                       $thisfile_ac3_raw_bsi['mixlevel'] = $this->readHeaderBSI(5);
+                       $thisfile_ac3_raw_bsi['roomtyp']  = $this->readHeaderBSI(2);
+
+                       $thisfile_ac3['mixing_level'] = (80 + $thisfile_ac3_raw_bsi['mixlevel']).'dB';
+                       $thisfile_ac3['room_type']    = self::roomTypeLookup($thisfile_ac3_raw_bsi['roomtyp']);
+               }
+
+               if ($thisfile_ac3_raw_bsi['acmod'] == 0x00) {
+                       // If acmod is 0, then two completely independent program channels (dual mono)
+                       // are encoded into the bit stream, and are referenced as Ch1, Ch2. In this case,
+                       // a number of additional items are present in BSI or audblk to fully describe Ch2.
+
+                       // This indicates how far the average dialogue level is below digital 100 percent. Valid values are 1-31.
+                       // The value of 0 is reserved. The values of 1 to 31 are interpreted as -1 dB to -31 dB with respect to digital 100 percent.
+                       $thisfile_ac3_raw_bsi['dialnorm2'] = $this->readHeaderBSI(5);
+                       $thisfile_ac3['dialogue_normalization2'] = '-'.$thisfile_ac3_raw_bsi['dialnorm2'].'dB';
+
+                       $thisfile_ac3_raw_bsi['compre_flag2'] = (bool) $this->readHeaderBSI(1);
+                       if ($thisfile_ac3_raw_bsi['compre_flag2']) {
+                               $thisfile_ac3_raw_bsi['compr2'] = $this->readHeaderBSI(8);
+                               $thisfile_ac3['heavy_compression2'] = self::heavyCompression($thisfile_ac3_raw_bsi['compr2']);
+                       }
+
+                       $thisfile_ac3_raw_bsi['langcode_flag2'] = (bool) $this->readHeaderBSI(1);
+                       if ($thisfile_ac3_raw_bsi['langcode_flag2']) {
+                               $thisfile_ac3_raw_bsi['langcod2'] = $this->readHeaderBSI(8);
+                       }
+
+                       $thisfile_ac3_raw_bsi['audprodie2'] = (bool) $this->readHeaderBSI(1);
+                       if ($thisfile_ac3_raw_bsi['audprodie2']) {
+                               $thisfile_ac3_raw_bsi['mixlevel2'] = $this->readHeaderBSI(5);
+                               $thisfile_ac3_raw_bsi['roomtyp2']  = $this->readHeaderBSI(2);
+
+                               $thisfile_ac3['mixing_level2'] = (80 + $thisfile_ac3_raw_bsi['mixlevel2']).'dB';
+                               $thisfile_ac3['room_type2']    = self::roomTypeLookup($thisfile_ac3_raw_bsi['roomtyp2']);
+                       }
+
+               }
+
+               $thisfile_ac3_raw_bsi['copyright'] = (bool) $this->readHeaderBSI(1);
+
+               $thisfile_ac3_raw_bsi['original']  = (bool) $this->readHeaderBSI(1);
+
+               $thisfile_ac3_raw_bsi['timecode1_flag'] = (bool) $this->readHeaderBSI(1);
+               if ($thisfile_ac3_raw_bsi['timecode1_flag']) {
+                       $thisfile_ac3_raw_bsi['timecode1'] = $this->readHeaderBSI(14);
+               }
+
+               $thisfile_ac3_raw_bsi['timecode2_flag'] = (bool) $this->readHeaderBSI(1);
+               if ($thisfile_ac3_raw_bsi['timecode2_flag']) {
+                       $thisfile_ac3_raw_bsi['timecode2'] = $this->readHeaderBSI(14);
+               }
+
+               $thisfile_ac3_raw_bsi['addbsi_flag'] = (bool) $this->readHeaderBSI(1);
+               if ($thisfile_ac3_raw_bsi['addbsi_flag']) {
+                       $thisfile_ac3_raw_bsi['addbsi_length'] = $this->readHeaderBSI(6);
+
+                       $this->AC3header['bsi'] .= getid3_lib::BigEndian2Bin($this->fread($thisfile_ac3_raw_bsi['addbsi_length']));
+
+                       $thisfile_ac3_raw_bsi['addbsi_data'] = substr($this->AC3header['bsi'], $this->BSIoffset, $thisfile_ac3_raw_bsi['addbsi_length'] * 8);
+                       $this->BSIoffset += $thisfile_ac3_raw_bsi['addbsi_length'] * 8;
+               }
+
+               return true;
+       }
+
+       private function readHeaderBSI($length) {
+               $data = substr($this->AC3header['bsi'], $this->BSIoffset, $length);
+               $this->BSIoffset += $length;
+
+               return bindec($data);
+       }
+
+       public static function sampleRateCodeLookup($fscod) {
+               static $sampleRateCodeLookup = array(
+                       0 => 48000,
+                       1 => 44100,
+                       2 => 32000,
+                       3 => 'reserved' // If the reserved code is indicated, the decoder should not attempt to decode audio and should mute.
+               );
+               return (isset($sampleRateCodeLookup[$fscod]) ? $sampleRateCodeLookup[$fscod] : false);
+       }
+
+       public static function serviceTypeLookup($bsmod, $acmod) {
+               static $serviceTypeLookup = array();
+               if (empty($serviceTypeLookup)) {
+                       for ($i = 0; $i <= 7; $i++) {
+                               $serviceTypeLookup[0][$i] = 'main audio service: complete main (CM)';
+                               $serviceTypeLookup[1][$i] = 'main audio service: music and effects (ME)';
+                               $serviceTypeLookup[2][$i] = 'associated service: visually impaired (VI)';
+                               $serviceTypeLookup[3][$i] = 'associated service: hearing impaired (HI)';
+                               $serviceTypeLookup[4][$i] = 'associated service: dialogue (D)';
+                               $serviceTypeLookup[5][$i] = 'associated service: commentary (C)';
+                               $serviceTypeLookup[6][$i] = 'associated service: emergency (E)';
+                       }
+
+                       $serviceTypeLookup[7][1]      = 'associated service: voice over (VO)';
+                       for ($i = 2; $i <= 7; $i++) {
+                               $serviceTypeLookup[7][$i] = 'main audio service: karaoke';
+                       }
+               }
+               return (isset($serviceTypeLookup[$bsmod][$acmod]) ? $serviceTypeLookup[$bsmod][$acmod] : false);
+       }
+
+       public static function audioCodingModeLookup($acmod) {
+               // array(channel configuration, # channels (not incl LFE), channel order)
+               static $audioCodingModeLookup = array (
+                       0 => array('channel_config'=>'1+1', 'num_channels'=>2, 'channel_order'=>'Ch1,Ch2'),
+                       1 => array('channel_config'=>'1/0', 'num_channels'=>1, 'channel_order'=>'C'),
+                       2 => array('channel_config'=>'2/0', 'num_channels'=>2, 'channel_order'=>'L,R'),
+                       3 => array('channel_config'=>'3/0', 'num_channels'=>3, 'channel_order'=>'L,C,R'),
+                       4 => array('channel_config'=>'2/1', 'num_channels'=>3, 'channel_order'=>'L,R,S'),
+                       5 => array('channel_config'=>'3/1', 'num_channels'=>4, 'channel_order'=>'L,C,R,S'),
+                       6 => array('channel_config'=>'2/2', 'num_channels'=>4, 'channel_order'=>'L,R,SL,SR'),
+                       7 => array('channel_config'=>'3/2', 'num_channels'=>5, 'channel_order'=>'L,C,R,SL,SR'),
+               );
+               return (isset($audioCodingModeLookup[$acmod]) ? $audioCodingModeLookup[$acmod] : false);
+       }
+
+       public static function centerMixLevelLookup($cmixlev) {
+               static $centerMixLevelLookup;
+               if (empty($centerMixLevelLookup)) {
+                       $centerMixLevelLookup = array(
+                               0 => pow(2, -3.0 / 6), // 0.707 (-3.0 dB)
+                               1 => pow(2, -4.5 / 6), // 0.595 (-4.5 dB)
+                               2 => pow(2, -6.0 / 6), // 0.500 (-6.0 dB)
+                               3 => 'reserved'
+                       );
+               }
+               return (isset($centerMixLevelLookup[$cmixlev]) ? $centerMixLevelLookup[$cmixlev] : false);
+       }
+
+       public static function surroundMixLevelLookup($surmixlev) {
+               static $surroundMixLevelLookup;
+               if (empty($surroundMixLevelLookup)) {
+                       $surroundMixLevelLookup = array(
+                               0 => pow(2, -3.0 / 6),
+                               1 => pow(2, -6.0 / 6),
+                               2 => 0,
+                               3 => 'reserved'
+                       );
+               }
+               return (isset($surroundMixLevelLookup[$surmixlev]) ? $surroundMixLevelLookup[$surmixlev] : false);
+       }
+
+       public static function dolbySurroundModeLookup($dsurmod) {
+               static $dolbySurroundModeLookup = array(
+                       0 => 'not indicated',
+                       1 => 'Not Dolby Surround encoded',
+                       2 => 'Dolby Surround encoded',
+                       3 => 'reserved'
+               );
+               return (isset($dolbySurroundModeLookup[$dsurmod]) ? $dolbySurroundModeLookup[$dsurmod] : false);
+       }
+
+       public static function channelsEnabledLookup($acmod, $lfeon) {
+               $lookup = array(
+                       'ch1'=>(bool) ($acmod == 0),
+                       'ch2'=>(bool) ($acmod == 0),
+                       'left'=>(bool) ($acmod > 1),
+                       'right'=>(bool) ($acmod > 1),
+                       'center'=>(bool) ($acmod & 0x01),
+                       'surround_mono'=>false,
+                       'surround_left'=>false,
+                       'surround_right'=>false,
+                       'lfe'=>$lfeon);
+               switch ($acmod) {
+                       case 4:
+                       case 5:
+                               $lookup['surround_mono']  = true;
+                               break;
+                       case 6:
+                       case 7:
+                               $lookup['surround_left']  = true;
+                               $lookup['surround_right'] = true;
+                               break;
+               }
+               return $lookup;
+       }
+
+       public static function heavyCompression($compre) {
+               // The first four bits indicate gain changes in 6.02dB increments which can be
+               // implemented with an arithmetic shift operation. The following four bits
+               // indicate linear gain changes, and require a 5-bit multiply.
+               // We will represent the two 4-bit fields of compr as follows:
+               //   X0 X1 X2 X3 . Y4 Y5 Y6 Y7
+               // The meaning of the X values is most simply described by considering X to represent a 4-bit
+               // signed integer with values from -8 to +7. The gain indicated by X is then (X + 1) * 6.02 dB. The
+               // following table shows this in detail.
+
+               // Meaning of 4 msb of compr
+               //  7    +48.16 dB
+               //  6    +42.14 dB
+               //  5    +36.12 dB
+               //  4    +30.10 dB
+               //  3    +24.08 dB
+               //  2    +18.06 dB
+               //  1    +12.04 dB
+               //  0     +6.02 dB
+               // -1         0 dB
+               // -2     -6.02 dB
+               // -3    -12.04 dB
+               // -4    -18.06 dB
+               // -5    -24.08 dB
+               // -6    -30.10 dB
+               // -7    -36.12 dB
+               // -8    -42.14 dB
+
+               $fourbit = str_pad(decbin(($compre & 0xF0) >> 4), 4, '0', STR_PAD_LEFT);
+               if ($fourbit{0} == '1') {
+                       $log_gain = -8 + bindec(substr($fourbit, 1));
+               } else {
+                       $log_gain = bindec(substr($fourbit, 1));
+               }
+               $log_gain = ($log_gain + 1) * getid3_lib::RGADamplitude2dB(2);
+
+               // The value of Y is a linear representation of a gain change of up to -6 dB. Y is considered to
+               // be an unsigned fractional integer, with a leading value of 1, or: 0.1 Y4 Y5 Y6 Y7 (base 2). Y can
+               // represent values between 0.111112 (or 31/32) and 0.100002 (or 1/2). Thus, Y can represent gain
+               // changes from -0.28 dB to -6.02 dB.
+
+               $lin_gain = (16 + ($compre & 0x0F)) / 32;
+
+               // The combination of X and Y values allows compr to indicate gain changes from
+               //  48.16 - 0.28 = +47.89 dB, to
+               // -42.14 - 6.02 = -48.16 dB.
+
+               return $log_gain - $lin_gain;
+       }
+
+       public static function roomTypeLookup($roomtyp) {
+               static $roomTypeLookup = array(
+                       0 => 'not indicated',
+                       1 => 'large room, X curve monitor',
+                       2 => 'small room, flat monitor',
+                       3 => 'reserved'
+               );
+               return (isset($roomTypeLookup[$roomtyp]) ? $roomTypeLookup[$roomtyp] : false);
+       }
+
+       public static function frameSizeLookup($frmsizecod, $fscod) {
+               $padding     = (bool) ($frmsizecod % 2);
+               $framesizeid =   floor($frmsizecod / 2);
+
+               static $frameSizeLookup = array();
+               if (empty($frameSizeLookup)) {
+                       $frameSizeLookup = array (
+                               0  => array(128, 138, 192),
+                               1  => array(40, 160, 174, 240),
+                               2  => array(48, 192, 208, 288),
+                               3  => array(56, 224, 242, 336),
+                               4  => array(64, 256, 278, 384),
+                               5  => array(80, 320, 348, 480),
+                               6  => array(96, 384, 416, 576),
+                               7  => array(112, 448, 486, 672),
+                               8  => array(128, 512, 556, 768),
+                               9  => array(160, 640, 696, 960),
+                               10 => array(192, 768, 834, 1152),
+                               11 => array(224, 896, 974, 1344),
+                               12 => array(256, 1024, 1114, 1536),
+                               13 => array(320, 1280, 1392, 1920),
+                               14 => array(384, 1536, 1670, 2304),
+                               15 => array(448, 1792, 1950, 2688),
+                               16 => array(512, 2048, 2228, 3072),
+                               17 => array(576, 2304, 2506, 3456),
+                               18 => array(640, 2560, 2786, 3840)
+                       );
+               }
+               if (($fscod == 1) && $padding) {
+                       // frame lengths are padded by 1 word (16 bits) at 44100
+                       $frameSizeLookup[$frmsizecod] += 2;
+               }
+               return (isset($frameSizeLookup[$framesizeid][$fscod]) ? $frameSizeLookup[$framesizeid][$fscod] : false);
+       }
+
+       public static function bitrateLookup($frmsizecod) {
+               $framesizeid =   floor($frmsizecod / 2);
+
+               static $bitrateLookup = array(
+                       0  => 32000,
+                       1  => 40000,
+                       2  => 48000,
+                       3  => 56000,
+                       4  => 64000,
+                       5  => 80000,
+                       6  => 96000,
+                       7  => 112000,
+                       8  => 128000,
+                       9  => 160000,
+                       10 => 192000,
+                       11 => 224000,
+                       12 => 256000,
+                       13 => 320000,
+                       14 => 384000,
+                       15 => 448000,
+                       16 => 512000,
+                       17 => 576000,
+                       18 => 640000
+               );
+               return (isset($bitrateLookup[$framesizeid]) ? $bitrateLookup[$framesizeid] : false);
+       }
+
+
+}
diff --git a/wp-includes/ID3/module.audio.dts.php b/wp-includes/ID3/module.audio.dts.php
new file mode 100644 (file)
index 0000000..79982cc
--- /dev/null
@@ -0,0 +1,290 @@
+<?php
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org>               //
+//  available at http://getid3.sourceforge.net                 //
+//            or http://www.getid3.org                         //
+/////////////////////////////////////////////////////////////////
+// See readme.txt for more details                             //
+/////////////////////////////////////////////////////////////////
+//                                                             //
+// module.audio.dts.php                                        //
+// module for analyzing DTS Audio files                        //
+// dependencies: NONE                                          //
+//                                                             //
+/////////////////////////////////////////////////////////////////
+
+
+/**
+* @tutorial http://wiki.multimedia.cx/index.php?title=DTS
+*/
+class getid3_dts extends getid3_handler
+{
+       /**
+       * Default DTS syncword used in native .cpt or .dts formats
+       */
+    const syncword = "\x7F\xFE\x80\x01";
+
+       private $readBinDataOffset = 0;
+
+    /**
+    * Possible syncwords indicating bitstream encoding
+    */
+    public static $syncwords = array(
+       0 => "\x7F\xFE\x80\x01",  // raw big-endian
+       1 => "\xFE\x7F\x01\x80",  // raw little-endian
+       2 => "\x1F\xFF\xE8\x00",  // 14-bit big-endian
+       3 => "\xFF\x1F\x00\xE8"); // 14-bit little-endian
+
+       public function Analyze() {
+               $info = &$this->getid3->info;
+               $info['fileformat'] = 'dts';
+
+               $this->fseek($info['avdataoffset']);
+               $DTSheader = $this->fread(20); // we only need 2 words magic + 6 words frame header, but these words may be normal 16-bit words OR 14-bit words with 2 highest bits set to zero, so 8 words can be either 8*16/8 = 16 bytes OR 8*16*(16/14)/8 = 18.3 bytes
+
+               // check syncword
+               $sync = substr($DTSheader, 0, 4);
+        if (($encoding = array_search($sync, self::$syncwords)) !== false) {
+
+               $info['dts']['raw']['magic'] = $sync;
+                       $this->readBinDataOffset = 32;
+
+        } elseif ($this->isDependencyFor('matroska')) {
+
+                       // Matroska contains DTS without syncword encoded as raw big-endian format
+                       $encoding = 0;
+                       $this->readBinDataOffset = 0;
+
+        } else {
+
+                       unset($info['fileformat']);
+                       return $this->error('Expecting "'.implode('| ', array_map('getid3_lib::PrintHexBytes', self::$syncwords)).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($sync).'"');
+
+               }
+
+               // decode header
+               $fhBS = '';
+               for ($word_offset = 0; $word_offset <= strlen($DTSheader); $word_offset += 2) {
+                       switch ($encoding) {
+                               case 0: // raw big-endian
+                                       $fhBS .=        getid3_lib::BigEndian2Bin(       substr($DTSheader, $word_offset, 2) );
+                                       break;
+                               case 1: // raw little-endian
+                                       $fhBS .=        getid3_lib::BigEndian2Bin(strrev(substr($DTSheader, $word_offset, 2)));
+                                       break;
+                               case 2: // 14-bit big-endian
+                                       $fhBS .= substr(getid3_lib::BigEndian2Bin(       substr($DTSheader, $word_offset, 2) ), 2, 14);
+                                       break;
+                               case 3: // 14-bit little-endian
+                                       $fhBS .= substr(getid3_lib::BigEndian2Bin(strrev(substr($DTSheader, $word_offset, 2))), 2, 14);
+                                       break;
+                       }
+               }
+
+               $info['dts']['raw']['frame_type']             =        $this->readBinData($fhBS,  1);
+               $info['dts']['raw']['deficit_samples']        =        $this->readBinData($fhBS,  5);
+               $info['dts']['flags']['crc_present']          = (bool) $this->readBinData($fhBS,  1);
+               $info['dts']['raw']['pcm_sample_blocks']      =        $this->readBinData($fhBS,  7);
+               $info['dts']['raw']['frame_byte_size']        =        $this->readBinData($fhBS, 14);
+               $info['dts']['raw']['channel_arrangement']    =        $this->readBinData($fhBS,  6);
+               $info['dts']['raw']['sample_frequency']       =        $this->readBinData($fhBS,  4);
+               $info['dts']['raw']['bitrate']                =        $this->readBinData($fhBS,  5);
+               $info['dts']['flags']['embedded_downmix']     = (bool) $this->readBinData($fhBS,  1);
+               $info['dts']['flags']['dynamicrange']         = (bool) $this->readBinData($fhBS,  1);
+               $info['dts']['flags']['timestamp']            = (bool) $this->readBinData($fhBS,  1);
+               $info['dts']['flags']['auxdata']              = (bool) $this->readBinData($fhBS,  1);
+               $info['dts']['flags']['hdcd']                 = (bool) $this->readBinData($fhBS,  1);
+               $info['dts']['raw']['extension_audio']        =        $this->readBinData($fhBS,  3);
+               $info['dts']['flags']['extended_coding']      = (bool) $this->readBinData($fhBS,  1);
+               $info['dts']['flags']['audio_sync_insertion'] = (bool) $this->readBinData($fhBS,  1);
+               $info['dts']['raw']['lfe_effects']            =        $this->readBinData($fhBS,  2);
+               $info['dts']['flags']['predictor_history']    = (bool) $this->readBinData($fhBS,  1);
+               if ($info['dts']['flags']['crc_present']) {
+                       $info['dts']['raw']['crc16']              =        $this->readBinData($fhBS, 16);
+               }
+               $info['dts']['flags']['mri_perfect_reconst']  = (bool) $this->readBinData($fhBS,  1);
+               $info['dts']['raw']['encoder_soft_version']   =        $this->readBinData($fhBS,  4);
+               $info['dts']['raw']['copy_history']           =        $this->readBinData($fhBS,  2);
+               $info['dts']['raw']['bits_per_sample']        =        $this->readBinData($fhBS,  2);
+               $info['dts']['flags']['surround_es']          = (bool) $this->readBinData($fhBS,  1);
+               $info['dts']['flags']['front_sum_diff']       = (bool) $this->readBinData($fhBS,  1);
+               $info['dts']['flags']['surround_sum_diff']    = (bool) $this->readBinData($fhBS,  1);
+               $info['dts']['raw']['dialog_normalization']   =        $this->readBinData($fhBS,  4);
+
+
+               $info['dts']['bitrate']              = self::bitrateLookup($info['dts']['raw']['bitrate']);
+               $info['dts']['bits_per_sample']      = self::bitPerSampleLookup($info['dts']['raw']['bits_per_sample']);
+               $info['dts']['sample_rate']          = self::sampleRateLookup($info['dts']['raw']['sample_frequency']);
+               $info['dts']['dialog_normalization'] = self::dialogNormalization($info['dts']['raw']['dialog_normalization'], $info['dts']['raw']['encoder_soft_version']);
+               $info['dts']['flags']['lossless']    = (($info['dts']['raw']['bitrate'] == 31) ? true  : false);
+               $info['dts']['bitrate_mode']         = (($info['dts']['raw']['bitrate'] == 30) ? 'vbr' : 'cbr');
+               $info['dts']['channels']             = self::numChannelsLookup($info['dts']['raw']['channel_arrangement']);
+               $info['dts']['channel_arrangement']  = self::channelArrangementLookup($info['dts']['raw']['channel_arrangement']);
+
+               $info['audio']['dataformat']          = 'dts';
+               $info['audio']['lossless']            = $info['dts']['flags']['lossless'];
+               $info['audio']['bitrate_mode']        = $info['dts']['bitrate_mode'];
+               $info['audio']['bits_per_sample']     = $info['dts']['bits_per_sample'];
+               $info['audio']['sample_rate']         = $info['dts']['sample_rate'];
+               $info['audio']['channels']            = $info['dts']['channels'];
+               $info['audio']['bitrate']             = $info['dts']['bitrate'];
+               if (isset($info['avdataend']) && !empty($info['dts']['bitrate']) && is_numeric($info['dts']['bitrate'])) {
+                       $info['playtime_seconds']         = ($info['avdataend'] - $info['avdataoffset']) / ($info['dts']['bitrate'] / 8);
+                       if (($encoding == 2) || ($encoding == 3)) {
+                               // 14-bit data packed into 16-bit words, so the playtime is wrong because only (14/16) of the bytes in the data portion of the file are used at the specified bitrate
+                               $info['playtime_seconds'] *= (14 / 16);
+                       }
+               }
+               return true;
+       }
+
+       private function readBinData($bin, $length) {
+               $data = substr($bin, $this->readBinDataOffset, $length);
+               $this->readBinDataOffset += $length;
+
+               return bindec($data);
+       }
+
+       public static function bitrateLookup($index) {
+               static $lookup = array(
+                       0  => 32000,
+                       1  => 56000,
+                       2  => 64000,
+                       3  => 96000,
+                       4  => 112000,
+                       5  => 128000,
+                       6  => 192000,
+                       7  => 224000,
+                       8  => 256000,
+                       9  => 320000,
+                       10 => 384000,
+                       11 => 448000,
+                       12 => 512000,
+                       13 => 576000,
+                       14 => 640000,
+                       15 => 768000,
+                       16 => 960000,
+                       17 => 1024000,
+                       18 => 1152000,
+                       19 => 1280000,
+                       20 => 1344000,
+                       21 => 1408000,
+                       22 => 1411200,
+                       23 => 1472000,
+                       24 => 1536000,
+                       25 => 1920000,
+                       26 => 2048000,
+                       27 => 3072000,
+                       28 => 3840000,
+                       29 => 'open',
+                       30 => 'variable',
+                       31 => 'lossless',
+               );
+               return (isset($lookup[$index]) ? $lookup[$index] : false);
+       }
+
+       public static function sampleRateLookup($index) {
+               static $lookup = array(
+                       0  => 'invalid',
+                       1  => 8000,
+                       2  => 16000,
+                       3  => 32000,
+                       4  => 'invalid',
+                       5  => 'invalid',
+                       6  => 11025,
+                       7  => 22050,
+                       8  => 44100,
+                       9  => 'invalid',
+                       10 => 'invalid',
+                       11 => 12000,
+                       12 => 24000,
+                       13 => 48000,
+                       14 => 'invalid',
+                       15 => 'invalid',
+               );
+               return (isset($lookup[$index]) ? $lookup[$index] : false);
+       }
+
+       public static function bitPerSampleLookup($index) {
+               static $lookup = array(
+                       0  => 16,
+                       1  => 20,
+                       2  => 24,
+                       3  => 24,
+               );
+               return (isset($lookup[$index]) ? $lookup[$index] : false);
+       }
+
+       public static function numChannelsLookup($index) {
+               switch ($index) {
+                       case 0:
+                               return 1;
+                               break;
+                       case 1:
+                       case 2:
+                       case 3:
+                       case 4:
+                               return 2;
+                               break;
+                       case 5:
+                       case 6:
+                               return 3;
+                               break;
+                       case 7:
+                       case 8:
+                               return 4;
+                               break;
+                       case 9:
+                               return 5;
+                               break;
+                       case 10:
+                       case 11:
+                       case 12:
+                               return 6;
+                               break;
+                       case 13:
+                               return 7;
+                               break;
+                       case 14:
+                       case 15:
+                               return 8;
+                               break;
+               }
+               return false;
+       }
+
+       public static function channelArrangementLookup($index) {
+               static $lookup = array(
+                       0  => 'A',
+                       1  => 'A + B (dual mono)',
+                       2  => 'L + R (stereo)',
+                       3  => '(L+R) + (L-R) (sum-difference)',
+                       4  => 'LT + RT (left and right total)',
+                       5  => 'C + L + R',
+                       6  => 'L + R + S',
+                       7  => 'C + L + R + S',
+                       8  => 'L + R + SL + SR',
+                       9  => 'C + L + R + SL + SR',
+                       10 => 'CL + CR + L + R + SL + SR',
+                       11 => 'C + L + R+ LR + RR + OV',
+                       12 => 'CF + CR + LF + RF + LR + RR',
+                       13 => 'CL + C + CR + L + R + SL + SR',
+                       14 => 'CL + CR + L + R + SL1 + SL2 + SR1 + SR2',
+                       15 => 'CL + C+ CR + L + R + SL + S + SR',
+               );
+               return (isset($lookup[$index]) ? $lookup[$index] : 'user-defined');
+       }
+
+       public static function dialogNormalization($index, $version) {
+               switch ($version) {
+                       case 7:
+                               return 0 - $index;
+                               break;
+                       case 6:
+                               return 0 - 16 - $index;
+                               break;
+               }
+               return false;
+       }
+
+}
diff --git a/wp-includes/ID3/module.audio.flac.php b/wp-includes/ID3/module.audio.flac.php
new file mode 100644 (file)
index 0000000..6b9598c
--- /dev/null
@@ -0,0 +1,442 @@
+<?php
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org>               //
+//  available at http://getid3.sourceforge.net                 //
+//            or http://www.getid3.org                         //
+/////////////////////////////////////////////////////////////////
+// See readme.txt for more details                             //
+/////////////////////////////////////////////////////////////////
+//                                                             //
+// module.audio.flac.php                                       //
+// module for analyzing FLAC and OggFLAC audio files           //
+// dependencies: module.audio.ogg.php                          //
+//                                                            ///
+/////////////////////////////////////////////////////////////////
+
+
+getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ogg.php', __FILE__, true);
+
+/**
+* @tutorial http://flac.sourceforge.net/format.html
+*/
+class getid3_flac extends getid3_handler
+{
+       const syncword = 'fLaC';
+
+       public function Analyze() {
+               $info = &$this->getid3->info;
+
+               $this->fseek($info['avdataoffset']);
+               $StreamMarker = $this->fread(4);
+               if ($StreamMarker != self::syncword) {
+                       return $this->error('Expecting "'.getid3_lib::PrintHexBytes(self::syncword).'" at offset '.$info['avdataoffset'].', found "'.getid3_lib::PrintHexBytes($StreamMarker).'"');
+               }
+               $info['fileformat']            = 'flac';
+               $info['audio']['dataformat']   = 'flac';
+               $info['audio']['bitrate_mode'] = 'vbr';
+               $info['audio']['lossless']     = true;
+
+               // parse flac container
+               return $this->parseMETAdata();
+       }
+
+       public function parseMETAdata() {
+               $info = &$this->getid3->info;
+               do {
+                       $BlockOffset   = $this->ftell();
+                       $BlockHeader   = $this->fread(4);
+                       $LBFBT         = getid3_lib::BigEndian2Int(substr($BlockHeader, 0, 1));
+                       $LastBlockFlag = (bool) ($LBFBT & 0x80);
+                       $BlockType     =        ($LBFBT & 0x7F);
+                       $BlockLength   = getid3_lib::BigEndian2Int(substr($BlockHeader, 1, 3));
+                       $BlockTypeText = self::metaBlockTypeLookup($BlockType);
+
+                       if (($BlockOffset + 4 + $BlockLength) > $info['avdataend']) {
+                               $this->error('METADATA_BLOCK_HEADER.BLOCK_TYPE ('.$BlockTypeText.') at offset '.$BlockOffset.' extends beyond end of file');
+                               break;
+                       }
+                       if ($BlockLength < 1) {
+                               $this->error('METADATA_BLOCK_HEADER.BLOCK_LENGTH ('.$BlockLength.') at offset '.$BlockOffset.' is invalid');
+                               break;
+                       }
+
+                       $info['flac'][$BlockTypeText]['raw'] = array();
+                       $BlockTypeText_raw = &$info['flac'][$BlockTypeText]['raw'];
+
+                       $BlockTypeText_raw['offset']          = $BlockOffset;
+                       $BlockTypeText_raw['last_meta_block'] = $LastBlockFlag;
+                       $BlockTypeText_raw['block_type']      = $BlockType;
+                       $BlockTypeText_raw['block_type_text'] = $BlockTypeText;
+                       $BlockTypeText_raw['block_length']    = $BlockLength;
+                       if ($BlockTypeText_raw['block_type'] != 0x06) { // do not read attachment data automatically
+                               $BlockTypeText_raw['block_data']  = $this->fread($BlockLength);
+                       }
+
+                       switch ($BlockTypeText) {
+                               case 'STREAMINFO':     // 0x00
+                                       if (!$this->parseSTREAMINFO($BlockTypeText_raw['block_data'])) {
+                                               return false;
+                                       }
+                                       break;
+
+                               case 'PADDING':        // 0x01
+                                       unset($info['flac']['PADDING']); // ignore
+                                       break;
+
+                               case 'APPLICATION':    // 0x02
+                                       if (!$this->parseAPPLICATION($BlockTypeText_raw['block_data'])) {
+                                               return false;
+                                       }
+                                       break;
+
+                               case 'SEEKTABLE':      // 0x03
+                                       if (!$this->parseSEEKTABLE($BlockTypeText_raw['block_data'])) {
+                                               return false;
+                                       }
+                                       break;
+
+                               case 'VORBIS_COMMENT': // 0x04
+                                       if (!$this->parseVORBIS_COMMENT($BlockTypeText_raw['block_data'])) {
+                                               return false;
+                                       }
+                                       break;
+
+                               case 'CUESHEET':       // 0x05
+                                       if (!$this->parseCUESHEET($BlockTypeText_raw['block_data'])) {
+                                               return false;
+                                       }
+                                       break;
+
+                               case 'PICTURE':        // 0x06
+                                       if (!$this->parsePICTURE()) {
+                                               return false;
+                                       }
+                                       break;
+
+                               default:
+                                       $this->warning('Unhandled METADATA_BLOCK_HEADER.BLOCK_TYPE ('.$BlockType.') at offset '.$BlockOffset);
+                       }
+
+                       unset($info['flac'][$BlockTypeText]['raw']);
+                       $info['avdataoffset'] = $this->ftell();
+               }
+               while ($LastBlockFlag === false);
+
+               // handle tags
+               if (!empty($info['flac']['VORBIS_COMMENT']['comments'])) {
+                       $info['flac']['comments'] = $info['flac']['VORBIS_COMMENT']['comments'];
+               }
+               if (!empty($info['flac']['VORBIS_COMMENT']['vendor'])) {
+                       $info['audio']['encoder'] = str_replace('reference ', '', $info['flac']['VORBIS_COMMENT']['vendor']);
+               }
+
+               // copy attachments to 'comments' array if nesesary
+               if (isset($info['flac']['PICTURE']) && ($this->getid3->option_save_attachments !== getID3::ATTACHMENTS_NONE)) {
+                       foreach ($info['flac']['PICTURE'] as $entry) {
+                               if (!empty($entry['data'])) {
+                                       $info['flac']['comments']['picture'][] = array('image_mime'=>$entry['image_mime'], 'data'=>$entry['data']);
+                               }
+                       }
+               }
+
+               if (isset($info['flac']['STREAMINFO'])) {
+                       if (!$this->isDependencyFor('matroska')) {
+                               $info['flac']['compressed_audio_bytes'] = $info['avdataend'] - $info['avdataoffset'];
+                       }
+                       $info['flac']['uncompressed_audio_bytes'] = $info['flac']['STREAMINFO']['samples_stream'] * $info['flac']['STREAMINFO']['channels'] * ($info['flac']['STREAMINFO']['bits_per_sample'] / 8);
+                       if ($info['flac']['uncompressed_audio_bytes'] == 0) {
+                               return $this->error('Corrupt FLAC file: uncompressed_audio_bytes == zero');
+                       }
+                       if (!empty($info['flac']['compressed_audio_bytes'])) {
+                               $info['flac']['compression_ratio'] = $info['flac']['compressed_audio_bytes'] / $info['flac']['uncompressed_audio_bytes'];
+                       }
+               }
+
+               // set md5_data_source - built into flac 0.5+
+               if (isset($info['flac']['STREAMINFO']['audio_signature'])) {
+
+                       if ($info['flac']['STREAMINFO']['audio_signature'] === str_repeat("\x00", 16)) {
+                $this->warning('FLAC STREAMINFO.audio_signature is null (known issue with libOggFLAC)');
+                       }
+                       else {
+                               $info['md5_data_source'] = '';
+                               $md5 = $info['flac']['STREAMINFO']['audio_signature'];
+                               for ($i = 0; $i < strlen($md5); $i++) {
+                                       $info['md5_data_source'] .= str_pad(dechex(ord($md5[$i])), 2, '00', STR_PAD_LEFT);
+                               }
+                               if (!preg_match('/^[0-9a-f]{32}$/', $info['md5_data_source'])) {
+                                       unset($info['md5_data_source']);
+                               }
+                       }
+               }
+
+               if (isset($info['flac']['STREAMINFO']['bits_per_sample'])) {
+                       $info['audio']['bits_per_sample'] = $info['flac']['STREAMINFO']['bits_per_sample'];
+                       if ($info['audio']['bits_per_sample'] == 8) {
+                               // special case
+                               // must invert sign bit on all data bytes before MD5'ing to match FLAC's calculated value
+                               // MD5sum calculates on unsigned bytes, but FLAC calculated MD5 on 8-bit audio data as signed
+                               $this->warning('FLAC calculates MD5 data strangely on 8-bit audio, so the stored md5_data_source value will not match the decoded WAV file');
+                       }
+               }
+
+               return true;
+       }
+
+       private function parseSTREAMINFO($BlockData) {
+               $info = &$this->getid3->info;
+
+               $info['flac']['STREAMINFO'] = array();
+               $streaminfo = &$info['flac']['STREAMINFO'];
+
+               $streaminfo['min_block_size']  = getid3_lib::BigEndian2Int(substr($BlockData, 0, 2));
+               $streaminfo['max_block_size']  = getid3_lib::BigEndian2Int(substr($BlockData, 2, 2));
+               $streaminfo['min_frame_size']  = getid3_lib::BigEndian2Int(substr($BlockData, 4, 3));
+               $streaminfo['max_frame_size']  = getid3_lib::BigEndian2Int(substr($BlockData, 7, 3));
+
+               $SRCSBSS                       = getid3_lib::BigEndian2Bin(substr($BlockData, 10, 8));
+               $streaminfo['sample_rate']     = getid3_lib::Bin2Dec(substr($SRCSBSS,  0, 20));
+               $streaminfo['channels']        = getid3_lib::Bin2Dec(substr($SRCSBSS, 20,  3)) + 1;
+               $streaminfo['bits_per_sample'] = getid3_lib::Bin2Dec(substr($SRCSBSS, 23,  5)) + 1;
+               $streaminfo['samples_stream']  = getid3_lib::Bin2Dec(substr($SRCSBSS, 28, 36));
+
+               $streaminfo['audio_signature'] = substr($BlockData, 18, 16);
+
+               if (!empty($streaminfo['sample_rate'])) {
+
+                       $info['audio']['bitrate_mode']    = 'vbr';
+                       $info['audio']['sample_rate']     = $streaminfo['sample_rate'];
+                       $info['audio']['channels']        = $streaminfo['channels'];
+                       $info['audio']['bits_per_sample'] = $streaminfo['bits_per_sample'];
+                       $info['playtime_seconds']         = $streaminfo['samples_stream'] / $streaminfo['sample_rate'];
+                       if ($info['playtime_seconds'] > 0) {
+                               if (!$this->isDependencyFor('matroska')) {
+                                       $info['audio']['bitrate'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / $info['playtime_seconds'];
+                               }
+                               else {
+                                       $this->warning('Cannot determine audio bitrate because total stream size is unknown');
+                               }
+                       }
+
+               } else {
+                       return $this->error('Corrupt METAdata block: STREAMINFO');
+               }
+
+               return true;
+       }
+
+       private function parseAPPLICATION($BlockData) {
+               $info = &$this->getid3->info;
+
+               $ApplicationID = getid3_lib::BigEndian2Int(substr($BlockData, 0, 4));
+               $info['flac']['APPLICATION'][$ApplicationID]['name'] = self::applicationIDLookup($ApplicationID);
+               $info['flac']['APPLICATION'][$ApplicationID]['data'] = substr($BlockData, 4);
+
+               return true;
+       }
+
+       private function parseSEEKTABLE($BlockData) {
+               $info = &$this->getid3->info;
+
+               $offset = 0;
+               $BlockLength = strlen($BlockData);
+               $placeholderpattern = str_repeat("\xFF", 8);
+               while ($offset < $BlockLength) {
+                       $SampleNumberString = substr($BlockData, $offset, 8);
+                       $offset += 8;
+                       if ($SampleNumberString == $placeholderpattern) {
+
+                               // placeholder point
+                               getid3_lib::safe_inc($info['flac']['SEEKTABLE']['placeholders'], 1);
+                               $offset += 10;
+
+                       } else {
+
+                               $SampleNumber                                        = getid3_lib::BigEndian2Int($SampleNumberString);
+                               $info['flac']['SEEKTABLE'][$SampleNumber]['offset']  = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8));
+                               $offset += 8;
+                               $info['flac']['SEEKTABLE'][$SampleNumber]['samples'] = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 2));
+                               $offset += 2;
+
+                       }
+               }
+
+               return true;
+       }
+
+       private function parseVORBIS_COMMENT($BlockData) {
+               $info = &$this->getid3->info;
+
+               $getid3_ogg = new getid3_ogg($this->getid3);
+               if ($this->isDependencyFor('matroska')) {
+                       $getid3_ogg->setStringMode($this->data_string);
+               }
+               $getid3_ogg->ParseVorbisComments();
+               if (isset($info['ogg'])) {
+                       unset($info['ogg']['comments_raw']);
+                       $info['flac']['VORBIS_COMMENT'] = $info['ogg'];
+                       unset($info['ogg']);
+               }
+
+               unset($getid3_ogg);
+
+               return true;
+       }
+
+       private function parseCUESHEET($BlockData) {
+               $info = &$this->getid3->info;
+               $offset = 0;
+               $info['flac']['CUESHEET']['media_catalog_number'] =                              trim(substr($BlockData, $offset, 128), "\0");
+               $offset += 128;
+               $info['flac']['CUESHEET']['lead_in_samples']      =         getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8));
+               $offset += 8;
+               $info['flac']['CUESHEET']['flags']['is_cd']       = (bool) (getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1)) & 0x80);
+               $offset += 1;
+
+               $offset += 258; // reserved
+
+               $info['flac']['CUESHEET']['number_tracks']        =         getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1));
+               $offset += 1;
+
+               for ($track = 0; $track < $info['flac']['CUESHEET']['number_tracks']; $track++) {
+                       $TrackSampleOffset = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8));
+                       $offset += 8;
+                       $TrackNumber       = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1));
+                       $offset += 1;
+
+                       $info['flac']['CUESHEET']['tracks'][$TrackNumber]['sample_offset']         = $TrackSampleOffset;
+
+                       $info['flac']['CUESHEET']['tracks'][$TrackNumber]['isrc']                  =                           substr($BlockData, $offset, 12);
+                       $offset += 12;
+
+                       $TrackFlagsRaw                                                             = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1));
+                       $offset += 1;
+                       $info['flac']['CUESHEET']['tracks'][$TrackNumber]['flags']['is_audio']     = (bool) ($TrackFlagsRaw & 0x80);
+                       $info['flac']['CUESHEET']['tracks'][$TrackNumber]['flags']['pre_emphasis'] = (bool) ($TrackFlagsRaw & 0x40);
+
+                       $offset += 13; // reserved
+
+                       $info['flac']['CUESHEET']['tracks'][$TrackNumber]['index_points']          = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1));
+                       $offset += 1;
+
+                       for ($index = 0; $index < $info['flac']['CUESHEET']['tracks'][$TrackNumber]['index_points']; $index++) {
+                               $IndexSampleOffset = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 8));
+                               $offset += 8;
+                               $IndexNumber       = getid3_lib::BigEndian2Int(substr($BlockData, $offset, 1));
+                               $offset += 1;
+
+                               $offset += 3; // reserved
+
+                               $info['flac']['CUESHEET']['tracks'][$TrackNumber]['indexes'][$IndexNumber] = $IndexSampleOffset;
+                       }
+               }
+
+               return true;
+       }
+
+       /**
+       * Parse METADATA_BLOCK_PICTURE flac structure and extract attachment
+       * External usage: audio.ogg
+       */
+       public function parsePICTURE() {
+               $info = &$this->getid3->info;
+
+               $picture['typeid']         = getid3_lib::BigEndian2Int($this->fread(4));
+               $picture['type']           = self::pictureTypeLookup($picture['typeid']);
+               $picture['image_mime']     = $this->fread(getid3_lib::BigEndian2Int($this->fread(4)));
+               $descr_length              = getid3_lib::BigEndian2Int($this->fread(4));
+               if ($descr_length) {
+                       $picture['description'] = $this->fread($descr_length);
+               }
+               $picture['width']          = getid3_lib::BigEndian2Int($this->fread(4));
+               $picture['height']         = getid3_lib::BigEndian2Int($this->fread(4));
+               $picture['color_depth']    = getid3_lib::BigEndian2Int($this->fread(4));
+               $picture['colors_indexed'] = getid3_lib::BigEndian2Int($this->fread(4));
+               $data_length               = getid3_lib::BigEndian2Int($this->fread(4));
+
+               if ($picture['image_mime'] == '-->') {
+                       $picture['data'] = $this->fread($data_length);
+               } else {
+                       $picture['data'] = $this->saveAttachment(
+                               str_replace('/', '_', $picture['type']).'_'.$this->ftell(),
+                               $this->ftell(),
+                               $data_length,
+                               $picture['image_mime']);
+               }
+
+               $info['flac']['PICTURE'][] = $picture;
+
+               return true;
+       }
+
+       public static function metaBlockTypeLookup($blocktype) {
+               static $lookup = array(
+                       0 => 'STREAMINFO',
+                       1 => 'PADDING',
+                       2 => 'APPLICATION',
+                       3 => 'SEEKTABLE',
+                       4 => 'VORBIS_COMMENT',
+                       5 => 'CUESHEET',
+                       6 => 'PICTURE',
+               );
+               return (isset($lookup[$blocktype]) ? $lookup[$blocktype] : 'reserved');
+       }
+
+       public static function applicationIDLookup($applicationid) {
+               // http://flac.sourceforge.net/id.html
+               static $lookup = array(
+                       0x41544348 => 'FlacFile',                                                                           // "ATCH"
+                       0x42534F4C => 'beSolo',                                                                             // "BSOL"
+                       0x42554753 => 'Bugs Player',                                                                        // "BUGS"
+                       0x43756573 => 'GoldWave cue points (specification)',                                                // "Cues"
+                       0x46696361 => 'CUE Splitter',                                                                       // "Fica"
+                       0x46746F6C => 'flac-tools',                                                                         // "Ftol"
+                       0x4D4F5442 => 'MOTB MetaCzar',                                                                      // "MOTB"
+                       0x4D505345 => 'MP3 Stream Editor',                                                                  // "MPSE"
+                       0x4D754D4C => 'MusicML: Music Metadata Language',                                                   // "MuML"
+                       0x52494646 => 'Sound Devices RIFF chunk storage',                                                   // "RIFF"
+                       0x5346464C => 'Sound Font FLAC',                                                                    // "SFFL"
+                       0x534F4E59 => 'Sony Creative Software',                                                             // "SONY"
+                       0x5351455A => 'flacsqueeze',                                                                        // "SQEZ"
+                       0x54745776 => 'TwistedWave',                                                                        // "TtWv"
+                       0x55495453 => 'UITS Embedding tools',                                                               // "UITS"
+                       0x61696666 => 'FLAC AIFF chunk storage',                                                            // "aiff"
+                       0x696D6167 => 'flac-image application for storing arbitrary files in APPLICATION metadata blocks',  // "imag"
+                       0x7065656D => 'Parseable Embedded Extensible Metadata (specification)',                             // "peem"
+                       0x71667374 => 'QFLAC Studio',                                                                       // "qfst"
+                       0x72696666 => 'FLAC RIFF chunk storage',                                                            // "riff"
+                       0x74756E65 => 'TagTuner',                                                                           // "tune"
+                       0x78626174 => 'XBAT',                                                                               // "xbat"
+                       0x786D6364 => 'xmcd',                                                                               // "xmcd"
+               );
+               return (isset($lookup[$applicationid]) ? $lookup[$applicationid] : 'reserved');
+       }
+
+       public static function pictureTypeLookup($type_id) {
+               static $lookup = array (
+                        0 => 'Other',
+                        1 => '32x32 pixels \'file icon\' (PNG only)',
+                        2 => 'Other file icon',
+                        3 => 'Cover (front)',
+                        4 => 'Cover (back)',
+                        5 => 'Leaflet page',
+                        6 => 'Media (e.g. label side of CD)',
+                        7 => 'Lead artist/lead performer/soloist',
+                        8 => 'Artist/performer',
+                        9 => 'Conductor',
+                       10 => 'Band/Orchestra',
+                       11 => 'Composer',
+                       12 => 'Lyricist/text writer',
+                       13 => 'Recording Location',
+                       14 => 'During recording',
+                       15 => 'During performance',
+                       16 => 'Movie/video screen capture',
+                       17 => 'A bright coloured fish',
+                       18 => 'Illustration',
+                       19 => 'Band/artist logotype',
+                       20 => 'Publisher/Studio logotype',
+               );
+               return (isset($lookup[$type_id]) ? $lookup[$type_id] : 'reserved');
+       }
+
+}
diff --git a/wp-includes/ID3/module.audio.mp3.php b/wp-includes/ID3/module.audio.mp3.php
new file mode 100644 (file)
index 0000000..e6ffea9
--- /dev/null
@@ -0,0 +1,2009 @@
+<?php
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org>               //
+//  available at http://getid3.sourceforge.net                 //
+//            or http://www.getid3.org                         //
+/////////////////////////////////////////////////////////////////
+// See readme.txt for more details                             //
+/////////////////////////////////////////////////////////////////
+//                                                             //
+// module.audio.mp3.php                                        //
+// module for analyzing MP3 files                              //
+// dependencies: NONE                                          //
+//                                                            ///
+/////////////////////////////////////////////////////////////////
+
+
+// number of frames to scan to determine if MPEG-audio sequence is valid
+// Lower this number to 5-20 for faster scanning
+// Increase this number to 50+ for most accurate detection of valid VBR/CBR
+// mpeg-audio streams
+define('GETID3_MP3_VALID_CHECK_FRAMES', 35);
+
+
+class getid3_mp3 extends getid3_handler
+{
+
+       public $allow_bruteforce = false; // forces getID3() to scan the file byte-by-byte and log all the valid audio frame headers - extremely slow, unrecommended, but may provide data from otherwise-unusuable files
+
+       public function Analyze() {
+               $info = &$this->getid3->info;
+
+               $initialOffset = $info['avdataoffset'];
+
+               if (!$this->getOnlyMPEGaudioInfo($info['avdataoffset'])) {
+                       if ($this->allow_bruteforce) {
+                               $info['error'][] = 'Rescanning file in BruteForce mode';
+                               $this->getOnlyMPEGaudioInfoBruteForce($this->getid3->fp, $info);
+                       }
+               }
+
+
+               if (isset($info['mpeg']['audio']['bitrate_mode'])) {
+                       $info['audio']['bitrate_mode'] = strtolower($info['mpeg']['audio']['bitrate_mode']);
+               }
+
+               if (((isset($info['id3v2']['headerlength']) && ($info['avdataoffset'] > $info['id3v2']['headerlength'])) || (!isset($info['id3v2']) && ($info['avdataoffset'] > 0) && ($info['avdataoffset'] != $initialOffset)))) {
+
+                       $synchoffsetwarning = 'Unknown data before synch ';
+                       if (isset($info['id3v2']['headerlength'])) {
+                               $synchoffsetwarning .= '(ID3v2 header ends at '.$info['id3v2']['headerlength'].', then '.($info['avdataoffset'] - $info['id3v2']['headerlength']).' bytes garbage, ';
+                       } elseif ($initialOffset > 0) {
+                               $synchoffsetwarning .= '(should be at '.$initialOffset.', ';
+                       } else {
+                               $synchoffsetwarning .= '(should be at beginning of file, ';
+                       }
+                       $synchoffsetwarning .= 'synch detected at '.$info['avdataoffset'].')';
+                       if (isset($info['audio']['bitrate_mode']) && ($info['audio']['bitrate_mode'] == 'cbr')) {
+
+                               if (!empty($info['id3v2']['headerlength']) && (($info['avdataoffset'] - $info['id3v2']['headerlength']) == $info['mpeg']['audio']['framelength'])) {
+
+                                       $synchoffsetwarning .= '. This is a known problem with some versions of LAME (3.90-3.92) DLL in CBR mode.';
+                                       $info['audio']['codec'] = 'LAME';
+                                       $CurrentDataLAMEversionString = 'LAME3.';
+
+                               } elseif (empty($info['id3v2']['headerlength']) && ($info['avdataoffset'] == $info['mpeg']['audio']['framelength'])) {
+
+                                       $synchoffsetwarning .= '. This is a known problem with some versions of LAME (3.90 - 3.92) DLL in CBR mode.';
+                                       $info['audio']['codec'] = 'LAME';
+                                       $CurrentDataLAMEversionString = 'LAME3.';
+
+                               }
+
+                       }
+                       $info['warning'][] = $synchoffsetwarning;
+
+               }
+
+               if (isset($info['mpeg']['audio']['LAME'])) {
+                       $info['audio']['codec'] = 'LAME';
+                       if (!empty($info['mpeg']['audio']['LAME']['long_version'])) {
+                               $info['audio']['encoder'] = rtrim($info['mpeg']['audio']['LAME']['long_version'], "\x00");
+                       } elseif (!empty($info['mpeg']['audio']['LAME']['short_version'])) {
+                               $info['audio']['encoder'] = rtrim($info['mpeg']['audio']['LAME']['short_version'], "\x00");
+                       }
+               }
+
+               $CurrentDataLAMEversionString = (!empty($CurrentDataLAMEversionString) ? $CurrentDataLAMEversionString : (isset($info['audio']['encoder']) ? $info['audio']['encoder'] : ''));
+               if (!empty($CurrentDataLAMEversionString) && (substr($CurrentDataLAMEversionString, 0, 6) == 'LAME3.') && !preg_match('[0-9\)]', substr($CurrentDataLAMEversionString, -1))) {
+                       // a version number of LAME that does not end with a number like "LAME3.92"
+                       // or with a closing parenthesis like "LAME3.88 (alpha)"
+                       // or a version of LAME with the LAMEtag-not-filled-in-DLL-mode bug (3.90-3.92)
+
+                       // not sure what the actual last frame length will be, but will be less than or equal to 1441
+                       $PossiblyLongerLAMEversion_FrameLength = 1441;
+
+                       // Not sure what version of LAME this is - look in padding of last frame for longer version string
+                       $PossibleLAMEversionStringOffset = $info['avdataend'] - $PossiblyLongerLAMEversion_FrameLength;
+                       fseek($this->getid3->fp, $PossibleLAMEversionStringOffset);
+                       $PossiblyLongerLAMEversion_Data = fread($this->getid3->fp, $PossiblyLongerLAMEversion_FrameLength);
+                       switch (substr($CurrentDataLAMEversionString, -1)) {
+                               case 'a':
+                               case 'b':
+                                       // "LAME3.94a" will have a longer version string of "LAME3.94 (alpha)" for example
+                                       // need to trim off "a" to match longer string
+                                       $CurrentDataLAMEversionString = substr($CurrentDataLAMEversionString, 0, -1);
+                                       break;
+                       }
+                       if (($PossiblyLongerLAMEversion_String = strstr($PossiblyLongerLAMEversion_Data, $CurrentDataLAMEversionString)) !== false) {
+                               if (substr($PossiblyLongerLAMEversion_String, 0, strlen($CurrentDataLAMEversionString)) == $CurrentDataLAMEversionString) {
+                                       $PossiblyLongerLAMEversion_NewString = substr($PossiblyLongerLAMEversion_String, 0, strspn($PossiblyLongerLAMEversion_String, 'LAME0123456789., (abcdefghijklmnopqrstuvwxyzJFSOND)')); //"LAME3.90.3"  "LAME3.87 (beta 1, Sep 27 2000)" "LAME3.88 (beta)"
+                                       if (empty($info['audio']['encoder']) || (strlen($PossiblyLongerLAMEversion_NewString) > strlen($info['audio']['encoder']))) {
+                                               $info['audio']['encoder'] = $PossiblyLongerLAMEversion_NewString;
+                                       }
+                               }
+                       }
+               }
+               if (!empty($info['audio']['encoder'])) {
+                       $info['audio']['encoder'] = rtrim($info['audio']['encoder'], "\x00 ");
+               }
+
+               switch (isset($info['mpeg']['audio']['layer']) ? $info['mpeg']['audio']['layer'] : '') {
+                       case 1:
+                       case 2:
+                               $info['audio']['dataformat'] = 'mp'.$info['mpeg']['audio']['layer'];
+                               break;
+               }
+               if (isset($info['fileformat']) && ($info['fileformat'] == 'mp3')) {
+                       switch ($info['audio']['dataformat']) {
+                               case 'mp1':
+                               case 'mp2':
+                               case 'mp3':
+                                       $info['fileformat'] = $info['audio']['dataformat'];
+                                       break;
+
+                               default:
+                                       $info['warning'][] = 'Expecting [audio][dataformat] to be mp1/mp2/mp3 when fileformat == mp3, [audio][dataformat] actually "'.$info['audio']['dataformat'].'"';
+                                       break;
+                       }
+               }
+
+               if (empty($info['fileformat'])) {
+                       unset($info['fileformat']);
+                       unset($info['audio']['bitrate_mode']);
+                       unset($info['avdataoffset']);
+                       unset($info['avdataend']);
+                       return false;
+               }
+
+               $info['mime_type']         = 'audio/mpeg';
+               $info['audio']['lossless'] = false;
+
+               // Calculate playtime
+               if (!isset($info['playtime_seconds']) && isset($info['audio']['bitrate']) && ($info['audio']['bitrate'] > 0)) {
+                       $info['playtime_seconds'] = ($info['avdataend'] - $info['avdataoffset']) * 8 / $info['audio']['bitrate'];
+               }
+
+               $info['audio']['encoder_options'] = $this->GuessEncoderOptions();
+
+               return true;
+       }
+
+
+       public function GuessEncoderOptions() {
+               // shortcuts
+               $info = &$this->getid3->info;
+               if (!empty($info['mpeg']['audio'])) {
+                       $thisfile_mpeg_audio = &$info['mpeg']['audio'];
+                       if (!empty($thisfile_mpeg_audio['LAME'])) {
+                               $thisfile_mpeg_audio_lame = &$thisfile_mpeg_audio['LAME'];
+                       }
+               }
+
+               $encoder_options = '';
+               static $NamedPresetBitrates = array(16, 24, 40, 56, 112, 128, 160, 192, 256);
+
+               if (isset($thisfile_mpeg_audio['VBR_method']) && ($thisfile_mpeg_audio['VBR_method'] == 'Fraunhofer') && !empty($thisfile_mpeg_audio['VBR_quality'])) {
+
+                       $encoder_options = 'VBR q'.$thisfile_mpeg_audio['VBR_quality'];
+
+               } elseif (!empty($thisfile_mpeg_audio_lame['preset_used']) && (!in_array($thisfile_mpeg_audio_lame['preset_used_id'], $NamedPresetBitrates))) {
+
+                       $encoder_options = $thisfile_mpeg_audio_lame['preset_used'];
+
+               } elseif (!empty($thisfile_mpeg_audio_lame['vbr_quality'])) {
+
+                       static $KnownEncoderValues = array();
+                       if (empty($KnownEncoderValues)) {
+
+                               //$KnownEncoderValues[abrbitrate_minbitrate][vbr_quality][raw_vbr_method][raw_noise_shaping][raw_stereo_mode][ath_type][lowpass_frequency] = 'preset name';
+                               $KnownEncoderValues[0xFF][58][1][1][3][2][20500] = '--alt-preset insane';        // 3.90,   3.90.1, 3.92
+                               $KnownEncoderValues[0xFF][58][1][1][3][2][20600] = '--alt-preset insane';        // 3.90.2, 3.90.3, 3.91
+                               $KnownEncoderValues[0xFF][57][1][1][3][4][20500] = '--alt-preset insane';        // 3.94,   3.95
+                               $KnownEncoderValues['**'][78][3][2][3][2][19500] = '--alt-preset extreme';       // 3.90,   3.90.1, 3.92
+                               $KnownEncoderValues['**'][78][3][2][3][2][19600] = '--alt-preset extreme';       // 3.90.2, 3.91
+                               $KnownEncoderValues['**'][78][3][1][3][2][19600] = '--alt-preset extreme';       // 3.90.3
+                               $KnownEncoderValues['**'][78][4][2][3][2][19500] = '--alt-preset fast extreme';  // 3.90,   3.90.1, 3.92
+                               $KnownEncoderValues['**'][78][4][2][3][2][19600] = '--alt-preset fast extreme';  // 3.90.2, 3.90.3, 3.91
+                               $KnownEncoderValues['**'][78][3][2][3][4][19000] = '--alt-preset standard';      // 3.90,   3.90.1, 3.90.2, 3.91, 3.92
+                               $KnownEncoderValues['**'][78][3][1][3][4][19000] = '--alt-preset standard';      // 3.90.3
+                               $KnownEncoderValues['**'][78][4][2][3][4][19000] = '--alt-preset fast standard'; // 3.90,   3.90.1, 3.90.2, 3.91, 3.92
+                               $KnownEncoderValues['**'][78][4][1][3][4][19000] = '--alt-preset fast standard'; // 3.90.3
+                               $KnownEncoderValues['**'][88][4][1][3][3][19500] = '--r3mix';                    // 3.90,   3.90.1, 3.92
+                               $KnownEncoderValues['**'][88][4][1][3][3][19600] = '--r3mix';                    // 3.90.2, 3.90.3, 3.91
+                               $KnownEncoderValues['**'][67][4][1][3][4][18000] = '--r3mix';                    // 3.94,   3.95
+                               $KnownEncoderValues['**'][68][3][2][3][4][18000] = '--alt-preset medium';        // 3.90.3
+                               $KnownEncoderValues['**'][68][4][2][3][4][18000] = '--alt-preset fast medium';   // 3.90.3
+
+                               $KnownEncoderValues[0xFF][99][1][1][1][2][0]     = '--preset studio';            // 3.90,   3.90.1, 3.90.2, 3.91, 3.92
+                               $KnownEncoderValues[0xFF][58][2][1][3][2][20600] = '--preset studio';            // 3.90.3, 3.93.1
+                               $KnownEncoderValues[0xFF][58][2][1][3][2][20500] = '--preset studio';            // 3.93
+                               $KnownEncoderValues[0xFF][57][2][1][3][4][20500] = '--preset studio';            // 3.94,   3.95
+                               $KnownEncoderValues[0xC0][88][1][1][1][2][0]     = '--preset cd';                // 3.90,   3.90.1, 3.90.2,   3.91, 3.92
+                               $KnownEncoderValues[0xC0][58][2][2][3][2][19600] = '--preset cd';                // 3.90.3, 3.93.1
+                               $KnownEncoderValues[0xC0][58][2][2][3][2][19500] = '--preset cd';                // 3.93
+                               $KnownEncoderValues[0xC0][57][2][1][3][4][19500] = '--preset cd';                // 3.94,   3.95
+                               $KnownEncoderValues[0xA0][78][1][1][3][2][18000] = '--preset hifi';              // 3.90,   3.90.1, 3.90.2,   3.91, 3.92
+                               $KnownEncoderValues[0xA0][58][2][2][3][2][18000] = '--preset hifi';              // 3.90.3, 3.93,   3.93.1
+                               $KnownEncoderValues[0xA0][57][2][1][3][4][18000] = '--preset hifi';              // 3.94,   3.95
+                               $KnownEncoderValues[0x80][67][1][1][3][2][18000] = '--preset tape';              // 3.90,   3.90.1, 3.90.2,   3.91, 3.92
+                               $KnownEncoderValues[0x80][67][1][1][3][2][15000] = '--preset radio';             // 3.90,   3.90.1, 3.90.2,   3.91, 3.92
+                               $KnownEncoderValues[0x70][67][1][1][3][2][15000] = '--preset fm';                // 3.90,   3.90.1, 3.90.2,   3.91, 3.92
+                               $KnownEncoderValues[0x70][58][2][2][3][2][16000] = '--preset tape/radio/fm';     // 3.90.3, 3.93,   3.93.1
+                               $KnownEncoderValues[0x70][57][2][1][3][4][16000] = '--preset tape/radio/fm';     // 3.94,   3.95
+                               $KnownEncoderValues[0x38][58][2][2][0][2][10000] = '--preset voice';             // 3.90.3, 3.93,   3.93.1
+                               $KnownEncoderValues[0x38][57][2][1][0][4][15000] = '--preset voice';             // 3.94,   3.95
+                               $KnownEncoderValues[0x38][57][2][1][0][4][16000] = '--preset voice';             // 3.94a14
+                               $KnownEncoderValues[0x28][65][1][1][0][2][7500]  = '--preset mw-us';             // 3.90,   3.90.1, 3.92
+                               $KnownEncoderValues[0x28][65][1][1][0][2][7600]  = '--preset mw-us';             // 3.90.2, 3.91
+                               $KnownEncoderValues[0x28][58][2][2][0][2][7000]  = '--preset mw-us';             // 3.90.3, 3.93,   3.93.1
+                               $KnownEncoderValues[0x28][57][2][1][0][4][10500] = '--preset mw-us';             // 3.94,   3.95
+                               $KnownEncoderValues[0x28][57][2][1][0][4][11200] = '--preset mw-us';             // 3.94a14
+                               $KnownEncoderValues[0x28][57][2][1][0][4][8800]  = '--preset mw-us';             // 3.94a15
+                               $KnownEncoderValues[0x18][58][2][2][0][2][4000]  = '--preset phon+/lw/mw-eu/sw'; // 3.90.3, 3.93.1
+                               $KnownEncoderValues[0x18][58][2][2][0][2][3900]  = '--preset phon+/lw/mw-eu/sw'; // 3.93
+                               $KnownEncoderValues[0x18][57][2][1][0][4][5900]  = '--preset phon+/lw/mw-eu/sw'; // 3.94,   3.95
+                               $KnownEncoderValues[0x18][57][2][1][0][4][6200]  = '--preset phon+/lw/mw-eu/sw'; // 3.94a14
+                               $KnownEncoderValues[0x18][57][2][1][0][4][3200]  = '--preset phon+/lw/mw-eu/sw'; // 3.94a15
+                               $KnownEncoderValues[0x10][58][2][2][0][2][3800]  = '--preset phone';             // 3.90.3, 3.93.1
+                               $KnownEncoderValues[0x10][58][2][2][0][2][3700]  = '--preset phone';             // 3.93
+                               $KnownEncoderValues[0x10][57][2][1][0][4][5600]  = '--preset phone';             // 3.94,   3.95
+                       }
+
+                       if (isset($KnownEncoderValues[$thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate']][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']])) {
+
+                               $encoder_options = $KnownEncoderValues[$thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate']][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']];
+
+                       } elseif (isset($KnownEncoderValues['**'][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']])) {
+
+                               $encoder_options = $KnownEncoderValues['**'][$thisfile_mpeg_audio_lame['vbr_quality']][$thisfile_mpeg_audio_lame['raw']['vbr_method']][$thisfile_mpeg_audio_lame['raw']['noise_shaping']][$thisfile_mpeg_audio_lame['raw']['stereo_mode']][$thisfile_mpeg_audio_lame['ath_type']][$thisfile_mpeg_audio_lame['lowpass_frequency']];
+
+                       } elseif ($info['audio']['bitrate_mode'] == 'vbr') {
+
+                               // http://gabriel.mp3-tech.org/mp3infotag.html
+                               // int    Quality = (100 - 10 * gfp->VBR_q - gfp->quality)h
+
+
+                               $LAME_V_value = 10 - ceil($thisfile_mpeg_audio_lame['vbr_quality'] / 10);
+                               $LAME_q_value = 100 - $thisfile_mpeg_audio_lame['vbr_quality'] - ($LAME_V_value * 10);
+                               $encoder_options = '-V'.$LAME_V_value.' -q'.$LAME_q_value;
+
+                       } elseif ($info['audio']['bitrate_mode'] == 'cbr') {
+
+                               $encoder_options = strtoupper($info['audio']['bitrate_mode']).ceil($info['audio']['bitrate'] / 1000);
+
+                       } else {
+
+                               $encoder_options = strtoupper($info['audio']['bitrate_mode']);
+
+                       }
+
+               } elseif (!empty($thisfile_mpeg_audio_lame['bitrate_abr'])) {
+
+                       $encoder_options = 'ABR'.$thisfile_mpeg_audio_lame['bitrate_abr'];
+
+               } elseif (!empty($info['audio']['bitrate'])) {
+
+                       if ($info['audio']['bitrate_mode'] == 'cbr') {
+                               $encoder_options = strtoupper($info['audio']['bitrate_mode']).ceil($info['audio']['bitrate'] / 1000);
+                       } else {
+                               $encoder_options = strtoupper($info['audio']['bitrate_mode']);
+                       }
+
+               }
+               if (!empty($thisfile_mpeg_audio_lame['bitrate_min'])) {
+                       $encoder_options .= ' -b'.$thisfile_mpeg_audio_lame['bitrate_min'];
+               }
+
+               if (!empty($thisfile_mpeg_audio_lame['encoding_flags']['nogap_prev']) || !empty($thisfile_mpeg_audio_lame['encoding_flags']['nogap_next'])) {
+                       $encoder_options .= ' --nogap';
+               }
+
+               if (!empty($thisfile_mpeg_audio_lame['lowpass_frequency'])) {
+                       $ExplodedOptions = explode(' ', $encoder_options, 4);
+                       if ($ExplodedOptions[0] == '--r3mix') {
+                               $ExplodedOptions[1] = 'r3mix';
+                       }
+                       switch ($ExplodedOptions[0]) {
+                               case '--preset':
+                               case '--alt-preset':
+                               case '--r3mix':
+                                       if ($ExplodedOptions[1] == 'fast') {
+                                               $ExplodedOptions[1] .= ' '.$ExplodedOptions[2];
+                                       }
+                                       switch ($ExplodedOptions[1]) {
+                                               case 'portable':
+                                               case 'medium':
+                                               case 'standard':
+                                               case 'extreme':
+                                               case 'insane':
+                                               case 'fast portable':
+                                               case 'fast medium':
+                                               case 'fast standard':
+                                               case 'fast extreme':
+                                               case 'fast insane':
+                                               case 'r3mix':
+                                                       static $ExpectedLowpass = array(
+                                                                       'insane|20500'        => 20500,
+                                                                       'insane|20600'        => 20600,  // 3.90.2, 3.90.3, 3.91
+                                                                       'medium|18000'        => 18000,
+                                                                       'fast medium|18000'   => 18000,
+                                                                       'extreme|19500'       => 19500,  // 3.90,   3.90.1, 3.92, 3.95
+                                                                       'extreme|19600'       => 19600,  // 3.90.2, 3.90.3, 3.91, 3.93.1
+                                                                       'fast extreme|19500'  => 19500,  // 3.90,   3.90.1, 3.92, 3.95
+                                                                       'fast extreme|19600'  => 19600,  // 3.90.2, 3.90.3, 3.91, 3.93.1
+                                                                       'standard|19000'      => 19000,
+                                                                       'fast standard|19000' => 19000,
+                                                                       'r3mix|19500'         => 19500,  // 3.90,   3.90.1, 3.92
+                                                                       'r3mix|19600'         => 19600,  // 3.90.2, 3.90.3, 3.91
+                                                                       'r3mix|18000'         => 18000,  // 3.94,   3.95
+                                                               );
+                                                       if (!isset($ExpectedLowpass[$ExplodedOptions[1].'|'.$thisfile_mpeg_audio_lame['lowpass_frequency']]) && ($thisfile_mpeg_audio_lame['lowpass_frequency'] < 22050) && (round($thisfile_mpeg_audio_lame['lowpass_frequency'] / 1000) < round($thisfile_mpeg_audio['sample_rate'] / 2000))) {
+                                                               $encoder_options .= ' --lowpass '.$thisfile_mpeg_audio_lame['lowpass_frequency'];
+                                                       }
+                                                       break;
+
+                                               default:
+                                                       break;
+                                       }
+                                       break;
+                       }
+               }
+
+               if (isset($thisfile_mpeg_audio_lame['raw']['source_sample_freq'])) {
+                       if (($thisfile_mpeg_audio['sample_rate'] == 44100) && ($thisfile_mpeg_audio_lame['raw']['source_sample_freq'] != 1)) {
+                               $encoder_options .= ' --resample 44100';
+                       } elseif (($thisfile_mpeg_audio['sample_rate'] == 48000) && ($thisfile_mpeg_audio_lame['raw']['source_sample_freq'] != 2)) {
+                               $encoder_options .= ' --resample 48000';
+                       } elseif ($thisfile_mpeg_audio['sample_rate'] < 44100) {
+                               switch ($thisfile_mpeg_audio_lame['raw']['source_sample_freq']) {
+                                       case 0: // <= 32000
+                                               // may or may not be same as source frequency - ignore
+                                               break;
+                                       case 1: // 44100
+                                       case 2: // 48000
+                                       case 3: // 48000+
+                                               $ExplodedOptions = explode(' ', $encoder_options, 4);
+                                               switch ($ExplodedOptions[0]) {
+                                                       case '--preset':
+                                                       case '--alt-preset':
+                                                               switch ($ExplodedOptions[1]) {
+                                                                       case 'fast':
+                                                                       case 'portable':
+                                                                       case 'medium':
+                                                                       case 'standard':
+                                                                       case 'extreme':
+                                                                       case 'insane':
+                                                                               $encoder_options .= ' --resample '.$thisfile_mpeg_audio['sample_rate'];
+                                                                               break;
+
+                                                                       default:
+                                                                               static $ExpectedResampledRate = array(
+                                                                                               'phon+/lw/mw-eu/sw|16000' => 16000,
+                                                                                               'mw-us|24000'             => 24000, // 3.95
+                                                                                               'mw-us|32000'             => 32000, // 3.93
+                                                                                               'mw-us|16000'             => 16000, // 3.92
+                                                                                               'phone|16000'             => 16000,
+                                                                                               'phone|11025'             => 11025, // 3.94a15
+                                                                                               'radio|32000'             => 32000, // 3.94a15
+                                                                                               'fm/radio|32000'          => 32000, // 3.92
+                                                                                               'fm|32000'                => 32000, // 3.90
+                                                                                               'voice|32000'             => 32000);
+                                                                               if (!isset($ExpectedResampledRate[$ExplodedOptions[1].'|'.$thisfile_mpeg_audio['sample_rate']])) {
+                                                                                       $encoder_options .= ' --resample '.$thisfile_mpeg_audio['sample_rate'];
+                                                                               }
+                                                                               break;
+                                                               }
+                                                               break;
+
+                                                       case '--r3mix':
+                                                       default:
+                                                               $encoder_options .= ' --resample '.$thisfile_mpeg_audio['sample_rate'];
+                                                               break;
+                                               }
+                                               break;
+                               }
+                       }
+               }
+               if (empty($encoder_options) && !empty($info['audio']['bitrate']) && !empty($info['audio']['bitrate_mode'])) {
+                       //$encoder_options = strtoupper($info['audio']['bitrate_mode']).ceil($info['audio']['bitrate'] / 1000);
+                       $encoder_options = strtoupper($info['audio']['bitrate_mode']);
+               }
+
+               return $encoder_options;
+       }
+
+
+       public function decodeMPEGaudioHeader($offset, &$info, $recursivesearch=true, $ScanAsCBR=false, $FastMPEGheaderScan=false) {
+               static $MPEGaudioVersionLookup;
+               static $MPEGaudioLayerLookup;
+               static $MPEGaudioBitrateLookup;
+               static $MPEGaudioFrequencyLookup;
+               static $MPEGaudioChannelModeLookup;
+               static $MPEGaudioModeExtensionLookup;
+               static $MPEGaudioEmphasisLookup;
+               if (empty($MPEGaudioVersionLookup)) {
+                       $MPEGaudioVersionLookup       = self::MPEGaudioVersionArray();
+                       $MPEGaudioLayerLookup         = self::MPEGaudioLayerArray();
+                       $MPEGaudioBitrateLookup       = self::MPEGaudioBitrateArray();
+                       $MPEGaudioFrequencyLookup     = self::MPEGaudioFrequencyArray();
+                       $MPEGaudioChannelModeLookup   = self::MPEGaudioChannelModeArray();
+                       $MPEGaudioModeExtensionLookup = self::MPEGaudioModeExtensionArray();
+                       $MPEGaudioEmphasisLookup      = self::MPEGaudioEmphasisArray();
+               }
+
+               if (fseek($this->getid3->fp, $offset, SEEK_SET) != 0) {
+                       $info['error'][] = 'decodeMPEGaudioHeader() failed to seek to next offset at '.$offset;
+                       return false;
+               }
+               //$headerstring = fread($this->getid3->fp, 1441); // worst-case max length = 32kHz @ 320kbps layer 3 = 1441 bytes/frame
+               $headerstring = fread($this->getid3->fp, 226); // LAME header at offset 36 + 190 bytes of Xing/LAME data
+
+               // MP3 audio frame structure:
+               // $aa $aa $aa $aa [$bb $bb] $cc...
+               // where $aa..$aa is the four-byte mpeg-audio header (below)
+               // $bb $bb is the optional 2-byte CRC
+               // and $cc... is the audio data
+
+               $head4 = substr($headerstring, 0, 4);
+
+               static $MPEGaudioHeaderDecodeCache = array();
+               if (isset($MPEGaudioHeaderDecodeCache[$head4])) {
+                       $MPEGheaderRawArray = $MPEGaudioHeaderDecodeCache[$head4];
+               } else {
+                       $MPEGheaderRawArray = self::MPEGaudioHeaderDecode($head4);
+                       $MPEGaudioHeaderDecodeCache[$head4] = $MPEGheaderRawArray;
+               }
+
+               static $MPEGaudioHeaderValidCache = array();
+               if (!isset($MPEGaudioHeaderValidCache[$head4])) { // Not in cache
+                       //$MPEGaudioHeaderValidCache[$head4] = self::MPEGaudioHeaderValid($MPEGheaderRawArray, false, true);  // allow badly-formatted freeformat (from LAME 3.90 - 3.93.1)
+                       $MPEGaudioHeaderValidCache[$head4] = self::MPEGaudioHeaderValid($MPEGheaderRawArray, false, false);
+               }
+
+               // shortcut
+               if (!isset($info['mpeg']['audio'])) {
+                       $info['mpeg']['audio'] = array();
+               }
+               $thisfile_mpeg_audio = &$info['mpeg']['audio'];
+
+
+               if ($MPEGaudioHeaderValidCache[$head4]) {
+                       $thisfile_mpeg_audio['raw'] = $MPEGheaderRawArray;
+               } else {
+                       $info['error'][] = 'Invalid MPEG audio header ('.getid3_lib::PrintHexBytes($head4).') at offset '.$offset;
+                       return false;
+               }
+
+               if (!$FastMPEGheaderScan) {
+                       $thisfile_mpeg_audio['version']       = $MPEGaudioVersionLookup[$thisfile_mpeg_audio['raw']['version']];
+                       $thisfile_mpeg_audio['layer']         = $MPEGaudioLayerLookup[$thisfile_mpeg_audio['raw']['layer']];
+
+                       $thisfile_mpeg_audio['channelmode']   = $MPEGaudioChannelModeLookup[$thisfile_mpeg_audio['raw']['channelmode']];
+                       $thisfile_mpeg_audio['channels']      = (($thisfile_mpeg_audio['channelmode'] == 'mono') ? 1 : 2);
+                       $thisfile_mpeg_audio['sample_rate']   = $MPEGaudioFrequencyLookup[$thisfile_mpeg_audio['version']][$thisfile_mpeg_audio['raw']['sample_rate']];
+                       $thisfile_mpeg_audio['protection']    = !$thisfile_mpeg_audio['raw']['protection'];
+                       $thisfile_mpeg_audio['private']       = (bool) $thisfile_mpeg_audio['raw']['private'];
+                       $thisfile_mpeg_audio['modeextension'] = $MPEGaudioModeExtensionLookup[$thisfile_mpeg_audio['layer']][$thisfile_mpeg_audio['raw']['modeextension']];
+                       $thisfile_mpeg_audio['copyright']     = (bool) $thisfile_mpeg_audio['raw']['copyright'];
+                       $thisfile_mpeg_audio['original']      = (bool) $thisfile_mpeg_audio['raw']['original'];
+                       $thisfile_mpeg_audio['emphasis']      = $MPEGaudioEmphasisLookup[$thisfile_mpeg_audio['raw']['emphasis']];
+
+                       $info['audio']['channels']    = $thisfile_mpeg_audio['channels'];
+                       $info['audio']['sample_rate'] = $thisfile_mpeg_audio['sample_rate'];
+
+                       if ($thisfile_mpeg_audio['protection']) {
+                               $thisfile_mpeg_audio['crc'] = getid3_lib::BigEndian2Int(substr($headerstring, 4, 2));
+                       }
+               }
+
+               if ($thisfile_mpeg_audio['raw']['bitrate'] == 15) {
+                       // http://www.hydrogenaudio.org/?act=ST&f=16&t=9682&st=0
+                       $info['warning'][] = 'Invalid bitrate index (15), this is a known bug in free-format MP3s encoded by LAME v3.90 - 3.93.1';
+                       $thisfile_mpeg_audio['raw']['bitrate'] = 0;
+               }
+               $thisfile_mpeg_audio['padding'] = (bool) $thisfile_mpeg_audio['raw']['padding'];
+               $thisfile_mpeg_audio['bitrate'] = $MPEGaudioBitrateLookup[$thisfile_mpeg_audio['version']][$thisfile_mpeg_audio['layer']][$thisfile_mpeg_audio['raw']['bitrate']];
+
+               if (($thisfile_mpeg_audio['bitrate'] == 'free') && ($offset == $info['avdataoffset'])) {
+                       // only skip multiple frame check if free-format bitstream found at beginning of file
+                       // otherwise is quite possibly simply corrupted data
+                       $recursivesearch = false;
+               }
+
+               // For Layer 2 there are some combinations of bitrate and mode which are not allowed.
+               if (!$FastMPEGheaderScan && ($thisfile_mpeg_audio['layer'] == '2')) {
+
+                       $info['audio']['dataformat'] = 'mp2';
+                       switch ($thisfile_mpeg_audio['channelmode']) {
+
+                               case 'mono':
+                                       if (($thisfile_mpeg_audio['bitrate'] == 'free') || ($thisfile_mpeg_audio['bitrate'] <= 192000)) {
+                                               // these are ok
+                                       } else {
+                                               $info['error'][] = $thisfile_mpeg_audio['bitrate'].'kbps not allowed in Layer 2, '.$thisfile_mpeg_audio['channelmode'].'.';
+                                               return false;
+                                       }
+                                       break;
+
+                               case 'stereo':
+                               case 'joint stereo':
+                               case 'dual channel':
+                                       if (($thisfile_mpeg_audio['bitrate'] == 'free') || ($thisfile_mpeg_audio['bitrate'] == 64000) || ($thisfile_mpeg_audio['bitrate'] >= 96000)) {
+                                               // these are ok
+                                       } else {
+                                               $info['error'][] = intval(round($thisfile_mpeg_audio['bitrate'] / 1000)).'kbps not allowed in Layer 2, '.$thisfile_mpeg_audio['channelmode'].'.';
+                                               return false;
+                                       }
+                                       break;
+
+                       }
+
+               }
+
+
+               if ($info['audio']['sample_rate'] > 0) {
+                       $thisfile_mpeg_audio['framelength'] = self::MPEGaudioFrameLength($thisfile_mpeg_audio['bitrate'], $thisfile_mpeg_audio['version'], $thisfile_mpeg_audio['layer'], (int) $thisfile_mpeg_audio['padding'], $info['audio']['sample_rate']);
+               }
+
+               $nextframetestoffset = $offset + 1;
+               if ($thisfile_mpeg_audio['bitrate'] != 'free') {
+
+                       $info['audio']['bitrate'] = $thisfile_mpeg_audio['bitrate'];
+
+                       if (isset($thisfile_mpeg_audio['framelength'])) {
+                               $nextframetestoffset = $offset + $thisfile_mpeg_audio['framelength'];
+                       } else {
+                               $info['error'][] = 'Frame at offset('.$offset.') is has an invalid frame length.';
+                               return false;
+                       }
+
+               }
+
+               $ExpectedNumberOfAudioBytes = 0;
+
+               ////////////////////////////////////////////////////////////////////////////////////
+               // Variable-bitrate headers
+
+               if (substr($headerstring, 4 + 32, 4) == 'VBRI') {
+                       // Fraunhofer VBR header is hardcoded 'VBRI' at offset 0x24 (36)
+                       // specs taken from http://minnie.tuhs.org/pipermail/mp3encoder/2001-January/001800.html
+
+                       $thisfile_mpeg_audio['bitrate_mode'] = 'vbr';
+                       $thisfile_mpeg_audio['VBR_method']   = 'Fraunhofer';
+                       $info['audio']['codec']                = 'Fraunhofer';
+
+                       $SideInfoData = substr($headerstring, 4 + 2, 32);
+
+                       $FraunhoferVBROffset = 36;
+
+                       $thisfile_mpeg_audio['VBR_encoder_version']     = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset +  4, 2)); // VbriVersion
+                       $thisfile_mpeg_audio['VBR_encoder_delay']       = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset +  6, 2)); // VbriDelay
+                       $thisfile_mpeg_audio['VBR_quality']             = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset +  8, 2)); // VbriQuality
+                       $thisfile_mpeg_audio['VBR_bytes']               = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 10, 4)); // VbriStreamBytes
+                       $thisfile_mpeg_audio['VBR_frames']              = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 14, 4)); // VbriStreamFrames
+                       $thisfile_mpeg_audio['VBR_seek_offsets']        = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 18, 2)); // VbriTableSize
+                       $thisfile_mpeg_audio['VBR_seek_scale']          = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 20, 2)); // VbriTableScale
+                       $thisfile_mpeg_audio['VBR_entry_bytes']         = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 22, 2)); // VbriEntryBytes
+                       $thisfile_mpeg_audio['VBR_entry_frames']        = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset + 24, 2)); // VbriEntryFrames
+
+                       $ExpectedNumberOfAudioBytes = $thisfile_mpeg_audio['VBR_bytes'];
+
+                       $previousbyteoffset = $offset;
+                       for ($i = 0; $i < $thisfile_mpeg_audio['VBR_seek_offsets']; $i++) {
+                               $Fraunhofer_OffsetN = getid3_lib::BigEndian2Int(substr($headerstring, $FraunhoferVBROffset, $thisfile_mpeg_audio['VBR_entry_bytes']));
+                               $FraunhoferVBROffset += $thisfile_mpeg_audio['VBR_entry_bytes'];
+                               $thisfile_mpeg_audio['VBR_offsets_relative'][$i] = ($Fraunhofer_OffsetN * $thisfile_mpeg_audio['VBR_seek_scale']);
+                               $thisfile_mpeg_audio['VBR_offsets_absolute'][$i] = ($Fraunhofer_OffsetN * $thisfile_mpeg_audio['VBR_seek_scale']) + $previousbyteoffset;
+                               $previousbyteoffset += $Fraunhofer_OffsetN;
+                       }
+
+
+               } else {
+
+                       // Xing VBR header is hardcoded 'Xing' at a offset 0x0D (13), 0x15 (21) or 0x24 (36)
+                       // depending on MPEG layer and number of channels
+
+                       $VBRidOffset = self::XingVBRidOffset($thisfile_mpeg_audio['version'], $thisfile_mpeg_audio['channelmode']);
+                       $SideInfoData = substr($headerstring, 4 + 2, $VBRidOffset - 4);
+
+                       if ((substr($headerstring, $VBRidOffset, strlen('Xing')) == 'Xing') || (substr($headerstring, $VBRidOffset, strlen('Info')) == 'Info')) {
+                               // 'Xing' is traditional Xing VBR frame
+                               // 'Info' is LAME-encoded CBR (This was done to avoid CBR files to be recognized as traditional Xing VBR files by some decoders.)
+                               // 'Info' *can* legally be used to specify a VBR file as well, however.
+
+                               // http://www.multiweb.cz/twoinches/MP3inside.htm
+                               //00..03 = "Xing" or "Info"
+                               //04..07 = Flags:
+                               //  0x01  Frames Flag     set if value for number of frames in file is stored
+                               //  0x02  Bytes Flag      set if value for filesize in bytes is stored
+                               //  0x04  TOC Flag        set if values for TOC are stored
+                               //  0x08  VBR Scale Flag  set if values for VBR scale is stored
+                               //08..11  Frames: Number of frames in file (including the first Xing/Info one)
+                               //12..15  Bytes:  File length in Bytes
+                               //16..115  TOC (Table of Contents):
+                               //  Contains of 100 indexes (one Byte length) for easier lookup in file. Approximately solves problem with moving inside file.
+                               //  Each Byte has a value according this formula:
+                               //  (TOC[i] / 256) * fileLenInBytes
+                               //  So if song lasts eg. 240 sec. and you want to jump to 60. sec. (and file is 5 000 000 Bytes length) you can use:
+                               //  TOC[(60/240)*100] = TOC[25]
+                               //  and corresponding Byte in file is then approximately at:
+                               //  (TOC[25]/256) * 5000000
+                               //116..119  VBR Scale
+
+
+                               // should be safe to leave this at 'vbr' and let it be overriden to 'cbr' if a CBR preset/mode is used by LAME
+//                             if (substr($headerstring, $VBRidOffset, strlen('Info')) == 'Xing') {
+                                       $thisfile_mpeg_audio['bitrate_mode'] = 'vbr';
+                                       $thisfile_mpeg_audio['VBR_method']   = 'Xing';
+//                             } else {
+//                                     $ScanAsCBR = true;
+//                                     $thisfile_mpeg_audio['bitrate_mode'] = 'cbr';
+//                             }
+
+                               $thisfile_mpeg_audio['xing_flags_raw'] = getid3_lib::BigEndian2Int(substr($headerstring, $VBRidOffset + 4, 4));
+
+                               $thisfile_mpeg_audio['xing_flags']['frames']    = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000001);
+                               $thisfile_mpeg_audio['xing_flags']['bytes']     = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000002);
+                               $thisfile_mpeg_audio['xing_flags']['toc']       = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000004);
+                               $thisfile_mpeg_audio['xing_flags']['vbr_scale'] = (bool) ($thisfile_mpeg_audio['xing_flags_raw'] & 0x00000008);
+
+                               if ($thisfile_mpeg_audio['xing_flags']['frames']) {
+                                       $thisfile_mpeg_audio['VBR_frames'] = getid3_lib::BigEndian2Int(substr($headerstring, $VBRidOffset +  8, 4));
+                                       //$thisfile_mpeg_audio['VBR_frames']--; // don't count header Xing/Info frame
+                               }
+                               if ($thisfile_mpeg_audio['xing_flags']['bytes']) {
+                                       $thisfile_mpeg_audio['VBR_bytes']  = getid3_lib::BigEndian2Int(substr($headerstring, $VBRidOffset + 12, 4));
+                               }
+
+                               //if (($thisfile_mpeg_audio['bitrate'] == 'free') && !empty($thisfile_mpeg_audio['VBR_frames']) && !empty($thisfile_mpeg_audio['VBR_bytes'])) {
+                               if (!empty($thisfile_mpeg_audio['VBR_frames']) && !empty($thisfile_mpeg_audio['VBR_bytes'])) {
+
+                                       $framelengthfloat = $thisfile_mpeg_audio['VBR_bytes'] / $thisfile_mpeg_audio['VBR_frames'];
+
+                                       if ($thisfile_mpeg_audio['layer'] == '1') {
+                                               // BitRate = (((FrameLengthInBytes / 4) - Padding) * SampleRate) / 12
+                                               //$info['audio']['bitrate'] = ((($framelengthfloat / 4) - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 12;
+                                               $info['audio']['bitrate'] = ($framelengthfloat / 4) * $thisfile_mpeg_audio['sample_rate'] * (2 / $info['audio']['channels']) / 12;
+                                       } else {
+                                               // Bitrate = ((FrameLengthInBytes - Padding) * SampleRate) / 144
+                                               //$info['audio']['bitrate'] = (($framelengthfloat - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 144;
+                                               $info['audio']['bitrate'] = $framelengthfloat * $thisfile_mpeg_audio['sample_rate'] * (2 / $info['audio']['channels']) / 144;
+                                       }
+                                       $thisfile_mpeg_audio['framelength'] = floor($framelengthfloat);
+                               }
+
+                               if ($thisfile_mpeg_audio['xing_flags']['toc']) {
+                                       $LAMEtocData = substr($headerstring, $VBRidOffset + 16, 100);
+                                       for ($i = 0; $i < 100; $i++) {
+                                               $thisfile_mpeg_audio['toc'][$i] = ord($LAMEtocData{$i});
+                                       }
+                               }
+                               if ($thisfile_mpeg_audio['xing_flags']['vbr_scale']) {
+                                       $thisfile_mpeg_audio['VBR_scale'] = getid3_lib::BigEndian2Int(substr($headerstring, $VBRidOffset + 116, 4));
+                               }
+
+
+                               // http://gabriel.mp3-tech.org/mp3infotag.html
+                               if (substr($headerstring, $VBRidOffset + 120, 4) == 'LAME') {
+
+                                       // shortcut
+                                       $thisfile_mpeg_audio['LAME'] = array();
+                                       $thisfile_mpeg_audio_lame    = &$thisfile_mpeg_audio['LAME'];
+
+
+                                       $thisfile_mpeg_audio_lame['long_version']  = substr($headerstring, $VBRidOffset + 120, 20);
+                                       $thisfile_mpeg_audio_lame['short_version'] = substr($thisfile_mpeg_audio_lame['long_version'], 0, 9);
+
+                                       if ($thisfile_mpeg_audio_lame['short_version'] >= 'LAME3.90') {
+
+                                               // extra 11 chars are not part of version string when LAMEtag present
+                                               unset($thisfile_mpeg_audio_lame['long_version']);
+
+                                               // It the LAME tag was only introduced in LAME v3.90
+                                               // http://www.hydrogenaudio.org/?act=ST&f=15&t=9933
+
+                                               // Offsets of various bytes in http://gabriel.mp3-tech.org/mp3infotag.html
+                                               // are assuming a 'Xing' identifier offset of 0x24, which is the case for
+                                               // MPEG-1 non-mono, but not for other combinations
+                                               $LAMEtagOffsetContant = $VBRidOffset - 0x24;
+
+                                               // shortcuts
+                                               $thisfile_mpeg_audio_lame['RGAD']    = array('track'=>array(), 'album'=>array());
+                                               $thisfile_mpeg_audio_lame_RGAD       = &$thisfile_mpeg_audio_lame['RGAD'];
+                                               $thisfile_mpeg_audio_lame_RGAD_track = &$thisfile_mpeg_audio_lame_RGAD['track'];
+                                               $thisfile_mpeg_audio_lame_RGAD_album = &$thisfile_mpeg_audio_lame_RGAD['album'];
+                                               $thisfile_mpeg_audio_lame['raw'] = array();
+                                               $thisfile_mpeg_audio_lame_raw    = &$thisfile_mpeg_audio_lame['raw'];
+
+                                               // byte $9B  VBR Quality
+                                               // This field is there to indicate a quality level, although the scale was not precised in the original Xing specifications.
+                                               // Actually overwrites original Xing bytes
+                                               unset($thisfile_mpeg_audio['VBR_scale']);
+                                               $thisfile_mpeg_audio_lame['vbr_quality'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0x9B, 1));
+
+                                               // bytes $9C-$A4  Encoder short VersionString
+                                               $thisfile_mpeg_audio_lame['short_version'] = substr($headerstring, $LAMEtagOffsetContant + 0x9C, 9);
+
+                                               // byte $A5  Info Tag revision + VBR method
+                                               $LAMEtagRevisionVBRmethod = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xA5, 1));
+
+                                               $thisfile_mpeg_audio_lame['tag_revision']   = ($LAMEtagRevisionVBRmethod & 0xF0) >> 4;
+                                               $thisfile_mpeg_audio_lame_raw['vbr_method'] =  $LAMEtagRevisionVBRmethod & 0x0F;
+                                               $thisfile_mpeg_audio_lame['vbr_method']     = self::LAMEvbrMethodLookup($thisfile_mpeg_audio_lame_raw['vbr_method']);
+                                               $thisfile_mpeg_audio['bitrate_mode']        = substr($thisfile_mpeg_audio_lame['vbr_method'], 0, 3); // usually either 'cbr' or 'vbr', but truncates 'vbr-old / vbr-rh' to 'vbr'
+
+                                               // byte $A6  Lowpass filter value
+                                               $thisfile_mpeg_audio_lame['lowpass_frequency'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xA6, 1)) * 100;
+
+                                               // bytes $A7-$AE  Replay Gain
+                                               // http://privatewww.essex.ac.uk/~djmrob/replaygain/rg_data_format.html
+                                               // bytes $A7-$AA : 32 bit floating point "Peak signal amplitude"
+                                               if ($thisfile_mpeg_audio_lame['short_version'] >= 'LAME3.94b') {
+                                                       // LAME 3.94a16 and later - 9.23 fixed point
+                                                       // ie 0x0059E2EE / (2^23) = 5890798 / 8388608 = 0.7022378444671630859375
+                                                       $thisfile_mpeg_audio_lame_RGAD['peak_amplitude'] = (float) ((getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xA7, 4))) / 8388608);
+                                               } else {
+                                                       // LAME 3.94a15 and earlier - 32-bit floating point
+                                                       // Actually 3.94a16 will fall in here too and be WRONG, but is hard to detect 3.94a16 vs 3.94a15
+                                                       $thisfile_mpeg_audio_lame_RGAD['peak_amplitude'] = getid3_lib::LittleEndian2Float(substr($headerstring, $LAMEtagOffsetContant + 0xA7, 4));
+                                               }
+                                               if ($thisfile_mpeg_audio_lame_RGAD['peak_amplitude'] == 0) {
+                                                       unset($thisfile_mpeg_audio_lame_RGAD['peak_amplitude']);
+                                               } else {
+                                                       $thisfile_mpeg_audio_lame_RGAD['peak_db'] = getid3_lib::RGADamplitude2dB($thisfile_mpeg_audio_lame_RGAD['peak_amplitude']);
+                                               }
+
+                                               $thisfile_mpeg_audio_lame_raw['RGAD_track']      =   getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xAB, 2));
+                                               $thisfile_mpeg_audio_lame_raw['RGAD_album']      =   getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xAD, 2));
+
+
+                                               if ($thisfile_mpeg_audio_lame_raw['RGAD_track'] != 0) {
+
+                                                       $thisfile_mpeg_audio_lame_RGAD_track['raw']['name']        = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0xE000) >> 13;
+                                                       $thisfile_mpeg_audio_lame_RGAD_track['raw']['originator']  = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0x1C00) >> 10;
+                                                       $thisfile_mpeg_audio_lame_RGAD_track['raw']['sign_bit']    = ($thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0x0200) >> 9;
+                                                       $thisfile_mpeg_audio_lame_RGAD_track['raw']['gain_adjust'] =  $thisfile_mpeg_audio_lame_raw['RGAD_track'] & 0x01FF;
+                                                       $thisfile_mpeg_audio_lame_RGAD_track['name']       = getid3_lib::RGADnameLookup($thisfile_mpeg_audio_lame_RGAD_track['raw']['name']);
+                                                       $thisfile_mpeg_audio_lame_RGAD_track['originator'] = getid3_lib::RGADoriginatorLookup($thisfile_mpeg_audio_lame_RGAD_track['raw']['originator']);
+                                                       $thisfile_mpeg_audio_lame_RGAD_track['gain_db']    = getid3_lib::RGADadjustmentLookup($thisfile_mpeg_audio_lame_RGAD_track['raw']['gain_adjust'], $thisfile_mpeg_audio_lame_RGAD_track['raw']['sign_bit']);
+
+                                                       if (!empty($thisfile_mpeg_audio_lame_RGAD['peak_amplitude'])) {
+                                                               $info['replay_gain']['track']['peak']   = $thisfile_mpeg_audio_lame_RGAD['peak_amplitude'];
+                                                       }
+                                                       $info['replay_gain']['track']['originator'] = $thisfile_mpeg_audio_lame_RGAD_track['originator'];
+                                                       $info['replay_gain']['track']['adjustment'] = $thisfile_mpeg_audio_lame_RGAD_track['gain_db'];
+                                               } else {
+                                                       unset($thisfile_mpeg_audio_lame_RGAD['track']);
+                                               }
+                                               if ($thisfile_mpeg_audio_lame_raw['RGAD_album'] != 0) {
+
+                                                       $thisfile_mpeg_audio_lame_RGAD_album['raw']['name']        = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0xE000) >> 13;
+                                                       $thisfile_mpeg_audio_lame_RGAD_album['raw']['originator']  = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0x1C00) >> 10;
+                                                       $thisfile_mpeg_audio_lame_RGAD_album['raw']['sign_bit']    = ($thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0x0200) >> 9;
+                                                       $thisfile_mpeg_audio_lame_RGAD_album['raw']['gain_adjust'] = $thisfile_mpeg_audio_lame_raw['RGAD_album'] & 0x01FF;
+                                                       $thisfile_mpeg_audio_lame_RGAD_album['name']       = getid3_lib::RGADnameLookup($thisfile_mpeg_audio_lame_RGAD_album['raw']['name']);
+                                                       $thisfile_mpeg_audio_lame_RGAD_album['originator'] = getid3_lib::RGADoriginatorLookup($thisfile_mpeg_audio_lame_RGAD_album['raw']['originator']);
+                                                       $thisfile_mpeg_audio_lame_RGAD_album['gain_db']    = getid3_lib::RGADadjustmentLookup($thisfile_mpeg_audio_lame_RGAD_album['raw']['gain_adjust'], $thisfile_mpeg_audio_lame_RGAD_album['raw']['sign_bit']);
+
+                                                       if (!empty($thisfile_mpeg_audio_lame_RGAD['peak_amplitude'])) {
+                                                               $info['replay_gain']['album']['peak']   = $thisfile_mpeg_audio_lame_RGAD['peak_amplitude'];
+                                                       }
+                                                       $info['replay_gain']['album']['originator'] = $thisfile_mpeg_audio_lame_RGAD_album['originator'];
+                                                       $info['replay_gain']['album']['adjustment'] = $thisfile_mpeg_audio_lame_RGAD_album['gain_db'];
+                                               } else {
+                                                       unset($thisfile_mpeg_audio_lame_RGAD['album']);
+                                               }
+                                               if (empty($thisfile_mpeg_audio_lame_RGAD)) {
+                                                       unset($thisfile_mpeg_audio_lame['RGAD']);
+                                               }
+
+
+                                               // byte $AF  Encoding flags + ATH Type
+                                               $EncodingFlagsATHtype = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xAF, 1));
+                                               $thisfile_mpeg_audio_lame['encoding_flags']['nspsytune']   = (bool) ($EncodingFlagsATHtype & 0x10);
+                                               $thisfile_mpeg_audio_lame['encoding_flags']['nssafejoint'] = (bool) ($EncodingFlagsATHtype & 0x20);
+                                               $thisfile_mpeg_audio_lame['encoding_flags']['nogap_next']  = (bool) ($EncodingFlagsATHtype & 0x40);
+                                               $thisfile_mpeg_audio_lame['encoding_flags']['nogap_prev']  = (bool) ($EncodingFlagsATHtype & 0x80);
+                                               $thisfile_mpeg_audio_lame['ath_type']                      =         $EncodingFlagsATHtype & 0x0F;
+
+                                               // byte $B0  if ABR {specified bitrate} else {minimal bitrate}
+                                               $thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB0, 1));
+                                               if ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 2) { // Average BitRate (ABR)
+                                                       $thisfile_mpeg_audio_lame['bitrate_abr'] = $thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate'];
+                                               } elseif ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 1) { // Constant BitRate (CBR)
+                                                       // ignore
+                                               } elseif ($thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate'] > 0) { // Variable BitRate (VBR) - minimum bitrate
+                                                       $thisfile_mpeg_audio_lame['bitrate_min'] = $thisfile_mpeg_audio_lame['raw']['abrbitrate_minbitrate'];
+                                               }
+
+                                               // bytes $B1-$B3  Encoder delays
+                                               $EncoderDelays = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB1, 3));
+                                               $thisfile_mpeg_audio_lame['encoder_delay'] = ($EncoderDelays & 0xFFF000) >> 12;
+                                               $thisfile_mpeg_audio_lame['end_padding']   =  $EncoderDelays & 0x000FFF;
+
+                                               // byte $B4  Misc
+                                               $MiscByte = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB4, 1));
+                                               $thisfile_mpeg_audio_lame_raw['noise_shaping']       = ($MiscByte & 0x03);
+                                               $thisfile_mpeg_audio_lame_raw['stereo_mode']         = ($MiscByte & 0x1C) >> 2;
+                                               $thisfile_mpeg_audio_lame_raw['not_optimal_quality'] = ($MiscByte & 0x20) >> 5;
+                                               $thisfile_mpeg_audio_lame_raw['source_sample_freq']  = ($MiscByte & 0xC0) >> 6;
+                                               $thisfile_mpeg_audio_lame['noise_shaping']       = $thisfile_mpeg_audio_lame_raw['noise_shaping'];
+                                               $thisfile_mpeg_audio_lame['stereo_mode']         = self::LAMEmiscStereoModeLookup($thisfile_mpeg_audio_lame_raw['stereo_mode']);
+                                               $thisfile_mpeg_audio_lame['not_optimal_quality'] = (bool) $thisfile_mpeg_audio_lame_raw['not_optimal_quality'];
+                                               $thisfile_mpeg_audio_lame['source_sample_freq']  = self::LAMEmiscSourceSampleFrequencyLookup($thisfile_mpeg_audio_lame_raw['source_sample_freq']);
+
+                                               // byte $B5  MP3 Gain
+                                               $thisfile_mpeg_audio_lame_raw['mp3_gain'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB5, 1), false, true);
+                                               $thisfile_mpeg_audio_lame['mp3_gain_db']     = (getid3_lib::RGADamplitude2dB(2) / 4) * $thisfile_mpeg_audio_lame_raw['mp3_gain'];
+                                               $thisfile_mpeg_audio_lame['mp3_gain_factor'] = pow(2, ($thisfile_mpeg_audio_lame['mp3_gain_db'] / 6));
+
+                                               // bytes $B6-$B7  Preset and surround info
+                                               $PresetSurroundBytes = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB6, 2));
+                                               // Reserved                                                    = ($PresetSurroundBytes & 0xC000);
+                                               $thisfile_mpeg_audio_lame_raw['surround_info'] = ($PresetSurroundBytes & 0x3800);
+                                               $thisfile_mpeg_audio_lame['surround_info']     = self::LAMEsurroundInfoLookup($thisfile_mpeg_audio_lame_raw['surround_info']);
+                                               $thisfile_mpeg_audio_lame['preset_used_id']    = ($PresetSurroundBytes & 0x07FF);
+                                               $thisfile_mpeg_audio_lame['preset_used']       = self::LAMEpresetUsedLookup($thisfile_mpeg_audio_lame);
+                                               if (!empty($thisfile_mpeg_audio_lame['preset_used_id']) && empty($thisfile_mpeg_audio_lame['preset_used'])) {
+                                                       $info['warning'][] = 'Unknown LAME preset used ('.$thisfile_mpeg_audio_lame['preset_used_id'].') - please report to info@getid3.org';
+                                               }
+                                               if (($thisfile_mpeg_audio_lame['short_version'] == 'LAME3.90.') && !empty($thisfile_mpeg_audio_lame['preset_used_id'])) {
+                                                       // this may change if 3.90.4 ever comes out
+                                                       $thisfile_mpeg_audio_lame['short_version'] = 'LAME3.90.3';
+                                               }
+
+                                               // bytes $B8-$BB  MusicLength
+                                               $thisfile_mpeg_audio_lame['audio_bytes'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xB8, 4));
+                                               $ExpectedNumberOfAudioBytes = (($thisfile_mpeg_audio_lame['audio_bytes'] > 0) ? $thisfile_mpeg_audio_lame['audio_bytes'] : $thisfile_mpeg_audio['VBR_bytes']);
+
+                                               // bytes $BC-$BD  MusicCRC
+                                               $thisfile_mpeg_audio_lame['music_crc']    = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xBC, 2));
+
+                                               // bytes $BE-$BF  CRC-16 of Info Tag
+                                               $thisfile_mpeg_audio_lame['lame_tag_crc'] = getid3_lib::BigEndian2Int(substr($headerstring, $LAMEtagOffsetContant + 0xBE, 2));
+
+
+                                               // LAME CBR
+                                               if ($thisfile_mpeg_audio_lame_raw['vbr_method'] == 1) {
+
+                                                       $thisfile_mpeg_audio['bitrate_mode'] = 'cbr';
+                                                       $thisfile_mpeg_audio['bitrate'] = self::ClosestStandardMP3Bitrate($thisfile_mpeg_audio['bitrate']);
+                                                       $info['audio']['bitrate'] = $thisfile_mpeg_audio['bitrate'];
+                                                       //if (empty($thisfile_mpeg_audio['bitrate']) || (!empty($thisfile_mpeg_audio_lame['bitrate_min']) && ($thisfile_mpeg_audio_lame['bitrate_min'] != 255))) {
+                                                       //      $thisfile_mpeg_audio['bitrate'] = $thisfile_mpeg_audio_lame['bitrate_min'];
+                                                       //}
+
+                                               }
+
+                                       }
+                               }
+
+                       } else {
+
+                               // not Fraunhofer or Xing VBR methods, most likely CBR (but could be VBR with no header)
+                               $thisfile_mpeg_audio['bitrate_mode'] = 'cbr';
+                               if ($recursivesearch) {
+                                       $thisfile_mpeg_audio['bitrate_mode'] = 'vbr';
+                                       if ($this->RecursiveFrameScanning($offset, $nextframetestoffset, true)) {
+                                               $recursivesearch = false;
+                                               $thisfile_mpeg_audio['bitrate_mode'] = 'cbr';
+                                       }
+                                       if ($thisfile_mpeg_audio['bitrate_mode'] == 'vbr') {
+                                               $info['warning'][] = 'VBR file with no VBR header. Bitrate values calculated from actual frame bitrates.';
+                                       }
+                               }
+
+                       }
+
+               }
+
+               if (($ExpectedNumberOfAudioBytes > 0) && ($ExpectedNumberOfAudioBytes != ($info['avdataend'] - $info['avdataoffset']))) {
+                       if ($ExpectedNumberOfAudioBytes > ($info['avdataend'] - $info['avdataoffset'])) {
+                               if (isset($info['fileformat']) && ($info['fileformat'] == 'riff')) {
+                                       // ignore, audio data is broken into chunks so will always be data "missing"
+                               } elseif (($ExpectedNumberOfAudioBytes - ($info['avdataend'] - $info['avdataoffset'])) == 1) {
+                                       $info['warning'][] = 'Last byte of data truncated (this is a known bug in Meracl ID3 Tag Writer before v1.3.5)';
+                               } else {
+                                       $info['warning'][] = 'Probable truncated file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, only found '.($info['avdataend'] - $info['avdataoffset']).' (short by '.($ExpectedNumberOfAudioBytes - ($info['avdataend'] - $info['avdataoffset'])).' bytes)';
+                               }
+                       } else {
+                               if ((($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes) == 1) {
+                               //      $prenullbytefileoffset = ftell($this->getid3->fp);
+                               //      fseek($this->getid3->fp, $info['avdataend'], SEEK_SET);
+                               //      $PossibleNullByte = fread($this->getid3->fp, 1);
+                               //      fseek($this->getid3->fp, $prenullbytefileoffset, SEEK_SET);
+                               //      if ($PossibleNullByte === "\x00") {
+                                               $info['avdataend']--;
+                               //              $info['warning'][] = 'Extra null byte at end of MP3 data assumed to be RIFF padding and therefore ignored';
+                               //      } else {
+                               //              $info['warning'][] = 'Too much data in file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, found '.($info['avdataend'] - $info['avdataoffset']).' ('.(($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes).' bytes too many)';
+                               //      }
+                               } else {
+                                       $info['warning'][] = 'Too much data in file: expecting '.$ExpectedNumberOfAudioBytes.' bytes of audio data, found '.($info['avdataend'] - $info['avdataoffset']).' ('.(($info['avdataend'] - $info['avdataoffset']) - $ExpectedNumberOfAudioBytes).' bytes too many)';
+                               }
+                       }
+               }
+
+               if (($thisfile_mpeg_audio['bitrate'] == 'free') && empty($info['audio']['bitrate'])) {
+                       if (($offset == $info['avdataoffset']) && empty($thisfile_mpeg_audio['VBR_frames'])) {
+                               $framebytelength = $this->FreeFormatFrameLength($offset, true);
+                               if ($framebytelength > 0) {
+                                       $thisfile_mpeg_audio['framelength'] = $framebytelength;
+                                       if ($thisfile_mpeg_audio['layer'] == '1') {
+                                               // BitRate = (((FrameLengthInBytes / 4) - Padding) * SampleRate) / 12
+                                               $info['audio']['bitrate'] = ((($framebytelength / 4) - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 12;
+                                       } else {
+                                               // Bitrate = ((FrameLengthInBytes - Padding) * SampleRate) / 144
+                                               $info['audio']['bitrate'] = (($framebytelength - intval($thisfile_mpeg_audio['padding'])) * $thisfile_mpeg_audio['sample_rate']) / 144;
+                                       }
+                               } else {
+                                       $info['error'][] = 'Error calculating frame length of free-format MP3 without Xing/LAME header';
+                               }
+                       }
+               }
+
+               if (isset($thisfile_mpeg_audio['VBR_frames']) ? $thisfile_mpeg_audio['VBR_frames'] : '') {
+                       switch ($thisfile_mpeg_audio['bitrate_mode']) {
+                               case 'vbr':
+                               case 'abr':
+                                       $bytes_per_frame = 1152;
+                                       if (($thisfile_mpeg_audio['version'] == '1') && ($thisfile_mpeg_audio['layer'] == 1)) {
+                                               $bytes_per_frame = 384;
+                                       } elseif ((($thisfile_mpeg_audio['version'] == '2') || ($thisfile_mpeg_audio['version'] == '2.5')) && ($thisfile_mpeg_audio['layer'] == 3)) {
+                                               $bytes_per_frame = 576;
+                                       }
+                                       $thisfile_mpeg_audio['VBR_bitrate'] = (isset($thisfile_mpeg_audio['VBR_bytes']) ? (($thisfile_mpeg_audio['VBR_bytes'] / $thisfile_mpeg_audio['VBR_frames']) * 8) * ($info['audio']['sample_rate'] / $bytes_per_frame) : 0);
+                                       if ($thisfile_mpeg_audio['VBR_bitrate'] > 0) {
+                                               $info['audio']['bitrate']         = $thisfile_mpeg_audio['VBR_bitrate'];
+                                               $thisfile_mpeg_audio['bitrate'] = $thisfile_mpeg_audio['VBR_bitrate']; // to avoid confusion
+                                       }
+                                       break;
+                       }
+               }
+
+               // End variable-bitrate headers
+               ////////////////////////////////////////////////////////////////////////////////////
+
+               if ($recursivesearch) {
+
+                       if (!$this->RecursiveFrameScanning($offset, $nextframetestoffset, $ScanAsCBR)) {
+                               return false;
+                       }
+
+               }
+
+
+               //if (false) {
+               //    // experimental side info parsing section - not returning anything useful yet
+               //
+               //    $SideInfoBitstream = getid3_lib::BigEndian2Bin($SideInfoData);
+               //    $SideInfoOffset = 0;
+               //
+               //    if ($thisfile_mpeg_audio['version'] == '1') {
+               //        if ($thisfile_mpeg_audio['channelmode'] == 'mono') {
+               //            // MPEG-1 (mono)
+               //            $thisfile_mpeg_audio['side_info']['main_data_begin'] = substr($SideInfoBitstream, $SideInfoOffset, 9);
+               //            $SideInfoOffset += 9;
+               //            $SideInfoOffset += 5;
+               //        } else {
+               //            // MPEG-1 (stereo, joint-stereo, dual-channel)
+               //            $thisfile_mpeg_audio['side_info']['main_data_begin'] = substr($SideInfoBitstream, $SideInfoOffset, 9);
+               //            $SideInfoOffset += 9;
+               //            $SideInfoOffset += 3;
+               //        }
+               //    } else { // 2 or 2.5
+               //        if ($thisfile_mpeg_audio['channelmode'] == 'mono') {
+               //            // MPEG-2, MPEG-2.5 (mono)
+               //            $thisfile_mpeg_audio['side_info']['main_data_begin'] = substr($SideInfoBitstream, $SideInfoOffset, 8);
+               //            $SideInfoOffset += 8;
+               //            $SideInfoOffset += 1;
+               //        } else {
+               //            // MPEG-2, MPEG-2.5 (stereo, joint-stereo, dual-channel)
+               //            $thisfile_mpeg_audio['side_info']['main_data_begin'] = substr($SideInfoBitstream, $SideInfoOffset, 8);
+               //            $SideInfoOffset += 8;
+               //            $SideInfoOffset += 2;
+               //        }
+               //    }
+               //
+               //    if ($thisfile_mpeg_audio['version'] == '1') {
+               //        for ($channel = 0; $channel < $info['audio']['channels']; $channel++) {
+               //            for ($scfsi_band = 0; $scfsi_band < 4; $scfsi_band++) {
+               //                $thisfile_mpeg_audio['scfsi'][$channel][$scfsi_band] = substr($SideInfoBitstream, $SideInfoOffset, 1);
+               //                $SideInfoOffset += 2;
+               //            }
+               //        }
+               //    }
+               //    for ($granule = 0; $granule < (($thisfile_mpeg_audio['version'] == '1') ? 2 : 1); $granule++) {
+               //        for ($channel = 0; $channel < $info['audio']['channels']; $channel++) {
+               //            $thisfile_mpeg_audio['part2_3_length'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 12);
+               //            $SideInfoOffset += 12;
+               //            $thisfile_mpeg_audio['big_values'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 9);
+               //            $SideInfoOffset += 9;
+               //            $thisfile_mpeg_audio['global_gain'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 8);
+               //            $SideInfoOffset += 8;
+               //            if ($thisfile_mpeg_audio['version'] == '1') {
+               //                $thisfile_mpeg_audio['scalefac_compress'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 4);
+               //                $SideInfoOffset += 4;
+               //            } else {
+               //                $thisfile_mpeg_audio['scalefac_compress'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 9);
+               //                $SideInfoOffset += 9;
+               //            }
+               //            $thisfile_mpeg_audio['window_switching_flag'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 1);
+               //            $SideInfoOffset += 1;
+               //
+               //            if ($thisfile_mpeg_audio['window_switching_flag'][$granule][$channel] == '1') {
+               //
+               //                $thisfile_mpeg_audio['block_type'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 2);
+               //                $SideInfoOffset += 2;
+               //                $thisfile_mpeg_audio['mixed_block_flag'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 1);
+               //                $SideInfoOffset += 1;
+               //
+               //                for ($region = 0; $region < 2; $region++) {
+               //                    $thisfile_mpeg_audio['table_select'][$granule][$channel][$region] = substr($SideInfoBitstream, $SideInfoOffset, 5);
+               //                    $SideInfoOffset += 5;
+               //                }
+               //                $thisfile_mpeg_audio['table_select'][$granule][$channel][2] = 0;
+               //
+               //                for ($window = 0; $window < 3; $window++) {
+               //                    $thisfile_mpeg_audio['subblock_gain'][$granule][$channel][$window] = substr($SideInfoBitstream, $SideInfoOffset, 3);
+               //                    $SideInfoOffset += 3;
+               //                }
+               //
+               //            } else {
+               //
+               //                for ($region = 0; $region < 3; $region++) {
+               //                    $thisfile_mpeg_audio['table_select'][$granule][$channel][$region] = substr($SideInfoBitstream, $SideInfoOffset, 5);
+               //                    $SideInfoOffset += 5;
+               //                }
+               //
+               //                $thisfile_mpeg_audio['region0_count'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 4);
+               //                $SideInfoOffset += 4;
+               //                $thisfile_mpeg_audio['region1_count'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 3);
+               //                $SideInfoOffset += 3;
+               //                $thisfile_mpeg_audio['block_type'][$granule][$channel] = 0;
+               //            }
+               //
+               //            if ($thisfile_mpeg_audio['version'] == '1') {
+               //                $thisfile_mpeg_audio['preflag'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 1);
+               //                $SideInfoOffset += 1;
+               //            }
+               //            $thisfile_mpeg_audio['scalefac_scale'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 1);
+               //            $SideInfoOffset += 1;
+               //            $thisfile_mpeg_audio['count1table_select'][$granule][$channel] = substr($SideInfoBitstream, $SideInfoOffset, 1);
+               //            $SideInfoOffset += 1;
+               //        }
+               //    }
+               //}
+
+               return true;
+       }
+
+       public function RecursiveFrameScanning(&$offset, &$nextframetestoffset, $ScanAsCBR) {
+               $info = &$this->getid3->info;
+               $firstframetestarray = array('error'=>'', 'warning'=>'', 'avdataend'=>$info['avdataend'], 'avdataoffset'=>$info['avdataoffset']);
+               $this->decodeMPEGaudioHeader($offset, $firstframetestarray, false);
+
+               for ($i = 0; $i < GETID3_MP3_VALID_CHECK_FRAMES; $i++) {
+                       // check next GETID3_MP3_VALID_CHECK_FRAMES frames for validity, to make sure we haven't run across a false synch
+                       if (($nextframetestoffset + 4) >= $info['avdataend']) {
+                               // end of file
+                               return true;
+                       }
+
+                       $nextframetestarray = array('error'=>'', 'warning'=>'', 'avdataend'=>$info['avdataend'], 'avdataoffset'=>$info['avdataoffset']);
+                       if ($this->decodeMPEGaudioHeader($nextframetestoffset, $nextframetestarray, false)) {
+                               if ($ScanAsCBR) {
+                                       // force CBR mode, used for trying to pick out invalid audio streams with valid(?) VBR headers, or VBR streams with no VBR header
+                                       if (!isset($nextframetestarray['mpeg']['audio']['bitrate']) || !isset($firstframetestarray['mpeg']['audio']['bitrate']) || ($nextframetestarray['mpeg']['audio']['bitrate'] != $firstframetestarray['mpeg']['audio']['bitrate'])) {
+                                               return false;
+                                       }
+                               }
+
+
+                               // next frame is OK, get ready to check the one after that
+                               if (isset($nextframetestarray['mpeg']['audio']['framelength']) && ($nextframetestarray['mpeg']['audio']['framelength'] > 0)) {
+                                       $nextframetestoffset += $nextframetestarray['mpeg']['audio']['framelength'];
+                               } else {
+                                       $info['error'][] = 'Frame at offset ('.$offset.') is has an invalid frame length.';
+                                       return false;
+                               }
+
+                       } elseif (!empty($firstframetestarray['mpeg']['audio']['framelength']) && (($nextframetestoffset + $firstframetestarray['mpeg']['audio']['framelength']) > $info['avdataend'])) {
+
+                               // it's not the end of the file, but there's not enough data left for another frame, so assume it's garbage/padding and return OK
+                               return true;
+
+                       } else {
+
+                               // next frame is not valid, note the error and fail, so scanning can contiue for a valid frame sequence
+                               $info['warning'][] = 'Frame at offset ('.$offset.') is valid, but the next one at ('.$nextframetestoffset.') is not.';
+
+                               return false;
+                       }
+               }
+               return true;
+       }
+
+       public function FreeFormatFrameLength($offset, $deepscan=false) {
+               $info = &$this->getid3->info;
+
+               fseek($this->getid3->fp, $offset, SEEK_SET);
+               $MPEGaudioData = fread($this->getid3->fp, 32768);
+
+               $SyncPattern1 = substr($MPEGaudioData, 0, 4);
+               // may be different pattern due to padding
+               $SyncPattern2 = $SyncPattern1{0}.$SyncPattern1{1}.chr(ord($SyncPattern1{2}) | 0x02).$SyncPattern1{3};
+               if ($SyncPattern2 === $SyncPattern1) {
+                       $SyncPattern2 = $SyncPattern1{0}.$SyncPattern1{1}.chr(ord($SyncPattern1{2}) & 0xFD).$SyncPattern1{3};
+               }
+
+               $framelength = false;
+               $framelength1 = strpos($MPEGaudioData, $SyncPattern1, 4);
+               $framelength2 = strpos($MPEGaudioData, $SyncPattern2, 4);
+               if ($framelength1 > 4) {
+                       $framelength = $framelength1;
+               }
+               if (($framelength2 > 4) && ($framelength2 < $framelength1)) {
+                       $framelength = $framelength2;
+               }
+               if (!$framelength) {
+
+                       // LAME 3.88 has a different value for modeextension on the first frame vs the rest
+                       $framelength1 = strpos($MPEGaudioData, substr($SyncPattern1, 0, 3), 4);
+                       $framelength2 = strpos($MPEGaudioData, substr($SyncPattern2, 0, 3), 4);
+
+                       if ($framelength1 > 4) {
+                               $framelength = $framelength1;
+                       }
+                       if (($framelength2 > 4) && ($framelength2 < $framelength1)) {
+                               $framelength = $framelength2;
+                       }
+                       if (!$framelength) {
+                               $info['error'][] = 'Cannot find next free-format synch pattern ('.getid3_lib::PrintHexBytes($SyncPattern1).' or '.getid3_lib::PrintHexBytes($SyncPattern2).') after offset '.$offset;
+                               return false;
+                       } else {
+                               $info['warning'][] = 'ModeExtension varies between first frame and other frames (known free-format issue in LAME 3.88)';
+                               $info['audio']['codec']   = 'LAME';
+                               $info['audio']['encoder'] = 'LAME3.88';
+                               $SyncPattern1 = substr($SyncPattern1, 0, 3);
+                               $SyncPattern2 = substr($SyncPattern2, 0, 3);
+                       }
+               }
+
+               if ($deepscan) {
+
+                       $ActualFrameLengthValues = array();
+                       $nextoffset = $offset + $framelength;
+                       while ($nextoffset < ($info['avdataend'] - 6)) {
+                               fseek($this->getid3->fp, $nextoffset - 1, SEEK_SET);
+                               $NextSyncPattern = fread($this->getid3->fp, 6);
+                               if ((substr($NextSyncPattern, 1, strlen($SyncPattern1)) == $SyncPattern1) || (substr($NextSyncPattern, 1, strlen($SyncPattern2)) == $SyncPattern2)) {
+                                       // good - found where expected
+                                       $ActualFrameLengthValues[] = $framelength;
+                               } elseif ((substr($NextSyncPattern, 0, strlen($SyncPattern1)) == $SyncPattern1) || (substr($NextSyncPattern, 0, strlen($SyncPattern2)) == $SyncPattern2)) {
+                                       // ok - found one byte earlier than expected (last frame wasn't padded, first frame was)
+                                       $ActualFrameLengthValues[] = ($framelength - 1);
+                                       $nextoffset--;
+                               } elseif ((substr($NextSyncPattern, 2, strlen($SyncPattern1)) == $SyncPattern1) || (substr($NextSyncPattern, 2, strlen($SyncPattern2)) == $SyncPattern2)) {
+                                       // ok - found one byte later than expected (last frame was padded, first frame wasn't)
+                                       $ActualFrameLengthValues[] = ($framelength + 1);
+                                       $nextoffset++;
+                               } else {
+                                       $info['error'][] = 'Did not find expected free-format sync pattern at offset '.$nextoffset;
+                                       return false;
+                               }
+                               $nextoffset += $framelength;
+                       }
+                       if (count($ActualFrameLengthValues) > 0) {
+                               $framelength = intval(round(array_sum($ActualFrameLengthValues) / count($ActualFrameLengthValues)));
+                       }
+               }
+               return $framelength;
+       }
+
+       public function getOnlyMPEGaudioInfoBruteForce() {
+               $MPEGaudioHeaderDecodeCache   = array();
+               $MPEGaudioHeaderValidCache    = array();
+               $MPEGaudioHeaderLengthCache   = array();
+               $MPEGaudioVersionLookup       = self::MPEGaudioVersionArray();
+               $MPEGaudioLayerLookup         = self::MPEGaudioLayerArray();
+               $MPEGaudioBitrateLookup       = self::MPEGaudioBitrateArray();
+               $MPEGaudioFrequencyLookup     = self::MPEGaudioFrequencyArray();
+               $MPEGaudioChannelModeLookup   = self::MPEGaudioChannelModeArray();
+               $MPEGaudioModeExtensionLookup = self::MPEGaudioModeExtensionArray();
+               $MPEGaudioEmphasisLookup      = self::MPEGaudioEmphasisArray();
+               $LongMPEGversionLookup        = array();
+               $LongMPEGlayerLookup          = array();
+               $LongMPEGbitrateLookup        = array();
+               $LongMPEGpaddingLookup        = array();
+               $LongMPEGfrequencyLookup      = array();
+               $Distribution['bitrate']      = array();
+               $Distribution['frequency']    = array();
+               $Distribution['layer']        = array();
+               $Distribution['version']      = array();
+               $Distribution['padding']      = array();
+
+               $info = &$this->getid3->info;
+               fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET);
+
+               $max_frames_scan = 5000;
+               $frames_scanned  = 0;
+
+               $previousvalidframe = $info['avdataoffset'];
+               while (ftell($this->getid3->fp) < $info['avdataend']) {
+                       set_time_limit(30);
+                       $head4 = fread($this->getid3->fp, 4);
+                       if (strlen($head4) < 4) {
+                               break;
+                       }
+                       if ($head4{0} != "\xFF") {
+                               for ($i = 1; $i < 4; $i++) {
+                                       if ($head4{$i} == "\xFF") {
+                                               fseek($this->getid3->fp, $i - 4, SEEK_CUR);
+                                               continue 2;
+                                       }
+                               }
+                               continue;
+                       }
+                       if (!isset($MPEGaudioHeaderDecodeCache[$head4])) {
+                               $MPEGaudioHeaderDecodeCache[$head4] = self::MPEGaudioHeaderDecode($head4);
+                       }
+                       if (!isset($MPEGaudioHeaderValidCache[$head4])) {
+                               $MPEGaudioHeaderValidCache[$head4] = self::MPEGaudioHeaderValid($MPEGaudioHeaderDecodeCache[$head4], false, false);
+                       }
+                       if ($MPEGaudioHeaderValidCache[$head4]) {
+
+                               if (!isset($MPEGaudioHeaderLengthCache[$head4])) {
+                                       $LongMPEGversionLookup[$head4]   = $MPEGaudioVersionLookup[$MPEGaudioHeaderDecodeCache[$head4]['version']];
+                                       $LongMPEGlayerLookup[$head4]     = $MPEGaudioLayerLookup[$MPEGaudioHeaderDecodeCache[$head4]['layer']];
+                                       $LongMPEGbitrateLookup[$head4]   = $MPEGaudioBitrateLookup[$LongMPEGversionLookup[$head4]][$LongMPEGlayerLookup[$head4]][$MPEGaudioHeaderDecodeCache[$head4]['bitrate']];
+                                       $LongMPEGpaddingLookup[$head4]   = (bool) $MPEGaudioHeaderDecodeCache[$head4]['padding'];
+                                       $LongMPEGfrequencyLookup[$head4] = $MPEGaudioFrequencyLookup[$LongMPEGversionLookup[$head4]][$MPEGaudioHeaderDecodeCache[$head4]['sample_rate']];
+                                       $MPEGaudioHeaderLengthCache[$head4] = self::MPEGaudioFrameLength(
+                                               $LongMPEGbitrateLookup[$head4],
+                                               $LongMPEGversionLookup[$head4],
+                                               $LongMPEGlayerLookup[$head4],
+                                               $LongMPEGpaddingLookup[$head4],
+                                               $LongMPEGfrequencyLookup[$head4]);
+                               }
+                               if ($MPEGaudioHeaderLengthCache[$head4] > 4) {
+                                       $WhereWeWere = ftell($this->getid3->fp);
+                                       fseek($this->getid3->fp, $MPEGaudioHeaderLengthCache[$head4] - 4, SEEK_CUR);
+                                       $next4 = fread($this->getid3->fp, 4);
+                                       if ($next4{0} == "\xFF") {
+                                               if (!isset($MPEGaudioHeaderDecodeCache[$next4])) {
+                                                       $MPEGaudioHeaderDecodeCache[$next4] = self::MPEGaudioHeaderDecode($next4);
+                                               }
+                                               if (!isset($MPEGaudioHeaderValidCache[$next4])) {
+                                                       $MPEGaudioHeaderValidCache[$next4] = self::MPEGaudioHeaderValid($MPEGaudioHeaderDecodeCache[$next4], false, false);
+                                               }
+                                               if ($MPEGaudioHeaderValidCache[$next4]) {
+                                                       fseek($this->getid3->fp, -4, SEEK_CUR);
+
+                                                       getid3_lib::safe_inc($Distribution['bitrate'][$LongMPEGbitrateLookup[$head4]]);
+                                                       getid3_lib::safe_inc($Distribution['layer'][$LongMPEGlayerLookup[$head4]]);
+                                                       getid3_lib::safe_inc($Distribution['version'][$LongMPEGversionLookup[$head4]]);
+                                                       getid3_lib::safe_inc($Distribution['padding'][intval($LongMPEGpaddingLookup[$head4])]);
+                                                       getid3_lib::safe_inc($Distribution['frequency'][$LongMPEGfrequencyLookup[$head4]]);
+                                                       if ($max_frames_scan && (++$frames_scanned >= $max_frames_scan)) {
+                                                               $pct_data_scanned = (ftell($this->getid3->fp) - $info['avdataoffset']) / ($info['avdataend'] - $info['avdataoffset']);
+                                                               $info['warning'][] = 'too many MPEG audio frames to scan, only scanned first '.$max_frames_scan.' frames ('.number_format($pct_data_scanned * 100, 1).'% of file) and extrapolated distribution, playtime and bitrate may be incorrect.';
+                                                               foreach ($Distribution as $key1 => $value1) {
+                                                                       foreach ($value1 as $key2 => $value2) {
+                                                                               $Distribution[$key1][$key2] = round($value2 / $pct_data_scanned);
+                                                                       }
+                                                               }
+                                                               break;
+                                                       }
+                                                       continue;
+                                               }
+                                       }
+                                       unset($next4);
+                                       fseek($this->getid3->fp, $WhereWeWere - 3, SEEK_SET);
+                               }
+
+                       }
+               }
+               foreach ($Distribution as $key => $value) {
+                       ksort($Distribution[$key], SORT_NUMERIC);
+               }
+               ksort($Distribution['version'], SORT_STRING);
+               $info['mpeg']['audio']['bitrate_distribution']   = $Distribution['bitrate'];
+               $info['mpeg']['audio']['frequency_distribution'] = $Distribution['frequency'];
+               $info['mpeg']['audio']['layer_distribution']     = $Distribution['layer'];
+               $info['mpeg']['audio']['version_distribution']   = $Distribution['version'];
+               $info['mpeg']['audio']['padding_distribution']   = $Distribution['padding'];
+               if (count($Distribution['version']) > 1) {
+                       $info['error'][] = 'Corrupt file - more than one MPEG version detected';
+               }
+               if (count($Distribution['layer']) > 1) {
+                       $info['error'][] = 'Corrupt file - more than one MPEG layer detected';
+               }
+               if (count($Distribution['frequency']) > 1) {
+                       $info['error'][] = 'Corrupt file - more than one MPEG sample rate detected';
+               }
+
+
+               $bittotal = 0;
+               foreach ($Distribution['bitrate'] as $bitratevalue => $bitratecount) {
+                       if ($bitratevalue != 'free') {
+                               $bittotal += ($bitratevalue * $bitratecount);
+                       }
+               }
+               $info['mpeg']['audio']['frame_count']  = array_sum($Distribution['bitrate']);
+               if ($info['mpeg']['audio']['frame_count'] == 0) {
+                       $info['error'][] = 'no MPEG audio frames found';
+                       return false;
+               }
+               $info['mpeg']['audio']['bitrate']      = ($bittotal / $info['mpeg']['audio']['frame_count']);
+               $info['mpeg']['audio']['bitrate_mode'] = ((count($Distribution['bitrate']) > 0) ? 'vbr' : 'cbr');
+               $info['mpeg']['audio']['sample_rate']  = getid3_lib::array_max($Distribution['frequency'], true);
+
+               $info['audio']['bitrate']      = $info['mpeg']['audio']['bitrate'];
+               $info['audio']['bitrate_mode'] = $info['mpeg']['audio']['bitrate_mode'];
+               $info['audio']['sample_rate']  = $info['mpeg']['audio']['sample_rate'];
+               $info['audio']['dataformat']   = 'mp'.getid3_lib::array_max($Distribution['layer'], true);
+               $info['fileformat']            = $info['audio']['dataformat'];
+
+               return true;
+       }
+
+
+       public function getOnlyMPEGaudioInfo($avdataoffset, $BitrateHistogram=false) {
+               // looks for synch, decodes MPEG audio header
+
+               $info = &$this->getid3->info;
+
+               static $MPEGaudioVersionLookup;
+               static $MPEGaudioLayerLookup;
+               static $MPEGaudioBitrateLookup;
+               if (empty($MPEGaudioVersionLookup)) {
+                  $MPEGaudioVersionLookup = self::MPEGaudioVersionArray();
+                  $MPEGaudioLayerLookup   = self::MPEGaudioLayerArray();
+                  $MPEGaudioBitrateLookup = self::MPEGaudioBitrateArray();
+
+               }
+
+               fseek($this->getid3->fp, $avdataoffset, SEEK_SET);
+               $sync_seek_buffer_size = min(128 * 1024, $info['avdataend'] - $avdataoffset);
+               if ($sync_seek_buffer_size <= 0) {
+                       $info['error'][] = 'Invalid $sync_seek_buffer_size at offset '.$avdataoffset;
+                       return false;
+               }
+               $header = fread($this->getid3->fp, $sync_seek_buffer_size);
+               $sync_seek_buffer_size = strlen($header);
+               $SynchSeekOffset = 0;
+               while ($SynchSeekOffset < $sync_seek_buffer_size) {
+                       if ((($avdataoffset + $SynchSeekOffset)  < $info['avdataend']) && !feof($this->getid3->fp)) {
+
+                               if ($SynchSeekOffset > $sync_seek_buffer_size) {
+                                       // if a synch's not found within the first 128k bytes, then give up
+                                       $info['error'][] = 'Could not find valid MPEG audio synch within the first '.round($sync_seek_buffer_size / 1024).'kB';
+                                       if (isset($info['audio']['bitrate'])) {
+                                               unset($info['audio']['bitrate']);
+                                       }
+                                       if (isset($info['mpeg']['audio'])) {
+                                               unset($info['mpeg']['audio']);
+                                       }
+                                       if (empty($info['mpeg'])) {
+                                               unset($info['mpeg']);
+                                       }
+                                       return false;
+
+                               } elseif (feof($this->getid3->fp)) {
+
+                                       $info['error'][] = 'Could not find valid MPEG audio synch before end of file';
+                                       if (isset($info['audio']['bitrate'])) {
+                                               unset($info['audio']['bitrate']);
+                                       }
+                                       if (isset($info['mpeg']['audio'])) {
+                                               unset($info['mpeg']['audio']);
+                                       }
+                                       if (isset($info['mpeg']) && (!is_array($info['mpeg']) || (count($info['mpeg']) == 0))) {
+                                               unset($info['mpeg']);
+                                       }
+                                       return false;
+                               }
+                       }
+
+                       if (($SynchSeekOffset + 1) >= strlen($header)) {
+                               $info['error'][] = 'Could not find valid MPEG synch before end of file';
+                               return false;
+                       }
+
+                       if (($header{$SynchSeekOffset} == "\xFF") && ($header{($SynchSeekOffset + 1)} > "\xE0")) { // synch detected
+                               if (!isset($FirstFrameThisfileInfo) && !isset($info['mpeg']['audio'])) {
+                                       $FirstFrameThisfileInfo = $info;
+                                       $FirstFrameAVDataOffset = $avdataoffset + $SynchSeekOffset;
+                                       if (!$this->decodeMPEGaudioHeader($FirstFrameAVDataOffset, $FirstFrameThisfileInfo, false)) {
+                                               // if this is the first valid MPEG-audio frame, save it in case it's a VBR header frame and there's
+                                               // garbage between this frame and a valid sequence of MPEG-audio frames, to be restored below
+                                               unset($FirstFrameThisfileInfo);
+                                       }
+                               }
+
+                               $dummy = $info; // only overwrite real data if valid header found
+                               if ($this->decodeMPEGaudioHeader($avdataoffset + $SynchSeekOffset, $dummy, true)) {
+                                       $info = $dummy;
+                                       $info['avdataoffset'] = $avdataoffset + $SynchSeekOffset;
+                                       switch (isset($info['fileformat']) ? $info['fileformat'] : '') {
+                                               case '':
+                                               case 'id3':
+                                               case 'ape':
+                                               case 'mp3':
+                                                       $info['fileformat']          = 'mp3';
+                                                       $info['audio']['dataformat'] = 'mp3';
+                                                       break;
+                                       }
+                                       if (isset($FirstFrameThisfileInfo['mpeg']['audio']['bitrate_mode']) && ($FirstFrameThisfileInfo['mpeg']['audio']['bitrate_mode'] == 'vbr')) {
+                                               if (!(abs($info['audio']['bitrate'] - $FirstFrameThisfileInfo['audio']['bitrate']) <= 1)) {
+                                                       // If there is garbage data between a valid VBR header frame and a sequence
+                                                       // of valid MPEG-audio frames the VBR data is no longer discarded.
+                                                       $info = $FirstFrameThisfileInfo;
+                                                       $info['avdataoffset']        = $FirstFrameAVDataOffset;
+                                                       $info['fileformat']          = 'mp3';
+                                                       $info['audio']['dataformat'] = 'mp3';
+                                                       $dummy                       = $info;
+                                                       unset($dummy['mpeg']['audio']);
+                                                       $GarbageOffsetStart = $FirstFrameAVDataOffset + $FirstFrameThisfileInfo['mpeg']['audio']['framelength'];
+                                                       $GarbageOffsetEnd   = $avdataoffset + $SynchSeekOffset;
+                                                       if ($this->decodeMPEGaudioHeader($GarbageOffsetEnd, $dummy, true, true)) {
+                                                               $info = $dummy;
+                                                               $info['avdataoffset'] = $GarbageOffsetEnd;
+                                                               $info['warning'][] = 'apparently-valid VBR header not used because could not find '.GETID3_MP3_VALID_CHECK_FRAMES.' consecutive MPEG-audio frames immediately after VBR header (garbage data for '.($GarbageOffsetEnd - $GarbageOffsetStart).' bytes between '.$GarbageOffsetStart.' and '.$GarbageOffsetEnd.'), but did find valid CBR stream starting at '.$GarbageOffsetEnd;
+                                                       } else {
+                                                               $info['warning'][] = 'using data from VBR header even though could not find '.GETID3_MP3_VALID_CHECK_FRAMES.' consecutive MPEG-audio frames immediately after VBR header (garbage data for '.($GarbageOffsetEnd - $GarbageOffsetStart).' bytes between '.$GarbageOffsetStart.' and '.$GarbageOffsetEnd.')';
+                                                       }
+                                               }
+                                       }
+                                       if (isset($info['mpeg']['audio']['bitrate_mode']) && ($info['mpeg']['audio']['bitrate_mode'] == 'vbr') && !isset($info['mpeg']['audio']['VBR_method'])) {
+                                               // VBR file with no VBR header
+                                               $BitrateHistogram = true;
+                                       }
+
+                                       if ($BitrateHistogram) {
+
+                                               $info['mpeg']['audio']['stereo_distribution']  = array('stereo'=>0, 'joint stereo'=>0, 'dual channel'=>0, 'mono'=>0);
+                                               $info['mpeg']['audio']['version_distribution'] = array('1'=>0, '2'=>0, '2.5'=>0);
+
+                                               if ($info['mpeg']['audio']['version'] == '1') {
+                                                       if ($info['mpeg']['audio']['layer'] == 3) {
+                                                               $info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 32000=>0, 40000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 320000=>0);
+                                                       } elseif ($info['mpeg']['audio']['layer'] == 2) {
+                                                               $info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 32000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 320000=>0, 384000=>0);
+                                                       } elseif ($info['mpeg']['audio']['layer'] == 1) {
+                                                               $info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 32000=>0, 64000=>0, 96000=>0, 128000=>0, 160000=>0, 192000=>0, 224000=>0, 256000=>0, 288000=>0, 320000=>0, 352000=>0, 384000=>0, 416000=>0, 448000=>0);
+                                                       }
+                                               } elseif ($info['mpeg']['audio']['layer'] == 1) {
+                                                       $info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 32000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 144000=>0, 160000=>0, 176000=>0, 192000=>0, 224000=>0, 256000=>0);
+                                               } else {
+                                                       $info['mpeg']['audio']['bitrate_distribution'] = array('free'=>0, 8000=>0, 16000=>0, 24000=>0, 32000=>0, 40000=>0, 48000=>0, 56000=>0, 64000=>0, 80000=>0, 96000=>0, 112000=>0, 128000=>0, 144000=>0, 160000=>0);
+                                               }
+
+                                               $dummy = array('error'=>$info['error'], 'warning'=>$info['warning'], 'avdataend'=>$info['avdataend'], 'avdataoffset'=>$info['avdataoffset']);
+                                               $synchstartoffset = $info['avdataoffset'];
+                                               fseek($this->getid3->fp, $info['avdataoffset'], SEEK_SET);
+
+                                               // you can play with these numbers:
+                                               $max_frames_scan  = 50000;
+                                               $max_scan_segments = 10;
+
+                                               // don't play with these numbers:
+                                               $FastMode = false;
+                                               $SynchErrorsFound = 0;
+                                               $frames_scanned   = 0;
+                                               $this_scan_segment = 0;
+                                               $frames_scan_per_segment = ceil($max_frames_scan / $max_scan_segments);
+                                               $pct_data_scanned = 0;
+                                               for ($current_segment = 0; $current_segment < $max_scan_segments; $current_segment++) {
+                                                       $frames_scanned_this_segment = 0;
+                                                       if (ftell($this->getid3->fp) >= $info['avdataend']) {
+                                                               break;
+                                                       }
+                                                       $scan_start_offset[$current_segment] = max(ftell($this->getid3->fp), $info['avdataoffset'] + round($current_segment * (($info['avdataend'] - $info['avdataoffset']) / $max_scan_segments)));
+                                                       if ($current_segment > 0) {
+                                                               fseek($this->getid3->fp, $scan_start_offset[$current_segment], SEEK_SET);
+                                                               $buffer_4k = fread($this->getid3->fp, 4096);
+                                                               for ($j = 0; $j < (strlen($buffer_4k) - 4); $j++) {
+                                                                       if (($buffer_4k{$j} == "\xFF") && ($buffer_4k{($j + 1)} > "\xE0")) { // synch detected
+                                                                               if ($this->decodeMPEGaudioHeader($scan_start_offset[$current_segment] + $j, $dummy, false, false, $FastMode)) {
+                                                                                       $calculated_next_offset = $scan_start_offset[$current_segment] + $j + $dummy['mpeg']['audio']['framelength'];
+                                                                                       if ($this->decodeMPEGaudioHeader($calculated_next_offset, $dummy, false, false, $FastMode)) {
+                                                                                               $scan_start_offset[$current_segment] += $j;
+                                                                                               break;
+                                                                                       }
+                                                                               }
+                                                                       }
+                                                               }
+                                                       }
+                                                       $synchstartoffset = $scan_start_offset[$current_segment];
+                                                       while ($this->decodeMPEGaudioHeader($synchstartoffset, $dummy, false, false, $FastMode)) {
+                                                               $FastMode = true;
+                                                               $thisframebitrate = $MPEGaudioBitrateLookup[$MPEGaudioVersionLookup[$dummy['mpeg']['audio']['raw']['version']]][$MPEGaudioLayerLookup[$dummy['mpeg']['audio']['raw']['layer']]][$dummy['mpeg']['audio']['raw']['bitrate']];
+
+                                                               if (empty($dummy['mpeg']['audio']['framelength'])) {
+                                                                       $SynchErrorsFound++;
+                                                                       $synchstartoffset++;
+                                                               } else {
+                                                                       getid3_lib::safe_inc($info['mpeg']['audio']['bitrate_distribution'][$thisframebitrate]);
+                                                                       getid3_lib::safe_inc($info['mpeg']['audio']['stereo_distribution'][$dummy['mpeg']['audio']['channelmode']]);
+                                                                       getid3_lib::safe_inc($info['mpeg']['audio']['version_distribution'][$dummy['mpeg']['audio']['version']]);
+                                                                       $synchstartoffset += $dummy['mpeg']['audio']['framelength'];
+                                                               }
+                                                               $frames_scanned++;
+                                                               if ($frames_scan_per_segment && (++$frames_scanned_this_segment >= $frames_scan_per_segment)) {
+                                                                       $this_pct_scanned = (ftell($this->getid3->fp) - $scan_start_offset[$current_segment]) / ($info['avdataend'] - $info['avdataoffset']);
+                                                                       if (($current_segment == 0) && (($this_pct_scanned * $max_scan_segments) >= 1)) {
+                                                                               // file likely contains < $max_frames_scan, just scan as one segment
+                                                                               $max_scan_segments = 1;
+                                                                               $frames_scan_per_segment = $max_frames_scan;
+                                                                       } else {
+                                                                               $pct_data_scanned += $this_pct_scanned;
+                                                                               break;
+                                                                       }
+                                                               }
+                                                       }
+                                               }
+                                               if ($pct_data_scanned > 0) {
+                                                       $info['warning'][] = 'too many MPEG audio frames to scan, only scanned '.$frames_scanned.' frames in '.$max_scan_segments.' segments ('.number_format($pct_data_scanned * 100, 1).'% of file) and extrapolated distribution, playtime and bitrate may be incorrect.';
+                                                       foreach ($info['mpeg']['audio'] as $key1 => $value1) {
+                                                               if (!preg_match('#_distribution$#i', $key1)) {
+                                                                       continue;
+                                                               }
+                                                               foreach ($value1 as $key2 => $value2) {
+                                                                       $info['mpeg']['audio'][$key1][$key2] = round($value2 / $pct_data_scanned);
+                                                               }
+                                                       }
+                                               }
+
+                                               if ($SynchErrorsFound > 0) {
+                                                       $info['warning'][] = 'Found '.$SynchErrorsFound.' synch errors in histogram analysis';
+                                                       //return false;
+                                               }
+
+                                               $bittotal     = 0;
+                                               $framecounter = 0;
+                                               foreach ($info['mpeg']['audio']['bitrate_distribution'] as $bitratevalue => $bitratecount) {
+                                                       $framecounter += $bitratecount;
+                                                       if ($bitratevalue != 'free') {
+                                                               $bittotal += ($bitratevalue * $bitratecount);
+                                                       }
+                                               }
+                                               if ($framecounter == 0) {
+                                                       $info['error'][] = 'Corrupt MP3 file: framecounter == zero';
+                                                       return false;
+                                               }
+                                               $info['mpeg']['audio']['frame_count'] = getid3_lib::CastAsInt($framecounter);
+                                               $info['mpeg']['audio']['bitrate']     = ($bittotal / $framecounter);
+
+                                               $info['audio']['bitrate'] = $info['mpeg']['audio']['bitrate'];
+
+
+                                               // Definitively set VBR vs CBR, even if the Xing/LAME/VBRI header says differently
+                                               $distinct_bitrates = 0;
+                                               foreach ($info['mpeg']['audio']['bitrate_distribution'] as $bitrate_value => $bitrate_count) {
+                                                       if ($bitrate_count > 0) {
+                                                               $distinct_bitrates++;
+                                                       }
+                                               }
+                                               if ($distinct_bitrates > 1) {
+                                                       $info['mpeg']['audio']['bitrate_mode'] = 'vbr';
+                                               } else {
+                                                       $info['mpeg']['audio']['bitrate_mode'] = 'cbr';
+                                               }
+                                               $info['audio']['bitrate_mode'] = $info['mpeg']['audio']['bitrate_mode'];
+
+                                       }
+
+                                       break; // exit while()
+                               }
+                       }
+
+                       $SynchSeekOffset++;
+                       if (($avdataoffset + $SynchSeekOffset) >= $info['avdataend']) {
+                               // end of file/data
+
+                               if (empty($info['mpeg']['audio'])) {
+
+                                       $info['error'][] = 'could not find valid MPEG synch before end of file';
+                                       if (isset($info['audio']['bitrate'])) {
+                                               unset($info['audio']['bitrate']);
+                                       }
+                                       if (isset($info['mpeg']['audio'])) {
+                                               unset($info['mpeg']['audio']);
+                                       }
+                                       if (isset($info['mpeg']) && (!is_array($info['mpeg']) || empty($info['mpeg']))) {
+                                               unset($info['mpeg']);
+                                       }
+                                       return false;
+
+                               }
+                               break;
+                       }
+
+               }
+               $info['audio']['channels']        = $info['mpeg']['audio']['channels'];
+               $info['audio']['channelmode']     = $info['mpeg']['audio']['channelmode'];
+               $info['audio']['sample_rate']     = $info['mpeg']['audio']['sample_rate'];
+               return true;
+       }
+
+
+       public static function MPEGaudioVersionArray() {
+               static $MPEGaudioVersion = array('2.5', false, '2', '1');
+               return $MPEGaudioVersion;
+       }
+
+       public static function MPEGaudioLayerArray() {
+               static $MPEGaudioLayer = array(false, 3, 2, 1);
+               return $MPEGaudioLayer;
+       }
+
+       public static function MPEGaudioBitrateArray() {
+               static $MPEGaudioBitrate;
+               if (empty($MPEGaudioBitrate)) {
+                       $MPEGaudioBitrate = array (
+                               '1'  =>  array (1 => array('free', 32000, 64000, 96000, 128000, 160000, 192000, 224000, 256000, 288000, 320000, 352000, 384000, 416000, 448000),
+                                                               2 => array('free', 32000, 48000, 56000,  64000,  80000,  96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000, 384000),
+                                                               3 => array('free', 32000, 40000, 48000,  56000,  64000,  80000,  96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000)
+                                                          ),
+
+                               '2'  =>  array (1 => array('free', 32000, 48000, 56000,  64000,  80000,  96000, 112000, 128000, 144000, 160000, 176000, 192000, 224000, 256000),
+                                                               2 => array('free',  8000, 16000, 24000,  32000,  40000,  48000,  56000,  64000,  80000,  96000, 112000, 128000, 144000, 160000),
+                                                          )
+                       );
+                       $MPEGaudioBitrate['2'][3] = $MPEGaudioBitrate['2'][2];
+                       $MPEGaudioBitrate['2.5']  = $MPEGaudioBitrate['2'];
+               }
+               return $MPEGaudioBitrate;
+       }
+
+       public static function MPEGaudioFrequencyArray() {
+               static $MPEGaudioFrequency;
+               if (empty($MPEGaudioFrequency)) {
+                       $MPEGaudioFrequency = array (
+                               '1'   => array(44100, 48000, 32000),
+                               '2'   => array(22050, 24000, 16000),
+                               '2.5' => array(11025, 12000,  8000)
+                       );
+               }
+               return $MPEGaudioFrequency;
+       }
+
+       public static function MPEGaudioChannelModeArray() {
+               static $MPEGaudioChannelMode = array('stereo', 'joint stereo', 'dual channel', 'mono');
+               return $MPEGaudioChannelMode;
+       }
+
+       public static function MPEGaudioModeExtensionArray() {
+               static $MPEGaudioModeExtension;
+               if (empty($MPEGaudioModeExtension)) {
+                       $MPEGaudioModeExtension = array (
+                               1 => array('4-31', '8-31', '12-31', '16-31'),
+                               2 => array('4-31', '8-31', '12-31', '16-31'),
+                               3 => array('', 'IS', 'MS', 'IS+MS')
+                       );
+               }
+               return $MPEGaudioModeExtension;
+       }
+
+       public static function MPEGaudioEmphasisArray() {
+               static $MPEGaudioEmphasis = array('none', '50/15ms', false, 'CCIT J.17');
+               return $MPEGaudioEmphasis;
+       }
+
+       public static function MPEGaudioHeaderBytesValid($head4, $allowBitrate15=false) {
+               return self::MPEGaudioHeaderValid(self::MPEGaudioHeaderDecode($head4), false, $allowBitrate15);
+       }
+
+       public static function MPEGaudioHeaderValid($rawarray, $echoerrors=false, $allowBitrate15=false) {
+               if (($rawarray['synch'] & 0x0FFE) != 0x0FFE) {
+                       return false;
+               }
+
+               static $MPEGaudioVersionLookup;
+               static $MPEGaudioLayerLookup;
+               static $MPEGaudioBitrateLookup;
+               static $MPEGaudioFrequencyLookup;
+               static $MPEGaudioChannelModeLookup;
+               static $MPEGaudioModeExtensionLookup;
+               static $MPEGaudioEmphasisLookup;
+               if (empty($MPEGaudioVersionLookup)) {
+                       $MPEGaudioVersionLookup       = self::MPEGaudioVersionArray();
+                       $MPEGaudioLayerLookup         = self::MPEGaudioLayerArray();
+                       $MPEGaudioBitrateLookup       = self::MPEGaudioBitrateArray();
+                       $MPEGaudioFrequencyLookup     = self::MPEGaudioFrequencyArray();
+                       $MPEGaudioChannelModeLookup   = self::MPEGaudioChannelModeArray();
+                       $MPEGaudioModeExtensionLookup = self::MPEGaudioModeExtensionArray();
+                       $MPEGaudioEmphasisLookup      = self::MPEGaudioEmphasisArray();
+               }
+
+               if (isset($MPEGaudioVersionLookup[$rawarray['version']])) {
+                       $decodedVersion = $MPEGaudioVersionLookup[$rawarray['version']];
+               } else {
+                       echo ($echoerrors ? "\n".'invalid Version ('.$rawarray['version'].')' : '');
+                       return false;
+               }
+               if (isset($MPEGaudioLayerLookup[$rawarray['layer']])) {
+                       $decodedLayer = $MPEGaudioLayerLookup[$rawarray['layer']];
+               } else {
+                       echo ($echoerrors ? "\n".'invalid Layer ('.$rawarray['layer'].')' : '');
+                       return false;
+               }
+               if (!isset($MPEGaudioBitrateLookup[$decodedVersion][$decodedLayer][$rawarray['bitrate']])) {
+                       echo ($echoerrors ? "\n".'invalid Bitrate ('.$rawarray['bitrate'].')' : '');
+                       if ($rawarray['bitrate'] == 15) {
+                               // known issue in LAME 3.90 - 3.93.1 where free-format has bitrate ID of 15 instead of 0
+                               // let it go through here otherwise file will not be identified
+                               if (!$allowBitrate15) {
+                                       return false;
+                               }
+                       } else {
+                               return false;
+                       }
+               }
+               if (!isset($MPEGaudioFrequencyLookup[$decodedVersion][$rawarray['sample_rate']])) {
+                       echo ($echoerrors ? "\n".'invalid Frequency ('.$rawarray['sample_rate'].')' : '');
+                       return false;
+               }
+               if (!isset($MPEGaudioChannelModeLookup[$rawarray['channelmode']])) {
+                       echo ($echoerrors ? "\n".'invalid ChannelMode ('.$rawarray['channelmode'].')' : '');
+                       return false;
+               }
+               if (!isset($MPEGaudioModeExtensionLookup[$decodedLayer][$rawarray['modeextension']])) {
+                       echo ($echoerrors ? "\n".'invalid Mode Extension ('.$rawarray['modeextension'].')' : '');
+                       return false;
+               }
+               if (!isset($MPEGaudioEmphasisLookup[$rawarray['emphasis']])) {
+                       echo ($echoerrors ? "\n".'invalid Emphasis ('.$rawarray['emphasis'].')' : '');
+                       return false;
+               }
+               // These are just either set or not set, you can't mess that up :)
+               // $rawarray['protection'];
+               // $rawarray['padding'];
+               // $rawarray['private'];
+               // $rawarray['copyright'];
+               // $rawarray['original'];
+
+               return true;
+       }
+
+       public static function MPEGaudioHeaderDecode($Header4Bytes) {
+               // AAAA AAAA  AAAB BCCD  EEEE FFGH  IIJJ KLMM
+               // A - Frame sync (all bits set)
+               // B - MPEG Audio version ID
+               // C - Layer description
+               // D - Protection bit
+               // E - Bitrate index
+               // F - Sampling rate frequency index
+               // G - Padding bit
+               // H - Private bit
+               // I - Channel Mode
+               // J - Mode extension (Only if Joint stereo)
+               // K - Copyright
+               // L - Original
+               // M - Emphasis
+
+               if (strlen($Header4Bytes) != 4) {
+                       return false;
+               }
+
+               $MPEGrawHeader['synch']         = (getid3_lib::BigEndian2Int(substr($Header4Bytes, 0, 2)) & 0xFFE0) >> 4;
+               $MPEGrawHeader['version']       = (ord($Header4Bytes{1}) & 0x18) >> 3; //    BB
+               $MPEGrawHeader['layer']         = (ord($Header4Bytes{1}) & 0x06) >> 1; //      CC
+               $MPEGrawHeader['protection']    = (ord($Header4Bytes{1}) & 0x01);      //        D
+               $MPEGrawHeader['bitrate']       = (ord($Header4Bytes{2}) & 0xF0) >> 4; // EEEE
+               $MPEGrawHeader['sample_rate']   = (ord($Header4Bytes{2}) & 0x0C) >> 2; //     FF
+               $MPEGrawHeader['padding']       = (ord($Header4Bytes{2}) & 0x02) >> 1; //       G
+               $MPEGrawHeader['private']       = (ord($Header4Bytes{2}) & 0x01);      //        H
+               $MPEGrawHeader['channelmode']   = (ord($Header4Bytes{3}) & 0xC0) >> 6; // II
+               $MPEGrawHeader['modeextension'] = (ord($Header4Bytes{3}) & 0x30) >> 4; //   JJ
+               $MPEGrawHeader['copyright']     = (ord($Header4Bytes{3}) & 0x08) >> 3; //     K
+               $MPEGrawHeader['original']      = (ord($Header4Bytes{3}) & 0x04) >> 2; //      L
+               $MPEGrawHeader['emphasis']      = (ord($Header4Bytes{3}) & 0x03);      //       MM
+
+               return $MPEGrawHeader;
+       }
+
+       public static function MPEGaudioFrameLength(&$bitrate, &$version, &$layer, $padding, &$samplerate) {
+               static $AudioFrameLengthCache = array();
+
+               if (!isset($AudioFrameLengthCache[$bitrate][$version][$layer][$padding][$samplerate])) {
+                       $AudioFrameLengthCache[$bitrate][$version][$layer][$padding][$samplerate] = false;
+                       if ($bitrate != 'free') {
+
+                               if ($version == '1') {
+
+                                       if ($layer == '1') {
+
+                                               // For Layer I slot is 32 bits long
+                                               $FrameLengthCoefficient = 48;
+                                               $SlotLength = 4;
+
+                                       } else { // Layer 2 / 3
+
+                                               // for Layer 2 and Layer 3 slot is 8 bits long.
+                                               $FrameLengthCoefficient = 144;
+                                               $SlotLength = 1;
+
+                                       }
+
+                               } else { // MPEG-2 / MPEG-2.5
+
+                                       if ($layer == '1') {
+
+                                               // For Layer I slot is 32 bits long
+                                               $FrameLengthCoefficient = 24;
+                                               $SlotLength = 4;
+
+                                       } elseif ($layer == '2') {
+
+                                               // for Layer 2 and Layer 3 slot is 8 bits long.
+                                               $FrameLengthCoefficient = 144;
+                                               $SlotLength = 1;
+
+                                       } else { // layer 3
+
+                                               // for Layer 2 and Layer 3 slot is 8 bits long.
+                                               $FrameLengthCoefficient = 72;
+                                               $SlotLength = 1;
+
+                                       }
+
+                               }
+
+                               // FrameLengthInBytes = ((Coefficient * BitRate) / SampleRate) + Padding
+                               if ($samplerate > 0) {
+                                       $NewFramelength  = ($FrameLengthCoefficient * $bitrate) / $samplerate;
+                                       $NewFramelength  = floor($NewFramelength / $SlotLength) * $SlotLength; // round to next-lower multiple of SlotLength (1 byte for Layer 2/3, 4 bytes for Layer I)
+                                       if ($padding) {
+                                               $NewFramelength += $SlotLength;
+                                       }
+                                       $AudioFrameLengthCache[$bitrate][$version][$layer][$padding][$samplerate] = (int) $NewFramelength;
+                               }
+                       }
+               }
+               return $AudioFrameLengthCache[$bitrate][$version][$layer][$padding][$samplerate];
+       }
+
+       public static function ClosestStandardMP3Bitrate($bit_rate) {
+               static $standard_bit_rates = array (320000, 256000, 224000, 192000, 160000, 128000, 112000, 96000, 80000, 64000, 56000, 48000, 40000, 32000, 24000, 16000, 8000);
+               static $bit_rate_table = array (0=>'-');
+               $round_bit_rate = intval(round($bit_rate, -3));
+               if (!isset($bit_rate_table[$round_bit_rate])) {
+                       if ($round_bit_rate > max($standard_bit_rates)) {
+                               $bit_rate_table[$round_bit_rate] = round($bit_rate, 2 - strlen($bit_rate));
+                       } else {
+                               $bit_rate_table[$round_bit_rate] = max($standard_bit_rates);
+                               foreach ($standard_bit_rates as $standard_bit_rate) {
+                                       if ($round_bit_rate >= $standard_bit_rate + (($bit_rate_table[$round_bit_rate] - $standard_bit_rate) / 2)) {
+                                               break;
+                                       }
+                                       $bit_rate_table[$round_bit_rate] = $standard_bit_rate;
+                               }
+                       }
+               }
+               return $bit_rate_table[$round_bit_rate];
+       }
+
+       public static function XingVBRidOffset($version, $channelmode) {
+               static $XingVBRidOffsetCache = array();
+               if (empty($XingVBRidOffset)) {
+                       $XingVBRidOffset = array (
+                               '1'   => array ('mono'          => 0x15, // 4 + 17 = 21
+                                                               'stereo'        => 0x24, // 4 + 32 = 36
+                                                               'joint stereo'  => 0x24,
+                                                               'dual channel'  => 0x24
+                                                          ),
+
+                               '2'   => array ('mono'          => 0x0D, // 4 +  9 = 13
+                                                               'stereo'        => 0x15, // 4 + 17 = 21
+                                                               'joint stereo'  => 0x15,
+                                                               'dual channel'  => 0x15
+                                                          ),
+
+                               '2.5' => array ('mono'          => 0x15,
+                                                               'stereo'        => 0x15,
+                                                               'joint stereo'  => 0x15,
+                                                               'dual channel'  => 0x15
+                                                          )
+                       );
+               }
+               return $XingVBRidOffset[$version][$channelmode];
+       }
+
+       public static function LAMEvbrMethodLookup($VBRmethodID) {
+               static $LAMEvbrMethodLookup = array(
+                       0x00 => 'unknown',
+                       0x01 => 'cbr',
+                       0x02 => 'abr',
+                       0x03 => 'vbr-old / vbr-rh',
+                       0x04 => 'vbr-new / vbr-mtrh',
+                       0x05 => 'vbr-mt',
+                       0x06 => 'vbr (full vbr method 4)',
+                       0x08 => 'cbr (constant bitrate 2 pass)',
+                       0x09 => 'abr (2 pass)',
+                       0x0F => 'reserved'
+               );
+               return (isset($LAMEvbrMethodLookup[$VBRmethodID]) ? $LAMEvbrMethodLookup[$VBRmethodID] : '');
+       }
+
+       public static function LAMEmiscStereoModeLookup($StereoModeID) {
+               static $LAMEmiscStereoModeLookup = array(
+                       0 => 'mono',
+                       1 => 'stereo',
+                       2 => 'dual mono',
+                       3 => 'joint stereo',
+                       4 => 'forced stereo',
+                       5 => 'auto',
+                       6 => 'intensity stereo',
+                       7 => 'other'
+               );
+               return (isset($LAMEmiscStereoModeLookup[$StereoModeID]) ? $LAMEmiscStereoModeLookup[$StereoModeID] : '');
+       }
+
+       public static function LAMEmiscSourceSampleFrequencyLookup($SourceSampleFrequencyID) {
+               static $LAMEmiscSourceSampleFrequencyLookup = array(
+                       0 => '<= 32 kHz',
+                       1 => '44.1 kHz',
+                       2 => '48 kHz',
+                       3 => '> 48kHz'
+               );
+               return (isset($LAMEmiscSourceSampleFrequencyLookup[$SourceSampleFrequencyID]) ? $LAMEmiscSourceSampleFrequencyLookup[$SourceSampleFrequencyID] : '');
+       }
+
+       public static function LAMEsurroundInfoLookup($SurroundInfoID) {
+               static $LAMEsurroundInfoLookup = array(
+                       0 => 'no surround info',
+                       1 => 'DPL encoding',
+                       2 => 'DPL2 encoding',
+                       3 => 'Ambisonic encoding'
+               );
+               return (isset($LAMEsurroundInfoLookup[$SurroundInfoID]) ? $LAMEsurroundInfoLookup[$SurroundInfoID] : 'reserved');
+       }
+
+       public static function LAMEpresetUsedLookup($LAMEtag) {
+
+               if ($LAMEtag['preset_used_id'] == 0) {
+                       // no preset used (LAME >=3.93)
+                       // no preset recorded (LAME <3.93)
+                       return '';
+               }
+               $LAMEpresetUsedLookup = array();
+
+               /////  THIS PART CANNOT BE STATIC .
+               for ($i = 8; $i <= 320; $i++) {
+                       switch ($LAMEtag['vbr_method']) {
+                               case 'cbr':
+                                       $LAMEpresetUsedLookup[$i] = '--alt-preset '.$LAMEtag['vbr_method'].' '.$i;
+                                       break;
+                               case 'abr':
+                               default: // other VBR modes shouldn't be here(?)
+                                       $LAMEpresetUsedLookup[$i] = '--alt-preset '.$i;
+                                       break;
+                       }
+               }
+
+               // named old-style presets (studio, phone, voice, etc) are handled in GuessEncoderOptions()
+
+               // named alt-presets
+               $LAMEpresetUsedLookup[1000] = '--r3mix';
+               $LAMEpresetUsedLookup[1001] = '--alt-preset standard';
+               $LAMEpresetUsedLookup[1002] = '--alt-preset extreme';
+               $LAMEpresetUsedLookup[1003] = '--alt-preset insane';
+               $LAMEpresetUsedLookup[1004] = '--alt-preset fast standard';
+               $LAMEpresetUsedLookup[1005] = '--alt-preset fast extreme';
+               $LAMEpresetUsedLookup[1006] = '--alt-preset medium';
+               $LAMEpresetUsedLookup[1007] = '--alt-preset fast medium';
+
+               // LAME 3.94 additions/changes
+               $LAMEpresetUsedLookup[1010] = '--preset portable';                                                           // 3.94a15 Oct 21 2003
+               $LAMEpresetUsedLookup[1015] = '--preset radio';                                                              // 3.94a15 Oct 21 2003
+
+               $LAMEpresetUsedLookup[320]  = '--preset insane';                                                             // 3.94a15 Nov 12 2003
+               $LAMEpresetUsedLookup[410]  = '-V9';
+               $LAMEpresetUsedLookup[420]  = '-V8';
+               $LAMEpresetUsedLookup[440]  = '-V6';
+               $LAMEpresetUsedLookup[430]  = '--preset radio';                                                              // 3.94a15 Nov 12 2003
+               $LAMEpresetUsedLookup[450]  = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'portable';  // 3.94a15 Nov 12 2003
+               $LAMEpresetUsedLookup[460]  = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'medium';    // 3.94a15 Nov 12 2003
+               $LAMEpresetUsedLookup[470]  = '--r3mix';                                                                     // 3.94b1  Dec 18 2003
+               $LAMEpresetUsedLookup[480]  = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'standard';  // 3.94a15 Nov 12 2003
+               $LAMEpresetUsedLookup[490]  = '-V1';
+               $LAMEpresetUsedLookup[500]  = '--preset '.(($LAMEtag['raw']['vbr_method'] == 4) ? 'fast ' : '').'extreme';   // 3.94a15 Nov 12 2003
+
+               return (isset($LAMEpresetUsedLookup[$LAMEtag['preset_used_id']]) ? $LAMEpresetUsedLookup[$LAMEtag['preset_used_id']] : 'new/unknown preset: '.$LAMEtag['preset_used_id'].' - report to info@getid3.org');
+       }
+
+}
diff --git a/wp-includes/ID3/module.audio.ogg.php b/wp-includes/ID3/module.audio.ogg.php
new file mode 100644 (file)
index 0000000..a2a35aa
--- /dev/null
@@ -0,0 +1,671 @@
+<?php
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org>               //
+//  available at http://getid3.sourceforge.net                 //
+//            or http://www.getid3.org                         //
+/////////////////////////////////////////////////////////////////
+// See readme.txt for more details                             //
+/////////////////////////////////////////////////////////////////
+//                                                             //
+// module.audio.ogg.php                                        //
+// module for analyzing Ogg Vorbis, OggFLAC and Speex files    //
+// dependencies: module.audio.flac.php                         //
+//                                                            ///
+/////////////////////////////////////////////////////////////////
+
+getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.flac.php', __FILE__, true);
+
+class getid3_ogg extends getid3_handler
+{
+       // http://xiph.org/vorbis/doc/Vorbis_I_spec.html
+       public function Analyze() {
+               $info = &$this->getid3->info;
+
+               $info['fileformat'] = 'ogg';
+
+               // Warn about illegal tags - only vorbiscomments are allowed
+               if (isset($info['id3v2'])) {
+                       $info['warning'][] = 'Illegal ID3v2 tag present.';
+               }
+               if (isset($info['id3v1'])) {
+                       $info['warning'][] = 'Illegal ID3v1 tag present.';
+               }
+               if (isset($info['ape'])) {
+                       $info['warning'][] = 'Illegal APE tag present.';
+               }
+
+
+               // Page 1 - Stream Header
+
+               $this->fseek($info['avdataoffset']);
+
+               $oggpageinfo = $this->ParseOggPageHeader();
+               $info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo;
+
+               if ($this->ftell() >= $this->getid3->fread_buffer_size()) {
+                       $info['error'][] = 'Could not find start of Ogg page in the first '.$this->getid3->fread_buffer_size().' bytes (this might not be an Ogg-Vorbis file?)';
+                       unset($info['fileformat']);
+                       unset($info['ogg']);
+                       return false;
+               }
+
+               $filedata = $this->fread($oggpageinfo['page_length']);
+               $filedataoffset = 0;
+
+               if (substr($filedata, 0, 4) == 'fLaC') {
+
+                       $info['audio']['dataformat']   = 'flac';
+                       $info['audio']['bitrate_mode'] = 'vbr';
+                       $info['audio']['lossless']     = true;
+
+               } elseif (substr($filedata, 1, 6) == 'vorbis') {
+
+                       $this->ParseVorbisPageHeader($filedata, $filedataoffset, $oggpageinfo);
+
+               } elseif (substr($filedata, 0, 8) == 'Speex   ') {
+
+                       // http://www.speex.org/manual/node10.html
+
+                       $info['audio']['dataformat']   = 'speex';
+                       $info['mime_type']             = 'audio/speex';
+                       $info['audio']['bitrate_mode'] = 'abr';
+                       $info['audio']['lossless']     = false;
+
+                       $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_string']           =                              substr($filedata, $filedataoffset, 8); // hard-coded to 'Speex   '
+                       $filedataoffset += 8;
+                       $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_version']          =                              substr($filedata, $filedataoffset, 20);
+                       $filedataoffset += 20;
+                       $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_version_id']       = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+                       $filedataoffset += 4;
+                       $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['header_size']            = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+                       $filedataoffset += 4;
+                       $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['rate']                   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+                       $filedataoffset += 4;
+                       $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['mode']                   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+                       $filedataoffset += 4;
+                       $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['mode_bitstream_version'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+                       $filedataoffset += 4;
+                       $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['nb_channels']            = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+                       $filedataoffset += 4;
+                       $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['bitrate']                = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+                       $filedataoffset += 4;
+                       $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['framesize']              = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+                       $filedataoffset += 4;
+                       $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['vbr']                    = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+                       $filedataoffset += 4;
+                       $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['frames_per_packet']      = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+                       $filedataoffset += 4;
+                       $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['extra_headers']          = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+                       $filedataoffset += 4;
+                       $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['reserved1']              = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+                       $filedataoffset += 4;
+                       $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['reserved2']              = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+                       $filedataoffset += 4;
+
+                       $info['speex']['speex_version'] = trim($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['speex_version']);
+                       $info['speex']['sample_rate']   = $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['rate'];
+                       $info['speex']['channels']      = $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['nb_channels'];
+                       $info['speex']['vbr']           = (bool) $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['vbr'];
+                       $info['speex']['band_type']     = $this->SpeexBandModeLookup($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['mode']);
+
+                       $info['audio']['sample_rate']   = $info['speex']['sample_rate'];
+                       $info['audio']['channels']      = $info['speex']['channels'];
+                       if ($info['speex']['vbr']) {
+                               $info['audio']['bitrate_mode'] = 'vbr';
+                       }
+
+
+               } elseif (substr($filedata, 0, 8) == "fishead\x00") {
+
+                       // Ogg Skeleton version 3.0 Format Specification
+                       // http://xiph.org/ogg/doc/skeleton.html
+                       $filedataoffset += 8;
+                       $info['ogg']['skeleton']['fishead']['raw']['version_major']                = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  2));
+                       $filedataoffset += 2;
+                       $info['ogg']['skeleton']['fishead']['raw']['version_minor']                = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  2));
+                       $filedataoffset += 2;
+                       $info['ogg']['skeleton']['fishead']['raw']['presentationtime_numerator']   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
+                       $filedataoffset += 8;
+                       $info['ogg']['skeleton']['fishead']['raw']['presentationtime_denominator'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
+                       $filedataoffset += 8;
+                       $info['ogg']['skeleton']['fishead']['raw']['basetime_numerator']           = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
+                       $filedataoffset += 8;
+                       $info['ogg']['skeleton']['fishead']['raw']['basetime_denominator']         = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
+                       $filedataoffset += 8;
+                       $info['ogg']['skeleton']['fishead']['raw']['utc']                          = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 20));
+                       $filedataoffset += 20;
+
+                       $info['ogg']['skeleton']['fishead']['version']          = $info['ogg']['skeleton']['fishead']['raw']['version_major'].'.'.$info['ogg']['skeleton']['fishead']['raw']['version_minor'];
+                       $info['ogg']['skeleton']['fishead']['presentationtime'] = $info['ogg']['skeleton']['fishead']['raw']['presentationtime_numerator'] / $info['ogg']['skeleton']['fishead']['raw']['presentationtime_denominator'];
+                       $info['ogg']['skeleton']['fishead']['basetime']         = $info['ogg']['skeleton']['fishead']['raw']['basetime_numerator']         / $info['ogg']['skeleton']['fishead']['raw']['basetime_denominator'];
+                       $info['ogg']['skeleton']['fishead']['utc']              = $info['ogg']['skeleton']['fishead']['raw']['utc'];
+
+
+                       $counter = 0;
+                       do {
+                               $oggpageinfo = $this->ParseOggPageHeader();
+                               $info['ogg']['pageheader'][$oggpageinfo['page_seqno'].'.'.$counter++] = $oggpageinfo;
+                               $filedata = $this->fread($oggpageinfo['page_length']);
+                               $this->fseek($oggpageinfo['page_end_offset']);
+
+                               if (substr($filedata, 0, 8) == "fisbone\x00") {
+
+                                       $filedataoffset = 8;
+                                       $info['ogg']['skeleton']['fisbone']['raw']['message_header_offset']   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  4));
+                                       $filedataoffset += 4;
+                                       $info['ogg']['skeleton']['fisbone']['raw']['serial_number']           = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  4));
+                                       $filedataoffset += 4;
+                                       $info['ogg']['skeleton']['fisbone']['raw']['number_header_packets']   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  4));
+                                       $filedataoffset += 4;
+                                       $info['ogg']['skeleton']['fisbone']['raw']['granulerate_numerator']   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
+                                       $filedataoffset += 8;
+                                       $info['ogg']['skeleton']['fisbone']['raw']['granulerate_denominator'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
+                                       $filedataoffset += 8;
+                                       $info['ogg']['skeleton']['fisbone']['raw']['basegranule']             = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  8));
+                                       $filedataoffset += 8;
+                                       $info['ogg']['skeleton']['fisbone']['raw']['preroll']                 = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  4));
+                                       $filedataoffset += 4;
+                                       $info['ogg']['skeleton']['fisbone']['raw']['granuleshift']            = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset,  1));
+                                       $filedataoffset += 1;
+                                       $info['ogg']['skeleton']['fisbone']['raw']['padding']                 =                              substr($filedata, $filedataoffset,  3);
+                                       $filedataoffset += 3;
+
+                               } elseif (substr($filedata, 1, 6) == 'theora') {
+
+                                       $info['video']['dataformat'] = 'theora';
+                                       $info['error'][] = 'Ogg Theora not correctly handled in this version of getID3 ['.$this->getid3->version().']';
+                                       //break;
+
+                               } elseif (substr($filedata, 1, 6) == 'vorbis') {
+
+                                       $this->ParseVorbisPageHeader($filedata, $filedataoffset, $oggpageinfo);
+
+                               } else {
+                                       $info['error'][] = 'unexpected';
+                                       //break;
+                               }
+                       //} while ($oggpageinfo['page_seqno'] == 0);
+                       } while (($oggpageinfo['page_seqno'] == 0) && (substr($filedata, 0, 8) != "fisbone\x00"));
+
+                       $this->fseek($oggpageinfo['page_start_offset']);
+
+                       $info['error'][] = 'Ogg Skeleton not correctly handled in this version of getID3 ['.$this->getid3->version().']';
+                       //return false;
+
+               } else {
+
+                       $info['error'][] = 'Expecting either "Speex   " or "vorbis" identifier strings, found "'.substr($filedata, 0, 8).'"';
+                       unset($info['ogg']);
+                       unset($info['mime_type']);
+                       return false;
+
+               }
+
+               // Page 2 - Comment Header
+               $oggpageinfo = $this->ParseOggPageHeader();
+               $info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo;
+
+               switch ($info['audio']['dataformat']) {
+                       case 'vorbis':
+                               $filedata = $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']);
+                               $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['packet_type'] = getid3_lib::LittleEndian2Int(substr($filedata, 0, 1));
+                               $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['stream_type'] =                              substr($filedata, 1, 6); // hard-coded to 'vorbis'
+
+                               $this->ParseVorbisComments();
+                               break;
+
+                       case 'flac':
+                               $flac = new getid3_flac($this->getid3);
+                               if (!$flac->parseMETAdata()) {
+                                       $info['error'][] = 'Failed to parse FLAC headers';
+                                       return false;
+                               }
+                               unset($flac);
+                               break;
+
+                       case 'speex':
+                               $this->fseek($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length'], SEEK_CUR);
+                               $this->ParseVorbisComments();
+                               break;
+               }
+
+
+               // Last Page - Number of Samples
+               if (!getid3_lib::intValueSupported($info['avdataend'])) {
+
+                       $info['warning'][] = 'Unable to parse Ogg end chunk file (PHP does not support file operations beyond '.round(PHP_INT_MAX / 1073741824).'GB)';
+
+               } else {
+
+                       $this->fseek(max($info['avdataend'] - $this->getid3->fread_buffer_size(), 0));
+                       $LastChunkOfOgg = strrev($this->fread($this->getid3->fread_buffer_size()));
+                       if ($LastOggSpostion = strpos($LastChunkOfOgg, 'SggO')) {
+                               $this->fseek($info['avdataend'] - ($LastOggSpostion + strlen('SggO')));
+                               $info['avdataend'] = $this->ftell();
+                               $info['ogg']['pageheader']['eos'] = $this->ParseOggPageHeader();
+                               $info['ogg']['samples']   = $info['ogg']['pageheader']['eos']['pcm_abs_position'];
+                               if ($info['ogg']['samples'] == 0) {
+                                       $info['error'][] = 'Corrupt Ogg file: eos.number of samples == zero';
+                                       return false;
+                               }
+                               if (!empty($info['audio']['sample_rate'])) {
+                                       $info['ogg']['bitrate_average'] = (($info['avdataend'] - $info['avdataoffset']) * 8) / ($info['ogg']['samples'] / $info['audio']['sample_rate']);
+                               }
+                       }
+
+               }
+
+               if (!empty($info['ogg']['bitrate_average'])) {
+                       $info['audio']['bitrate'] = $info['ogg']['bitrate_average'];
+               } elseif (!empty($info['ogg']['bitrate_nominal'])) {
+                       $info['audio']['bitrate'] = $info['ogg']['bitrate_nominal'];
+               } elseif (!empty($info['ogg']['bitrate_min']) && !empty($info['ogg']['bitrate_max'])) {
+                       $info['audio']['bitrate'] = ($info['ogg']['bitrate_min'] + $info['ogg']['bitrate_max']) / 2;
+               }
+               if (isset($info['audio']['bitrate']) && !isset($info['playtime_seconds'])) {
+                       if ($info['audio']['bitrate'] == 0) {
+                               $info['error'][] = 'Corrupt Ogg file: bitrate_audio == zero';
+                               return false;
+                       }
+                       $info['playtime_seconds'] = (float) ((($info['avdataend'] - $info['avdataoffset']) * 8) / $info['audio']['bitrate']);
+               }
+
+               if (isset($info['ogg']['vendor'])) {
+                       $info['audio']['encoder'] = preg_replace('/^Encoded with /', '', $info['ogg']['vendor']);
+
+                       // Vorbis only
+                       if ($info['audio']['dataformat'] == 'vorbis') {
+
+                               // Vorbis 1.0 starts with Xiph.Org
+                               if  (preg_match('/^Xiph.Org/', $info['audio']['encoder'])) {
+
+                                       if ($info['audio']['bitrate_mode'] == 'abr') {
+
+                                               // Set -b 128 on abr files
+                                               $info['audio']['encoder_options'] = '-b '.round($info['ogg']['bitrate_nominal'] / 1000);
+
+                                       } elseif (($info['audio']['bitrate_mode'] == 'vbr') && ($info['audio']['channels'] == 2) && ($info['audio']['sample_rate'] >= 44100) && ($info['audio']['sample_rate'] <= 48000)) {
+                                               // Set -q N on vbr files
+                                               $info['audio']['encoder_options'] = '-q '.$this->get_quality_from_nominal_bitrate($info['ogg']['bitrate_nominal']);
+
+                                       }
+                               }
+
+                               if (empty($info['audio']['encoder_options']) && !empty($info['ogg']['bitrate_nominal'])) {
+                                       $info['audio']['encoder_options'] = 'Nominal bitrate: '.intval(round($info['ogg']['bitrate_nominal'] / 1000)).'kbps';
+                               }
+                       }
+               }
+
+               return true;
+       }
+
+       public function ParseVorbisPageHeader(&$filedata, &$filedataoffset, &$oggpageinfo) {
+               $info = &$this->getid3->info;
+               $info['audio']['dataformat'] = 'vorbis';
+               $info['audio']['lossless']   = false;
+
+               $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['packet_type'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1));
+               $filedataoffset += 1;
+               $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['stream_type'] = substr($filedata, $filedataoffset, 6); // hard-coded to 'vorbis'
+               $filedataoffset += 6;
+               $info['ogg']['bitstreamversion'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+               $filedataoffset += 4;
+               $info['ogg']['numberofchannels'] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1));
+               $filedataoffset += 1;
+               $info['audio']['channels']       = $info['ogg']['numberofchannels'];
+               $info['ogg']['samplerate']       = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+               $filedataoffset += 4;
+               if ($info['ogg']['samplerate'] == 0) {
+                       $info['error'][] = 'Corrupt Ogg file: sample rate == zero';
+                       return false;
+               }
+               $info['audio']['sample_rate']    = $info['ogg']['samplerate'];
+               $info['ogg']['samples']          = 0; // filled in later
+               $info['ogg']['bitrate_average']  = 0; // filled in later
+               $info['ogg']['bitrate_max']      = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+               $filedataoffset += 4;
+               $info['ogg']['bitrate_nominal']  = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+               $filedataoffset += 4;
+               $info['ogg']['bitrate_min']      = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+               $filedataoffset += 4;
+               $info['ogg']['blocksize_small']  = pow(2,  getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)) & 0x0F);
+               $info['ogg']['blocksize_large']  = pow(2, (getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)) & 0xF0) >> 4);
+               $info['ogg']['stop_bit']         = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1)); // must be 1, marks end of packet
+
+               $info['audio']['bitrate_mode'] = 'vbr'; // overridden if actually abr
+               if ($info['ogg']['bitrate_max'] == 0xFFFFFFFF) {
+                       unset($info['ogg']['bitrate_max']);
+                       $info['audio']['bitrate_mode'] = 'abr';
+               }
+               if ($info['ogg']['bitrate_nominal'] == 0xFFFFFFFF) {
+                       unset($info['ogg']['bitrate_nominal']);
+               }
+               if ($info['ogg']['bitrate_min'] == 0xFFFFFFFF) {
+                       unset($info['ogg']['bitrate_min']);
+                       $info['audio']['bitrate_mode'] = 'abr';
+               }
+               return true;
+       }
+
+       public function ParseOggPageHeader() {
+               // http://xiph.org/ogg/vorbis/doc/framing.html
+               $oggheader['page_start_offset'] = $this->ftell(); // where we started from in the file
+
+               $filedata = $this->fread($this->getid3->fread_buffer_size());
+               $filedataoffset = 0;
+               while ((substr($filedata, $filedataoffset++, 4) != 'OggS')) {
+                       if (($this->ftell() - $oggheader['page_start_offset']) >= $this->getid3->fread_buffer_size()) {
+                               // should be found before here
+                               return false;
+                       }
+                       if ((($filedataoffset + 28) > strlen($filedata)) || (strlen($filedata) < 28)) {
+                               if ($this->feof() || (($filedata .= $this->fread($this->getid3->fread_buffer_size())) === false)) {
+                                       // get some more data, unless eof, in which case fail
+                                       return false;
+                               }
+                       }
+               }
+               $filedataoffset += strlen('OggS') - 1; // page, delimited by 'OggS'
+
+               $oggheader['stream_structver']  = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1));
+               $filedataoffset += 1;
+               $oggheader['flags_raw']         = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1));
+               $filedataoffset += 1;
+               $oggheader['flags']['fresh']    = (bool) ($oggheader['flags_raw'] & 0x01); // fresh packet
+               $oggheader['flags']['bos']      = (bool) ($oggheader['flags_raw'] & 0x02); // first page of logical bitstream (bos)
+               $oggheader['flags']['eos']      = (bool) ($oggheader['flags_raw'] & 0x04); // last page of logical bitstream (eos)
+
+               $oggheader['pcm_abs_position']  = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 8));
+               $filedataoffset += 8;
+               $oggheader['stream_serialno']   = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+               $filedataoffset += 4;
+               $oggheader['page_seqno']        = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+               $filedataoffset += 4;
+               $oggheader['page_checksum']     = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 4));
+               $filedataoffset += 4;
+               $oggheader['page_segments']     = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1));
+               $filedataoffset += 1;
+               $oggheader['page_length'] = 0;
+               for ($i = 0; $i < $oggheader['page_segments']; $i++) {
+                       $oggheader['segment_table'][$i] = getid3_lib::LittleEndian2Int(substr($filedata, $filedataoffset, 1));
+                       $filedataoffset += 1;
+                       $oggheader['page_length'] += $oggheader['segment_table'][$i];
+               }
+               $oggheader['header_end_offset'] = $oggheader['page_start_offset'] + $filedataoffset;
+               $oggheader['page_end_offset']   = $oggheader['header_end_offset'] + $oggheader['page_length'];
+               $this->fseek($oggheader['header_end_offset']);
+
+               return $oggheader;
+       }
+
+    // http://xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-810005
+       public function ParseVorbisComments() {
+               $info = &$this->getid3->info;
+
+               $OriginalOffset = $this->ftell();
+               $commentdataoffset = 0;
+               $VorbisCommentPage = 1;
+
+               switch ($info['audio']['dataformat']) {
+                       case 'vorbis':
+                       case 'speex':
+                               $CommentStartOffset = $info['ogg']['pageheader'][$VorbisCommentPage]['page_start_offset'];  // Second Ogg page, after header block
+                               $this->fseek($CommentStartOffset);
+                               $commentdataoffset = 27 + $info['ogg']['pageheader'][$VorbisCommentPage]['page_segments'];
+                               $commentdata = $this->fread(self::OggPageSegmentLength($info['ogg']['pageheader'][$VorbisCommentPage], 1) + $commentdataoffset);
+
+                               if ($info['audio']['dataformat'] == 'vorbis') {
+                                       $commentdataoffset += (strlen('vorbis') + 1);
+                               }
+                               break;
+
+                       case 'flac':
+                               $CommentStartOffset = $info['flac']['VORBIS_COMMENT']['raw']['offset'] + 4;
+                               $this->fseek($CommentStartOffset);
+                               $commentdata = $this->fread($info['flac']['VORBIS_COMMENT']['raw']['block_length']);
+                               break;
+
+                       default:
+                               return false;
+               }
+
+               $VendorSize = getid3_lib::LittleEndian2Int(substr($commentdata, $commentdataoffset, 4));
+               $commentdataoffset += 4;
+
+               $info['ogg']['vendor'] = substr($commentdata, $commentdataoffset, $VendorSize);
+               $commentdataoffset += $VendorSize;
+
+               $CommentsCount = getid3_lib::LittleEndian2Int(substr($commentdata, $commentdataoffset, 4));
+               $commentdataoffset += 4;
+               $info['avdataoffset'] = $CommentStartOffset + $commentdataoffset;
+
+               $basicfields = array('TITLE', 'ARTIST', 'ALBUM', 'TRACKNUMBER', 'GENRE', 'DATE', 'DESCRIPTION', 'COMMENT');
+               $ThisFileInfo_ogg_comments_raw = &$info['ogg']['comments_raw'];
+               for ($i = 0; $i < $CommentsCount; $i++) {
+
+                       $ThisFileInfo_ogg_comments_raw[$i]['dataoffset'] = $CommentStartOffset + $commentdataoffset;
+
+                       if ($this->ftell() < ($ThisFileInfo_ogg_comments_raw[$i]['dataoffset'] + 4)) {
+                               if ($oggpageinfo = $this->ParseOggPageHeader()) {
+                                       $info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo;
+
+                                       $VorbisCommentPage++;
+
+                                       // First, save what we haven't read yet
+                                       $AsYetUnusedData = substr($commentdata, $commentdataoffset);
+
+                                       // Then take that data off the end
+                                       $commentdata     = substr($commentdata, 0, $commentdataoffset);
+
+                                       // Add [headerlength] bytes of dummy data for the Ogg Page Header, just to keep absolute offsets correct
+                                       $commentdata .= str_repeat("\x00", 27 + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_segments']);
+                                       $commentdataoffset += (27 + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_segments']);
+
+                                       // Finally, stick the unused data back on the end
+                                       $commentdata .= $AsYetUnusedData;
+
+                                       //$commentdata .= $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']);
+                                       $commentdata .= $this->fread($this->OggPageSegmentLength($info['ogg']['pageheader'][$VorbisCommentPage], 1));
+                               }
+
+                       }
+                       $ThisFileInfo_ogg_comments_raw[$i]['size'] = getid3_lib::LittleEndian2Int(substr($commentdata, $commentdataoffset, 4));
+
+                       // replace avdataoffset with position just after the last vorbiscomment
+                       $info['avdataoffset'] = $ThisFileInfo_ogg_comments_raw[$i]['dataoffset'] + $ThisFileInfo_ogg_comments_raw[$i]['size'] + 4;
+
+                       $commentdataoffset += 4;
+                       while ((strlen($commentdata) - $commentdataoffset) < $ThisFileInfo_ogg_comments_raw[$i]['size']) {
+                               if (($ThisFileInfo_ogg_comments_raw[$i]['size'] > $info['avdataend']) || ($ThisFileInfo_ogg_comments_raw[$i]['size'] < 0)) {
+                                       $info['warning'][] = 'Invalid Ogg comment size (comment #'.$i.', claims to be '.number_format($ThisFileInfo_ogg_comments_raw[$i]['size']).' bytes) - aborting reading comments';
+                                       break 2;
+                               }
+
+                               $VorbisCommentPage++;
+
+                               $oggpageinfo = $this->ParseOggPageHeader();
+                               $info['ogg']['pageheader'][$oggpageinfo['page_seqno']] = $oggpageinfo;
+
+                               // First, save what we haven't read yet
+                               $AsYetUnusedData = substr($commentdata, $commentdataoffset);
+
+                               // Then take that data off the end
+                               $commentdata     = substr($commentdata, 0, $commentdataoffset);
+
+                               // Add [headerlength] bytes of dummy data for the Ogg Page Header, just to keep absolute offsets correct
+                               $commentdata .= str_repeat("\x00", 27 + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_segments']);
+                               $commentdataoffset += (27 + $info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_segments']);
+
+                               // Finally, stick the unused data back on the end
+                               $commentdata .= $AsYetUnusedData;
+
+                               //$commentdata .= $this->fread($info['ogg']['pageheader'][$oggpageinfo['page_seqno']]['page_length']);
+                               if (!isset($info['ogg']['pageheader'][$VorbisCommentPage])) {
+                                       $info['warning'][] = 'undefined Vorbis Comment page "'.$VorbisCommentPage.'" at offset '.$this->ftell();
+                                       break;
+                               }
+                               $readlength = self::OggPageSegmentLength($info['ogg']['pageheader'][$VorbisCommentPage], 1);
+                               if ($readlength <= 0) {
+                                       $info['warning'][] = 'invalid length Vorbis Comment page "'.$VorbisCommentPage.'" at offset '.$this->ftell();
+                                       break;
+                               }
+                               $commentdata .= $this->fread($readlength);
+
+                               //$filebaseoffset += $oggpageinfo['header_end_offset'] - $oggpageinfo['page_start_offset'];
+                       }
+                       $ThisFileInfo_ogg_comments_raw[$i]['offset'] = $commentdataoffset;
+                       $commentstring = substr($commentdata, $commentdataoffset, $ThisFileInfo_ogg_comments_raw[$i]['size']);
+                       $commentdataoffset += $ThisFileInfo_ogg_comments_raw[$i]['size'];
+
+                       if (!$commentstring) {
+
+                               // no comment?
+                               $info['warning'][] = 'Blank Ogg comment ['.$i.']';
+
+                       } elseif (strstr($commentstring, '=')) {
+
+                               $commentexploded = explode('=', $commentstring, 2);
+                               $ThisFileInfo_ogg_comments_raw[$i]['key']   = strtoupper($commentexploded[0]);
+                               $ThisFileInfo_ogg_comments_raw[$i]['value'] = (isset($commentexploded[1]) ? $commentexploded[1] : '');
+
+                               if ($ThisFileInfo_ogg_comments_raw[$i]['key'] == 'METADATA_BLOCK_PICTURE') {
+
+                                       // http://wiki.xiph.org/VorbisComment#METADATA_BLOCK_PICTURE
+                                       // The unencoded format is that of the FLAC picture block. The fields are stored in big endian order as in FLAC, picture data is stored according to the relevant standard.
+                                       // http://flac.sourceforge.net/format.html#metadata_block_picture
+                                       $flac = new getid3_flac($this->getid3);
+                                       $flac->setStringMode(base64_decode($ThisFileInfo_ogg_comments_raw[$i]['value']));
+                                       $flac->parsePICTURE();
+                                       $info['ogg']['comments']['picture'][] = $flac->getid3->info['flac']['PICTURE'][0];
+                                       unset($flac);
+
+                               } elseif ($ThisFileInfo_ogg_comments_raw[$i]['key'] == 'COVERART') {
+
+                                       $data = base64_decode($ThisFileInfo_ogg_comments_raw[$i]['value']);
+                                       $this->notice('Found deprecated COVERART tag, it should be replaced in honor of METADATA_BLOCK_PICTURE structure');
+                                       /** @todo use 'coverartmime' where available */
+                                       $imageinfo = getid3_lib::GetDataImageSize($data);
+                                       if ($imageinfo === false || !isset($imageinfo['mime'])) {
+                                               $this->warning('COVERART vorbiscomment tag contains invalid image');
+                                               continue;
+                                       }
+
+                                       $ogg = new self($this->getid3);
+                                       $ogg->setStringMode($data);
+                                       $info['ogg']['comments']['picture'][] = array(
+                                               'image_mime' => $imageinfo['mime'],
+                                               'data'       => $ogg->saveAttachment('coverart', 0, strlen($data), $imageinfo['mime']),
+                                       );
+                                       unset($ogg);
+
+                               } else {
+
+                                       $info['ogg']['comments'][strtolower($ThisFileInfo_ogg_comments_raw[$i]['key'])][] = $ThisFileInfo_ogg_comments_raw[$i]['value'];
+
+                               }
+
+                       } else {
+
+                               $info['warning'][] = '[known problem with CDex >= v1.40, < v1.50b7] Invalid Ogg comment name/value pair ['.$i.']: '.$commentstring;
+
+                       }
+                       unset($ThisFileInfo_ogg_comments_raw[$i]);
+               }
+               unset($ThisFileInfo_ogg_comments_raw);
+
+
+               // Replay Gain Adjustment
+               // http://privatewww.essex.ac.uk/~djmrob/replaygain/
+               if (isset($info['ogg']['comments']) && is_array($info['ogg']['comments'])) {
+                       foreach ($info['ogg']['comments'] as $index => $commentvalue) {
+                               switch ($index) {
+                                       case 'rg_audiophile':
+                                       case 'replaygain_album_gain':
+                                               $info['replay_gain']['album']['adjustment'] = (double) $commentvalue[0];
+                                               unset($info['ogg']['comments'][$index]);
+                                               break;
+
+                                       case 'rg_radio':
+                                       case 'replaygain_track_gain':
+                                               $info['replay_gain']['track']['adjustment'] = (double) $commentvalue[0];
+                                               unset($info['ogg']['comments'][$index]);
+                                               break;
+
+                                       case 'replaygain_album_peak':
+                                               $info['replay_gain']['album']['peak'] = (double) $commentvalue[0];
+                                               unset($info['ogg']['comments'][$index]);
+                                               break;
+
+                                       case 'rg_peak':
+                                       case 'replaygain_track_peak':
+                                               $info['replay_gain']['track']['peak'] = (double) $commentvalue[0];
+                                               unset($info['ogg']['comments'][$index]);
+                                               break;
+
+                                       case 'replaygain_reference_loudness':
+                                               $info['replay_gain']['reference_volume'] = (double) $commentvalue[0];
+                                               unset($info['ogg']['comments'][$index]);
+                                               break;
+
+                                       default:
+                                               // do nothing
+                                               break;
+                               }
+                       }
+               }
+
+               $this->fseek($OriginalOffset);
+
+               return true;
+       }
+
+       public static function SpeexBandModeLookup($mode) {
+               static $SpeexBandModeLookup = array();
+               if (empty($SpeexBandModeLookup)) {
+                       $SpeexBandModeLookup[0] = 'narrow';
+                       $SpeexBandModeLookup[1] = 'wide';
+                       $SpeexBandModeLookup[2] = 'ultra-wide';
+               }
+               return (isset($SpeexBandModeLookup[$mode]) ? $SpeexBandModeLookup[$mode] : null);
+       }
+
+
+       public static function OggPageSegmentLength($OggInfoArray, $SegmentNumber=1) {
+               for ($i = 0; $i < $SegmentNumber; $i++) {
+                       $segmentlength = 0;
+                       foreach ($OggInfoArray['segment_table'] as $key => $value) {
+                               $segmentlength += $value;
+                               if ($value < 255) {
+                                       break;
+                               }
+                       }
+               }
+               return $segmentlength;
+       }
+
+
+       public static function get_quality_from_nominal_bitrate($nominal_bitrate) {
+
+               // decrease precision
+               $nominal_bitrate = $nominal_bitrate / 1000;
+
+               if ($nominal_bitrate < 128) {
+                       // q-1 to q4
+                       $qval = ($nominal_bitrate - 64) / 16;
+               } elseif ($nominal_bitrate < 256) {
+                       // q4 to q8
+                       $qval = $nominal_bitrate / 32;
+               } elseif ($nominal_bitrate < 320) {
+                       // q8 to q9
+                       $qval = ($nominal_bitrate + 256) / 64;
+               } else {
+                       // q9 to q10
+                       $qval = ($nominal_bitrate + 1300) / 180;
+               }
+               //return $qval; // 5.031324
+               //return intval($qval); // 5
+               return round($qval, 1); // 5 or 4.9
+       }
+
+}
diff --git a/wp-includes/ID3/module.tag.apetag.php b/wp-includes/ID3/module.tag.apetag.php
new file mode 100644 (file)
index 0000000..afeede7
--- /dev/null
@@ -0,0 +1,370 @@
+<?php
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org>               //
+//  available at http://getid3.sourceforge.net                 //
+//            or http://www.getid3.org                         //
+/////////////////////////////////////////////////////////////////
+// See readme.txt for more details                             //
+/////////////////////////////////////////////////////////////////
+//                                                             //
+// module.tag.apetag.php                                       //
+// module for analyzing APE tags                               //
+// dependencies: NONE                                          //
+//                                                            ///
+/////////////////////////////////////////////////////////////////
+
+class getid3_apetag extends getid3_handler
+{
+       public $inline_attachments = true; // true: return full data for all attachments; false: return no data for all attachments; integer: return data for attachments <= than this; string: save as file to this directory
+       public $overrideendoffset  = 0;
+
+       public function Analyze() {
+               $info = &$this->getid3->info;
+
+               if (!getid3_lib::intValueSupported($info['filesize'])) {
+                       $info['warning'][] = 'Unable to check for APEtags because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB';
+                       return false;
+               }
+
+               $id3v1tagsize     = 128;
+               $apetagheadersize = 32;
+               $lyrics3tagsize   = 10;
+
+               if ($this->overrideendoffset == 0) {
+
+                       fseek($this->getid3->fp, 0 - $id3v1tagsize - $apetagheadersize - $lyrics3tagsize, SEEK_END);
+                       $APEfooterID3v1 = fread($this->getid3->fp, $id3v1tagsize + $apetagheadersize + $lyrics3tagsize);
+
+                       //if (preg_match('/APETAGEX.{24}TAG.{125}$/i', $APEfooterID3v1)) {
+                       if (substr($APEfooterID3v1, strlen($APEfooterID3v1) - $id3v1tagsize - $apetagheadersize, 8) == 'APETAGEX') {
+
+                               // APE tag found before ID3v1
+                               $info['ape']['tag_offset_end'] = $info['filesize'] - $id3v1tagsize;
+
+                       //} elseif (preg_match('/APETAGEX.{24}$/i', $APEfooterID3v1)) {
+                       } elseif (substr($APEfooterID3v1, strlen($APEfooterID3v1) - $apetagheadersize, 8) == 'APETAGEX') {
+
+                               // APE tag found, no ID3v1
+                               $info['ape']['tag_offset_end'] = $info['filesize'];
+
+                       }
+
+               } else {
+
+                       fseek($this->getid3->fp, $this->overrideendoffset - $apetagheadersize, SEEK_SET);
+                       if (fread($this->getid3->fp, 8) == 'APETAGEX') {
+                               $info['ape']['tag_offset_end'] = $this->overrideendoffset;
+                       }
+
+               }
+               if (!isset($info['ape']['tag_offset_end'])) {
+
+                       // APE tag not found
+                       unset($info['ape']);
+                       return false;
+
+               }
+
+               // shortcut
+               $thisfile_ape = &$info['ape'];
+
+               fseek($this->getid3->fp, $thisfile_ape['tag_offset_end'] - $apetagheadersize, SEEK_SET);
+               $APEfooterData = fread($this->getid3->fp, 32);
+               if (!($thisfile_ape['footer'] = $this->parseAPEheaderFooter($APEfooterData))) {
+                       $info['error'][] = 'Error parsing APE footer at offset '.$thisfile_ape['tag_offset_end'];
+                       return false;
+               }
+
+               if (isset($thisfile_ape['footer']['flags']['header']) && $thisfile_ape['footer']['flags']['header']) {
+                       fseek($this->getid3->fp, $thisfile_ape['tag_offset_end'] - $thisfile_ape['footer']['raw']['tagsize'] - $apetagheadersize, SEEK_SET);
+                       $thisfile_ape['tag_offset_start'] = ftell($this->getid3->fp);
+                       $APEtagData = fread($this->getid3->fp, $thisfile_ape['footer']['raw']['tagsize'] + $apetagheadersize);
+               } else {
+                       $thisfile_ape['tag_offset_start'] = $thisfile_ape['tag_offset_end'] - $thisfile_ape['footer']['raw']['tagsize'];
+                       fseek($this->getid3->fp, $thisfile_ape['tag_offset_start'], SEEK_SET);
+                       $APEtagData = fread($this->getid3->fp, $thisfile_ape['footer']['raw']['tagsize']);
+               }
+               $info['avdataend'] = $thisfile_ape['tag_offset_start'];
+
+               if (isset($info['id3v1']['tag_offset_start']) && ($info['id3v1']['tag_offset_start'] < $thisfile_ape['tag_offset_end'])) {
+                       $info['warning'][] = 'ID3v1 tag information ignored since it appears to be a false synch in APEtag data';
+                       unset($info['id3v1']);
+                       foreach ($info['warning'] as $key => $value) {
+                               if ($value == 'Some ID3v1 fields do not use NULL characters for padding') {
+                                       unset($info['warning'][$key]);
+                                       sort($info['warning']);
+                                       break;
+                               }
+                       }
+               }
+
+               $offset = 0;
+               if (isset($thisfile_ape['footer']['flags']['header']) && $thisfile_ape['footer']['flags']['header']) {
+                       if ($thisfile_ape['header'] = $this->parseAPEheaderFooter(substr($APEtagData, 0, $apetagheadersize))) {
+                               $offset += $apetagheadersize;
+                       } else {
+                               $info['error'][] = 'Error parsing APE header at offset '.$thisfile_ape['tag_offset_start'];
+                               return false;
+                       }
+               }
+
+               // shortcut
+               $info['replay_gain'] = array();
+               $thisfile_replaygain = &$info['replay_gain'];
+
+               for ($i = 0; $i < $thisfile_ape['footer']['raw']['tag_items']; $i++) {
+                       $value_size = getid3_lib::LittleEndian2Int(substr($APEtagData, $offset, 4));
+                       $offset += 4;
+                       $item_flags = getid3_lib::LittleEndian2Int(substr($APEtagData, $offset, 4));
+                       $offset += 4;
+                       if (strstr(substr($APEtagData, $offset), "\x00") === false) {
+                               $info['error'][] = 'Cannot find null-byte (0x00) seperator between ItemKey #'.$i.' and value. ItemKey starts '.$offset.' bytes into the APE tag, at file offset '.($thisfile_ape['tag_offset_start'] + $offset);
+                               return false;
+                       }
+                       $ItemKeyLength = strpos($APEtagData, "\x00", $offset) - $offset;
+                       $item_key      = strtolower(substr($APEtagData, $offset, $ItemKeyLength));
+
+                       // shortcut
+                       $thisfile_ape['items'][$item_key] = array();
+                       $thisfile_ape_items_current = &$thisfile_ape['items'][$item_key];
+
+                       $thisfile_ape_items_current['offset'] = $thisfile_ape['tag_offset_start'] + $offset;
+
+                       $offset += ($ItemKeyLength + 1); // skip 0x00 terminator
+                       $thisfile_ape_items_current['data'] = substr($APEtagData, $offset, $value_size);
+                       $offset += $value_size;
+
+                       $thisfile_ape_items_current['flags'] = $this->parseAPEtagFlags($item_flags);
+                       switch ($thisfile_ape_items_current['flags']['item_contents_raw']) {
+                               case 0: // UTF-8
+                               case 3: // Locator (URL, filename, etc), UTF-8 encoded
+                                       $thisfile_ape_items_current['data'] = explode("\x00", trim($thisfile_ape_items_current['data']));
+                                       break;
+
+                               default: // binary data
+                                       break;
+                       }
+
+                       switch (strtolower($item_key)) {
+                               case 'replaygain_track_gain':
+                                       $thisfile_replaygain['track']['adjustment'] = (float) str_replace(',', '.', $thisfile_ape_items_current['data'][0]); // float casting will see "0,95" as zero!
+                                       $thisfile_replaygain['track']['originator'] = 'unspecified';
+                                       break;
+
+                               case 'replaygain_track_peak':
+                                       $thisfile_replaygain['track']['peak']       = (float) str_replace(',', '.', $thisfile_ape_items_current['data'][0]); // float casting will see "0,95" as zero!
+                                       $thisfile_replaygain['track']['originator'] = 'unspecified';
+                                       if ($thisfile_replaygain['track']['peak'] <= 0) {
+                                               $info['warning'][] = 'ReplayGain Track peak from APEtag appears invalid: '.$thisfile_replaygain['track']['peak'].' (original value = "'.$thisfile_ape_items_current['data'][0].'")';
+                                       }
+                                       break;
+
+                               case 'replaygain_album_gain':
+                                       $thisfile_replaygain['album']['adjustment'] = (float) str_replace(',', '.', $thisfile_ape_items_current['data'][0]); // float casting will see "0,95" as zero!
+                                       $thisfile_replaygain['album']['originator'] = 'unspecified';
+                                       break;
+
+                               case 'replaygain_album_peak':
+                                       $thisfile_replaygain['album']['peak']       = (float) str_replace(',', '.', $thisfile_ape_items_current['data'][0]); // float casting will see "0,95" as zero!
+                                       $thisfile_replaygain['album']['originator'] = 'unspecified';
+                                       if ($thisfile_replaygain['album']['peak'] <= 0) {
+                                               $info['warning'][] = 'ReplayGain Album peak from APEtag appears invalid: '.$thisfile_replaygain['album']['peak'].' (original value = "'.$thisfile_ape_items_current['data'][0].'")';
+                                       }
+                                       break;
+
+                               case 'mp3gain_undo':
+                                       list($mp3gain_undo_left, $mp3gain_undo_right, $mp3gain_undo_wrap) = explode(',', $thisfile_ape_items_current['data'][0]);
+                                       $thisfile_replaygain['mp3gain']['undo_left']  = intval($mp3gain_undo_left);
+                                       $thisfile_replaygain['mp3gain']['undo_right'] = intval($mp3gain_undo_right);
+                                       $thisfile_replaygain['mp3gain']['undo_wrap']  = (($mp3gain_undo_wrap == 'Y') ? true : false);
+                                       break;
+
+                               case 'mp3gain_minmax':
+                                       list($mp3gain_globalgain_min, $mp3gain_globalgain_max) = explode(',', $thisfile_ape_items_current['data'][0]);
+                                       $thisfile_replaygain['mp3gain']['globalgain_track_min'] = intval($mp3gain_globalgain_min);
+                                       $thisfile_replaygain['mp3gain']['globalgain_track_max'] = intval($mp3gain_globalgain_max);
+                                       break;
+
+                               case 'mp3gain_album_minmax':
+                                       list($mp3gain_globalgain_album_min, $mp3gain_globalgain_album_max) = explode(',', $thisfile_ape_items_current['data'][0]);
+                                       $thisfile_replaygain['mp3gain']['globalgain_album_min'] = intval($mp3gain_globalgain_album_min);
+                                       $thisfile_replaygain['mp3gain']['globalgain_album_max'] = intval($mp3gain_globalgain_album_max);
+                                       break;
+
+                               case 'tracknumber':
+                                       if (is_array($thisfile_ape_items_current['data'])) {
+                                               foreach ($thisfile_ape_items_current['data'] as $comment) {
+                                                       $thisfile_ape['comments']['track'][] = $comment;
+                                               }
+                                       }
+                                       break;
+
+                               case 'cover art (artist)':
+                               case 'cover art (back)':
+                               case 'cover art (band logo)':
+                               case 'cover art (band)':
+                               case 'cover art (colored fish)':
+                               case 'cover art (composer)':
+                               case 'cover art (conductor)':
+                               case 'cover art (front)':
+                               case 'cover art (icon)':
+                               case 'cover art (illustration)':
+                               case 'cover art (lead)':
+                               case 'cover art (leaflet)':
+                               case 'cover art (lyricist)':
+                               case 'cover art (media)':
+                               case 'cover art (movie scene)':
+                               case 'cover art (other icon)':
+                               case 'cover art (other)':
+                               case 'cover art (performance)':
+                               case 'cover art (publisher logo)':
+                               case 'cover art (recording)':
+                               case 'cover art (studio)':
+                                       // list of possible cover arts from http://taglib-sharp.sourcearchive.com/documentation/2.0.3.0-2/Ape_2Tag_8cs-source.html
+                                       list($thisfile_ape_items_current['filename'], $thisfile_ape_items_current['data']) = explode("\x00", $thisfile_ape_items_current['data'], 2);
+                                       $thisfile_ape_items_current['data_offset'] = $thisfile_ape_items_current['offset'] + strlen($thisfile_ape_items_current['filename']."\x00");
+                                       $thisfile_ape_items_current['data_length'] = strlen($thisfile_ape_items_current['data']);
+
+                                       $thisfile_ape_items_current['image_mime'] = '';
+                                       $imageinfo = array();
+                                       $imagechunkcheck = getid3_lib::GetDataImageSize($thisfile_ape_items_current['data'], $imageinfo);
+                                       $thisfile_ape_items_current['image_mime'] = image_type_to_mime_type($imagechunkcheck[2]);
+
+                                       do {
+                                               if ($this->inline_attachments === false) {
+                                                       // skip entirely
+                                                       unset($thisfile_ape_items_current['data']);
+                                                       break;
+                                               }
+                                               if ($this->inline_attachments === true) {
+                                                       // great
+                                               } elseif (is_int($this->inline_attachments)) {
+                                                       if ($this->inline_attachments < $thisfile_ape_items_current['data_length']) {
+                                                               // too big, skip
+                                                               $info['warning'][] = 'attachment at '.$thisfile_ape_items_current['offset'].' is too large to process inline ('.number_format($thisfile_ape_items_current['data_length']).' bytes)';
+                                                               unset($thisfile_ape_items_current['data']);
+                                                               break;
+                                                       }
+                                               } elseif (is_string($this->inline_attachments)) {
+                                                       $this->inline_attachments = rtrim(str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $this->inline_attachments), DIRECTORY_SEPARATOR);
+                                                       if (!is_dir($this->inline_attachments) || !is_writable($this->inline_attachments)) {
+                                                               // cannot write, skip
+                                                               $info['warning'][] = 'attachment at '.$thisfile_ape_items_current['offset'].' cannot be saved to "'.$this->inline_attachments.'" (not writable)';
+                                                               unset($thisfile_ape_items_current['data']);
+                                                               break;
+                                                       }
+                                               }
+                                               // if we get this far, must be OK
+                                               if (is_string($this->inline_attachments)) {
+                                                       $destination_filename = $this->inline_attachments.DIRECTORY_SEPARATOR.md5($info['filenamepath']).'_'.$thisfile_ape_items_current['data_offset'];
+                                                       if (!file_exists($destination_filename) || is_writable($destination_filename)) {
+                                                               file_put_contents($destination_filename, $thisfile_ape_items_current['data']);
+                                                       } else {
+                                                               $info['warning'][] = 'attachment at '.$thisfile_ape_items_current['offset'].' cannot be saved to "'.$destination_filename.'" (not writable)';
+                                                       }
+                                                       $thisfile_ape_items_current['data_filename'] = $destination_filename;
+                                                       unset($thisfile_ape_items_current['data']);
+                                               } else {
+                                                       if (!isset($info['ape']['comments']['picture'])) {
+                                                               $info['ape']['comments']['picture'] = array();
+                                                       }
+                                                       $info['ape']['comments']['picture'][] = array('data'=>$thisfile_ape_items_current['data'], 'image_mime'=>$thisfile_ape_items_current['image_mime']);
+                                               }
+                                       } while (false);
+                                       break;
+
+                               default:
+                                       if (is_array($thisfile_ape_items_current['data'])) {
+                                               foreach ($thisfile_ape_items_current['data'] as $comment) {
+                                                       $thisfile_ape['comments'][strtolower($item_key)][] = $comment;
+                                               }
+                                       }
+                                       break;
+                       }
+
+               }
+               if (empty($thisfile_replaygain)) {
+                       unset($info['replay_gain']);
+               }
+               return true;
+       }
+
+       public function parseAPEheaderFooter($APEheaderFooterData) {
+               // http://www.uni-jena.de/~pfk/mpp/sv8/apeheader.html
+
+               // shortcut
+               $headerfooterinfo['raw'] = array();
+               $headerfooterinfo_raw = &$headerfooterinfo['raw'];
+
+               $headerfooterinfo_raw['footer_tag']   =                  substr($APEheaderFooterData,  0, 8);
+               if ($headerfooterinfo_raw['footer_tag'] != 'APETAGEX') {
+                       return false;
+               }
+               $headerfooterinfo_raw['version']      = getid3_lib::LittleEndian2Int(substr($APEheaderFooterData,  8, 4));
+               $headerfooterinfo_raw['tagsize']      = getid3_lib::LittleEndian2Int(substr($APEheaderFooterData, 12, 4));
+               $headerfooterinfo_raw['tag_items']    = getid3_lib::LittleEndian2Int(substr($APEheaderFooterData, 16, 4));
+               $headerfooterinfo_raw['global_flags'] = getid3_lib::LittleEndian2Int(substr($APEheaderFooterData, 20, 4));
+               $headerfooterinfo_raw['reserved']     =                              substr($APEheaderFooterData, 24, 8);
+
+               $headerfooterinfo['tag_version']         = $headerfooterinfo_raw['version'] / 1000;
+               if ($headerfooterinfo['tag_version'] >= 2) {
+                       $headerfooterinfo['flags'] = $this->parseAPEtagFlags($headerfooterinfo_raw['global_flags']);
+               }
+               return $headerfooterinfo;
+       }
+
+       public function parseAPEtagFlags($rawflagint) {
+               // "Note: APE Tags 1.0 do not use any of the APE Tag flags.
+               // All are set to zero on creation and ignored on reading."
+               // http://www.uni-jena.de/~pfk/mpp/sv8/apetagflags.html
+               $flags['header']            = (bool) ($rawflagint & 0x80000000);
+               $flags['footer']            = (bool) ($rawflagint & 0x40000000);
+               $flags['this_is_header']    = (bool) ($rawflagint & 0x20000000);
+               $flags['item_contents_raw'] =        ($rawflagint & 0x00000006) >> 1;
+               $flags['read_only']         = (bool) ($rawflagint & 0x00000001);
+
+               $flags['item_contents']     = $this->APEcontentTypeFlagLookup($flags['item_contents_raw']);
+
+               return $flags;
+       }
+
+       public function APEcontentTypeFlagLookup($contenttypeid) {
+               static $APEcontentTypeFlagLookup = array(
+                       0 => 'utf-8',
+                       1 => 'binary',
+                       2 => 'external',
+                       3 => 'reserved'
+               );
+               return (isset($APEcontentTypeFlagLookup[$contenttypeid]) ? $APEcontentTypeFlagLookup[$contenttypeid] : 'invalid');
+       }
+
+       public function APEtagItemIsUTF8Lookup($itemkey) {
+               static $APEtagItemIsUTF8Lookup = array(
+                       'title',
+                       'subtitle',
+                       'artist',
+                       'album',
+                       'debut album',
+                       'publisher',
+                       'conductor',
+                       'track',
+                       'composer',
+                       'comment',
+                       'copyright',
+                       'publicationright',
+                       'file',
+                       'year',
+                       'record date',
+                       'record location',
+                       'genre',
+                       'media',
+                       'related',
+                       'isrc',
+                       'abstract',
+                       'language',
+                       'bibliography'
+               );
+               return in_array(strtolower($itemkey), $APEtagItemIsUTF8Lookup);
+       }
+
+}
diff --git a/wp-includes/ID3/module.tag.id3v1.php b/wp-includes/ID3/module.tag.id3v1.php
new file mode 100644 (file)
index 0000000..fd9069e
--- /dev/null
@@ -0,0 +1,359 @@
+<?php
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org>               //
+//  available at http://getid3.sourceforge.net                 //
+//            or http://www.getid3.org                         //
+/////////////////////////////////////////////////////////////////
+// See readme.txt for more details                             //
+/////////////////////////////////////////////////////////////////
+//                                                             //
+// module.tag.id3v1.php                                        //
+// module for analyzing ID3v1 tags                             //
+// dependencies: NONE                                          //
+//                                                            ///
+/////////////////////////////////////////////////////////////////
+
+
+class getid3_id3v1 extends getid3_handler
+{
+
+       public function Analyze() {
+               $info = &$this->getid3->info;
+
+               if (!getid3_lib::intValueSupported($info['filesize'])) {
+                       $info['warning'][] = 'Unable to check for ID3v1 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB';
+                       return false;
+               }
+
+               fseek($this->getid3->fp, -256, SEEK_END);
+               $preid3v1 = fread($this->getid3->fp, 128);
+               $id3v1tag = fread($this->getid3->fp, 128);
+
+               if (substr($id3v1tag, 0, 3) == 'TAG') {
+
+                       $info['avdataend'] = $info['filesize'] - 128;
+
+                       $ParsedID3v1['title']   = $this->cutfield(substr($id3v1tag,   3, 30));
+                       $ParsedID3v1['artist']  = $this->cutfield(substr($id3v1tag,  33, 30));
+                       $ParsedID3v1['album']   = $this->cutfield(substr($id3v1tag,  63, 30));
+                       $ParsedID3v1['year']    = $this->cutfield(substr($id3v1tag,  93,  4));
+                       $ParsedID3v1['comment'] =                 substr($id3v1tag,  97, 30);  // can't remove nulls yet, track detection depends on them
+                       $ParsedID3v1['genreid'] =             ord(substr($id3v1tag, 127,  1));
+
+                       // If second-last byte of comment field is null and last byte of comment field is non-null
+                       // then this is ID3v1.1 and the comment field is 28 bytes long and the 30th byte is the track number
+                       if (($id3v1tag{125} === "\x00") && ($id3v1tag{126} !== "\x00")) {
+                               $ParsedID3v1['track']   = ord(substr($ParsedID3v1['comment'], 29,  1));
+                               $ParsedID3v1['comment'] =     substr($ParsedID3v1['comment'],  0, 28);
+                       }
+                       $ParsedID3v1['comment'] = $this->cutfield($ParsedID3v1['comment']);
+
+                       $ParsedID3v1['genre'] = $this->LookupGenreName($ParsedID3v1['genreid']);
+                       if (!empty($ParsedID3v1['genre'])) {
+                               unset($ParsedID3v1['genreid']);
+                       }
+                       if (isset($ParsedID3v1['genre']) && (empty($ParsedID3v1['genre']) || ($ParsedID3v1['genre'] == 'Unknown'))) {
+                               unset($ParsedID3v1['genre']);
+                       }
+
+                       foreach ($ParsedID3v1 as $key => $value) {
+                               $ParsedID3v1['comments'][$key][0] = $value;
+                       }
+
+                       // ID3v1 data is supposed to be padded with NULL characters, but some taggers pad with spaces
+                       $GoodFormatID3v1tag = $this->GenerateID3v1Tag(
+                                                                                       $ParsedID3v1['title'],
+                                                                                       $ParsedID3v1['artist'],
+                                                                                       $ParsedID3v1['album'],
+                                                                                       $ParsedID3v1['year'],
+                                                                                       (isset($ParsedID3v1['genre']) ? $this->LookupGenreID($ParsedID3v1['genre']) : false),
+                                                                                       $ParsedID3v1['comment'],
+                                                                                       (!empty($ParsedID3v1['track']) ? $ParsedID3v1['track'] : ''));
+                       $ParsedID3v1['padding_valid'] = true;
+                       if ($id3v1tag !== $GoodFormatID3v1tag) {
+                               $ParsedID3v1['padding_valid'] = false;
+                               $info['warning'][] = 'Some ID3v1 fields do not use NULL characters for padding';
+                       }
+
+                       $ParsedID3v1['tag_offset_end']   = $info['filesize'];
+                       $ParsedID3v1['tag_offset_start'] = $ParsedID3v1['tag_offset_end'] - 128;
+
+                       $info['id3v1'] = $ParsedID3v1;
+               }
+
+               if (substr($preid3v1, 0, 3) == 'TAG') {
+                       // The way iTunes handles tags is, well, brain-damaged.
+                       // It completely ignores v1 if ID3v2 is present.
+                       // This goes as far as adding a new v1 tag *even if there already is one*
+
+                       // A suspected double-ID3v1 tag has been detected, but it could be that
+                       // the "TAG" identifier is a legitimate part of an APE or Lyrics3 tag
+                       if (substr($preid3v1, 96, 8) == 'APETAGEX') {
+                               // an APE tag footer was found before the last ID3v1, assume false "TAG" synch
+                       } elseif (substr($preid3v1, 119, 6) == 'LYRICS') {
+                               // a Lyrics3 tag footer was found before the last ID3v1, assume false "TAG" synch
+                       } else {
+                               // APE and Lyrics3 footers not found - assume double ID3v1
+                               $info['warning'][] = 'Duplicate ID3v1 tag detected - this has been known to happen with iTunes';
+                               $info['avdataend'] -= 128;
+                       }
+               }
+
+               return true;
+       }
+
+       public static function cutfield($str) {
+               return trim(substr($str, 0, strcspn($str, "\x00")));
+       }
+
+       public static function ArrayOfGenres($allowSCMPXextended=false) {
+               static $GenreLookup = array(
+                       0    => 'Blues',
+                       1    => 'Classic Rock',
+                       2    => 'Country',
+                       3    => 'Dance',
+                       4    => 'Disco',
+                       5    => 'Funk',
+                       6    => 'Grunge',
+                       7    => 'Hip-Hop',
+                       8    => 'Jazz',
+                       9    => 'Metal',
+                       10   => 'New Age',
+                       11   => 'Oldies',
+                       12   => 'Other',
+                       13   => 'Pop',
+                       14   => 'R&B',
+                       15   => 'Rap',
+                       16   => 'Reggae',
+                       17   => 'Rock',
+                       18   => 'Techno',
+                       19   => 'Industrial',
+                       20   => 'Alternative',
+                       21   => 'Ska',
+                       22   => 'Death Metal',
+                       23   => 'Pranks',
+                       24   => 'Soundtrack',
+                       25   => 'Euro-Techno',
+                       26   => 'Ambient',
+                       27   => 'Trip-Hop',
+                       28   => 'Vocal',
+                       29   => 'Jazz+Funk',
+                       30   => 'Fusion',
+                       31   => 'Trance',
+                       32   => 'Classical',
+                       33   => 'Instrumental',
+                       34   => 'Acid',
+                       35   => 'House',
+                       36   => 'Game',
+                       37   => 'Sound Clip',
+                       38   => 'Gospel',
+                       39   => 'Noise',
+                       40   => 'Alt. Rock',
+                       41   => 'Bass',
+                       42   => 'Soul',
+                       43   => 'Punk',
+                       44   => 'Space',
+                       45   => 'Meditative',
+                       46   => 'Instrumental Pop',
+                       47   => 'Instrumental Rock',
+                       48   => 'Ethnic',
+                       49   => 'Gothic',
+                       50   => 'Darkwave',
+                       51   => 'Techno-Industrial',
+                       52   => 'Electronic',
+                       53   => 'Pop-Folk',
+                       54   => 'Eurodance',
+                       55   => 'Dream',
+                       56   => 'Southern Rock',
+                       57   => 'Comedy',
+                       58   => 'Cult',
+                       59   => 'Gangsta Rap',
+                       60   => 'Top 40',
+                       61   => 'Christian Rap',
+                       62   => 'Pop/Funk',
+                       63   => 'Jungle',
+                       64   => 'Native American',
+                       65   => 'Cabaret',
+                       66   => 'New Wave',
+                       67   => 'Psychedelic',
+                       68   => 'Rave',
+                       69   => 'Showtunes',
+                       70   => 'Trailer',
+                       71   => 'Lo-Fi',
+                       72   => 'Tribal',
+                       73   => 'Acid Punk',
+                       74   => 'Acid Jazz',
+                       75   => 'Polka',
+                       76   => 'Retro',
+                       77   => 'Musical',
+                       78   => 'Rock & Roll',
+                       79   => 'Hard Rock',
+                       80   => 'Folk',
+                       81   => 'Folk/Rock',
+                       82   => 'National Folk',
+                       83   => 'Swing',
+                       84   => 'Fast-Fusion',
+                       85   => 'Bebob',
+                       86   => 'Latin',
+                       87   => 'Revival',
+                       88   => 'Celtic',
+                       89   => 'Bluegrass',
+                       90   => 'Avantgarde',
+                       91   => 'Gothic Rock',
+                       92   => 'Progressive Rock',
+                       93   => 'Psychedelic Rock',
+                       94   => 'Symphonic Rock',
+                       95   => 'Slow Rock',
+                       96   => 'Big Band',
+                       97   => 'Chorus',
+                       98   => 'Easy Listening',
+                       99   => 'Acoustic',
+                       100  => 'Humour',
+                       101  => 'Speech',
+                       102  => 'Chanson',
+                       103  => 'Opera',
+                       104  => 'Chamber Music',
+                       105  => 'Sonata',
+                       106  => 'Symphony',
+                       107  => 'Booty Bass',
+                       108  => 'Primus',
+                       109  => 'Porn Groove',
+                       110  => 'Satire',
+                       111  => 'Slow Jam',
+                       112  => 'Club',
+                       113  => 'Tango',
+                       114  => 'Samba',
+                       115  => 'Folklore',
+                       116  => 'Ballad',
+                       117  => 'Power Ballad',
+                       118  => 'Rhythmic Soul',
+                       119  => 'Freestyle',
+                       120  => 'Duet',
+                       121  => 'Punk Rock',
+                       122  => 'Drum Solo',
+                       123  => 'A Cappella',
+                       124  => 'Euro-House',
+                       125  => 'Dance Hall',
+                       126  => 'Goa',
+                       127  => 'Drum & Bass',
+                       128  => 'Club-House',
+                       129  => 'Hardcore',
+                       130  => 'Terror',
+                       131  => 'Indie',
+                       132  => 'BritPop',
+                       133  => 'Negerpunk',
+                       134  => 'Polsk Punk',
+                       135  => 'Beat',
+                       136  => 'Christian Gangsta Rap',
+                       137  => 'Heavy Metal',
+                       138  => 'Black Metal',
+                       139  => 'Crossover',
+                       140  => 'Contemporary Christian',
+                       141  => 'Christian Rock',
+                       142  => 'Merengue',
+                       143  => 'Salsa',
+                       144  => 'Thrash Metal',
+                       145  => 'Anime',
+                       146  => 'JPop',
+                       147  => 'Synthpop',
+
+                       255  => 'Unknown',
+
+                       'CR' => 'Cover',
+                       'RX' => 'Remix'
+               );
+
+               static $GenreLookupSCMPX = array();
+               if ($allowSCMPXextended && empty($GenreLookupSCMPX)) {
+                       $GenreLookupSCMPX = $GenreLookup;
+                       // http://www.geocities.co.jp/SiliconValley-Oakland/3664/alittle.html#GenreExtended
+                       // Extended ID3v1 genres invented by SCMPX
+                       // Note that 255 "Japanese Anime" conflicts with standard "Unknown"
+                       $GenreLookupSCMPX[240] = 'Sacred';
+                       $GenreLookupSCMPX[241] = 'Northern Europe';
+                       $GenreLookupSCMPX[242] = 'Irish & Scottish';
+                       $GenreLookupSCMPX[243] = 'Scotland';
+                       $GenreLookupSCMPX[244] = 'Ethnic Europe';
+                       $GenreLookupSCMPX[245] = 'Enka';
+                       $GenreLookupSCMPX[246] = 'Children\'s Song';
+                       $GenreLookupSCMPX[247] = 'Japanese Sky';
+                       $GenreLookupSCMPX[248] = 'Japanese Heavy Rock';
+                       $GenreLookupSCMPX[249] = 'Japanese Doom Rock';
+                       $GenreLookupSCMPX[250] = 'Japanese J-POP';
+                       $GenreLookupSCMPX[251] = 'Japanese Seiyu';
+                       $GenreLookupSCMPX[252] = 'Japanese Ambient Techno';
+                       $GenreLookupSCMPX[253] = 'Japanese Moemoe';
+                       $GenreLookupSCMPX[254] = 'Japanese Tokusatsu';
+                       //$GenreLookupSCMPX[255] = 'Japanese Anime';
+               }
+
+               return ($allowSCMPXextended ? $GenreLookupSCMPX : $GenreLookup);
+       }
+
+       public static function LookupGenreName($genreid, $allowSCMPXextended=true) {
+               switch ($genreid) {
+                       case 'RX':
+                       case 'CR':
+                               break;
+                       default:
+                               if (!is_numeric($genreid)) {
+                                       return false;
+                               }
+                               $genreid = intval($genreid); // to handle 3 or '3' or '03'
+                               break;
+               }
+               $GenreLookup = self::ArrayOfGenres($allowSCMPXextended);
+               return (isset($GenreLookup[$genreid]) ? $GenreLookup[$genreid] : false);
+       }
+
+       public static function LookupGenreID($genre, $allowSCMPXextended=false) {
+               $GenreLookup = self::ArrayOfGenres($allowSCMPXextended);
+               $LowerCaseNoSpaceSearchTerm = strtolower(str_replace(' ', '', $genre));
+               foreach ($GenreLookup as $key => $value) {
+                       if (strtolower(str_replace(' ', '', $value)) == $LowerCaseNoSpaceSearchTerm) {
+                               return $key;
+                       }
+               }
+               return false;
+       }
+
+       public static function StandardiseID3v1GenreName($OriginalGenre) {
+               if (($GenreID = self::LookupGenreID($OriginalGenre)) !== false) {
+                       return self::LookupGenreName($GenreID);
+               }
+               return $OriginalGenre;
+       }
+
+       public static function GenerateID3v1Tag($title, $artist, $album, $year, $genreid, $comment, $track='') {
+               $ID3v1Tag  = 'TAG';
+               $ID3v1Tag .= str_pad(trim(substr($title,  0, 30)), 30, "\x00", STR_PAD_RIGHT);
+               $ID3v1Tag .= str_pad(trim(substr($artist, 0, 30)), 30, "\x00", STR_PAD_RIGHT);
+               $ID3v1Tag .= str_pad(trim(substr($album,  0, 30)), 30, "\x00", STR_PAD_RIGHT);
+               $ID3v1Tag .= str_pad(trim(substr($year,   0,  4)),  4, "\x00", STR_PAD_LEFT);
+               if (!empty($track) && ($track > 0) && ($track <= 255)) {
+                       $ID3v1Tag .= str_pad(trim(substr($comment, 0, 28)), 28, "\x00", STR_PAD_RIGHT);
+                       $ID3v1Tag .= "\x00";
+                       if (gettype($track) == 'string') {
+                               $track = (int) $track;
+                       }
+                       $ID3v1Tag .= chr($track);
+               } else {
+                       $ID3v1Tag .= str_pad(trim(substr($comment, 0, 30)), 30, "\x00", STR_PAD_RIGHT);
+               }
+               if (($genreid < 0) || ($genreid > 147)) {
+                       $genreid = 255; // 'unknown' genre
+               }
+               switch (gettype($genreid)) {
+                       case 'string':
+                       case 'integer':
+                               $ID3v1Tag .= chr(intval($genreid));
+                               break;
+                       default:
+                               $ID3v1Tag .= chr(255); // 'unknown' genre
+                               break;
+               }
+
+               return $ID3v1Tag;
+       }
+
+}
diff --git a/wp-includes/ID3/module.tag.id3v2.php b/wp-includes/ID3/module.tag.id3v2.php
new file mode 100644 (file)
index 0000000..b08f9f9
--- /dev/null
@@ -0,0 +1,3414 @@
+<?php
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org>               //
+//  available at http://getid3.sourceforge.net                 //
+//            or http://www.getid3.org                         //
+/////////////////////////////////////////////////////////////////
+// See readme.txt for more details                             //
+/////////////////////////////////////////////////////////////////
+///                                                            //
+// module.tag.id3v2.php                                        //
+// module for analyzing ID3v2 tags                             //
+// dependencies: module.tag.id3v1.php                          //
+//                                                            ///
+/////////////////////////////////////////////////////////////////
+
+getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v1.php', __FILE__, true);
+
+class getid3_id3v2 extends getid3_handler
+{
+       public $StartingOffset = 0;
+
+       public function Analyze() {
+               $info = &$this->getid3->info;
+
+               //    Overall tag structure:
+               //        +-----------------------------+
+               //        |      Header (10 bytes)      |
+               //        +-----------------------------+
+               //        |       Extended Header       |
+               //        | (variable length, OPTIONAL) |
+               //        +-----------------------------+
+               //        |   Frames (variable length)  |
+               //        +-----------------------------+
+               //        |           Padding           |
+               //        | (variable length, OPTIONAL) |
+               //        +-----------------------------+
+               //        | Footer (10 bytes, OPTIONAL) |
+               //        +-----------------------------+
+
+               //    Header
+               //        ID3v2/file identifier      "ID3"
+               //        ID3v2 version              $04 00
+               //        ID3v2 flags                (%ab000000 in v2.2, %abc00000 in v2.3, %abcd0000 in v2.4.x)
+               //        ID3v2 size             4 * %0xxxxxxx
+
+
+               // shortcuts
+               $info['id3v2']['header'] = true;
+               $thisfile_id3v2                  = &$info['id3v2'];
+               $thisfile_id3v2['flags']         =  array();
+               $thisfile_id3v2_flags            = &$thisfile_id3v2['flags'];
+
+
+               fseek($this->getid3->fp, $this->StartingOffset, SEEK_SET);
+               $header = fread($this->getid3->fp, 10);
+               if (substr($header, 0, 3) == 'ID3'  &&  strlen($header) == 10) {
+
+                       $thisfile_id3v2['majorversion'] = ord($header{3});
+                       $thisfile_id3v2['minorversion'] = ord($header{4});
+
+                       // shortcut
+                       $id3v2_majorversion = &$thisfile_id3v2['majorversion'];
+
+               } else {
+
+                       unset($info['id3v2']);
+                       return false;
+
+               }
+
+               if ($id3v2_majorversion > 4) { // this script probably won't correctly parse ID3v2.5.x and above (if it ever exists)
+
+                       $info['error'][] = 'this script only parses up to ID3v2.4.x - this tag is ID3v2.'.$id3v2_majorversion.'.'.$thisfile_id3v2['minorversion'];
+                       return false;
+
+               }
+
+               $id3_flags = ord($header{5});
+               switch ($id3v2_majorversion) {
+                       case 2:
+                               // %ab000000 in v2.2
+                               $thisfile_id3v2_flags['unsynch']     = (bool) ($id3_flags & 0x80); // a - Unsynchronisation
+                               $thisfile_id3v2_flags['compression'] = (bool) ($id3_flags & 0x40); // b - Compression
+                               break;
+
+                       case 3:
+                               // %abc00000 in v2.3
+                               $thisfile_id3v2_flags['unsynch']     = (bool) ($id3_flags & 0x80); // a - Unsynchronisation
+                               $thisfile_id3v2_flags['exthead']     = (bool) ($id3_flags & 0x40); // b - Extended header
+                               $thisfile_id3v2_flags['experim']     = (bool) ($id3_flags & 0x20); // c - Experimental indicator
+                               break;
+
+                       case 4:
+                               // %abcd0000 in v2.4
+                               $thisfile_id3v2_flags['unsynch']     = (bool) ($id3_flags & 0x80); // a - Unsynchronisation
+                               $thisfile_id3v2_flags['exthead']     = (bool) ($id3_flags & 0x40); // b - Extended header
+                               $thisfile_id3v2_flags['experim']     = (bool) ($id3_flags & 0x20); // c - Experimental indicator
+                               $thisfile_id3v2_flags['isfooter']    = (bool) ($id3_flags & 0x10); // d - Footer present
+                               break;
+               }
+
+               $thisfile_id3v2['headerlength'] = getid3_lib::BigEndian2Int(substr($header, 6, 4), 1) + 10; // length of ID3v2 tag in 10-byte header doesn't include 10-byte header length
+
+               $thisfile_id3v2['tag_offset_start'] = $this->StartingOffset;
+               $thisfile_id3v2['tag_offset_end']   = $thisfile_id3v2['tag_offset_start'] + $thisfile_id3v2['headerlength'];
+
+
+
+               // create 'encoding' key - used by getid3::HandleAllTags()
+               // in ID3v2 every field can have it's own encoding type
+               // so force everything to UTF-8 so it can be handled consistantly
+               $thisfile_id3v2['encoding'] = 'UTF-8';
+
+
+       //    Frames
+
+       //        All ID3v2 frames consists of one frame header followed by one or more
+       //        fields containing the actual information. The header is always 10
+       //        bytes and laid out as follows:
+       //
+       //        Frame ID      $xx xx xx xx  (four characters)
+       //        Size      4 * %0xxxxxxx
+       //        Flags         $xx xx
+
+               $sizeofframes = $thisfile_id3v2['headerlength'] - 10; // not including 10-byte initial header
+               if (!empty($thisfile_id3v2['exthead']['length'])) {
+                       $sizeofframes -= ($thisfile_id3v2['exthead']['length'] + 4);
+               }
+               if (!empty($thisfile_id3v2_flags['isfooter'])) {
+                       $sizeofframes -= 10; // footer takes last 10 bytes of ID3v2 header, after frame data, before audio
+               }
+               if ($sizeofframes > 0) {
+
+                       $framedata = fread($this->getid3->fp, $sizeofframes); // read all frames from file into $framedata variable
+
+                       //    if entire frame data is unsynched, de-unsynch it now (ID3v2.3.x)
+                       if (!empty($thisfile_id3v2_flags['unsynch']) && ($id3v2_majorversion <= 3)) {
+                               $framedata = $this->DeUnsynchronise($framedata);
+                       }
+                       //        [in ID3v2.4.0] Unsynchronisation [S:6.1] is done on frame level, instead
+                       //        of on tag level, making it easier to skip frames, increasing the streamability
+                       //        of the tag. The unsynchronisation flag in the header [S:3.1] indicates that
+                       //        there exists an unsynchronised frame, while the new unsynchronisation flag in
+                       //        the frame header [S:4.1.2] indicates unsynchronisation.
+
+
+                       //$framedataoffset = 10 + ($thisfile_id3v2['exthead']['length'] ? $thisfile_id3v2['exthead']['length'] + 4 : 0); // how many bytes into the stream - start from after the 10-byte header (and extended header length+4, if present)
+                       $framedataoffset = 10; // how many bytes into the stream - start from after the 10-byte header
+
+
+                       //    Extended Header
+                       if (!empty($thisfile_id3v2_flags['exthead'])) {
+                               $extended_header_offset = 0;
+
+                               if ($id3v2_majorversion == 3) {
+
+                                       // v2.3 definition:
+                                       //Extended header size  $xx xx xx xx   // 32-bit integer
+                                       //Extended Flags        $xx xx
+                                       //     %x0000000 %00000000 // v2.3
+                                       //     x - CRC data present
+                                       //Size of padding       $xx xx xx xx
+
+                                       $thisfile_id3v2['exthead']['length'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 4), 0);
+                                       $extended_header_offset += 4;
+
+                                       $thisfile_id3v2['exthead']['flag_bytes'] = 2;
+                                       $thisfile_id3v2['exthead']['flag_raw'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, $thisfile_id3v2['exthead']['flag_bytes']));
+                                       $extended_header_offset += $thisfile_id3v2['exthead']['flag_bytes'];
+
+                                       $thisfile_id3v2['exthead']['flags']['crc'] = (bool) ($thisfile_id3v2['exthead']['flag_raw'] & 0x8000);
+
+                                       $thisfile_id3v2['exthead']['padding_size'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 4));
+                                       $extended_header_offset += 4;
+
+                                       if ($thisfile_id3v2['exthead']['flags']['crc']) {
+                                               $thisfile_id3v2['exthead']['flag_data']['crc'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 4));
+                                               $extended_header_offset += 4;
+                                       }
+                                       $extended_header_offset += $thisfile_id3v2['exthead']['padding_size'];
+
+                               } elseif ($id3v2_majorversion == 4) {
+
+                                       // v2.4 definition:
+                                       //Extended header size   4 * %0xxxxxxx // 28-bit synchsafe integer
+                                       //Number of flag bytes       $01
+                                       //Extended Flags             $xx
+                                       //     %0bcd0000 // v2.4
+                                       //     b - Tag is an update
+                                       //         Flag data length       $00
+                                       //     c - CRC data present
+                                       //         Flag data length       $05
+                                       //         Total frame CRC    5 * %0xxxxxxx
+                                       //     d - Tag restrictions
+                                       //         Flag data length       $01
+
+                                       $thisfile_id3v2['exthead']['length'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 4), true);
+                                       $extended_header_offset += 4;
+
+                                       $thisfile_id3v2['exthead']['flag_bytes'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1)); // should always be 1
+                                       $extended_header_offset += 1;
+
+                                       $thisfile_id3v2['exthead']['flag_raw'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, $thisfile_id3v2['exthead']['flag_bytes']));
+                                       $extended_header_offset += $thisfile_id3v2['exthead']['flag_bytes'];
+
+                                       $thisfile_id3v2['exthead']['flags']['update']       = (bool) ($thisfile_id3v2['exthead']['flag_raw'] & 0x40);
+                                       $thisfile_id3v2['exthead']['flags']['crc']          = (bool) ($thisfile_id3v2['exthead']['flag_raw'] & 0x20);
+                                       $thisfile_id3v2['exthead']['flags']['restrictions'] = (bool) ($thisfile_id3v2['exthead']['flag_raw'] & 0x10);
+
+                                       if ($thisfile_id3v2['exthead']['flags']['update']) {
+                                               $ext_header_chunk_length = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1)); // should be 0
+                                               $extended_header_offset += 1;
+                                       }
+
+                                       if ($thisfile_id3v2['exthead']['flags']['crc']) {
+                                               $ext_header_chunk_length = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1)); // should be 5
+                                               $extended_header_offset += 1;
+                                               $thisfile_id3v2['exthead']['flag_data']['crc'] = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, $ext_header_chunk_length), true, false);
+                                               $extended_header_offset += $ext_header_chunk_length;
+                                       }
+
+                                       if ($thisfile_id3v2['exthead']['flags']['restrictions']) {
+                                               $ext_header_chunk_length = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1)); // should be 1
+                                               $extended_header_offset += 1;
+
+                                               // %ppqrrstt
+                                               $restrictions_raw = getid3_lib::BigEndian2Int(substr($framedata, $extended_header_offset, 1));
+                                               $extended_header_offset += 1;
+                                               $thisfile_id3v2['exthead']['flags']['restrictions']['tagsize']  = ($restrictions_raw & 0xC0) >> 6; // p - Tag size restrictions
+                                               $thisfile_id3v2['exthead']['flags']['restrictions']['textenc']  = ($restrictions_raw & 0x20) >> 5; // q - Text encoding restrictions
+                                               $thisfile_id3v2['exthead']['flags']['restrictions']['textsize'] = ($restrictions_raw & 0x18) >> 3; // r - Text fields size restrictions
+                                               $thisfile_id3v2['exthead']['flags']['restrictions']['imgenc']   = ($restrictions_raw & 0x04) >> 2; // s - Image encoding restrictions
+                                               $thisfile_id3v2['exthead']['flags']['restrictions']['imgsize']  = ($restrictions_raw & 0x03) >> 0; // t - Image size restrictions
+
+                                               $thisfile_id3v2['exthead']['flags']['restrictions_text']['tagsize']  = $this->LookupExtendedHeaderRestrictionsTagSizeLimits($thisfile_id3v2['exthead']['flags']['restrictions']['tagsize']);
+                                               $thisfile_id3v2['exthead']['flags']['restrictions_text']['textenc']  = $this->LookupExtendedHeaderRestrictionsTextEncodings($thisfile_id3v2['exthead']['flags']['restrictions']['textenc']);
+                                               $thisfile_id3v2['exthead']['flags']['restrictions_text']['textsize'] = $this->LookupExtendedHeaderRestrictionsTextFieldSize($thisfile_id3v2['exthead']['flags']['restrictions']['textsize']);
+                                               $thisfile_id3v2['exthead']['flags']['restrictions_text']['imgenc']   = $this->LookupExtendedHeaderRestrictionsImageEncoding($thisfile_id3v2['exthead']['flags']['restrictions']['imgenc']);
+                                               $thisfile_id3v2['exthead']['flags']['restrictions_text']['imgsize']  = $this->LookupExtendedHeaderRestrictionsImageSizeSize($thisfile_id3v2['exthead']['flags']['restrictions']['imgsize']);
+                                       }
+
+                                       if ($thisfile_id3v2['exthead']['length'] != $extended_header_offset) {
+                                               $info['warning'][] = 'ID3v2.4 extended header length mismatch (expecting '.intval($thisfile_id3v2['exthead']['length']).', found '.intval($extended_header_offset).')';
+                                       }
+                               }
+
+                               $framedataoffset += $extended_header_offset;
+                               $framedata = substr($framedata, $extended_header_offset);
+                       } // end extended header
+
+
+                       while (isset($framedata) && (strlen($framedata) > 0)) { // cycle through until no more frame data is left to parse
+                               if (strlen($framedata) <= $this->ID3v2HeaderLength($id3v2_majorversion)) {
+                                       // insufficient room left in ID3v2 header for actual data - must be padding
+                                       $thisfile_id3v2['padding']['start']  = $framedataoffset;
+                                       $thisfile_id3v2['padding']['length'] = strlen($framedata);
+                                       $thisfile_id3v2['padding']['valid']  = true;
+                                       for ($i = 0; $i < $thisfile_id3v2['padding']['length']; $i++) {
+                                               if ($framedata{$i} != "\x00") {
+                                                       $thisfile_id3v2['padding']['valid'] = false;
+                                                       $thisfile_id3v2['padding']['errorpos'] = $thisfile_id3v2['padding']['start'] + $i;
+                                                       $info['warning'][] = 'Invalid ID3v2 padding found at offset '.$thisfile_id3v2['padding']['errorpos'].' (the remaining '.($thisfile_id3v2['padding']['length'] - $i).' bytes are considered invalid)';
+                                                       break;
+                                               }
+                                       }
+                                       break; // skip rest of ID3v2 header
+                               }
+                               if ($id3v2_majorversion == 2) {
+                                       // Frame ID  $xx xx xx (three characters)
+                                       // Size      $xx xx xx (24-bit integer)
+                                       // Flags     $xx xx
+
+                                       $frame_header = substr($framedata, 0, 6); // take next 6 bytes for header
+                                       $framedata    = substr($framedata, 6);    // and leave the rest in $framedata
+                                       $frame_name   = substr($frame_header, 0, 3);
+                                       $frame_size   = getid3_lib::BigEndian2Int(substr($frame_header, 3, 3), 0);
+                                       $frame_flags  = 0; // not used for anything in ID3v2.2, just set to avoid E_NOTICEs
+
+                               } elseif ($id3v2_majorversion > 2) {
+
+                                       // Frame ID  $xx xx xx xx (four characters)
+                                       // Size      $xx xx xx xx (32-bit integer in v2.3, 28-bit synchsafe in v2.4+)
+                                       // Flags     $xx xx
+
+                                       $frame_header = substr($framedata, 0, 10); // take next 10 bytes for header
+                                       $framedata    = substr($framedata, 10);    // and leave the rest in $framedata
+
+                                       $frame_name = substr($frame_header, 0, 4);
+                                       if ($id3v2_majorversion == 3) {
+                                               $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 0); // 32-bit integer
+                                       } else { // ID3v2.4+
+                                               $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 1); // 32-bit synchsafe integer (28-bit value)
+                                       }
+
+                                       if ($frame_size < (strlen($framedata) + 4)) {
+                                               $nextFrameID = substr($framedata, $frame_size, 4);
+                                               if ($this->IsValidID3v2FrameName($nextFrameID, $id3v2_majorversion)) {
+                                                       // next frame is OK
+                                               } elseif (($frame_name == "\x00".'MP3') || ($frame_name == "\x00\x00".'MP') || ($frame_name == ' MP3') || ($frame_name == 'MP3e')) {
+                                                       // MP3ext known broken frames - "ok" for the purposes of this test
+                                               } elseif (($id3v2_majorversion == 4) && ($this->IsValidID3v2FrameName(substr($framedata, getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 0), 4), 3))) {
+                                                       $info['warning'][] = 'ID3v2 tag written as ID3v2.4, but with non-synchsafe integers (ID3v2.3 style). Older versions of (Helium2; iTunes) are known culprits of this. Tag has been parsed as ID3v2.3';
+                                                       $id3v2_majorversion = 3;
+                                                       $frame_size = getid3_lib::BigEndian2Int(substr($frame_header, 4, 4), 0); // 32-bit integer
+                                               }
+                                       }
+
+
+                                       $frame_flags = getid3_lib::BigEndian2Int(substr($frame_header, 8, 2));
+                               }
+
+                               if ((($id3v2_majorversion == 2) && ($frame_name == "\x00\x00\x00")) || ($frame_name == "\x00\x00\x00\x00")) {
+                                       // padding encountered
+
+                                       $thisfile_id3v2['padding']['start']  = $framedataoffset;
+                                       $thisfile_id3v2['padding']['length'] = strlen($frame_header) + strlen($framedata);
+                                       $thisfile_id3v2['padding']['valid']  = true;
+
+                                       $len = strlen($framedata);
+                                       for ($i = 0; $i < $len; $i++) {
+                                               if ($framedata{$i} != "\x00") {
+                                                       $thisfile_id3v2['padding']['valid'] = false;
+                                                       $thisfile_id3v2['padding']['errorpos'] = $thisfile_id3v2['padding']['start'] + $i;
+                                                       $info['warning'][] = 'Invalid ID3v2 padding found at offset '.$thisfile_id3v2['padding']['errorpos'].' (the remaining '.($thisfile_id3v2['padding']['length'] - $i).' bytes are considered invalid)';
+                                                       break;
+                                               }
+                                       }
+                                       break; // skip rest of ID3v2 header
+                               }
+
+                               if ($frame_name == 'COM ') {
+                                       $info['warning'][] = 'error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_majorversion.'))). [Note: this particular error has been known to happen with tags edited by iTunes (versions "X v2.0.3", "v3.0.1" are known-guilty, probably others too)]';
+                                       $frame_name = 'COMM';
+                               }
+                               if (($frame_size <= strlen($framedata)) && ($this->IsValidID3v2FrameName($frame_name, $id3v2_majorversion))) {
+
+                                       unset($parsedFrame);
+                                       $parsedFrame['frame_name']      = $frame_name;
+                                       $parsedFrame['frame_flags_raw'] = $frame_flags;
+                                       $parsedFrame['data']            = substr($framedata, 0, $frame_size);
+                                       $parsedFrame['datalength']      = getid3_lib::CastAsInt($frame_size);
+                                       $parsedFrame['dataoffset']      = $framedataoffset;
+
+                                       $this->ParseID3v2Frame($parsedFrame);
+                                       $thisfile_id3v2[$frame_name][] = $parsedFrame;
+
+                                       $framedata = substr($framedata, $frame_size);
+
+                               } else { // invalid frame length or FrameID
+
+                                       if ($frame_size <= strlen($framedata)) {
+
+                                               if ($this->IsValidID3v2FrameName(substr($framedata, $frame_size, 4), $id3v2_majorversion)) {
+
+                                                       // next frame is valid, just skip the current frame
+                                                       $framedata = substr($framedata, $frame_size);
+                                                       $info['warning'][] = 'Next ID3v2 frame is valid, skipping current frame.';
+
+                                               } else {
+
+                                                       // next frame is invalid too, abort processing
+                                                       //unset($framedata);
+                                                       $framedata = null;
+                                                       $info['error'][] = 'Next ID3v2 frame is also invalid, aborting processing.';
+
+                                               }
+
+                                       } elseif ($frame_size == strlen($framedata)) {
+
+                                               // this is the last frame, just skip
+                                               $info['warning'][] = 'This was the last ID3v2 frame.';
+
+                                       } else {
+
+                                               // next frame is invalid too, abort processing
+                                               //unset($framedata);
+                                               $framedata = null;
+                                               $info['warning'][] = 'Invalid ID3v2 frame size, aborting.';
+
+                                       }
+                                       if (!$this->IsValidID3v2FrameName($frame_name, $id3v2_majorversion)) {
+
+                                               switch ($frame_name) {
+                                                       case "\x00\x00".'MP':
+                                                       case "\x00".'MP3':
+                                                       case ' MP3':
+                                                       case 'MP3e':
+                                                       case "\x00".'MP':
+                                                       case ' MP':
+                                                       case 'MP3':
+                                                               $info['warning'][] = 'error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: !IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_majorversion.'))). [Note: this particular error has been known to happen with tags edited by "MP3ext (www.mutschler.de/mp3ext/)"]';
+                                                               break;
+
+                                                       default:
+                                                               $info['warning'][] = 'error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: !IsValidID3v2FrameName("'.str_replace("\x00", ' ', $frame_name).'", '.$id3v2_majorversion.'))).';
+                                                               break;
+                                               }
+
+                                       } elseif (!isset($framedata) || ($frame_size > strlen($framedata))) {
+
+                                               $info['error'][] = 'error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag). (ERROR: $frame_size ('.$frame_size.') > strlen($framedata) ('.(isset($framedata) ? strlen($framedata) : 'null').')).';
+
+                                       } else {
+
+                                               $info['error'][] = 'error parsing "'.$frame_name.'" ('.$framedataoffset.' bytes into the ID3v2.'.$id3v2_majorversion.' tag).';
+
+                                       }
+
+                               }
+                               $framedataoffset += ($frame_size + $this->ID3v2HeaderLength($id3v2_majorversion));
+
+                       }
+
+               }
+
+
+       //    Footer
+
+       //    The footer is a copy of the header, but with a different identifier.
+       //        ID3v2 identifier           "3DI"
+       //        ID3v2 version              $04 00
+       //        ID3v2 flags                %abcd0000
+       //        ID3v2 size             4 * %0xxxxxxx
+
+               if (isset($thisfile_id3v2_flags['isfooter']) && $thisfile_id3v2_flags['isfooter']) {
+                       $footer = fread($this->getid3->fp, 10);
+                       if (substr($footer, 0, 3) == '3DI') {
+                               $thisfile_id3v2['footer'] = true;
+                               $thisfile_id3v2['majorversion_footer'] = ord($footer{3});
+                               $thisfile_id3v2['minorversion_footer'] = ord($footer{4});
+                       }
+                       if ($thisfile_id3v2['majorversion_footer'] <= 4) {
+                               $id3_flags = ord(substr($footer{5}));
+                               $thisfile_id3v2_flags['unsynch_footer']  = (bool) ($id3_flags & 0x80);
+                               $thisfile_id3v2_flags['extfoot_footer']  = (bool) ($id3_flags & 0x40);
+                               $thisfile_id3v2_flags['experim_footer']  = (bool) ($id3_flags & 0x20);
+                               $thisfile_id3v2_flags['isfooter_footer'] = (bool) ($id3_flags & 0x10);
+
+                               $thisfile_id3v2['footerlength'] = getid3_lib::BigEndian2Int(substr($footer, 6, 4), 1);
+                       }
+               } // end footer
+
+               if (isset($thisfile_id3v2['comments']['genre'])) {
+                       foreach ($thisfile_id3v2['comments']['genre'] as $key => $value) {
+                               unset($thisfile_id3v2['comments']['genre'][$key]);
+                               $thisfile_id3v2['comments'] = getid3_lib::array_merge_noclobber($thisfile_id3v2['comments'], array('genre'=>$this->ParseID3v2GenreString($value)));
+                       }
+               }
+
+               if (isset($thisfile_id3v2['comments']['track'])) {
+                       foreach ($thisfile_id3v2['comments']['track'] as $key => $value) {
+                               if (strstr($value, '/')) {
+                                       list($thisfile_id3v2['comments']['tracknum'][$key], $thisfile_id3v2['comments']['totaltracks'][$key]) = explode('/', $thisfile_id3v2['comments']['track'][$key]);
+                               }
+                       }
+               }
+
+               if (!isset($thisfile_id3v2['comments']['year']) && !empty($thisfile_id3v2['comments']['recording_time'][0]) && preg_match('#^([0-9]{4})#', trim($thisfile_id3v2['comments']['recording_time'][0]), $matches)) {
+                       $thisfile_id3v2['comments']['year'] = array($matches[1]);
+               }
+
+
+               if (!empty($thisfile_id3v2['TXXX'])) {
+                       // MediaMonkey does this, maybe others: write a blank RGAD frame, but put replay-gain adjustment values in TXXX frames
+                       foreach ($thisfile_id3v2['TXXX'] as $txxx_array) {
+                               switch ($txxx_array['description']) {
+                                       case 'replaygain_track_gain':
+                                               if (empty($info['replay_gain']['track']['adjustment']) && !empty($txxx_array['data'])) {
+                                                       $info['replay_gain']['track']['adjustment'] = floatval(trim(str_replace('dB', '', $txxx_array['data'])));
+                                               }
+                                               break;
+                                       case 'replaygain_track_peak':
+                                               if (empty($info['replay_gain']['track']['peak']) && !empty($txxx_array['data'])) {
+                                                       $info['replay_gain']['track']['peak'] = floatval($txxx_array['data']);
+                                               }
+                                               break;
+                                       case 'replaygain_album_gain':
+                                               if (empty($info['replay_gain']['album']['adjustment']) && !empty($txxx_array['data'])) {
+                                                       $info['replay_gain']['album']['adjustment'] = floatval(trim(str_replace('dB', '', $txxx_array['data'])));
+                                               }
+                                               break;
+                               }
+                       }
+               }
+
+
+               // Set avdataoffset
+               $info['avdataoffset'] = $thisfile_id3v2['headerlength'];
+               if (isset($thisfile_id3v2['footer'])) {
+                       $info['avdataoffset'] += 10;
+               }
+
+               return true;
+       }
+
+
+       public function ParseID3v2GenreString($genrestring) {
+               // Parse genres into arrays of genreName and genreID
+               // ID3v2.2.x, ID3v2.3.x: '(21)' or '(4)Eurodisco' or '(51)(39)' or '(55)((I think...)'
+               // ID3v2.4.x: '21' $00 'Eurodisco' $00
+               $clean_genres = array();
+               if (strpos($genrestring, "\x00") === false) {
+                       $genrestring = preg_replace('#\(([0-9]{1,3})\)#', '$1'."\x00", $genrestring);
+               }
+               $genre_elements = explode("\x00", $genrestring);
+               foreach ($genre_elements as $element) {
+                       $element = trim($element);
+                       if ($element) {
+                               if (preg_match('#^[0-9]{1,3}#', $element)) {
+                                       $clean_genres[] = getid3_id3v1::LookupGenreName($element);
+                               } else {
+                                       $clean_genres[] = str_replace('((', '(', $element);
+                               }
+                       }
+               }
+               return $clean_genres;
+       }
+
+
+       public function ParseID3v2Frame(&$parsedFrame) {
+
+               // shortcuts
+               $info = &$this->getid3->info;
+               $id3v2_majorversion = $info['id3v2']['majorversion'];
+
+               $parsedFrame['framenamelong']  = $this->FrameNameLongLookup($parsedFrame['frame_name']);
+               if (empty($parsedFrame['framenamelong'])) {
+                       unset($parsedFrame['framenamelong']);
+               }
+               $parsedFrame['framenameshort'] = $this->FrameNameShortLookup($parsedFrame['frame_name']);
+               if (empty($parsedFrame['framenameshort'])) {
+                       unset($parsedFrame['framenameshort']);
+               }
+
+               if ($id3v2_majorversion >= 3) { // frame flags are not part of the ID3v2.2 standard
+                       if ($id3v2_majorversion == 3) {
+                               //    Frame Header Flags
+                               //    %abc00000 %ijk00000
+                               $parsedFrame['flags']['TagAlterPreservation']  = (bool) ($parsedFrame['frame_flags_raw'] & 0x8000); // a - Tag alter preservation
+                               $parsedFrame['flags']['FileAlterPreservation'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x4000); // b - File alter preservation
+                               $parsedFrame['flags']['ReadOnly']              = (bool) ($parsedFrame['frame_flags_raw'] & 0x2000); // c - Read only
+                               $parsedFrame['flags']['compression']           = (bool) ($parsedFrame['frame_flags_raw'] & 0x0080); // i - Compression
+                               $parsedFrame['flags']['Encryption']            = (bool) ($parsedFrame['frame_flags_raw'] & 0x0040); // j - Encryption
+                               $parsedFrame['flags']['GroupingIdentity']      = (bool) ($parsedFrame['frame_flags_raw'] & 0x0020); // k - Grouping identity
+
+                       } elseif ($id3v2_majorversion == 4) {
+                               //    Frame Header Flags
+                               //    %0abc0000 %0h00kmnp
+                               $parsedFrame['flags']['TagAlterPreservation']  = (bool) ($parsedFrame['frame_flags_raw'] & 0x4000); // a - Tag alter preservation
+                               $parsedFrame['flags']['FileAlterPreservation'] = (bool) ($parsedFrame['frame_flags_raw'] & 0x2000); // b - File alter preservation
+                               $parsedFrame['flags']['ReadOnly']              = (bool) ($parsedFrame['frame_flags_raw'] & 0x1000); // c - Read only
+                               $parsedFrame['flags']['GroupingIdentity']      = (bool) ($parsedFrame['frame_flags_raw'] & 0x0040); // h - Grouping identity
+                               $parsedFrame['flags']['compression']           = (bool) ($parsedFrame['frame_flags_raw'] & 0x0008); // k - Compression
+                               $parsedFrame['flags']['Encryption']            = (bool) ($parsedFrame['frame_flags_raw'] & 0x0004); // m - Encryption
+                               $parsedFrame['flags']['Unsynchronisation']     = (bool) ($parsedFrame['frame_flags_raw'] & 0x0002); // n - Unsynchronisation
+                               $parsedFrame['flags']['DataLengthIndicator']   = (bool) ($parsedFrame['frame_flags_raw'] & 0x0001); // p - Data length indicator
+
+                               // Frame-level de-unsynchronisation - ID3v2.4
+                               if ($parsedFrame['flags']['Unsynchronisation']) {
+                                       $parsedFrame['data'] = $this->DeUnsynchronise($parsedFrame['data']);
+                               }
+
+                               if ($parsedFrame['flags']['DataLengthIndicator']) {
+                                       $parsedFrame['data_length_indicator'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 0, 4), 1);
+                                       $parsedFrame['data']                  =                           substr($parsedFrame['data'], 4);
+                               }
+                       }
+
+                       //    Frame-level de-compression
+                       if ($parsedFrame['flags']['compression']) {
+                               $parsedFrame['decompressed_size'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 0, 4));
+                               if (!function_exists('gzuncompress')) {
+                                       $info['warning'][] = 'gzuncompress() support required to decompress ID3v2 frame "'.$parsedFrame['frame_name'].'"';
+                               } else {
+                                       if ($decompresseddata = @gzuncompress(substr($parsedFrame['data'], 4))) {
+                                       //if ($decompresseddata = @gzuncompress($parsedFrame['data'])) {
+                                               $parsedFrame['data'] = $decompresseddata;
+                                               unset($decompresseddata);
+                                       } else {
+                                               $info['warning'][] = 'gzuncompress() failed on compressed contents of ID3v2 frame "'.$parsedFrame['frame_name'].'"';
+                                       }
+                               }
+                       }
+               }
+
+               if (!empty($parsedFrame['flags']['DataLengthIndicator'])) {
+                       if ($parsedFrame['data_length_indicator'] != strlen($parsedFrame['data'])) {
+                               $info['warning'][] = 'ID3v2 frame "'.$parsedFrame['frame_name'].'" should be '.$parsedFrame['data_length_indicator'].' bytes long according to DataLengthIndicator, but found '.strlen($parsedFrame['data']).' bytes of data';
+                       }
+               }
+
+               if (isset($parsedFrame['datalength']) && ($parsedFrame['datalength'] == 0)) {
+
+                       $warning = 'Frame "'.$parsedFrame['frame_name'].'" at offset '.$parsedFrame['dataoffset'].' has no data portion';
+                       switch ($parsedFrame['frame_name']) {
+                               case 'WCOM':
+                                       $warning .= ' (this is known to happen with files tagged by RioPort)';
+                                       break;
+
+                               default:
+                                       break;
+                       }
+                       $info['warning'][] = $warning;
+
+               } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'UFID')) || // 4.1   UFID Unique file identifier
+                       (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'UFI'))) {  // 4.1   UFI  Unique file identifier
+                       //   There may be more than one 'UFID' frame in a tag,
+                       //   but only one with the same 'Owner identifier'.
+                       // <Header for 'Unique file identifier', ID: 'UFID'>
+                       // Owner identifier        <text string> $00
+                       // Identifier              <up to 64 bytes binary data>
+                       $exploded = explode("\x00", $parsedFrame['data'], 2);
+                       $parsedFrame['ownerid'] = (isset($exploded[0]) ? $exploded[0] : '');
+                       $parsedFrame['data']    = (isset($exploded[1]) ? $exploded[1] : '');
+
+               } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'TXXX')) || // 4.2.2 TXXX User defined text information frame
+                               (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'TXX'))) {    // 4.2.2 TXX  User defined text information frame
+                       //   There may be more than one 'TXXX' frame in each tag,
+                       //   but only one with the same description.
+                       // <Header for 'User defined text information frame', ID: 'TXXX'>
+                       // Text encoding     $xx
+                       // Description       <text string according to encoding> $00 (00)
+                       // Value             <text string according to encoding>
+
+                       $frame_offset = 0;
+                       $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+
+                       if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
+                               $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
+                       }
+                       $frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding), $frame_offset);
+                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
+                               $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
+                       }
+                       $frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                       if (ord($frame_description) === 0) {
+                               $frame_description = '';
+                       }
+                       $parsedFrame['encodingid']  = $frame_textencoding;
+                       $parsedFrame['encoding']    = $this->TextEncodingNameLookup($frame_textencoding);
+
+                       $parsedFrame['description'] = $frame_description;
+                       $parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)));
+                       if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {
+                               $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = trim(getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']));
+                       }
+                       //unset($parsedFrame['data']); do not unset, may be needed elsewhere, e.g. for replaygain
+
+
+               } elseif ($parsedFrame['frame_name']{0} == 'T') { // 4.2. T??[?] Text information frame
+                       //   There may only be one text information frame of its kind in an tag.
+                       // <Header for 'Text information frame', ID: 'T000' - 'TZZZ',
+                       // excluding 'TXXX' described in 4.2.6.>
+                       // Text encoding                $xx
+                       // Information                  <text string(s) according to encoding>
+
+                       $frame_offset = 0;
+                       $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
+                               $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
+                       }
+
+                       $parsedFrame['data'] = (string) substr($parsedFrame['data'], $frame_offset);
+
+                       $parsedFrame['encodingid'] = $frame_textencoding;
+                       $parsedFrame['encoding']   = $this->TextEncodingNameLookup($frame_textencoding);
+
+                       if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {
+                               // ID3v2.3 specs say that TPE1 (and others) can contain multiple artist values separated with /
+                               // This of course breaks when an artist name contains slash character, e.g. "AC/DC"
+                               // MP3tag (maybe others) implement alternative system where multiple artists are null-separated, which makes more sense
+                               // getID3 will split null-separated artists into multiple artists and leave slash-separated ones to the user
+                               switch ($parsedFrame['encoding']) {
+                                       case 'UTF-16':
+                                       case 'UTF-16BE':
+                                       case 'UTF-16LE':
+                                               $wordsize = 2;
+                                               break;
+                                       case 'ISO-8859-1':
+                                       case 'UTF-8':
+                                       default:
+                                               $wordsize = 1;
+                                               break;
+                               }
+                               $Txxx_elements = array();
+                               $Txxx_elements_start_offset = 0;
+                               for ($i = 0; $i < strlen($parsedFrame['data']); $i += $wordsize) {
+                                       if (substr($parsedFrame['data'], $i, $wordsize) == str_repeat("\x00", $wordsize)) {
+                                               $Txxx_elements[] = substr($parsedFrame['data'], $Txxx_elements_start_offset, $i - $Txxx_elements_start_offset);
+                                               $Txxx_elements_start_offset = $i + $wordsize;
+                                       }
+                               }
+                               $Txxx_elements[] = substr($parsedFrame['data'], $Txxx_elements_start_offset, $i - $Txxx_elements_start_offset);
+                               foreach ($Txxx_elements as $Txxx_element) {
+                                       $string = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $Txxx_element);
+                                       if (!empty($string)) {
+                                               $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = $string;
+                                       }
+                               }
+                               unset($string, $wordsize, $i, $Txxx_elements, $Txxx_element, $Txxx_elements_start_offset);
+                       }
+
+               } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'WXXX')) || // 4.3.2 WXXX User defined URL link frame
+                               (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'WXX'))) {    // 4.3.2 WXX  User defined URL link frame
+                       //   There may be more than one 'WXXX' frame in each tag,
+                       //   but only one with the same description
+                       // <Header for 'User defined URL link frame', ID: 'WXXX'>
+                       // Text encoding     $xx
+                       // Description       <text string according to encoding> $00 (00)
+                       // URL               <text string>
+
+                       $frame_offset = 0;
+                       $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
+                               $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
+                       }
+                       $frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding), $frame_offset);
+                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
+                               $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
+                       }
+                       $frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+
+                       if (ord($frame_description) === 0) {
+                               $frame_description = '';
+                       }
+                       $parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)));
+
+                       $frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding));
+                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
+                               $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
+                       }
+                       if ($frame_terminatorpos) {
+                               // there are null bytes after the data - this is not according to spec
+                               // only use data up to first null byte
+                               $frame_urldata = (string) substr($parsedFrame['data'], 0, $frame_terminatorpos);
+                       } else {
+                               // no null bytes following data, just use all data
+                               $frame_urldata = (string) $parsedFrame['data'];
+                       }
+
+                       $parsedFrame['encodingid']  = $frame_textencoding;
+                       $parsedFrame['encoding']    = $this->TextEncodingNameLookup($frame_textencoding);
+
+                       $parsedFrame['url']         = $frame_urldata;
+                       $parsedFrame['description'] = $frame_description;
+                       if (!empty($parsedFrame['framenameshort']) && $parsedFrame['url']) {
+                               $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['url']);
+                       }
+                       unset($parsedFrame['data']);
+
+
+               } elseif ($parsedFrame['frame_name']{0} == 'W') { // 4.3. W??? URL link frames
+                       //   There may only be one URL link frame of its kind in a tag,
+                       //   except when stated otherwise in the frame description
+                       // <Header for 'URL link frame', ID: 'W000' - 'WZZZ', excluding 'WXXX'
+                       // described in 4.3.2.>
+                       // URL              <text string>
+
+                       $parsedFrame['url'] = trim($parsedFrame['data']);
+                       if (!empty($parsedFrame['framenameshort']) && $parsedFrame['url']) {
+                               $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = $parsedFrame['url'];
+                       }
+                       unset($parsedFrame['data']);
+
+
+               } elseif ((($id3v2_majorversion == 3) && ($parsedFrame['frame_name'] == 'IPLS')) || // 4.4  IPLS Involved people list (ID3v2.3 only)
+                               (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'IPL'))) {     // 4.4  IPL  Involved people list (ID3v2.2 only)
+                       // http://id3.org/id3v2.3.0#sec4.4
+                       //   There may only be one 'IPL' frame in each tag
+                       // <Header for 'User defined URL link frame', ID: 'IPL'>
+                       // Text encoding     $xx
+                       // People list strings    <textstrings>
+
+                       $frame_offset = 0;
+                       $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
+                               $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
+                       }
+                       $parsedFrame['encodingid'] = $frame_textencoding;
+                       $parsedFrame['encoding']   = $this->TextEncodingNameLookup($parsedFrame['encodingid']);
+                       $parsedFrame['data_raw']   = (string) substr($parsedFrame['data'], $frame_offset);
+
+                       // http://www.getid3.org/phpBB3/viewtopic.php?t=1369
+                       // "this tag typically contains null terminated strings, which are associated in pairs"
+                       // "there are users that use the tag incorrectly"
+                       $IPLS_parts = array();
+                       if (strpos($parsedFrame['data_raw'], "\x00") !== false) {
+                               $IPLS_parts_unsorted = array();
+                               if (((strlen($parsedFrame['data_raw']) % 2) == 0) && ((substr($parsedFrame['data_raw'], 0, 2) == "\xFF\xFE") || (substr($parsedFrame['data_raw'], 0, 2) == "\xFE\xFF"))) {
+                                       // UTF-16, be careful looking for null bytes since most 2-byte characters may contain one; you need to find twin null bytes, and on even padding
+                                       $thisILPS  = '';
+                                       for ($i = 0; $i < strlen($parsedFrame['data_raw']); $i += 2) {
+                                               $twobytes = substr($parsedFrame['data_raw'], $i, 2);
+                                               if ($twobytes === "\x00\x00") {
+                                                       $IPLS_parts_unsorted[] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $thisILPS);
+                                                       $thisILPS  = '';
+                                               } else {
+                                                       $thisILPS .= $twobytes;
+                                               }
+                                       }
+                                       if (strlen($thisILPS) > 2) { // 2-byte BOM
+                                               $IPLS_parts_unsorted[] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $thisILPS);
+                                       }
+                               } else {
+                                       // ISO-8859-1 or UTF-8 or other single-byte-null character set
+                                       $IPLS_parts_unsorted = explode("\x00", $parsedFrame['data_raw']);
+                               }
+                               if (count($IPLS_parts_unsorted) == 1) {
+                                       // just a list of names, e.g. "Dino Baptiste, Jimmy Copley, John Gordon, Bernie Marsden, Sharon Watson"
+                                       foreach ($IPLS_parts_unsorted as $key => $value) {
+                                               $IPLS_parts_sorted = preg_split('#[;,\\r\\n\\t]#', $value);
+                                               $position = '';
+                                               foreach ($IPLS_parts_sorted as $person) {
+                                                       $IPLS_parts[] = array('position'=>$position, 'person'=>$person);
+                                               }
+                                       }
+                               } elseif ((count($IPLS_parts_unsorted) % 2) == 0) {
+                                       $position = '';
+                                       $person   = '';
+                                       foreach ($IPLS_parts_unsorted as $key => $value) {
+                                               if (($key % 2) == 0) {
+                                                       $position = $value;
+                                               } else {
+                                                       $person   = $value;
+                                                       $IPLS_parts[] = array('position'=>$position, 'person'=>$person);
+                                                       $position = '';
+                                                       $person   = '';
+                                               }
+                                       }
+                               } else {
+                                       foreach ($IPLS_parts_unsorted as $key => $value) {
+                                               $IPLS_parts[] = array($value);
+                                       }
+                               }
+
+                       } else {
+                               $IPLS_parts = preg_split('#[;,\\r\\n\\t]#', $parsedFrame['data_raw']);
+                       }
+                       $parsedFrame['data'] = $IPLS_parts;
+
+                       if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {
+                               $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = $parsedFrame['data'];
+                       }
+
+
+               } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'MCDI')) || // 4.4   MCDI Music CD identifier
+                               (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'MCI'))) {     // 4.5   MCI  Music CD identifier
+                       //   There may only be one 'MCDI' frame in each tag
+                       // <Header for 'Music CD identifier', ID: 'MCDI'>
+                       // CD TOC                <binary data>
+
+                       if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {
+                               $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = $parsedFrame['data'];
+                       }
+
+
+               } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'ETCO')) || // 4.5   ETCO Event timing codes
+                               (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'ETC'))) {     // 4.6   ETC  Event timing codes
+                       //   There may only be one 'ETCO' frame in each tag
+                       // <Header for 'Event timing codes', ID: 'ETCO'>
+                       // Time stamp format    $xx
+                       //   Where time stamp format is:
+                       // $01  (32-bit value) MPEG frames from beginning of file
+                       // $02  (32-bit value) milliseconds from beginning of file
+                       //   Followed by a list of key events in the following format:
+                       // Type of event   $xx
+                       // Time stamp      $xx (xx ...)
+                       //   The 'Time stamp' is set to zero if directly at the beginning of the sound
+                       //   or after the previous event. All events MUST be sorted in chronological order.
+
+                       $frame_offset = 0;
+                       $parsedFrame['timestampformat'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+
+                       while ($frame_offset < strlen($parsedFrame['data'])) {
+                               $parsedFrame['typeid']    = substr($parsedFrame['data'], $frame_offset++, 1);
+                               $parsedFrame['type']      = $this->ETCOEventLookup($parsedFrame['typeid']);
+                               $parsedFrame['timestamp'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));
+                               $frame_offset += 4;
+                       }
+                       unset($parsedFrame['data']);
+
+
+               } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'MLLT')) || // 4.6   MLLT MPEG location lookup table
+                               (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'MLL'))) {     // 4.7   MLL MPEG location lookup table
+                       //   There may only be one 'MLLT' frame in each tag
+                       // <Header for 'Location lookup table', ID: 'MLLT'>
+                       // MPEG frames between reference  $xx xx
+                       // Bytes between reference        $xx xx xx
+                       // Milliseconds between reference $xx xx xx
+                       // Bits for bytes deviation       $xx
+                       // Bits for milliseconds dev.     $xx
+                       //   Then for every reference the following data is included;
+                       // Deviation in bytes         %xxx....
+                       // Deviation in milliseconds  %xxx....
+
+                       $frame_offset = 0;
+                       $parsedFrame['framesbetweenreferences'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 0, 2));
+                       $parsedFrame['bytesbetweenreferences']  = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 2, 3));
+                       $parsedFrame['msbetweenreferences']     = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 5, 3));
+                       $parsedFrame['bitsforbytesdeviation']   = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 8, 1));
+                       $parsedFrame['bitsformsdeviation']      = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], 9, 1));
+                       $parsedFrame['data'] = substr($parsedFrame['data'], 10);
+                       while ($frame_offset < strlen($parsedFrame['data'])) {
+                               $deviationbitstream .= getid3_lib::BigEndian2Bin(substr($parsedFrame['data'], $frame_offset++, 1));
+                       }
+                       $reference_counter = 0;
+                       while (strlen($deviationbitstream) > 0) {
+                               $parsedFrame[$reference_counter]['bytedeviation'] = bindec(substr($deviationbitstream, 0, $parsedFrame['bitsforbytesdeviation']));
+                               $parsedFrame[$reference_counter]['msdeviation']   = bindec(substr($deviationbitstream, $parsedFrame['bitsforbytesdeviation'], $parsedFrame['bitsformsdeviation']));
+                               $deviationbitstream = substr($deviationbitstream, $parsedFrame['bitsforbytesdeviation'] + $parsedFrame['bitsformsdeviation']);
+                               $reference_counter++;
+                       }
+                       unset($parsedFrame['data']);
+
+
+               } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'SYTC')) || // 4.7   SYTC Synchronised tempo codes
+                                 (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'STC'))) {  // 4.8   STC  Synchronised tempo codes
+                       //   There may only be one 'SYTC' frame in each tag
+                       // <Header for 'Synchronised tempo codes', ID: 'SYTC'>
+                       // Time stamp format   $xx
+                       // Tempo data          <binary data>
+                       //   Where time stamp format is:
+                       // $01  (32-bit value) MPEG frames from beginning of file
+                       // $02  (32-bit value) milliseconds from beginning of file
+
+                       $frame_offset = 0;
+                       $parsedFrame['timestampformat'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       $timestamp_counter = 0;
+                       while ($frame_offset < strlen($parsedFrame['data'])) {
+                               $parsedFrame[$timestamp_counter]['tempo'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                               if ($parsedFrame[$timestamp_counter]['tempo'] == 255) {
+                                       $parsedFrame[$timestamp_counter]['tempo'] += ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                               }
+                               $parsedFrame[$timestamp_counter]['timestamp'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));
+                               $frame_offset += 4;
+                               $timestamp_counter++;
+                       }
+                       unset($parsedFrame['data']);
+
+
+               } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'USLT')) || // 4.8   USLT Unsynchronised lyric/text transcription
+                               (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'ULT'))) {     // 4.9   ULT  Unsynchronised lyric/text transcription
+                       //   There may be more than one 'Unsynchronised lyrics/text transcription' frame
+                       //   in each tag, but only one with the same language and content descriptor.
+                       // <Header for 'Unsynchronised lyrics/text transcription', ID: 'USLT'>
+                       // Text encoding        $xx
+                       // Language             $xx xx xx
+                       // Content descriptor   <text string according to encoding> $00 (00)
+                       // Lyrics/text          <full text string according to encoding>
+
+                       $frame_offset = 0;
+                       $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
+                               $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
+                       }
+                       $frame_language = substr($parsedFrame['data'], $frame_offset, 3);
+                       $frame_offset += 3;
+                       $frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding), $frame_offset);
+                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
+                               $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
+                       }
+                       $frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                       if (ord($frame_description) === 0) {
+                               $frame_description = '';
+                       }
+                       $parsedFrame['data'] = substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)));
+
+                       $parsedFrame['encodingid']   = $frame_textencoding;
+                       $parsedFrame['encoding']     = $this->TextEncodingNameLookup($frame_textencoding);
+
+                       $parsedFrame['data']         = $parsedFrame['data'];
+                       $parsedFrame['language']     = $frame_language;
+                       $parsedFrame['languagename'] = $this->LanguageLookup($frame_language, false);
+                       $parsedFrame['description']  = $frame_description;
+                       if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {
+                               $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']);
+                       }
+                       unset($parsedFrame['data']);
+
+
+               } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'SYLT')) || // 4.9   SYLT Synchronised lyric/text
+                               (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'SLT'))) {     // 4.10  SLT  Synchronised lyric/text
+                       //   There may be more than one 'SYLT' frame in each tag,
+                       //   but only one with the same language and content descriptor.
+                       // <Header for 'Synchronised lyrics/text', ID: 'SYLT'>
+                       // Text encoding        $xx
+                       // Language             $xx xx xx
+                       // Time stamp format    $xx
+                       //   $01  (32-bit value) MPEG frames from beginning of file
+                       //   $02  (32-bit value) milliseconds from beginning of file
+                       // Content type         $xx
+                       // Content descriptor   <text string according to encoding> $00 (00)
+                       //   Terminated text to be synced (typically a syllable)
+                       //   Sync identifier (terminator to above string)   $00 (00)
+                       //   Time stamp                                     $xx (xx ...)
+
+                       $frame_offset = 0;
+                       $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
+                               $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
+                       }
+                       $frame_language = substr($parsedFrame['data'], $frame_offset, 3);
+                       $frame_offset += 3;
+                       $parsedFrame['timestampformat'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       $parsedFrame['contenttypeid']   = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       $parsedFrame['contenttype']     = $this->SYTLContentTypeLookup($parsedFrame['contenttypeid']);
+                       $parsedFrame['encodingid']      = $frame_textencoding;
+                       $parsedFrame['encoding']        = $this->TextEncodingNameLookup($frame_textencoding);
+
+                       $parsedFrame['language']        = $frame_language;
+                       $parsedFrame['languagename']    = $this->LanguageLookup($frame_language, false);
+
+                       $timestampindex = 0;
+                       $frame_remainingdata = substr($parsedFrame['data'], $frame_offset);
+                       while (strlen($frame_remainingdata)) {
+                               $frame_offset = 0;
+                               $frame_terminatorpos = strpos($frame_remainingdata, $this->TextEncodingTerminatorLookup($frame_textencoding));
+                               if ($frame_terminatorpos === false) {
+                                       $frame_remainingdata = '';
+                               } else {
+                                       if (ord(substr($frame_remainingdata, $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
+                                               $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
+                                       }
+                                       $parsedFrame['lyrics'][$timestampindex]['data'] = substr($frame_remainingdata, $frame_offset, $frame_terminatorpos - $frame_offset);
+
+                                       $frame_remainingdata = substr($frame_remainingdata, $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)));
+                                       if (($timestampindex == 0) && (ord($frame_remainingdata{0}) != 0)) {
+                                               // timestamp probably omitted for first data item
+                                       } else {
+                                               $parsedFrame['lyrics'][$timestampindex]['timestamp'] = getid3_lib::BigEndian2Int(substr($frame_remainingdata, 0, 4));
+                                               $frame_remainingdata = substr($frame_remainingdata, 4);
+                                       }
+                                       $timestampindex++;
+                               }
+                       }
+                       unset($parsedFrame['data']);
+
+
+               } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'COMM')) || // 4.10  COMM Comments
+                               (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'COM'))) {     // 4.11  COM  Comments
+                       //   There may be more than one comment frame in each tag,
+                       //   but only one with the same language and content descriptor.
+                       // <Header for 'Comment', ID: 'COMM'>
+                       // Text encoding          $xx
+                       // Language               $xx xx xx
+                       // Short content descrip. <text string according to encoding> $00 (00)
+                       // The actual text        <full text string according to encoding>
+
+                       if (strlen($parsedFrame['data']) < 5) {
+
+                               $info['warning'][] = 'Invalid data (too short) for "'.$parsedFrame['frame_name'].'" frame at offset '.$parsedFrame['dataoffset'];
+
+                       } else {
+
+                               $frame_offset = 0;
+                               $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                               if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
+                                       $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
+                               }
+                               $frame_language = substr($parsedFrame['data'], $frame_offset, 3);
+                               $frame_offset += 3;
+                               $frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding), $frame_offset);
+                               if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
+                                       $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
+                               }
+                               $frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                               if (ord($frame_description) === 0) {
+                                       $frame_description = '';
+                               }
+                               $frame_text = (string) substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)));
+
+                               $parsedFrame['encodingid']   = $frame_textencoding;
+                               $parsedFrame['encoding']     = $this->TextEncodingNameLookup($frame_textencoding);
+
+                               $parsedFrame['language']     = $frame_language;
+                               $parsedFrame['languagename'] = $this->LanguageLookup($frame_language, false);
+                               $parsedFrame['description']  = $frame_description;
+                               $parsedFrame['data']         = $frame_text;
+                               if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {
+                                       $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']);
+                               }
+
+                       }
+
+               } elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'RVA2')) { // 4.11  RVA2 Relative volume adjustment (2) (ID3v2.4+ only)
+                       //   There may be more than one 'RVA2' frame in each tag,
+                       //   but only one with the same identification string
+                       // <Header for 'Relative volume adjustment (2)', ID: 'RVA2'>
+                       // Identification          <text string> $00
+                       //   The 'identification' string is used to identify the situation and/or
+                       //   device where this adjustment should apply. The following is then
+                       //   repeated for every channel:
+                       // Type of channel         $xx
+                       // Volume adjustment       $xx xx
+                       // Bits representing peak  $xx
+                       // Peak volume             $xx (xx ...)
+
+                       $frame_terminatorpos = strpos($parsedFrame['data'], "\x00");
+                       $frame_idstring = substr($parsedFrame['data'], 0, $frame_terminatorpos);
+                       if (ord($frame_idstring) === 0) {
+                               $frame_idstring = '';
+                       }
+                       $frame_remainingdata = substr($parsedFrame['data'], $frame_terminatorpos + strlen("\x00"));
+                       $parsedFrame['description'] = $frame_idstring;
+                       $RVA2channelcounter = 0;
+                       while (strlen($frame_remainingdata) >= 5) {
+                               $frame_offset = 0;
+                               $frame_channeltypeid = ord(substr($frame_remainingdata, $frame_offset++, 1));
+                               $parsedFrame[$RVA2channelcounter]['channeltypeid']  = $frame_channeltypeid;
+                               $parsedFrame[$RVA2channelcounter]['channeltype']    = $this->RVA2ChannelTypeLookup($frame_channeltypeid);
+                               $parsedFrame[$RVA2channelcounter]['volumeadjust']   = getid3_lib::BigEndian2Int(substr($frame_remainingdata, $frame_offset, 2), false, true); // 16-bit signed
+                               $frame_offset += 2;
+                               $parsedFrame[$RVA2channelcounter]['bitspeakvolume'] = ord(substr($frame_remainingdata, $frame_offset++, 1));
+                               if (($parsedFrame[$RVA2channelcounter]['bitspeakvolume'] < 1) || ($parsedFrame[$RVA2channelcounter]['bitspeakvolume'] > 4)) {
+                                       $info['warning'][] = 'ID3v2::RVA2 frame['.$RVA2channelcounter.'] contains invalid '.$parsedFrame[$RVA2channelcounter]['bitspeakvolume'].'-byte bits-representing-peak value';
+                                       break;
+                               }
+                               $frame_bytespeakvolume = ceil($parsedFrame[$RVA2channelcounter]['bitspeakvolume'] / 8);
+                               $parsedFrame[$RVA2channelcounter]['peakvolume']     = getid3_lib::BigEndian2Int(substr($frame_remainingdata, $frame_offset, $frame_bytespeakvolume));
+                               $frame_remainingdata = substr($frame_remainingdata, $frame_offset + $frame_bytespeakvolume);
+                               $RVA2channelcounter++;
+                       }
+                       unset($parsedFrame['data']);
+
+
+               } elseif ((($id3v2_majorversion == 3) && ($parsedFrame['frame_name'] == 'RVAD')) || // 4.12  RVAD Relative volume adjustment (ID3v2.3 only)
+                                 (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'RVA'))) {  // 4.12  RVA  Relative volume adjustment (ID3v2.2 only)
+                       //   There may only be one 'RVA' frame in each tag
+                       // <Header for 'Relative volume adjustment', ID: 'RVA'>
+                       // ID3v2.2 => Increment/decrement     %000000ba
+                       // ID3v2.3 => Increment/decrement     %00fedcba
+                       // Bits used for volume descr.        $xx
+                       // Relative volume change, right      $xx xx (xx ...) // a
+                       // Relative volume change, left       $xx xx (xx ...) // b
+                       // Peak volume right                  $xx xx (xx ...)
+                       // Peak volume left                   $xx xx (xx ...)
+                       //   ID3v2.3 only, optional (not present in ID3v2.2):
+                       // Relative volume change, right back $xx xx (xx ...) // c
+                       // Relative volume change, left back  $xx xx (xx ...) // d
+                       // Peak volume right back             $xx xx (xx ...)
+                       // Peak volume left back              $xx xx (xx ...)
+                       //   ID3v2.3 only, optional (not present in ID3v2.2):
+                       // Relative volume change, center     $xx xx (xx ...) // e
+                       // Peak volume center                 $xx xx (xx ...)
+                       //   ID3v2.3 only, optional (not present in ID3v2.2):
+                       // Relative volume change, bass       $xx xx (xx ...) // f
+                       // Peak volume bass                   $xx xx (xx ...)
+
+                       $frame_offset = 0;
+                       $frame_incrdecrflags = getid3_lib::BigEndian2Bin(substr($parsedFrame['data'], $frame_offset++, 1));
+                       $parsedFrame['incdec']['right'] = (bool) substr($frame_incrdecrflags, 6, 1);
+                       $parsedFrame['incdec']['left']  = (bool) substr($frame_incrdecrflags, 7, 1);
+                       $parsedFrame['bitsvolume'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       $frame_bytesvolume = ceil($parsedFrame['bitsvolume'] / 8);
+                       $parsedFrame['volumechange']['right'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));
+                       if ($parsedFrame['incdec']['right'] === false) {
+                               $parsedFrame['volumechange']['right'] *= -1;
+                       }
+                       $frame_offset += $frame_bytesvolume;
+                       $parsedFrame['volumechange']['left'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));
+                       if ($parsedFrame['incdec']['left'] === false) {
+                               $parsedFrame['volumechange']['left'] *= -1;
+                       }
+                       $frame_offset += $frame_bytesvolume;
+                       $parsedFrame['peakvolume']['right'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));
+                       $frame_offset += $frame_bytesvolume;
+                       $parsedFrame['peakvolume']['left']  = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));
+                       $frame_offset += $frame_bytesvolume;
+                       if ($id3v2_majorversion == 3) {
+                               $parsedFrame['data'] = substr($parsedFrame['data'], $frame_offset);
+                               if (strlen($parsedFrame['data']) > 0) {
+                                       $parsedFrame['incdec']['rightrear'] = (bool) substr($frame_incrdecrflags, 4, 1);
+                                       $parsedFrame['incdec']['leftrear']  = (bool) substr($frame_incrdecrflags, 5, 1);
+                                       $parsedFrame['volumechange']['rightrear'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));
+                                       if ($parsedFrame['incdec']['rightrear'] === false) {
+                                               $parsedFrame['volumechange']['rightrear'] *= -1;
+                                       }
+                                       $frame_offset += $frame_bytesvolume;
+                                       $parsedFrame['volumechange']['leftrear'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));
+                                       if ($parsedFrame['incdec']['leftrear'] === false) {
+                                               $parsedFrame['volumechange']['leftrear'] *= -1;
+                                       }
+                                       $frame_offset += $frame_bytesvolume;
+                                       $parsedFrame['peakvolume']['rightrear'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));
+                                       $frame_offset += $frame_bytesvolume;
+                                       $parsedFrame['peakvolume']['leftrear']  = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));
+                                       $frame_offset += $frame_bytesvolume;
+                               }
+                               $parsedFrame['data'] = substr($parsedFrame['data'], $frame_offset);
+                               if (strlen($parsedFrame['data']) > 0) {
+                                       $parsedFrame['incdec']['center'] = (bool) substr($frame_incrdecrflags, 3, 1);
+                                       $parsedFrame['volumechange']['center'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));
+                                       if ($parsedFrame['incdec']['center'] === false) {
+                                               $parsedFrame['volumechange']['center'] *= -1;
+                                       }
+                                       $frame_offset += $frame_bytesvolume;
+                                       $parsedFrame['peakvolume']['center'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));
+                                       $frame_offset += $frame_bytesvolume;
+                               }
+                               $parsedFrame['data'] = substr($parsedFrame['data'], $frame_offset);
+                               if (strlen($parsedFrame['data']) > 0) {
+                                       $parsedFrame['incdec']['bass'] = (bool) substr($frame_incrdecrflags, 2, 1);
+                                       $parsedFrame['volumechange']['bass'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));
+                                       if ($parsedFrame['incdec']['bass'] === false) {
+                                               $parsedFrame['volumechange']['bass'] *= -1;
+                                       }
+                                       $frame_offset += $frame_bytesvolume;
+                                       $parsedFrame['peakvolume']['bass'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesvolume));
+                                       $frame_offset += $frame_bytesvolume;
+                               }
+                       }
+                       unset($parsedFrame['data']);
+
+
+               } elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'EQU2')) { // 4.12  EQU2 Equalisation (2) (ID3v2.4+ only)
+                       //   There may be more than one 'EQU2' frame in each tag,
+                       //   but only one with the same identification string
+                       // <Header of 'Equalisation (2)', ID: 'EQU2'>
+                       // Interpolation method  $xx
+                       //   $00  Band
+                       //   $01  Linear
+                       // Identification        <text string> $00
+                       //   The following is then repeated for every adjustment point
+                       // Frequency          $xx xx
+                       // Volume adjustment  $xx xx
+
+                       $frame_offset = 0;
+                       $frame_interpolationmethod = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset);
+                       $frame_idstring = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                       if (ord($frame_idstring) === 0) {
+                               $frame_idstring = '';
+                       }
+                       $parsedFrame['description'] = $frame_idstring;
+                       $frame_remainingdata = substr($parsedFrame['data'], $frame_terminatorpos + strlen("\x00"));
+                       while (strlen($frame_remainingdata)) {
+                               $frame_frequency = getid3_lib::BigEndian2Int(substr($frame_remainingdata, 0, 2)) / 2;
+                               $parsedFrame['data'][$frame_frequency] = getid3_lib::BigEndian2Int(substr($frame_remainingdata, 2, 2), false, true);
+                               $frame_remainingdata = substr($frame_remainingdata, 4);
+                       }
+                       $parsedFrame['interpolationmethod'] = $frame_interpolationmethod;
+                       unset($parsedFrame['data']);
+
+
+               } elseif ((($id3v2_majorversion == 3) && ($parsedFrame['frame_name'] == 'EQUA')) || // 4.12  EQUA Equalisation (ID3v2.3 only)
+                               (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'EQU'))) {     // 4.13  EQU  Equalisation (ID3v2.2 only)
+                       //   There may only be one 'EQUA' frame in each tag
+                       // <Header for 'Relative volume adjustment', ID: 'EQU'>
+                       // Adjustment bits    $xx
+                       //   This is followed by 2 bytes + ('adjustment bits' rounded up to the
+                       //   nearest byte) for every equalisation band in the following format,
+                       //   giving a frequency range of 0 - 32767Hz:
+                       // Increment/decrement   %x (MSB of the Frequency)
+                       // Frequency             (lower 15 bits)
+                       // Adjustment            $xx (xx ...)
+
+                       $frame_offset = 0;
+                       $parsedFrame['adjustmentbits'] = substr($parsedFrame['data'], $frame_offset++, 1);
+                       $frame_adjustmentbytes = ceil($parsedFrame['adjustmentbits'] / 8);
+
+                       $frame_remainingdata = (string) substr($parsedFrame['data'], $frame_offset);
+                       while (strlen($frame_remainingdata) > 0) {
+                               $frame_frequencystr = getid3_lib::BigEndian2Bin(substr($frame_remainingdata, 0, 2));
+                               $frame_incdec    = (bool) substr($frame_frequencystr, 0, 1);
+                               $frame_frequency = bindec(substr($frame_frequencystr, 1, 15));
+                               $parsedFrame[$frame_frequency]['incdec'] = $frame_incdec;
+                               $parsedFrame[$frame_frequency]['adjustment'] = getid3_lib::BigEndian2Int(substr($frame_remainingdata, 2, $frame_adjustmentbytes));
+                               if ($parsedFrame[$frame_frequency]['incdec'] === false) {
+                                       $parsedFrame[$frame_frequency]['adjustment'] *= -1;
+                               }
+                               $frame_remainingdata = substr($frame_remainingdata, 2 + $frame_adjustmentbytes);
+                       }
+                       unset($parsedFrame['data']);
+
+
+               } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'RVRB')) || // 4.13  RVRB Reverb
+                               (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'REV'))) {     // 4.14  REV  Reverb
+                       //   There may only be one 'RVRB' frame in each tag.
+                       // <Header for 'Reverb', ID: 'RVRB'>
+                       // Reverb left (ms)                 $xx xx
+                       // Reverb right (ms)                $xx xx
+                       // Reverb bounces, left             $xx
+                       // Reverb bounces, right            $xx
+                       // Reverb feedback, left to left    $xx
+                       // Reverb feedback, left to right   $xx
+                       // Reverb feedback, right to right  $xx
+                       // Reverb feedback, right to left   $xx
+                       // Premix left to right             $xx
+                       // Premix right to left             $xx
+
+                       $frame_offset = 0;
+                       $parsedFrame['left']  = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2));
+                       $frame_offset += 2;
+                       $parsedFrame['right'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2));
+                       $frame_offset += 2;
+                       $parsedFrame['bouncesL']      = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       $parsedFrame['bouncesR']      = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       $parsedFrame['feedbackLL']    = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       $parsedFrame['feedbackLR']    = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       $parsedFrame['feedbackRR']    = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       $parsedFrame['feedbackRL']    = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       $parsedFrame['premixLR']      = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       $parsedFrame['premixRL']      = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       unset($parsedFrame['data']);
+
+
+               } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'APIC')) || // 4.14  APIC Attached picture
+                               (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'PIC'))) {     // 4.15  PIC  Attached picture
+                       //   There may be several pictures attached to one file,
+                       //   each in their individual 'APIC' frame, but only one
+                       //   with the same content descriptor
+                       // <Header for 'Attached picture', ID: 'APIC'>
+                       // Text encoding      $xx
+                       // ID3v2.3+ => MIME type          <text string> $00
+                       // ID3v2.2  => Image format       $xx xx xx
+                       // Picture type       $xx
+                       // Description        <text string according to encoding> $00 (00)
+                       // Picture data       <binary data>
+
+                       $frame_offset = 0;
+                       $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
+                               $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
+                       }
+
+                       if ($id3v2_majorversion == 2 && strlen($parsedFrame['data']) > $frame_offset) {
+                               $frame_imagetype = substr($parsedFrame['data'], $frame_offset, 3);
+                               if (strtolower($frame_imagetype) == 'ima') {
+                                       // complete hack for mp3Rage (www.chaoticsoftware.com) that puts ID3v2.3-formatted
+                                       // MIME type instead of 3-char ID3v2.2-format image type  (thanks xbhoffØpacbell*net)
+                                       $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset);
+                                       $frame_mimetype = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                                       if (ord($frame_mimetype) === 0) {
+                                               $frame_mimetype = '';
+                                       }
+                                       $frame_imagetype = strtoupper(str_replace('image/', '', strtolower($frame_mimetype)));
+                                       if ($frame_imagetype == 'JPEG') {
+                                               $frame_imagetype = 'JPG';
+                                       }
+                                       $frame_offset = $frame_terminatorpos + strlen("\x00");
+                               } else {
+                                       $frame_offset += 3;
+                               }
+                       }
+                       if ($id3v2_majorversion > 2 && strlen($parsedFrame['data']) > $frame_offset) {
+                               $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset);
+                               $frame_mimetype = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                               if (ord($frame_mimetype) === 0) {
+                                       $frame_mimetype = '';
+                               }
+                               $frame_offset = $frame_terminatorpos + strlen("\x00");
+                       }
+
+                       $frame_picturetype = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+
+                       if ($frame_offset >= $parsedFrame['datalength']) {
+                               $info['warning'][] = 'data portion of APIC frame is missing at offset '.($parsedFrame['dataoffset'] + 8 + $frame_offset);
+                       } else {
+                               $frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding), $frame_offset);
+                               if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
+                                       $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
+                               }
+                               $frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                               if (ord($frame_description) === 0) {
+                                       $frame_description = '';
+                               }
+                               $parsedFrame['encodingid']       = $frame_textencoding;
+                               $parsedFrame['encoding']         = $this->TextEncodingNameLookup($frame_textencoding);
+
+                               if ($id3v2_majorversion == 2) {
+                                       $parsedFrame['imagetype']    = $frame_imagetype;
+                               } else {
+                                       $parsedFrame['mime']         = $frame_mimetype;
+                               }
+                               $parsedFrame['picturetypeid']    = $frame_picturetype;
+                               $parsedFrame['picturetype']      = $this->APICPictureTypeLookup($frame_picturetype);
+                               $parsedFrame['description']      = $frame_description;
+                               $parsedFrame['data']             = substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)));
+                               $parsedFrame['datalength']       = strlen($parsedFrame['data']);
+
+                               $parsedFrame['image_mime'] = '';
+                               $imageinfo = array();
+                               $imagechunkcheck = getid3_lib::GetDataImageSize($parsedFrame['data'], $imageinfo);
+                               if (($imagechunkcheck[2] >= 1) && ($imagechunkcheck[2] <= 3)) {
+                                       $parsedFrame['image_mime']       = 'image/'.getid3_lib::ImageTypesLookup($imagechunkcheck[2]);
+                                       if ($imagechunkcheck[0]) {
+                                               $parsedFrame['image_width']  = $imagechunkcheck[0];
+                                       }
+                                       if ($imagechunkcheck[1]) {
+                                               $parsedFrame['image_height'] = $imagechunkcheck[1];
+                                       }
+                               }
+
+                               do {
+                                       if ($this->getid3->option_save_attachments === false) {
+                                               // skip entirely
+                                               unset($parsedFrame['data']);
+                                               break;
+                                       }
+                                       if ($this->getid3->option_save_attachments === true) {
+                                               // great
+/*
+                                       } elseif (is_int($this->getid3->option_save_attachments)) {
+                                               if ($this->getid3->option_save_attachments < $parsedFrame['data_length']) {
+                                                       // too big, skip
+                                                       $info['warning'][] = 'attachment at '.$frame_offset.' is too large to process inline ('.number_format($parsedFrame['data_length']).' bytes)';
+                                                       unset($parsedFrame['data']);
+                                                       break;
+                                               }
+*/
+                                       } elseif (is_string($this->getid3->option_save_attachments)) {
+                                               $dir = rtrim(str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $this->getid3->option_save_attachments), DIRECTORY_SEPARATOR);
+                                               if (!is_dir($dir) || !is_writable($dir)) {
+                                                       // cannot write, skip
+                                                       $info['warning'][] = 'attachment at '.$frame_offset.' cannot be saved to "'.$dir.'" (not writable)';
+                                                       unset($parsedFrame['data']);
+                                                       break;
+                                               }
+                                       }
+                                       // if we get this far, must be OK
+                                       if (is_string($this->getid3->option_save_attachments)) {
+                                               $destination_filename = $dir.DIRECTORY_SEPARATOR.md5($info['filenamepath']).'_'.$frame_offset;
+                                               if (!file_exists($destination_filename) || is_writable($destination_filename)) {
+                                                       file_put_contents($destination_filename, $parsedFrame['data']);
+                                               } else {
+                                                       $info['warning'][] = 'attachment at '.$frame_offset.' cannot be saved to "'.$destination_filename.'" (not writable)';
+                                               }
+                                               $parsedFrame['data_filename'] = $destination_filename;
+                                               unset($parsedFrame['data']);
+                                       } else {
+                                               if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {
+                                                       if (!isset($info['id3v2']['comments']['picture'])) {
+                                                               $info['id3v2']['comments']['picture'] = array();
+                                                       }
+                                                       $info['id3v2']['comments']['picture'][] = array('data'=>$parsedFrame['data'], 'image_mime'=>$parsedFrame['image_mime']);
+                                               }
+                                       }
+                               } while (false);
+                       }
+
+               } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'GEOB')) || // 4.15  GEOB General encapsulated object
+                               (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'GEO'))) {     // 4.16  GEO  General encapsulated object
+                       //   There may be more than one 'GEOB' frame in each tag,
+                       //   but only one with the same content descriptor
+                       // <Header for 'General encapsulated object', ID: 'GEOB'>
+                       // Text encoding          $xx
+                       // MIME type              <text string> $00
+                       // Filename               <text string according to encoding> $00 (00)
+                       // Content description    <text string according to encoding> $00 (00)
+                       // Encapsulated object    <binary data>
+
+                       $frame_offset = 0;
+                       $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
+                               $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
+                       }
+                       $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset);
+                       $frame_mimetype = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                       if (ord($frame_mimetype) === 0) {
+                               $frame_mimetype = '';
+                       }
+                       $frame_offset = $frame_terminatorpos + strlen("\x00");
+
+                       $frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding), $frame_offset);
+                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
+                               $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
+                       }
+                       $frame_filename = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                       if (ord($frame_filename) === 0) {
+                               $frame_filename = '';
+                       }
+                       $frame_offset = $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding));
+
+                       $frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding), $frame_offset);
+                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
+                               $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
+                       }
+                       $frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                       if (ord($frame_description) === 0) {
+                               $frame_description = '';
+                       }
+                       $frame_offset = $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding));
+
+                       $parsedFrame['objectdata']  = (string) substr($parsedFrame['data'], $frame_offset);
+                       $parsedFrame['encodingid']  = $frame_textencoding;
+                       $parsedFrame['encoding']    = $this->TextEncodingNameLookup($frame_textencoding);
+
+                       $parsedFrame['mime']        = $frame_mimetype;
+                       $parsedFrame['filename']    = $frame_filename;
+                       $parsedFrame['description'] = $frame_description;
+                       unset($parsedFrame['data']);
+
+
+               } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'PCNT')) || // 4.16  PCNT Play counter
+                               (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'CNT'))) {     // 4.17  CNT  Play counter
+                       //   There may only be one 'PCNT' frame in each tag.
+                       //   When the counter reaches all one's, one byte is inserted in
+                       //   front of the counter thus making the counter eight bits bigger
+                       // <Header for 'Play counter', ID: 'PCNT'>
+                       // Counter        $xx xx xx xx (xx ...)
+
+                       $parsedFrame['data']          = getid3_lib::BigEndian2Int($parsedFrame['data']);
+
+
+               } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'POPM')) || // 4.17  POPM Popularimeter
+                               (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'POP'))) {    // 4.18  POP  Popularimeter
+                       //   There may be more than one 'POPM' frame in each tag,
+                       //   but only one with the same email address
+                       // <Header for 'Popularimeter', ID: 'POPM'>
+                       // Email to user   <text string> $00
+                       // Rating          $xx
+                       // Counter         $xx xx xx xx (xx ...)
+
+                       $frame_offset = 0;
+                       $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset);
+                       $frame_emailaddress = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                       if (ord($frame_emailaddress) === 0) {
+                               $frame_emailaddress = '';
+                       }
+                       $frame_offset = $frame_terminatorpos + strlen("\x00");
+                       $frame_rating = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       $parsedFrame['counter'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset));
+                       $parsedFrame['email']   = $frame_emailaddress;
+                       $parsedFrame['rating']  = $frame_rating;
+                       unset($parsedFrame['data']);
+
+
+               } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'RBUF')) || // 4.18  RBUF Recommended buffer size
+                               (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'BUF'))) {     // 4.19  BUF  Recommended buffer size
+                       //   There may only be one 'RBUF' frame in each tag
+                       // <Header for 'Recommended buffer size', ID: 'RBUF'>
+                       // Buffer size               $xx xx xx
+                       // Embedded info flag        %0000000x
+                       // Offset to next tag        $xx xx xx xx
+
+                       $frame_offset = 0;
+                       $parsedFrame['buffersize'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 3));
+                       $frame_offset += 3;
+
+                       $frame_embeddedinfoflags = getid3_lib::BigEndian2Bin(substr($parsedFrame['data'], $frame_offset++, 1));
+                       $parsedFrame['flags']['embededinfo'] = (bool) substr($frame_embeddedinfoflags, 7, 1);
+                       $parsedFrame['nexttagoffset'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));
+                       unset($parsedFrame['data']);
+
+
+               } elseif (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'CRM')) { // 4.20  Encrypted meta frame (ID3v2.2 only)
+                       //   There may be more than one 'CRM' frame in a tag,
+                       //   but only one with the same 'owner identifier'
+                       // <Header for 'Encrypted meta frame', ID: 'CRM'>
+                       // Owner identifier      <textstring> $00 (00)
+                       // Content/explanation   <textstring> $00 (00)
+                       // Encrypted datablock   <binary data>
+
+                       $frame_offset = 0;
+                       $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset);
+                       $frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                       $frame_offset = $frame_terminatorpos + strlen("\x00");
+
+                       $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset);
+                       $frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                       if (ord($frame_description) === 0) {
+                               $frame_description = '';
+                       }
+                       $frame_offset = $frame_terminatorpos + strlen("\x00");
+
+                       $parsedFrame['ownerid']     = $frame_ownerid;
+                       $parsedFrame['data']        = (string) substr($parsedFrame['data'], $frame_offset);
+                       $parsedFrame['description'] = $frame_description;
+                       unset($parsedFrame['data']);
+
+
+               } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'AENC')) || // 4.19  AENC Audio encryption
+                               (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'CRA'))) {     // 4.21  CRA  Audio encryption
+                       //   There may be more than one 'AENC' frames in a tag,
+                       //   but only one with the same 'Owner identifier'
+                       // <Header for 'Audio encryption', ID: 'AENC'>
+                       // Owner identifier   <text string> $00
+                       // Preview start      $xx xx
+                       // Preview length     $xx xx
+                       // Encryption info    <binary data>
+
+                       $frame_offset = 0;
+                       $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset);
+                       $frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                       if (ord($frame_ownerid) === 0) {
+                               $frame_ownerid == '';
+                       }
+                       $frame_offset = $frame_terminatorpos + strlen("\x00");
+                       $parsedFrame['ownerid'] = $frame_ownerid;
+                       $parsedFrame['previewstart'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2));
+                       $frame_offset += 2;
+                       $parsedFrame['previewlength'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2));
+                       $frame_offset += 2;
+                       $parsedFrame['encryptioninfo'] = (string) substr($parsedFrame['data'], $frame_offset);
+                       unset($parsedFrame['data']);
+
+
+               } elseif ((($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'LINK')) || // 4.20  LINK Linked information
+                               (($id3v2_majorversion == 2) && ($parsedFrame['frame_name'] == 'LNK'))) {     // 4.22  LNK  Linked information
+                       //   There may be more than one 'LINK' frame in a tag,
+                       //   but only one with the same contents
+                       // <Header for 'Linked information', ID: 'LINK'>
+                       // ID3v2.3+ => Frame identifier   $xx xx xx xx
+                       // ID3v2.2  => Frame identifier   $xx xx xx
+                       // URL                            <text string> $00
+                       // ID and additional data         <text string(s)>
+
+                       $frame_offset = 0;
+                       if ($id3v2_majorversion == 2) {
+                               $parsedFrame['frameid'] = substr($parsedFrame['data'], $frame_offset, 3);
+                               $frame_offset += 3;
+                       } else {
+                               $parsedFrame['frameid'] = substr($parsedFrame['data'], $frame_offset, 4);
+                               $frame_offset += 4;
+                       }
+
+                       $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset);
+                       $frame_url = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                       if (ord($frame_url) === 0) {
+                               $frame_url = '';
+                       }
+                       $frame_offset = $frame_terminatorpos + strlen("\x00");
+                       $parsedFrame['url'] = $frame_url;
+
+                       $parsedFrame['additionaldata'] = (string) substr($parsedFrame['data'], $frame_offset);
+                       if (!empty($parsedFrame['framenameshort']) && $parsedFrame['url']) {
+                               $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = utf8_encode($parsedFrame['url']);
+                       }
+                       unset($parsedFrame['data']);
+
+
+               } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'POSS')) { // 4.21  POSS Position synchronisation frame (ID3v2.3+ only)
+                       //   There may only be one 'POSS' frame in each tag
+                       // <Head for 'Position synchronisation', ID: 'POSS'>
+                       // Time stamp format         $xx
+                       // Position                  $xx (xx ...)
+
+                       $frame_offset = 0;
+                       $parsedFrame['timestampformat'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       $parsedFrame['position']        = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset));
+                       unset($parsedFrame['data']);
+
+
+               } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'USER')) { // 4.22  USER Terms of use (ID3v2.3+ only)
+                       //   There may be more than one 'Terms of use' frame in a tag,
+                       //   but only one with the same 'Language'
+                       // <Header for 'Terms of use frame', ID: 'USER'>
+                       // Text encoding        $xx
+                       // Language             $xx xx xx
+                       // The actual text      <text string according to encoding>
+
+                       $frame_offset = 0;
+                       $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
+                               $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
+                       }
+                       $frame_language = substr($parsedFrame['data'], $frame_offset, 3);
+                       $frame_offset += 3;
+                       $parsedFrame['language']     = $frame_language;
+                       $parsedFrame['languagename'] = $this->LanguageLookup($frame_language, false);
+                       $parsedFrame['encodingid']   = $frame_textencoding;
+                       $parsedFrame['encoding']     = $this->TextEncodingNameLookup($frame_textencoding);
+
+                       $parsedFrame['data']         = (string) substr($parsedFrame['data'], $frame_offset);
+                       if (!empty($parsedFrame['framenameshort']) && !empty($parsedFrame['data'])) {
+                               $info['id3v2']['comments'][$parsedFrame['framenameshort']][] = getid3_lib::iconv_fallback($parsedFrame['encoding'], $info['id3v2']['encoding'], $parsedFrame['data']);
+                       }
+                       unset($parsedFrame['data']);
+
+
+               } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'OWNE')) { // 4.23  OWNE Ownership frame (ID3v2.3+ only)
+                       //   There may only be one 'OWNE' frame in a tag
+                       // <Header for 'Ownership frame', ID: 'OWNE'>
+                       // Text encoding     $xx
+                       // Price paid        <text string> $00
+                       // Date of purch.    <text string>
+                       // Seller            <text string according to encoding>
+
+                       $frame_offset = 0;
+                       $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
+                               $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
+                       }
+                       $parsedFrame['encodingid'] = $frame_textencoding;
+                       $parsedFrame['encoding']   = $this->TextEncodingNameLookup($frame_textencoding);
+
+                       $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset);
+                       $frame_pricepaid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                       $frame_offset = $frame_terminatorpos + strlen("\x00");
+
+                       $parsedFrame['pricepaid']['currencyid'] = substr($frame_pricepaid, 0, 3);
+                       $parsedFrame['pricepaid']['currency']   = $this->LookupCurrencyUnits($parsedFrame['pricepaid']['currencyid']);
+                       $parsedFrame['pricepaid']['value']      = substr($frame_pricepaid, 3);
+
+                       $parsedFrame['purchasedate'] = substr($parsedFrame['data'], $frame_offset, 8);
+                       if (!$this->IsValidDateStampString($parsedFrame['purchasedate'])) {
+                               $parsedFrame['purchasedateunix'] = mktime (0, 0, 0, substr($parsedFrame['purchasedate'], 4, 2), substr($parsedFrame['purchasedate'], 6, 2), substr($parsedFrame['purchasedate'], 0, 4));
+                       }
+                       $frame_offset += 8;
+
+                       $parsedFrame['seller'] = (string) substr($parsedFrame['data'], $frame_offset);
+                       unset($parsedFrame['data']);
+
+
+               } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'COMR')) { // 4.24  COMR Commercial frame (ID3v2.3+ only)
+                       //   There may be more than one 'commercial frame' in a tag,
+                       //   but no two may be identical
+                       // <Header for 'Commercial frame', ID: 'COMR'>
+                       // Text encoding      $xx
+                       // Price string       <text string> $00
+                       // Valid until        <text string>
+                       // Contact URL        <text string> $00
+                       // Received as        $xx
+                       // Name of seller     <text string according to encoding> $00 (00)
+                       // Description        <text string according to encoding> $00 (00)
+                       // Picture MIME type  <string> $00
+                       // Seller logo        <binary data>
+
+                       $frame_offset = 0;
+                       $frame_textencoding = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       if ((($id3v2_majorversion <= 3) && ($frame_textencoding > 1)) || (($id3v2_majorversion == 4) && ($frame_textencoding > 3))) {
+                               $info['warning'][] = 'Invalid text encoding byte ('.$frame_textencoding.') in frame "'.$parsedFrame['frame_name'].'" - defaulting to ISO-8859-1 encoding';
+                       }
+
+                       $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset);
+                       $frame_pricestring = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                       $frame_offset = $frame_terminatorpos + strlen("\x00");
+                       $frame_rawpricearray = explode('/', $frame_pricestring);
+                       foreach ($frame_rawpricearray as $key => $val) {
+                               $frame_currencyid = substr($val, 0, 3);
+                               $parsedFrame['price'][$frame_currencyid]['currency'] = $this->LookupCurrencyUnits($frame_currencyid);
+                               $parsedFrame['price'][$frame_currencyid]['value']    = substr($val, 3);
+                       }
+
+                       $frame_datestring = substr($parsedFrame['data'], $frame_offset, 8);
+                       $frame_offset += 8;
+
+                       $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset);
+                       $frame_contacturl = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                       $frame_offset = $frame_terminatorpos + strlen("\x00");
+
+                       $frame_receivedasid = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+
+                       $frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding), $frame_offset);
+                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
+                               $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
+                       }
+                       $frame_sellername = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                       if (ord($frame_sellername) === 0) {
+                               $frame_sellername = '';
+                       }
+                       $frame_offset = $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding));
+
+                       $frame_terminatorpos = strpos($parsedFrame['data'], $this->TextEncodingTerminatorLookup($frame_textencoding), $frame_offset);
+                       if (ord(substr($parsedFrame['data'], $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding)), 1)) === 0) {
+                               $frame_terminatorpos++; // strpos() fooled because 2nd byte of Unicode chars are often 0x00
+                       }
+                       $frame_description = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                       if (ord($frame_description) === 0) {
+                               $frame_description = '';
+                       }
+                       $frame_offset = $frame_terminatorpos + strlen($this->TextEncodingTerminatorLookup($frame_textencoding));
+
+                       $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset);
+                       $frame_mimetype = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                       $frame_offset = $frame_terminatorpos + strlen("\x00");
+
+                       $frame_sellerlogo = substr($parsedFrame['data'], $frame_offset);
+
+                       $parsedFrame['encodingid']        = $frame_textencoding;
+                       $parsedFrame['encoding']          = $this->TextEncodingNameLookup($frame_textencoding);
+
+                       $parsedFrame['pricevaliduntil']   = $frame_datestring;
+                       $parsedFrame['contacturl']        = $frame_contacturl;
+                       $parsedFrame['receivedasid']      = $frame_receivedasid;
+                       $parsedFrame['receivedas']        = $this->COMRReceivedAsLookup($frame_receivedasid);
+                       $parsedFrame['sellername']        = $frame_sellername;
+                       $parsedFrame['description']       = $frame_description;
+                       $parsedFrame['mime']              = $frame_mimetype;
+                       $parsedFrame['logo']              = $frame_sellerlogo;
+                       unset($parsedFrame['data']);
+
+
+               } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'ENCR')) { // 4.25  ENCR Encryption method registration (ID3v2.3+ only)
+                       //   There may be several 'ENCR' frames in a tag,
+                       //   but only one containing the same symbol
+                       //   and only one containing the same owner identifier
+                       // <Header for 'Encryption method registration', ID: 'ENCR'>
+                       // Owner identifier    <text string> $00
+                       // Method symbol       $xx
+                       // Encryption data     <binary data>
+
+                       $frame_offset = 0;
+                       $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset);
+                       $frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                       if (ord($frame_ownerid) === 0) {
+                               $frame_ownerid = '';
+                       }
+                       $frame_offset = $frame_terminatorpos + strlen("\x00");
+
+                       $parsedFrame['ownerid']      = $frame_ownerid;
+                       $parsedFrame['methodsymbol'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       $parsedFrame['data']         = (string) substr($parsedFrame['data'], $frame_offset);
+
+
+               } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'GRID')) { // 4.26  GRID Group identification registration (ID3v2.3+ only)
+
+                       //   There may be several 'GRID' frames in a tag,
+                       //   but only one containing the same symbol
+                       //   and only one containing the same owner identifier
+                       // <Header for 'Group ID registration', ID: 'GRID'>
+                       // Owner identifier      <text string> $00
+                       // Group symbol          $xx
+                       // Group dependent data  <binary data>
+
+                       $frame_offset = 0;
+                       $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset);
+                       $frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                       if (ord($frame_ownerid) === 0) {
+                               $frame_ownerid = '';
+                       }
+                       $frame_offset = $frame_terminatorpos + strlen("\x00");
+
+                       $parsedFrame['ownerid']       = $frame_ownerid;
+                       $parsedFrame['groupsymbol']   = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       $parsedFrame['data']          = (string) substr($parsedFrame['data'], $frame_offset);
+
+
+               } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'PRIV')) { // 4.27  PRIV Private frame (ID3v2.3+ only)
+                       //   The tag may contain more than one 'PRIV' frame
+                       //   but only with different contents
+                       // <Header for 'Private frame', ID: 'PRIV'>
+                       // Owner identifier      <text string> $00
+                       // The private data      <binary data>
+
+                       $frame_offset = 0;
+                       $frame_terminatorpos = strpos($parsedFrame['data'], "\x00", $frame_offset);
+                       $frame_ownerid = substr($parsedFrame['data'], $frame_offset, $frame_terminatorpos - $frame_offset);
+                       if (ord($frame_ownerid) === 0) {
+                               $frame_ownerid = '';
+                       }
+                       $frame_offset = $frame_terminatorpos + strlen("\x00");
+
+                       $parsedFrame['ownerid'] = $frame_ownerid;
+                       $parsedFrame['data']    = (string) substr($parsedFrame['data'], $frame_offset);
+
+
+               } elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'SIGN')) { // 4.28  SIGN Signature frame (ID3v2.4+ only)
+                       //   There may be more than one 'signature frame' in a tag,
+                       //   but no two may be identical
+                       // <Header for 'Signature frame', ID: 'SIGN'>
+                       // Group symbol      $xx
+                       // Signature         <binary data>
+
+                       $frame_offset = 0;
+                       $parsedFrame['groupsymbol'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       $parsedFrame['data']        = (string) substr($parsedFrame['data'], $frame_offset);
+
+
+               } elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'SEEK')) { // 4.29  SEEK Seek frame (ID3v2.4+ only)
+                       //   There may only be one 'seek frame' in a tag
+                       // <Header for 'Seek frame', ID: 'SEEK'>
+                       // Minimum offset to next tag       $xx xx xx xx
+
+                       $frame_offset = 0;
+                       $parsedFrame['data']          = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));
+
+
+               } elseif (($id3v2_majorversion >= 4) && ($parsedFrame['frame_name'] == 'ASPI')) { // 4.30  ASPI Audio seek point index (ID3v2.4+ only)
+                       //   There may only be one 'audio seek point index' frame in a tag
+                       // <Header for 'Seek Point Index', ID: 'ASPI'>
+                       // Indexed data start (S)         $xx xx xx xx
+                       // Indexed data length (L)        $xx xx xx xx
+                       // Number of index points (N)     $xx xx
+                       // Bits per index point (b)       $xx
+                       //   Then for every index point the following data is included:
+                       // Fraction at index (Fi)          $xx (xx)
+
+                       $frame_offset = 0;
+                       $parsedFrame['datastart'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));
+                       $frame_offset += 4;
+                       $parsedFrame['indexeddatalength'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 4));
+                       $frame_offset += 4;
+                       $parsedFrame['indexpoints'] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, 2));
+                       $frame_offset += 2;
+                       $parsedFrame['bitsperpoint'] = ord(substr($parsedFrame['data'], $frame_offset++, 1));
+                       $frame_bytesperpoint = ceil($parsedFrame['bitsperpoint'] / 8);
+                       for ($i = 0; $i < $frame_indexpoints; $i++) {
+                               $parsedFrame['indexes'][$i] = getid3_lib::BigEndian2Int(substr($parsedFrame['data'], $frame_offset, $frame_bytesperpoint));
+                               $frame_offset += $frame_bytesperpoint;
+                       }
+                       unset($parsedFrame['data']);
+
+               } elseif (($id3v2_majorversion >= 3) && ($parsedFrame['frame_name'] == 'RGAD')) { // Replay Gain Adjustment
+                       // http://privatewww.essex.ac.uk/~djmrob/replaygain/file_format_id3v2.html
+                       //   There may only be one 'RGAD' frame in a tag
+                       // <Header for 'Replay Gain Adjustment', ID: 'RGAD'>
+                       // Peak Amplitude                      $xx $xx $xx $xx
+                       // Radio Replay Gain Adjustment        %aaabbbcd %dddddddd
+                       // Audiophile Replay Gain Adjustment   %aaabbbcd %dddddddd
+                       //   a - name code
+                       //   b - originator code
+                       //   c - sign bit
+                       //   d - replay gain adjustment
+
+                       $frame_offset = 0;
+                       $parsedFrame['peakamplitude'] = getid3_lib::BigEndian2Float(substr($parsedFrame['data'], $frame_offset, 4));
+                       $frame_offset += 4;
+                       $rg_track_adjustment = getid3_lib::Dec2Bin(substr($parsedFrame['data'], $frame_offset, 2));
+                       $frame_offset += 2;
+                       $rg_album_adjustment = getid3_lib::Dec2Bin(substr($parsedFrame['data'], $frame_offset, 2));
+                       $frame_offset += 2;
+                       $parsedFrame['raw']['track']['name']       = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 0, 3));
+                       $parsedFrame['raw']['track']['originator'] = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 3, 3));
+                       $parsedFrame['raw']['track']['signbit']    = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 6, 1));
+                       $parsedFrame['raw']['track']['adjustment'] = getid3_lib::Bin2Dec(substr($rg_track_adjustment, 7, 9));
+                       $parsedFrame['raw']['album']['name']       = getid3_lib::Bin2Dec(substr($rg_album_adjustment, 0, 3));
+                       $parsedFrame['raw']['album']['originator'] = getid3_lib::Bin2Dec(substr($rg_album_adjustment, 3, 3));
+                       $parsedFrame['raw']['album']['signbit']    = getid3_lib::Bin2Dec(substr($rg_album_adjustment, 6, 1));
+                       $parsedFrame['raw']['album']['adjustment'] = getid3_lib::Bin2Dec(substr($rg_album_adjustment, 7, 9));
+                       $parsedFrame['track']['name']       = getid3_lib::RGADnameLookup($parsedFrame['raw']['track']['name']);
+                       $parsedFrame['track']['originator'] = getid3_lib::RGADoriginatorLookup($parsedFrame['raw']['track']['originator']);
+                       $parsedFrame['track']['adjustment'] = getid3_lib::RGADadjustmentLookup($parsedFrame['raw']['track']['adjustment'], $parsedFrame['raw']['track']['signbit']);
+                       $parsedFrame['album']['name']       = getid3_lib::RGADnameLookup($parsedFrame['raw']['album']['name']);
+                       $parsedFrame['album']['originator'] = getid3_lib::RGADoriginatorLookup($parsedFrame['raw']['album']['originator']);
+                       $parsedFrame['album']['adjustment'] = getid3_lib::RGADadjustmentLookup($parsedFrame['raw']['album']['adjustment'], $parsedFrame['raw']['album']['signbit']);
+
+                       $info['replay_gain']['track']['peak']       = $parsedFrame['peakamplitude'];
+                       $info['replay_gain']['track']['originator'] = $parsedFrame['track']['originator'];
+                       $info['replay_gain']['track']['adjustment'] = $parsedFrame['track']['adjustment'];
+                       $info['replay_gain']['album']['originator'] = $parsedFrame['album']['originator'];
+                       $info['replay_gain']['album']['adjustment'] = $parsedFrame['album']['adjustment'];
+
+                       unset($parsedFrame['data']);
+
+               }
+
+               return true;
+       }
+
+
+       public function DeUnsynchronise($data) {
+               return str_replace("\xFF\x00", "\xFF", $data);
+       }
+
+       public function LookupExtendedHeaderRestrictionsTagSizeLimits($index) {
+               static $LookupExtendedHeaderRestrictionsTagSizeLimits = array(
+                       0x00 => 'No more than 128 frames and 1 MB total tag size',
+                       0x01 => 'No more than 64 frames and 128 KB total tag size',
+                       0x02 => 'No more than 32 frames and 40 KB total tag size',
+                       0x03 => 'No more than 32 frames and 4 KB total tag size',
+               );
+               return (isset($LookupExtendedHeaderRestrictionsTagSizeLimits[$index]) ? $LookupExtendedHeaderRestrictionsTagSizeLimits[$index] : '');
+       }
+
+       public function LookupExtendedHeaderRestrictionsTextEncodings($index) {
+               static $LookupExtendedHeaderRestrictionsTextEncodings = array(
+                       0x00 => 'No restrictions',
+                       0x01 => 'Strings are only encoded with ISO-8859-1 or UTF-8',
+               );
+               return (isset($LookupExtendedHeaderRestrictionsTextEncodings[$index]) ? $LookupExtendedHeaderRestrictionsTextEncodings[$index] : '');
+       }
+
+       public function LookupExtendedHeaderRestrictionsTextFieldSize($index) {
+               static $LookupExtendedHeaderRestrictionsTextFieldSize = array(
+                       0x00 => 'No restrictions',
+                       0x01 => 'No string is longer than 1024 characters',
+                       0x02 => 'No string is longer than 128 characters',
+                       0x03 => 'No string is longer than 30 characters',
+               );
+               return (isset($LookupExtendedHeaderRestrictionsTextFieldSize[$index]) ? $LookupExtendedHeaderRestrictionsTextFieldSize[$index] : '');
+       }
+
+       public function LookupExtendedHeaderRestrictionsImageEncoding($index) {
+               static $LookupExtendedHeaderRestrictionsImageEncoding = array(
+                       0x00 => 'No restrictions',
+                       0x01 => 'Images are encoded only with PNG or JPEG',
+               );
+               return (isset($LookupExtendedHeaderRestrictionsImageEncoding[$index]) ? $LookupExtendedHeaderRestrictionsImageEncoding[$index] : '');
+       }
+
+       public function LookupExtendedHeaderRestrictionsImageSizeSize($index) {
+               static $LookupExtendedHeaderRestrictionsImageSizeSize = array(
+                       0x00 => 'No restrictions',
+                       0x01 => 'All images are 256x256 pixels or smaller',
+                       0x02 => 'All images are 64x64 pixels or smaller',
+                       0x03 => 'All images are exactly 64x64 pixels, unless required otherwise',
+               );
+               return (isset($LookupExtendedHeaderRestrictionsImageSizeSize[$index]) ? $LookupExtendedHeaderRestrictionsImageSizeSize[$index] : '');
+       }
+
+       public function LookupCurrencyUnits($currencyid) {
+
+               $begin = __LINE__;
+
+               /** This is not a comment!
+
+
+                       AED     Dirhams
+                       AFA     Afghanis
+                       ALL     Leke
+                       AMD     Drams
+                       ANG     Guilders
+                       AOA     Kwanza
+                       ARS     Pesos
+                       ATS     Schillings
+                       AUD     Dollars
+                       AWG     Guilders
+                       AZM     Manats
+                       BAM     Convertible Marka
+                       BBD     Dollars
+                       BDT     Taka
+                       BEF     Francs
+                       BGL     Leva
+                       BHD     Dinars
+                       BIF     Francs
+                       BMD     Dollars
+                       BND     Dollars
+                       BOB     Bolivianos
+                       BRL     Brazil Real
+                       BSD     Dollars
+                       BTN     Ngultrum
+                       BWP     Pulas
+                       BYR     Rubles
+                       BZD     Dollars
+                       CAD     Dollars
+                       CDF     Congolese Francs
+                       CHF     Francs
+                       CLP     Pesos
+                       CNY     Yuan Renminbi
+                       COP     Pesos
+                       CRC     Colones
+                       CUP     Pesos
+                       CVE     Escudos
+                       CYP     Pounds
+                       CZK     Koruny
+                       DEM     Deutsche Marks
+                       DJF     Francs
+                       DKK     Kroner
+                       DOP     Pesos
+                       DZD     Algeria Dinars
+                       EEK     Krooni
+                       EGP     Pounds
+                       ERN     Nakfa
+                       ESP     Pesetas
+                       ETB     Birr
+                       EUR     Euro
+                       FIM     Markkaa
+                       FJD     Dollars
+                       FKP     Pounds
+                       FRF     Francs
+                       GBP     Pounds
+                       GEL     Lari
+                       GGP     Pounds
+                       GHC     Cedis
+                       GIP     Pounds
+                       GMD     Dalasi
+                       GNF     Francs
+                       GRD     Drachmae
+                       GTQ     Quetzales
+                       GYD     Dollars
+                       HKD     Dollars
+                       HNL     Lempiras
+                       HRK     Kuna
+                       HTG     Gourdes
+                       HUF     Forints
+                       IDR     Rupiahs
+                       IEP     Pounds
+                       ILS     New Shekels
+                       IMP     Pounds
+                       INR     Rupees
+                       IQD     Dinars
+                       IRR     Rials
+                       ISK     Kronur
+                       ITL     Lire
+                       JEP     Pounds
+                       JMD     Dollars
+                       JOD     Dinars
+                       JPY     Yen
+                       KES     Shillings
+                       KGS     Soms
+                       KHR     Riels
+                       KMF     Francs
+                       KPW     Won
+                       KWD     Dinars
+                       KYD     Dollars
+                       KZT     Tenge
+                       LAK     Kips
+                       LBP     Pounds
+                       LKR     Rupees
+                       LRD     Dollars
+                       LSL     Maloti
+                       LTL     Litai
+                       LUF     Francs
+                       LVL     Lati
+                       LYD     Dinars
+                       MAD     Dirhams
+                       MDL     Lei
+                       MGF     Malagasy Francs
+                       MKD     Denars
+                       MMK     Kyats
+                       MNT     Tugriks
+                       MOP     Patacas
+                       MRO     Ouguiyas
+                       MTL     Liri
+                       MUR     Rupees
+                       MVR     Rufiyaa
+                       MWK     Kwachas
+                       MXN     Pesos
+                       MYR     Ringgits
+                       MZM     Meticais
+                       NAD     Dollars
+                       NGN     Nairas
+                       NIO     Gold Cordobas
+                       NLG     Guilders
+                       NOK     Krone
+                       NPR     Nepal Rupees
+                       NZD     Dollars
+                       OMR     Rials
+                       PAB     Balboa
+                       PEN     Nuevos Soles
+                       PGK     Kina
+                       PHP     Pesos
+                       PKR     Rupees
+                       PLN     Zlotych
+                       PTE     Escudos
+                       PYG     Guarani
+                       QAR     Rials
+                       ROL     Lei
+                       RUR     Rubles
+                       RWF     Rwanda Francs
+                       SAR     Riyals
+                       SBD     Dollars
+                       SCR     Rupees
+                       SDD     Dinars
+                       SEK     Kronor
+                       SGD     Dollars
+                       SHP     Pounds
+                       SIT     Tolars
+                       SKK     Koruny
+                       SLL     Leones
+                       SOS     Shillings
+                       SPL     Luigini
+                       SRG     Guilders
+                       STD     Dobras
+                       SVC     Colones
+                       SYP     Pounds
+                       SZL     Emalangeni
+                       THB     Baht
+                       TJR     Rubles
+                       TMM     Manats
+                       TND     Dinars
+                       TOP     Pa'anga
+                       TRL     Liras
+                       TTD     Dollars
+                       TVD     Tuvalu Dollars
+                       TWD     New Dollars
+                       TZS     Shillings
+                       UAH     Hryvnia
+                       UGX     Shillings
+                       USD     Dollars
+                       UYU     Pesos
+                       UZS     Sums
+                       VAL     Lire
+                       VEB     Bolivares
+                       VND     Dong
+                       VUV     Vatu
+                       WST     Tala
+                       XAF     Francs
+                       XAG     Ounces
+                       XAU     Ounces
+                       XCD     Dollars
+                       XDR     Special Drawing Rights
+                       XPD     Ounces
+                       XPF     Francs
+                       XPT     Ounces
+                       YER     Rials
+                       YUM     New Dinars
+                       ZAR     Rand
+                       ZMK     Kwacha
+                       ZWD     Zimbabwe Dollars
+
+               */
+
+               return getid3_lib::EmbeddedLookup($currencyid, $begin, __LINE__, __FILE__, 'id3v2-currency-units');
+       }
+
+
+       public function LookupCurrencyCountry($currencyid) {
+
+               $begin = __LINE__;
+
+               /** This is not a comment!
+
+                       AED     United Arab Emirates
+                       AFA     Afghanistan
+                       ALL     Albania
+                       AMD     Armenia
+                       ANG     Netherlands Antilles
+                       AOA     Angola
+                       ARS     Argentina
+                       ATS     Austria
+                       AUD     Australia
+                       AWG     Aruba
+                       AZM     Azerbaijan
+                       BAM     Bosnia and Herzegovina
+                       BBD     Barbados
+                       BDT     Bangladesh
+                       BEF     Belgium
+                       BGL     Bulgaria
+                       BHD     Bahrain
+                       BIF     Burundi
+                       BMD     Bermuda
+                       BND     Brunei Darussalam
+                       BOB     Bolivia
+                       BRL     Brazil
+                       BSD     Bahamas
+                       BTN     Bhutan
+                       BWP     Botswana
+                       BYR     Belarus
+                       BZD     Belize
+                       CAD     Canada
+                       CDF     Congo/Kinshasa
+                       CHF     Switzerland
+                       CLP     Chile
+                       CNY     China
+                       COP     Colombia
+                       CRC     Costa Rica
+                       CUP     Cuba
+                       CVE     Cape Verde
+                       CYP     Cyprus
+                       CZK     Czech Republic
+                       DEM     Germany
+                       DJF     Djibouti
+                       DKK     Denmark
+                       DOP     Dominican Republic
+                       DZD     Algeria
+                       EEK     Estonia
+                       EGP     Egypt
+                       ERN     Eritrea
+                       ESP     Spain
+                       ETB     Ethiopia
+                       EUR     Euro Member Countries
+                       FIM     Finland
+                       FJD     Fiji
+                       FKP     Falkland Islands (Malvinas)
+                       FRF     France
+                       GBP     United Kingdom
+                       GEL     Georgia
+                       GGP     Guernsey
+                       GHC     Ghana
+                       GIP     Gibraltar
+                       GMD     Gambia
+                       GNF     Guinea
+                       GRD     Greece
+                       GTQ     Guatemala
+                       GYD     Guyana
+                       HKD     Hong Kong
+                       HNL     Honduras
+                       HRK     Croatia
+                       HTG     Haiti
+                       HUF     Hungary
+                       IDR     Indonesia
+                       IEP     Ireland (Eire)
+                       ILS     Israel
+                       IMP     Isle of Man
+                       INR     India
+                       IQD     Iraq
+                       IRR     Iran
+                       ISK     Iceland
+                       ITL     Italy
+                       JEP     Jersey
+                       JMD     Jamaica
+                       JOD     Jordan
+                       JPY     Japan
+                       KES     Kenya
+                       KGS     Kyrgyzstan
+                       KHR     Cambodia
+                       KMF     Comoros
+                       KPW     Korea
+                       KWD     Kuwait
+                       KYD     Cayman Islands
+                       KZT     Kazakstan
+                       LAK     Laos
+                       LBP     Lebanon
+                       LKR     Sri Lanka
+                       LRD     Liberia
+                       LSL     Lesotho
+                       LTL     Lithuania
+                       LUF     Luxembourg
+                       LVL     Latvia
+                       LYD     Libya
+                       MAD     Morocco
+                       MDL     Moldova
+                       MGF     Madagascar
+                       MKD     Macedonia
+                       MMK     Myanmar (Burma)
+                       MNT     Mongolia
+                       MOP     Macau
+                       MRO     Mauritania
+                       MTL     Malta
+                       MUR     Mauritius
+                       MVR     Maldives (Maldive Islands)
+                       MWK     Malawi
+                       MXN     Mexico
+                       MYR     Malaysia
+                       MZM     Mozambique
+                       NAD     Namibia
+                       NGN     Nigeria
+                       NIO     Nicaragua
+                       NLG     Netherlands (Holland)
+                       NOK     Norway
+                       NPR     Nepal
+                       NZD     New Zealand
+                       OMR     Oman
+                       PAB     Panama
+                       PEN     Peru
+                       PGK     Papua New Guinea
+                       PHP     Philippines
+                       PKR     Pakistan
+                       PLN     Poland
+                       PTE     Portugal
+                       PYG     Paraguay
+                       QAR     Qatar
+                       ROL     Romania
+                       RUR     Russia
+                       RWF     Rwanda
+                       SAR     Saudi Arabia
+                       SBD     Solomon Islands
+                       SCR     Seychelles
+                       SDD     Sudan
+                       SEK     Sweden
+                       SGD     Singapore
+                       SHP     Saint Helena
+                       SIT     Slovenia
+                       SKK     Slovakia
+                       SLL     Sierra Leone
+                       SOS     Somalia
+                       SPL     Seborga
+                       SRG     Suriname
+                       STD     São Tome and Principe
+                       SVC     El Salvador
+                       SYP     Syria
+                       SZL     Swaziland
+                       THB     Thailand
+                       TJR     Tajikistan
+                       TMM     Turkmenistan
+                       TND     Tunisia
+                       TOP     Tonga
+                       TRL     Turkey
+                       TTD     Trinidad and Tobago
+                       TVD     Tuvalu
+                       TWD     Taiwan
+                       TZS     Tanzania
+                       UAH     Ukraine
+                       UGX     Uganda
+                       USD     United States of America
+                       UYU     Uruguay
+                       UZS     Uzbekistan
+                       VAL     Vatican City
+                       VEB     Venezuela
+                       VND     Viet Nam
+                       VUV     Vanuatu
+                       WST     Samoa
+                       XAF     Communauté Financière Africaine
+                       XAG     Silver
+                       XAU     Gold
+                       XCD     East Caribbean
+                       XDR     International Monetary Fund
+                       XPD     Palladium
+                       XPF     Comptoirs Français du Pacifique
+                       XPT     Platinum
+                       YER     Yemen
+                       YUM     Yugoslavia
+                       ZAR     South Africa
+                       ZMK     Zambia
+                       ZWD     Zimbabwe
+
+               */
+
+               return getid3_lib::EmbeddedLookup($currencyid, $begin, __LINE__, __FILE__, 'id3v2-currency-country');
+       }
+
+
+
+       public static function LanguageLookup($languagecode, $casesensitive=false) {
+
+               if (!$casesensitive) {
+                       $languagecode = strtolower($languagecode);
+               }
+
+               // http://www.id3.org/id3v2.4.0-structure.txt
+               // [4.   ID3v2 frame overview]
+               // The three byte language field, present in several frames, is used to
+               // describe the language of the frame's content, according to ISO-639-2
+               // [ISO-639-2]. The language should be represented in lower case. If the
+               // language is not known the string "XXX" should be used.
+
+
+               // ISO 639-2 - http://www.id3.org/iso639-2.html
+
+               $begin = __LINE__;
+
+               /** This is not a comment!
+
+                       XXX     unknown
+                       xxx     unknown
+                       aar     Afar
+                       abk     Abkhazian
+                       ace     Achinese
+                       ach     Acoli
+                       ada     Adangme
+                       afa     Afro-Asiatic (Other)
+                       afh     Afrihili
+                       afr     Afrikaans
+                       aka     Akan
+                       akk     Akkadian
+                       alb     Albanian
+                       ale     Aleut
+                       alg     Algonquian Languages
+                       amh     Amharic
+                       ang     English, Old (ca. 450-1100)
+                       apa     Apache Languages
+                       ara     Arabic
+                       arc     Aramaic
+                       arm     Armenian
+                       arn     Araucanian
+                       arp     Arapaho
+                       art     Artificial (Other)
+                       arw     Arawak
+                       asm     Assamese
+                       ath     Athapascan Languages
+                       ava     Avaric
+                       ave     Avestan
+                       awa     Awadhi
+                       aym     Aymara
+                       aze     Azerbaijani
+                       bad     Banda
+                       bai     Bamileke Languages
+                       bak     Bashkir
+                       bal     Baluchi
+                       bam     Bambara
+                       ban     Balinese
+                       baq     Basque
+                       bas     Basa
+                       bat     Baltic (Other)
+                       bej     Beja
+                       bel     Byelorussian
+                       bem     Bemba
+                       ben     Bengali
+                       ber     Berber (Other)
+                       bho     Bhojpuri
+                       bih     Bihari
+                       bik     Bikol
+                       bin     Bini
+                       bis     Bislama
+                       bla     Siksika
+                       bnt     Bantu (Other)
+                       bod     Tibetan
+                       bra     Braj
+                       bre     Breton
+                       bua     Buriat
+                       bug     Buginese
+                       bul     Bulgarian
+                       bur     Burmese
+                       cad     Caddo
+                       cai     Central American Indian (Other)
+                       car     Carib
+                       cat     Catalan
+                       cau     Caucasian (Other)
+                       ceb     Cebuano
+                       cel     Celtic (Other)
+                       ces     Czech
+                       cha     Chamorro
+                       chb     Chibcha
+                       che     Chechen
+                       chg     Chagatai
+                       chi     Chinese
+                       chm     Mari
+                       chn     Chinook jargon
+                       cho     Choctaw
+                       chr     Cherokee
+                       chu     Church Slavic
+                       chv     Chuvash
+                       chy     Cheyenne
+                       cop     Coptic
+                       cor     Cornish
+                       cos     Corsican
+                       cpe     Creoles and Pidgins, English-based (Other)
+                       cpf     Creoles and Pidgins, French-based (Other)
+                       cpp     Creoles and Pidgins, Portuguese-based (Other)
+                       cre     Cree
+                       crp     Creoles and Pidgins (Other)
+                       cus     Cushitic (Other)
+                       cym     Welsh
+                       cze     Czech
+                       dak     Dakota
+                       dan     Danish
+                       del     Delaware
+                       deu     German
+                       din     Dinka
+                       div     Divehi
+                       doi     Dogri
+                       dra     Dravidian (Other)
+                       dua     Duala
+                       dum     Dutch, Middle (ca. 1050-1350)
+                       dut     Dutch
+                       dyu     Dyula
+                       dzo     Dzongkha
+                       efi     Efik
+                       egy     Egyptian (Ancient)
+                       eka     Ekajuk
+                       ell     Greek, Modern (1453-)
+                       elx     Elamite
+                       eng     English
+                       enm     English, Middle (ca. 1100-1500)
+                       epo     Esperanto
+                       esk     Eskimo (Other)
+                       esl     Spanish
+                       est     Estonian
+                       eus     Basque
+                       ewe     Ewe
+                       ewo     Ewondo
+                       fan     Fang
+                       fao     Faroese
+                       fas     Persian
+                       fat     Fanti
+                       fij     Fijian
+                       fin     Finnish
+                       fiu     Finno-Ugrian (Other)
+                       fon     Fon
+                       fra     French
+                       fre     French
+                       frm     French, Middle (ca. 1400-1600)
+                       fro     French, Old (842- ca. 1400)
+                       fry     Frisian
+                       ful     Fulah
+                       gaa     Ga
+                       gae     Gaelic (Scots)
+                       gai     Irish
+                       gay     Gayo
+                       gdh     Gaelic (Scots)
+                       gem     Germanic (Other)
+                       geo     Georgian
+                       ger     German
+                       gez     Geez
+                       gil     Gilbertese
+                       glg     Gallegan
+                       gmh     German, Middle High (ca. 1050-1500)
+                       goh     German, Old High (ca. 750-1050)
+                       gon     Gondi
+                       got     Gothic
+                       grb     Grebo
+                       grc     Greek, Ancient (to 1453)
+                       gre     Greek, Modern (1453-)
+                       grn     Guarani
+                       guj     Gujarati
+                       hai     Haida
+                       hau     Hausa
+                       haw     Hawaiian
+                       heb     Hebrew
+                       her     Herero
+                       hil     Hiligaynon
+                       him     Himachali
+                       hin     Hindi
+                       hmo     Hiri Motu
+                       hun     Hungarian
+                       hup     Hupa
+                       hye     Armenian
+                       iba     Iban
+                       ibo     Igbo
+                       ice     Icelandic
+                       ijo     Ijo
+                       iku     Inuktitut
+                       ilo     Iloko
+                       ina     Interlingua (International Auxiliary language Association)
+                       inc     Indic (Other)
+                       ind     Indonesian
+                       ine     Indo-European (Other)
+                       ine     Interlingue
+                       ipk     Inupiak
+                       ira     Iranian (Other)
+                       iri     Irish
+                       iro     Iroquoian uages
+                       isl     Icelandic
+                       ita     Italian
+                       jav     Javanese
+                       jaw     Javanese
+                       jpn     Japanese
+                       jpr     Judeo-Persian
+                       jrb     Judeo-Arabic
+                       kaa     Kara-Kalpak
+                       kab     Kabyle
+                       kac     Kachin
+                       kal     Greenlandic
+                       kam     Kamba
+                       kan     Kannada
+                       kar     Karen
+                       kas     Kashmiri
+                       kat     Georgian
+                       kau     Kanuri
+                       kaw     Kawi
+                       kaz     Kazakh
+                       kha     Khasi
+                       khi     Khoisan (Other)
+                       khm     Khmer
+                       kho     Khotanese
+                       kik     Kikuyu
+                       kin     Kinyarwanda
+                       kir     Kirghiz
+                       kok     Konkani
+                       kom     Komi
+                       kon     Kongo
+                       kor     Korean
+                       kpe     Kpelle
+                       kro     Kru
+                       kru     Kurukh
+                       kua     Kuanyama
+                       kum     Kumyk
+                       kur     Kurdish
+                       kus     Kusaie
+                       kut     Kutenai
+                       lad     Ladino
+                       lah     Lahnda
+                       lam     Lamba
+                       lao     Lao
+                       lat     Latin
+                       lav     Latvian
+                       lez     Lezghian
+                       lin     Lingala
+                       lit     Lithuanian
+                       lol     Mongo
+                       loz     Lozi
+                       ltz     Letzeburgesch
+                       lub     Luba-Katanga
+                       lug     Ganda
+                       lui     Luiseno
+                       lun     Lunda
+                       luo     Luo (Kenya and Tanzania)
+                       mac     Macedonian
+                       mad     Madurese
+                       mag     Magahi
+                       mah     Marshall
+                       mai     Maithili
+                       mak     Macedonian
+                       mak     Makasar
+                       mal     Malayalam
+                       man     Mandingo
+                       mao     Maori
+                       map     Austronesian (Other)
+                       mar     Marathi
+                       mas     Masai
+                       max     Manx
+                       may     Malay
+                       men     Mende
+                       mga     Irish, Middle (900 - 1200)
+                       mic     Micmac
+                       min     Minangkabau
+                       mis     Miscellaneous (Other)
+                       mkh     Mon-Kmer (Other)
+                       mlg     Malagasy
+                       mlt     Maltese
+                       mni     Manipuri
+                       mno     Manobo Languages
+                       moh     Mohawk
+                       mol     Moldavian
+                       mon     Mongolian
+                       mos     Mossi
+                       mri     Maori
+                       msa     Malay
+                       mul     Multiple Languages
+                       mun     Munda Languages
+                       mus     Creek
+                       mwr     Marwari
+                       mya     Burmese
+                       myn     Mayan Languages
+                       nah     Aztec
+                       nai     North American Indian (Other)
+                       nau     Nauru
+                       nav     Navajo
+                       nbl     Ndebele, South
+                       nde     Ndebele, North
+                       ndo     Ndongo
+                       nep     Nepali
+                       new     Newari
+                       nic     Niger-Kordofanian (Other)
+                       niu     Niuean
+                       nla     Dutch
+                       nno     Norwegian (Nynorsk)
+                       non     Norse, Old
+                       nor     Norwegian
+                       nso     Sotho, Northern
+                       nub     Nubian Languages
+                       nya     Nyanja
+                       nym     Nyamwezi
+                       nyn     Nyankole
+                       nyo     Nyoro
+                       nzi     Nzima
+                       oci     Langue d'Oc (post 1500)
+                       oji     Ojibwa
+                       ori     Oriya
+                       orm     Oromo
+                       osa     Osage
+                       oss     Ossetic
+                       ota     Turkish, Ottoman (1500 - 1928)
+                       oto     Otomian Languages
+                       paa     Papuan-Australian (Other)
+                       pag     Pangasinan
+                       pal     Pahlavi
+                       pam     Pampanga
+                       pan     Panjabi
+                       pap     Papiamento
+                       pau     Palauan
+                       peo     Persian, Old (ca 600 - 400 B.C.)
+                       per     Persian
+                       phn     Phoenician
+                       pli     Pali
+                       pol     Polish
+                       pon     Ponape
+                       por     Portuguese
+                       pra     Prakrit uages
+                       pro     Provencal, Old (to 1500)
+                       pus     Pushto
+                       que     Quechua
+                       raj     Rajasthani
+                       rar     Rarotongan
+                       roa     Romance (Other)
+                       roh     Rhaeto-Romance
+                       rom     Romany
+                       ron     Romanian
+                       rum     Romanian
+                       run     Rundi
+                       rus     Russian
+                       sad     Sandawe
+                       sag     Sango
+                       sah     Yakut
+                       sai     South American Indian (Other)
+                       sal     Salishan Languages
+                       sam     Samaritan Aramaic
+                       san     Sanskrit
+                       sco     Scots
+                       scr     Serbo-Croatian
+                       sel     Selkup
+                       sem     Semitic (Other)
+                       sga     Irish, Old (to 900)
+                       shn     Shan
+                       sid     Sidamo
+                       sin     Singhalese
+                       sio     Siouan Languages
+                       sit     Sino-Tibetan (Other)
+                       sla     Slavic (Other)
+                       slk     Slovak
+                       slo     Slovak
+                       slv     Slovenian
+                       smi     Sami Languages
+                       smo     Samoan
+                       sna     Shona
+                       snd     Sindhi
+                       sog     Sogdian
+                       som     Somali
+                       son     Songhai
+                       sot     Sotho, Southern
+                       spa     Spanish
+                       sqi     Albanian
+                       srd     Sardinian
+                       srr     Serer
+                       ssa     Nilo-Saharan (Other)
+                       ssw     Siswant
+                       ssw     Swazi
+                       suk     Sukuma
+                       sun     Sudanese
+                       sus     Susu
+                       sux     Sumerian
+                       sve     Swedish
+                       swa     Swahili
+                       swe     Swedish
+                       syr     Syriac
+                       tah     Tahitian
+                       tam     Tamil
+                       tat     Tatar
+                       tel     Telugu
+                       tem     Timne
+                       ter     Tereno
+                       tgk     Tajik
+                       tgl     Tagalog
+                       tha     Thai
+                       tib     Tibetan
+                       tig     Tigre
+                       tir     Tigrinya
+                       tiv     Tivi
+                       tli     Tlingit
+                       tmh     Tamashek
+                       tog     Tonga (Nyasa)
+                       ton     Tonga (Tonga Islands)
+                       tru     Truk
+                       tsi     Tsimshian
+                       tsn     Tswana
+                       tso     Tsonga
+                       tuk     Turkmen
+                       tum     Tumbuka
+                       tur     Turkish
+                       tut     Altaic (Other)
+                       twi     Twi
+                       tyv     Tuvinian
+                       uga     Ugaritic
+                       uig     Uighur
+                       ukr     Ukrainian
+                       umb     Umbundu
+                       und     Undetermined
+                       urd     Urdu
+                       uzb     Uzbek
+                       vai     Vai
+                       ven     Venda
+                       vie     Vietnamese
+                       vol     Volapük
+                       vot     Votic
+                       wak     Wakashan Languages
+                       wal     Walamo
+                       war     Waray
+                       was     Washo
+                       wel     Welsh
+                       wen     Sorbian Languages
+                       wol     Wolof
+                       xho     Xhosa
+                       yao     Yao
+                       yap     Yap
+                       yid     Yiddish
+                       yor     Yoruba
+                       zap     Zapotec
+                       zen     Zenaga
+                       zha     Zhuang
+                       zho     Chinese
+                       zul     Zulu
+                       zun     Zuni
+
+               */
+
+               return getid3_lib::EmbeddedLookup($languagecode, $begin, __LINE__, __FILE__, 'id3v2-languagecode');
+       }
+
+
+       public static function ETCOEventLookup($index) {
+               if (($index >= 0x17) && ($index <= 0xDF)) {
+                       return 'reserved for future use';
+               }
+               if (($index >= 0xE0) && ($index <= 0xEF)) {
+                       return 'not predefined synch 0-F';
+               }
+               if (($index >= 0xF0) && ($index <= 0xFC)) {
+                       return 'reserved for future use';
+               }
+
+               static $EventLookup = array(
+                       0x00 => 'padding (has no meaning)',
+                       0x01 => 'end of initial silence',
+                       0x02 => 'intro start',
+                       0x03 => 'main part start',
+                       0x04 => 'outro start',
+                       0x05 => 'outro end',
+                       0x06 => 'verse start',
+                       0x07 => 'refrain start',
+                       0x08 => 'interlude start',
+                       0x09 => 'theme start',
+                       0x0A => 'variation start',
+                       0x0B => 'key change',
+                       0x0C => 'time change',
+                       0x0D => 'momentary unwanted noise (Snap, Crackle & Pop)',
+                       0x0E => 'sustained noise',
+                       0x0F => 'sustained noise end',
+                       0x10 => 'intro end',
+                       0x11 => 'main part end',
+                       0x12 => 'verse end',
+                       0x13 => 'refrain end',
+                       0x14 => 'theme end',
+                       0x15 => 'profanity',
+                       0x16 => 'profanity end',
+                       0xFD => 'audio end (start of silence)',
+                       0xFE => 'audio file ends',
+                       0xFF => 'one more byte of events follows'
+               );
+
+               return (isset($EventLookup[$index]) ? $EventLookup[$index] : '');
+       }
+
+       public static function SYTLContentTypeLookup($index) {
+               static $SYTLContentTypeLookup = array(
+                       0x00 => 'other',
+                       0x01 => 'lyrics',
+                       0x02 => 'text transcription',
+                       0x03 => 'movement/part name', // (e.g. 'Adagio')
+                       0x04 => 'events',             // (e.g. 'Don Quijote enters the stage')
+                       0x05 => 'chord',              // (e.g. 'Bb F Fsus')
+                       0x06 => 'trivia/\'pop up\' information',
+                       0x07 => 'URLs to webpages',
+                       0x08 => 'URLs to images'
+               );
+
+               return (isset($SYTLContentTypeLookup[$index]) ? $SYTLContentTypeLookup[$index] : '');
+       }
+
+       public static function APICPictureTypeLookup($index, $returnarray=false) {
+               static $APICPictureTypeLookup = array(
+                       0x00 => 'Other',
+                       0x01 => '32x32 pixels \'file icon\' (PNG only)',
+                       0x02 => 'Other file icon',
+                       0x03 => 'Cover (front)',
+                       0x04 => 'Cover (back)',
+                       0x05 => 'Leaflet page',
+                       0x06 => 'Media (e.g. label side of CD)',
+                       0x07 => 'Lead artist/lead performer/soloist',
+                       0x08 => 'Artist/performer',
+                       0x09 => 'Conductor',
+                       0x0A => 'Band/Orchestra',
+                       0x0B => 'Composer',
+                       0x0C => 'Lyricist/text writer',
+                       0x0D => 'Recording Location',
+                       0x0E => 'During recording',
+                       0x0F => 'During performance',
+                       0x10 => 'Movie/video screen capture',
+                       0x11 => 'A bright coloured fish',
+                       0x12 => 'Illustration',
+                       0x13 => 'Band/artist logotype',
+                       0x14 => 'Publisher/Studio logotype'
+               );
+               if ($returnarray) {
+                       return $APICPictureTypeLookup;
+               }
+               return (isset($APICPictureTypeLookup[$index]) ? $APICPictureTypeLookup[$index] : '');
+       }
+
+       public static function COMRReceivedAsLookup($index) {
+               static $COMRReceivedAsLookup = array(
+                       0x00 => 'Other',
+                       0x01 => 'Standard CD album with other songs',
+                       0x02 => 'Compressed audio on CD',
+                       0x03 => 'File over the Internet',
+                       0x04 => 'Stream over the Internet',
+                       0x05 => 'As note sheets',
+                       0x06 => 'As note sheets in a book with other sheets',
+                       0x07 => 'Music on other media',
+                       0x08 => 'Non-musical merchandise'
+               );
+
+               return (isset($COMRReceivedAsLookup[$index]) ? $COMRReceivedAsLookup[$index] : '');
+       }
+
+       public static function RVA2ChannelTypeLookup($index) {
+               static $RVA2ChannelTypeLookup = array(
+                       0x00 => 'Other',
+                       0x01 => 'Master volume',
+                       0x02 => 'Front right',
+                       0x03 => 'Front left',
+                       0x04 => 'Back right',
+                       0x05 => 'Back left',
+                       0x06 => 'Front centre',
+                       0x07 => 'Back centre',
+                       0x08 => 'Subwoofer'
+               );
+
+               return (isset($RVA2ChannelTypeLookup[$index]) ? $RVA2ChannelTypeLookup[$index] : '');
+       }
+
+       public static function FrameNameLongLookup($framename) {
+
+               $begin = __LINE__;
+
+               /** This is not a comment!
+
+                       AENC    Audio encryption
+                       APIC    Attached picture
+                       ASPI    Audio seek point index
+                       BUF     Recommended buffer size
+                       CNT     Play counter
+                       COM     Comments
+                       COMM    Comments
+                       COMR    Commercial frame
+                       CRA     Audio encryption
+                       CRM     Encrypted meta frame
+                       ENCR    Encryption method registration
+                       EQU     Equalisation
+                       EQU2    Equalisation (2)
+                       EQUA    Equalisation
+                       ETC     Event timing codes
+                       ETCO    Event timing codes
+                       GEO     General encapsulated object
+                       GEOB    General encapsulated object
+                       GRID    Group identification registration
+                       IPL     Involved people list
+                       IPLS    Involved people list
+                       LINK    Linked information
+                       LNK     Linked information
+                       MCDI    Music CD identifier
+                       MCI     Music CD Identifier
+                       MLL     MPEG location lookup table
+                       MLLT    MPEG location lookup table
+                       OWNE    Ownership frame
+                       PCNT    Play counter
+                       PIC     Attached picture
+                       POP     Popularimeter
+                       POPM    Popularimeter
+                       POSS    Position synchronisation frame
+                       PRIV    Private frame
+                       RBUF    Recommended buffer size
+                       REV     Reverb
+                       RVA     Relative volume adjustment
+                       RVA2    Relative volume adjustment (2)
+                       RVAD    Relative volume adjustment
+                       RVRB    Reverb
+                       SEEK    Seek frame
+                       SIGN    Signature frame
+                       SLT     Synchronised lyric/text
+                       STC     Synced tempo codes
+                       SYLT    Synchronised lyric/text
+                       SYTC    Synchronised tempo codes
+                       TAL     Album/Movie/Show title
+                       TALB    Album/Movie/Show title
+                       TBP     BPM (Beats Per Minute)
+                       TBPM    BPM (beats per minute)
+                       TCM     Composer
+                       TCMP    Part of a compilation
+                       TCO     Content type
+                       TCOM    Composer
+                       TCON    Content type
+                       TCOP    Copyright message
+                       TCP     Part of a compilation
+                       TCR     Copyright message
+                       TDA     Date
+                       TDAT    Date
+                       TDEN    Encoding time
+                       TDLY    Playlist delay
+                       TDOR    Original release time
+                       TDRC    Recording time
+                       TDRL    Release time
+                       TDTG    Tagging time
+                       TDY     Playlist delay
+                       TEN     Encoded by
+                       TENC    Encoded by
+                       TEXT    Lyricist/Text writer
+                       TFLT    File type
+                       TFT     File type
+                       TIM     Time
+                       TIME    Time
+                       TIPL    Involved people list
+                       TIT1    Content group description
+                       TIT2    Title/songname/content description
+                       TIT3    Subtitle/Description refinement
+                       TKE     Initial key
+                       TKEY    Initial key
+                       TLA     Language(s)
+                       TLAN    Language(s)
+                       TLE     Length
+                       TLEN    Length
+                       TMCL    Musician credits list
+                       TMED    Media type
+                       TMOO    Mood
+                       TMT     Media type
+                       TOA     Original artist(s)/performer(s)
+                       TOAL    Original album/movie/show title
+                       TOF     Original filename
+                       TOFN    Original filename
+                       TOL     Original Lyricist(s)/text writer(s)
+                       TOLY    Original lyricist(s)/text writer(s)
+                       TOPE    Original artist(s)/performer(s)
+                       TOR     Original release year
+                       TORY    Original release year
+                       TOT     Original album/Movie/Show title
+                       TOWN    File owner/licensee
+                       TP1     Lead artist(s)/Lead performer(s)/Soloist(s)/Performing group
+                       TP2     Band/Orchestra/Accompaniment
+                       TP3     Conductor/Performer refinement
+                       TP4     Interpreted, remixed, or otherwise modified by
+                       TPA     Part of a set
+                       TPB     Publisher
+                       TPE1    Lead performer(s)/Soloist(s)
+                       TPE2    Band/orchestra/accompaniment
+                       TPE3    Conductor/performer refinement
+                       TPE4    Interpreted, remixed, or otherwise modified by
+                       TPOS    Part of a set
+                       TPRO    Produced notice
+                       TPUB    Publisher
+                       TRC     ISRC (International Standard Recording Code)
+                       TRCK    Track number/Position in set
+                       TRD     Recording dates
+                       TRDA    Recording dates
+                       TRK     Track number/Position in set
+                       TRSN    Internet radio station name
+                       TRSO    Internet radio station owner
+                       TS2     Album-Artist sort order
+                       TSA     Album sort order
+                       TSC     Composer sort order
+                       TSI     Size
+                       TSIZ    Size
+                       TSO2    Album-Artist sort order
+                       TSOA    Album sort order
+                       TSOC    Composer sort order
+                       TSOP    Performer sort order
+                       TSOT    Title sort order
+                       TSP     Performer sort order
+                       TSRC    ISRC (international standard recording code)
+                       TSS     Software/hardware and settings used for encoding
+                       TSSE    Software/Hardware and settings used for encoding
+                       TSST    Set subtitle
+                       TST     Title sort order
+                       TT1     Content group description
+                       TT2     Title/Songname/Content description
+                       TT3     Subtitle/Description refinement
+                       TXT     Lyricist/text writer
+                       TXX     User defined text information frame
+                       TXXX    User defined text information frame
+                       TYE     Year
+                       TYER    Year
+                       UFI     Unique file identifier
+                       UFID    Unique file identifier
+                       ULT     Unsychronised lyric/text transcription
+                       USER    Terms of use
+                       USLT    Unsynchronised lyric/text transcription
+                       WAF     Official audio file webpage
+                       WAR     Official artist/performer webpage
+                       WAS     Official audio source webpage
+                       WCM     Commercial information
+                       WCOM    Commercial information
+                       WCOP    Copyright/Legal information
+                       WCP     Copyright/Legal information
+                       WOAF    Official audio file webpage
+                       WOAR    Official artist/performer webpage
+                       WOAS    Official audio source webpage
+                       WORS    Official Internet radio station homepage
+                       WPAY    Payment
+                       WPB     Publishers official webpage
+                       WPUB    Publishers official webpage
+                       WXX     User defined URL link frame
+                       WXXX    User defined URL link frame
+                       TFEA    Featured Artist
+                       TSTU    Recording Studio
+                       rgad    Replay Gain Adjustment
+
+               */
+
+               return getid3_lib::EmbeddedLookup($framename, $begin, __LINE__, __FILE__, 'id3v2-framename_long');
+
+               // Last three:
+               // from Helium2 [www.helium2.com]
+               // from http://privatewww.essex.ac.uk/~djmrob/replaygain/file_format_id3v2.html
+       }
+
+
+       public static function FrameNameShortLookup($framename) {
+
+               $begin = __LINE__;
+
+               /** This is not a comment!
+
+                       AENC    audio_encryption
+                       APIC    attached_picture
+                       ASPI    audio_seek_point_index
+                       BUF     recommended_buffer_size
+                       CNT     play_counter
+                       COM     comment
+                       COMM    comment
+                       COMR    commercial_frame
+                       CRA     audio_encryption
+                       CRM     encrypted_meta_frame
+                       ENCR    encryption_method_registration
+                       EQU     equalisation
+                       EQU2    equalisation
+                       EQUA    equalisation
+                       ETC     event_timing_codes
+                       ETCO    event_timing_codes
+                       GEO     general_encapsulated_object
+                       GEOB    general_encapsulated_object
+                       GRID    group_identification_registration
+                       IPL     involved_people_list
+                       IPLS    involved_people_list
+                       LINK    linked_information
+                       LNK     linked_information
+                       MCDI    music_cd_identifier
+                       MCI     music_cd_identifier
+                       MLL     mpeg_location_lookup_table
+                       MLLT    mpeg_location_lookup_table
+                       OWNE    ownership_frame
+                       PCNT    play_counter
+                       PIC     attached_picture
+                       POP     popularimeter
+                       POPM    popularimeter
+                       POSS    position_synchronisation_frame
+                       PRIV    private_frame
+                       RBUF    recommended_buffer_size
+                       REV     reverb
+                       RVA     relative_volume_adjustment
+                       RVA2    relative_volume_adjustment
+                       RVAD    relative_volume_adjustment
+                       RVRB    reverb
+                       SEEK    seek_frame
+                       SIGN    signature_frame
+                       SLT     synchronised_lyric
+                       STC     synced_tempo_codes
+                       SYLT    synchronised_lyric
+                       SYTC    synchronised_tempo_codes
+                       TAL     album
+                       TALB    album
+                       TBP     bpm
+                       TBPM    bpm
+                       TCM     composer
+                       TCMP    part_of_a_compilation
+                       TCO     genre
+                       TCOM    composer
+                       TCON    genre
+                       TCOP    copyright_message
+                       TCP     part_of_a_compilation
+                       TCR     copyright_message
+                       TDA     date
+                       TDAT    date
+                       TDEN    encoding_time
+                       TDLY    playlist_delay
+                       TDOR    original_release_time
+                       TDRC    recording_time
+                       TDRL    release_time
+                       TDTG    tagging_time
+                       TDY     playlist_delay
+                       TEN     encoded_by
+                       TENC    encoded_by
+                       TEXT    lyricist
+                       TFLT    file_type
+                       TFT     file_type
+                       TIM     time
+                       TIME    time
+                       TIPL    involved_people_list
+                       TIT1    content_group_description
+                       TIT2    title
+                       TIT3    subtitle
+                       TKE     initial_key
+                       TKEY    initial_key
+                       TLA     language
+                       TLAN    language
+                       TLE     length
+                       TLEN    length
+                       TMCL    musician_credits_list
+                       TMED    media_type
+                       TMOO    mood
+                       TMT     media_type
+                       TOA     original_artist
+                       TOAL    original_album
+                       TOF     original_filename
+                       TOFN    original_filename
+                       TOL     original_lyricist
+                       TOLY    original_lyricist
+                       TOPE    original_artist
+                       TOR     original_year
+                       TORY    original_year
+                       TOT     original_album
+                       TOWN    file_owner
+                       TP1     artist
+                       TP2     band
+                       TP3     conductor
+                       TP4     remixer
+                       TPA     part_of_a_set
+                       TPB     publisher
+                       TPE1    artist
+                       TPE2    band
+                       TPE3    conductor
+                       TPE4    remixer
+                       TPOS    part_of_a_set
+                       TPRO    produced_notice
+                       TPUB    publisher
+                       TRC     isrc
+                       TRCK    track_number
+                       TRD     recording_dates
+                       TRDA    recording_dates
+                       TRK     track_number
+                       TRSN    internet_radio_station_name
+                       TRSO    internet_radio_station_owner
+                       TS2     album_artist_sort_order
+                       TSA     album_sort_order
+                       TSC     composer_sort_order
+                       TSI     size
+                       TSIZ    size
+                       TSO2    album_artist_sort_order
+                       TSOA    album_sort_order
+                       TSOC    composer_sort_order
+                       TSOP    performer_sort_order
+                       TSOT    title_sort_order
+                       TSP     performer_sort_order
+                       TSRC    isrc
+                       TSS     encoder_settings
+                       TSSE    encoder_settings
+                       TSST    set_subtitle
+                       TST     title_sort_order
+                       TT1     content_group_description
+                       TT2     title
+                       TT3     subtitle
+                       TXT     lyricist
+                       TXX     text
+                       TXXX    text
+                       TYE     year
+                       TYER    year
+                       UFI     unique_file_identifier
+                       UFID    unique_file_identifier
+                       ULT     unsychronised_lyric
+                       USER    terms_of_use
+                       USLT    unsynchronised_lyric
+                       WAF     url_file
+                       WAR     url_artist
+                       WAS     url_source
+                       WCM     commercial_information
+                       WCOM    commercial_information
+                       WCOP    copyright
+                       WCP     copyright
+                       WOAF    url_file
+                       WOAR    url_artist
+                       WOAS    url_source
+                       WORS    url_station
+                       WPAY    url_payment
+                       WPB     url_publisher
+                       WPUB    url_publisher
+                       WXX     url_user
+                       WXXX    url_user
+                       TFEA    featured_artist
+                       TSTU    recording_studio
+                       rgad    replay_gain_adjustment
+
+               */
+
+               return getid3_lib::EmbeddedLookup($framename, $begin, __LINE__, __FILE__, 'id3v2-framename_short');
+       }
+
+       public static function TextEncodingTerminatorLookup($encoding) {
+               // http://www.id3.org/id3v2.4.0-structure.txt
+               // Frames that allow different types of text encoding contains a text encoding description byte. Possible encodings:
+               static $TextEncodingTerminatorLookup = array(
+                       0   => "\x00",     // $00  ISO-8859-1. Terminated with $00.
+                       1   => "\x00\x00", // $01  UTF-16 encoded Unicode with BOM. All strings in the same frame SHALL have the same byteorder. Terminated with $00 00.
+                       2   => "\x00\x00", // $02  UTF-16BE encoded Unicode without BOM. Terminated with $00 00.
+                       3   => "\x00",     // $03  UTF-8 encoded Unicode. Terminated with $00.
+                       255 => "\x00\x00"
+               );
+               return (isset($TextEncodingTerminatorLookup[$encoding]) ? $TextEncodingTerminatorLookup[$encoding] : '');
+       }
+
+       public static function TextEncodingNameLookup($encoding) {
+               // http://www.id3.org/id3v2.4.0-structure.txt
+               // Frames that allow different types of text encoding contains a text encoding description byte. Possible encodings:
+               static $TextEncodingNameLookup = array(
+                       0   => 'ISO-8859-1', // $00  ISO-8859-1. Terminated with $00.
+                       1   => 'UTF-16',     // $01  UTF-16 encoded Unicode with BOM. All strings in the same frame SHALL have the same byteorder. Terminated with $00 00.
+                       2   => 'UTF-16BE',   // $02  UTF-16BE encoded Unicode without BOM. Terminated with $00 00.
+                       3   => 'UTF-8',      // $03  UTF-8 encoded Unicode. Terminated with $00.
+                       255 => 'UTF-16BE'
+               );
+               return (isset($TextEncodingNameLookup[$encoding]) ? $TextEncodingNameLookup[$encoding] : 'ISO-8859-1');
+       }
+
+       public static function IsValidID3v2FrameName($framename, $id3v2majorversion) {
+               switch ($id3v2majorversion) {
+                       case 2:
+                               return preg_match('#[A-Z][A-Z0-9]{2}#', $framename);
+                               break;
+
+                       case 3:
+                       case 4:
+                               return preg_match('#[A-Z][A-Z0-9]{3}#', $framename);
+                               break;
+               }
+               return false;
+       }
+
+       public static function IsANumber($numberstring, $allowdecimal=false, $allownegative=false) {
+               for ($i = 0; $i < strlen($numberstring); $i++) {
+                       if ((chr($numberstring{$i}) < chr('0')) || (chr($numberstring{$i}) > chr('9'))) {
+                               if (($numberstring{$i} == '.') && $allowdecimal) {
+                                       // allowed
+                               } elseif (($numberstring{$i} == '-') && $allownegative && ($i == 0)) {
+                                       // allowed
+                               } else {
+                                       return false;
+                               }
+                       }
+               }
+               return true;
+       }
+
+       public static function IsValidDateStampString($datestamp) {
+               if (strlen($datestamp) != 8) {
+                       return false;
+               }
+               if (!self::IsANumber($datestamp, false)) {
+                       return false;
+               }
+               $year  = substr($datestamp, 0, 4);
+               $month = substr($datestamp, 4, 2);
+               $day   = substr($datestamp, 6, 2);
+               if (($year == 0) || ($month == 0) || ($day == 0)) {
+                       return false;
+               }
+               if ($month > 12) {
+                       return false;
+               }
+               if ($day > 31) {
+                       return false;
+               }
+               if (($day > 30) && (($month == 4) || ($month == 6) || ($month == 9) || ($month == 11))) {
+                       return false;
+               }
+               if (($day > 29) && ($month == 2)) {
+                       return false;
+               }
+               return true;
+       }
+
+       public static function ID3v2HeaderLength($majorversion) {
+               return (($majorversion == 2) ? 6 : 10);
+       }
+
+}
+
diff --git a/wp-includes/ID3/module.tag.lyrics3.php b/wp-includes/ID3/module.tag.lyrics3.php
new file mode 100644 (file)
index 0000000..108d7ae
--- /dev/null
@@ -0,0 +1,294 @@
+<?php
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org>               //
+//  available at http://getid3.sourceforge.net                 //
+//            or http://www.getid3.org                         //
+/////////////////////////////////////////////////////////////////
+// See readme.txt for more details                             //
+/////////////////////////////////////////////////////////////////
+///                                                            //
+// module.tag.lyrics3.php                                      //
+// module for analyzing Lyrics3 tags                           //
+// dependencies: module.tag.apetag.php (optional)              //
+//                                                            ///
+/////////////////////////////////////////////////////////////////
+
+
+class getid3_lyrics3 extends getid3_handler
+{
+
+       public function Analyze() {
+               $info = &$this->getid3->info;
+
+               // http://www.volweb.cz/str/tags.htm
+
+               if (!getid3_lib::intValueSupported($info['filesize'])) {
+                       $info['warning'][] = 'Unable to check for Lyrics3 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB';
+                       return false;
+               }
+
+               fseek($this->getid3->fp, (0 - 128 - 9 - 6), SEEK_END);          // end - ID3v1 - "LYRICSEND" - [Lyrics3size]
+               $lyrics3_id3v1 = fread($this->getid3->fp, 128 + 9 + 6);
+               $lyrics3lsz    = substr($lyrics3_id3v1,  0,   6); // Lyrics3size
+               $lyrics3end    = substr($lyrics3_id3v1,  6,   9); // LYRICSEND or LYRICS200
+               $id3v1tag      = substr($lyrics3_id3v1, 15, 128); // ID3v1
+
+               if ($lyrics3end == 'LYRICSEND') {
+                       // Lyrics3v1, ID3v1, no APE
+
+                       $lyrics3size    = 5100;
+                       $lyrics3offset  = $info['filesize'] - 128 - $lyrics3size;
+                       $lyrics3version = 1;
+
+               } elseif ($lyrics3end == 'LYRICS200') {
+                       // Lyrics3v2, ID3v1, no APE
+
+                       // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200'
+                       $lyrics3size    = $lyrics3lsz + 6 + strlen('LYRICS200');
+                       $lyrics3offset  = $info['filesize'] - 128 - $lyrics3size;
+                       $lyrics3version = 2;
+
+               } elseif (substr(strrev($lyrics3_id3v1), 0, 9) == strrev('LYRICSEND')) {
+                       // Lyrics3v1, no ID3v1, no APE
+
+                       $lyrics3size    = 5100;
+                       $lyrics3offset  = $info['filesize'] - $lyrics3size;
+                       $lyrics3version = 1;
+                       $lyrics3offset  = $info['filesize'] - $lyrics3size;
+
+               } elseif (substr(strrev($lyrics3_id3v1), 0, 9) == strrev('LYRICS200')) {
+
+                       // Lyrics3v2, no ID3v1, no APE
+
+                       $lyrics3size    = strrev(substr(strrev($lyrics3_id3v1), 9, 6)) + 6 + strlen('LYRICS200'); // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200'
+                       $lyrics3offset  = $info['filesize'] - $lyrics3size;
+                       $lyrics3version = 2;
+
+               } else {
+
+                       if (isset($info['ape']['tag_offset_start']) && ($info['ape']['tag_offset_start'] > 15)) {
+
+                               fseek($this->getid3->fp, $info['ape']['tag_offset_start'] - 15, SEEK_SET);
+                               $lyrics3lsz = fread($this->getid3->fp, 6);
+                               $lyrics3end = fread($this->getid3->fp, 9);
+
+                               if ($lyrics3end == 'LYRICSEND') {
+                                       // Lyrics3v1, APE, maybe ID3v1
+
+                                       $lyrics3size    = 5100;
+                                       $lyrics3offset  = $info['ape']['tag_offset_start'] - $lyrics3size;
+                                       $info['avdataend'] = $lyrics3offset;
+                                       $lyrics3version = 1;
+                                       $info['warning'][] = 'APE tag located after Lyrics3, will probably break Lyrics3 compatability';
+
+                               } elseif ($lyrics3end == 'LYRICS200') {
+                                       // Lyrics3v2, APE, maybe ID3v1
+
+                                       $lyrics3size    = $lyrics3lsz + 6 + strlen('LYRICS200'); // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200'
+                                       $lyrics3offset  = $info['ape']['tag_offset_start'] - $lyrics3size;
+                                       $lyrics3version = 2;
+                                       $info['warning'][] = 'APE tag located after Lyrics3, will probably break Lyrics3 compatability';
+
+                               }
+
+                       }
+
+               }
+
+               if (isset($lyrics3offset)) {
+                       $info['avdataend'] = $lyrics3offset;
+                       $this->getLyrics3Data($lyrics3offset, $lyrics3version, $lyrics3size);
+
+                       if (!isset($info['ape'])) {
+                               $GETID3_ERRORARRAY = &$info['warning'];
+                               if (getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.apetag.php', __FILE__, false)) {
+                                       $getid3_temp = new getID3();
+                                       $getid3_temp->openfile($this->getid3->filename);
+                                       $getid3_apetag = new getid3_apetag($getid3_temp);
+                                       $getid3_apetag->overrideendoffset = $info['lyrics3']['tag_offset_start'];
+                                       $getid3_apetag->Analyze();
+                                       if (!empty($getid3_temp->info['ape'])) {
+                                               $info['ape'] = $getid3_temp->info['ape'];
+                                       }
+                                       if (!empty($getid3_temp->info['replay_gain'])) {
+                                               $info['replay_gain'] = $getid3_temp->info['replay_gain'];
+                                       }
+                                       unset($getid3_temp, $getid3_apetag);
+                               }
+                       }
+
+               }
+
+               return true;
+       }
+
+       public function getLyrics3Data($endoffset, $version, $length) {
+               // http://www.volweb.cz/str/tags.htm
+
+               $info = &$this->getid3->info;
+
+               if (!getid3_lib::intValueSupported($endoffset)) {
+                       $info['warning'][] = 'Unable to check for Lyrics3 because file is larger than '.round(PHP_INT_MAX / 1073741824).'GB';
+                       return false;
+               }
+
+               fseek($this->getid3->fp, $endoffset, SEEK_SET);
+               if ($length <= 0) {
+                       return false;
+               }
+               $rawdata = fread($this->getid3->fp, $length);
+
+               $ParsedLyrics3['raw']['lyrics3version'] = $version;
+               $ParsedLyrics3['raw']['lyrics3tagsize'] = $length;
+               $ParsedLyrics3['tag_offset_start']      = $endoffset;
+               $ParsedLyrics3['tag_offset_end']        = $endoffset + $length - 1;
+
+               if (substr($rawdata, 0, 11) != 'LYRICSBEGIN') {
+                       if (strpos($rawdata, 'LYRICSBEGIN') !== false) {
+
+                               $info['warning'][] = '"LYRICSBEGIN" expected at '.$endoffset.' but actually found at '.($endoffset + strpos($rawdata, 'LYRICSBEGIN')).' - this is invalid for Lyrics3 v'.$version;
+                               $info['avdataend'] = $endoffset + strpos($rawdata, 'LYRICSBEGIN');
+                               $rawdata = substr($rawdata, strpos($rawdata, 'LYRICSBEGIN'));
+                               $length = strlen($rawdata);
+                               $ParsedLyrics3['tag_offset_start'] = $info['avdataend'];
+                               $ParsedLyrics3['raw']['lyrics3tagsize'] = $length;
+
+                       } else {
+
+                               $info['error'][] = '"LYRICSBEGIN" expected at '.$endoffset.' but found "'.substr($rawdata, 0, 11).'" instead';
+                               return false;
+
+                       }
+
+               }
+
+               switch ($version) {
+
+                       case 1:
+                               if (substr($rawdata, strlen($rawdata) - 9, 9) == 'LYRICSEND') {
+                                       $ParsedLyrics3['raw']['LYR'] = trim(substr($rawdata, 11, strlen($rawdata) - 11 - 9));
+                                       $this->Lyrics3LyricsTimestampParse($ParsedLyrics3);
+                               } else {
+                                       $info['error'][] = '"LYRICSEND" expected at '.(ftell($this->getid3->fp) - 11 + $length - 9).' but found "'.substr($rawdata, strlen($rawdata) - 9, 9).'" instead';
+                                       return false;
+                               }
+                               break;
+
+                       case 2:
+                               if (substr($rawdata, strlen($rawdata) - 9, 9) == 'LYRICS200') {
+                                       $ParsedLyrics3['raw']['unparsed'] = substr($rawdata, 11, strlen($rawdata) - 11 - 9 - 6); // LYRICSBEGIN + LYRICS200 + LSZ
+                                       $rawdata = $ParsedLyrics3['raw']['unparsed'];
+                                       while (strlen($rawdata) > 0) {
+                                               $fieldname = substr($rawdata, 0, 3);
+                                               $fieldsize = (int) substr($rawdata, 3, 5);
+                                               $ParsedLyrics3['raw'][$fieldname] = substr($rawdata, 8, $fieldsize);
+                                               $rawdata = substr($rawdata, 3 + 5 + $fieldsize);
+                                       }
+
+                                       if (isset($ParsedLyrics3['raw']['IND'])) {
+                                               $i = 0;
+                                               $flagnames = array('lyrics', 'timestamps', 'inhibitrandom');
+                                               foreach ($flagnames as $flagname) {
+                                                       if (strlen($ParsedLyrics3['raw']['IND']) > $i++) {
+                                                               $ParsedLyrics3['flags'][$flagname] = $this->IntString2Bool(substr($ParsedLyrics3['raw']['IND'], $i, 1 - 1));
+                                                       }
+                                               }
+                                       }
+
+                                       $fieldnametranslation = array('ETT'=>'title', 'EAR'=>'artist', 'EAL'=>'album', 'INF'=>'comment', 'AUT'=>'author');
+                                       foreach ($fieldnametranslation as $key => $value) {
+                                               if (isset($ParsedLyrics3['raw'][$key])) {
+                                                       $ParsedLyrics3['comments'][$value][] = trim($ParsedLyrics3['raw'][$key]);
+                                               }
+                                       }
+
+                                       if (isset($ParsedLyrics3['raw']['IMG'])) {
+                                               $imagestrings = explode("\r\n", $ParsedLyrics3['raw']['IMG']);
+                                               foreach ($imagestrings as $key => $imagestring) {
+                                                       if (strpos($imagestring, '||') !== false) {
+                                                               $imagearray = explode('||', $imagestring);
+                                                               $ParsedLyrics3['images'][$key]['filename']     =                                (isset($imagearray[0]) ? $imagearray[0] : '');
+                                                               $ParsedLyrics3['images'][$key]['description']  =                                (isset($imagearray[1]) ? $imagearray[1] : '');
+                                                               $ParsedLyrics3['images'][$key]['timestamp']    = $this->Lyrics3Timestamp2Seconds(isset($imagearray[2]) ? $imagearray[2] : '');
+                                                       }
+                                               }
+                                       }
+                                       if (isset($ParsedLyrics3['raw']['LYR'])) {
+                                               $this->Lyrics3LyricsTimestampParse($ParsedLyrics3);
+                                       }
+                               } else {
+                                       $info['error'][] = '"LYRICS200" expected at '.(ftell($this->getid3->fp) - 11 + $length - 9).' but found "'.substr($rawdata, strlen($rawdata) - 9, 9).'" instead';
+                                       return false;
+                               }
+                               break;
+
+                       default:
+                               $info['error'][] = 'Cannot process Lyrics3 version '.$version.' (only v1 and v2)';
+                               return false;
+                               break;
+               }
+
+
+               if (isset($info['id3v1']['tag_offset_start']) && ($info['id3v1']['tag_offset_start'] <= $ParsedLyrics3['tag_offset_end'])) {
+                       $info['warning'][] = 'ID3v1 tag information ignored since it appears to be a false synch in Lyrics3 tag data';
+                       unset($info['id3v1']);
+                       foreach ($info['warning'] as $key => $value) {
+                               if ($value == 'Some ID3v1 fields do not use NULL characters for padding') {
+                                       unset($info['warning'][$key]);
+                                       sort($info['warning']);
+                                       break;
+                               }
+                       }
+               }
+
+               $info['lyrics3'] = $ParsedLyrics3;
+
+               return true;
+       }
+
+       public function Lyrics3Timestamp2Seconds($rawtimestamp) {
+               if (preg_match('#^\\[([0-9]{2}):([0-9]{2})\\]$#', $rawtimestamp, $regs)) {
+                       return (int) (($regs[1] * 60) + $regs[2]);
+               }
+               return false;
+       }
+
+       public function Lyrics3LyricsTimestampParse(&$Lyrics3data) {
+               $lyricsarray = explode("\r\n", $Lyrics3data['raw']['LYR']);
+               foreach ($lyricsarray as $key => $lyricline) {
+                       $regs = array();
+                       unset($thislinetimestamps);
+                       while (preg_match('#^(\\[[0-9]{2}:[0-9]{2}\\])#', $lyricline, $regs)) {
+                               $thislinetimestamps[] = $this->Lyrics3Timestamp2Seconds($regs[0]);
+                               $lyricline = str_replace($regs[0], '', $lyricline);
+                       }
+                       $notimestamplyricsarray[$key] = $lyricline;
+                       if (isset($thislinetimestamps) && is_array($thislinetimestamps)) {
+                               sort($thislinetimestamps);
+                               foreach ($thislinetimestamps as $timestampkey => $timestamp) {
+                                       if (isset($Lyrics3data['synchedlyrics'][$timestamp])) {
+                                               // timestamps only have a 1-second resolution, it's possible that multiple lines
+                                               // could have the same timestamp, if so, append
+                                               $Lyrics3data['synchedlyrics'][$timestamp] .= "\r\n".$lyricline;
+                                       } else {
+                                               $Lyrics3data['synchedlyrics'][$timestamp] = $lyricline;
+                                       }
+                               }
+                       }
+               }
+               $Lyrics3data['unsynchedlyrics'] = implode("\r\n", $notimestamplyricsarray);
+               if (isset($Lyrics3data['synchedlyrics']) && is_array($Lyrics3data['synchedlyrics'])) {
+                       ksort($Lyrics3data['synchedlyrics']);
+               }
+               return true;
+       }
+
+       public function IntString2Bool($char) {
+               if ($char == '1') {
+                       return true;
+               } elseif ($char == '0') {
+                       return false;
+               }
+               return null;
+       }
+}
diff --git a/wp-includes/ID3/readme.txt b/wp-includes/ID3/readme.txt
new file mode 100644 (file)
index 0000000..337e84f
--- /dev/null
@@ -0,0 +1,603 @@
+/////////////////////////////////////////////////////////////////
+/// getID3() by James Heinrich <info@getid3.org>               //
+//  available at http://getid3.sourceforge.net                 //
+//            or http://www.getid3.org                         //
+/////////////////////////////////////////////////////////////////
+
+*****************************************************************
+*****************************************************************
+
+   getID3() is released under multiple licenses. You may choose
+   from the following licenses, and use getID3 according to the
+   terms of the license most suitable to your project.
+
+GNU GPL: https://gnu.org/licenses/gpl.html                   (v3)
+         https://gnu.org/licenses/old-licenses/gpl-2.0.html  (v2)
+         https://gnu.org/licenses/old-licenses/gpl-1.0.html  (v1)
+
+GNU LGPL: https://gnu.org/licenses/lgpl.html                 (v3)
+
+Mozilla MPL: http://www.mozilla.org/MPL/2.0/                 (v2)
+
+getID3 Commercial License: http://getid3.org/#gCL (payment required)
+
+*****************************************************************
+*****************************************************************
+Copies of each of the above licenses are included in the 'licenses'
+directory of the getID3 distribution.
+
+
+       +---------------------------------------------+
+       | If you want to donate, there is a link on   |
+       | http://www.getid3.org for PayPal donations. |
+       +---------------------------------------------+
+
+
+Quick Start
+===========================================================================
+
+Q: How can I check that getID3() works on my server/files?
+A: Unzip getID3() to a directory, then access /demos/demo.browse.php
+
+
+
+Support
+===========================================================================
+
+Q: I have a question, or I found a bug. What do I do?
+A: The preferred method of support requests and/or bug reports is the
+   forum at http://support.getid3.org/
+
+
+
+Sourceforge Notification
+===========================================================================
+
+It's highly recommended that you sign up for notification from
+Sourceforge for when new versions are released. Please visit:
+http://sourceforge.net/project/showfiles.php?group_id=55859
+and click the little "monitor package" icon/link.  If you're
+previously signed up for the mailing list, be aware that it has
+been discontinued, only the automated Sourceforge notification
+will be used from now on.
+
+
+
+What does getID3() do?
+===========================================================================
+
+Reads & parses (to varying degrees):
+# tags:
+  * APE (v1 and v2)
+  * ID3v1 (& ID3v1.1)
+  * ID3v2 (v2.4, v2.3, v2.2)
+  * Lyrics3 (v1 & v2)
+
+# audio-lossy:
+  * MP3/MP2/MP1
+  * MPC / Musepack
+  * Ogg (Vorbis, OggFLAC, Speex)
+  * AAC / MP4
+  * AC3
+  * DTS
+  * RealAudio
+  * Speex
+  * DSS
+  * VQF
+
+# audio-lossless:
+  * AIFF
+  * AU
+  * Bonk
+  * CD-audio (*.cda)
+  * FLAC
+  * LA (Lossless Audio)
+  * LiteWave
+  * LPAC
+  * MIDI
+  * Monkey's Audio
+  * OptimFROG
+  * RKAU
+  * Shorten
+  * TTA
+  * VOC
+  * WAV (RIFF)
+  * WavPack
+
+# audio-video:
+  * ASF: ASF, Windows Media Audio (WMA), Windows Media Video (WMV)
+  * AVI (RIFF)
+  * Flash
+  * Matroska (MKV)
+  * MPEG-1 / MPEG-2
+  * NSV (Nullsoft Streaming Video)
+  * Quicktime (including MP4)
+  * RealVideo
+
+# still image:
+  * BMP
+  * GIF
+  * JPEG
+  * PNG
+  * TIFF
+  * SWF (Flash)
+  * PhotoCD
+
+# data:
+  * ISO-9660 CD-ROM image (directory structure)
+  * SZIP (limited support)
+  * ZIP (directory structure)
+  * TAR
+  * CUE
+
+
+Writes:
+  * ID3v1 (& ID3v1.1)
+  * ID3v2 (v2.3 & v2.4)
+  * VorbisComment on OggVorbis
+  * VorbisComment on FLAC (not OggFLAC)
+  * APE v2
+  * Lyrics3 (delete only)
+
+
+
+Requirements
+===========================================================================
+
+* PHP 4.2.0 up to 5.2.x for getID3() 1.7.x (and earlier)
+* PHP 5.0.5 (or higher) for getID3() 1.8.x (and up)
+* PHP 5.0.5 (or higher) for getID3() 2.0.x (and up)
+* at least 4MB memory for PHP. 8MB or more is highly recommended.
+  12MB is required with all modules loaded.
+
+
+
+Usage
+===========================================================================
+
+See /demos/demo.basic.php for a very basic use of getID3() with no
+fancy output, just scanning one file.
+
+See structure.txt for the returned data structure.
+
+*>  For an example of a complete directory-browsing,       <*
+*>  file-scanning implementation of getID3(), please run   <*
+*>  /demos/demo.browse.php                                 <*
+
+See /demos/demo.mysql.php for a sample recursive scanning code that
+scans every file in a given directory, and all sub-directories, stores
+the results in a database and allows various analysis / maintenance
+operations
+
+To analyze remote files over HTTP or FTP you need to copy the file
+locally first before running getID3(). Your code would look something
+like this:
+
+// Copy remote file locally to scan with getID3()
+$remotefilename = 'http://www.example.com/filename.mp3';
+if ($fp_remote = fopen($remotefilename, 'rb')) {
+    $localtempfilename = tempnam('/tmp', 'getID3');
+    if ($fp_local = fopen($localtempfilename, 'wb')) {
+        while ($buffer = fread($fp_remote, 8192)) {
+            fwrite($fp_local, $buffer);
+        }
+        fclose($fp_local);
+
+               // Initialize getID3 engine
+               $getID3 = new getID3;
+
+               $ThisFileInfo = $getID3->analyze($filename);
+
+        // Delete temporary file
+        unlink($localtempfilename);
+    }
+    fclose($fp_remote);
+}
+
+
+See /demos/demo.write.php for how to write tags.
+
+
+
+What does the returned data structure look like?
+===========================================================================
+
+See structure.txt
+
+It is recommended that you look at the output of
+/demos/demo.browse.php scanning the file(s) you're interested in to
+confirm what data is actually returned for any particular filetype in
+general, and your files in particular, as the actual data returned
+may vary considerably depending on what information is available in
+the file itself.
+
+
+
+Notes
+===========================================================================
+
+getID3() 1.x:
+If the format parser encounters a critical problem, it will return
+something in $fileinfo['error'], describing the encountered error. If
+a less critical error or notice is generated it will appear in
+$fileinfo['warning']. Both keys may contain more than one warning or
+error. If something is returned in ['error'] then the file was not
+correctly parsed and returned data may or may not be correct and/or
+complete. If something is returned in ['warning'] (and not ['error'])
+then the data that is returned is OK - usually getID3() is reporting
+errors in the file that have been worked around due to known bugs in
+other programs. Some warnings may indicate that the data that is
+returned is OK but that some data could not be extracted due to
+errors in the file.
+
+getID3() 2.x:
+See above except errors are thrown (so you will only get one error).
+
+
+
+Disclaimer
+===========================================================================
+
+getID3() has been tested on many systems, on many types of files,
+under many operating systems, and is generally believe to be stable
+and safe. That being said, there is still the chance there is an
+undiscovered and/or unfixed bug that may potentially corrupt your
+file, especially within the writing functions. By using getID3() you
+agree that it's not my fault if any of your files are corrupted.
+In fact, I'm not liable for anything :)
+
+
+
+License
+===========================================================================
+
+GNU General Public License - see license.txt
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to:
+Free Software Foundation, Inc.
+59 Temple Place - Suite 330
+Boston, MA  02111-1307, USA.
+
+FAQ:
+Q: Can I use getID3() in my program? Do I need a commercial license?
+A: You're generally free to use getID3 however you see fit. The only
+   case in which you would require a commercial license is if you're
+   selling your closed-source program that integrates getID3. If you
+   sell your program including a copy of getID3, that's fine as long
+   as you include a copy of the sourcecode when you sell it.  Or you
+   can distribute your code without getID3 and say "download it from
+   getid3.sourceforge.net"
+
+
+
+Why is it called "getID3()" if it does so much more than just that?
+===========================================================================
+
+v0.1 did in fact just do that. I don't have a copy of code that old, but I
+could essentially write it today with a one-line function:
+  function getID3($filename) { return unpack('a3TAG/a30title/a30artist/a30album/a4year/a28comment/c1track/c1genreid', substr(file_get_contents($filename), -128)); }
+
+
+Future Plans
+===========================================================================
+http://www.getid3.org/phpBB3/viewforum.php?f=7
+
+* Better support for MP4 container format
+* Scan for appended ID3v2 tag at end of file per ID3v2.4 specs (Section 5.0)
+* Support for JPEG-2000 (http://www.morgan-multimedia.com/jpeg2000_overview.htm)
+* Support for MOD (mod/stm/s3m/it/xm/mtm/ult/669)
+* Support for ACE (thanks Vince)
+* Support for Ogg other than Vorbis, Speex and OggFlac (ie. Ogg+Xvid)
+* Ability to create Xing/LAME VBR header for VBR MP3s that are missing VBR header
+* Ability to "clean" ID3v2 padding (replace invalid padding with valid padding)
+* Warn if MP3s change version mid-stream (in full-scan mode)
+* check for corrupt/broken mid-file MP3 streams in histogram scan
+* Support for lossless-compression formats
+  (http://www.firstpr.com.au/audiocomp/lossless/#Links)
+  (http://compression.ca/act-sound.html)
+  (http://web.inter.nl.net/users/hvdh/lossless/lossless.htm)
+* Support for RIFF-INFO chunks
+  * http://lotto.st-andrews.ac.uk/~njh/tag_interchange.html
+    (thanks Nick Humfrey <njh@surgeradio*co*uk>)
+  * http://abcavi.narod.ru/sof/abcavi/infotags.htm
+    (thanks Kibi)
+* Better support for Bink video
+* http://www.hr/josip/DSP/AudioFile2.html
+* http://www.pcisys.net/~melanson/codecs/
+* Detect mp3PRO
+* Support for PSD
+* Support for JPC
+* Support for JP2
+* Support for JPX
+* Support for JB2
+* Support for IFF
+* Support for ICO
+* Support for ANI
+* Support for EXE (comments, author, etc) (thanks p*quaedackers@planet*nl)
+* Support for DVD-IFO (region, subtitles, aspect ratio, etc)
+  (thanks p*quaedackers@planet*nl)
+* More complete support for SWF - parsing encapsulated MP3 and/or JPEG content
+    (thanks n8n8@yahoo*com)
+* Support for a2b
+* Optional scan-through-frames for AVI verification
+  (thanks rockcohen@massive-interactive*nl)
+* Support for TTF (thanks info@butterflyx*com)
+* Support for DSS (http://www.getid3.org/phpBB3/viewtopic.php?t=171)
+* Support for SMAF (http://smaf-yamaha.com/what/demo.html)
+  http://www.getid3.org/phpBB3/viewtopic.php?t=182
+* Support for AMR (http://www.getid3.org/phpBB3/viewtopic.php?t=195)
+* Support for 3gpp (http://www.getid3.org/phpBB3/viewtopic.php?t=195)
+* Support for ID4 (http://www.wackysoft.cjb.net grizlyY2K@hotmail*com)
+* Parse XML data returned in Ogg comments
+* Parse XML data from Quicktime SMIL metafiles (klausrath@mac*com)
+* ID3v2 genre string creator function
+* More complete parsing of JPG
+* Support for all old-style ASF packets
+* ASF/WMA/WMV tag writing
+* Parse declared T??? ID3v2 text information frames, where appropriate
+    (thanks Christian Fritz for the idea)
+* Recognize encoder:
+  http://www.guerillasoft.com/EncSpot2/index.html
+  http://ff123.net/identify.html
+  http://www.hydrogenaudio.org/?act=ST&f=16&t=9414
+  http://www.hydrogenaudio.org/?showtopic=11785
+* Support for other OS/2 bitmap structures: Bitmap Array('BA'),
+  Color Icon('CI'), Color Pointer('CP'), Icon('IC'), Pointer ('PT')
+  http://netghost.narod.ru/gff/graphics/summary/os2bmp.htm
+* Support for WavPack RAW mode
+* ASF/WMA/WMV data packet parsing
+* ID3v2FrameFlagsLookupTagAlter()
+* ID3v2FrameFlagsLookupFileAlter()
+* obey ID3v2 tag alter/preserve/discard rules
+* http://www.geocities.com/SiliconValley/Sector/9654/Softdoc/Illyrium/Aolyr.htm
+* proper checking for LINK/LNK frame validity in ID3v2 writing
+* proper checking for ASPI-TLEN frame validity in ID3v2 writing
+* proper checking for COMR frame validity in ID3v2 writing
+* http://www.geocities.co.jp/SiliconValley-Oakland/3664/index.html
+* decode GEOB ID3v2 structure as encoded by RealJukebox,
+  decode NCON ID3v2 structure as encoded by MusicMatch
+  (probably won't happen - the formats are proprietary)
+
+
+
+Known Bugs/Issues in getID3() that may be fixed eventually
+===========================================================================
+http://www.getid3.org/phpBB3/viewtopic.php?t=25
+
+* Cannot determine bitrate for MPEG video with VBR video data
+  (need documentation)
+* Interlace/progressive cannot be determined for MPEG video
+  (need documentation)
+* MIDI playtime is sometimes inaccurate
+* AAC-RAW mode files cannot be identified
+* WavPack-RAW mode files cannot be identified
+* mp4 files report lots of "Unknown QuickTime atom type"
+   (need documentation)
+* Encrypted ASF/WMA/WMV files warn about "unhandled GUID
+  ASF_Content_Encryption_Object"
+* Bitrate split between audio and video cannot be calculated for
+  NSV, only the total bitrate. (need documentation)
+* All Ogg formats (Vorbis, OggFLAC, Speex) are affected by the
+  problem of large VorbisComments spanning multiple Ogg pages, but
+  but only OggVorbis files can be processed with vorbiscomment.
+* The version of "head" supplied with Mac OS 10.2.8 (maybe other
+  versions too) does only understands a single option (-n) and
+  therefore fails. getID3 ignores this and returns wrong md5_data.
+
+
+
+Known Bugs/Issues in getID3() that cannot be fixed
+--------------------------------------------------
+http://www.getid3.org/phpBB3/viewtopic.php?t=25
+
+* 32-bit PHP installations only:
+  Files larger than 2GB cannot always be parsed fully by getID3()
+  due to limitations in the 32-bit PHP filesystem functions.
+  NOTE: Since v1.7.8b3 there is partial support for larger-than-
+  2GB files, most of which will parse OK, as long as no critical
+  data is located beyond the 2GB offset.
+  Known will-work:
+  * all file formats on 64-bit PHP
+  * ZIP  (format doesn't support files >2GB)
+  * FLAC (current encoders don't support files >2GB)
+  Known will-not-work:
+  * ID3v1 tags (always located at end-of-file)
+  * Lyrics3 tags (always located at end-of-file)
+  * APE tags (always located at end-of-file)
+  Maybe-will-work:
+  * Quicktime (will work if needed metadata is before 2GB offset,
+    that is if the file has been hinted/optimized for streaming)
+  * RIFF.WAV (should work fine, but gives warnings about not being
+    able to parse all chunks)
+  * RIFF.AVI (playtime will probably be wrong, is only based on
+    "movi" chunk that fits in the first 2GB, should issue error
+    to show that playtime is incorrect. Other data should be mostly
+    correct, assuming that data is constant throughout the file)
+
+
+
+Known Bugs/Issues in other programs
+-----------------------------------
+http://www.getid3.org/phpBB3/viewtopic.php?t=25
+
+* Windows Media Player (up to v11) and iTunes (up to v10+) do
+    not correctly handle ID3v2.3 tags with UTF-16BE+BOM
+    encoding (they assume the data is UTF-16LE+BOM and either
+    crash (WMP) or output Asian character set (iTunes)
+* Winamp (up to v2.80 at least) does not support ID3v2.4 tags,
+    only ID3v2.3
+    see: http://forums.winamp.com/showthread.php?postid=387524
+* Some versions of Helium2 (www.helium2.com) do not write
+    ID3v2.4-compliant Frame Sizes, even though the tag is marked
+    as ID3v2.4)  (detected by getID3())
+* MP3ext V3.3.17 places a non-compliant padding string at the end
+    of the ID3v2 header. This is supposedly fixed in v3.4b21 but
+    only if you manually add a registry key. This fix is not yet
+    confirmed.  (detected by getID3())
+* CDex v1.40 (fixed by v1.50b7) writes non-compliant Ogg comment
+    strings, supposed to be in the format "NAME=value" but actually
+    written just "value"  (detected by getID3())
+* Oggenc 0.9-rc3 flags the encoded file as ABR whether it's
+    actually ABR or VBR.
+* iTunes (versions "X v2.0.3", "v3.0.1" are known-guilty, probably
+    other versions are too) writes ID3v2.3 comment tags using a
+    frame name 'COM ' which is not valid for ID3v2.3+ (it's an
+    ID3v2.2-style frame name)  (detected by getID3())
+* MP2enc does not encode mono CBR MP2 files properly (half speed
+    sound and double playtime)
+* MP2enc does not encode mono VBR MP2 files properly (actually
+    encoded as stereo)
+* tooLAME does not encode mono VBR MP2 files properly (actually
+    encoded as stereo)
+* AACenc encodes files in VBR mode (actually ABR) even if CBR is
+   specified
+* AAC/ADIF - bitrate_mode = cbr for vbr files
+* LAME 3.90-3.92 prepends one frame of null data (space for the
+  LAME/VBR header, but it never gets written) when encoding in CBR
+  mode with the DLL
+* Ahead Nero encodes TwinVQF with a DSIZ value (which is supposed
+  to be the filesize in bytes) of "0" for TwinVQF v1.0 and "1" for
+  TwinVQF v2.0  (detected by getID3())
+* Ahead Nero encodes TwinVQF files 1 second shorter than they
+  should be
+* AAC-ADTS files are always actually encoded VBR, even if CBR mode
+  is specified (the CBR-mode switches on the encoder enable ABR
+  mode, not CBR as such, but it's not possible to tell the
+  difference between such ABR files and true VBR)
+* STREAMINFO.audio_signature in OggFLAC is always null. "The reason
+  it's like that is because there is no seeking support in
+  libOggFLAC yet, so it has no way to go back and write the
+  computed sum after encoding. Seeking support in Ogg FLAC is the
+  #1 item for the next release." - Josh Coalson (FLAC developer)
+  NOTE: getID3() will calculate md5_data in a method similar to
+  other file formats, but that value cannot be compared to the
+  md5_data value from FLAC data in a FLAC file format.
+* STREAMINFO.audio_signature is not calculated in FLAC v0.3.0 &
+  v0.4.0 - getID3() will calculate md5_data in a method similar to
+  other file formats, but that value cannot be compared to the
+  md5_data value from FLAC v0.5.0+
+* RioPort (various versions including 2.0 and 3.11) tags ID3v2 with
+  a WCOM frame that has no data portion
+* Earlier versions of Coolplayer adds illegal ID3 tags to Ogg Vorbis
+  files, thus making them corrupt.
+* Meracl ID3 Tag Writer v1.3.4 (and older) incorrectly truncates the
+  last byte of data from an MP3 file when appending a new ID3v1 tag.
+  (detected by getID3())
+* Lossless-Audio files encoded with and without the -noseek switch
+  do actually differ internally and therefore cannot match md5_data
+* iTunes has been known to append a new ID3v1 tag on the end of an
+  existing ID3v1 tag when ID3v2 tag is also present
+  (detected by getID3())
+* MediaMonkey may write a blank RGAD ID3v2 frame but put actual
+  replay gain adjustments in a series of user-defined TXXX frames
+  (detected and handled by getID3() since v1.9.2)
+
+
+
+
+Reference material:
+===========================================================================
+
+[www.id3.org material now mirrored at http://id3lib.sourceforge.net/id3/]
+* http://www.id3.org/id3v2.4.0-structure.txt
+* http://www.id3.org/id3v2.4.0-frames.txt
+* http://www.id3.org/id3v2.4.0-changes.txt
+* http://www.id3.org/id3v2.3.0.txt
+* http://www.id3.org/id3v2-00.txt
+* http://www.id3.org/mp3frame.html
+* http://minnie.tuhs.org/pipermail/mp3encoder/2001-January/001800.html <mathewhendry@hotmail.com>
+* http://www.dv.co.yu/mpgscript/mpeghdr.htm
+* http://www.mp3-tech.org/programmer/frame_header.html
+* http://users.belgacom.net/gc247244/extra/tag.html
+* http://gabriel.mp3-tech.org/mp3infotag.html
+* http://www.id3.org/iso4217.html
+* http://www.unicode.org/Public/MAPPINGS/ISO8859/8859-1.TXT
+* http://www.xiph.org/ogg/vorbis/doc/framing.html
+* http://www.xiph.org/ogg/vorbis/doc/v-comment.html
+* http://leknor.com/code/php/class.ogg.php.txt
+* http://www.id3.org/iso639-2.html
+* http://www.id3.org/lyrics3.html
+* http://www.id3.org/lyrics3200.html
+* http://www.psc.edu/general/software/packages/ieee/ieee.html
+* http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee-expl.html
+* http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html
+* http://www.jmcgowan.com/avi.html
+* http://www.wotsit.org/
+* http://www.herdsoft.com/ti/davincie/davp3xo2.htm
+* http://www.mathdogs.com/vorbis-illuminated/bitstream-appendix.html
+* "Standard MIDI File Format" by Dustin Caldwell (from www.wotsit.org)
+* http://midistudio.com/Help/GMSpecs_Patches.htm
+* http://www.xiph.org/archives/vorbis/200109/0459.html
+* http://www.replaygain.org/
+* http://www.lossless-audio.com/
+* http://download.microsoft.com/download/winmediatech40/Doc/1.0/WIN98MeXP/EN-US/ASF_Specification_v.1.0.exe
+* http://mediaxw.sourceforge.net/files/doc/Active%20Streaming%20Format%20(ASF)%201.0%20Specification.pdf
+* http://www.uni-jena.de/~pfk/mpp/sv8/ (archived at http://www.hydrogenaudio.org/musepack/klemm/www.personal.uni-jena.de/~pfk/mpp/sv8/)
+* http://jfaul.de/atl/
+* http://www.uni-jena.de/~pfk/mpp/ (archived at http://www.hydrogenaudio.org/musepack/klemm/www.personal.uni-jena.de/~pfk/mpp/)
+* http://www.libpng.org/pub/png/spec/png-1.2-pdg.html
+* http://www.real.com/devzone/library/creating/rmsdk/doc/rmff.htm
+* http://www.fastgraph.com/help/bmp_os2_header_format.html
+* http://netghost.narod.ru/gff/graphics/summary/os2bmp.htm
+* http://flac.sourceforge.net/format.html
+* http://www.research.att.com/projects/mpegaudio/mpeg2.html
+* http://www.audiocoding.com/wiki/index.php?page=AAC
+* http://libmpeg.org/mpeg4/doc/w2203tfs.pdf
+* http://www.geocities.com/xhelmboyx/quicktime/formats/qtm-layout.txt
+* http://developer.apple.com/techpubs/quicktime/qtdevdocs/RM/frameset.htm
+* http://www.nullsoft.com/nsv/
+* http://www.wotsit.org/download.asp?f=iso9660
+* http://sandbox.mc.edu/~bennet/cs110/tc/tctod.html
+* http://www.cdroller.com/htm/readdata.html
+* http://www.speex.org/manual/node10.html
+* http://www.harmony-central.com/Computer/Programming/aiff-file-format.doc
+* http://www.faqs.org/rfcs/rfc2361.html
+* http://ghido.shelter.ro/
+* http://www.ebu.ch/tech_t3285.pdf
+* http://www.sr.se/utveckling/tu/bwf
+* http://ftp.aessc.org/pub/aes46-2002.pdf
+* http://cartchunk.org:8080/
+* http://www.broadcastpapers.com/radio/cartchunk01.htm
+* http://www.hr/josip/DSP/AudioFile2.html
+* http://home.attbi.com/~chris.bagwell/AudioFormats-11.html
+* http://www.pure-mac.com/extkey.html
+* http://cesnet.dl.sourceforge.net/sourceforge/bonkenc/bonk-binary-format-0.9.txt
+* http://www.headbands.com/gspot/
+* http://www.openswf.org/spec/SWFfileformat.html
+* http://j-faul.virtualave.net/
+* http://www.btinternet.com/~AnthonyJ/Atari/programming/avr_format.html
+* http://cui.unige.ch/OSG/info/AudioFormats/ap11.html
+* http://sswf.sourceforge.net/SWFalexref.html
+* http://www.geocities.com/xhelmboyx/quicktime/formats/qti-layout.txt
+* http://www-lehre.informatik.uni-osnabrueck.de/~fbstark/diplom/docs/swf/Flash_Uncovered.htm
+* http://developer.apple.com/quicktime/icefloe/dispatch012.html
+* http://www.csdn.net/Dev/Format/graphics/PCD.htm
+* http://tta.iszf.irk.ru/
+* http://www.atsc.org/standards/a_52a.pdf
+* http://www.alanwood.net/unicode/
+* http://www.freelists.org/archives/matroska-devel/07-2003/msg00010.html
+* http://www.its.msstate.edu/net/real/reports/config/tags.stats
+* http://homepages.slingshot.co.nz/~helmboy/quicktime/formats/qtm-layout.txt
+* http://brennan.young.net/Comp/LiveStage/things.html
+* http://www.multiweb.cz/twoinches/MP3inside.htm
+* http://www.geocities.co.jp/SiliconValley-Oakland/3664/alittle.html#GenreExtended
+* http://www.mactech.com/articles/mactech/Vol.06/06.01/SANENormalized/
+* http://www.unicode.org/unicode/faq/utf_bom.html
+* http://tta.corecodec.org/?menu=format
+* http://www.scvi.net/nsvformat.htm
+* http://pda.etsi.org/pda/queryform.asp
+* http://cpansearch.perl.org/src/RGIBSON/Audio-DSS-0.02/lib/Audio/DSS.pm
+* http://trac.musepack.net/trac/wiki/SV8Specification
+* http://wyday.com/cuesharp/specification.php
+* http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Nikon.html
index 5d7367f64662bb4b6bd61e26e23d1a7188e53e41..1c1b618414fa00e13ca8ccb6703e2cb2b03f9eaa 100644 (file)
@@ -124,7 +124,7 @@ class SimplePie_Misc
                                                {
                                                        $attribs[$j][2] = $attribs[$j][1];
                                                }
-                                               $return[$i]['attribs'][strtolower($attribs[$j][1])]['data'] = SimplePie_Misc::entities_decode(end($attribs[$j]), 'UTF-8');
+                                               $return[$i]['attribs'][strtolower($attribs[$j][1])]['data'] = SimplePie_Misc::entities_decode(end($attribs[$j]));
                                        }
                                }
                        }
index 3ba7b4c7ea8336d6f660334a01d868a8c2f54b88..dc24b67f71c1de2c7278a3560fdbaa378fd789a4 100644 (file)
@@ -205,7 +205,7 @@ class Text_Diff {
      * @param string $line  The line to trim.
      * @param integer $key  The index of the line in the array. Not used.
      */
-    function trimNewlines(&$line, $key)
+    static function trimNewlines(&$line, $key)
     {
         $line = str_replace(array("\n", "\r"), '', $line);
     }
@@ -377,7 +377,7 @@ class Text_Diff_Op_copy extends Text_Diff_Op {
 
     function &reverse()
     {
-        $reverse = &new Text_Diff_Op_copy($this->final, $this->orig);
+        $reverse = new Text_Diff_Op_copy($this->final, $this->orig);
         return $reverse;
     }
 
@@ -399,7 +399,7 @@ class Text_Diff_Op_delete extends Text_Diff_Op {
 
     function &reverse()
     {
-        $reverse = &new Text_Diff_Op_add($this->orig);
+        $reverse = new Text_Diff_Op_add($this->orig);
         return $reverse;
     }
 
@@ -421,7 +421,7 @@ class Text_Diff_Op_add extends Text_Diff_Op {
 
     function &reverse()
     {
-        $reverse = &new Text_Diff_Op_delete($this->final);
+        $reverse = new Text_Diff_Op_delete($this->final);
         return $reverse;
     }
 
@@ -443,7 +443,7 @@ class Text_Diff_Op_change extends Text_Diff_Op {
 
     function &reverse()
     {
-        $reverse = &new Text_Diff_Op_change($this->final, $this->orig);
+        $reverse = new Text_Diff_Op_change($this->final, $this->orig);
         return $reverse;
     }
 
index 93eaef220d8695b21e747966af71eaae521a9821..e908cfeccaf8bd09cfff33ac7d37b267c0a53470 100644 (file)
@@ -104,7 +104,7 @@ class Text_Diff_Engine_native {
                 ++$yi;
             }
             if ($copy) {
-                $edits[] = &new Text_Diff_Op_copy($copy);
+                $edits[] = new Text_Diff_Op_copy($copy);
             }
 
             // Find deletes & adds.
@@ -119,11 +119,11 @@ class Text_Diff_Engine_native {
             }
 
             if ($delete && $add) {
-                $edits[] = &new Text_Diff_Op_change($delete, $add);
+                $edits[] = new Text_Diff_Op_change($delete, $add);
             } elseif ($delete) {
-                $edits[] = &new Text_Diff_Op_delete($delete);
+                $edits[] = new Text_Diff_Op_delete($delete);
             } elseif ($add) {
-                $edits[] = &new Text_Diff_Op_add($add);
+                $edits[] = new Text_Diff_Op_add($add);
             }
         }
 
index 59eb8adb45e740cf71b46c00409122f6c5a4d479..0f3b3745a52b88c7cf80b1c21b7201e3e05080d1 100644 (file)
@@ -99,7 +99,7 @@ class Text_Diff_Engine_string {
                 do {
                     $diff1[] = substr($diff[$i], 1);
                 } while (++$i < $end && substr($diff[$i], 0, 1) == ' ');
-                $edits[] = &new Text_Diff_Op_copy($diff1);
+                $edits[] = new Text_Diff_Op_copy($diff1);
                 break;
 
             case '+':
@@ -107,7 +107,7 @@ class Text_Diff_Engine_string {
                 do {
                     $diff1[] = substr($diff[$i], 1);
                 } while (++$i < $end && substr($diff[$i], 0, 1) == '+');
-                $edits[] = &new Text_Diff_Op_add($diff1);
+                $edits[] = new Text_Diff_Op_add($diff1);
                 break;
 
             case '-':
@@ -121,9 +121,9 @@ class Text_Diff_Engine_string {
                     $diff2[] = substr($diff[$i++], 1);
                 }
                 if (count($diff2) == 0) {
-                    $edits[] = &new Text_Diff_Op_delete($diff1);
+                    $edits[] = new Text_Diff_Op_delete($diff1);
                 } else {
-                    $edits[] = &new Text_Diff_Op_change($diff1, $diff2);
+                    $edits[] = new Text_Diff_Op_change($diff1, $diff2);
                 }
                 break;
 
@@ -189,7 +189,7 @@ class Text_Diff_Engine_string {
                 $array[] = substr($diff[$j++], 2);
             }
             if (count($array) > 0) {
-                $edits[] = &new Text_Diff_Op_copy($array);
+                $edits[] = new Text_Diff_Op_copy($array);
             }
 
             if ($i < $max_i) {
@@ -203,21 +203,21 @@ class Text_Diff_Engine_string {
                             $diff2[] = substr($diff[$j++], 2);
                         }
                     } while (++$i < $max_i && substr($diff[$i], 0, 1) == '!');
-                    $edits[] = &new Text_Diff_Op_change($diff1, $diff2);
+                    $edits[] = new Text_Diff_Op_change($diff1, $diff2);
                     break;
 
                 case '+':
                     do {
                         $diff1[] = substr($diff[$i], 2);
                     } while (++$i < $max_i && substr($diff[$i], 0, 1) == '+');
-                    $edits[] = &new Text_Diff_Op_add($diff1);
+                    $edits[] = new Text_Diff_Op_add($diff1);
                     break;
 
                 case '-':
                     do {
                         $diff1[] = substr($diff[$i], 2);
                     } while (++$i < $max_i && substr($diff[$i], 0, 1) == '-');
-                    $edits[] = &new Text_Diff_Op_delete($diff1);
+                    $edits[] = new Text_Diff_Op_delete($diff1);
                     break;
                 }
             }
@@ -229,14 +229,14 @@ class Text_Diff_Engine_string {
                     do {
                         $diff2[] = substr($diff[$j++], 2);
                     } while ($j < $max_j && substr($diff[$j], 0, 1) == '+');
-                    $edits[] = &new Text_Diff_Op_add($diff2);
+                    $edits[] = new Text_Diff_Op_add($diff2);
                     break;
 
                 case '-':
                     do {
                         $diff2[] = substr($diff[$j++], 2);
                     } while ($j < $max_j && substr($diff[$j], 0, 1) == '-');
-                    $edits[] = &new Text_Diff_Op_delete($diff2);
+                    $edits[] = new Text_Diff_Op_delete($diff2);
                     break;
                 }
             }
index b9f17360456f381d977128ca10fa718ed0a656e0..02ce848078e523325f52f252e8b172b768f78489 100644 (file)
@@ -45,15 +45,15 @@ class Text_Diff_Engine_xdiff {
             }
             switch ($line[0]) {
             case ' ':
-                $edits[] = &new Text_Diff_Op_copy(array(substr($line, 1)));
+                $edits[] = new Text_Diff_Op_copy(array(substr($line, 1)));
                 break;
 
             case '+':
-                $edits[] = &new Text_Diff_Op_add(array(substr($line, 1)));
+                $edits[] = new Text_Diff_Op_add(array(substr($line, 1)));
                 break;
 
             case '-':
-                $edits[] = &new Text_Diff_Op_delete(array(substr($line, 1)));
+                $edits[] = new Text_Diff_Op_delete(array(substr($line, 1)));
                 break;
             }
         }
index 922f4c09cc061b8e004e174681062bdb3e7072aa..95c6db4b897931c616775d320eca320468ceb3b8 100644 (file)
@@ -98,7 +98,7 @@ class Text_Diff_Renderer {
                             /* Create a new block with as many lines as we need
                              * for the trailing context. */
                             $context = array_slice($edit->orig, 0, $ntrail);
-                            $block[] = &new Text_Diff_Op_copy($context);
+                            $block[] = new Text_Diff_Op_copy($context);
                         }
                         /* @todo */
                         $output .= $this->_block($x0, $ntrail + $xi - $x0,
@@ -118,7 +118,7 @@ class Text_Diff_Renderer {
                     $y0 = $yi - count($context);
                     $block = array();
                     if ($context) {
-                        $block[] = &new Text_Diff_Op_copy($context);
+                        $block[] = new Text_Diff_Op_copy($context);
                     }
                 }
                 $block[] = $edit;
index 6af10214533942f0722cfcfa1323c38afba060de..756fc12609549967a68fab7ddc9b5834d2493181 100644 (file)
@@ -8,8 +8,8 @@
 /**
  * Instantiate the admin bar object and set it up as a global for access elsewhere.
  *
- * To hide the admin bar, you're looking in the wrong place. Unhooking this function will not
- * properly remove the admin bar. For that, use show_admin_bar(false) or the show_admin_bar filter.
+ * UNHOOKING THIS FUNCTION WILL NOT PROPERLY REMOVE THE ADMIN BAR.
+ * For that, use show_admin_bar(false) or the 'show_admin_bar' filter.
  *
  * @since 3.1.0
  * @access private
@@ -36,7 +36,9 @@ function _wp_admin_bar_init() {
 
        return true;
 }
-add_action( 'init', '_wp_admin_bar_init' ); // Don't remove. Wrong way to disable.
+// Don't remove. Wrong way to disable.
+add_action( 'template_redirect', '_wp_admin_bar_init', 0 );
+add_action( 'admin_init', '_wp_admin_bar_init' );
 
 /**
  * Render the admin bar to the page based on the $wp_admin_bar->menu member var.
@@ -174,8 +176,8 @@ function wp_admin_bar_my_account_menu( $wp_admin_bar ) {
        $user_info  = get_avatar( $user_id, 64 );
        $user_info .= "<span class='display-name'>{$current_user->display_name}</span>";
 
-       if ( $current_user->display_name !== $current_user->user_nicename )
-               $user_info .= "<span class='username'>{$current_user->user_nicename}</span>";
+       if ( $current_user->display_name !== $current_user->user_login )
+               $user_info .= "<span class='username'>{$current_user->user_login}</span>";
 
        $wp_admin_bar->add_menu( array(
                'parent' => 'user-actions',
@@ -227,9 +229,7 @@ function wp_admin_bar_site_menu( $wp_admin_bar ) {
                $blogname = sprintf( __('Global Dashboard: %s'), esc_html( $current_site->site_name ) );
        }
 
-       $title = wp_html_excerpt( $blogname, 40 );
-       if ( $title != $blogname )
-               $title = trim( $title ) . '&hellip;';
+       $title = wp_html_excerpt( $blogname, 40, '&hellip;' );
 
        $wp_admin_bar->add_menu( array(
                'id'    => 'site-name',
@@ -429,7 +429,7 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) {
                if ( 'post' == $current_screen->base
                        && 'add' != $current_screen->action
                        && ( $post_type_object = get_post_type_object( $post->post_type ) )
-                       && current_user_can( $post_type_object->cap->read_post, $post->ID )
+                       && current_user_can( 'read_post', $post->ID )
                        && ( $post_type_object->public )
                        && ( $post_type_object->show_in_admin_bar ) )
                {
@@ -457,7 +457,7 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) {
 
                if ( ! empty( $current_object->post_type )
                        && ( $post_type_object = get_post_type_object( $current_object->post_type ) )
-                       && current_user_can( $post_type_object->cap->edit_post, $current_object->ID )
+                       && current_user_can( 'edit_post', $current_object->ID )
                        && $post_type_object->show_ui && $post_type_object->show_in_admin_bar )
                {
                        $wp_admin_bar->add_menu( array(
index c6f2f24750d74ad578c58ca373dc7318f3e99e37..4dcddc99cb52ce4655e7d984e878e79a2fc79d5e 100644 (file)
@@ -131,8 +131,8 @@ class AtomParser {
 
             if(!xml_parse($parser, $data, feof($fp))) {
                 trigger_error(sprintf(__('XML error: %s at line %d')."\n",
-                    xml_error_string(xml_get_error_code($xml_parser)),
-                    xml_get_current_line_number($xml_parser)));
+                    xml_error_string(xml_get_error_code($parser)),
+                    xml_get_current_line_number($parser)));
                 $ret = false;
                 break;
             }
index 1e65baa1e65b7ca40c09cd5587499a1b37486096..2a89498968385f727269d4681395cb2b424bc794 100644 (file)
@@ -134,7 +134,7 @@ function the_author_meta($field = '', $user_id = false) {
  */
 function get_the_author_link() {
        if ( get_the_author_meta('url') ) {
-               return '<a href="' . get_the_author_meta('url') . '" title="' . esc_attr( sprintf(__("Visit %s&#8217;s website"), get_the_author()) ) . '" rel="author external">' . get_the_author() . '</a>';
+               return '<a href="' . esc_url( get_the_author_meta('url') ) . '" title="' . esc_attr( sprintf(__("Visit %s&#8217;s website"), get_the_author()) ) . '" rel="author external">' . get_the_author() . '</a>';
        } else {
                return get_the_author();
        }
@@ -200,7 +200,7 @@ function the_author_posts_link($deprecated = '') {
                return false;
        $link = sprintf(
                '<a href="%1$s" title="%2$s" rel="author">%3$s</a>',
-               get_author_posts_url( $authordata->ID, $authordata->user_nicename ),
+               esc_url( get_author_posts_url( $authordata->ID, $authordata->user_nicename ) ),
                esc_attr( sprintf( __( 'Posts by %s' ), get_the_author() ) ),
                get_the_author()
        );
@@ -244,7 +244,7 @@ function get_author_posts_url($author_id, $author_nicename = '') {
  * <li>optioncount (boolean) (false): Show the count in parenthesis next to the
  * author's name.</li>
  * <li>exclude_admin (boolean) (true): Exclude the 'admin' user that is
- * installed bydefault.</li>
+ * installed by default.</li>
  * <li>show_fullname (boolean) (false): Show their full names.</li>
  * <li>hide_empty (boolean) (true): Don't show authors without any posts.</li>
  * <li>feed (string) (''): If isn't empty, show links to author's feeds.</li>
@@ -372,10 +372,10 @@ function wp_list_authors($args = '') {
 function is_multi_author() {
        global $wpdb;
 
-       if ( false === ( $is_multi_author = wp_cache_get('is_multi_author', 'posts') ) ) {
+       if ( false === ( $is_multi_author = get_transient( 'is_multi_author' ) ) ) {
                $rows = (array) $wpdb->get_col("SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_type = 'post' AND post_status = 'publish' LIMIT 2");
                $is_multi_author = 1 < count( $rows ) ? 1 : 0;
-               wp_cache_set('is_multi_author', $is_multi_author, 'posts');
+               set_transient( 'is_multi_author', $is_multi_author );
        }
 
        return apply_filters( 'is_multi_author', (bool) $is_multi_author );
@@ -387,6 +387,6 @@ function is_multi_author() {
  * @private
  */
 function __clear_multi_author_cache() {
-       wp_cache_delete('is_multi_author', 'posts');
+       delete_transient( 'is_multi_author' );
 }
 add_action('transition_post_status', '__clear_multi_author_cache');
index ab4b8c8c6b4dcd5ff445997c208d000ab74524d9..9a3ac6107c2526e304c9f42c8279d057733c8341 100644 (file)
@@ -186,7 +186,7 @@ function get_bookmarks($args = '') {
        }
 
        if ( ! empty($search) ) {
-               $search = like_escape($search);
+               $search = esc_sql( like_escape( $search ) );
                $search = " AND ( (link_url LIKE '%$search%') OR (link_name LIKE '%$search%') OR (link_description LIKE '%$search%') ) ";
        }
 
index 933c7b2ec1af9ddb05ade3dfb3ba490f8ddd27d4..af1c2adac9555083bf6cf42c4b03fb4a4ae8755b 100644 (file)
@@ -19,7 +19,7 @@
  * @param mixed $data The data to add to the cache store
  * @param string $group The group to add the cache to
  * @param int $expire When the cache data should be expired
- * @return unknown
+ * @return bool False if cache key and group already exist, true on success
  */
 function wp_cache_add($key, $data, $group = '', $expire = 0) {
        global $wp_object_cache;
@@ -85,7 +85,7 @@ function wp_cache_delete($key, $group = '') {
  * @uses $wp_object_cache Object Cache Class
  * @see WP_Object_Cache::flush()
  *
- * @return bool Always returns true
+ * @return bool False on failure, true on success
  */
 function wp_cache_flush() {
        global $wp_object_cache;
@@ -152,7 +152,7 @@ function wp_cache_init() {
  * @param mixed $data The contents to store in the cache
  * @param string $group Where to group the cache contents
  * @param int $expire When to expire the cache contents
- * @return bool False if cache key and group already exist, true on success
+ * @return bool False if not exists, true if contents were replaced
  */
 function wp_cache_replace($key, $data, $group = '', $expire = 0) {
        global $wp_object_cache;
@@ -171,7 +171,7 @@ function wp_cache_replace($key, $data, $group = '', $expire = 0) {
  * @param mixed $data The contents to store in the cache
  * @param string $group Where to group the cache contents
  * @param int $expire When to expire the cache contents
- * @return bool False if cache key and group already exist, true on success
+ * @return bool False on failure, true on success
  */
 function wp_cache_set($key, $data, $group = '', $expire = 0) {
        global $wp_object_cache;
index 7cd12564f73e3e954b600161cf62e7dcc1007d28..423dcc6366df2efe99c09443709942e5be2c53cd 100644 (file)
@@ -18,7 +18,7 @@
  * one or the other.
  *
  * Prevents redirection for feeds, trackbacks, searches, comment popup, and
- * admin URLs. Does not redirect on non-pretty-permalink-supporting IIS 7,
+ * admin URLs. Does not redirect on non-pretty-permalink-supporting IIS 7+,
  * page/post previews, WP admin, Trackbacks, robots.txt, searches, or on POST
  * requests.
  *
@@ -272,9 +272,9 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
                                $redirect['query'] = remove_query_arg( 'cpage', $redirect['query'] );
                        }
 
-                       $redirect['path'] = user_trailingslashit( preg_replace('|/index.php/?$|', '/', $redirect['path']) ); // strip off trailing /index.php/
-                       if ( !empty( $addl_path ) && $wp_rewrite->using_index_permalinks() && strpos($redirect['path'], '/index.php/') === false )
-                               $redirect['path'] = trailingslashit($redirect['path']) . 'index.php/';
+                       $redirect['path'] = user_trailingslashit( preg_replace('|/' . preg_quote( $wp_rewrite->index, '|' ) . '/?$|', '/', $redirect['path']) ); // strip off trailing /index.php/
+                       if ( !empty( $addl_path ) && $wp_rewrite->using_index_permalinks() && strpos($redirect['path'], '/' . $wp_rewrite->index . '/') === false )
+                               $redirect['path'] = trailingslashit($redirect['path']) . $wp_rewrite->index . '/';
                        if ( !empty( $addl_path ) )
                                $redirect['path'] = trailingslashit($redirect['path']) . $addl_path;
                        $redirect_url = $redirect['scheme'] . '://' . $redirect['host'] . $redirect['path'];
@@ -324,7 +324,7 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
                unset($redirect['port']);
 
        // trailing /index.php
-       $redirect['path'] = preg_replace('|/index.php/*?$|', '/', $redirect['path']);
+       $redirect['path'] = preg_replace('|/' . preg_quote( $wp_rewrite->index, '|' ) . '/*?$|', '/', $redirect['path']);
 
        // Remove trailing spaces from the path
        $redirect['path'] = preg_replace( '#(%20| )+$#', '', $redirect['path'] );
@@ -337,7 +337,7 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
                $redirect['query'] = trim(preg_replace( '#(^|&)(p|page_id|cat|tag)=?(&|$)#', '&', $redirect['query']), '&');
 
                // Redirect obsolete feeds
-               $redirect['query'] = preg_replace( '#(^|&)feed=rss(&|$)#', '$1feed=rss2$3', $redirect['query'] );
+               $redirect['query'] = preg_replace( '#(^|&)feed=rss(&|$)#', '$1feed=rss2$2', $redirect['query'] );
 
                // Remove redundant leading ampersands
                $redirect['query'] = preg_replace( '#^\??&*?#', '', $redirect['query'] );
@@ -345,7 +345,7 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
 
        // strip /index.php/ when we're not using PATHINFO permalinks
        if ( !$wp_rewrite->using_index_permalinks() )
-               $redirect['path'] = str_replace('/index.php/', '/', $redirect['path']);
+               $redirect['path'] = str_replace( '/' . $wp_rewrite->index . '/', '/', $redirect['path'] );
 
        // trailing slashes
        if ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() && !is_404() && (!is_front_page() || ( is_front_page() && (get_query_var('paged') > 1) ) ) ) {
index 3503316ccfe5aad3bff752d3d4d897bdba6d022d..c3bb58f627a7895a16711012b9ca013868835b9b 100644 (file)
@@ -158,7 +158,7 @@ class WP_Roles {
         * @param string $role Role name.
         * @param string $display_name Role display name.
         * @param array $capabilities List of role capabilities in the above format.
-        * @return null|WP_Role WP_Role object if role is added, null if already exists.
+        * @return WP_Role|null WP_Role object if role is added, null if already exists.
         */
        function add_role( $role, $display_name, $capabilities = array() ) {
                if ( isset( $this->roles[$role] ) )
@@ -239,7 +239,7 @@ class WP_Roles {
         * @access public
         *
         * @param string $role Role name.
-        * @return object|null Null, if role does not exist. WP_Role object, if found.
+        * @return WP_Role|null WP_Role object if found, null if the role does not exist.
         */
        function get_role( $role ) {
                if ( isset( $this->role_objects[$role] ) )
@@ -535,7 +535,9 @@ class WP_User {
                        // to int 1.
                        if ( ! is_numeric( $value ) )
                                return false;
-                       $value = absint( $value );
+                       $value = intval( $value );
+                       if ( $value < 1 )
+                               return false;
                } else {
                        $value = trim( $value );
                }
@@ -803,6 +805,7 @@ class WP_User {
                foreach ( (array) $this->roles as $oldrole )
                        unset( $this->caps[$oldrole] );
 
+               $old_roles = $this->roles;
                if ( !empty( $role ) ) {
                        $this->caps[$role] = true;
                        $this->roles = array( $role => true );
@@ -812,7 +815,7 @@ class WP_User {
                update_user_meta( $this->ID, $this->cap_key, $this->caps );
                $this->get_role_caps();
                $this->update_user_level_from_caps();
-               do_action( 'set_user_role', $this->ID, $role );
+               do_action( 'set_user_role', $this->ID, $role, $old_roles );
        }
 
        /**
@@ -1159,8 +1162,7 @@ function map_meta_cap( $cap, $user_id ) {
        case 'delete_post_meta':
        case 'add_post_meta':
                $post = get_post( $args[0] );
-               $post_type_object = get_post_type_object( $post->post_type );
-               $caps = map_meta_cap( $post_type_object->cap->edit_post, $user_id, $post->ID );
+               $caps = map_meta_cap( 'edit_post', $user_id, $post->ID );
 
                $meta_key = isset( $args[ 1 ] ) ? $args[ 1 ] : false;
 
@@ -1175,9 +1177,7 @@ function map_meta_cap( $cap, $user_id ) {
        case 'edit_comment':
                $comment = get_comment( $args[0] );
                $post = get_post( $comment->comment_post_ID );
-               $post_type_object = get_post_type_object( $post->post_type );
-
-               $caps = map_meta_cap( $post_type_object->cap->edit_post, $user_id, $post->ID );
+               $caps = map_meta_cap( 'edit_post', $user_id, $post->ID );
                break;
        case 'unfiltered_upload':
                if ( defined('ALLOW_UNFILTERED_UPLOADS') && ALLOW_UNFILTERED_UPLOADS && ( !is_multisite() || is_super_admin( $user_id ) )  )
@@ -1371,7 +1371,7 @@ function user_can( $user, $capability ) {
  * @since 2.0.0
  *
  * @param string $role Role name.
- * @return object
+ * @return WP_Role|null WP_Role object if found, null if the role does not exist.
  */
 function get_role( $role ) {
        global $wp_roles;
@@ -1391,7 +1391,7 @@ function get_role( $role ) {
  * @param string $role Role name.
  * @param string $display_name Display name for role.
  * @param array $capabilities List of capabilities, e.g. array( 'edit_posts' => true, 'delete_posts' => false );
- * @return null|WP_Role WP_Role object if role is added, null if already exists.
+ * @return WP_Role|null WP_Role object if role is added, null if already exists.
  */
 function add_role( $role, $display_name, $capabilities = array() ) {
        global $wp_roles;
index e45734abbbaf334f9bf4110af88325df3f09a333..96a61cf35ecf1b90b9d93d5304dc9986457d019d 100644 (file)
@@ -37,7 +37,7 @@ function get_category_link( $category ) {
  * @param string $separator Optional, default is '/'. How to separate categories.
  * @param bool $nicename Optional, default is false. Whether to use nice name for display.
  * @param array $visited Optional. Already linked to categories to prevent duplicates.
- * @return string
+ * @return string|WP_Error A list of category parents on success, WP_Error on failure.
  */
 function get_category_parents( $id, $link = false, $separator = '/', $nicename = false, $visited = array() ) {
        $chain = '';
@@ -131,7 +131,7 @@ function _usort_terms_by_ID( $a, $b ) {
  * @since 0.71
  *
  * @param int $cat_ID Category ID.
- * @return string Category name.
+ * @return string|WP_Error Category name on success, WP_Error on failure.
  */
 function get_the_category_by_ID( $cat_ID ) {
        $cat_ID = (int) $cat_ID;
@@ -671,7 +671,7 @@ function wp_generate_tag_cloud( $tags, $args = '' ) {
                $tag_link = '#' != $tag->link ? esc_url( $tag->link ) : '#';
                $tag_id = isset($tags[ $key ]->id) ? $tags[ $key ]->id : $key;
                $tag_name = $tags[ $key ]->name;
-               $a[] = "<a href='$tag_link' class='tag-link-$tag_id' title='" . esc_attr( call_user_func( $topic_count_text_callback, $real_count ) ) . "' style='font-size: " .
+               $a[] = "<a href='$tag_link' class='tag-link-$tag_id' title='" . esc_attr( call_user_func( $topic_count_text_callback, $real_count, $tag, $args ) ) . "' style='font-size: " .
                        str_replace( ',', '.', ( $smallest + ( ( $count - $min_count ) * $font_step ) ) )
                        . "$unit;'>$tag_name</a>";
        }
@@ -933,7 +933,7 @@ class Walker_CategoryDropdown extends Walker {
         * @param int $depth Depth of category. Used for padding.
         * @param array $args Uses 'selected' and 'show_count' keys, if they exist.
         */
-       function start_el( &$output, $category, $depth, $args, $id = 0 ) {
+       function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) {
                $pad = str_repeat('&nbsp;', $depth * 3);
 
                $cat_name = apply_filters('list_cats', $category->name, $category);
@@ -980,7 +980,7 @@ function get_tag_link( $tag ) {
  * @uses apply_filters() Calls 'get_the_tags' filter on the list of post tags.
  *
  * @param int $id Post ID.
- * @return array
+ * @return array|bool Array of tag objects on success, false on failure.
  */
 function get_the_tags( $id = 0 ) {
        return apply_filters( 'get_the_tags', get_the_terms( $id, 'post_tag' ) );
@@ -996,7 +996,7 @@ function get_the_tags( $id = 0 ) {
  * @param string $sep Optional. Between tags.
  * @param string $after Optional. After tags.
  * @param int $id Optional. Post ID. Defaults to the current post.
- * @return string
+ * @return string|bool|WP_Error A list of tags on success, false or WP_Error on failure.
  */
 function get_the_tag_list( $before = '', $sep = '', $after = '', $id = 0 ) {
        return apply_filters( 'the_tags', get_the_term_list( $id, 'post_tag', $before, $sep, $after ), $before, $sep, $after, $id );
@@ -1010,7 +1010,6 @@ function get_the_tag_list( $before = '', $sep = '', $after = '', $id = 0 ) {
  * @param string $before Optional. Before list.
  * @param string $sep Optional. Separate items using this.
  * @param string $after Optional. After list.
- * @return string
  */
 function the_tags( $before = null, $sep = ', ', $after = '' ) {
        if ( null === $before )
@@ -1054,9 +1053,9 @@ function term_description( $term = 0, $taxonomy = 'post_tag' ) {
  *
  * @since 2.5.0
  *
- * @param mixed $post Post ID or object.
+ * @param int|object $post Post ID or object.
  * @param string $taxonomy Taxonomy name.
- * @return array|bool False on failure. Array of term objects on success.
+ * @return array|bool|WP_Error Array of term objects on success, false or WP_Error on failure.
  */
 function get_the_terms( $post, $taxonomy ) {
        if ( ! $post = get_post( $post ) )
@@ -1086,7 +1085,7 @@ function get_the_terms( $post, $taxonomy ) {
  * @param string $before Optional. Before list.
  * @param string $sep Optional. Separate items using this.
  * @param string $after Optional. After list.
- * @return string
+ * @return string|bool|WP_Error A list of terms on success, false or WP_Error on failure.
  */
 function get_the_term_list( $id, $taxonomy, $before = '', $sep = '', $after = '' ) {
        $terms = get_the_terms( $id, $taxonomy );
index 491d775e144491eaf2e7156e65fd39cc79f83643..bdad84db6cba40bb4079ddd0c46c30a14c1f60de 100644 (file)
@@ -69,7 +69,6 @@ class WP_SimplePie_File extends SimplePie_File {
                        $args = array(
                                'timeout' => $this->timeout,
                                'redirection' => $this->redirects,
-                               'reject_unsafe_urls' => true,
                        );
 
                        if ( !empty($this->headers) )
@@ -78,7 +77,7 @@ class WP_SimplePie_File extends SimplePie_File {
                        if ( SIMPLEPIE_USERAGENT != $this->useragent ) //Use default WP user agent unless custom has been specified
                                $args['user-agent'] = $this->useragent;
 
-                       $res = wp_remote_request($url, $args);
+                       $res = wp_safe_remote_request($url, $args);
 
                        if ( is_wp_error($res) ) {
                                $this->error = 'WP HTTP Error: ' . $res->get_error_message();
index 0358932ac877b25bdc875ca1f756e11a58a83d14..b824285dabd3a1c70f5b155a66e80d5d48ae84ef 100644 (file)
@@ -96,7 +96,8 @@ class WP_Http {
                        'decompress' => true,
                        'sslverify' => true,
                        'stream' => false,
-                       'filename' => null
+                       'filename' => null,
+                       'limit_response_size' => null,
                );
 
                // Pre-parse for the HEAD checks.
@@ -118,10 +119,11 @@ class WP_Http {
                if ( false !== $pre )
                        return $pre;
 
-               if ( $r['reject_unsafe_urls'] )
-                       $url = wp_http_validate_url( $url );
-               if ( function_exists( 'wp_kses_bad_protocol' ) )
+               if ( function_exists( 'wp_kses_bad_protocol' ) ) {
+                       if ( $r['reject_unsafe_urls'] )
+                               $url = wp_http_validate_url( $url );
                        $url = wp_kses_bad_protocol( $url, array( 'http', 'https', 'ssl' ) );
+               }
 
                $arrURL = @parse_url( $url );
 
@@ -141,14 +143,14 @@ class WP_Http {
                unset( $homeURL );
 
                // If we are streaming to a file but no filename was given drop it in the WP temp dir
-               // and pick it's name using the basename of the $url
+               // and pick its name using the basename of the $url
                if ( $r['stream']  && empty( $r['filename'] ) )
                        $r['filename'] = get_temp_dir() . basename( $url );
 
                // Force some settings if we are streaming to a file and check for existence and perms of destination directory
                if ( $r['stream'] ) {
                        $r['blocking'] = true;
-                       if ( ! call_user_func( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) ? 'win_is_writable' : 'is_writable', dirname( $r['filename'] ) ) )
+                       if ( ! wp_is_writable( dirname( $r['filename'] ) ) )
                                return new WP_Error( 'http_request_failed', __( 'Destination directory for file streaming does not exist or is not writable.' ) );
                }
 
@@ -173,8 +175,10 @@ class WP_Http {
                // Construct Cookie: header if any cookies are set
                WP_Http::buildCookieHeader( $r );
 
-               if ( WP_Http_Encoding::is_available() )
-                       $r['headers']['Accept-Encoding'] = WP_Http_Encoding::accept_encoding();
+               if ( ! isset( $r['headers']['Accept-Encoding'] ) ) {
+                       if ( $encoding = WP_Http_Encoding::accept_encoding( $url, $r ) )
+                               $r['headers']['Accept-Encoding'] = $encoding;
+               }
 
                if ( ( ! is_null( $r['body'] ) && '' != $r['body'] ) || 'POST' == $r['method'] || 'PUT' == $r['method'] ) {
                        if ( is_array( $r['body'] ) || is_object( $r['body'] ) ) {
@@ -328,7 +332,7 @@ class WP_Http {
         * @param string $strResponse The full response string
         * @return array Array with 'headers' and 'body' keys.
         */
-       function processResponse($strResponse) {
+       public static function processResponse($strResponse) {
                $res = explode("\r\n\r\n", $strResponse, 2);
 
                return array('headers' => $res[0], 'body' => isset($res[1]) ? $res[1] : '');
@@ -537,7 +541,7 @@ class WP_Http {
                if ( !empty($wildcard_regex) )
                        return !preg_match($wildcard_regex, $check['host']);
                else
-                       return !in_array( $check['host'], $accessible_hosts ); //Inverse logic, If its in the array, then we can't access it.
+                       return !in_array( $check['host'], $accessible_hosts ); //Inverse logic, If it's in the array, then we can't access it.
 
        }
 
@@ -562,7 +566,7 @@ class WP_Http {
                // Start off with the Absolute URL path
                $path = ! empty( $url_parts['path'] ) ? $url_parts['path'] : '/';
 
-               // If the it's a root-relative path, then great
+               // If it's a root-relative path, then great
                if ( ! empty( $relative_url_parts['path'] ) && '/' == $relative_url_parts['path'][0] ) {
                        $path = $relative_url_parts['path'];
 
@@ -738,6 +742,10 @@ class WP_Http_Fsockopen {
 
                $strResponse = '';
                $bodyStarted = false;
+               $keep_reading = true;
+               $block_size = 4096;
+               if ( isset( $r['limit_response_size'] ) )
+                       $block_size = min( $block_size, $r['limit_response_size'] );
 
                // If streaming to a file setup the file handle
                if ( $r['stream'] ) {
@@ -748,30 +756,45 @@ class WP_Http_Fsockopen {
                        if ( ! $stream_handle )
                                return new WP_Error( 'http_request_failed', sprintf( __( 'Could not open handle for fopen() to %s' ), $r['filename'] ) );
 
-                       while ( ! feof($handle) ) {
-                               $block = fread( $handle, 4096 );
-                               if ( $bodyStarted ) {
-                                       fwrite( $stream_handle, $block );
-                               } else {
+                       $bytes_written = 0;
+                       while ( ! feof($handle) && $keep_reading ) {
+                               $block = fread( $handle, $block_size );
+                               if ( ! $bodyStarted ) {
                                        $strResponse .= $block;
                                        if ( strpos( $strResponse, "\r\n\r\n" ) ) {
                                                $process = WP_Http::processResponse( $strResponse );
                                                $bodyStarted = true;
-                                               fwrite( $stream_handle, $process['body'] );
+                                               $block = $process['body'];
                                                unset( $strResponse );
                                                $process['body'] = '';
                                        }
                                }
+
+                               if ( isset( $r['limit_response_size'] ) && ( $bytes_written + strlen( $block ) ) > $r['limit_response_size'] )
+                                       $block = substr( $block, 0, ( $r['limit_response_size'] - $bytes_written ) );
+
+                               $bytes_written += fwrite( $stream_handle, $block );
+
+                               $keep_reading = !isset( $r['limit_response_size'] ) || $bytes_written < $r['limit_response_size'];
                        }
 
                        fclose( $stream_handle );
 
                } else {
-                       while ( ! feof($handle) )
-                               $strResponse .= fread( $handle, 4096 );
+                       $header_length = 0;
+                       while ( ! feof( $handle ) && $keep_reading ) {
+                               $block = fread( $handle, $block_size );
+                               $strResponse .= $block;
+                               if ( ! $bodyStarted && strpos( $strResponse, "\r\n\r\n" ) ) {
+                                       $header_length = strpos( $strResponse, "\r\n\r\n" ) + 4;
+                                       $bodyStarted = true;
+                               }
+                               $keep_reading = ( ! $bodyStarted || !isset( $r['limit_response_size'] ) || strlen( $strResponse ) < ( $header_length + $r['limit_response_size'] ) );
+                       }
 
                        $process = WP_Http::processResponse( $strResponse );
                        unset( $strResponse );
+
                }
 
                fclose( $handle );
@@ -797,6 +820,9 @@ class WP_Http_Fsockopen {
                if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode($arrHeaders['headers']) )
                        $process['body'] = WP_Http_Encoding::decompress( $process['body'] );
 
+               if ( isset( $r['limit_response_size'] ) && strlen( $process['body'] ) > $r['limit_response_size'] )
+                       $process['body'] = substr( $process['body'], 0, $r['limit_response_size'] );
+
                return array( 'headers' => $arrHeaders['headers'], 'body' => $process['body'], 'response' => $arrHeaders['response'], 'cookies' => $arrHeaders['cookies'], 'filename' => $r['filename'] );
        }
 
@@ -941,6 +967,7 @@ class WP_Http_Streams {
                        return array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() );
                }
 
+               $max_bytes = isset( $r['limit_response_size'] ) ? intval( $r['limit_response_size'] ) : -1;
                if ( $r['stream'] ) {
                        if ( ! WP_DEBUG )
                                $stream_handle = @fopen( $r['filename'], 'w+' );
@@ -950,12 +977,12 @@ class WP_Http_Streams {
                        if ( ! $stream_handle )
                                return new WP_Error( 'http_request_failed', sprintf( __( 'Could not open handle for fopen() to %s' ), $r['filename'] ) );
 
-                       stream_copy_to_stream( $handle, $stream_handle );
+                       stream_copy_to_stream( $handle, $stream_handle, $max_bytes );
 
                        fclose( $stream_handle );
                        $strResponse = '';
                } else {
-                       $strResponse = stream_get_contents( $handle );
+                       $strResponse = stream_get_contents( $handle, $max_bytes );
                }
 
                $meta = stream_get_meta_data( $handle );
@@ -1022,7 +1049,7 @@ class WP_Http_Streams {
 class WP_Http_Curl {
 
        /**
-        * Temporary header storage for use with streaming to a file.
+        * Temporary header storage for during requests.
         *
         * @since 3.2.0
         * @access private
@@ -1030,6 +1057,33 @@ class WP_Http_Curl {
         */
        private $headers = '';
 
+       /**
+        * Temporary body storage for during requests.
+        *
+        * @since 3.6.0
+        * @access private
+        * @var string
+        */
+       private $body = '';
+
+       /**
+        * The maximum amount of data to recieve from the remote server
+        *
+        * @since 3.6.0
+        * @access private
+        * @var int
+        */
+       private $max_body_length = false;
+
+       /**
+        * The file resource used for streaming to file.
+        *
+        * @since 3.6.0
+        * @access private
+        * @var resource
+        */
+       private $stream_handle = false;
+
        /**
         * Send a HTTP request to a URI using cURL extension.
         *
@@ -1121,20 +1175,28 @@ class WP_Http_Curl {
                                break;
                }
 
-               if ( true === $r['blocking'] )
+               if ( true === $r['blocking'] ) {
                        curl_setopt( $handle, CURLOPT_HEADERFUNCTION, array( $this, 'stream_headers' ) );
+                       curl_setopt( $handle, CURLOPT_WRITEFUNCTION, array( $this, 'stream_body' ) );
+               }
 
                curl_setopt( $handle, CURLOPT_HEADER, false );
 
+               if ( isset( $r['limit_response_size'] ) )
+                       $this->max_body_length = intval( $r['limit_response_size'] );
+               else
+                       $this->max_body_length = false;
+
                // If streaming to a file open a file handle, and setup our curl streaming handler
                if ( $r['stream'] ) {
                        if ( ! WP_DEBUG )
-                               $stream_handle = @fopen( $r['filename'], 'w+' );
+                               $this->stream_handle = @fopen( $r['filename'], 'w+' );
                        else
-                               $stream_handle = fopen( $r['filename'], 'w+' );
-                       if ( ! $stream_handle )
+                               $this->stream_handle = fopen( $r['filename'], 'w+' );
+                       if ( ! $this->stream_handle )
                                return new WP_Error( 'http_request_failed', sprintf( __( 'Could not open handle for fopen() to %s' ), $r['filename'] ) );
-                       curl_setopt( $handle, CURLOPT_FILE, $stream_handle );
+               } else {
+                       $this->stream_handle = false;
                }
 
                if ( !empty( $r['headers'] ) ) {
@@ -1158,27 +1220,39 @@ class WP_Http_Curl {
                // We don't need to return the body, so don't. Just execute request and return.
                if ( ! $r['blocking'] ) {
                        curl_exec( $handle );
+
+                       if ( $curl_error = curl_error( $handle ) ) {
+                               curl_close( $handle );
+                               return new WP_Error( 'http_request_failed', $curl_error );
+                       }
+                       if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ) ) ) {
+                               curl_close( $handle );
+                               return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) );
+                       }
+
                        curl_close( $handle );
                        return array( 'headers' => array(), 'body' => '', 'response' => array('code' => false, 'message' => false), 'cookies' => array() );
                }
 
                $theResponse = curl_exec( $handle );
-               $theBody = '';
                $theHeaders = WP_Http::processHeaders( $this->headers );
+               $theBody = $this->body;
 
-               if ( strlen($theResponse) > 0 && ! is_bool( $theResponse ) ) // is_bool: when using $args['stream'], curl_exec will return (bool)true
-                       $theBody = $theResponse;
+               $this->headers = '';
+               $this->body = '';
 
                // If no response
-               if ( 0 == strlen( $theResponse ) && empty( $theHeaders['headers'] ) ) {
-                       if ( $curl_error = curl_error( $handle ) )
+               if ( 0 == strlen( $theBody ) && empty( $theHeaders['headers'] ) ) {
+                       if ( $curl_error = curl_error( $handle ) ) {
+                               curl_close( $handle );
                                return new WP_Error( 'http_request_failed', $curl_error );
-                       if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ) ) )
+                       }
+                       if ( in_array( curl_getinfo( $handle, CURLINFO_HTTP_CODE ), array( 301, 302 ) ) ) {
+                               curl_close( $handle );
                                return new WP_Error( 'http_request_failed', __( 'Too many redirects.' ) );
+                       }
                }
 
-               $this->headers = '';
-
                $response = array();
                $response['code'] = curl_getinfo( $handle, CURLINFO_HTTP_CODE );
                $response['message'] = get_status_header_desc($response['code']);
@@ -1186,7 +1260,7 @@ class WP_Http_Curl {
                curl_close( $handle );
 
                if ( $r['stream'] )
-                       fclose( $stream_handle );
+                       fclose( $this->stream_handle );
 
                // See #11305 - When running under safe mode, redirection is disabled above. Handle it manually.
                if ( ! empty( $theHeaders['headers']['location'] ) && 0 !== $r['_redirection'] ) { // _redirection: The requested number of redirections
@@ -1217,6 +1291,28 @@ class WP_Http_Curl {
                return strlen( $headers );
        }
 
+       /**
+        * Grab the body of the cURL request
+        *
+        * The contents of the document are passed in chunks, so we append to the $body property for temporary storage.
+        * Returning a length shorter than the length of $data passed in will cause cURL to abort the request as "completed"
+        *
+        * @since 3.6.0
+        * @access private
+        * @return int
+        */
+       private function stream_body( $handle, $data ) {
+               if ( $this->max_body_length && ( strlen( $this->body ) + strlen( $data ) ) > $this->max_body_length )
+                       $data = substr( $data, 0, ( $this->max_body_length - strlen( $this->body ) ) );
+
+               if ( $this->stream_handle )
+                       fwrite( $this->stream_handle, $data );
+               else
+                       $this->body .= $data;
+
+               return strlen( $data );
+       }
+
        /**
         * Whether this class can be used for retrieving an URL.
         *
@@ -1743,16 +1839,29 @@ class WP_Http_Encoding {
         *
         * @return string Types of encoding to accept.
         */
-       public static function accept_encoding() {
+       public static function accept_encoding( $url, $args ) {
                $type = array();
-               if ( function_exists( 'gzinflate' ) )
-                       $type[] = 'deflate;q=1.0';
+               $compression_enabled = WP_Http_Encoding::is_available();
+
+               if ( ! $args['decompress'] ) // decompression specifically disabled
+                       $compression_enabled = false;
+               elseif ( $args['stream'] ) // disable when streaming to file
+                       $compression_enabled = false;
+               elseif ( isset( $args['limit_response_size'] ) ) // If only partial content is being requested, we won't be able to decompress it
+                       $compression_enabled = false;
 
-               if ( function_exists( 'gzuncompress' ) )
-                       $type[] = 'compress;q=0.5';
+               if ( $compression_enabled ) {
+                       if ( function_exists( 'gzinflate' ) )
+                               $type[] = 'deflate;q=1.0';
+
+                       if ( function_exists( 'gzuncompress' ) )
+                               $type[] = 'compress;q=0.5';
+
+                       if ( function_exists( 'gzdecode' ) )
+                               $type[] = 'gzip;q=0.5';
+               }
 
-               if ( function_exists( 'gzdecode' ) )
-                       $type[] = 'gzip;q=0.5';
+               $type = apply_filters( 'wp_http_accept_encoding', $type, $url, $args );
 
                return implode(', ', $type);
        }
index 58f6f7de2863ade31832939646d5ae2f83e163ad..417592fb88ba331e11f9b259bc30d854a75b24eb 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-if ( !class_exists( 'Services_JSON' ) ) :
+if ( ! class_exists( 'Services_JSON' ) ) :
 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 /**
  * Converts to and from JSON format.
@@ -46,20 +46,20 @@ if ( !class_exists( 'Services_JSON' ) ) :
  * DAMAGE.
  *
  * @category
- * @package            Services_JSON
- * @author             Michal Migurski <mike-json@teczno.com>
- * @author             Matt Knapp <mdknapp[at]gmail[dot]com>
- * @author             Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
- * @copyright  2005 Michal Migurski
- * @version     CVS: $Id: JSON.php 288200 2009-09-09 15:41:29Z alan_k $
- * @license            http://www.opensource.org/licenses/bsd-license.php
- * @link               http://pear.php.net/pepr/pepr-proposal-show.php?id=198
+ * @package     Services_JSON
+ * @author      Michal Migurski <mike-json@teczno.com>
+ * @author      Matt Knapp <mdknapp[at]gmail[dot]com>
+ * @author      Brett Stimmerman <brettstimmerman[at]gmail[dot]com>
+ * @copyright   2005 Michal Migurski
+ * @version     CVS: $Id: JSON.php 305040 2010-11-02 23:19:03Z alan_k $
+ * @license     http://www.opensource.org/licenses/bsd-license.php
+ * @link        http://pear.php.net/pepr/pepr-proposal-show.php?id=198
  */
 
 /**
  * Marker constant for Services_JSON::decode(), used to flag stack state
  */
-define('SERVICES_JSON_SLICE', 1);
+define('SERVICES_JSON_SLICE',   1);
 
 /**
  * Marker constant for Services_JSON::decode(), used to flag stack state
@@ -91,6 +91,11 @@ define('SERVICES_JSON_LOOSE_TYPE', 16);
  */
 define('SERVICES_JSON_SUPPRESS_ERRORS', 32);
 
+/**
+ * Behavior switch for Services_JSON::decode()
+ */
+define('SERVICES_JSON_USE_TO_JSON', 64);
+
 /**
  * Converts to and from JSON format.
  *
@@ -114,749 +119,818 @@ define('SERVICES_JSON_SUPPRESS_ERRORS', 32);
  */
 class Services_JSON
 {
- /**
-       * constructs a new JSON instance
-       *
-       * @param int $use object behavior flags; combine with boolean-OR
-       *
-       *                                               possible values:
-       *                                               - SERVICES_JSON_LOOSE_TYPE:  loose typing.
-       *                                                               "{...}" syntax creates associative arrays
-       *                                                               instead of objects in decode().
-       *                                               - SERVICES_JSON_SUPPRESS_ERRORS:  error suppression.
-       *                                                               Values which can't be encoded (e.g. resources)
-       *                                                               appear as NULL instead of throwing errors.
-       *                                                               By default, a deeply-nested resource will
-       *                                                               bubble up with an error, so all return values
-       *                                                               from encode() should be checked with isError()
-       */
-       function Services_JSON($use = 0)
-       {
-               $this->use = $use;
-       }
-
- /**
-       * convert a string from one UTF-16 char to one UTF-8 char
-       *
-       * Normally should be handled by mb_convert_encoding, but
-       * provides a slower PHP-only method for installations
-       * that lack the multibye string extension.
-       *
-       * @param        string  $utf16  UTF-16 character
-       * @return string  UTF-8 character
-       * @access private
-       */
-       function utf162utf8($utf16)
-       {
-               // oh please oh please oh please oh please oh please
-               if(function_exists('mb_convert_encoding')) {
-                       return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
-               }
-
-               $bytes = (ord($utf16[0]) << 8) | ord($utf16[1]);
-
-               switch(true) {
-                       case ((0x7F & $bytes) == $bytes):
-                               // this case should never be reached, because we are in ASCII range
-                               // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
-                               return chr(0x7F & $bytes);
-
-                       case (0x07FF & $bytes) == $bytes:
-                               // return a 2-byte UTF-8 character
-                               // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
-                               return chr(0xC0 | (($bytes >> 6) & 0x1F))
-                                       . chr(0x80 | ($bytes & 0x3F));
-
-                       case (0xFFFF & $bytes) == $bytes:
-                               // return a 3-byte UTF-8 character
-                               // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
-                               return chr(0xE0 | (($bytes >> 12) & 0x0F))
-                                       . chr(0x80 | (($bytes >> 6) & 0x3F))
-                                       . chr(0x80 | ($bytes & 0x3F));
-               }
-
-               // ignoring UTF-32 for now, sorry
-               return '';
-       }
-
- /**
-       * convert a string from one UTF-8 char to one UTF-16 char
-       *
-       * Normally should be handled by mb_convert_encoding, but
-       * provides a slower PHP-only method for installations
-       * that lack the multibye string extension.
-       *
-       * @param        string  $utf8 UTF-8 character
-       * @return string  UTF-16 character
-       * @access private
-       */
-       function utf82utf16($utf8)
-       {
-               // oh please oh please oh please oh please oh please
-               if(function_exists('mb_convert_encoding')) {
-                       return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');
-               }
-
-               switch(strlen($utf8)) {
-                       case 1:
-                               // this case should never be reached, because we are in ASCII range
-                               // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
-                               return $utf8;
-
-                       case 2:
-                               // return a UTF-16 character from a 2-byte UTF-8 char
-                               // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
-                               return chr(0x07 & (ord($utf8[0]) >> 2))
-                                       . chr((0xC0 & (ord($utf8[0]) << 6))
-                                               | (0x3F & ord($utf8[1])));
-
-                       case 3:
-                               // return a UTF-16 character from a 3-byte UTF-8 char
-                               // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
-                               return chr((0xF0 & (ord($utf8[0]) << 4))
-                                               | (0x0F & (ord($utf8[1]) >> 2)))
-                                       . chr((0xC0 & (ord($utf8[1]) << 6))
-                                               | (0x7F & ord($utf8[2])));
-               }
-
-               // ignoring UTF-32 for now, sorry
-               return '';
-       }
-
- /**
-       * encodes an arbitrary variable into JSON format (and sends JSON Header)
-       *
-       * @param        mixed $var      any number, boolean, string, array, or object to be encoded.
-       *                                               see argument 1 to Services_JSON() above for array-parsing behavior.
-       *                                               if var is a strng, note that encode() always expects it
-       *                                               to be in ASCII or UTF-8 format!
-       *
-       * @return mixed JSON string representation of input var or an error if a problem occurs
-       * @access public
-       */
-       function encode($var)
-       {
-               header('Content-type: application/json');
-               return $this->_encode($var);
-       }
-       /**
-       * encodes an arbitrary variable into JSON format without JSON Header - warning - may allow CSS!!!!)
-       *
-       * @param        mixed $var      any number, boolean, string, array, or object to be encoded.
-       *                                               see argument 1 to Services_JSON() above for array-parsing behavior.
-       *                                               if var is a strng, note that encode() always expects it
-       *                                               to be in ASCII or UTF-8 format!
-       *
-       * @return mixed JSON string representation of input var or an error if a problem occurs
-       * @access public
-       */
-       function encodeUnsafe($var)
-       {
-               return $this->_encode($var);
-       }
-       /**
-       * PRIVATE CODE that does the work of encodes an arbitrary variable into JSON format
-       *
-       * @param        mixed $var      any number, boolean, string, array, or object to be encoded.
-       *                                               see argument 1 to Services_JSON() above for array-parsing behavior.
-       *                                               if var is a strng, note that encode() always expects it
-       *                                               to be in ASCII or UTF-8 format!
-       *
-       * @return mixed JSON string representation of input var or an error if a problem occurs
-       * @access public
-       */
-       function _encode($var)
-       {
-
-               switch (gettype($var)) {
-                       case 'boolean':
-                               return $var ? 'true' : 'false';
-
-                       case 'NULL':
-                               return 'null';
-
-                       case 'integer':
-                               return (int) $var;
-
-                       case 'double':
-                       case 'float':
-                               return (float) $var;
-
-                       case 'string':
-                               // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT
-                               $ascii = '';
-                               $strlen_var = strlen($var);
-
-                       /*
-                               * Iterate over every character in the string,
-                               * escaping with a slash or encoding to UTF-8 where necessary
-                               */
-                               for ($c = 0; $c < $strlen_var; ++$c) {
-
-                                       $ord_var_c = ord($var[$c]);
-
-                                       switch (true) {
-                                               case $ord_var_c == 0x08:
-                                                       $ascii .= '\b';
-                                                       break;
-                                               case $ord_var_c == 0x09:
-                                                       $ascii .= '\t';
-                                                       break;
-                                               case $ord_var_c == 0x0A:
-                                                       $ascii .= '\n';
-                                                       break;
-                                               case $ord_var_c == 0x0C:
-                                                       $ascii .= '\f';
-                                                       break;
-                                               case $ord_var_c == 0x0D:
-                                                       $ascii .= '\r';
-                                                       break;
-
-                                               case $ord_var_c == 0x22:
-                                               case $ord_var_c == 0x2F:
-                                               case $ord_var_c == 0x5C:
-                                                       // double quote, slash, slosh
-                                                       $ascii .= '\\'.$var[$c];
-                                                       break;
-
-                                               case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
-                                                       // characters U-00000000 - U-0000007F (same as ASCII)
-                                                       $ascii .= $var[$c];
-                                                       break;
-
-                                               case (($ord_var_c & 0xE0) == 0xC0):
-                                                       // characters U-00000080 - U-000007FF, mask 110XXXXX
-                                                       // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
-                                                       if ($c+1 >= $strlen_var) {
-                                                               $c += 1;
-                                                               $ascii .= '?';
-                                                               break;
-                                                       }
-
-                                                       $char = pack('C*', $ord_var_c, ord($var[$c + 1]));
-                                                       $c += 1;
-                                                       $utf16 = $this->utf82utf16($char);
-                                                       $ascii .= sprintf('\u%04s', bin2hex($utf16));
-                                                       break;
-
-                                               case (($ord_var_c & 0xF0) == 0xE0):
-                                                       if ($c+2 >= $strlen_var) {
-                                                               $c += 2;
-                                                               $ascii .= '?';
-                                                               break;
-                                                       }
-                                                       // characters U-00000800 - U-0000FFFF, mask 1110XXXX
-                                                       // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
-                                                       $char = pack('C*', $ord_var_c,
-                                                                               @ord($var[$c + 1]),
-                                                                               @ord($var[$c + 2]));
-                                                       $c += 2;
-                                                       $utf16 = $this->utf82utf16($char);
-                                                       $ascii .= sprintf('\u%04s', bin2hex($utf16));
-                                                       break;
-
-                                               case (($ord_var_c & 0xF8) == 0xF0):
-                                                       if ($c+3 >= $strlen_var) {
-                                                               $c += 3;
-                                                               $ascii .= '?';
-                                                               break;
-                                                       }
-                                                       // characters U-00010000 - U-001FFFFF, mask 11110XXX
-                                                       // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
-                                                       $char = pack('C*', $ord_var_c,
-                                                                               ord($var[$c + 1]),
-                                                                               ord($var[$c + 2]),
-                                                                               ord($var[$c + 3]));
-                                                       $c += 3;
-                                                       $utf16 = $this->utf82utf16($char);
-                                                       $ascii .= sprintf('\u%04s', bin2hex($utf16));
-                                                       break;
-
-                                               case (($ord_var_c & 0xFC) == 0xF8):
-                                                       // characters U-00200000 - U-03FFFFFF, mask 111110XX
-                                                       // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
-                                                       if ($c+4 >= $strlen_var) {
-                                                               $c += 4;
-                                                               $ascii .= '?';
-                                                               break;
-                                                       }
-                                                       $char = pack('C*', $ord_var_c,
-                                                                               ord($var[$c + 1]),
-                                                                               ord($var[$c + 2]),
-                                                                               ord($var[$c + 3]),
-                                                                               ord($var[$c + 4]));
-                                                       $c += 4;
-                                                       $utf16 = $this->utf82utf16($char);
-                                                       $ascii .= sprintf('\u%04s', bin2hex($utf16));
-                                                       break;
-
-                                               case (($ord_var_c & 0xFE) == 0xFC):
-                                               if ($c+5 >= $strlen_var) {
-                                                               $c += 5;
-                                                               $ascii .= '?';
-                                                               break;
-                                                       }
-                                                       // characters U-04000000 - U-7FFFFFFF, mask 1111110X
-                                                       // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
-                                                       $char = pack('C*', $ord_var_c,
-                                                                               ord($var[$c + 1]),
-                                                                               ord($var[$c + 2]),
-                                                                               ord($var[$c + 3]),
-                                                                               ord($var[$c + 4]),
-                                                                               ord($var[$c + 5]));
-                                                       $c += 5;
-                                                       $utf16 = $this->utf82utf16($char);
-                                                       $ascii .= sprintf('\u%04s', bin2hex($utf16));
-                                                       break;
-                                       }
-                               }
-                               return  '"'.$ascii.'"';
-
-                       case 'array':
-                       /*
-                               * As per JSON spec if any array key is not an integer
-                               * we must treat the the whole array as an object. We
-                               * also try to catch a sparsely populated associative
-                               * array with numeric keys here because some JS engines
-                               * will create an array with empty indexes up to
-                               * max_index which can cause memory issues and because
-                               * the keys, which may be relevant, will be remapped
-                               * otherwise.
-                               *
-                               * As per the ECMA and JSON specification an object may
-                               * have any string as a property. Unfortunately due to
-                               * a hole in the ECMA specification if the key is a
-                               * ECMA reserved word or starts with a digit the
-                               * parameter is only accessible using ECMAScript's
-                               * bracket notation.
-                               */
-
-                               // treat as a JSON object
-                               if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {
-                                       $properties = array_map(array($this, 'name_value'),
-                                                                                       array_keys($var),
-                                                                                       array_values($var));
-
-                                       foreach($properties as $property) {
-                                               if(Services_JSON::isError($property)) {
-                                                       return $property;
-                                               }
-                                       }
-
-                                       return '{' . join(',', $properties) . '}';
-                               }
-
-                               // treat it like a regular array
-                               $elements = array_map(array($this, '_encode'), $var);
-
-                               foreach($elements as $element) {
-                                       if(Services_JSON::isError($element)) {
-                                               return $element;
-                                       }
-                               }
-
-                               return '[' . join(',', $elements) . ']';
-
-                       case 'object':
-                               $vars = get_object_vars($var);
-
-                               $properties = array_map(array($this, 'name_value'),
-                                                                               array_keys($vars),
-                                                                               array_values($vars));
-
-                               foreach($properties as $property) {
-                                       if(Services_JSON::isError($property)) {
-                                               return $property;
-                                       }
-                               }
-
-                               return '{' . join(',', $properties) . '}';
-
-                       default:
-                               return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS)
-                                       ? 'null'
-                                       : new Services_JSON_Error(gettype($var)." can not be encoded as JSON string");
-               }
-       }
-
- /**
-       * array-walking function for use in generating JSON-formatted name-value pairs
-       *
-       * @param        string  $name name of key to use
-       * @param        mixed $value  reference to an array element to be encoded
-       *
-       * @return string  JSON-formatted name-value pair, like '"name":value'
-       * @access private
-       */
-       function name_value($name, $value)
-       {
-               $encoded_value = $this->_encode($value);
-
-               if(Services_JSON::isError($encoded_value)) {
-                       return $encoded_value;
-               }
-
-               return $this->_encode(strval($name)) . ':' . $encoded_value;
-       }
-
- /**
-       * reduce a string by removing leading and trailing comments and whitespace
-       *
-       * @param        $str    string  string value to strip of comments and whitespace
-       *
-       * @return string  string value stripped of comments and whitespace
-       * @access private
-       */
-       function reduce_string($str)
-       {
-               $str = preg_replace(array(
-
-                               // eliminate single line comments in '// ...' form
-                               '#^\s*//(.+)$#m',
-
-                               // eliminate multi-line comments in '/* ... */' form, at start of string
-                               '#^\s*/\*(.+)\*/#Us',
-
-                               // eliminate multi-line comments in '/* ... */' form, at end of string
-                               '#/\*(.+)\*/\s*$#Us'
-
-                       ), '', $str);
-
-               // eliminate extraneous space
-               return trim($str);
-       }
-
- /**
-       * decodes a JSON string into appropriate variable
-       *
-       * @param        string  $str    JSON-formatted string
-       *
-       * @return mixed number, boolean, string, array, or object
-       *                               corresponding to given JSON input string.
-       *                               See argument 1 to Services_JSON() above for object-output behavior.
-       *                               Note that decode() always returns strings
-       *                               in ASCII or UTF-8 format!
-       * @access public
-       */
-       function decode($str)
-       {
-               $str = $this->reduce_string($str);
-
-               switch (strtolower($str)) {
-                       case 'true':
-                               return true;
-
-                       case 'false':
-                               return false;
-
-                       case 'null':
-                               return null;
-
-                       default:
-                               $m = array();
-
-                               if (is_numeric($str)) {
-                                       // Lookie-loo, it's a number
-
-                                       // This would work on its own, but I'm trying to be
-                                       // good about returning integers where appropriate:
-                                       // return (float)$str;
-
-                                       // Return float or int, as appropriate
-                                       return ((float)$str == (integer)$str)
-                                               ? (integer)$str
-                                               : (float)$str;
-
-                               } elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) {
-                                       // STRINGS RETURNED IN UTF-8 FORMAT
-                                       $delim = substr($str, 0, 1);
-                                       $chrs = substr($str, 1, -1);
-                                       $utf8 = '';
-                                       $strlen_chrs = strlen($chrs);
-
-                                       for ($c = 0; $c < $strlen_chrs; ++$c) {
-
-                                               $substr_chrs_c_2 = substr($chrs, $c, 2);
-                                               $ord_chrs_c = ord($chrs[$c]);
-
-                                               switch (true) {
-                                                       case $substr_chrs_c_2 == '\b':
-                                                               $utf8 .= chr(0x08);
-                                                               ++$c;
-                                                               break;
-                                                       case $substr_chrs_c_2 == '\t':
-                                                               $utf8 .= chr(0x09);
-                                                               ++$c;
-                                                               break;
-                                                       case $substr_chrs_c_2 == '\n':
-                                                               $utf8 .= chr(0x0A);
-                                                               ++$c;
-                                                               break;
-                                                       case $substr_chrs_c_2 == '\f':
-                                                               $utf8 .= chr(0x0C);
-                                                               ++$c;
-                                                               break;
-                                                       case $substr_chrs_c_2 == '\r':
-                                                               $utf8 .= chr(0x0D);
-                                                               ++$c;
-                                                               break;
-
-                                                       case $substr_chrs_c_2 == '\\"':
-                                                       case $substr_chrs_c_2 == '\\\'':
-                                                       case $substr_chrs_c_2 == '\\\\':
-                                                       case $substr_chrs_c_2 == '\\/':
-                                                               if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
-                                                               ($delim == "'" && $substr_chrs_c_2 != '\\"')) {
-                                                                       $utf8 .= $chrs[++$c];
-                                                               }
-                                                               break;
-
-                                                       case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)):
-                                                               // single, escaped unicode character
-                                                               $utf16 = chr(hexdec(substr($chrs, ($c + 2), 2)))
-                                                                       . chr(hexdec(substr($chrs, ($c + 4), 2)));
-                                                               $utf8 .= $this->utf162utf8($utf16);
-                                                               $c += 5;
-                                                               break;
-
-                                                       case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
-                                                               $utf8 .= $chrs[$c];
-                                                               break;
-
-                                                       case ($ord_chrs_c & 0xE0) == 0xC0:
-                                                               // characters U-00000080 - U-000007FF, mask 110XXXXX
-                                                               //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
-                                                               $utf8 .= substr($chrs, $c, 2);
-                                                               ++$c;
-                                                               break;
-
-                                                       case ($ord_chrs_c & 0xF0) == 0xE0:
-                                                               // characters U-00000800 - U-0000FFFF, mask 1110XXXX
-                                                               // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
-                                                               $utf8 .= substr($chrs, $c, 3);
-                                                               $c += 2;
-                                                               break;
-
-                                                       case ($ord_chrs_c & 0xF8) == 0xF0:
-                                                               // characters U-00010000 - U-001FFFFF, mask 11110XXX
-                                                               // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
-                                                               $utf8 .= substr($chrs, $c, 4);
-                                                               $c += 3;
-                                                               break;
-
-                                                       case ($ord_chrs_c & 0xFC) == 0xF8:
-                                                               // characters U-00200000 - U-03FFFFFF, mask 111110XX
-                                                               // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
-                                                               $utf8 .= substr($chrs, $c, 5);
-                                                               $c += 4;
-                                                               break;
-
-                                                       case ($ord_chrs_c & 0xFE) == 0xFC:
-                                                               // characters U-04000000 - U-7FFFFFFF, mask 1111110X
-                                                               // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
-                                                               $utf8 .= substr($chrs, $c, 6);
-                                                               $c += 5;
-                                                               break;
-
-                                               }
-
-                                       }
-
-                                       return $utf8;
-
-                               } elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
-                                       // array, or object notation
-
-                                       if ($str[0] == '[') {
-                                               $stk = array(SERVICES_JSON_IN_ARR);
-                                               $arr = array();
-                                       } else {
-                                               if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
-                                                       $stk = array(SERVICES_JSON_IN_OBJ);
-                                                       $obj = array();
-                                               } else {
-                                                       $stk = array(SERVICES_JSON_IN_OBJ);
-                                                       $obj = new stdClass();
-                                               }
-                                       }
-
-                                       array_push($stk, array('what'  => SERVICES_JSON_SLICE,
-                                                                               'where' => 0,
-                                                                               'delim' => false));
-
-                                       $chrs = substr($str, 1, -1);
-                                       $chrs = $this->reduce_string($chrs);
-
-                                       if ($chrs == '') {
-                                               if (reset($stk) == SERVICES_JSON_IN_ARR) {
-                                                       return $arr;
-
-                                               } else {
-                                                       return $obj;
-
-                                               }
-                                       }
-
-                                       //print("\nparsing {$chrs}\n");
-
-                                       $strlen_chrs = strlen($chrs);
-
-                                       for ($c = 0; $c <= $strlen_chrs; ++$c) {
-
-                                               $top = end($stk);
-                                               $substr_chrs_c_2 = substr($chrs, $c, 2);
-
-                                               if (($c == $strlen_chrs) || (($chrs[$c] == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
-                                                       // found a comma that is not inside a string, array, etc.,
-                                                       // OR we've reached the end of the character list
-                                                       $slice = substr($chrs, $top['where'], ($c - $top['where']));
-                                                       array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false));
-                                                       //print("Found split at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
-
-                                                       if (reset($stk) == SERVICES_JSON_IN_ARR) {
-                                                               // we are in an array, so just push an element onto the stack
-                                                               array_push($arr, $this->decode($slice));
-
-                                                       } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
-                                                               // we are in an object, so figure
-                                                               // out the property name and set an
-                                                               // element in an associative array,
-                                                               // for now
-                                                               $parts = array();
-
-                                                               if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
-                                                                       // "name":value pair
-                                                                       $key = $this->decode($parts[1]);
-                                                                       $val = $this->decode($parts[2]);
-
-                                                                       if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
-                                                                               $obj[$key] = $val;
-                                                                       } else {
-                                                                               $obj->$key = $val;
-                                                                       }
-                                                               } elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) {
-                                                                       // name:value pair, where name is unquoted
-                                                                       $key = $parts[1];
-                                                                       $val = $this->decode($parts[2]);
-
-                                                                       if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
-                                                                               $obj[$key] = $val;
-                                                                       } else {
-                                                                               $obj->$key = $val;
-                                                                       }
-                                                               }
-
-                                                       }
-
-                                               } elseif ((($chrs[$c] == '"') || ($chrs[$c] == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
-                                                       // found a quote, and we are not inside a string
-                                                       array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs[$c]));
-                                                       //print("Found start of string at {$c}\n");
-
-                                               } elseif (($chrs[$c] == $top['delim']) &&
-                                                               ($top['what'] == SERVICES_JSON_IN_STR) &&
-                                                               ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) {
-                                                       // found a quote, we're in a string, and it's not escaped
-                                                       // we know that it's not escaped becase there is _not_ an
-                                                       // odd number of backslashes at the end of the string so far
-                                                       array_pop($stk);
-                                                       //print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
-
-                                               } elseif (($chrs[$c] == '[') &&
-                                                               in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
-                                                       // found a left-bracket, and we are in an array, object, or slice
-                                                       array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
-                                                       //print("Found start of array at {$c}\n");
-
-                                               } elseif (($chrs[$c] == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
-                                                       // found a right-bracket, and we're in an array
-                                                       array_pop($stk);
-                                                       //print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
-
-                                               } elseif (($chrs[$c] == '{') &&
-                                                               in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
-                                                       // found a left-brace, and we are in an array, object, or slice
-                                                       array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
-                                                       //print("Found start of object at {$c}\n");
-
-                                               } elseif (($chrs[$c] == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
-                                                       // found a right-brace, and we're in an object
-                                                       array_pop($stk);
-                                                       //print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
-
-                                               } elseif (($substr_chrs_c_2 == '/*') &&
-                                                               in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
-                                                       // found a comment start, and we are in an array, object, or slice
-                                                       array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false));
-                                                       $c++;
-                                                       //print("Found start of comment at {$c}\n");
-
-                                               } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) {
-                                                       // found a comment end, and we're in one now
-                                                       array_pop($stk);
-                                                       $c++;
-
-                                                       for ($i = $top['where']; $i <= $c; ++$i)
-                                                               $chrs = substr_replace($chrs, ' ', $i, 1);
-
-                                                       //print("Found end of comment at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
-
-                                               }
-
-                                       }
-
-                                       if (reset($stk) == SERVICES_JSON_IN_ARR) {
-                                               return $arr;
-
-                                       } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
-                                               return $obj;
-
-                                       }
-
-                               }
-               }
-       }
-
-       /**
-       * @todo Ultimately, this should just call PEAR::isError()
-       */
-       function isError($data, $code = null)
-       {
-               if (class_exists('pear')) {
-                       return PEAR::isError($data, $code);
-               } elseif (is_object($data) && (get_class($data) == 'services_json_error' ||
-                                                               is_subclass_of($data, 'services_json_error'))) {
-                       return true;
-               }
-
-               return false;
-       }
+   /**
+    * constructs a new JSON instance
+    *
+    * @param    int     $use    object behavior flags; combine with boolean-OR
+    *
+    *                           possible values:
+    *                           - SERVICES_JSON_LOOSE_TYPE:  loose typing.
+    *                                   "{...}" syntax creates associative arrays
+    *                                   instead of objects in decode().
+    *                           - SERVICES_JSON_SUPPRESS_ERRORS:  error suppression.
+    *                                   Values which can't be encoded (e.g. resources)
+    *                                   appear as NULL instead of throwing errors.
+    *                                   By default, a deeply-nested resource will
+    *                                   bubble up with an error, so all return values
+    *                                   from encode() should be checked with isError()
+    *                           - SERVICES_JSON_USE_TO_JSON:  call toJSON when serializing objects
+    *                                   It serializes the return value from the toJSON call rather 
+    *                                   than the object it'self,  toJSON can return associative arrays, 
+    *                                   strings or numbers, if you return an object, make sure it does
+    *                                   not have a toJSON method, otherwise an error will occur.
+    */
+    function Services_JSON($use = 0)
+    {
+        $this->use = $use;
+        $this->_mb_strlen            = function_exists('mb_strlen');
+        $this->_mb_convert_encoding  = function_exists('mb_convert_encoding');
+        $this->_mb_substr            = function_exists('mb_substr');
+    }
+    // private - cache the mbstring lookup results..
+    var $_mb_strlen = false;
+    var $_mb_substr = false;
+    var $_mb_convert_encoding = false;
+    
+   /**
+    * convert a string from one UTF-16 char to one UTF-8 char
+    *
+    * Normally should be handled by mb_convert_encoding, but
+    * provides a slower PHP-only method for installations
+    * that lack the multibye string extension.
+    *
+    * @param    string  $utf16  UTF-16 character
+    * @return   string  UTF-8 character
+    * @access   private
+    */
+    function utf162utf8($utf16)
+    {
+        // oh please oh please oh please oh please oh please
+        if($this->_mb_convert_encoding) {
+            return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
+        }
+
+        $bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
+
+        switch(true) {
+            case ((0x7F & $bytes) == $bytes):
+                // this case should never be reached, because we are in ASCII range
+                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                return chr(0x7F & $bytes);
+
+            case (0x07FF & $bytes) == $bytes:
+                // return a 2-byte UTF-8 character
+                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                return chr(0xC0 | (($bytes >> 6) & 0x1F))
+                     . chr(0x80 | ($bytes & 0x3F));
+
+            case (0xFFFF & $bytes) == $bytes:
+                // return a 3-byte UTF-8 character
+                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                return chr(0xE0 | (($bytes >> 12) & 0x0F))
+                     . chr(0x80 | (($bytes >> 6) & 0x3F))
+                     . chr(0x80 | ($bytes & 0x3F));
+        }
+
+        // ignoring UTF-32 for now, sorry
+        return '';
+    }
+
+   /**
+    * convert a string from one UTF-8 char to one UTF-16 char
+    *
+    * Normally should be handled by mb_convert_encoding, but
+    * provides a slower PHP-only method for installations
+    * that lack the multibye string extension.
+    *
+    * @param    string  $utf8   UTF-8 character
+    * @return   string  UTF-16 character
+    * @access   private
+    */
+    function utf82utf16($utf8)
+    {
+        // oh please oh please oh please oh please oh please
+        if($this->_mb_convert_encoding) {
+            return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');
+        }
+
+        switch($this->strlen8($utf8)) {
+            case 1:
+                // this case should never be reached, because we are in ASCII range
+                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                return $utf8;
+
+            case 2:
+                // return a UTF-16 character from a 2-byte UTF-8 char
+                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                return chr(0x07 & (ord($utf8{0}) >> 2))
+                     . chr((0xC0 & (ord($utf8{0}) << 6))
+                         | (0x3F & ord($utf8{1})));
+
+            case 3:
+                // return a UTF-16 character from a 3-byte UTF-8 char
+                // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                return chr((0xF0 & (ord($utf8{0}) << 4))
+                         | (0x0F & (ord($utf8{1}) >> 2)))
+                     . chr((0xC0 & (ord($utf8{1}) << 6))
+                         | (0x7F & ord($utf8{2})));
+        }
+
+        // ignoring UTF-32 for now, sorry
+        return '';
+    }
+
+   /**
+    * encodes an arbitrary variable into JSON format (and sends JSON Header)
+    *
+    * @param    mixed   $var    any number, boolean, string, array, or object to be encoded.
+    *                           see argument 1 to Services_JSON() above for array-parsing behavior.
+    *                           if var is a strng, note that encode() always expects it
+    *                           to be in ASCII or UTF-8 format!
+    *
+    * @return   mixed   JSON string representation of input var or an error if a problem occurs
+    * @access   public
+    */
+    function encode($var)
+    {
+        header('Content-type: application/json');
+        return $this->encodeUnsafe($var);
+    }
+    /**
+    * encodes an arbitrary variable into JSON format without JSON Header - warning - may allow XSS!!!!)
+    *
+    * @param    mixed   $var    any number, boolean, string, array, or object to be encoded.
+    *                           see argument 1 to Services_JSON() above for array-parsing behavior.
+    *                           if var is a strng, note that encode() always expects it
+    *                           to be in ASCII or UTF-8 format!
+    *
+    * @return   mixed   JSON string representation of input var or an error if a problem occurs
+    * @access   public
+    */
+    function encodeUnsafe($var)
+    {
+        // see bug #16908 - regarding numeric locale printing
+        $lc = setlocale(LC_NUMERIC, 0);
+        setlocale(LC_NUMERIC, 'C');
+        $ret = $this->_encode($var);
+        setlocale(LC_NUMERIC, $lc);
+        return $ret;
+        
+    }
+    /**
+    * PRIVATE CODE that does the work of encodes an arbitrary variable into JSON format 
+    *
+    * @param    mixed   $var    any number, boolean, string, array, or object to be encoded.
+    *                           see argument 1 to Services_JSON() above for array-parsing behavior.
+    *                           if var is a strng, note that encode() always expects it
+    *                           to be in ASCII or UTF-8 format!
+    *
+    * @return   mixed   JSON string representation of input var or an error if a problem occurs
+    * @access   public
+    */
+    function _encode($var) 
+    {
+         
+        switch (gettype($var)) {
+            case 'boolean':
+                return $var ? 'true' : 'false';
+
+            case 'NULL':
+                return 'null';
+
+            case 'integer':
+                return (int) $var;
+
+            case 'double':
+            case 'float':
+                return  (float) $var;
+
+            case 'string':
+                // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT
+                $ascii = '';
+                $strlen_var = $this->strlen8($var);
+
+               /*
+                * Iterate over every character in the string,
+                * escaping with a slash or encoding to UTF-8 where necessary
+                */
+                for ($c = 0; $c < $strlen_var; ++$c) {
+
+                    $ord_var_c = ord($var{$c});
+
+                    switch (true) {
+                        case $ord_var_c == 0x08:
+                            $ascii .= '\b';
+                            break;
+                        case $ord_var_c == 0x09:
+                            $ascii .= '\t';
+                            break;
+                        case $ord_var_c == 0x0A:
+                            $ascii .= '\n';
+                            break;
+                        case $ord_var_c == 0x0C:
+                            $ascii .= '\f';
+                            break;
+                        case $ord_var_c == 0x0D:
+                            $ascii .= '\r';
+                            break;
+
+                        case $ord_var_c == 0x22:
+                        case $ord_var_c == 0x2F:
+                        case $ord_var_c == 0x5C:
+                            // double quote, slash, slosh
+                            $ascii .= '\\'.$var{$c};
+                            break;
+
+                        case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
+                            // characters U-00000000 - U-0000007F (same as ASCII)
+                            $ascii .= $var{$c};
+                            break;
+
+                        case (($ord_var_c & 0xE0) == 0xC0):
+                            // characters U-00000080 - U-000007FF, mask 110XXXXX
+                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                            if ($c+1 >= $strlen_var) {
+                                $c += 1;
+                                $ascii .= '?';
+                                break;
+                            }
+                            
+                            $char = pack('C*', $ord_var_c, ord($var{$c + 1}));
+                            $c += 1;
+                            $utf16 = $this->utf82utf16($char);
+                            $ascii .= sprintf('\u%04s', bin2hex($utf16));
+                            break;
+
+                        case (($ord_var_c & 0xF0) == 0xE0):
+                            if ($c+2 >= $strlen_var) {
+                                $c += 2;
+                                $ascii .= '?';
+                                break;
+                            }
+                            // characters U-00000800 - U-0000FFFF, mask 1110XXXX
+                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                            $char = pack('C*', $ord_var_c,
+                                         @ord($var{$c + 1}),
+                                         @ord($var{$c + 2}));
+                            $c += 2;
+                            $utf16 = $this->utf82utf16($char);
+                            $ascii .= sprintf('\u%04s', bin2hex($utf16));
+                            break;
+
+                        case (($ord_var_c & 0xF8) == 0xF0):
+                            if ($c+3 >= $strlen_var) {
+                                $c += 3;
+                                $ascii .= '?';
+                                break;
+                            }
+                            // characters U-00010000 - U-001FFFFF, mask 11110XXX
+                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                            $char = pack('C*', $ord_var_c,
+                                         ord($var{$c + 1}),
+                                         ord($var{$c + 2}),
+                                         ord($var{$c + 3}));
+                            $c += 3;
+                            $utf16 = $this->utf82utf16($char);
+                            $ascii .= sprintf('\u%04s', bin2hex($utf16));
+                            break;
+
+                        case (($ord_var_c & 0xFC) == 0xF8):
+                            // characters U-00200000 - U-03FFFFFF, mask 111110XX
+                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                            if ($c+4 >= $strlen_var) {
+                                $c += 4;
+                                $ascii .= '?';
+                                break;
+                            }
+                            $char = pack('C*', $ord_var_c,
+                                         ord($var{$c + 1}),
+                                         ord($var{$c + 2}),
+                                         ord($var{$c + 3}),
+                                         ord($var{$c + 4}));
+                            $c += 4;
+                            $utf16 = $this->utf82utf16($char);
+                            $ascii .= sprintf('\u%04s', bin2hex($utf16));
+                            break;
+
+                        case (($ord_var_c & 0xFE) == 0xFC):
+                        if ($c+5 >= $strlen_var) {
+                                $c += 5;
+                                $ascii .= '?';
+                                break;
+                            }
+                            // characters U-04000000 - U-7FFFFFFF, mask 1111110X
+                            // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                            $char = pack('C*', $ord_var_c,
+                                         ord($var{$c + 1}),
+                                         ord($var{$c + 2}),
+                                         ord($var{$c + 3}),
+                                         ord($var{$c + 4}),
+                                         ord($var{$c + 5}));
+                            $c += 5;
+                            $utf16 = $this->utf82utf16($char);
+                            $ascii .= sprintf('\u%04s', bin2hex($utf16));
+                            break;
+                    }
+                }
+                return  '"'.$ascii.'"';
+
+            case 'array':
+               /*
+                * As per JSON spec if any array key is not an integer
+                * we must treat the the whole array as an object. We
+                * also try to catch a sparsely populated associative
+                * array with numeric keys here because some JS engines
+                * will create an array with empty indexes up to
+                * max_index which can cause memory issues and because
+                * the keys, which may be relevant, will be remapped
+                * otherwise.
+                *
+                * As per the ECMA and JSON specification an object may
+                * have any string as a property. Unfortunately due to
+                * a hole in the ECMA specification if the key is a
+                * ECMA reserved word or starts with a digit the
+                * parameter is only accessible using ECMAScript's
+                * bracket notation.
+                */
+
+                // treat as a JSON object
+                if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {
+                    $properties = array_map(array($this, 'name_value'),
+                                            array_keys($var),
+                                            array_values($var));
+
+                    foreach($properties as $property) {
+                        if(Services_JSON::isError($property)) {
+                            return $property;
+                        }
+                    }
+
+                    return '{' . join(',', $properties) . '}';
+                }
+
+                // treat it like a regular array
+                $elements = array_map(array($this, '_encode'), $var);
+
+                foreach($elements as $element) {
+                    if(Services_JSON::isError($element)) {
+                        return $element;
+                    }
+                }
+
+                return '[' . join(',', $elements) . ']';
+
+            case 'object':
+            
+                // support toJSON methods.
+                if (($this->use & SERVICES_JSON_USE_TO_JSON) && method_exists($var, 'toJSON')) {
+                    // this may end up allowing unlimited recursion
+                    // so we check the return value to make sure it's not got the same method.
+                    $recode = $var->toJSON();
+                    
+                    if (method_exists($recode, 'toJSON')) {
+                        
+                        return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS)
+                        ? 'null'
+                        : new Services_JSON_Error(get_class($var).
+                            " toJSON returned an object with a toJSON method.");
+                            
+                    }
+                    
+                    return $this->_encode( $recode );
+                } 
+                
+                $vars = get_object_vars($var);
+                
+                $properties = array_map(array($this, 'name_value'),
+                                        array_keys($vars),
+                                        array_values($vars));
+
+                foreach($properties as $property) {
+                    if(Services_JSON::isError($property)) {
+                        return $property;
+                    }
+                }
+
+                return '{' . join(',', $properties) . '}';
+
+            default:
+                return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS)
+                    ? 'null'
+                    : new Services_JSON_Error(gettype($var)." can not be encoded as JSON string");
+        }
+    }
+
+   /**
+    * array-walking function for use in generating JSON-formatted name-value pairs
+    *
+    * @param    string  $name   name of key to use
+    * @param    mixed   $value  reference to an array element to be encoded
+    *
+    * @return   string  JSON-formatted name-value pair, like '"name":value'
+    * @access   private
+    */
+    function name_value($name, $value)
+    {
+        $encoded_value = $this->_encode($value);
+
+        if(Services_JSON::isError($encoded_value)) {
+            return $encoded_value;
+        }
+
+        return $this->_encode(strval($name)) . ':' . $encoded_value;
+    }
+
+   /**
+    * reduce a string by removing leading and trailing comments and whitespace
+    *
+    * @param    $str    string      string value to strip of comments and whitespace
+    *
+    * @return   string  string value stripped of comments and whitespace
+    * @access   private
+    */
+    function reduce_string($str)
+    {
+        $str = preg_replace(array(
+
+                // eliminate single line comments in '// ...' form
+                '#^\s*//(.+)$#m',
+
+                // eliminate multi-line comments in '/* ... */' form, at start of string
+                '#^\s*/\*(.+)\*/#Us',
+
+                // eliminate multi-line comments in '/* ... */' form, at end of string
+                '#/\*(.+)\*/\s*$#Us'
+
+            ), '', $str);
+
+        // eliminate extraneous space
+        return trim($str);
+    }
+
+   /**
+    * decodes a JSON string into appropriate variable
+    *
+    * @param    string  $str    JSON-formatted string
+    *
+    * @return   mixed   number, boolean, string, array, or object
+    *                   corresponding to given JSON input string.
+    *                   See argument 1 to Services_JSON() above for object-output behavior.
+    *                   Note that decode() always returns strings
+    *                   in ASCII or UTF-8 format!
+    * @access   public
+    */
+    function decode($str)
+    {
+        $str = $this->reduce_string($str);
+
+        switch (strtolower($str)) {
+            case 'true':
+                return true;
+
+            case 'false':
+                return false;
+
+            case 'null':
+                return null;
+
+            default:
+                $m = array();
+
+                if (is_numeric($str)) {
+                    // Lookie-loo, it's a number
+
+                    // This would work on its own, but I'm trying to be
+                    // good about returning integers where appropriate:
+                    // return (float)$str;
+
+                    // Return float or int, as appropriate
+                    return ((float)$str == (integer)$str)
+                        ? (integer)$str
+                        : (float)$str;
+
+                } elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) {
+                    // STRINGS RETURNED IN UTF-8 FORMAT
+                    $delim = $this->substr8($str, 0, 1);
+                    $chrs = $this->substr8($str, 1, -1);
+                    $utf8 = '';
+                    $strlen_chrs = $this->strlen8($chrs);
+
+                    for ($c = 0; $c < $strlen_chrs; ++$c) {
+
+                        $substr_chrs_c_2 = $this->substr8($chrs, $c, 2);
+                        $ord_chrs_c = ord($chrs{$c});
+
+                        switch (true) {
+                            case $substr_chrs_c_2 == '\b':
+                                $utf8 .= chr(0x08);
+                                ++$c;
+                                break;
+                            case $substr_chrs_c_2 == '\t':
+                                $utf8 .= chr(0x09);
+                                ++$c;
+                                break;
+                            case $substr_chrs_c_2 == '\n':
+                                $utf8 .= chr(0x0A);
+                                ++$c;
+                                break;
+                            case $substr_chrs_c_2 == '\f':
+                                $utf8 .= chr(0x0C);
+                                ++$c;
+                                break;
+                            case $substr_chrs_c_2 == '\r':
+                                $utf8 .= chr(0x0D);
+                                ++$c;
+                                break;
+
+                            case $substr_chrs_c_2 == '\\"':
+                            case $substr_chrs_c_2 == '\\\'':
+                            case $substr_chrs_c_2 == '\\\\':
+                            case $substr_chrs_c_2 == '\\/':
+                                if (($delim == '"' && $substr_chrs_c_2 != '\\\'') ||
+                                   ($delim == "'" && $substr_chrs_c_2 != '\\"')) {
+                                    $utf8 .= $chrs{++$c};
+                                }
+                                break;
+
+                            case preg_match('/\\\u[0-9A-F]{4}/i', $this->substr8($chrs, $c, 6)):
+                                // single, escaped unicode character
+                                $utf16 = chr(hexdec($this->substr8($chrs, ($c + 2), 2)))
+                                       . chr(hexdec($this->substr8($chrs, ($c + 4), 2)));
+                                $utf8 .= $this->utf162utf8($utf16);
+                                $c += 5;
+                                break;
+
+                            case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
+                                $utf8 .= $chrs{$c};
+                                break;
+
+                            case ($ord_chrs_c & 0xE0) == 0xC0:
+                                // characters U-00000080 - U-000007FF, mask 110XXXXX
+                                //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                                $utf8 .= $this->substr8($chrs, $c, 2);
+                                ++$c;
+                                break;
+
+                            case ($ord_chrs_c & 0xF0) == 0xE0:
+                                // characters U-00000800 - U-0000FFFF, mask 1110XXXX
+                                // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                                $utf8 .= $this->substr8($chrs, $c, 3);
+                                $c += 2;
+                                break;
+
+                            case ($ord_chrs_c & 0xF8) == 0xF0:
+                                // characters U-00010000 - U-001FFFFF, mask 11110XXX
+                                // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                                $utf8 .= $this->substr8($chrs, $c, 4);
+                                $c += 3;
+                                break;
+
+                            case ($ord_chrs_c & 0xFC) == 0xF8:
+                                // characters U-00200000 - U-03FFFFFF, mask 111110XX
+                                // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                                $utf8 .= $this->substr8($chrs, $c, 5);
+                                $c += 4;
+                                break;
+
+                            case ($ord_chrs_c & 0xFE) == 0xFC:
+                                // characters U-04000000 - U-7FFFFFFF, mask 1111110X
+                                // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+                                $utf8 .= $this->substr8($chrs, $c, 6);
+                                $c += 5;
+                                break;
+
+                        }
+
+                    }
+
+                    return $utf8;
+
+                } elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
+                    // array, or object notation
+
+                    if ($str{0} == '[') {
+                        $stk = array(SERVICES_JSON_IN_ARR);
+                        $arr = array();
+                    } else {
+                        if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
+                            $stk = array(SERVICES_JSON_IN_OBJ);
+                            $obj = array();
+                        } else {
+                            $stk = array(SERVICES_JSON_IN_OBJ);
+                            $obj = new stdClass();
+                        }
+                    }
+
+                    array_push($stk, array('what'  => SERVICES_JSON_SLICE,
+                                           'where' => 0,
+                                           'delim' => false));
+
+                    $chrs = $this->substr8($str, 1, -1);
+                    $chrs = $this->reduce_string($chrs);
+
+                    if ($chrs == '') {
+                        if (reset($stk) == SERVICES_JSON_IN_ARR) {
+                            return $arr;
+
+                        } else {
+                            return $obj;
+
+                        }
+                    }
+
+                    //print("\nparsing {$chrs}\n");
+
+                    $strlen_chrs = $this->strlen8($chrs);
+
+                    for ($c = 0; $c <= $strlen_chrs; ++$c) {
+
+                        $top = end($stk);
+                        $substr_chrs_c_2 = $this->substr8($chrs, $c, 2);
+
+                        if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) {
+                            // found a comma that is not inside a string, array, etc.,
+                            // OR we've reached the end of the character list
+                            $slice = $this->substr8($chrs, $top['where'], ($c - $top['where']));
+                            array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false));
+                            //print("Found split at {$c}: ".$this->substr8($chrs, $top['where'], (1 + $c - $top['where']))."\n");
+
+                            if (reset($stk) == SERVICES_JSON_IN_ARR) {
+                                // we are in an array, so just push an element onto the stack
+                                array_push($arr, $this->decode($slice));
+
+                            } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
+                                // we are in an object, so figure
+                                // out the property name and set an
+                                // element in an associative array,
+                                // for now
+                                $parts = array();
+                                
+                               if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:/Uis', $slice, $parts)) {
+                                     // "name":value pair
+                                    $key = $this->decode($parts[1]);
+                                    $val = $this->decode(trim(substr($slice, strlen($parts[0])), ", \t\n\r\0\x0B"));
+                                    if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
+                                        $obj[$key] = $val;
+                                    } else {
+                                        $obj->$key = $val;
+                                    }
+                                } elseif (preg_match('/^\s*(\w+)\s*:/Uis', $slice, $parts)) {
+                                    // name:value pair, where name is unquoted
+                                    $key = $parts[1];
+                                    $val = $this->decode(trim(substr($slice, strlen($parts[0])), ", \t\n\r\0\x0B"));
+
+                                    if ($this->use & SERVICES_JSON_LOOSE_TYPE) {
+                                        $obj[$key] = $val;
+                                    } else {
+                                        $obj->$key = $val;
+                                    }
+                                }
+
+                            }
+
+                        } elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
+                            // found a quote, and we are not inside a string
+                            array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));
+                            //print("Found start of string at {$c}\n");
+
+                        } elseif (($chrs{$c} == $top['delim']) &&
+                                 ($top['what'] == SERVICES_JSON_IN_STR) &&
+                                 (($this->strlen8($this->substr8($chrs, 0, $c)) - $this->strlen8(rtrim($this->substr8($chrs, 0, $c), '\\'))) % 2 != 1)) {
+                            // found a quote, we're in a string, and it's not escaped
+                            // we know that it's not escaped becase there is _not_ an
+                            // odd number of backslashes at the end of the string so far
+                            array_pop($stk);
+                            //print("Found end of string at {$c}: ".$this->substr8($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
+
+                        } elseif (($chrs{$c} == '[') &&
+                                 in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
+                            // found a left-bracket, and we are in an array, object, or slice
+                            array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
+                            //print("Found start of array at {$c}\n");
+
+                        } elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
+                            // found a right-bracket, and we're in an array
+                            array_pop($stk);
+                            //print("Found end of array at {$c}: ".$this->substr8($chrs, $top['where'], (1 + $c - $top['where']))."\n");
+
+                        } elseif (($chrs{$c} == '{') &&
+                                 in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
+                            // found a left-brace, and we are in an array, object, or slice
+                            array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
+                            //print("Found start of object at {$c}\n");
+
+                        } elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
+                            // found a right-brace, and we're in an object
+                            array_pop($stk);
+                            //print("Found end of object at {$c}: ".$this->substr8($chrs, $top['where'], (1 + $c - $top['where']))."\n");
+
+                        } elseif (($substr_chrs_c_2 == '/*') &&
+                                 in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
+                            // found a comment start, and we are in an array, object, or slice
+                            array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false));
+                            $c++;
+                            //print("Found start of comment at {$c}\n");
+
+                        } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) {
+                            // found a comment end, and we're in one now
+                            array_pop($stk);
+                            $c++;
+
+                            for ($i = $top['where']; $i <= $c; ++$i)
+                                $chrs = substr_replace($chrs, ' ', $i, 1);
+
+                            //print("Found end of comment at {$c}: ".$this->substr8($chrs, $top['where'], (1 + $c - $top['where']))."\n");
+
+                        }
+
+                    }
+
+                    if (reset($stk) == SERVICES_JSON_IN_ARR) {
+                        return $arr;
+
+                    } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
+                        return $obj;
+
+                    }
+
+                }
+        }
+    }
+
+    /**
+     * @todo Ultimately, this should just call PEAR::isError()
+     */
+    function isError($data, $code = null)
+    {
+        if (class_exists('pear')) {
+            return PEAR::isError($data, $code);
+        } elseif (is_object($data) && (get_class($data) == 'services_json_error' ||
+                                 is_subclass_of($data, 'services_json_error'))) {
+            return true;
+        }
+
+        return false;
+    }
+    
+    /**
+    * Calculates length of string in bytes
+    * @param string 
+    * @return integer length
+    */
+    function strlen8( $str ) 
+    {
+        if ( $this->_mb_strlen ) {
+            return mb_strlen( $str, "8bit" );
+        }
+        return strlen( $str );
+    }
+    
+    /**
+    * Returns part of a string, interpreting $start and $length as number of bytes.
+    * @param string 
+    * @param integer start 
+    * @param integer length 
+    * @return integer length
+    */
+    function substr8( $string, $start, $length=false ) 
+    {
+        if ( $length === false ) {
+            $length = $this->strlen8( $string ) - $start;
+        }
+        if ( $this->_mb_substr ) {
+            return mb_substr( $string, $start, $length, "8bit" );
+        }
+        return substr( $string, $start, $length );
+    }
+
 }
 
 if (class_exists('PEAR_Error')) {
 
-       class Services_JSON_Error extends PEAR_Error
-       {
-               function Services_JSON_Error($message = 'unknown error', $code = null,
-                                                                       $mode = null, $options = null, $userinfo = null)
-               {
-                       parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
-               }
-       }
+    class Services_JSON_Error extends PEAR_Error
+    {
+        function Services_JSON_Error($message = 'unknown error', $code = null,
+                                     $mode = null, $options = null, $userinfo = null)
+        {
+            parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
+        }
+    }
 
 } else {
 
-       /**
-       * @todo Ultimately, this class shall be descended from PEAR_Error
-       */
-       class Services_JSON_Error
-       {
-               function Services_JSON_Error($message = 'unknown error', $code = null,
-                                                                       $mode = null, $options = null, $userinfo = null)
-               {
-
-               }
-       }
-
+    /**
+     * @todo Ultimately, this class shall be descended from PEAR_Error
+     */
+    class Services_JSON_Error
+    {
+        function Services_JSON_Error($message = 'unknown error', $code = null,
+                                     $mode = null, $options = null, $userinfo = null)
+        {
+
+        }
+    }
+    
 }
+
 endif;
index 5ff2a2e05b549d16d7d541567f039aaef07c68e5..a880448db3f0e674a5c9c7079940a6f9dff48dbf 100644 (file)
@@ -30,12 +30,14 @@ class WP_oEmbed {
                // The WP_Embed class disables discovery for non-unfiltered_html users, so only providers in this array will be used for them.
                // Add to this list using the wp_oembed_add_provider() function (see its PHPDoc for details).
                $this->providers = apply_filters( 'oembed_providers', array(
-                       '#https?://(www\.)?youtube.com/watch.*#i'            => array( 'http://www.youtube.com/oembed',                     true  ),
+                       '#https?://(www\.)?youtube\.com/watch.*#i'           => array( 'http://www.youtube.com/oembed',                     true  ),
                        'http://youtu.be/*'                                  => array( 'http://www.youtube.com/oembed',                     false ),
                        'http://blip.tv/*'                                   => array( 'http://blip.tv/oembed/',                            false ),
                        '#https?://(www\.)?vimeo\.com/.*#i'                  => array( 'http://vimeo.com/api/oembed.{format}',              true  ),
                        '#https?://(www\.)?dailymotion\.com/.*#i'            => array( 'http://www.dailymotion.com/services/oembed',        true  ),
+                       'http://dai.ly/*'                                    => array( 'http://www.dailymotion.com/services/oembed',        false ),
                        '#https?://(www\.)?flickr\.com/.*#i'                 => array( 'http://www.flickr.com/services/oembed/',            true  ),
+                       'http://flic.kr/*'                                   => array( 'http://www.flickr.com/services/oembed/',            false ),
                        '#https?://(.+\.)?smugmug\.com/.*#i'                 => array( 'http://api.smugmug.com/services/oembed/',           true  ),
                        '#https?://(www\.)?hulu\.com/watch/.*#i'             => array( 'http://www.hulu.com/api/oembed.{format}',           true  ),
                        '#https?://(www\.)?viddler\.com/.*#i'                => array( 'http://lab.viddler.com/services/oembed/',           true  ),
@@ -47,10 +49,13 @@ class WP_oEmbed {
                        'http://wordpress.tv/*'                              => array( 'http://wordpress.tv/oembed/',                       false ),
                        '#https?://(.+\.)?polldaddy\.com/.*#i'               => array( 'http://polldaddy.com/oembed/',                      true  ),
                        '#https?://(www\.)?funnyordie\.com/videos/.*#i'      => array( 'http://www.funnyordie.com/oembed',                  true  ),
-                       '#https?://(www\.)?twitter.com/.+?/status(es)?/.*#i' => array( 'http://api.twitter.com/1/statuses/oembed.{format}', true  ),
+                       '#https?://(www\.)?twitter\.com/.+?/status(es)?/.*#i'=> array( 'http://api.twitter.com/1/statuses/oembed.{format}', true  ),
                        '#https?://(www\.)?soundcloud\.com/.*#i'             => array( 'http://soundcloud.com/oembed',                      true  ),
-                       '#https?://(www\.)?slideshare.net/*#'                => array( 'http://www.slideshare.net/api/oembed/2',            true  ),
+                       '#https?://(www\.)?slideshare\.net/*#'               => array( 'http://www.slideshare.net/api/oembed/2',            true  ),
                        '#http://instagr(\.am|am\.com)/p/.*#i'               => array( 'http://api.instagram.com/oembed',                   true  ),
+                       '#https?://(www\.)?rdio\.com/.*#i'                   => array( 'http://www.rdio.com/api/oembed/',                   true  ),
+                       '#https?://rd\.io/x/.*#i'                            => array( 'http://www.rdio.com/api/oembed/',                   true  ),
+                       '#https?://(open|play)\.spotify\.com/.*#i'           => array( 'https://embed.spotify.com/oembed/',                 true  ),
                ) );
 
                // Fix any embeds that contain new lines in the middle of the HTML which breaks wpautop().
@@ -108,7 +113,7 @@ class WP_oEmbed {
                $providers = array();
 
                // Fetch URL content
-               if ( $html = wp_remote_retrieve_body( wp_remote_get( $url, array( 'reject_unsafe_urls' => true ) ) ) ) {
+               if ( $html = wp_remote_retrieve_body( wp_safe_remote_get( $url ) ) ) {
 
                        // <link> types that contain oEmbed provider URLs
                        $linktypes = apply_filters( 'oembed_linktypes', array(
@@ -190,7 +195,7 @@ class WP_oEmbed {
         */
        function _fetch_with_format( $provider_url_with_args, $format ) {
                $provider_url_with_args = add_query_arg( 'format', $format, $provider_url_with_args );
-               $response = wp_remote_get( $provider_url_with_args, array( 'reject_unsafe_urls' => true ) );
+               $response = wp_safe_remote_get( $provider_url_with_args );
                if ( 501 == wp_remote_retrieve_response_code( $response ) )
                        return new WP_Error( 'not-implemented' );
                if ( ! $body = wp_remote_retrieve_body( $response ) )
@@ -216,27 +221,52 @@ class WP_oEmbed {
         * @access private
         */
        function _parse_xml( $response_body ) {
-               if ( !function_exists('simplexml_load_string') ) {
-                       return false;
-               }
                if ( ! function_exists( 'libxml_disable_entity_loader' ) )
                        return false;
 
                $loader = libxml_disable_entity_loader( true );
-
                $errors = libxml_use_internal_errors( true );
-               $data = simplexml_load_string( $response_body );
+
+               $return = $this->_parse_xml_body( $response_body );
+
                libxml_use_internal_errors( $errors );
+               libxml_disable_entity_loader( $loader );
 
-               $return = false;
-               if ( is_object( $data ) ) {
-                       $return = new stdClass;
-                       foreach ( $data as $key => $value ) {
-                               $return->$key = (string) $value;
-                       }
+               return $return;
+       }
+
+       /**
+        * Helper function for parsing an XML response body.
+        *
+        * @since 3.6.0
+        * @access private
+        */
+       private function _parse_xml_body( $response_body ) {
+               if ( ! function_exists( 'simplexml_import_dom' ) || ! class_exists( 'DOMDocument' ) )
+                       return false;
+
+               $dom = new DOMDocument;
+               $success = $dom->loadXML( $response_body );
+               if ( ! $success )
+                       return false;
+
+               if ( isset( $dom->doctype ) )
+                       return false;
+
+               foreach ( $dom->childNodes as $child ) {
+                       if ( XML_DOCUMENT_TYPE_NODE === $child->nodeType )
+                               return false;
+               }
+
+               $xml = simplexml_import_dom( $dom );
+               if ( ! $xml )
+                       return false;
+
+               $return = new stdClass;
+               foreach ( $xml as $key => $value ) {
+                       $return->$key = (string) $value;
                }
 
-               libxml_disable_entity_loader( $loader );
                return $return;
        }
 
index df533c27152ce28cafd410e8df2ecab5b9aaf652..38ac37626a8d61057dacc1cfba1cc00519062b82 100644 (file)
@@ -2,7 +2,7 @@
 /*~ class.phpmailer.php
 .---------------------------------------------------------------------------.
 |  Software: PHPMailer - PHP email class                                    |
-|   Version: 5.2.1                                                          |
+|   Version: 5.2.4                                                          |
 |      Site: https://code.google.com/a/apache-extras.org/p/phpmailer/       |
 | ------------------------------------------------------------------------- |
 |     Admin: Jim Jagielski (project admininistrator)                        |
@@ -23,7 +23,7 @@
 */
 
 /**
- * PHPMailer - PHP email transport class
+ * PHPMailer - PHP email creation and transport class
  * NOTE: Requires PHP version 5 or later
  * @package PHPMailer
  * @author Andy Prevost
  * @author Jim Jagielski
  * @copyright 2010 - 2012 Jim Jagielski
  * @copyright 2004 - 2009 Andy Prevost
- * @version $Id: class.phpmailer.php 450 2010-06-23 16:46:33Z coolbru $
  * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
  */
 
 if (version_compare(PHP_VERSION, '5.0.0', '<') ) exit("Sorry, this version of PHPMailer will only run on PHP version 5 or greater!\n");
 
+/**
+ * PHP email creation and transport class
+ * @package PHPMailer
+ */
 class PHPMailer {
 
   /////////////////////////////////////////////////
@@ -93,6 +96,13 @@ class PHPMailer {
    */
   public $Sender            = '';
 
+  /**
+   * Sets the Return-Path of the message.  If empty, it will
+   * be set to either From or Sender.
+   * @var string
+   */
+  public $ReturnPath        = '';
+
   /**
    * Sets the Subject of the message.
    * @var string
@@ -130,11 +140,11 @@ class PHPMailer {
   protected $MIMEHeader     = '';
 
   /**
-   * Stores the complete sent MIME message (Body and Headers)
+   * Stores the extra header list which CreateHeader() doesn't fold in
    * @var string
    * @access protected
   */
-  protected $SentMIMEMessage     = '';
+  protected $mailHeader     = '';
 
   /**
    * Sets word wrapping on the body of the message to a given number of
@@ -155,6 +165,13 @@ class PHPMailer {
    */
   public $Sendmail          = '/usr/sbin/sendmail';
 
+  /**
+   * Determine if mail() uses a fully sendmail compatible MTA that
+   * supports sendmail's "-oi -f" options
+   * @var boolean
+   */
+  public $UseSendmailOptions   = true;
+  
   /**
    * Path to PHPMailer plugins.  Useful if the SMTP class
    * is in a different directory than the PHP include path.
@@ -183,12 +200,21 @@ class PHPMailer {
    */
   public $MessageID         = '';
 
+  /**
+   * Sets the message Date to be used in the Date header.
+   * If empty, the current date will be added.
+   * @var string
+   */
+  public $MessageDate       = '';
+
   /////////////////////////////////////////////////
   // PROPERTIES FOR SMTP
   /////////////////////////////////////////////////
 
   /**
-   * Sets the SMTP hosts.  All hosts must be separated by a
+   * Sets the SMTP hosts.
+   *
+   * All hosts must be separated by a
    * semicolon.  You can also specify a different port
    * for each host by using this format: [hostname:port]
    * (e.g. "smtp1.example.com:25;smtp2.example.com").
@@ -210,8 +236,7 @@ class PHPMailer {
   public $Helo          = '';
 
   /**
-   * Sets connection prefix.
-   * Options are "", "ssl" or "tls"
+   * Sets connection prefix. Options are "", "ssl" or "tls"
    * @var string
    */
   public $SMTPSecure    = '';
@@ -234,6 +259,24 @@ class PHPMailer {
    */
   public $Password      = '';
 
+  /**
+   *  Sets SMTP auth type. Options are LOGIN | PLAIN | NTLM  (default LOGIN)
+   *  @var string
+   */
+  public $AuthType      = '';
+  
+  /**
+   *  Sets SMTP realm.
+   *  @var string
+   */
+  public $Realm         = '';
+
+  /**
+   *  Sets SMTP workstation.
+   *  @var string
+   */
+  public $Workstation   = '';
+
   /**
    * Sets the SMTP server timeout in seconds.
    * This function will not work with the win32 version.
@@ -247,6 +290,13 @@ class PHPMailer {
    */
   public $SMTPDebug     = false;
 
+  /**
+   * Sets the function/method to use for debugging output.
+   * Right now we only honor "echo" or "error_log"
+   * @var string
+   */
+  public $Debugoutput     = "echo";
+
   /**
    * Prevents the SMTP connection from being closed after each mail
    * sending.  If this is set to true then to close the connection
@@ -269,53 +319,69 @@ class PHPMailer {
   public $SingleToArray = array();
 
  /**
-   * Provides the ability to change the line ending
+   * Provides the ability to change the generic line ending
+   * NOTE: The default remains '\n'. We force CRLF where we KNOW
+   *        it must be used via self::CRLF
    * @var string
    */
   public $LE              = "\n";
 
-  /**
-   * Used with DKIM DNS Resource Record
+   /**
+   * Used with DKIM Signing
+   * required parameter if DKIM is enabled
+   *
+   * domain selector example domainkey
    * @var string
    */
-  public $DKIM_selector   = 'phpmailer';
+  public $DKIM_selector   = '';
 
   /**
-   * Used with DKIM DNS Resource Record
-   * optional, in format of email address 'you@yourdomain.com'
+   * Used with DKIM Signing
+   * required if DKIM is enabled, in format of email address 'you@yourdomain.com' typically used as the source of the email
    * @var string
    */
   public $DKIM_identity   = '';
 
   /**
-   * Used with DKIM DNS Resource Record
+   * Used with DKIM Signing
+   * optional parameter if your private key requires a passphras
    * @var string
    */
   public $DKIM_passphrase   = '';
 
   /**
-   * Used with DKIM DNS Resource Record
-   * optional, in format of email address 'you@yourdomain.com'
+   * Used with DKIM Singing
+   * required if DKIM is enabled, in format of email address 'domain.com'
    * @var string
    */
   public $DKIM_domain     = '';
 
   /**
-   * Used with DKIM DNS Resource Record
-   * optional, in format of email address 'you@yourdomain.com'
+   * Used with DKIM Signing
+   * required if DKIM is enabled, path to private key file
    * @var string
    */
   public $DKIM_private    = '';
 
   /**
-   * Callback Action function name
-   * the function that handles the result of the send email action. Parameters:
+   * Callback Action function name.
+   * The function that handles the result of the send email action.
+   * It is called out by Send() for each email sent.
+   *
+   * Value can be:
+   * - 'function_name' for function names
+   * - 'Class::Method' for static method calls
+   * - array($object, 'Method') for calling methods on $object
+   * See http://php.net/is_callable manual page for more details.
+   *
+   * Parameters:
    *   bool    $result        result of the send action
    *   string  $to            email address of the recipient
    *   string  $cc            cc email addresses
    *   string  $bcc           bcc email addresses
    *   string  $subject       the subject
    *   string  $body          the email body
+   *   string  $from          email address of sender
    * @var string
    */
   public $action_function = ''; //'callbackAction';
@@ -324,11 +390,11 @@ class PHPMailer {
    * Sets the PHPMailer Version number
    * @var string
    */
-  public $Version         = '5.2.1';
+  public $Version         = '5.2.4';
 
   /**
    * What to use in the X-Mailer header
-   * @var string
+   * @var string NULL for default, whitespace for None, or actual string to use
    */
   public $XMailer         = '';
 
@@ -336,21 +402,85 @@ class PHPMailer {
   // PROPERTIES, PRIVATE AND PROTECTED
   /////////////////////////////////////////////////
 
-  protected   $smtp           = NULL;
+  /**
+   * @var SMTP An instance of the SMTP sender class
+   * @access protected
+   */
+  protected   $smtp           = null;
+  /**
+   * @var array An array of 'to' addresses
+   * @access protected
+   */
   protected   $to             = array();
+  /**
+   * @var array An array of 'cc' addresses
+   * @access protected
+   */
   protected   $cc             = array();
+  /**
+   * @var array An array of 'bcc' addresses
+   * @access protected
+   */
   protected   $bcc            = array();
+  /**
+   * @var array An array of reply-to name and address
+   * @access protected
+   */
   protected   $ReplyTo        = array();
+  /**
+   * @var array An array of all kinds of addresses: to, cc, bcc, replyto
+   * @access protected
+   */
   protected   $all_recipients = array();
+  /**
+   * @var array An array of attachments
+   * @access protected
+   */
   protected   $attachment     = array();
+  /**
+   * @var array An array of custom headers
+   * @access protected
+   */
   protected   $CustomHeader   = array();
+  /**
+   * @var string The message's MIME type
+   * @access protected
+   */
   protected   $message_type   = '';
+  /**
+   * @var array An array of MIME boundary strings
+   * @access protected
+   */
   protected   $boundary       = array();
+  /**
+   * @var array An array of available languages
+   * @access protected
+   */
   protected   $language       = array();
+  /**
+   * @var integer The number of errors encountered
+   * @access protected
+   */
   protected   $error_count    = 0;
+  /**
+   * @var string The filename of a DKIM certificate file
+   * @access protected
+   */
   protected   $sign_cert_file = '';
+  /**
+   * @var string The filename of a DKIM key file
+   * @access protected
+   */
   protected   $sign_key_file  = '';
+  /**
+   * @var string The password of a DKIM key
+   * @access protected
+   */
   protected   $sign_key_pass  = '';
+  /**
+   * @var boolean Whether to throw exceptions for errors
+   * @access protected
+   */
   protected   $exceptions     = false;
 
   /////////////////////////////////////////////////
@@ -360,11 +490,46 @@ class PHPMailer {
   const STOP_MESSAGE  = 0; // message only, continue processing
   const STOP_CONTINUE = 1; // message?, likely ok to continue processing
   const STOP_CRITICAL = 2; // message, plus full stop, critical error reached
-
+  const CRLF = "\r\n";     // SMTP RFC specified EOL
+  
   /////////////////////////////////////////////////
   // METHODS, VARIABLES
   /////////////////////////////////////////////////
 
+  /**
+   * Calls actual mail() function, but in a safe_mode aware fashion
+   * Also, unless sendmail_path points to sendmail (or something that
+   * claims to be sendmail), don't pass params (not a perfect fix,
+   * but it will do)
+   * @param string $to To
+   * @param string $subject Subject
+   * @param string $body Message Body
+   * @param string $header Additional Header(s)
+   * @param string $params Params
+   * @access private
+   * @return bool
+   */
+  private function mail_passthru($to, $subject, $body, $header, $params) {
+    if ( ini_get('safe_mode') || !($this->UseSendmailOptions) ) {
+        $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($subject)), $body, $header);
+    } else {
+        $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($subject)), $body, $header, $params);
+    }
+    return $rt;
+  }
+
+  /**
+   * Outputs debugging info via user-defined method
+   * @param string $str
+   */
+  private function edebug($str) {
+    if ($this->Debugoutput == "error_log") {
+        error_log($str);
+    } else {
+        echo $str;
+    }
+  }
+
   /**
    * Constructor
    * @param boolean $exceptions Should we throw external exceptions?
@@ -476,6 +641,7 @@ class PHPMailer {
    * @param string $kind One of 'to', 'cc', 'bcc', 'ReplyTo'
    * @param string $address The email address to send to
    * @param string $name
+   * @throws phpmailerException
    * @return boolean true on success, false if address already used or invalid in some way
    * @access protected
    */
@@ -485,20 +651,20 @@ class PHPMailer {
       if ($this->exceptions) {
         throw new phpmailerException('Invalid recipient array: ' . $kind);
       }
-         if ($this->SMTPDebug) {
-        echo $this->Lang('Invalid recipient array').': '.$kind;
+      if ($this->SMTPDebug) {
+        $this->edebug($this->Lang('Invalid recipient array').': '.$kind);
       }
       return false;
     }
     $address = trim($address);
     $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
-    if (!self::ValidateAddress($address)) {
+    if (!$this->ValidateAddress($address)) {
       $this->SetError($this->Lang('invalid_address').': '. $address);
       if ($this->exceptions) {
         throw new phpmailerException($this->Lang('invalid_address').': '.$address);
       }
-         if ($this->SMTPDebug) {
-        echo $this->Lang('invalid_address').': '.$address;
+      if ($this->SMTPDebug) {
+        $this->edebug($this->Lang('invalid_address').': '.$address);
       }
       return false;
     }
@@ -521,18 +687,20 @@ class PHPMailer {
  * Set the From and FromName properties
  * @param string $address
  * @param string $name
+ * @param int $auto Also set Reply-To and Sender
+   * @throws phpmailerException
  * @return boolean
  */
   public function SetFrom($address, $name = '', $auto = 1) {
     $address = trim($address);
     $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
-    if (!self::ValidateAddress($address)) {
+    if (!$this->ValidateAddress($address)) {
       $this->SetError($this->Lang('invalid_address').': '. $address);
       if ($this->exceptions) {
         throw new phpmailerException($this->Lang('invalid_address').': '.$address);
       }
-         if ($this->SMTPDebug) {
-        echo $this->Lang('invalid_address').': '.$address;
+      if ($this->SMTPDebug) {
+        $this->edebug($this->Lang('invalid_address').': '.$address);
       }
       return false;
     }
@@ -551,25 +719,31 @@ class PHPMailer {
 
   /**
    * Check that a string looks roughly like an email address should
-   * Static so it can be used without instantiation
-   * Tries to use PHP built-in validator in the filter extension (from PHP 5.2), falls back to a reasonably competent regex validator
-   * Conforms approximately to RFC2822
-   * @link http://www.hexillion.com/samples/#Regex Original pattern found here
+   * Static so it can be used without instantiation, public so people can overload
+   * Conforms to RFC5322: Uses *correct* regex on which FILTER_VALIDATE_EMAIL is
+   * based; So why not use FILTER_VALIDATE_EMAIL? Because it was broken to
+   * not allow a@b type valid addresses :(
+   * Some Versions of PHP break on the regex though, likely due to PCRE, so use
+   * the older validation method for those users. (http://php.net/manual/en/pcre.installation.php)
+   * @link http://squiloople.com/2009/12/20/email-address-validation/
+   * @copyright regex Copyright Michael Rushton 2009-10 | http://squiloople.com/ | Feel free to use and redistribute this code. But please keep this copyright notice.
    * @param string $address The email address to check
    * @return boolean
    * @static
    * @access public
    */
   public static function ValidateAddress($address) {
-    if (function_exists('filter_var')) { //Introduced in PHP 5.2
-      if(filter_var($address, FILTER_VALIDATE_EMAIL) === FALSE) {
-        return false;
-      } else {
-        return true;
-      }
+       if ((defined('PCRE_VERSION')) && (version_compare(PCRE_VERSION, '8.0') >= 0)) {
+         return preg_match('/^(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){255,})(?!(?>(?1)"?(?>\\\[ -~]|[^"])"?(?1)){65,}@)((?>(?>(?>((?>(?>(?>\x0D\x0A)?[     ])+|(?>[        ]*\x0D\x0A)?[   ]+)?)(\((?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-\'*-\[\]-\x7F]|\\\[\x00-\x7F]|(?3)))*(?2)\)))+(?2))|(?2))?)([!#-\'*+\/-9=?^-~-]+|"(?>(?2)(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\x7F]))*(?2)")(?>(?1)\.(?1)(?4))*(?1)@(?!(?1)[a-z0-9-]{64,})(?1)(?>([a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>(?1)\.(?!(?1)[a-z0-9-]{64,})(?1)(?5)){0,126}|\[(?:(?>IPv6:(?>([a-f0-9]{1,4})(?>:(?6)){7}|(?!(?:.*[a-f0-9][:\]]){7,})((?6)(?>:(?6)){0,5})?::(?7)?))|(?>(?>IPv6:(?>(?6)(?>:(?6)){5}:|(?!(?:.*[a-f0-9]:){5,})(?8)?::(?>((?6)(?>:(?6)){0,3}):)?))?(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?>\.(?9)){3}))\])(?1)$/isD', $address);
+       } elseif (function_exists('filter_var')) { //Introduced in PHP 5.2
+        if(filter_var($address, FILTER_VALIDATE_EMAIL) === FALSE) {
+          return false;
+        } else {
+          return true;
+        }
     } else {
-      return preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_-]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $address);
-    }
+        return preg_match('/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!\.)){0,61}[a-zA-Z0-9_-]?\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/', $address);
+       }
   }
 
   /////////////////////////////////////////////////
@@ -580,6 +754,7 @@ class PHPMailer {
    * Creates message and assigns Mailer. If the message is
    * not sent successfully then it returns false.  Use the ErrorInfo
    * variable to view description of the error.
+   * @throws phpmailerException
    * @return bool
    */
   public function Send() {
@@ -587,7 +762,7 @@ class PHPMailer {
       if(!$this->PreSend()) return false;
       return $this->PostSend();
     } catch (phpmailerException $e) {
-         $this->SentMIMEMessage = '';
+      $this->mailHeader = '';
       $this->SetError($e->getMessage());
       if ($this->exceptions) {
         throw $e;
@@ -596,9 +771,14 @@ class PHPMailer {
     }
   }
 
-  protected function PreSend() {
+  /**
+   * Prep mail by constructing all message entities
+   * @throws phpmailerException
+   * @return bool
+   */
+  public function PreSend() {
     try {
-         $mailHeader = "";
+      $this->mailHeader = "";
       if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) {
         throw new phpmailerException($this->Lang('provide_address'), self::STOP_CRITICAL);
       }
@@ -619,26 +799,25 @@ class PHPMailer {
       $this->MIMEBody = $this->CreateBody();
 
       // To capture the complete message when using mail(), create
-         // an extra header list which CreateHeader() doesn't fold in
+      // an extra header list which CreateHeader() doesn't fold in
       if ($this->Mailer == 'mail') {
         if (count($this->to) > 0) {
-          $mailHeader .= $this->AddrAppend("To", $this->to);
+          $this->mailHeader .= $this->AddrAppend("To", $this->to);
         } else {
-          $mailHeader .= $this->HeaderLine("To", "undisclosed-recipients:;");
+          $this->mailHeader .= $this->HeaderLine("To", "undisclosed-recipients:;");
         }
-        $mailHeader .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader(trim($this->Subject))));
+        $this->mailHeader .= $this->HeaderLine('Subject', $this->EncodeHeader($this->SecureHeader(trim($this->Subject))));
         // if(count($this->cc) > 0) {
-            // $mailHeader .= $this->AddrAppend("Cc", $this->cc);
+            // $this->mailHeader .= $this->AddrAppend("Cc", $this->cc);
         // }
       }
 
       // digitally sign with DKIM if enabled
-      if ($this->DKIM_domain && $this->DKIM_private) {
+      if (!empty($this->DKIM_domain) && !empty($this->DKIM_private) && !empty($this->DKIM_selector) && !empty($this->DKIM_domain) && file_exists($this->DKIM_private)) {
         $header_dkim = $this->DKIM_Add($this->MIMEHeader, $this->EncodeHeader($this->SecureHeader($this->Subject)), $this->MIMEBody);
         $this->MIMEHeader = str_replace("\r\n", "\n", $header_dkim) . $this->MIMEHeader;
       }
 
-      $this->SentMIMEMessage = sprintf("%s%s\r\n\r\n%s",$this->MIMEHeader,$mailHeader,$this->MIMEBody);
       return true;
 
     } catch (phpmailerException $e) {
@@ -650,7 +829,13 @@ class PHPMailer {
     }
   }
 
-  protected function PostSend() {
+  /**
+   * Actual Email transport function
+   * Send the email via the selected mechanism
+   * @throws phpmailerException
+   * @return bool
+   */
+  public function PostSend() {
     try {
       // Choose the mailer and send through it
       switch($this->Mailer) {
@@ -663,34 +848,34 @@ class PHPMailer {
         default:
           return $this->MailSend($this->MIMEHeader, $this->MIMEBody);
       }
-
     } catch (phpmailerException $e) {
       $this->SetError($e->getMessage());
       if ($this->exceptions) {
         throw $e;
       }
-         if ($this->SMTPDebug) {
-        echo $e->getMessage()."\n";
+      if ($this->SMTPDebug) {
+        $this->edebug($e->getMessage()."\n");
       }
-      return false;
     }
+    return false;
   }
 
   /**
    * Sends mail using the $Sendmail program.
    * @param string $header The message headers
    * @param string $body The message body
+   * @throws phpmailerException
    * @access protected
    * @return bool
    */
   protected function SendmailSend($header, $body) {
     if ($this->Sender != '') {
-      $sendmail = sprintf("%s -oi -f %s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
+      $sendmail = sprintf("%s -oi -f%s -t", escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
     } else {
       $sendmail = sprintf("%s -oi -t", escapeshellcmd($this->Sendmail));
     }
     if ($this->SingleTo === true) {
-      foreach ($this->SingleToArray as $key => $val) {
+      foreach ($this->SingleToArray as $val) {
         if(!@$mail = popen($sendmail, 'w')) {
           throw new phpmailerException($this->Lang('execute') . $this->Sendmail, self::STOP_CRITICAL);
         }
@@ -726,6 +911,7 @@ class PHPMailer {
    * Sends mail using the PHP mail() function.
    * @param string $header The message headers
    * @param string $body The message body
+     * @throws phpmailerException
    * @access protected
    * @return bool
    */
@@ -739,38 +925,25 @@ class PHPMailer {
     if (empty($this->Sender)) {
       $params = "-oi ";
     } else {
-      $params = sprintf("-oi -f %s", $this->Sender);
+      $params = sprintf("-oi -f%s", $this->Sender);
     }
     if ($this->Sender != '' and !ini_get('safe_mode')) {
       $old_from = ini_get('sendmail_from');
       ini_set('sendmail_from', $this->Sender);
-      if ($this->SingleTo === true && count($toArr) > 1) {
-        foreach ($toArr as $key => $val) {
-          $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
-          // implement call back function if it exists
-          $isSent = ($rt == 1) ? 1 : 0;
-          $this->doCallback($isSent, $val, $this->cc, $this->bcc, $this->Subject, $body);
-        }
-      } else {
-        $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params);
+    }
+      $rt = false;
+    if ($this->SingleTo === true && count($toArr) > 1) {
+      foreach ($toArr as $val) {
+        $rt = $this->mail_passthru($val, $this->Subject, $body, $header, $params);
         // implement call back function if it exists
         $isSent = ($rt == 1) ? 1 : 0;
-        $this->doCallback($isSent, $to, $this->cc, $this->bcc, $this->Subject, $body);
+        $this->doCallback($isSent, $val, $this->cc, $this->bcc, $this->Subject, $body);
       }
     } else {
-      if ($this->SingleTo === true && count($toArr) > 1) {
-        foreach ($toArr as $key => $val) {
-          $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header);
-          // implement call back function if it exists
-          $isSent = ($rt == 1) ? 1 : 0;
-          $this->doCallback($isSent, $val, $this->cc, $this->bcc, $this->Subject, $body);
-        }
-      } else {
-        $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header);
-        // implement call back function if it exists
-        $isSent = ($rt == 1) ? 1 : 0;
-        $this->doCallback($isSent, $to, $this->cc, $this->bcc, $this->Subject, $body);
-      }
+      $rt = $this->mail_passthru($to, $this->Subject, $body, $header, $params);
+      // implement call back function if it exists
+      $isSent = ($rt == 1) ? 1 : 0;
+      $this->doCallback($isSent, $to, $this->cc, $this->bcc, $this->Subject, $body);
     }
     if (isset($old_from)) {
       ini_set('sendmail_from', $old_from);
@@ -786,6 +959,7 @@ class PHPMailer {
    * Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
    * @param string $header The message headers
    * @param string $body The message body
+   * @throws phpmailerException
    * @uses SMTP
    * @access protected
    * @return bool
@@ -799,7 +973,8 @@ class PHPMailer {
     }
     $smtp_from = ($this->Sender == '') ? $this->From : $this->Sender;
     if(!$this->smtp->Mail($smtp_from)) {
-      throw new phpmailerException($this->Lang('from_failed') . $smtp_from, self::STOP_CRITICAL);
+      $this->SetError($this->Lang('from_failed') . $smtp_from . " : " . implode(",",$this->smtp->getError())) ;
+      throw new phpmailerException($this->ErrorInfo, self::STOP_CRITICAL);
     }
 
     // Attempt to send attach all recipients
@@ -850,6 +1025,9 @@ class PHPMailer {
     }
     if($this->SMTPKeepAlive == true) {
       $this->smtp->Reset();
+    } else {
+        $this->smtp->Quit();
+        $this->smtp->Close();
     }
     return true;
   }
@@ -859,13 +1037,15 @@ class PHPMailer {
    * Returns false if the operation failed.
    * @uses SMTP
    * @access public
+   * @throws phpmailerException
    * @return bool
    */
   public function SmtpConnect() {
     if(is_null($this->smtp)) {
-      $this->smtp = new SMTP();
+      $this->smtp = new SMTP;
     }
 
+    $this->smtp->Timeout = $this->Timeout;
     $this->smtp->do_debug = $this->SMTPDebug;
     $hosts = explode(';', $this->Host);
     $index = 0;
@@ -893,7 +1073,7 @@ class PHPMailer {
 
           if ($tls) {
             if (!$this->smtp->StartTLS()) {
-              throw new phpmailerException($this->Lang('tls'));
+              throw new phpmailerException($this->Lang('connect_host'));
             }
 
             //We must resend HELO after tls negotiation
@@ -902,19 +1082,20 @@ class PHPMailer {
 
           $connection = true;
           if ($this->SMTPAuth) {
-            if (!$this->smtp->Authenticate($this->Username, $this->Password)) {
+            if (!$this->smtp->Authenticate($this->Username, $this->Password, $this->AuthType,
+                                           $this->Realm, $this->Workstation)) {
               throw new phpmailerException($this->Lang('authenticate'));
             }
           }
         }
         $index++;
-        if (!$connection) {
-          throw new phpmailerException($this->Lang('connect_host'));
-        }
+      if (!$connection) {
+        throw new phpmailerException($this->Lang('connect_host'));
+      }
       }
     } catch (phpmailerException $e) {
       $this->smtp->Reset();
-         if ($this->exceptions) {
+      if ($this->exceptions) {
         throw $e;
       }
     }
@@ -926,7 +1107,7 @@ class PHPMailer {
    * @return void
    */
   public function SmtpClose() {
-    if(!is_null($this->smtp)) {
+    if ($this->smtp !== null) {
       if($this->smtp->Connected()) {
         $this->smtp->Quit();
         $this->smtp->Close();
@@ -939,28 +1120,30 @@ class PHPMailer {
   * Returns false if it cannot load the language file.  The default language is English.
   * @param string $langcode ISO 639-1 2-character language code (e.g. Portuguese: "br")
   * @param string $lang_path Path to the language file directory
+   * @return bool
   * @access public
   */
   function SetLanguage($langcode = 'en', $lang_path = 'language/') {
     //Define full set of translatable strings
     $PHPMAILER_LANG = array(
-      'provide_address' => 'You must provide at least one recipient email address.',
+      'authenticate'         => 'SMTP Error: Could not authenticate.',
+      'connect_host'         => 'SMTP Error: Could not connect to SMTP host.',
+      'data_not_accepted'    => 'SMTP Error: Data not accepted.',
+      'empty_message'        => 'Message body empty',
+      'encoding'             => 'Unknown encoding: ',
+      'execute'              => 'Could not execute: ',
+      'file_access'          => 'Could not access file: ',
+      'file_open'            => 'File Error: Could not open file: ',
+      'from_failed'          => 'The following From address failed: ',
+      'instantiate'          => 'Could not instantiate mail function.',
+      'invalid_address'      => 'Invalid address',
       'mailer_not_supported' => ' mailer is not supported.',
-      'execute' => 'Could not execute: ',
-      'instantiate' => 'Could not instantiate mail function.',
-      'authenticate' => 'SMTP Error: Could not authenticate.',
-      'from_failed' => 'The following From address failed: ',
-      'recipients_failed' => 'SMTP Error: The following recipients failed: ',
-      'data_not_accepted' => 'SMTP Error: Data not accepted.',
-      'connect_host' => 'SMTP Error: Could not connect to SMTP host.',
-      'file_access' => 'Could not access file: ',
-      'file_open' => 'File Error: Could not open file: ',
-      'encoding' => 'Unknown encoding: ',
-      'signing' => 'Signing Error: ',
-      'smtp_error' => 'SMTP server error: ',
-      'empty_message' => 'Message body empty',
-      'invalid_address' => 'Invalid address',
-      'variable_set' => 'Cannot set or reset variable: '
+      'provide_address'      => 'You must provide at least one recipient email address.',
+      'recipients_failed'    => 'SMTP Error: The following recipients failed: ',
+      'signing'              => 'Signing Error: ',
+      'smtp_connect_failed'  => 'SMTP Connect() failed.',
+      'smtp_error'           => 'SMTP server error: ',
+      'variable_set'         => 'Cannot set or reset variable: '
     );
     //Overwrite language-specific strings. This way we'll never have missing translations - no more "language string failed to load"!
     $l = true;
@@ -986,6 +1169,8 @@ class PHPMailer {
   /**
    * Creates recipient headers.
    * @access public
+   * @param string $type
+   * @param array $addr
    * @return string
    */
   public function AddrAppend($type, $addr) {
@@ -1003,6 +1188,7 @@ class PHPMailer {
   /**
    * Formats an address correctly.
    * @access public
+   * @param string $addr
    * @return string
    */
   public function AddrFormat($addr) {
@@ -1028,13 +1214,15 @@ class PHPMailer {
     // If utf-8 encoding is used, we will need to make sure we don't
     // split multibyte characters when we wrap
     $is_utf8 = (strtolower($this->CharSet) == "utf-8");
+    $lelen = strlen($this->LE);
+    $crlflen = strlen(self::CRLF);
 
     $message = $this->FixEOL($message);
-    if (substr($message, -1) == $this->LE) {
-      $message = substr($message, 0, -1);
+    if (substr($message, -$lelen) == $this->LE) {
+      $message = substr($message, 0, -$lelen);
     }
 
-    $line = explode($this->LE, $message);
+    $line = explode($this->LE, $message);   // Magic. We know FixEOL uses $LE
     $message = '';
     for ($i = 0 ;$i < count($line); $i++) {
       $line_part = explode(' ', $line[$i]);
@@ -1042,7 +1230,7 @@ class PHPMailer {
       for ($e = 0; $e<count($line_part); $e++) {
         $word = $line_part[$e];
         if ($qp_mode and (strlen($word) > $length)) {
-          $space_left = $length - strlen($buf) - 1;
+          $space_left = $length - strlen($buf) - $crlflen;
           if ($e != 0) {
             if ($space_left > 20) {
               $len = $space_left;
@@ -1056,7 +1244,7 @@ class PHPMailer {
               $part = substr($word, 0, $len);
               $word = substr($word, $len);
               $buf .= ' ' . $part;
-              $message .= $buf . sprintf("=%s", $this->LE);
+              $message .= $buf . sprintf("=%s", self::CRLF);
             } else {
               $message .= $buf . $soft_break;
             }
@@ -1075,7 +1263,7 @@ class PHPMailer {
             $word = substr($word, $len);
 
             if (strlen($word) > 0) {
-              $message .= $part . sprintf("=%s", $this->LE);
+              $message .= $part . sprintf("=%s", self::CRLF);
             } else {
               $buf = $part;
             }
@@ -1090,7 +1278,7 @@ class PHPMailer {
           }
         }
       }
-      $message .= $buf . $this->LE;
+      $message .= $buf . self::CRLF;
     }
 
     return $message;
@@ -1175,8 +1363,15 @@ class PHPMailer {
     $this->boundary[2] = 'b2_' . $uniq_id;
     $this->boundary[3] = 'b3_' . $uniq_id;
 
-    $result .= $this->HeaderLine('Date', self::RFCDate());
-    if($this->Sender == '') {
+    if ($this->MessageDate == '') {
+      $result .= $this->HeaderLine('Date', self::RFCDate());
+    } else {
+      $result .= $this->HeaderLine('Date', $this->MessageDate);
+    }
+
+    if ($this->ReturnPath) {
+      $result .= $this->HeaderLine('Return-Path', trim($this->ReturnPath));
+    } elseif ($this->Sender == '') {
       $result .= $this->HeaderLine('Return-Path', trim($this->From));
     } else {
       $result .= $this->HeaderLine('Return-Path', trim($this->Sender));
@@ -1195,7 +1390,7 @@ class PHPMailer {
           $result .= $this->HeaderLine('To', 'undisclosed-recipients:;');
         }
       }
-       }
+    }
 
     $from = array();
     $from[0][0] = trim($this->From);
@@ -1227,10 +1422,13 @@ class PHPMailer {
       $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE);
     }
     $result .= $this->HeaderLine('X-Priority', $this->Priority);
-    if($this->XMailer) {
-      $result .= $this->HeaderLine('X-Mailer', $this->XMailer);
+    if ($this->XMailer == '') {
+        $result .= $this->HeaderLine('X-Mailer', 'PHPMailer '.$this->Version.' (http://code.google.com/a/apache-extras.org/p/phpmailer/)');
     } else {
-      $result .= $this->HeaderLine('X-Mailer', 'PHPMailer '.$this->Version.' (http://code.google.com/a/apache-extras.org/p/phpmailer/)');
+      $myXmailer = trim($this->XMailer);
+      if ($myXmailer) {
+        $result .= $this->HeaderLine('X-Mailer', $myXmailer);
+      }
     }
 
     if($this->ConfirmReadingTo != '') {
@@ -1257,10 +1455,6 @@ class PHPMailer {
   public function GetMailMIME() {
     $result = '';
     switch($this->message_type) {
-      case 'plain':
-        $result .= $this->HeaderLine('Content-Transfer-Encoding', $this->Encoding);
-        $result .= $this->TextLine('Content-Type: '.$this->ContentType.'; charset="'.$this->CharSet.'"');
-        break;
       case 'inline':
         $result .= $this->HeaderLine('Content-Type', 'multipart/related;');
         $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
@@ -1277,10 +1471,15 @@ class PHPMailer {
         $result .= $this->HeaderLine('Content-Type', 'multipart/alternative;');
         $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
         break;
+      default:
+        // Catches case 'plain': and case '':
+        $result .= $this->HeaderLine('Content-Transfer-Encoding', $this->Encoding);
+        $result .= $this->TextLine('Content-Type: '.$this->ContentType.'; charset='.$this->CharSet);
+        break;
     }
 
     if($this->Mailer != 'mail') {
-      $result .= $this->LE.$this->LE;
+      $result .= $this->LE;
     }
 
     return $result;
@@ -1292,28 +1491,26 @@ class PHPMailer {
    * @return string
    */
   public function GetSentMIMEMessage() {
-    return $this->SentMIMEMessage;
+    return $this->MIMEHeader . $this->mailHeader . self::CRLF . $this->MIMEBody;
   }
 
 
   /**
    * Assembles the message body.  Returns an empty string on failure.
    * @access public
+   * @throws phpmailerException
    * @return string The assembled message body
    */
   public function CreateBody() {
     $body = '';
 
     if ($this->sign_key_file) {
-      $body .= $this->GetMailMIME();
+      $body .= $this->GetMailMIME().$this->LE;
     }
 
     $this->SetWordWrap();
 
     switch($this->message_type) {
-      case 'plain':
-        $body .= $this->EncodeString($this->Body, $this->Encoding);
-        break;
       case 'inline':
         $body .= $this->GetBoundary($this->boundary[1], '', '', '');
         $body .= $this->EncodeString($this->Body, $this->Encoding);
@@ -1398,6 +1595,10 @@ class PHPMailer {
         $body .= $this->LE;
         $body .= $this->AttachAll("attachment", $this->boundary[1]);
         break;
+      default:
+        // catch case 'plain' and case ''
+        $body .= $this->EncodeString($this->Body, $this->Encoding);
+        break;
     }
 
     if ($this->IsError()) {
@@ -1430,6 +1631,10 @@ class PHPMailer {
   /**
    * Returns the start of a message boundary.
    * @access protected
+   * @param string $boundary
+   * @param string $charSet
+   * @param string $contentType
+   * @param string $encoding
    * @return string
    */
   protected function GetBoundary($boundary, $charSet, $contentType, $encoding) {
@@ -1444,7 +1649,7 @@ class PHPMailer {
       $encoding = $this->Encoding;
     }
     $result .= $this->TextLine('--' . $boundary);
-    $result .= sprintf("Content-Type: %s; charset=\"%s\"", $contentType, $charSet);
+    $result .= sprintf("Content-Type: %s; charset=%s", $contentType, $charSet);
     $result .= $this->LE;
     $result .= $this->HeaderLine('Content-Transfer-Encoding', $encoding);
     $result .= $this->LE;
@@ -1455,6 +1660,7 @@ class PHPMailer {
   /**
    * Returns the end of a message boundary.
    * @access protected
+   * @param string $boundary
    * @return string
    */
   protected function EndBoundary($boundary) {
@@ -1478,6 +1684,8 @@ class PHPMailer {
   /**
    *  Returns a formatted header line.
    * @access public
+   * @param string $name
+   * @param string $value
    * @return string
    */
   public function HeaderLine($name, $value) {
@@ -1487,6 +1695,7 @@ class PHPMailer {
   /**
    * Returns a formatted mail line.
    * @access public
+   * @param string $value
    * @return string
    */
   public function TextLine($value) {
@@ -1505,6 +1714,7 @@ class PHPMailer {
    * @param string $name Overrides the attachment name.
    * @param string $encoding File encoding (see $Encoding).
    * @param string $type File extension (MIME) type.
+   * @throws phpmailerException
    * @return bool
    */
   public function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
@@ -1533,8 +1743,8 @@ class PHPMailer {
       if ($this->exceptions) {
         throw $e;
       }
-         if ($this->SMTPDebug) {
-        echo $e->getMessage()."\n";
+      if ($this->SMTPDebug) {
+        $this->edebug($e->getMessage()."\n");
       }
       if ( $e->getCode() == self::STOP_CRITICAL ) {
         return false;
@@ -1555,6 +1765,8 @@ class PHPMailer {
    * Attaches all fs, string, and binary attachments to the message.
    * Returns an empty string on failure.
    * @access protected
+   * @param string $disposition_type
+   * @param string $boundary
    * @return string
    */
   protected function AttachAll($disposition_type, $boundary) {
@@ -1568,6 +1780,8 @@ class PHPMailer {
       // CHECK IF IT IS A VALID DISPOSITION_FILTER
       if($attachment[6] == $disposition_type) {
         // Check for string attachment
+        $string = '';
+        $path = '';
         $bString = $attachment[5];
         if ($bString) {
           $string = $attachment[0];
@@ -1624,6 +1838,7 @@ class PHPMailer {
    * Returns an empty string on failure.
    * @param string $path The full path to the file
    * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable'
+   * @throws phpmailerException
    * @see EncodeFile()
    * @access protected
    * @return string
@@ -1633,28 +1848,28 @@ class PHPMailer {
       if (!is_readable($path)) {
         throw new phpmailerException($this->Lang('file_open') . $path, self::STOP_CONTINUE);
       }
-      if (function_exists('get_magic_quotes')) {
-        function get_magic_quotes() {
-          return false;
-        }
-      }
-         $magic_quotes = get_magic_quotes_runtime();
-         if ($magic_quotes) {
+      //  if (!function_exists('get_magic_quotes')) {
+      //    function get_magic_quotes() {
+      //      return false;
+      //    }
+      //  }
+      $magic_quotes = get_magic_quotes_runtime();
+      if ($magic_quotes) {
         if (version_compare(PHP_VERSION, '5.3.0', '<')) {
           set_magic_quotes_runtime(0);
         } else {
-                 ini_set('magic_quotes_runtime', 0);
-               }
-         }
+          ini_set('magic_quotes_runtime', 0); 
+        }
+      }
       $file_buffer  = file_get_contents($path);
       $file_buffer  = $this->EncodeString($file_buffer, $encoding);
-         if ($magic_quotes) {
+      if ($magic_quotes) {
         if (version_compare(PHP_VERSION, '5.3.0', '<')) {
           set_magic_quotes_runtime($magic_quotes);
         } else {
-                 ini_set('magic_quotes_runtime', $magic_quotes);
-           }
-         }
+          ini_set('magic_quotes_runtime', $magic_quotes); 
+        }
+      }
       return $file_buffer;
     } catch (Exception $e) {
       $this->SetError($e->getMessage());
@@ -1699,6 +1914,8 @@ class PHPMailer {
   /**
    * Encode a header string to best (shortest) of Q, B, quoted or none.
    * @access public
+   * @param string $str
+   * @param string $position
    * @return string
    */
   public function EncodeHeader($str, $position = 'text') {
@@ -1737,7 +1954,7 @@ class PHPMailer {
       if (function_exists('mb_strlen') && $this->HasMultiBytes($str)) {
         // Use a custom function which correctly encodes and wraps long
         // multibyte strings without breaking lines within a character
-        $encoded = $this->Base64EncodeWrapMB($str);
+        $encoded = $this->Base64EncodeWrapMB($str, "\n");
       } else {
         $encoded = base64_encode($str);
         $maxlen -= $maxlen % 4;
@@ -1747,7 +1964,7 @@ class PHPMailer {
       $encoding = 'Q';
       $encoded = $this->EncodeQ($str, $position);
       $encoded = $this->WrapText($encoded, $maxlen, true);
-      $encoded = str_replace('='.$this->LE, "\n", trim($encoded));
+      $encoded = str_replace('='.self::CRLF, "\n", trim($encoded));
     }
 
     $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded);
@@ -1776,12 +1993,16 @@ class PHPMailer {
    * Adapted from a function by paravoid at http://uk.php.net/manual/en/function.mb-encode-mimeheader.php
    * @access public
    * @param string $str multi-byte text to wrap encode
+   * @param string $lf string to use as linefeed/end-of-line
    * @return string
    */
-  public function Base64EncodeWrapMB($str) {
+  public function Base64EncodeWrapMB($str, $lf=null) {
     $start = "=?".$this->CharSet."?B?";
     $end = "?=";
     $encoded = "";
+    if ($lf === null) {
+      $lf = $this->LE;
+    }
 
     $mb_length = mb_strlen($str, $this->CharSet);
     // Each line must have length <= 75, including $start and $end
@@ -1802,11 +2023,11 @@ class PHPMailer {
       }
       while (strlen($chunk) > $length);
 
-      $encoded .= $chunk . $this->LE;
+      $encoded .= $chunk . $lf;
     }
 
     // Chomp the last linefeed
-    $encoded = substr($encoded, 0, -strlen($this->LE));
+    $encoded = substr($encoded, 0, -strlen($lf));
     return $encoded;
   }
 
@@ -1814,8 +2035,10 @@ class PHPMailer {
   * Encode string to quoted-printable.
   * Only uses standard PHP, slow, but will always work
   * @access public
-  * @param string $string the text to encode
+   * @param string $input
   * @param integer $line_max Number of chars allowed on a line before wrapping
+   * @param bool $space_conv
+   * @internal param string $string the text to encode
   * @return string
   */
   public function EncodeQPphp( $input = '', $line_max = 76, $space_conv = false) {
@@ -1840,8 +2063,8 @@ class PHPMailer {
             $c = '=20';
           }
         } elseif ( ($dec == 61) || ($dec < 32 ) || ($dec > 126) ) { // always encode "\t", which is *not* required
-          $h2 = floor($dec/16);
-          $h1 = floor($dec%16);
+          $h2 = (integer)floor($dec/16);
+          $h1 = (integer)floor($dec%16);
           $c = $escape.$hex[$h2].$hex[$h1];
         }
         if ( (strlen($newline) + strlen($c)) >= $line_max ) { // CRLF is not counted
@@ -1901,29 +2124,37 @@ class PHPMailer {
    * @return string
    */
   public function EncodeQ($str, $position = 'text') {
-    // There should not be any EOL in the string
-    $encoded = preg_replace('/[\r\n]*/', '', $str);
-
+    //There should not be any EOL in the string
+       $pattern="";
+    $encoded = str_replace(array("\r", "\n"), '', $str);
     switch (strtolower($position)) {
       case 'phrase':
-        $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
+        $pattern = '^A-Za-z0-9!*+\/ -';
         break;
+
       case 'comment':
-        $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
+        $pattern = '\(\)"';
+        //note that we dont break here!
+        //for this reason we build the $pattern withoud including delimiters and []
+
       case 'text':
       default:
-        // Replace every high ascii, control =, ? and _ characters
-        //TODO using /e (equivalent to eval()) is probably not a good idea
-        $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e',
-                                "'='.sprintf('%02X', ord(stripslashes('\\1')))", $encoded);
+        //Replace every high ascii, control =, ? and _ characters
+        //We put \075 (=) as first value to make sure it's the first one in being converted, preventing double encode
+        $pattern = '\075\000-\011\013\014\016-\037\077\137\177-\377' . $pattern;
         break;
     }
+    
+    if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) {
+      foreach (array_unique($matches[0]) as $char) {
+        $encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded);
+      }
+    }
+    
+    //Replace every spaces to _ (more readable than =20)
+    return str_replace(' ', '_', $encoded);
+}
 
-    // Replace every spaces to _ (more readable than =20)
-    $encoded = str_replace(' ', '_', $encoded);
-
-    return $encoded;
-  }
 
   /**
    * Adds a string or binary attachment (non-filesystem) to the list.
@@ -1989,12 +2220,25 @@ class PHPMailer {
     return true;
   }
 
-  public function AddStringEmbeddedImage($string, $cid, $filename = '', $encoding = 'base64', $type = 'application/octet-stream') {
+  /**
+   * Adds an embedded stringified attachment.  This can include images, sounds, and
+   * just about any other document.  Make sure to set the $type to an
+   * image type.  For JPEG images use "image/jpeg" and for GIF images
+   * use "image/gif".
+   * @param string $string The attachment.
+   * @param string $cid Content ID of the attachment.  Use this to identify
+   *        the Id for accessing the image in an HTML form.
+   * @param string $name Overrides the attachment name.
+   * @param string $encoding File encoding (see $Encoding).
+   * @param string $type File extension (MIME) type.
+   * @return bool
+   */
+  public function AddStringEmbeddedImage($string, $cid, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {
     // Append to $attachment array
     $this->attachment[] = array(
       0 => $string,
-      1 => $filename,
-      2 => basename($filename),
+      1 => $name,
+      2 => $name,
       3 => $encoding,
       4 => $type,
       5 => true,  // isStringAttachment
@@ -2017,6 +2261,10 @@ class PHPMailer {
     return false;
   }
 
+  /**
+   * Returns true if an attachment (non-inline) is present.
+   * @return bool
+   */
   public function AttachmentExists() {
     foreach($this->attachment as $attachment) {
       if ($attachment[6] == 'attachment') {
@@ -2026,8 +2274,12 @@ class PHPMailer {
     return false;
   }
 
+  /**
+   * Does this message have an alternative body set?
+   * @return bool
+   */
   public function AlternativeExists() {
-    return strlen($this->AltBody)>0;
+    return !empty($this->AltBody);
   }
 
   /////////////////////////////////////////////////
@@ -2111,6 +2363,7 @@ class PHPMailer {
   /**
    * Adds the error message to the error container.
    * @access protected
+   * @param string $msg
    * @return void
    */
   protected function SetError($msg) {
@@ -2160,6 +2413,7 @@ class PHPMailer {
   /**
    * Returns a message in the appropriate language.
    * @access protected
+   * @param string $key
    * @return string
    */
   protected function Lang($key) {
@@ -2184,30 +2438,44 @@ class PHPMailer {
   }
 
   /**
-   * Changes every end of line from CR or LF to CRLF.
+   * Changes every end of line from CRLF, CR or LF to $this->LE.
    * @access public
+   * @param string $str String to FixEOL
    * @return string
    */
   public function FixEOL($str) {
-    $str = str_replace("\r\n", "\n", $str);
-    $str = str_replace("\r", "\n", $str);
-    $str = str_replace("\n", $this->LE, $str);
-    return $str;
+       // condense down to \n
+       $nstr = str_replace(array("\r\n", "\r"), "\n", $str);
+       // Now convert LE as needed
+       if ($this->LE !== "\n") {
+               $nstr = str_replace("\n", $this->LE, $nstr);
+       }
+    return  $nstr;
   }
 
   /**
-   * Adds a custom header.
+   * Adds a custom header. $name value can be overloaded to contain
+   * both header name and value (name:value)
    * @access public
+   * @param string $name custom header name
+   * @param string $value header value
    * @return void
    */
-  public function AddCustomHeader($custom_header) {
-    $this->CustomHeader[] = explode(':', $custom_header, 2);
+  public function AddCustomHeader($name, $value=null) {
+       if ($value === null) {
+               // Value passed in as name:value
+               $this->CustomHeader[] = explode(':', $name, 2);
+       } else {
+               $this->CustomHeader[] = array($name, $value);
+       }
   }
 
   /**
    * Evaluates the message and returns modifications for inline images and backgrounds
    * @access public
-   * @return $message
+   * @param string $message Text to be HTML modified
+   * @param string $basedir baseline directory for path
+   * @return string $message
    */
   public function MsgHTML($message, $basedir = '') {
     preg_match_all("/(src|background)=[\"'](.*)[\"']/Ui", $message, $images);
@@ -2217,13 +2485,15 @@ class PHPMailer {
         if (!preg_match('#^[A-z]+://#', $url)) {
           $filename = basename($url);
           $directory = dirname($url);
-          ($directory == '.') ? $directory='': '';
-          $cid = 'cid:' . md5($filename);
+          if ($directory == '.') {
+            $directory = '';
+          }
+          $cid = 'cid:' . md5($url);
           $ext = pathinfo($filename, PATHINFO_EXTENSION);
           $mimeType  = self::_mime_types($ext);
           if ( strlen($basedir) > 1 && substr($basedir, -1) != '/') { $basedir .= '/'; }
           if ( strlen($directory) > 1 && substr($directory, -1) != '/') { $directory .= '/'; }
-          if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($filename), $filename, 'base64', $mimeType) ) {
+          if ( $this->AddEmbeddedImage($basedir.$directory.$filename, md5($url), $filename, 'base64', $mimeType) ) {
             $message = preg_replace("/".$images[1][$i]."=[\"']".preg_quote($url, '/')."[\"']/Ui", $images[1][$i]."=\"".$cid."\"", $message);
           }
         }
@@ -2231,40 +2501,42 @@ class PHPMailer {
     }
     $this->IsHTML(true);
     $this->Body = $message;
-       if (empty($this->AltBody)) {
-               $textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s', '', $message)));
-               if (!empty($textMsg)) {
-                       $this->AltBody = html_entity_decode($textMsg, ENT_QUOTES, $this->CharSet);
-               }
-       }
+    if (empty($this->AltBody)) {
+        $textMsg = trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/s', '', $message)));
+        if (!empty($textMsg)) {
+            $this->AltBody = html_entity_decode($textMsg, ENT_QUOTES, $this->CharSet);
+        }
+    }
     if (empty($this->AltBody)) {
       $this->AltBody = 'To view this email message, open it in a program that understands HTML!' . "\n\n";
     }
-       return $message;
+    return $message;
   }
 
   /**
    * Gets the MIME type of the embedded or inline image
-   * @param string File extension
+   * @param string $ext File extension
    * @access public
    * @return string MIME type of ext
    * @static
    */
   public static function _mime_types($ext = '') {
     $mimes = array(
+      'xl'    =>  'application/excel',
       'hqx'   =>  'application/mac-binhex40',
       'cpt'   =>  'application/mac-compactpro',
-      'doc'   =>  'application/msword',
       'bin'   =>  'application/macbinary',
+      'doc'   =>  'application/msword',
+      'word'  =>  'application/msword',
+      'class' =>  'application/octet-stream',
+      'dll'   =>  'application/octet-stream',
       'dms'   =>  'application/octet-stream',
+      'exe'   =>  'application/octet-stream',
       'lha'   =>  'application/octet-stream',
       'lzh'   =>  'application/octet-stream',
-      'exe'   =>  'application/octet-stream',
-      'class' =>  'application/octet-stream',
       'psd'   =>  'application/octet-stream',
-      'so'    =>  'application/octet-stream',
       'sea'   =>  'application/octet-stream',
-      'dll'   =>  'application/octet-stream',
+      'so'    =>  'application/octet-stream',
       'oda'   =>  'application/oda',
       'pdf'   =>  'application/pdf',
       'ai'    =>  'application/postscript',
@@ -2282,9 +2554,9 @@ class PHPMailer {
       'dxr'   =>  'application/x-director',
       'dvi'   =>  'application/x-dvi',
       'gtar'  =>  'application/x-gtar',
-      'php'   =>  'application/x-httpd-php',
-      'php4'  =>  'application/x-httpd-php',
       'php3'  =>  'application/x-httpd-php',
+      'php4'  =>  'application/x-httpd-php',
+      'php'   =>  'application/x-httpd-php',
       'phtml' =>  'application/x-httpd-php',
       'phps'  =>  'application/x-httpd-php-source',
       'js'    =>  'application/x-javascript',
@@ -2292,53 +2564,50 @@ class PHPMailer {
       'sit'   =>  'application/x-stuffit',
       'tar'   =>  'application/x-tar',
       'tgz'   =>  'application/x-tar',
-      'xhtml' =>  'application/xhtml+xml',
       'xht'   =>  'application/xhtml+xml',
+      'xhtml' =>  'application/xhtml+xml',
       'zip'   =>  'application/zip',
       'mid'   =>  'audio/midi',
       'midi'  =>  'audio/midi',
-      'mpga'  =>  'audio/mpeg',
       'mp2'   =>  'audio/mpeg',
       'mp3'   =>  'audio/mpeg',
+      'mpga'  =>  'audio/mpeg',
       'aif'   =>  'audio/x-aiff',
-      'aiff'  =>  'audio/x-aiff',
       'aifc'  =>  'audio/x-aiff',
+      'aiff'  =>  'audio/x-aiff',
       'ram'   =>  'audio/x-pn-realaudio',
       'rm'    =>  'audio/x-pn-realaudio',
       'rpm'   =>  'audio/x-pn-realaudio-plugin',
       'ra'    =>  'audio/x-realaudio',
-      'rv'    =>  'video/vnd.rn-realvideo',
       'wav'   =>  'audio/x-wav',
       'bmp'   =>  'image/bmp',
       'gif'   =>  'image/gif',
       'jpeg'  =>  'image/jpeg',
-      'jpg'   =>  'image/jpeg',
       'jpe'   =>  'image/jpeg',
+      'jpg'   =>  'image/jpeg',
       'png'   =>  'image/png',
       'tiff'  =>  'image/tiff',
       'tif'   =>  'image/tiff',
+      'eml'   =>  'message/rfc822',
       'css'   =>  'text/css',
       'html'  =>  'text/html',
       'htm'   =>  'text/html',
       'shtml' =>  'text/html',
-      'txt'   =>  'text/plain',
-      'text'  =>  'text/plain',
       'log'   =>  'text/plain',
+      'text'  =>  'text/plain',
+      'txt'   =>  'text/plain',
       'rtx'   =>  'text/richtext',
       'rtf'   =>  'text/rtf',
       'xml'   =>  'text/xml',
       'xsl'   =>  'text/xml',
       'mpeg'  =>  'video/mpeg',
-      'mpg'   =>  'video/mpeg',
       'mpe'   =>  'video/mpeg',
-      'qt'    =>  'video/quicktime',
+      'mpg'   =>  'video/mpeg',
       'mov'   =>  'video/quicktime',
+      'qt'    =>  'video/quicktime',
+      'rv'    =>  'video/vnd.rn-realvideo',
       'avi'   =>  'video/x-msvideo',
-      'movie' =>  'video/x-sgi-movie',
-      'doc'   =>  'application/msword',
-      'word'  =>  'application/msword',
-      'xl'    =>  'application/excel',
-      'eml'   =>  'message/rfc822'
+      'movie' =>  'video/x-sgi-movie'
     );
     return (!isset($mimes[strtolower($ext)])) ? 'application/octet-stream' : $mimes[strtolower($ext)];
   }
@@ -2353,6 +2622,8 @@ class PHPMailer {
   * @param string $name Parameter Name
   * @param mixed $value Parameter Value
   * NOTE: will not work with arrays, there are no arrays to set/reset
+   * @throws phpmailerException
+   * @return bool
   * @todo Should this not be using __set() magic function?
   */
   public function set($name, $value = '') {
@@ -2378,15 +2649,14 @@ class PHPMailer {
    * @return string
    */
   public function SecureHeader($str) {
-    $str = str_replace("\r", '', $str);
-    $str = str_replace("\n", '', $str);
-    return trim($str);
+    return trim(str_replace(array("\r", "\n"), '', $str));
   }
 
   /**
    * Set the private key file and password to sign the message.
    *
    * @access public
+   * @param $cert_filename
    * @param string $key_filename Parameter File Name
    * @param string $key_pass Password for private key
    */
@@ -2400,11 +2670,10 @@ class PHPMailer {
    * Set the private key file and password to sign the message.
    *
    * @access public
-   * @param string $key_filename Parameter File Name
-   * @param string $key_pass Password for private key
+   * @param string $txt
+   * @return string
    */
   public function DKIM_QP($txt) {
-    $tmp = '';
     $line = '';
     for ($i = 0; $i < strlen($txt); $i++) {
       $ord = ord($txt[$i]);
@@ -2422,6 +2691,7 @@ class PHPMailer {
    *
    * @access public
    * @param string $s Header
+   * @return string
    */
   public function DKIM_Sign($s) {
     $privKeyStr = file_get_contents($this->DKIM_private);
@@ -2433,6 +2703,7 @@ class PHPMailer {
     if (openssl_sign($s, $signature, $privKey)) {
       return base64_encode($signature);
     }
+    return '';
   }
 
   /**
@@ -2440,6 +2711,7 @@ class PHPMailer {
    *
    * @access public
    * @param string $s Header
+   * @return string
    */
   public function DKIM_HeaderC($s) {
     $s = preg_replace("/\r\n\s+/", " ", $s);
@@ -2459,6 +2731,7 @@ class PHPMailer {
    *
    * @access public
    * @param string $body Message Body
+   * @return string
    */
   public function DKIM_BodyC($body) {
     if ($body == '') return "\r\n";
@@ -2479,6 +2752,7 @@ class PHPMailer {
    * @param string $headers_line Header lines
    * @param string $subject Subject
    * @param string $body Body
+   * @return string
    */
   public function DKIM_Add($headers_line, $subject, $body) {
     $DKIMsignatureType    = 'rsa-sha1'; // Signature & hash algorithms
@@ -2487,6 +2761,8 @@ class PHPMailer {
     $DKIMtime             = time() ; // Signature Timestamp = seconds since 00:00:00 - Jan 1, 1970 (UTC time zone)
     $subject_header       = "Subject: $subject";
     $headers              = explode($this->LE, $headers_line);
+       $from_header          = "";
+       $to_header            = "";
     foreach($headers as $header) {
       if (strpos($header, 'From:') === 0) {
         $from_header = $header;
@@ -2512,18 +2788,36 @@ class PHPMailer {
                 "\tb=";
     $toSign   = $this->DKIM_HeaderC($from_header . "\r\n" . $to_header . "\r\n" . $subject_header . "\r\n" . $dkimhdrs);
     $signed   = $this->DKIM_Sign($toSign);
-    return "X-PHPMAILER-DKIM: phpmailer.worxware.com\r\n".$dkimhdrs.$signed."\r\n";
+    return "X-PHPMAILER-DKIM: code.google.com/a/apache-extras.org/p/phpmailer/\r\n".$dkimhdrs.$signed."\r\n";
   }
 
-  protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body) {
-    if (!empty($this->action_function) && function_exists($this->action_function)) {
-      $params = array($isSent, $to, $cc, $bcc, $subject, $body);
+  /**
+   * Perform callback
+   * @param boolean $isSent
+   * @param string $to
+   * @param string $cc
+   * @param string $bcc
+   * @param string $subject
+   * @param string $body
+   * @param string $from
+   */
+  protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from=null) {
+    if (!empty($this->action_function) && is_callable($this->action_function)) {
+      $params = array($isSent, $to, $cc, $bcc, $subject, $body, $from);
       call_user_func_array($this->action_function, $params);
     }
   }
 }
 
+/**
+ * Exception handler for PHPMailer
+ * @package PHPMailer
+ */
 class phpmailerException extends Exception {
+  /**
+   * Prettify error message output
+   * @return string
+   */
   public function errorMessage() {
     $errorMsg = '<strong>' . $this->getMessage() . "</strong><br />\n";
     return $errorMsg;
index 6977bffad14745086a1effac05c7ced3806da154..72361bbbbb0b725fc095ffe677c74147137c1009 100644 (file)
@@ -2,7 +2,7 @@
 /*~ class.smtp.php
 .---------------------------------------------------------------------------.
 |  Software: PHPMailer - PHP email class                                    |
-|   Version: 5.2.1                                                          |
+|   Version: 5.2.4                                                          |
 |      Site: https://code.google.com/a/apache-extras.org/p/phpmailer/       |
 | ------------------------------------------------------------------------- |
 |     Admin: Jim Jagielski (project admininistrator)                        |
  * @author Jim Jagielski
  * @copyright 2010 - 2012 Jim Jagielski
  * @license http://www.gnu.org/copyleft/lesser.html Distributed under the Lesser General Public License (LGPL)
- * @version $Id: class.smtp.php 450 2010-06-23 16:46:33Z coolbru $
  */
 
 /**
- * SMTP is rfc 821 compliant and implements all the rfc 821 SMTP
- * commands except TURN which will always return a not implemented
- * error. SMTP also provides some utility methods for sending mail
- * to an SMTP server.
- * original author: Chris Ryan
+ * PHP RFC821 SMTP client
+ *
+ * Implements all the RFC 821 SMTP commands except TURN which will always return a not implemented error.
+ * SMTP also provides some utility methods for sending mail to an SMTP server.
+ * @author Chris Ryan
+ * @package PHPMailer
  */
 
 class SMTP {
@@ -51,7 +51,7 @@ class SMTP {
   public $SMTP_PORT = 25;
 
   /**
-   *  SMTP reply line ending
+   *  SMTP reply line ending (don't change)
    *  @var string
    */
   public $CRLF = "\r\n";
@@ -62,30 +62,70 @@ class SMTP {
    */
   public $do_debug;       // the level of debug to perform
 
+  /**
+   * Sets the function/method to use for debugging output.
+   * Right now we only honor "echo" or "error_log"
+   * @var string
+   */
+  public $Debugoutput     = "echo";
+
   /**
    *  Sets VERP use on/off (default is off)
    *  @var bool
    */
   public $do_verp = false;
 
+  /**
+   * Sets the SMTP timeout value for reads, in seconds
+   * @var int
+   */
+  public $Timeout         = 15;
+
+  /**
+   * Sets the SMTP timelimit value for reads, in seconds
+   * @var int
+   */
+  public $Timelimit       = 30;
+
   /**
    * Sets the SMTP PHPMailer Version number
    * @var string
    */
-  public $Version         = '5.2.1';
+  public $Version         = '5.2.4';
 
   /////////////////////////////////////////////////
   // PROPERTIES, PRIVATE AND PROTECTED
   /////////////////////////////////////////////////
 
-  private $smtp_conn; // the socket to the server
-  private $error;     // error if any on the last call
-  private $helo_rply; // the reply the server sent to us for HELO
+  /**
+   * @var resource The socket to the server
+   */
+  private $smtp_conn;
+  /**
+   * @var string Error message, if any, for the last call
+   */
+  private $error;
+  /**
+   * @var string The reply the server sent to us for HELO
+   */
+  private $helo_rply;
+
+  /**
+   * Outputs debugging info via user-defined method
+   * @param string $str
+   */
+  private function edebug($str) {
+    if ($this->Debugoutput == "error_log") {
+        error_log($str);
+    } else {
+        echo $str;
+    }
+  }
 
   /**
    * Initialize the class so that the data is in a known state.
    * @access public
-   * @return void
+   * @return SMTP
    */
   public function __construct() {
     $this->smtp_conn = 0;
@@ -110,6 +150,9 @@ class SMTP {
    * SMTP CODE SUCCESS: 220
    * SMTP CODE FAILURE: 421
    * @access public
+   * @param string $host
+   * @param int $port
+   * @param int $tval
    * @return bool
    */
   public function Connect($host, $port = 0, $tval = 30) {
@@ -139,21 +182,26 @@ class SMTP {
                            "errno" => $errno,
                            "errstr" => $errstr);
       if($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF . '<br />';
+        $this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF . '<br />');
       }
       return false;
     }
 
     // SMTP server can take longer to respond, give longer timeout for first read
     // Windows does not have support for this timeout function
-    if(substr(PHP_OS, 0, 3) != "WIN")
-     socket_set_timeout($this->smtp_conn, $tval, 0);
+    if(substr(PHP_OS, 0, 3) != "WIN") {
+     $max = ini_get('max_execution_time');
+     if ($max != 0 && $tval > $max) { // don't bother if unlimited
+      @set_time_limit($tval);
+     }
+     stream_set_timeout($this->smtp_conn, $tval, 0);
+    }
 
     // get any announcement
     $announce = $this->get_lines();
 
     if($this->do_debug >= 2) {
-      echo "SMTP -> FROM SERVER:" . $announce . $this->CRLF . '<br />';
+      $this->edebug("SMTP -> FROM SERVER:" . $announce . $this->CRLF . '<br />');
     }
 
     return true;
@@ -182,7 +230,7 @@ class SMTP {
     $code = substr($rply,0,3);
 
     if($this->do_debug >= 2) {
-      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
+      $this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
     }
 
     if($code != 220) {
@@ -191,7 +239,7 @@ class SMTP {
                "smtp_code" => $code,
                "smtp_msg"  => substr($rply,4));
       if($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
+        $this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
       }
       return false;
     }
@@ -208,60 +256,164 @@ class SMTP {
    * Performs SMTP authentication.  Must be run after running the
    * Hello() method.  Returns true if successfully authenticated.
    * @access public
+   * @param string $username
+   * @param string $password
+   * @param string $authtype
+   * @param string $realm
+   * @param string $workstation
    * @return bool
    */
-  public function Authenticate($username, $password) {
-    // Start authentication
-    fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
-
-    $rply = $this->get_lines();
-    $code = substr($rply,0,3);
-
-    if($code != 334) {
-      $this->error =
-        array("error" => "AUTH not accepted from server",
-              "smtp_code" => $code,
-              "smtp_msg" => substr($rply,4));
-      if($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
-      }
-      return false;
-    }
-
-    // Send encoded username
-    fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);
-
-    $rply = $this->get_lines();
-    $code = substr($rply,0,3);
-
-    if($code != 334) {
-      $this->error =
-        array("error" => "Username not accepted from server",
-              "smtp_code" => $code,
-              "smtp_msg" => substr($rply,4));
-      if($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
-      }
-      return false;
-    }
-
-    // Send encoded password
-    fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);
-
-    $rply = $this->get_lines();
-    $code = substr($rply,0,3);
-
-    if($code != 235) {
-      $this->error =
-        array("error" => "Password not accepted from server",
-              "smtp_code" => $code,
-              "smtp_msg" => substr($rply,4));
-      if($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
-      }
-      return false;
+  public function Authenticate($username, $password, $authtype='LOGIN', $realm='', $workstation='') {
+    if (empty($authtype)) {
+      $authtype = 'LOGIN';
+    }
+
+    switch ($authtype) {
+      case 'PLAIN':
+        // Start authentication
+        fputs($this->smtp_conn,"AUTH PLAIN" . $this->CRLF);
+    
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+    
+        if($code != 334) {
+          $this->error =
+            array("error" => "AUTH not accepted from server",
+                  "smtp_code" => $code,
+                  "smtp_msg" => substr($rply,4));
+          if($this->do_debug >= 1) {
+            $this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
+          }
+          return false;
+        }
+        // Send encoded username and password
+        fputs($this->smtp_conn, base64_encode("\0".$username."\0".$password) . $this->CRLF);
+
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+    
+        if($code != 235) {
+          $this->error =
+            array("error" => "Authentication not accepted from server",
+                  "smtp_code" => $code,
+                  "smtp_msg" => substr($rply,4));
+          if($this->do_debug >= 1) {
+            $this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
+          }
+          return false;
+        }
+        break;
+      case 'LOGIN':
+        // Start authentication
+        fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
+    
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+    
+        if($code != 334) {
+          $this->error =
+            array("error" => "AUTH not accepted from server",
+                  "smtp_code" => $code,
+                  "smtp_msg" => substr($rply,4));
+          if($this->do_debug >= 1) {
+            $this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
+          }
+          return false;
+        }
+    
+        // Send encoded username
+        fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);
+    
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+    
+        if($code != 334) {
+          $this->error =
+            array("error" => "Username not accepted from server",
+                  "smtp_code" => $code,
+                  "smtp_msg" => substr($rply,4));
+          if($this->do_debug >= 1) {
+            $this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
+          }
+          return false;
+        }
+    
+        // Send encoded password
+        fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);
+    
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+    
+        if($code != 235) {
+          $this->error =
+            array("error" => "Password not accepted from server",
+                  "smtp_code" => $code,
+                  "smtp_msg" => substr($rply,4));
+          if($this->do_debug >= 1) {
+            $this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
+          }
+          return false;
+        }
+        break;
+      case 'NTLM':
+        /*
+         * ntlm_sasl_client.php
+         ** Bundled with Permission
+         **
+         ** How to telnet in windows: http://technet.microsoft.com/en-us/library/aa995718%28EXCHG.65%29.aspx
+         ** PROTOCOL Documentation http://curl.haxx.se/rfc/ntlm.html#ntlmSmtpAuthentication
+         */
+        require_once('ntlm_sasl_client.php');
+        $temp = new stdClass();
+        $ntlm_client = new ntlm_sasl_client_class;
+        if(! $ntlm_client->Initialize($temp)){//let's test if every function its available
+            $this->error = array("error" => $temp->error);
+            if($this->do_debug >= 1) {
+                $this->edebug("You need to enable some modules in your php.ini file: " . $this->error["error"] . $this->CRLF);
+            }
+            return false;
+        }
+        $msg1 = $ntlm_client->TypeMsg1($realm, $workstation);//msg1
+        
+        fputs($this->smtp_conn,"AUTH NTLM " . base64_encode($msg1) . $this->CRLF);
+
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+        
+
+        if($code != 334) {
+            $this->error =
+                array("error" => "AUTH not accepted from server",
+                      "smtp_code" => $code,
+                      "smtp_msg" => substr($rply,4));
+            if($this->do_debug >= 1) {
+                $this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF);
+            }
+            return false;
+        }
+        
+        $challange = substr($rply,3);//though 0 based, there is a white space after the 3 digit number....//msg2
+        $challange = base64_decode($challange);
+        $ntlm_res = $ntlm_client->NTLMResponse(substr($challange,24,8),$password);
+        $msg3 = $ntlm_client->TypeMsg3($ntlm_res,$username,$realm,$workstation);//msg3
+        // Send encoded username
+        fputs($this->smtp_conn, base64_encode($msg3) . $this->CRLF);
+
+        $rply = $this->get_lines();
+        $code = substr($rply,0,3);
+
+        if($code != 235) {
+            $this->error =
+                array("error" => "Could not authenticate",
+                      "smtp_code" => $code,
+                      "smtp_msg" => substr($rply,4));
+            if($this->do_debug >= 1) {
+                $this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF);
+            }
+            return false;
+        }
+        break;
     }
-
     return true;
   }
 
@@ -276,7 +428,7 @@ class SMTP {
       if($sock_status["eof"]) {
         // the socket is valid but we are not connected
         if($this->do_debug >= 1) {
-            echo "SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected";
+            $this->edebug("SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected");
         }
         $this->Close();
         return false;
@@ -324,6 +476,7 @@ class SMTP {
    * SMTP CODE FAILURE: 451,554
    * SMTP CODE ERROR  : 500,501,503,421
    * @access public
+   * @param string $msg_data
    * @return bool
    */
   public function Data($msg_data) {
@@ -341,7 +494,7 @@ class SMTP {
     $code = substr($rply,0,3);
 
     if($this->do_debug >= 2) {
-      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
+      $this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
     }
 
     if($code != 354) {
@@ -350,7 +503,7 @@ class SMTP {
               "smtp_code" => $code,
               "smtp_msg" => substr($rply,4));
       if($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
+        $this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
       }
       return false;
     }
@@ -435,7 +588,7 @@ class SMTP {
     $code = substr($rply,0,3);
 
     if($this->do_debug >= 2) {
-      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
+      $this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
     }
 
     if($code != 250) {
@@ -444,7 +597,7 @@ class SMTP {
               "smtp_code" => $code,
               "smtp_msg" => substr($rply,4));
       if($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
+        $this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
       }
       return false;
     }
@@ -461,6 +614,7 @@ class SMTP {
    * SMTP CODE SUCCESS: 250
    * SMTP CODE ERROR  : 500, 501, 504, 421
    * @access public
+   * @param string $host
    * @return bool
    */
   public function Hello($host = '') {
@@ -491,6 +645,8 @@ class SMTP {
   /**
    * Sends a HELO/EHLO command.
    * @access private
+   * @param string $hello
+   * @param string $host
    * @return bool
    */
   private function SendHello($hello, $host) {
@@ -500,7 +656,7 @@ class SMTP {
     $code = substr($rply,0,3);
 
     if($this->do_debug >= 2) {
-      echo "SMTP -> FROM SERVER: " . $rply . $this->CRLF . '<br />';
+      $this->edebug("SMTP -> FROM SERVER: " . $rply . $this->CRLF . '<br />');
     }
 
     if($code != 250) {
@@ -509,7 +665,7 @@ class SMTP {
               "smtp_code" => $code,
               "smtp_msg" => substr($rply,4));
       if($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
+        $this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
       }
       return false;
     }
@@ -531,6 +687,7 @@ class SMTP {
    * SMTP CODE SUCCESS: 552,451,452
    * SMTP CODE SUCCESS: 500,501,421
    * @access public
+   * @param string $from
    * @return bool
    */
   public function Mail($from) {
@@ -542,14 +699,14 @@ class SMTP {
       return false;
     }
 
-    $useVerp = ($this->do_verp ? "XVERP" : "");
+    $useVerp = ($this->do_verp ? " XVERP" : "");
     fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $useVerp . $this->CRLF);
 
     $rply = $this->get_lines();
     $code = substr($rply,0,3);
 
     if($this->do_debug >= 2) {
-      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
+      $this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
     }
 
     if($code != 250) {
@@ -558,7 +715,7 @@ class SMTP {
               "smtp_code" => $code,
               "smtp_msg" => substr($rply,4));
       if($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
+        $this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
       }
       return false;
     }
@@ -574,6 +731,7 @@ class SMTP {
    * SMTP CODE SUCCESS: 221
    * SMTP CODE ERROR  : 500
    * @access public
+   * @param bool $close_on_error
    * @return bool
    */
   public function Quit($close_on_error = true) {
@@ -592,7 +750,7 @@ class SMTP {
     $byemsg = $this->get_lines();
 
     if($this->do_debug >= 2) {
-      echo "SMTP -> FROM SERVER:" . $byemsg . $this->CRLF . '<br />';
+      $this->edebug("SMTP -> FROM SERVER:" . $byemsg . $this->CRLF . '<br />');
     }
 
     $rval = true;
@@ -606,7 +764,7 @@ class SMTP {
                  "smtp_rply" => substr($byemsg,4));
       $rval = false;
       if($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF . '<br />';
+        $this->edebug("SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF . '<br />');
       }
     }
 
@@ -627,6 +785,7 @@ class SMTP {
    * SMTP CODE FAILURE: 550,551,552,553,450,451,452
    * SMTP CODE ERROR  : 500,501,503,421
    * @access public
+   * @param string $to
    * @return bool
    */
   public function Recipient($to) {
@@ -644,7 +803,7 @@ class SMTP {
     $code = substr($rply,0,3);
 
     if($this->do_debug >= 2) {
-      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
+      $this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
     }
 
     if($code != 250 && $code != 251) {
@@ -653,7 +812,7 @@ class SMTP {
               "smtp_code" => $code,
               "smtp_msg" => substr($rply,4));
       if($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
+        $this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
       }
       return false;
     }
@@ -687,7 +846,7 @@ class SMTP {
     $code = substr($rply,0,3);
 
     if($this->do_debug >= 2) {
-      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
+      $this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
     }
 
     if($code != 250) {
@@ -696,7 +855,7 @@ class SMTP {
               "smtp_code" => $code,
               "smtp_msg" => substr($rply,4));
       if($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
+        $this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
       }
       return false;
     }
@@ -718,6 +877,7 @@ class SMTP {
    * SMTP CODE SUCCESS: 552,451,452
    * SMTP CODE SUCCESS: 500,501,502,421
    * @access public
+   * @param string $from
    * @return bool
    */
   public function SendAndMail($from) {
@@ -735,7 +895,7 @@ class SMTP {
     $code = substr($rply,0,3);
 
     if($this->do_debug >= 2) {
-      echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
+      $this->edebug("SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />');
     }
 
     if($code != 250) {
@@ -744,7 +904,7 @@ class SMTP {
               "smtp_code" => $code,
               "smtp_msg" => substr($rply,4));
       if($this->do_debug >= 1) {
-        echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
+        $this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />');
       }
       return false;
     }
@@ -768,7 +928,7 @@ class SMTP {
     $this->error = array("error" => "This method, TURN, of the SMTP ".
                                     "is not implemented");
     if($this->do_debug >= 1) {
-      echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '<br />';
+      $this->edebug("SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '<br />');
     }
     return false;
   }
@@ -797,22 +957,47 @@ class SMTP {
    */
   private function get_lines() {
     $data = "";
-    while(!feof($this->smtp_conn)) {
+    $endtime = 0;
+    /* If for some reason the fp is bad, don't inf loop */
+    if (!is_resource($this->smtp_conn)) {
+      return $data;
+    }
+    stream_set_timeout($this->smtp_conn, $this->Timeout);
+    if ($this->Timelimit > 0) {
+      $endtime = time() + $this->Timelimit;
+    }
+    while(is_resource($this->smtp_conn) && !feof($this->smtp_conn)) {
       $str = @fgets($this->smtp_conn,515);
       if($this->do_debug >= 4) {
-        echo "SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '<br />';
-        echo "SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '<br />';
+        $this->edebug("SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '<br />');
+        $this->edebug("SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '<br />');
       }
       $data .= $str;
       if($this->do_debug >= 4) {
-        echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF . '<br />';
+        $this->edebug("SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF . '<br />');
       }
       // if 4th character is a space, we are done reading, break the loop
       if(substr($str,3,1) == " ") { break; }
+      // Timed-out? Log and break
+      $info = stream_get_meta_data($this->smtp_conn);
+      if ($info['timed_out']) {
+        if($this->do_debug >= 4) {
+          $this->edebug("SMTP -> get_lines(): timed-out (" . $this->Timeout . " seconds) <br />");
+        }
+        break;
+      }
+      // Now check if reads took too long
+      if ($endtime) {
+        if (time() > $endtime) {
+          if($this->do_debug >= 4) {
+            $this->edebug("SMTP -> get_lines(): timelimit reached (" . $this->Timelimit . " seconds) <br />");
+          }
+          break;
+        }
+      }
     }
     return $data;
   }
 
 }
-
 ?>
index 66ff71fc36b6480225db2d9fe94a328cfbbeb477..2c59c48112cf01e0c0a8c510af5fd878ec3d86a5 100644 (file)
@@ -910,7 +910,7 @@ class Snoopy
                        return false;
                }
 
-               // check if there is a redirect meta tag
+               // check if there is a redirect meta tag
 
                if(preg_match("'<meta[\s]*http-equiv[^>]*?content[\s]*=[\s]*[\"\']?\d+;[\s]*URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match))
 
@@ -1010,7 +1010,7 @@ class Snoopy
                if($this->read_timeout > 0)
                        $cmdline_params .= " -m ".$this->read_timeout;
 
-               $headerfile = tempnam($temp_dir, "sno");
+               $headerfile = tempnam($this->temp_dir, "sno");
 
                exec($this->curl_path." -k -D \"$headerfile\"".$cmdline_params." \"".escapeshellcmd($URI)."\"",$results,$return);
 
@@ -1057,7 +1057,7 @@ class Snoopy
                        $this->headers[] = $result_headers[$currentHeader];
                }
 
-               // check if there is a redirect meta tag
+               // check if there is a redirect meta tag
 
                if(preg_match("'<meta[\s]*http-equiv[^>]*?content[\s]*=[\s]*[\"\']?\d+;[\s]*URL[\s]*=[\s]*([^\"\']*?)[\"\']?>'i",$results,$match))
                {
index d24a5f2e7c4e7b6096a06e7aa1f3047834d9058f..fde8561584e9cb1f9c2cc2e68a3227c3baf0a525 100644 (file)
@@ -384,7 +384,7 @@ class WP_Customize_Color_Control extends WP_Customize_Control {
                <label>
                        <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
                        <div class="customize-control-content">
-                               <input class="color-picker-hex" type="text" maxlength="7" placeholder="<?php esc_attr_e( 'Hex Value' ); ?>"<?php echo $default_attr ?> />
+                               <input class="color-picker-hex" type="text" maxlength="7" placeholder="<?php esc_attr_e( 'Hex Value' ); ?>"<?php echo $default_attr; ?> />
                        </div>
                </label>
                <?php
@@ -593,9 +593,7 @@ class WP_Customize_Image_Control extends WP_Customize_Upload_Control {
         */
        public function tab_upload_new() {
                if ( ! _device_can_upload() ) {
-                       ?>
-                       <p><?php _e('The web browser on your device cannot be used to upload files. You may be able to use the <a href="http://wordpress.org/extend/mobile/">native app for your device</a> instead.'); ?></p>
-                       <?php
+                       echo '<p>' . sprintf( __('The web browser on your device cannot be used to upload files. You may be able to use the <a href="%s">native app for your device</a> instead.'), 'http://wordpress.org/mobile/' ) . '</p>';
                } else {
                        ?>
                        <div class="upload-dropzone">
index 4be338969a03e386dd8c10f9495e741b4037384b..cad9f1351cd785412cd99996cd20582a773f3caf 100644 (file)
@@ -310,7 +310,7 @@ final class WP_Customize_Manager {
        public function post_value( $setting ) {
                if ( ! isset( $this->_post_values ) ) {
                        if ( isset( $_POST['customized'] ) )
-                               $this->_post_values = json_decode( stripslashes( $_POST['customized'] ), true );
+                               $this->_post_values = json_decode( wp_unslash( $_POST['customized'] ), true );
                        else
                                $this->_post_values = false;
                }
@@ -512,6 +512,8 @@ final class WP_Customize_Manager {
                        $setting->save();
                }
 
+               do_action( 'customize_save_after', $this );
+
                die;
        }
 
@@ -897,9 +899,7 @@ final class WP_Customize_Manager {
                if ( $menus ) {
                        $choices = array( 0 => __( '&mdash; Select &mdash;' ) );
                        foreach ( $menus as $menu ) {
-                               $truncated_name = wp_html_excerpt( $menu->name, 40 );
-                               $truncated_name = ( $truncated_name == $menu->name ) ? $menu->name : trim( $truncated_name ) . '&hellip;';
-                               $choices[ $menu->term_id ] = $truncated_name;
+                               $choices[ $menu->term_id ] = wp_html_excerpt( $menu->name, 40, '&hellip;' );
                        }
 
                        foreach ( $locations as $location => $description ) {
@@ -975,6 +975,7 @@ final class WP_Customize_Manager {
         * Callback for validating the header_textcolor value.
         *
         * Accepts 'blank', and otherwise uses sanitize_hex_color_no_hash().
+        * Returns default text color if hex color is empty.
         *
         * @since 3.4.0
         *
@@ -982,7 +983,14 @@ final class WP_Customize_Manager {
         * @return string
         */
        public function _sanitize_header_textcolor( $color ) {
-               return ( 'blank' === $color ) ? 'blank' : sanitize_hex_color_no_hash( $color );
+               if ( 'blank' === $color )
+                       return 'blank';
+
+               $color = sanitize_hex_color_no_hash( $color );
+               if ( empty( $color ) )
+                       $color = get_theme_support( 'custom-header', 'default-text-color' );
+
+               return $color;
        }
 };
 
index fb854110fe9227d7b441eab6f525da379dc28dbb..63051be61969b492ba71385b5d1217847afa1c5f 100644 (file)
@@ -79,9 +79,9 @@ class WP_Customize_Section {
         */
        protected function render() {
                ?>
-               <li id="customize-section-<?php echo esc_attr( $this->id ); ?>" class="control-section customize-section">
-                       <h3 class="customize-section-title" tabindex="0" title="<?php echo esc_attr( $this->description ); ?>"><?php echo esc_html( $this->title ); ?></h3>
-                       <ul class="customize-section-content">
+               <li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="control-section accordion-section">
+                       <h3 class="accordion-section-title" tabindex="0" title="<?php echo esc_attr( $this->description ); ?>"><?php echo esc_html( $this->title ); ?></h3>
+                       <ul class="accordion-section-content">
                                <?php
                                foreach ( $this->controls as $control )
                                        $control->maybe_render();
index dd49f79f2675bf5734b19022baee3162e5aae286..c8542efefa4b65fe4b688b2001fb819929712fe6 100644 (file)
@@ -144,7 +144,7 @@ class WP_Customize_Setting {
         * @return mixed Null if an input isn't valid, otherwise the sanitized value.
         */
        public function sanitize( $value ) {
-               $value = stripslashes_deep( $value );
+               $value = wp_unslash( $value );
                return apply_filters( "customize_sanitize_{$this->id}", $value, $this );
        }
 
index 38ab7c262fbf71fa290cb75848cbfecf6283e262..9ab3feb5c6c39afe8f4fb387a47a0a3624dc430c 100644 (file)
@@ -152,7 +152,6 @@ final class _WP_Editors {
        }
 
        public static function editor_settings($editor_id, $set) {
-               global $editor_styles;
                $first_run = false;
 
                if ( empty(self::$first_init) ) {
@@ -176,7 +175,7 @@ final class _WP_Editors {
                                $qtInit = array_merge($qtInit, $set['quicktags']);
 
                        if ( empty($qtInit['buttons']) )
-                               $qtInit['buttons'] = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,spell,close';
+                               $qtInit['buttons'] = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close';
 
                        if ( $set['dfw'] )
                                $qtInit['buttons'] .= ',fullscreen';
@@ -193,7 +192,7 @@ final class _WP_Editors {
                                self::$baseurl = includes_url('js/tinymce');
                                self::$mce_locale = $mce_locale = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) ); // only ISO 639-1
                                $no_captions = (bool) apply_filters( 'disable_captions', '' );
-                               $plugins = array( 'inlinepopups', 'spellchecker', 'tabfocus', 'paste', 'media', 'fullscreen', 'wordpress', 'wpeditimage', 'wpgallery', 'wplink', 'wpdialogs' );
+                               $plugins = array( 'inlinepopups', 'tabfocus', 'paste', 'media', 'fullscreen', 'wordpress', 'wpeditimage', 'wpgallery', 'wplink', 'wpdialogs' );
                                $first_run = true;
                                $ext_plugins = '';
 
@@ -286,20 +285,22 @@ final class _WP_Editors {
                                self::$plugins = $plugins;
                                self::$ext_plugins = $ext_plugins;
 
-                               /*
-                               translators: These languages show up in the spellchecker drop-down menu, in the order specified, and with the first
-                               language listed being the default language. They must be comma-separated and take the format of name=code, where name
-                               is the language name (which you may internationalize), and code is a valid ISO 639 language code. Please test the
-                               spellchecker with your values.
-                               */
-                               $mce_spellchecker_languages = __( 'English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv' );
-
-                               /*
-                               The following filter allows localization scripts to change the languages displayed in the spellchecker's drop-down menu.
-                               By default it uses Google's spellchecker API, but can be configured to use PSpell/ASpell if installed on the server.
-                               The + sign marks the default language. More: http://www.tinymce.com/wiki.php/Plugin:spellchecker.
-                               */
-                               $mce_spellchecker_languages = apply_filters( 'mce_spellchecker_languages', '+' . $mce_spellchecker_languages );
+                               if ( in_array( 'spellchecker', $plugins ) ) {
+                                       /*
+                                       translators: These languages show up in the spellchecker drop-down menu, in the order specified, and with the first
+                                       language listed being the default language. They must be comma-separated and take the format of name=code, where name
+                                       is the language name (which you may internationalize), and code is a valid ISO 639 language code. Please test the
+                                       spellchecker with your values.
+                                       */
+                                       $mce_spellchecker_languages = __( 'English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,Portuguese=pt,Spanish=es,Swedish=sv' );
+
+                                       /*
+                                       The following filter allows localization scripts to change the languages displayed in the spellchecker's drop-down menu.
+                                       By default it uses Google's spellchecker API, but can be configured to use PSpell/ASpell if installed on the server.
+                                       The + sign marks the default language. More: http://www.tinymce.com/wiki.php/Plugin:spellchecker.
+                                       */
+                                       $mce_spellchecker_languages = apply_filters( 'mce_spellchecker_languages', '+' . $mce_spellchecker_languages );
+                               }
 
                                self::$first_init = array(
                                        'mode' => 'exact',
@@ -307,7 +308,6 @@ final class _WP_Editors {
                                        'theme' => 'advanced',
                                        'skin' => 'wp_theme',
                                        'language' => self::$mce_locale,
-                                       'spellchecker_languages' => $mce_spellchecker_languages,
                                        'theme_advanced_toolbar_location' => 'top',
                                        'theme_advanced_toolbar_align' => 'left',
                                        'theme_advanced_statusbar_location' => 'bottom',
@@ -344,20 +344,36 @@ final class _WP_Editors {
                                        'paste_strip_class_attributes' => 'all',
                                        'paste_text_use_dialog' => true,
                                        'webkit_fake_resize' => false,
-                                       'spellchecker_rpc_url' => self::$baseurl . '/plugins/spellchecker/rpc.php',
+                                       'preview_styles' => 'font-family font-weight text-decoration text-transform',
                                        'schema' => 'html5',
                                        'wpeditimage_disable_captions' => $no_captions,
                                        'wp_fullscreen_content_css' => self::$baseurl . '/plugins/wpfullscreen/css/wp-fullscreen.css',
                                        'plugins' => implode( ',', $plugins )
                                );
 
+                               if ( in_array( 'spellchecker', $plugins ) ) {
+                                       self::$first_init['spellchecker_rpc_url'] = self::$baseurl . '/plugins/spellchecker/rpc.php';
+                                       self::$first_init['spellchecker_languages'] = $mce_spellchecker_languages;
+                               }
+
                                // load editor_style.css if the current theme supports it
-                               if ( ! empty( $editor_styles ) && is_array( $editor_styles ) ) {
+                               if ( ! empty( $GLOBALS['editor_styles'] ) && is_array( $GLOBALS['editor_styles'] ) ) {
+                                       $editor_styles = $GLOBALS['editor_styles'];
+
                                        $mce_css = array();
-                                       $editor_styles = array_unique($editor_styles);
+                                       $editor_styles = array_unique( array_filter( $editor_styles ) );
                                        $style_uri = get_stylesheet_directory_uri();
                                        $style_dir = get_stylesheet_directory();
 
+                                       // Support externally referenced styles (like, say, fonts).
+                                       foreach ( $editor_styles as $key => $file ) {
+                                               if ( preg_match( '~^(https?:)?//~', $file ) ) {
+                                                       $mce_css[] = esc_url_raw( $file );
+                                                       unset( $editor_styles[ $key ] );
+                                               }
+                                       }
+
+                                       // Look in a parent theme first, that way child theme CSS overrides.
                                        if ( is_child_theme() ) {
                                                $template_uri = get_template_directory_uri();
                                                $template_dir = get_template_directory();
@@ -396,8 +412,16 @@ final class _WP_Editors {
 
                        $body_class = $editor_id;
 
-                       if ( $post = get_post() )
-                               $body_class .= ' post-type-' . $post->post_type;
+                       if ( $post = get_post() ) {
+                               $body_class .= ' post-type-' . sanitize_html_class( $post->post_type ) . ' post-status-' . sanitize_html_class( $post->post_status );
+                               if ( post_type_supports( $post->post_type, 'post-formats' ) ) {
+                                       $post_format = get_post_format( $post );
+                                       if ( $post_format && ! is_wp_error( $post_format ) )
+                                               $body_class .= ' post-format-' . sanitize_html_class( $post_format );
+                                       else
+                                               $body_class .= ' post-format-standard';
+                               }
+                       }
 
                        if ( !empty($set['tinymce']['body_class']) ) {
                                $body_class .= ' ' . $set['tinymce']['body_class'];
index a3331da95078f8ce149330b44267af7345990c2c..bbfcebc444b960dc1cb0d6eda450b51c4a202379 100644 (file)
@@ -194,13 +194,11 @@ class WP_Error {
 /**
  * Check whether variable is a WordPress Error.
  *
- * Looks at the object and if a WP_Error class. Does not check to see if the
- * parent is also WP_Error, so can't inherit WP_Error and still use this
- * function.
+ * Returns true if $thing is an object of the WP_Error class.
  *
  * @since 2.1.0
  *
- * @param mixed $thing Check if unknown variable is WordPress Error object.
+ * @param mixed $thing Check if unknown variable is a WP_Error object.
  * @return bool True, if WP_Error. False, if not WP_Error.
  */
 function is_wp_error($thing) {
index b0781b572d6542c8b190c1c559d5eff4f8ea8152..12aaece1eb1cd5f83b559994777330987b23af37 100644 (file)
@@ -97,6 +97,11 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
                if ( ! $size )
                        return new WP_Error( 'invalid_image', __('Could not read image size.'), $this->file );
 
+               if ( function_exists( 'imagealphablending' ) && function_exists( 'imagesavealpha' ) ) {
+                       imagealphablending( $this->image, false );
+                       imagesavealpha( $this->image, true );
+               }
+
                $this->update_size( $size[0], $size[1] );
                $this->mime_type = $size['mime'];
 
@@ -173,10 +178,13 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
         * Processes current image and saves to disk
         * multiple sizes from single source.
         *
+        * 'width' and 'height' are required.
+        * 'crop' defaults to false when not provided.
+        *
         * @since 3.5.0
         * @access public
         *
-        * @param array $sizes { {'width'=>int, 'height'=>int, 'crop'=>bool}, ... }
+        * @param array $sizes { {'width'=>int, 'height'=>int, ['crop'=>bool]}, ... }
         * @return array
         */
        public function multi_resize( $sizes ) {
@@ -184,6 +192,12 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
                $orig_size = $this->size;
 
                foreach ( $sizes as $size => $size_data ) {
+                       if ( ! ( isset( $size_data['width'] ) && isset( $size_data['height'] ) ) )
+                               continue;
+
+                       if ( ! isset( $size_data['crop'] ) )
+                               $size_data['crop'] = false;
+
                        $image = $this->_resize( $size_data['width'], $size_data['height'], $size_data['crop'] );
 
                        if( ! is_wp_error( $image ) ) {
@@ -279,8 +293,8 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
         * @since 3.5.0
         * @access public
         *
-        * @param boolean $horz Horizontal Flip
-        * @param boolean $vert Vertical Flip
+        * @param boolean $horz Flip along Horizontal Axis
+        * @param boolean $vert Flip along Vertical Axis
         * @returns boolean|WP_Error
         */
        public function flip( $horz, $vert ) {
@@ -387,4 +401,22 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
                                return imagejpeg( $this->image, null, $this->quality );
                }
        }
+
+       /**
+        * Either calls editor's save function or handles file as a stream.
+        *
+        * @since 3.5.0
+        * @access protected
+        *
+        * @param string|stream $filename
+        * @param callable $function
+        * @param array $arguments
+        * @return boolean
+        */
+       protected function make_image( $filename, $function, $arguments ) {
+               if ( wp_is_stream( $filename ) )
+                       $arguments[1] = null;
+
+               return parent::make_image( $filename, $function, $arguments );
+       }
 }
index 21e4e0cac36b9fa70070000b301c671c5f468659..f803943a4bcaf217c1be444311498766f0cfdbda 100644 (file)
@@ -19,7 +19,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
        protected $image = null; // Imagick Object
 
        function __destruct() {
-               if ( $this->image ) {
+               if ( $this->image instanceof Imagick ) {
                        // we don't need the original in memory anymore
                        $this->image->clear();
                        $this->image->destroy();
@@ -97,7 +97,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
                                return false;
 
                try {
-                       return ( (bool) Imagick::queryFormats( $imagick_extension ) );
+                       return ( (bool) @Imagick::queryFormats( $imagick_extension ) );
                }
                catch ( Exception $e ) {
                        return false;
@@ -113,7 +113,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
         * @return boolean|WP_Error True if loaded; WP_Error on failure.
         */
        public function load() {
-               if ( $this->image )
+               if ( $this->image instanceof Imagick )
                        return true;
 
                if ( ! is_file( $this->file ) && ! preg_match( '|^https?://|', $this->file ) )
@@ -245,10 +245,13 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
         * Processes current image and saves to disk
         * multiple sizes from single source.
         *
+        * 'width' and 'height' are required.
+        * 'crop' defaults to false when not provided.
+        *
         * @since 3.5.0
         * @access public
         *
-        * @param array $sizes { {'width'=>int, 'height'=>int, 'crop'=>bool}, ... }
+        * @param array $sizes { {'width'=>int, 'height'=>int, ['crop'=>bool]}, ... }
         * @return array
         */
        public function multi_resize( $sizes ) {
@@ -260,6 +263,12 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
                        if ( ! $this->image )
                                $this->image = $orig_image->getImage();
 
+                       if ( ! ( isset( $size_data['width'] ) && isset( $size_data['height'] ) ) )
+                               continue;
+
+                       if ( ! isset( $size_data['crop'] ) )
+                               $size_data['crop'] = false;
+
                        $resize_result = $this->resize( $size_data['width'], $size_data['height'], $size_data['crop'] );
 
                        if( ! is_wp_error( $resize_result ) ) {
@@ -356,8 +365,8 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
         * @since 3.5.0
         * @access public
         *
-        * @param boolean $horz Horizontal Flip
-        * @param boolean $vert Vertical Flip
+        * @param boolean $horz Flip along Horizontal Axis
+        * @param boolean $vert Flip along Vertical Axis
         * @returns boolean|WP_Error
         */
        public function flip( $horz, $vert ) {
index 099df1e0f34e85ff8033a72595291ff8414d4ba1..3c2e1b3d432ee0531a5b28391c32c01108aee4f4 100644 (file)
@@ -97,11 +97,14 @@ abstract class WP_Image_Editor {
         * Processes current image and saves to disk
         * multiple sizes from single source.
         *
+        * 'width' and 'height' are required.
+        * 'crop' defaults to false when not provided.
+        *
         * @since 3.5.0
         * @access public
         * @abstract
         *
-        * @param array $sizes { {'width'=>int, 'height'=>int, 'crop'=>bool}, ... }
+        * @param array $sizes { {'width'=>int, 'height'=>int, ['crop'=>bool]}, ... }
         * @return array
         */
        abstract public function multi_resize( $sizes );
@@ -144,8 +147,8 @@ abstract class WP_Image_Editor {
         * @access public
         * @abstract
         *
-        * @param boolean $horz Horizontal Flip
-        * @param boolean $vert Vertical Flip
+        * @param boolean $horz Flip along Horizontal Axis
+        * @param boolean $vert Flip along Vertical Axis
         * @return boolean|WP_Error
         */
        abstract public function flip( $horz, $vert );
@@ -324,11 +327,11 @@ abstract class WP_Image_Editor {
         * @return boolean
         */
        protected function make_image( $filename, $function, $arguments ) {
-               $dst_file = $filename;
-
                if ( $stream = wp_is_stream( $filename ) ) {
-                       $filename = null;
                        ob_start();
+               } else {
+                       // The directory containing the original file may no longer exist when using a replication plugin. 
+                       wp_mkdir_p( dirname( $filename ) ); 
                }
 
                $result = call_user_func_array( $function, $arguments );
@@ -336,7 +339,7 @@ abstract class WP_Image_Editor {
                if ( $result && $stream ) {
                        $contents = ob_get_contents();
 
-                       $fp = fopen( $dst_file, 'w' );
+                       $fp = fopen( $filename, 'w' );
 
                        if ( ! $fp )
                                return false;
index 7585fba9519d0245c16839b7baf14b33a4f721bb..0d47f025c172360a29d837a6fce58f3872988297 100644 (file)
@@ -37,11 +37,12 @@ final class WP_Theme implements ArrayAccess {
         * @var array
         */
        private static $default_themes = array(
-               'classic'      => 'WordPress Classic',
-               'default'      => 'WordPress Default',
-               'twentyten'    => 'Twenty Ten',
-               'twentyeleven' => 'Twenty Eleven',
-               'twentytwelve' => 'Twenty Twelve',
+               'classic'        => 'WordPress Classic',
+               'default'        => 'WordPress Default',
+               'twentyten'      => 'Twenty Ten',
+               'twentyeleven'   => 'Twenty Eleven',
+               'twentytwelve'   => 'Twenty Twelve',
+               'twentythirteen' => 'Twenty Thirteen',
        );
 
        /**
@@ -86,7 +87,7 @@ final class WP_Theme implements ArrayAccess {
        /**
         * The directory name of the theme's files, inside the theme root.
         *
-        * In the case of a child theme, this is directory name of the the child theme.
+        * In the case of a child theme, this is directory name of the child theme.
         * Otherwise, 'stylesheet' is the same as 'template'.
         *
         * @access private
@@ -719,7 +720,7 @@ final class WP_Theme implements ArrayAccess {
        /**
         * The directory name of the theme's "stylesheet" files, inside the theme root.
         *
-        * In the case of a child theme, this is directory name of the the child theme.
+        * In the case of a child theme, this is directory name of the child theme.
         * Otherwise, get_stylesheet() is the same as get_template().
         *
         * @since 3.4.0
index df9d9b61f07964d1e99f48405b02a963fce87e33..655e7f4671c973360863804476acce9dcb76a5e6 100644 (file)
@@ -80,7 +80,7 @@ class Walker {
         *
         * @param string $output Passed by reference. Used to append additional content.
         */
-       function start_el( &$output, $object, $depth, $args, $current_object_id = 0 )  {}
+       function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 )  {}
 
        /**
         * Ends the element output, if needed.
@@ -115,7 +115,7 @@ class Walker {
         * @param string $output Passed by reference. Used to append additional content.
         * @return null Null on failure with no changes to parameters.
         */
-       function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) {
+       function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
 
                if ( !$element )
                        return;
@@ -123,7 +123,7 @@ class Walker {
                $id_field = $this->db_fields['id'];
 
                //display this element
-               if ( is_array( $args[0] ) )
+               if ( isset( $args[0] ) && is_array( $args[0] ) )
                        $args[0]['has_children'] = ! empty( $children_elements[$element->$id_field] );
                $cb_args = array_merge( array(&$output, $element, $depth), $args);
                call_user_func_array(array($this, 'start_el'), $cb_args);
index e4a2d961fa61d27ea116d06529211468fb8dd926..922e0284a4b8e146d1dfd1f3eb4db47911b64ee5 100644 (file)
@@ -12,8 +12,8 @@
  * pingback. Additional WordPress API for managing comments, pages, posts,
  * options, etc.
  *
- * Since WordPress 2.6.0, WordPress XMLRPC server can be disabled in the
- * administration panels.
+ * As of WordPress 3.5.0, XML-RPC is enabled by default. It can be disabled
+ * via the xmlrpc_enabled filter found in wp_xmlrpc_server::login().
  *
  * @package WordPress
  * @subpackage Publishing
@@ -211,28 +211,22 @@ class wp_xmlrpc_server extends IXR_Server {
        }
 
        /**
-        * Sanitize string or array of strings for database.
+        * Escape string or array of strings for database.
         *
         * @since 1.5.2
         *
-        * @param string|array $array Sanitize single string or array of strings.
-        * @return string|array Type matches $array and sanitized for the database.
+        * @param string|array $data Escape single string or array of strings.
+        * @return string|array Type matches $data and sanitized for the database.
         */
-       function escape(&$array) {
-               global $wpdb;
-
-               if (!is_array($array)) {
-                       return($wpdb->escape($array));
-               } else {
-                       foreach ( (array) $array as $k => $v ) {
-                               if ( is_array($v) ) {
-                                       $this->escape($array[$k]);
-                               } else if ( is_object($v) ) {
-                                       //skip
-                               } else {
-                                       $array[$k] = $wpdb->escape($v);
-                               }
-                       }
+       function escape( &$data ) {
+               if ( ! is_array( $data ) )
+                       return wp_slash( $data );
+
+               foreach ( $data as &$v ) {
+                       if ( is_array( $v ) )
+                               $this->escape( $v );
+                       elseif ( ! is_object( $v ) )
+                               $v = wp_slash( $v );
                }
        }
 
@@ -280,16 +274,16 @@ class wp_xmlrpc_server extends IXR_Server {
                                $meta['id'] = (int) $meta['id'];
                                $pmeta = get_metadata_by_mid( 'post', $meta['id'] );
                                if ( isset($meta['key']) ) {
-                                       $meta['key'] = stripslashes( $meta['key'] );
-                                       if ( $meta['key'] != $pmeta->meta_key )
+                                       $meta['key'] = wp_unslash( $meta['key'] );
+                                       if ( $meta['key'] !== $pmeta->meta_key )
                                                continue;
-                                       $meta['value'] = stripslashes_deep( $meta['value'] );
+                                       $meta['value'] = wp_unslash( $meta['value'] );
                                        if ( current_user_can( 'edit_post_meta', $post_id, $meta['key'] ) )
                                                update_metadata_by_mid( 'post', $meta['id'], $meta['value'] );
                                } elseif ( current_user_can( 'delete_post_meta', $post_id, $pmeta->meta_key ) ) {
                                        delete_metadata_by_mid( 'post', $meta['id'] );
                                }
-                       } elseif ( current_user_can( 'add_post_meta', $post_id, stripslashes( $meta['key'] ) ) ) {
+                       } elseif ( current_user_can( 'add_post_meta', $post_id, wp_unslash( $meta['key'] ) ) ) {
                                add_post_meta( $post_id, $meta['key'], $meta['value'] );
                        }
                }
@@ -318,15 +312,25 @@ class wp_xmlrpc_server extends IXR_Server {
                                'value'         => $wp_version
                        ),
                        'blog_url'          => array(
-                               'desc'          => __( 'Site URL' ),
+                               'desc'          => __( 'WordPress Address (URL)' ),
                                'readonly'      => true,
                                'option'        => 'siteurl'
                        ),
                        'home_url'          => array(
-                               'desc'          => __( 'Home URL' ),
+                               'desc'          => __( 'Site Address (URL)' ),
                                'readonly'      => true,
                                'option'        => 'home'
                        ),
+                       'login_url'          => array(
+                               'desc'          => __( 'Login Address (URL)' ),
+                               'readonly'      => true,
+                               'value'         => wp_login_url( )
+                       ),
+                       'admin_url'          => array(
+                               'desc'          => __( 'The URL to the admin area' ),
+                               'readonly'      => true,
+                               'value'         => get_admin_url( )
+                       ),
                        'image_default_link_type' => array(
                                'desc'          => __( 'Image default link type' ),
                                'readonly'      => true,
@@ -562,13 +566,13 @@ class wp_xmlrpc_server extends IXR_Server {
                if ( ! is_array( $_term) )
                        $_term = get_object_vars( $_term );
 
-               // For Intergers which may be largeer than XMLRPC supports ensure we return strings.
+               // For integers which may be larger than XML-RPC supports ensure we return strings.
                $_term['term_id'] = strval( $_term['term_id'] );
                $_term['term_group'] = strval( $_term['term_group'] );
                $_term['term_taxonomy_id'] = strval( $_term['term_taxonomy_id'] );
                $_term['parent'] = strval( $_term['parent'] );
 
-               // Count we are happy to return as an Integer because people really shouldn't use Terms that much.
+               // Count we are happy to return as an integer because people really shouldn't use terms that much.
                $_term['count'] = intval( $_term['count'] );
 
                return apply_filters( 'xmlrpc_prepare_term', $_term, $term );
@@ -1007,7 +1011,7 @@ class wp_xmlrpc_server extends IXR_Server {
                if ( $update ) {
                        if ( ! get_post( $post_data['ID'] ) )
                                return new IXR_Error( 401, __( 'Invalid post ID.' ) );
-                       if ( ! current_user_can( $post_type->cap->edit_post, $post_data['ID'] ) )
+                       if ( ! current_user_can( 'edit_post', $post_data['ID'] ) )
                                return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post.' ) );
                        if ( $post_data['post_type'] != get_post_type( $post_data['ID'] ) )
                                return new IXR_Error( 401, __( 'The post type may not be changed.' ) );
@@ -1317,8 +1321,7 @@ class wp_xmlrpc_server extends IXR_Server {
                if ( empty( $post['ID'] ) )
                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
 
-               $post_type = get_post_type_object( $post['post_type'] );
-               if ( ! current_user_can( $post_type->cap->delete_post, $post_id ) )
+               if ( ! current_user_can( 'delete_post', $post_id ) )
                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to delete this post.' ) );
 
                $result = wp_delete_post( $post_id );
@@ -1399,8 +1402,7 @@ class wp_xmlrpc_server extends IXR_Server {
                if ( empty( $post['ID'] ) )
                        return new IXR_Error( 404, __( 'Invalid post ID.' ) );
 
-               $post_type = get_post_type_object( $post['post_type'] );
-               if ( ! current_user_can( $post_type->cap->edit_post, $post_id ) )
+               if ( ! current_user_can( 'edit_post', $post_id ) )
                        return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );
 
                return $this->_prepare_post( $post, $fields );
@@ -1495,8 +1497,7 @@ class wp_xmlrpc_server extends IXR_Server {
                $struct = array();
 
                foreach ( $posts_list as $post ) {
-                       $post_type = get_post_type_object( $post['post_type'] );
-                       if ( ! current_user_can( $post_type->cap->edit_post, $post['ID'] ) )
+                       if ( ! current_user_can( 'edit_post', $post['ID'] ) )
                                continue;
 
                        $struct[] = $this->_prepare_post( $post, $fields );
@@ -2978,9 +2979,9 @@ class wp_xmlrpc_server extends IXR_Server {
                $comment['comment_post_ID'] = $post_id;
 
                if ( $logged_in ) {
-                       $comment['comment_author'] = $wpdb->escape( $user->display_name );
-                       $comment['comment_author_email'] = $wpdb->escape( $user->user_email );
-                       $comment['comment_author_url'] = $wpdb->escape( $user->user_url );
+                       $comment['comment_author'] = $this->escape( $user->display_name );
+                       $comment['comment_author_email'] = $this->escape( $user->user_email );
+                       $comment['comment_author_url'] = $this->escape( $user->user_url );
                        $comment['user_ID'] = $user->ID;
                } else {
                        $comment['comment_author'] = '';
@@ -3192,6 +3193,7 @@ class wp_xmlrpc_server extends IXR_Server {
         */
        function _getOptions($options) {
                $data = array();
+               $can_manage = current_user_can( 'manage_options' );
                foreach ( $options as $option ) {
                        if ( array_key_exists( $option, $this->blog_options ) ) {
                                $data[$option] = $this->blog_options[$option];
@@ -3200,6 +3202,9 @@ class wp_xmlrpc_server extends IXR_Server {
                                        $data[$option]['value'] = get_option( $data[$option]['option'] );
                                        unset($data[$option]['option']);
                                }
+
+                               if ( ! $can_manage )
+                                       $data[$option]['readonly'] = true;
                        }
                }
 
@@ -3535,7 +3540,7 @@ class wp_xmlrpc_server extends IXR_Server {
                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit posts.' ) );
 
                // Check if revisions are enabled.
-               if ( ! WP_POST_REVISIONS || ! post_type_supports( $post->post_type, 'revisions' ) )
+               if ( ! wp_revisions_enabled( $post ) )
                        return new IXR_Error( 401, __( 'Sorry, revisions are disabled.' ) );
 
                $revisions = wp_get_post_revisions( $post_id );
@@ -3602,7 +3607,7 @@ class wp_xmlrpc_server extends IXR_Server {
                        return new IXR_Error( 401, __( 'Sorry, you cannot edit this post.' ) );
 
                // Check if revisions are disabled.
-               if ( ! WP_POST_REVISIONS || ! post_type_supports( $post->post_type, 'revisions' ) )
+               if ( ! wp_revisions_enabled( $post ) )
                        return new IXR_Error( 401, __( 'Sorry, revisions are disabled.' ) );
 
                $post = wp_restore_post_revision( $revision_id );
@@ -3746,9 +3751,9 @@ class wp_xmlrpc_server extends IXR_Server {
 
                $categories = implode(',', wp_get_post_categories($post_ID));
 
-               $content  = '<title>'.stripslashes($post_data['post_title']).'</title>';
+               $content  = '<title>'.wp_unslash($post_data['post_title']).'</title>';
                $content .= '<category>'.$categories.'</category>';
-               $content .= stripslashes($post_data['post_content']);
+               $content .= wp_unslash($post_data['post_content']);
 
                $struct = array(
                        'userid'    => $post_data['post_author'],
@@ -3784,6 +3789,9 @@ class wp_xmlrpc_server extends IXR_Server {
                if ( !$user = $this->login($username, $password) )
                        return $this->error;
 
+               if ( ! current_user_can( 'edit_posts' ) )
+                       return new IXR_Error( 401, __( 'Sorry, you cannot edit posts on this site.' ) );
+
                do_action('xmlrpc_call', 'blogger.getRecentPosts');
 
                $posts_list = wp_get_recent_posts( $query );
@@ -3800,9 +3808,9 @@ class wp_xmlrpc_server extends IXR_Server {
                        $post_date  = $this->_convert_date( $entry['post_date'] );
                        $categories = implode(',', wp_get_post_categories($entry['ID']));
 
-                       $content  = '<title>'.stripslashes($entry['post_title']).'</title>';
+                       $content  = '<title>'.wp_unslash($entry['post_title']).'</title>';
                        $content .= '<category>'.$categories.'</category>';
-                       $content .= stripslashes($entry['post_content']);
+                       $content .= wp_unslash($entry['post_content']);
 
                        $struct[] = array(
                                'userid' => $entry['post_author'],
@@ -4300,22 +4308,20 @@ class wp_xmlrpc_server extends IXR_Server {
                return strval($post_ID);
        }
 
-       function add_enclosure_if_new($post_ID, $enclosure) {
+       function add_enclosure_if_new( $post_ID, $enclosure ) {
                if ( is_array( $enclosure ) && isset( $enclosure['url'] ) && isset( $enclosure['length'] ) && isset( $enclosure['type'] ) ) {
-
-                       $encstring = $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type'];
+                       $encstring = $enclosure['url'] . "\n" . $enclosure['length'] . "\n" . $enclosure['type'] . "\n";
                        $found = false;
-                       foreach ( (array) get_post_custom($post_ID) as $key => $val) {
-                               if ($key == 'enclosure') {
-                                       foreach ( (array) $val as $enc ) {
-                                               if ($enc == $encstring) {
-                                                       $found = true;
-                                                       break 2;
-                                               }
+                       if ( $enclosures = get_post_meta( $post_ID, 'enclosure' ) ) {
+                               foreach ( $enclosures as $enc ) {
+                                       // This method used to omit the trailing new line. #23219
+                                       if ( rtrim( $enc, "\n" ) == rtrim( $encstring, "\n" ) ) {
+                                               $found = true;
+                                               break;
                                        }
                                }
                        }
-                       if (!$found)
+                       if ( ! $found )
                                add_post_meta( $post_ID, 'enclosure', $encstring );
                }
        }
@@ -4335,7 +4341,7 @@ class wp_xmlrpc_server extends IXR_Server {
                $attachments = $wpdb->get_results( "SELECT ID, guid FROM {$wpdb->posts} WHERE post_parent = '0' AND post_type = 'attachment'" );
                if ( is_array( $attachments ) ) {
                        foreach ( $attachments as $file ) {
-                               if ( strpos( $post_content, $file->guid ) !== false )
+                               if ( ! empty( $file->guid ) && strpos( $post_content, $file->guid ) !== false )
                                        $wpdb->update($wpdb->posts, array('post_parent' => $post_ID), array('ID' => $file->ID) );
                        }
                }
@@ -4757,6 +4763,9 @@ class wp_xmlrpc_server extends IXR_Server {
                if ( !$user = $this->login($username, $password) )
                        return $this->error;
 
+               if ( ! current_user_can( 'edit_posts' ) )
+                       return new IXR_Error( 401, __( 'Sorry, you cannot edit posts on this site.' ) );
+
                do_action('xmlrpc_call', 'metaWeblog.getRecentPosts');
 
                $posts_list = wp_get_recent_posts( $query );
@@ -4908,8 +4917,8 @@ class wp_xmlrpc_server extends IXR_Server {
                global $wpdb;
 
                $blog_ID     = (int) $args[0];
-               $username  = $wpdb->escape($args[1]);
-               $password   = $wpdb->escape($args[2]);
+               $username  = $this->escape($args[1]);
+               $password   = $this->escape($args[2]);
                $data        = $args[3];
 
                $name = sanitize_file_name( $data['name'] );
@@ -5380,7 +5389,12 @@ class wp_xmlrpc_server extends IXR_Server {
                sleep(1);
 
                // Let's check the remote site
-               $linea = wp_remote_retrieve_body( wp_remote_get( $pagelinkedfrom, array( 'timeout' => 10, 'redirection' => 0, 'reject_unsafe_urls' => true ) ) );
+               $http_api_args = array(
+                       'timeout' => 10,
+                       'redirection' => 0,
+                       'limit_response_size' => 153600, // 150 KB
+               );
+               $linea = wp_remote_retrieve_body( wp_safe_remote_get( $pagelinkedfrom, $http_api_args ) );
 
                if ( !$linea )
                        return $this->pingback_error( 16, __( 'The source URL does not exist.' ) );
@@ -5389,7 +5403,7 @@ class wp_xmlrpc_server extends IXR_Server {
 
                // Work around bug in strip_tags():
                $linea = str_replace('<!DOC', '<DOC', $linea);
-               $linea = preg_replace( '/[\s\r\n\t]+/', ' ', $linea ); // normalize spaces
+               $linea = preg_replace( '/[\r\n\t ]+/', ' ', $linea ); // normalize spaces
                $linea = preg_replace( "/<\/*(h1|h2|h3|h4|h5|h6|p|th|td|li|dt|dd|pre|caption|input|textarea|button|body)[^>]*>/", "\n\n", $linea );
 
                preg_match('|<title>([^<]*?)</title>|is', $linea, $matchtitle);
@@ -5417,7 +5431,7 @@ class wp_xmlrpc_server extends IXR_Server {
 
                                // prevent really long link text
                                if ( strlen($context[1]) > 100 )
-                                       $context[1] = substr($context[1], 0, 100) . '...';
+                                       $context[1] = substr($context[1], 0, 100) . '&#8230;';
 
                                $marker = '<wpcontext>'.$context[1].'</wpcontext>';    // set up our marker
                                $excerpt= str_replace($context[0], $marker, $excerpt); // swap out the link for our marker
@@ -5435,8 +5449,8 @@ class wp_xmlrpc_server extends IXR_Server {
 
                $pagelinkedfrom = str_replace('&', '&amp;', $pagelinkedfrom);
 
-               $context = '[...] ' . esc_html( $excerpt ) . ' [...]';
-               $pagelinkedfrom = $wpdb->escape( $pagelinkedfrom );
+               $context = '[&#8230;] ' . esc_html( $excerpt ) . ' [&#8230;]';
+               $pagelinkedfrom = $this->escape( $pagelinkedfrom );
 
                $comment_post_ID = (int) $post_ID;
                $comment_author = $title;
index c76030b32c35fa9112f42e5f683d7c319c82150a..dc7768865074ee92d0aefbe6a6aa0af1a3029fb9 100644 (file)
@@ -25,7 +25,7 @@ class WP {
         * @since 2.0.0
         * @var array
         */
-       var $private_query_vars = array('offset', 'posts_per_page', 'posts_per_archive_page', 'showposts', 'nopaging', 'post_type', 'post_status', 'category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'tag_id', 'post_mime_type', 'perm', 'comments_per_page', 'post__in', 'post__not_in');
+       var $private_query_vars = array( 'offset', 'posts_per_page', 'posts_per_archive_page', 'showposts', 'nopaging', 'post_type', 'post_status', 'category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'tag_id', 'post_mime_type', 'perm', 'comments_per_page', 'post__in', 'post__not_in', 'post_parent__in', 'post_parent__not_in' );
 
        /**
         * Extra query variables set by the user.
@@ -356,7 +356,7 @@ class WP {
 
                        // Support for Conditional GET
                        if (isset($_SERVER['HTTP_IF_NONE_MATCH']))
-                               $client_etag = stripslashes(stripslashes($_SERVER['HTTP_IF_NONE_MATCH']));
+                               $client_etag = wp_unslash( $_SERVER['HTTP_IF_NONE_MATCH'] );
                        else $client_etag = false;
 
                        $client_last_modified = empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? '' : trim($_SERVER['HTTP_IF_MODIFIED_SINCE']);
index f75929b4abf875beb27ab1f6f3f325b23ca27eb1..38f3f9fcf3b7c64d406877deab30a958f7200ae4 100644 (file)
@@ -133,6 +133,9 @@ class WP_Scripts extends WP_Dependencies {
         * Localizes only if the script has already been added
         */
        function localize( $handle, $object_name, $l10n ) {
+               if ( $handle === 'jquery' )
+                       $handle = 'jquery-core';
+
                if ( is_array($l10n) && isset($l10n['l10n_print_after']) ) { // back compat, preserve the code in 'l10n_print_after' if present
                        $after = $l10n['l10n_print_after'];
                        unset($l10n['l10n_print_after']);
index fdfe5afe3213b2afd7ded35095b6ca1bae47085d..b1241b30460077b25b5eff35b187ea0d6154525d 100644 (file)
@@ -50,7 +50,7 @@ class WP_Styles extends WP_Dependencies {
                                $this->concat .= "$handle,";
                                $this->concat_version .= "$handle$ver";
 
-                               $this->print_code .= $this->get_data( $handle, 'after' );
+                               $this->print_code .= $this->print_inline_style( $handle, false );
 
                                return true;
                        }
index 8be25e10d58c208d4fd00f9f75edde02b6976a64..9a09d28d540eaf0e038cf486e3da9fbbadbb612a 100644 (file)
@@ -393,8 +393,8 @@ function comment_date( $d = '', $comment_ID = 0 ) {
 /**
  * Retrieve the excerpt of the current comment.
  *
- * Will cut each word and only output the first 20 words with '...' at the end.
- * If the word count is less than 20, then no truncating is done and no '...'
+ * Will cut each word and only output the first 20 words with '&hellip;' at the end.
+ * If the word count is less than 20, then no truncating is done and no '&hellip;'
  * will appear.
  *
  * @since 1.5.0
@@ -419,7 +419,7 @@ function get_comment_excerpt( $comment_ID = 0 ) {
        for ($i=0; $i<$k; $i++) {
                $excerpt .= $blah[$i] . ' ';
        }
-       $excerpt .= ($use_dotdotdot) ? '...' : '';
+       $excerpt .= ($use_dotdotdot) ? '&hellip;' : '';
        return apply_filters('get_comment_excerpt', $excerpt);
 }
 
@@ -516,7 +516,7 @@ function get_comment_link( $comment = null, $args = array() ) {
  * @return string The link to the comments
  */
 function get_comments_link($post_id = 0) {
-       return get_permalink($post_id) . '#comments';
+       return apply_filters( 'get_comments_link', get_permalink( $post_id ) . '#comments', $post_id );
 }
 
 /**
@@ -532,7 +532,7 @@ function comments_link( $deprecated = '', $deprecated_2 = '' ) {
                _deprecated_argument( __FUNCTION__, '0.72' );
        if ( !empty( $deprecated_2 ) )
                _deprecated_argument( __FUNCTION__, '1.3' );
-       echo get_comments_link();
+       echo esc_url( get_comments_link() );
 }
 
 /**
@@ -1244,11 +1244,11 @@ class Walker_Comment extends Walker {
                        case 'div':
                                break;
                        case 'ol':
-                               echo "<ol class='children'>\n";
+                               echo '<ol class="children">' . "\n";
                                break;
                        default:
                        case 'ul':
-                               echo "<ul class='children'>\n";
+                               echo '<ul class="children">' . "\n";
                                break;
                }
        }
@@ -1268,11 +1268,11 @@ class Walker_Comment extends Walker {
                        case 'div':
                                break;
                        case 'ol':
-                               echo "</ol>\n";
+                               echo "</ol><!-- .children -->\n";
                                break;
                        default:
                        case 'ul':
-                               echo "</ul>\n";
+                               echo "</ul><!-- .children -->\n";
                                break;
                }
        }
@@ -1295,7 +1295,7 @@ class Walker_Comment extends Walker {
         *  2.2
         *
         */
-       function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output ) {
+       function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
 
                if ( !$element )
                        return;
@@ -1325,18 +1325,72 @@ class Walker_Comment extends Walker {
         * @param int $depth Depth of comment in reference to parents.
         * @param array $args
         */
-       function start_el( &$output, $comment, $depth, $args, $id = 0 ) {
+       function start_el( &$output, $comment, $depth = 0, $args = array(), $id = 0 ) {
                $depth++;
                $GLOBALS['comment_depth'] = $depth;
                $GLOBALS['comment'] = $comment;
 
-               if ( !empty($args['callback']) ) {
-                       call_user_func($args['callback'], $comment, $args, $depth);
+               if ( !empty( $args['callback'] ) ) {
+                       call_user_func( $args['callback'], $comment, $args, $depth );
                        return;
                }
 
-               extract($args, EXTR_SKIP);
+               if ( ( 'pingback' == $comment->comment_type || 'trackback' == $comment->comment_type ) && $args['short_ping'] ) {
+                       $this->ping( $comment, $depth, $args );
+               } elseif ( 'html5' === $args['format'] ) {
+                       $this->html5_comment( $comment, $depth, $args );
+               } else {
+                       $this->comment( $comment, $depth, $args );
+               }
+       }
+
+       /**
+        * @see Walker::end_el()
+        * @since 2.7.0
+        *
+        * @param string $output Passed by reference. Used to append additional content.
+        * @param object $comment
+        * @param int $depth Depth of comment.
+        * @param array $args
+        */
+       function end_el( &$output, $comment, $depth = 0, $args = array() ) {
+               if ( !empty( $args['end-callback'] ) ) {
+                       call_user_func( $args['end-callback'], $comment, $args, $depth );
+                       return;
+               }
+               if ( 'div' == $args['style'] )
+                       echo "</div><!-- #comment-## -->\n";
+               else
+                       echo "</li><!-- #comment-## -->\n";
+       }
+
+       /**
+        * @since 3.6
+        * @access protected
+        *
+        * @param object $comment
+        * @param int $depth Depth of comment.
+        * @param array $args
+        */
+       protected function ping( $comment, $depth, $args ) {
+               $tag = ( 'div' == $args['style'] ) ? 'div' : 'li';
+?>
+               <<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class(); ?>>
+                       <div class="comment-body">
+                               <?php _e( 'Pingback:' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( 'Edit' ), '<span class="edit-link">', '</span>' ); ?>
+                       </div>
+<?php
+       }
 
+       /**
+        * @since 3.6
+        * @access protected
+        *
+        * @param object $comment Comment to display.
+        * @param int $depth Depth of comment.
+        * @param array $args Optional args.
+        */
+       protected function comment( $comment, $depth, $args ) {
                if ( 'div' == $args['style'] ) {
                        $tag = 'div';
                        $add_below = 'comment';
@@ -1345,30 +1399,30 @@ class Walker_Comment extends Walker {
                        $add_below = 'div-comment';
                }
 ?>
-               <<?php echo $tag ?> <?php comment_class(empty( $args['has_children'] ) ? '' : 'parent') ?> id="comment-<?php comment_ID() ?>">
+               <<?php echo $tag; ?> <?php comment_class( empty( $args['has_children'] ) ? '' : 'parent' ); ?> id="comment-<?php comment_ID(); ?>">
                <?php if ( 'div' != $args['style'] ) : ?>
-               <div id="div-comment-<?php comment_ID() ?>" class="comment-body">
+               <div id="div-comment-<?php comment_ID(); ?>" class="comment-body">
                <?php endif; ?>
                <div class="comment-author vcard">
-               <?php if ($args['avatar_size'] != 0) echo get_avatar( $comment, $args['avatar_size'] ); ?>
-               <?php printf(__('<cite class="fn">%s</cite> <span class="says">says:</span>'), get_comment_author_link()) ?>
+                       <?php if ( 0 != $args['avatar_size'] ) echo get_avatar( $comment, $args['avatar_size'] ); ?>
+                       <?php printf( __( '<cite class="fn">%s</cite> <span class="says">says:</span>' ), get_comment_author_link() ); ?>
                </div>
-<?php if ($comment->comment_approved == '0') : ?>
-               <em class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.') ?></em>
+               <?php if ( '0' == $comment->comment_approved ) : ?>
+               <em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.' ) ?></em>
                <br />
-<?php endif; ?>
+               <?php endif; ?>
 
-               <div class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>">
+               <div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
                        <?php
                                /* translators: 1: date, 2: time */
-                               printf( __('%1$s at %2$s'), get_comment_date(),  get_comment_time()) ?></a><?php edit_comment_link(__('(Edit)'),'&nbsp;&nbsp;','' );
+                               printf( __( '%1$s at %2$s' ), get_comment_date(),  get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)' ), '&nbsp;&nbsp;', '' );
                        ?>
                </div>
 
                <?php comment_text() ?>
 
                <div class="reply">
-               <?php comment_reply_link(array_merge( $args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?>
+                       <?php comment_reply_link( array_merge( $args, array( 'add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
                </div>
                <?php if ( 'div' != $args['style'] ) : ?>
                </div>
@@ -1377,25 +1431,48 @@ class Walker_Comment extends Walker {
        }
 
        /**
-        * @see Walker::end_el()
-        * @since 2.7.0
+        * @since 3.6
+        * @access protected
         *
-        * @param string $output Passed by reference. Used to append additional content.
-        * @param object $comment
+        * @param object $comment Comment to display.
         * @param int $depth Depth of comment.
-        * @param array $args
+        * @param array $args Optional args.
         */
-       function end_el(&$output, $comment, $depth = 0, $args = array() ) {
-               if ( !empty($args['end-callback']) ) {
-                       call_user_func($args['end-callback'], $comment, $args, $depth);
-                       return;
-               }
-               if ( 'div' == $args['style'] )
-                       echo "</div>\n";
-               else
-                       echo "</li>\n";
+       protected function html5_comment( $comment, $depth, $args ) {
+               $tag = ( 'div' === $args['style'] ) ? 'div' : 'li';
+?>
+               <<?php echo $tag; ?> id="comment-<?php comment_ID(); ?>" <?php comment_class( empty( $args['has_children'] ) ? '' : 'parent' ); ?>>
+                       <article id="div-comment-<?php comment_ID(); ?>" class="comment-body">
+                               <footer class="comment-meta">
+                                       <div class="comment-author vcard">
+                                               <?php if ( 0 != $args['avatar_size'] ) echo get_avatar( $comment, $args['avatar_size'] ); ?>
+                                               <?php printf( __( '%s <span class="says">says:</span>' ), sprintf( '<b class="fn">%s</b>', get_comment_author_link() ) ); ?>
+                                       </div><!-- .comment-author -->
+
+                                       <div class="comment-metadata">
+                                               <a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
+                                                       <time datetime="<?php comment_time( 'c' ); ?>">
+                                                               <?php printf( _x( '%1$s at %2$s', '1: date, 2: time' ), get_comment_date(), get_comment_time() ); ?>
+                                                       </time>
+                                               </a>
+                                               <?php edit_comment_link( __( 'Edit' ), '<span class="edit-link">', '</span>' ); ?>
+                                       </div><!-- .comment-metadata -->
+
+                                       <?php if ( '0' == $comment->comment_approved ) : ?>
+                                       <p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.' ); ?></p>
+                                       <?php endif; ?>
+                               </footer><!-- .comment-meta -->
+
+                               <div class="comment-content">
+                                       <?php comment_text(); ?>
+                               </div><!-- .comment-content -->
+
+                               <div class="reply">
+                                       <?php comment_reply_link( array_merge( $args, array( 'add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
+                               </div><!-- .reply -->
+                       </article><!-- .comment-body -->
+<?php
        }
-
 }
 
 /**
@@ -1417,8 +1494,21 @@ function wp_list_comments($args = array(), $comments = null ) {
        $comment_alt = $comment_thread_alt = 0;
        $comment_depth = 1;
 
-       $defaults = array('walker' => null, 'max_depth' => '', 'style' => 'ul', 'callback' => null, 'end-callback' => null, 'type' => 'all',
-               'page' => '', 'per_page' => '', 'avatar_size' => 32, 'reverse_top_level' => null, 'reverse_children' => '');
+       $defaults = array(
+               'walker'            => null,
+               'max_depth'         => '',
+               'style'             => 'ul',
+               'callback'          => null,
+               'end-callback'      => null,
+               'type'              => 'all',
+               'page'              => '',
+               'per_page'          => '',
+               'avatar_size'       => 32,
+               'reverse_top_level' => null,
+               'reverse_children'  => '',
+               'format'            => current_theme_supports( 'html5', 'comment-list' ) ? 'html5' : 'xhtml',
+               'short_ping'        => false,
+       );
 
        $r = wp_parse_args( $args, $defaults );
 
@@ -1507,10 +1597,8 @@ function wp_list_comments($args = array(), $comments = null ) {
  * @return void
  */
 function comment_form( $args = array(), $post_id = null ) {
-       global $id;
-
        if ( null === $post_id )
-               $post_id = $id;
+               $post_id = get_the_ID();
        else
                $id = $post_id;
 
@@ -1518,21 +1606,25 @@ function comment_form( $args = array(), $post_id = null ) {
        $user = wp_get_current_user();
        $user_identity = $user->exists() ? $user->display_name : '';
 
-       $req = get_option( 'require_name_email' );
+       if ( ! isset( $args['format'] ) )
+               $args['format'] = current_theme_supports( 'html5', 'comment-form' ) ? 'html5' : 'xhtml';
+
+       $req      = get_option( 'require_name_email' );
        $aria_req = ( $req ? " aria-required='true'" : '' );
-       $fields =  array(
+       $html5    = 'html5' === $args['format'];
+       $fields   =  array(
                'author' => '<p class="comment-form-author">' . '<label for="author">' . __( 'Name' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
                            '<input id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' /></p>',
                'email'  => '<p class="comment-form-email"><label for="email">' . __( 'Email' ) . ( $req ? ' <span class="required">*</span>' : '' ) . '</label> ' .
-                           '<input id="email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></p>',
-               'url'    => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label>' .
-                           '<input id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>',
+                           '<input id="email" name="email" ' . ( $html5 ? 'type="email"' : 'type="text"' ) . ' value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' /></p>',
+               'url'    => '<p class="comment-form-url"><label for="url">' . __( 'Website' ) . '</label> ' .
+                           '<input id="url" name="url" ' . ( $html5 ? 'type="url"' : 'type="text"' ) . ' value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" /></p>',
        );
 
        $required_text = sprintf( ' ' . __('Required fields are marked %s'), '<span class="required">*</span>' );
        $defaults = array(
                'fields'               => apply_filters( 'comment_form_default_fields', $fields ),
-               'comment_field'        => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>',
+               'comment_field'        => '<p class="comment-form-comment"><label for="comment">' . _x( 'Comment', 'noun' ) . '</label> <textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>',
                'must_log_in'          => '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
                'logged_in_as'         => '<p class="logged-in-as">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>' ), get_edit_user_link(), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '</p>',
                'comment_notes_before' => '<p class="comment-notes">' . __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) . '</p>',
@@ -1543,6 +1635,7 @@ function comment_form( $args = array(), $post_id = null ) {
                'title_reply_to'       => __( 'Leave a Reply to %s' ),
                'cancel_reply_link'    => __( 'Cancel reply' ),
                'label_submit'         => __( 'Post Comment' ),
+               'format'               => 'xhtml',
        );
 
        $args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) );
@@ -1550,13 +1643,13 @@ function comment_form( $args = array(), $post_id = null ) {
        ?>
                <?php if ( comments_open( $post_id ) ) : ?>
                        <?php do_action( 'comment_form_before' ); ?>
-                       <div id="respond">
-                               <h3 id="reply-title"><?php comment_form_title( $args['title_reply'], $args['title_reply_to'] ); ?> <small><?php cancel_comment_reply_link( $args['cancel_reply_link'] ); ?></small></h3>
+                       <div id="respond" class="comment-respond">
+                               <h3 id="reply-title" class="comment-reply-title"><?php comment_form_title( $args['title_reply'], $args['title_reply_to'] ); ?> <small><?php cancel_comment_reply_link( $args['cancel_reply_link'] ); ?></small></h3>
                                <?php if ( get_option( 'comment_registration' ) && !is_user_logged_in() ) : ?>
                                        <?php echo $args['must_log_in']; ?>
                                        <?php do_action( 'comment_form_must_log_in_after' ); ?>
                                <?php else : ?>
-                                       <form action="<?php echo site_url( '/wp-comments-post.php' ); ?>" method="post" id="<?php echo esc_attr( $args['id_form'] ); ?>">
+                                       <form action="<?php echo site_url( '/wp-comments-post.php' ); ?>" method="post" id="<?php echo esc_attr( $args['id_form'] ); ?>" class="comment-form"<?php echo $html5 ? ' novalidate' : ''; ?>>
                                                <?php do_action( 'comment_form_top' ); ?>
                                                <?php if ( is_user_logged_in() ) : ?>
                                                        <?php echo apply_filters( 'comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity ); ?>
index 5476b930c7e098fe72748acf684f32cfd40b2246..4d4c9bc496c9a68605996b4000404db98b70a09f 100644 (file)
@@ -250,8 +250,10 @@ class WP_Comment_Query {
                // $args can be whatever, only use the args defined in defaults to compute the key
                $key = md5( serialize( compact(array_keys($defaults)) )  );
                $last_changed = wp_cache_get( 'last_changed', 'comment' );
-               if ( ! $last_changed )
-                       $last_changed = wp_cache_set( 'last_changed', 1, 'comment' );
+               if ( ! $last_changed ) {
+                       $last_changed = microtime();
+                       wp_cache_set( 'last_changed', $last_changed, 'comment' );
+               }
                $cache_key = "get_comments:$key:$last_changed";
 
                if ( $cache = wp_cache_get( $cache_key, 'comment' ) )
@@ -415,7 +417,7 @@ class WP_Comment_Query {
  *
  * @return array List of comment statuses.
  */
-function get_comment_statuses( ) {
+function get_comment_statuses() {
        $status = array(
                'hold'          => __('Unapproved'),
                /* translators: comment status  */
@@ -537,7 +539,7 @@ function get_comment_count( $post_id = 0 ) {
  * @param string $meta_key Metadata name.
  * @param mixed $meta_value Metadata value.
  * @param bool $unique Optional, default is false. Whether the same key should not be added.
- * @return bool False for failure. True for success.
+ * @return int|bool Meta ID on success, false on failure.
  */
 function add_comment_meta($comment_id, $meta_key, $meta_value, $unique = false) {
        return add_metadata('comment', $comment_id, $meta_key, $meta_value, $unique);
@@ -557,7 +559,7 @@ function add_comment_meta($comment_id, $meta_key, $meta_value, $unique = false)
  * @param int $comment_id comment ID
  * @param string $meta_key Metadata name.
  * @param mixed $meta_value Optional. Metadata value.
- * @return bool False for failure. True for success.
+ * @return bool True on success, false on failure.
  */
 function delete_comment_meta($comment_id, $meta_key, $meta_value = '') {
        return delete_metadata('comment', $comment_id, $meta_key, $meta_value);
@@ -596,7 +598,7 @@ function get_comment_meta($comment_id, $key = '', $single = false) {
  * @param string $meta_key Metadata key.
  * @param mixed $meta_value Metadata value.
  * @param mixed $prev_value Optional. Previous value to check before removing.
- * @return bool False on failure, true if success.
+ * @return bool True on success, false on failure.
  */
 function update_comment_meta($comment_id, $meta_key, $meta_value, $prev_value = '') {
        return update_metadata('comment', $comment_id, $meta_key, $meta_value, $prev_value);
@@ -632,21 +634,21 @@ function wp_set_comment_cookies($comment, $user) {
 function sanitize_comment_cookies() {
        if ( isset($_COOKIE['comment_author_'.COOKIEHASH]) ) {
                $comment_author = apply_filters('pre_comment_author_name', $_COOKIE['comment_author_'.COOKIEHASH]);
-               $comment_author = stripslashes($comment_author);
+               $comment_author = wp_unslash($comment_author);
                $comment_author = esc_attr($comment_author);
                $_COOKIE['comment_author_'.COOKIEHASH] = $comment_author;
        }
 
        if ( isset($_COOKIE['comment_author_email_'.COOKIEHASH]) ) {
                $comment_author_email = apply_filters('pre_comment_author_email', $_COOKIE['comment_author_email_'.COOKIEHASH]);
-               $comment_author_email = stripslashes($comment_author_email);
+               $comment_author_email = wp_unslash($comment_author_email);
                $comment_author_email = esc_attr($comment_author_email);
                $_COOKIE['comment_author_email_'.COOKIEHASH] = $comment_author_email;
        }
 
        if ( isset($_COOKIE['comment_author_url_'.COOKIEHASH]) ) {
                $comment_author_url = apply_filters('pre_comment_author_url', $_COOKIE['comment_author_url_'.COOKIEHASH]);
-               $comment_author_url = stripslashes($comment_author_url);
+               $comment_author_url = wp_unslash($comment_author_url);
                $_COOKIE['comment_author_url_'.COOKIEHASH] = $comment_author_url;
        }
 }
@@ -669,10 +671,10 @@ function wp_allow_comment($commentdata) {
 
        // Simple duplicate check
        // expected_slashed ($comment_post_ID, $comment_author, $comment_author_email, $comment_content)
-       $dupe = "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = '$comment_post_ID' AND comment_parent = '$comment_parent' AND comment_approved != 'trash' AND ( comment_author = '$comment_author' ";
+       $dupe = $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_parent = %s AND comment_approved != 'trash' AND ( comment_author = %s ", wp_unslash( $comment_post_ID ), wp_unslash( $comment_parent ), wp_unslash( $comment_author ) );
        if ( $comment_author_email )
-               $dupe .= "OR comment_author_email = '$comment_author_email' ";
-       $dupe .= ") AND comment_content = '$comment_content' LIMIT 1";
+               $dupe .= $wpdb->prepare( "OR comment_author_email = %s ", wp_unslash( $comment_author_email ) );
+       $dupe .= $wpdb->prepare( ") AND comment_content = %s LIMIT 1", wp_unslash( $comment_content ) );
        if ( $wpdb->get_var($dupe) ) {
                do_action( 'comment_duplicate_trigger', $commentdata );
                if ( defined('DOING_AJAX') )
@@ -992,7 +994,7 @@ function wp_count_comments( $post_id = 0 ) {
  *
  * @param int $comment_id Comment ID
  * @param bool $force_delete Whether to bypass trash and force deletion. Default is false.
- * @return bool False if delete comment query failure, true on success.
+ * @return bool True on success, false on failure.
  */
 function wp_delete_comment($comment_id, $force_delete = false) {
        global $wpdb;
@@ -1042,7 +1044,7 @@ function wp_delete_comment($comment_id, $force_delete = false) {
  * @uses wp_delete_comment() if trash is disabled
  *
  * @param int $comment_id Comment ID.
- * @return mixed False on failure
+ * @return bool True on success, false on failure.
  */
 function wp_trash_comment($comment_id) {
        if ( !EMPTY_TRASH_DAYS )
@@ -1071,7 +1073,7 @@ function wp_trash_comment($comment_id) {
  * @uses do_action() on 'untrashed_comment' after untrashing
  *
  * @param int $comment_id Comment ID.
- * @return mixed False on failure
+ * @return bool True on success, false on failure.
  */
 function wp_untrash_comment($comment_id) {
        if ( ! (int)$comment_id )
@@ -1101,7 +1103,7 @@ function wp_untrash_comment($comment_id) {
  * @uses do_action() on 'spammed_comment' after spamming
  *
  * @param int $comment_id Comment ID.
- * @return mixed False on failure
+ * @return bool True on success, false on failure.
  */
 function wp_spam_comment($comment_id) {
        if ( !$comment = get_comment($comment_id) )
@@ -1126,7 +1128,7 @@ function wp_spam_comment($comment_id) {
  * @uses do_action() on 'unspammed_comment' after unspamming
  *
  * @param int $comment_id Comment ID.
- * @return mixed False on failure
+ * @return bool True on success, false on failure.
  */
 function wp_unspam_comment($comment_id) {
        if ( ! (int)$comment_id )
@@ -1260,7 +1262,7 @@ function wp_get_current_commenter() {
  */
 function wp_insert_comment($commentdata) {
        global $wpdb;
-       extract(stripslashes_deep($commentdata), EXTR_SKIP);
+       extract(wp_unslash($commentdata), EXTR_SKIP);
 
        if ( ! isset($comment_author_IP) )
                $comment_author_IP = '';
@@ -1290,12 +1292,7 @@ function wp_insert_comment($commentdata) {
        $comment = get_comment($id);
        do_action('wp_insert_comment', $id, $comment);
 
-       if ( function_exists( 'wp_cache_incr' ) ) {
-               wp_cache_incr( 'last_changed', 1, 'comment' );
-       } else {
-               $last_changed = wp_cache_get( 'last_changed', 'comment' );
-               wp_cache_set( 'last_changed', $last_changed + 1, 'comment' );
-       }
+       wp_cache_set( 'last_changed', microtime(), 'comment' );
 
        return $id;
 }
@@ -1388,7 +1385,7 @@ function wp_new_comment( $commentdata ) {
        $commentdata['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $commentdata['comment_parent'] : 0;
 
        $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] );
-       $commentdata['comment_agent']     = substr($_SERVER['HTTP_USER_AGENT'], 0, 254);
+       $commentdata['comment_agent']     = isset( $_SERVER['HTTP_USER_AGENT'] ) ? substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 ) : '';
 
        $commentdata['comment_date']     = current_time('mysql');
        $commentdata['comment_date_gmt'] = current_time('mysql', 1);
@@ -1426,7 +1423,7 @@ function wp_new_comment( $commentdata ) {
  * @param int $comment_id Comment ID.
  * @param string $comment_status New comment status, either 'hold', 'approve', 'spam', or 'trash'.
  * @param bool $wp_error Whether to return a WP_Error object if there is a failure. Default is false.
- * @return bool False on failure or deletion and true on success.
+ * @return bool|WP_Error True on success, false or WP_Error on failure.
  */
 function wp_set_comment_status($comment_id, $comment_status, $wp_error = false) {
        global $wpdb;
@@ -1495,7 +1492,7 @@ function wp_update_comment($commentarr) {
        $comment = get_comment($commentarr['comment_ID'], ARRAY_A);
 
        // Escape data pulled from DB.
-       $comment = esc_sql($comment);
+       $comment = wp_slash($comment);
 
        $old_status = $comment['comment_approved'];
 
@@ -1505,7 +1502,7 @@ function wp_update_comment($commentarr) {
        $commentarr = wp_filter_comment( $commentarr );
 
        // Now extract the merged array.
-       extract(stripslashes_deep($commentarr), EXTR_SKIP);
+       extract(wp_unslash($commentarr), EXTR_SKIP);
 
        $comment_content = apply_filters('comment_save_pre', $comment_content);
 
@@ -1604,7 +1601,7 @@ function wp_update_comment_count($post_id, $do_deferred=false) {
  * @uses do_action() Calls 'edit_posts' hook on $post_id and $post
  *
  * @param int $post_id Post ID
- * @return bool False on '0' $post_id or if post with ID does not exist. True on success.
+ * @return bool True on success, false on '0' $post_id or if post with ID does not exist.
  */
 function wp_update_comment_count_now($post_id) {
        global $wpdb;
@@ -1661,7 +1658,7 @@ function discover_pingback_server_uri( $url, $deprecated = '' ) {
        if ( 0 === strpos($url, $uploads_dir['baseurl']) )
                return false;
 
-       $response = wp_remote_head( $url, array( 'timeout' => 2, 'httpversion' => '1.0', 'reject_unsafe_urls' => true ) );
+       $response = wp_safe_remote_head( $url, array( 'timeout' => 2, 'httpversion' => '1.0' ) );
 
        if ( is_wp_error( $response ) )
                return false;
@@ -1673,8 +1670,8 @@ function discover_pingback_server_uri( $url, $deprecated = '' ) {
        if ( preg_match('#(image|audio|video|model)/#is', wp_remote_retrieve_header( $response, 'content-type' )) )
                return false;
 
-       // Now do a GET since we're going to look in the html headers (and we're sure its not a binary file)
-       $response = wp_remote_get( $url, array( 'timeout' => 2, 'httpversion' => '1.0', 'reject_unsafe_urls' => true ) );
+       // Now do a GET since we're going to look in the html headers (and we're sure it's not a binary file)
+       $response = wp_safe_remote_get( $url, array( 'timeout' => 2, 'httpversion' => '1.0' ) );
 
        if ( is_wp_error( $response ) )
                return false;
@@ -1752,11 +1749,11 @@ function do_trackbacks($post_id) {
        }
 
        if ( empty($post->post_excerpt) )
-               $excerpt = apply_filters('the_content', $post->post_content);
+               $excerpt = apply_filters('the_content', $post->post_content, $post->ID);
        else
                $excerpt = apply_filters('the_excerpt', $post->post_excerpt);
        $excerpt = str_replace(']]>', ']]&gt;', $excerpt);
-       $excerpt = wp_html_excerpt($excerpt, 252) . '...';
+       $excerpt = wp_html_excerpt($excerpt, 252, '&#8230;');
 
        $post_title = apply_filters('the_title', $post->post_title, $post->ID);
        $post_title = strip_tags($post_title);
@@ -1848,6 +1845,7 @@ function pingback($content, $post_ID) {
                endif;
        endforeach;
 
+       $post_links = array_unique( $post_links );
        do_action_ref_array( 'pre_ping', array( &$post_links, &$pung, $post_ID ) );
 
        foreach ( (array) $post_links as $pagelinkedto ) {
@@ -1908,7 +1906,6 @@ function trackback($trackback_url, $title, $excerpt, $ID) {
 
        $options = array();
        $options['timeout'] = 4;
-       $options['reject_unsafe_urls'] = true;
        $options['body'] = array(
                'title' => $title,
                'url' => get_permalink($ID),
@@ -1916,7 +1913,7 @@ function trackback($trackback_url, $title, $excerpt, $ID) {
                'excerpt' => $excerpt
        );
 
-       $response = wp_remote_post($trackback_url, $options);
+       $response = wp_safe_remote_post( $trackback_url, $options );
 
        if ( is_wp_error( $response ) )
                return;
@@ -2000,12 +1997,7 @@ function clean_comment_cache($ids) {
        foreach ( (array) $ids as $id )
                wp_cache_delete($id, 'comment');
 
-       if ( function_exists( 'wp_cache_incr' ) ) {
-               wp_cache_incr( 'last_changed', 1, 'comment' );
-       } else {
-               $last_changed = wp_cache_get( 'last_changed', 'comment' );
-               wp_cache_set( 'last_changed', $last_changed + 1, 'comment' );
-       }
+       wp_cache_set( 'last_changed', microtime(), 'comment' );
 }
 
 /**
index 4e469a051c2bed2926cf8943eda89cbe7809d0f3..6668dc546e292ce77f9d859762d1798451340b48 100644 (file)
@@ -230,7 +230,7 @@ function spawn_cron( $gmt_time = 0 ) {
                set_transient( 'doing_cron', $doing_wp_cron );
 
                ob_start();
-               wp_redirect( add_query_arg('doing_wp_cron', $doing_wp_cron, stripslashes($_SERVER['REQUEST_URI'])) );
+               wp_redirect( add_query_arg( 'doing_wp_cron', $doing_wp_cron, wp_unslash( $_SERVER['REQUEST_URI'] ) ) );
                echo ' ';
 
                // flush any buffers and send the headers
index 6f462e9cd9ec5cbf4415c7f47e2c646c69e3ea17..270fa9a0a10b0dba63a89edf815919c72331d477 100644 (file)
        -webkit-box-sizing: content-box;
        -moz-box-sizing:    content-box;
        box-sizing:         content-box;
+       -webkit-transition: none;
+       -moz-transition:    none;
+       -o-transition:      none;
+       transition:         none;
 }
 
 #wpadminbar ul li:before,
index 0a9b1dcf07a18c3558d5dd332f1e85a8162aa776..bac06caf96ddf11d61c9ff58c4a338e302726540 100644 (file)
@@ -1 +1 @@
-#wpadminbar *{height:auto;width:auto;margin:0;padding:0;position:static;text-transform:none;letter-spacing:normal;line-height:1;font:normal 13px/28px sans-serif;color:#ccc;text-shadow:#444 0 -1px 0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}#wpadminbar ul li:before,#wpadminbar ul li:after{content:normal}#wpadminbar a,#wpadminbar a:hover,#wpadminbar a img,#wpadminbar a img:hover{outline:0;border:0;text-decoration:none;background:0}#wpadminbar a:focus,#wpadminbar a:active,#wpadminbar input[type="text"],#wpadminbar input[type="password"],#wpadminbar input[type="number"],#wpadminbar input[type="search"],#wpadminbar input[type="email"],#wpadminbar input[type="url"],#wpadminbar select,#wpadminbar textarea,#wpadminbar div{outline:0}#wpadminbar{direction:ltr;color:#ccc;font:normal 13px/28px sans-serif;height:28px;position:fixed;top:0;left:0;width:100%;min-width:600px;z-index:99999;background:#464646;background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0,#373737),color-stop(18%,#464646));background-image:-webkit-linear-gradient(bottom,#373737 0,#464646 5px);background-image:-moz-linear-gradient(bottom,#373737 0,#464646 5px);background-image:-o-linear-gradient(bottom,#373737 0,#464646 5px);background-image:linear-gradient(to top,#373737 0,#464646 5px)}#wpadminbar .ab-sub-wrapper,#wpadminbar ul,#wpadminbar ul li{background:0;clear:none;list-style:none;margin:0;padding:0;position:relative;text-indent:0;z-index:99999}#wpadminbar .quicklinks{border-left:1px solid transparent}#wpadminbar .quicklinks ul{text-align:left}#wpadminbar li{float:left}#wpadminbar .ab-empty-item{outline:0}#wpadminbar .quicklinks>ul>li{border-right:1px solid #555}#wpadminbar .quicklinks>ul>li>a,#wpadminbar .quicklinks>ul>li>.ab-empty-item{border-right:1px solid #333}#wpadminbar .quicklinks .ab-top-secondary>li{border-left:1px solid #333;border-right:0;float:right}#wpadminbar .quicklinks .ab-top-secondary>li>a,#wpadminbar .quicklinks .ab-top-secondary>li>.ab-empty-item{border-left:1px solid #555;border-right:0}#wpadminbar .quicklinks a,#wpadminbar .quicklinks .ab-empty-item,#wpadminbar .shortlink-input{height:28px;display:block;padding:0 12px;margin:0}#wpadminbar .menupop .ab-sub-wrapper,#wpadminbar .shortlink-input{margin:0 0 0 -1px;padding:0;-webkit-box-shadow:0 4px 4px rgba(0,0,0,0.2);box-shadow:0 4px 4px rgba(0,0,0,0.2);background:#fff;display:none;position:absolute;float:none;border-width:0 1px 1px 1px;border-style:solid;border-color:#dfdfdf}#wpadminbar.ie7 .menupop .ab-sub-wrapper,#wpadminbar.ie7 .shortlink-input{top:28px;left:0}#wpadminbar .ab-top-menu>.menupop>.ab-sub-wrapper{min-width:100%}#wpadminbar .ab-top-secondary .menupop .ab-sub-wrapper{right:0;left:auto;margin:0 -1px 0 0}#wpadminbar .ab-sub-wrapper>.ab-submenu:first-child{border-top:0}#wpadminbar .ab-submenu{padding:6px 0;border-top:1px solid #dfdfdf}#wpadminbar .selected .shortlink-input{display:block}#wpadminbar .quicklinks .menupop ul li{float:none}#wpadminbar .quicklinks .menupop ul li a strong{font-weight:bold}#wpadminbar .quicklinks .menupop ul li .ab-item,#wpadminbar .quicklinks .menupop ul li a strong,#wpadminbar .quicklinks .menupop.hover ul li .ab-item,#wpadminbar.nojs .quicklinks .menupop:hover ul li .ab-item,#wpadminbar .shortlink-input{line-height:26px;height:26px;text-shadow:none;white-space:nowrap;min-width:140px}#wpadminbar .shortlink-input{width:200px}#wpadminbar.nojs li:hover>.ab-sub-wrapper,#wpadminbar li.hover>.ab-sub-wrapper{display:block}#wpadminbar .menupop li:hover>.ab-sub-wrapper,#wpadminbar .menupop li.hover>.ab-sub-wrapper{margin-left:100%;margin-top:-33px;border-width:1px}#wpadminbar .ab-top-secondary .menupop li:hover>.ab-sub-wrapper,#wpadminbar .ab-top-secondary .menupop li.hover>.ab-sub-wrapper{margin-left:0;left:inherit;right:100%}#wpadminbar .ab-top-menu>li:hover>.ab-item,#wpadminbar .ab-top-menu>li.hover>.ab-item,#wpadminbar .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus{color:#fafafa;background:#222;background-image:-webkit-gradient(linear,left bottom,left top,from(#3a3a3a),to(#222));background-image:-webkit-linear-gradient(bottom,#3a3a3a,#222);background-image:-moz-linear-gradient(bottom,#3a3a3a,#222);background-image:-o-linear-gradient(bottom,#3a3a3a,#222);background-image:linear-gradient(to top,#3a3a3a,#222)}#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item{background:#fff;color:#333;text-shadow:none;border-right-color:transparent;border-left-color:transparent}#wpadminbar .hover .ab-label,#wpadminbar.nojq .ab-item:focus .ab-label{color:#fafafa}#wpadminbar .menupop.hover .ab-label{color:#333;text-shadow:none}#wpadminbar .menupop li:hover,#wpadminbar .menupop li.hover,#wpadminbar .quicklinks .menupop .ab-item:focus,#wpadminbar .quicklinks .ab-top-menu .menupop .ab-item:focus{background-color:#eaf2fa}#wpadminbar .ab-submenu .ab-item{color:#333;text-shadow:none}#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop ul li a strong,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#21759b}#wpadminbar .menupop .menupop>.ab-item{display:block;background-image:url(../images/admin-bar-sprite.png?d=20120830);background-position:95% -20px;background-repeat:no-repeat;padding-right:2em}#wpadminbar .ab-top-secondary .menupop .menupop>.ab-item{background-image:url(../images/admin-bar-sprite.png?d=20120830);background-position:5% -46px;background-repeat:no-repeat;padding-left:2em;padding-right:1em}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary{display:block;position:relative;right:auto;margin:0;background:#eee;-webkit-box-shadow:none;box-shadow:none}#wpadminbar .quicklinks .menupop .ab-sub-secondary>li:hover,#wpadminbar .quicklinks .menupop .ab-sub-secondary>li.hover,#wpadminbar .quicklinks .menupop .ab-sub-secondary>li .ab-item:focus{background-color:#dfdfdf}#wpadminbar .quicklinks a span#ab-updates{background:#eee;color:#333;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:bold;-webkit-border-radius:10px;border-radius:10px}#wpadminbar .quicklinks a:hover span#ab-updates{background:#fff;color:#000}#wpadminbar .ab-top-secondary{float:right;background:#464646;background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0,#373737),color-stop(18%,#464646));background-image:-webkit-linear-gradient(bottom,#373737 0,#464646 5px);background-image:-moz-linear-gradient(bottom,#373737 0,#464646 5px);background-image:-o-linear-gradient(bottom,#373737 0,#464646 5px);background-image:linear-gradient(to top,#373737 0,#464646 5px)}#wpadminbar ul li:last-child,#wpadminbar ul li:last-child .ab-item{border-right:0;-webkit-box-shadow:none;box-shadow:none}#wp-admin-bar-my-account>ul{min-width:198px}#wp-admin-bar-my-account.with-avatar>ul{min-width:270px}#wpadminbar #wp-admin-bar-user-actions>li{margin-left:16px;margin-right:16px}#wpadminbar #wp-admin-bar-my-account.with-avatar #wp-admin-bar-user-actions>li{margin-left:88px}#wp-admin-bar-user-actions>li>.ab-item{padding-left:8px}#wpadminbar #wp-admin-bar-user-info{margin-top:6px;margin-bottom:15px;height:auto;background:0}#wp-admin-bar-user-info .avatar{position:absolute;left:-72px;top:4px;width:64px;height:64px}#wpadminbar #wp-admin-bar-user-info a{background:0;height:auto}#wpadminbar #wp-admin-bar-user-info span{background:0;padding:0;height:18px}#wpadminbar #wp-admin-bar-user-info .display-name,#wpadminbar #wp-admin-bar-user-info .username{text-shadow:none;display:block}#wpadminbar #wp-admin-bar-user-info .display-name{color:#333}#wpadminbar #wp-admin-bar-user-info .username{color:#999;font-size:11px}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{width:16px;height:16px;border:1px solid #999;padding:0;background:#eee;line-height:24px;vertical-align:middle;margin:-3px 0 0 6px;float:none;display:inline}#wpadminbar .quicklinks li .blavatar{vertical-align:middle;margin:-3px 4px 0 0;padding:0}#wpadminbar .quicklinks li div.blavatar{background:url('../images/wpmini-blue.png') no-repeat;height:16px;width:16px;display:inline-block}#wpadminbar #wp-admin-bar-search .ab-item{padding:0}#wpadminbar #wp-admin-bar-search .ab-item{background:transparent}#wpadminbar #adminbarsearch{height:28px;padding:0 2px}#wpadminbar #adminbarsearch .adminbar-input{font:13px/24px sans-serif;height:24px;width:24px;border:0;padding:0 3px 0 23px;margin:0;color:#ccc;text-shadow:#444 0 -1px 0;background-color:rgba(255,255,255,0);background-image:url(../images/admin-bar-sprite.png?d=20120830);background-position:3px 2px;background-repeat:no-repeat;outline:0;cursor:pointer;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-transition-duration:400ms;-webkit-transition-property:width,background;-webkit-transition-timing-function:ease;-moz-transition-duration:400ms;-moz-transition-property:width,background;-moz-transition-timing-function:ease;-o-transition-duration:400ms;-o-transition-property:width,background;-o-transition-timing-function:ease}#wpadminbar.ie7 #adminbarsearch .adminbar-input{margin-top:1px;width:120px}#wpadminbar #adminbarsearch .adminbar-input:focus{color:#555;text-shadow:0 1px 0 #fff;width:200px;background-color:rgba(255,255,255,0.9);cursor:text}#wpadminbar.ie8 #adminbarsearch .adminbar-input{background-color:#464646}#wpadminbar.ie8 #adminbarsearch .adminbar-input:focus{background-color:#fff}#wpadminbar #adminbarsearch .adminbar-input::-webkit-input-placeholder{color:#ddd}#wpadminbar #adminbarsearch .adminbar-input:-moz-placeholder{color:#ddd}#wpadminbar #adminbarsearch .adminbar-button{display:none}#wpadminbar #wp-admin-bar-appearance{border-top:0;margin-top:-12px}#wpadminbar #wp-admin-bar-appearance{border-top:0;margin-top:-12px}#wpadminbar .ab-icon{position:relative;float:left;width:16px;height:16px;margin-top:6px}#wpadminbar .ab-label{margin-left:4px}#wp-admin-bar-wp-logo>.ab-item .ab-icon{width:20px;height:20px;margin-top:4px;background-image:url(../images/admin-bar-sprite.png?d=20120830);background-position:0 -76px;background-repeat:no-repeat}#wpadminbar.nojs #wp-admin-bar-wp-logo:hover>.ab-item .ab-icon,#wpadminbar #wp-admin-bar-wp-logo.hover>.ab-item .ab-icon{background-position:0 -104px}#wp-admin-bar-updates>.ab-item .ab-icon{background-image:url(../images/admin-bar-sprite.png?d=20120830);background-position:-2px -159px;background-repeat:no-repeat}#wp-admin-bar-comments>.ab-item .ab-icon{background-image:url(../images/admin-bar-sprite.png?d=20120830);background-position:-1px -134px;background-repeat:no-repeat}#wpadminbar span.count-0{display:none}#wpadminbar #wp-admin-bar-new-content>.ab-item .ab-icon{background-image:url(../images/admin-bar-sprite.png?d=20120830);background-position:-2px -182px;background-repeat:no-repeat}#wpadminbar.nojs #wp-admin-bar-new-content:hover>.ab-item .ab-icon,#wpadminbar #wp-admin-bar-new-content.hover>.ab-item .ab-icon{background-position:-2px -203px}.no-customize-support .hide-if-no-customize,.customize-support .hide-if-customize,.no-customize-support.wp-core-ui .hide-if-no-customize,.no-customize-support .wp-core-ui .hide-if-no-customize,.customize-support.wp-core-ui .hide-if-customize,.customize-support .wp-core-ui .hide-if-customize{display:none}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){#wpadminbar .menupop .menupop>.ab-item,#wpadminbar .ab-top-secondary .menupop .menupop>.ab-item,#wpadminbar #adminbarsearch .adminbar-input,#wp-admin-bar-wp-logo>.ab-item .ab-icon,#wp-admin-bar-updates>.ab-item .ab-icon,#wp-admin-bar-comments>.ab-item .ab-icon,#wpadminbar #wp-admin-bar-new-content>.ab-item .ab-icon{background-image:url(../images/admin-bar-sprite-2x.png?d=20120830);background-size:20px 220px}#wpadminbar .quicklinks li div.blavatar{background:url('../images/wpmini-blue-2x.png') no-repeat;background-size:16px 16px}}#wpadminbar .screen-reader-text,#wpadminbar .screen-reader-text span{position:absolute;left:-1000em;top:-1000em;height:1px;width:1px;overflow:hidden}#wpadminbar .screen-reader-shortcut{position:absolute;top:-1000em}#wpadminbar .screen-reader-shortcut:focus{left:6px;top:7px;height:auto;width:auto;display:block;font-size:14px;font-weight:bold;padding:15px 23px 14px;background:#f1f1f1;color:#21759b;text-shadow:none;border-radius:3px;z-index:100000;line-height:normal;-webkit-box-shadow:0 0 2px 2px rgba(0,0,0,.6);box-shadow:0 0 2px 2px rgba(0,0,0,.6);text-decoration:none}* html #wpadminbar{overflow:hidden;position:absolute}* html #wpadminbar .quicklinks ul li a{float:left}* html #wpadminbar .menupop a span{background-image:none}
\ No newline at end of file
+#wpadminbar *{height:auto;width:auto;margin:0;padding:0;position:static;text-transform:none;letter-spacing:normal;line-height:1;font:normal 13px/28px sans-serif;color:#ccc;text-shadow:#444 0 -1px 0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}#wpadminbar ul li:before,#wpadminbar ul li:after{content:normal}#wpadminbar a,#wpadminbar a:hover,#wpadminbar a img,#wpadminbar a img:hover{outline:0;border:0;text-decoration:none;background:0}#wpadminbar a:focus,#wpadminbar a:active,#wpadminbar input[type="text"],#wpadminbar input[type="password"],#wpadminbar input[type="number"],#wpadminbar input[type="search"],#wpadminbar input[type="email"],#wpadminbar input[type="url"],#wpadminbar select,#wpadminbar textarea,#wpadminbar div{outline:0}#wpadminbar{direction:ltr;color:#ccc;font:normal 13px/28px sans-serif;height:28px;position:fixed;top:0;left:0;width:100%;min-width:600px;z-index:99999;background:#464646;background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0,#373737),color-stop(18%,#464646));background-image:-webkit-linear-gradient(bottom,#373737 0,#464646 5px);background-image:-moz-linear-gradient(bottom,#373737 0,#464646 5px);background-image:-o-linear-gradient(bottom,#373737 0,#464646 5px);background-image:linear-gradient(to top,#373737 0,#464646 5px)}#wpadminbar .ab-sub-wrapper,#wpadminbar ul,#wpadminbar ul li{background:0;clear:none;list-style:none;margin:0;padding:0;position:relative;text-indent:0;z-index:99999}#wpadminbar .quicklinks{border-left:1px solid transparent}#wpadminbar .quicklinks ul{text-align:left}#wpadminbar li{float:left}#wpadminbar .ab-empty-item{outline:0}#wpadminbar .quicklinks>ul>li{border-right:1px solid #555}#wpadminbar .quicklinks>ul>li>a,#wpadminbar .quicklinks>ul>li>.ab-empty-item{border-right:1px solid #333}#wpadminbar .quicklinks .ab-top-secondary>li{border-left:1px solid #333;border-right:0;float:right}#wpadminbar .quicklinks .ab-top-secondary>li>a,#wpadminbar .quicklinks .ab-top-secondary>li>.ab-empty-item{border-left:1px solid #555;border-right:0}#wpadminbar .quicklinks a,#wpadminbar .quicklinks .ab-empty-item,#wpadminbar .shortlink-input{height:28px;display:block;padding:0 12px;margin:0}#wpadminbar .menupop .ab-sub-wrapper,#wpadminbar .shortlink-input{margin:0 0 0 -1px;padding:0;-webkit-box-shadow:0 4px 4px rgba(0,0,0,0.2);box-shadow:0 4px 4px rgba(0,0,0,0.2);background:#fff;display:none;position:absolute;float:none;border-width:0 1px 1px 1px;border-style:solid;border-color:#dfdfdf}#wpadminbar.ie7 .menupop .ab-sub-wrapper,#wpadminbar.ie7 .shortlink-input{top:28px;left:0}#wpadminbar .ab-top-menu>.menupop>.ab-sub-wrapper{min-width:100%}#wpadminbar .ab-top-secondary .menupop .ab-sub-wrapper{right:0;left:auto;margin:0 -1px 0 0}#wpadminbar .ab-sub-wrapper>.ab-submenu:first-child{border-top:0}#wpadminbar .ab-submenu{padding:6px 0;border-top:1px solid #dfdfdf}#wpadminbar .selected .shortlink-input{display:block}#wpadminbar .quicklinks .menupop ul li{float:none}#wpadminbar .quicklinks .menupop ul li a strong{font-weight:bold}#wpadminbar .quicklinks .menupop ul li .ab-item,#wpadminbar .quicklinks .menupop ul li a strong,#wpadminbar .quicklinks .menupop.hover ul li .ab-item,#wpadminbar.nojs .quicklinks .menupop:hover ul li .ab-item,#wpadminbar .shortlink-input{line-height:26px;height:26px;text-shadow:none;white-space:nowrap;min-width:140px}#wpadminbar .shortlink-input{width:200px}#wpadminbar.nojs li:hover>.ab-sub-wrapper,#wpadminbar li.hover>.ab-sub-wrapper{display:block}#wpadminbar .menupop li:hover>.ab-sub-wrapper,#wpadminbar .menupop li.hover>.ab-sub-wrapper{margin-left:100%;margin-top:-33px;border-width:1px}#wpadminbar .ab-top-secondary .menupop li:hover>.ab-sub-wrapper,#wpadminbar .ab-top-secondary .menupop li.hover>.ab-sub-wrapper{margin-left:0;left:inherit;right:100%}#wpadminbar .ab-top-menu>li:hover>.ab-item,#wpadminbar .ab-top-menu>li.hover>.ab-item,#wpadminbar .ab-top-menu>li>.ab-item:focus,#wpadminbar.nojq .quicklinks .ab-top-menu>li>.ab-item:focus{color:#fafafa;background:#222;background-image:-webkit-gradient(linear,left bottom,left top,from(#3a3a3a),to(#222));background-image:-webkit-linear-gradient(bottom,#3a3a3a,#222);background-image:-moz-linear-gradient(bottom,#3a3a3a,#222);background-image:-o-linear-gradient(bottom,#3a3a3a,#222);background-image:linear-gradient(to top,#3a3a3a,#222)}#wpadminbar.nojs .ab-top-menu>li.menupop:hover>.ab-item,#wpadminbar .ab-top-menu>li.menupop.hover>.ab-item{background:#fff;color:#333;text-shadow:none;border-right-color:transparent;border-left-color:transparent}#wpadminbar .hover .ab-label,#wpadminbar.nojq .ab-item:focus .ab-label{color:#fafafa}#wpadminbar .menupop.hover .ab-label{color:#333;text-shadow:none}#wpadminbar .menupop li:hover,#wpadminbar .menupop li.hover,#wpadminbar .quicklinks .menupop .ab-item:focus,#wpadminbar .quicklinks .ab-top-menu .menupop .ab-item:focus{background-color:#eaf2fa}#wpadminbar .ab-submenu .ab-item{color:#333;text-shadow:none}#wpadminbar .quicklinks .menupop ul li a,#wpadminbar .quicklinks .menupop ul li a strong,#wpadminbar .quicklinks .menupop.hover ul li a,#wpadminbar.nojs .quicklinks .menupop:hover ul li a{color:#21759b}#wpadminbar .menupop .menupop>.ab-item{display:block;background-image:url(../images/admin-bar-sprite.png?d=20120830);background-position:95% -20px;background-repeat:no-repeat;padding-right:2em}#wpadminbar .ab-top-secondary .menupop .menupop>.ab-item{background-image:url(../images/admin-bar-sprite.png?d=20120830);background-position:5% -46px;background-repeat:no-repeat;padding-left:2em;padding-right:1em}#wpadminbar .quicklinks .menupop ul.ab-sub-secondary{display:block;position:relative;right:auto;margin:0;background:#eee;-webkit-box-shadow:none;box-shadow:none}#wpadminbar .quicklinks .menupop .ab-sub-secondary>li:hover,#wpadminbar .quicklinks .menupop .ab-sub-secondary>li.hover,#wpadminbar .quicklinks .menupop .ab-sub-secondary>li .ab-item:focus{background-color:#dfdfdf}#wpadminbar .quicklinks a span#ab-updates{background:#eee;color:#333;text-shadow:none;display:inline;padding:2px 5px;font-size:10px;font-weight:bold;-webkit-border-radius:10px;border-radius:10px}#wpadminbar .quicklinks a:hover span#ab-updates{background:#fff;color:#000}#wpadminbar .ab-top-secondary{float:right;background:#464646;background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0,#373737),color-stop(18%,#464646));background-image:-webkit-linear-gradient(bottom,#373737 0,#464646 5px);background-image:-moz-linear-gradient(bottom,#373737 0,#464646 5px);background-image:-o-linear-gradient(bottom,#373737 0,#464646 5px);background-image:linear-gradient(to top,#373737 0,#464646 5px)}#wpadminbar ul li:last-child,#wpadminbar ul li:last-child .ab-item{border-right:0;-webkit-box-shadow:none;box-shadow:none}#wp-admin-bar-my-account>ul{min-width:198px}#wp-admin-bar-my-account.with-avatar>ul{min-width:270px}#wpadminbar #wp-admin-bar-user-actions>li{margin-left:16px;margin-right:16px}#wpadminbar #wp-admin-bar-my-account.with-avatar #wp-admin-bar-user-actions>li{margin-left:88px}#wp-admin-bar-user-actions>li>.ab-item{padding-left:8px}#wpadminbar #wp-admin-bar-user-info{margin-top:6px;margin-bottom:15px;height:auto;background:0}#wp-admin-bar-user-info .avatar{position:absolute;left:-72px;top:4px;width:64px;height:64px}#wpadminbar #wp-admin-bar-user-info a{background:0;height:auto}#wpadminbar #wp-admin-bar-user-info span{background:0;padding:0;height:18px}#wpadminbar #wp-admin-bar-user-info .display-name,#wpadminbar #wp-admin-bar-user-info .username{text-shadow:none;display:block}#wpadminbar #wp-admin-bar-user-info .display-name{color:#333}#wpadminbar #wp-admin-bar-user-info .username{color:#999;font-size:11px}#wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar>a img{width:16px;height:16px;border:1px solid #999;padding:0;background:#eee;line-height:24px;vertical-align:middle;margin:-3px 0 0 6px;float:none;display:inline}#wpadminbar .quicklinks li .blavatar{vertical-align:middle;margin:-3px 4px 0 0;padding:0}#wpadminbar .quicklinks li div.blavatar{background:url('../images/wpmini-blue.png') no-repeat;height:16px;width:16px;display:inline-block}#wpadminbar #wp-admin-bar-search .ab-item{padding:0}#wpadminbar #wp-admin-bar-search .ab-item{background:transparent}#wpadminbar #adminbarsearch{height:28px;padding:0 2px}#wpadminbar #adminbarsearch .adminbar-input{font:13px/24px sans-serif;height:24px;width:24px;border:0;padding:0 3px 0 23px;margin:0;color:#ccc;text-shadow:#444 0 -1px 0;background-color:rgba(255,255,255,0);background-image:url(../images/admin-bar-sprite.png?d=20120830);background-position:3px 2px;background-repeat:no-repeat;outline:0;cursor:pointer;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-transition-duration:400ms;-webkit-transition-property:width,background;-webkit-transition-timing-function:ease;-moz-transition-duration:400ms;-moz-transition-property:width,background;-moz-transition-timing-function:ease;-o-transition-duration:400ms;-o-transition-property:width,background;-o-transition-timing-function:ease}#wpadminbar.ie7 #adminbarsearch .adminbar-input{margin-top:1px;width:120px}#wpadminbar #adminbarsearch .adminbar-input:focus{color:#555;text-shadow:0 1px 0 #fff;width:200px;background-color:rgba(255,255,255,0.9);cursor:text}#wpadminbar.ie8 #adminbarsearch .adminbar-input{background-color:#464646}#wpadminbar.ie8 #adminbarsearch .adminbar-input:focus{background-color:#fff}#wpadminbar #adminbarsearch .adminbar-input::-webkit-input-placeholder{color:#ddd}#wpadminbar #adminbarsearch .adminbar-input:-moz-placeholder{color:#ddd}#wpadminbar #adminbarsearch .adminbar-button{display:none}#wpadminbar #wp-admin-bar-appearance{border-top:0;margin-top:-12px}#wpadminbar #wp-admin-bar-appearance{border-top:0;margin-top:-12px}#wpadminbar .ab-icon{position:relative;float:left;width:16px;height:16px;margin-top:6px}#wpadminbar .ab-label{margin-left:4px}#wp-admin-bar-wp-logo>.ab-item .ab-icon{width:20px;height:20px;margin-top:4px;background-image:url(../images/admin-bar-sprite.png?d=20120830);background-position:0 -76px;background-repeat:no-repeat}#wpadminbar.nojs #wp-admin-bar-wp-logo:hover>.ab-item .ab-icon,#wpadminbar #wp-admin-bar-wp-logo.hover>.ab-item .ab-icon{background-position:0 -104px}#wp-admin-bar-updates>.ab-item .ab-icon{background-image:url(../images/admin-bar-sprite.png?d=20120830);background-position:-2px -159px;background-repeat:no-repeat}#wp-admin-bar-comments>.ab-item .ab-icon{background-image:url(../images/admin-bar-sprite.png?d=20120830);background-position:-1px -134px;background-repeat:no-repeat}#wpadminbar span.count-0{display:none}#wpadminbar #wp-admin-bar-new-content>.ab-item .ab-icon{background-image:url(../images/admin-bar-sprite.png?d=20120830);background-position:-2px -182px;background-repeat:no-repeat}#wpadminbar.nojs #wp-admin-bar-new-content:hover>.ab-item .ab-icon,#wpadminbar #wp-admin-bar-new-content.hover>.ab-item .ab-icon{background-position:-2px -203px}.no-customize-support .hide-if-no-customize,.customize-support .hide-if-customize,.no-customize-support.wp-core-ui .hide-if-no-customize,.no-customize-support .wp-core-ui .hide-if-no-customize,.customize-support.wp-core-ui .hide-if-customize,.customize-support .wp-core-ui .hide-if-customize{display:none}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){#wpadminbar .menupop .menupop>.ab-item,#wpadminbar .ab-top-secondary .menupop .menupop>.ab-item,#wpadminbar #adminbarsearch .adminbar-input,#wp-admin-bar-wp-logo>.ab-item .ab-icon,#wp-admin-bar-updates>.ab-item .ab-icon,#wp-admin-bar-comments>.ab-item .ab-icon,#wpadminbar #wp-admin-bar-new-content>.ab-item .ab-icon{background-image:url(../images/admin-bar-sprite-2x.png?d=20120830);background-size:20px 220px}#wpadminbar .quicklinks li div.blavatar{background:url('../images/wpmini-blue-2x.png') no-repeat;background-size:16px 16px}}#wpadminbar .screen-reader-text,#wpadminbar .screen-reader-text span{position:absolute;left:-1000em;top:-1000em;height:1px;width:1px;overflow:hidden}#wpadminbar .screen-reader-shortcut{position:absolute;top:-1000em}#wpadminbar .screen-reader-shortcut:focus{left:6px;top:7px;height:auto;width:auto;display:block;font-size:14px;font-weight:bold;padding:15px 23px 14px;background:#f1f1f1;color:#21759b;text-shadow:none;border-radius:3px;z-index:100000;line-height:normal;-webkit-box-shadow:0 0 2px 2px rgba(0,0,0,.6);box-shadow:0 0 2px 2px rgba(0,0,0,.6);text-decoration:none}* html #wpadminbar{overflow:hidden;position:absolute}* html #wpadminbar .quicklinks ul li a{float:left}* html #wpadminbar .menupop a span{background-image:none}
\ No newline at end of file
index 6fa48c300ef19ff4a11928cf4896fbf7661d7e52..17285608790a1fcc6e8a5924a54ee6d88e361583 100644 (file)
        border-top-right-radius: 2px;
 }
 
-/*.wp_themeSkin .mceListBox .mceLast {
-       display: none;
-}*/
+.wp_themeSkin .mceListBoxMenu .mce_formatPreview {
+       line-height: normal;
+}
 
 .wp_themeSkin .mceListBox .mceOpen,
 .wp_themeSkin .mceListBoxHover .mceOpen,
 
 .wp_themeSkin .mce_h1 span.mceText {
        font-weight: bolder;
-       font-size: 17px;
+       font-size: 18px;
 }
 
 .wp_themeSkin .mce_h2 span.mceText {
 
 .wp_themeSkin .mce_h3 span.mceText {
        font-weight: bolder;
-       font-size: 15px;
+       font-size: 14px;
 }
 
 .wp_themeSkin .mce_h4 span.mceText {
        font-weight: bolder;
-       font-size: 14px;
+       font-size: 12px;
 }
 
 .wp_themeSkin .mce_h5 span.mceText {
        font-weight: bolder;
-       font-size: 13px;
+       font-size: 11px;
 }
 
 .wp_themeSkin .mce_h6 span.mceText {
        font-weight: bolder;
-       font-size: 12px;
+       font-size: 10px;
 }
 
 /* Theme */
 }
 
 .wp-editor-container {
-    border-width: 1px;
+       border-width: 1px;
        border-style: solid;
        -webkit-border-top-right-radius: 3px;
        -webkit-border-top-left-radius: 3px;
 
 .wp-switch-editor {
        height: 18px;
-    font: 13px/18px Arial,Helvetica,sans-serif normal;
+       font: 13px/18px Arial,Helvetica,sans-serif normal;
        margin: 5px 5px 0 0;
        padding: 4px 5px 2px;
        float: right;
@@ -1367,12 +1367,12 @@ html[dir="rtl"] .wp-switch-editor {
        float: right;
 }
 
-/*
- * Based on:
- * jQuery UI CSS Framework @VERSION
+/*!
+ * jQuery UI CSS Framework 1.10.1
+ * http://jqueryui.com
  *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
+ * Copyright 2013 jQuery Foundation and other contributors
+ * Released under the MIT license.
  * http://jquery.org/license
  *
  * http://docs.jquery.com/UI/Theming/API
@@ -1380,78 +1380,249 @@ html[dir="rtl"] .wp-switch-editor {
 
 /* Layout helpers
 ----------------------------------*/
-.ui-helper-hidden { display: none; }
-.ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
-.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
-.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
-.ui-helper-clearfix { display: inline-block; }
-/* required comment for clearfix to work in Opera \*/
-* html .ui-helper-clearfix { height:1%; }
-.ui-helper-clearfix { display:block; }
-/* end clearfix */
-.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
+.ui-helper-hidden {
+       display: none;
+}
+.ui-helper-hidden-accessible {
+       border: 0;
+       clip: rect(0 0 0 0);
+       height: 1px;
+       margin: -1px;
+       overflow: hidden;
+       padding: 0;
+       position: absolute;
+       width: 1px;
+}
+.ui-helper-reset {
+       margin: 0;
+       padding: 0;
+       border: 0;
+       outline: 0;
+       line-height: 1.3;
+       text-decoration: none;
+       font-size: 100%;
+       list-style: none;
+}
+.ui-helper-clearfix:before,
+.ui-helper-clearfix:after {
+       content: "";
+       display: table;
+       border-collapse: collapse;
+}
+.ui-helper-clearfix:after {
+       clear: both;
+}
+.ui-helper-clearfix {
+       min-height: 0; /* support: IE7 */
+}
+.ui-helper-zfix {
+       width: 100%;
+       height: 100%;
+       top: 0;
+       left: 0;
+       position: absolute;
+       opacity: 0;
+       filter:Alpha(Opacity=0);
+}
+
+.ui-front {
+       z-index: 100;
+}
+
 
 /* Interaction Cues
 ----------------------------------*/
-.ui-state-disabled { cursor: default !important; }
+.ui-state-disabled {
+       cursor: default !important;
+}
+
 
 /* Icons
 ----------------------------------*/
 
 /* states and images */
-.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
+.ui-icon {
+       display: block;
+       text-indent: -99999px;
+       overflow: hidden;
+       background-repeat: no-repeat;
+}
+
 
 /* Misc visuals
 ----------------------------------*/
 
 /* Overlays */
-.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
+.ui-widget-overlay {
+       position: fixed;
+       top: 0;
+       left: 0;
+       width: 100%;
+       height: 100%;
+}
 
-/*
- * jQuery UI Resizable
+
+/*!
+ * jQuery UI Resizable 1.10.1
+ * http://jqueryui.com
  *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
+ * Copyright 2013 jQuery Foundation and other contributors
+ * Released under the MIT license.
  * http://jquery.org/license
  *
  * http://docs.jquery.com/UI/Resizable#theming
  */
-.ui-resizable { position: relative;}
-.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
-.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
-.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
-.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
-.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
-.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
-.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
-.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
-.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
-.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}
+.ui-resizable {
+       position: relative;
+}
+.ui-resizable-handle {
+       position: absolute;
+       font-size: 0.1px;
+       display: block;
+}
+.ui-resizable-disabled .ui-resizable-handle,
+.ui-resizable-autohide .ui-resizable-handle {
+       display: none;
+}
+.ui-resizable-n {
+       cursor: n-resize;
+       height: 7px;
+       width: 100%;
+       top: -5px;
+       left: 0;
+}
+.ui-resizable-s {
+       cursor: s-resize;
+       height: 7px;
+       width: 100%;
+       bottom: -5px;
+       left: 0;
+}
+.ui-resizable-e {
+       cursor: e-resize;
+       width: 7px;
+       right: -5px;
+       top: 0;
+       height: 100%;
+}
+.ui-resizable-w {
+       cursor: w-resize;
+       width: 7px;
+       left: -5px;
+       top: 0;
+       height: 100%;
+}
+.ui-resizable-se {
+       cursor: se-resize;
+       width: 12px;
+       height: 12px;
+       right: 1px;
+       bottom: 1px;
+}
+.ui-resizable-sw {
+       cursor: sw-resize;
+       width: 9px;
+       height: 9px;
+       left: -5px;
+       bottom: -5px;
+}
+.ui-resizable-nw {
+       cursor: nw-resize;
+       width: 9px;
+       height: 9px;
+       left: -5px;
+       top: -5px;
+}
+.ui-resizable-ne {
+       cursor: ne-resize;
+       width: 9px;
+       height: 9px;
+       right: -5px;
+       top: -5px;
+}
 
-/*
- * jQuery UI Dialog
+/*!
+ * jQuery UI Dialog 1.10.1
+ * http://jqueryui.com
  *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
+ * Copyright 2013 jQuery Foundation and other contributors
+ * Released under the MIT license.
  * http://jquery.org/license
  *
  * http://docs.jquery.com/UI/Dialog#theming
  */
-.wp-dialog { position: absolute; width: 300px; overflow: hidden; }
-.wp-dialog .ui-dialog-titlebar { position: relative; }
-.wp-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
-.wp-dialog .ui-dialog-content { position: relative; border: 0; padding: 0; background: none; overflow: auto; zoom: 1; }
-.wp-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
-.wp-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
-.wp-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
-.wp-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
-.ui-draggable .ui-dialog-titlebar { cursor: move; }
+.ui-dialog {
+       position: absolute;
+       top: 0;
+       left: 0;
+       padding: .2em;
+       outline: 0;
+}
+.ui-dialog .ui-dialog-titlebar {
+       padding: .4em 1em;
+       position: relative;
+}
+.ui-dialog .ui-dialog-title {
+       float: left;
+       margin: .1em 0;
+       white-space: nowrap;
+       width: 90%;
+       overflow: hidden;
+       text-overflow: ellipsis;
+}
+.ui-dialog .ui-dialog-titlebar-close {
+       position: absolute;
+       right: .3em;
+       top: 50%;
+       width: 21px;
+       margin: -10px 0 0 0;
+       padding: 1px;
+       height: 20px;
+}
+.ui-dialog .ui-dialog-content {
+       position: relative;
+       border: 0;
+       padding: .5em 1em;
+       background: none;
+       overflow: auto;
+}
+.ui-dialog .ui-dialog-buttonpane {
+       text-align: left;
+       border-width: 1px 0 0 0;
+       background-image: none;
+       margin-top: .5em;
+       padding: .3em 1em .5em .4em;
+}
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
+       float: right;
+}
+.ui-dialog .ui-dialog-buttonpane button {
+       margin: .5em .4em .5em 0;
+       cursor: pointer;
+}
+.ui-dialog .ui-resizable-se {
+       width: 12px;
+       height: 12px;
+       right: -5px;
+       bottom: -5px;
+       background-position: 16px 16px;
+}
+.ui-draggable .ui-dialog-titlebar {
+       cursor: move;
+}
 
 /* WP jQuery Dialog Theme */
 .wp-dialog {
+       padding: 0;
+       z-index: 300002;
        border: 1px solid #999;
        -webkit-box-shadow: 0px 0px 16px rgba( 0,0,0,0.3 );
        box-shadow: 0px 0px 16px rgba( 0,0,0,0.3 );
+       background-color: #f5f5f5;
+       -webkit-border-top-left-radius: 4px;
+       border-top-left-radius: 4px;
+       -webkit-border-top-right-radius: 4px;
+       border-top-right-radius: 4px;
 }
 
 .wp-dialog .ui-dialog-title {
@@ -1467,36 +1638,29 @@ html[dir="rtl"] .wp-switch-editor {
        font-size: 11px;
        line-height: 18px;
        color: #e5e5e5;
-}
-
-.wp-dialog {
-       background-color: #fff;
-       -webkit-border-top-left-radius: 4px;
-       -webkit-border-top-right-radius: 4px;
-       border-top-left-radius: 4px;
-       border-top-right-radius: 4px;
-}
-
-.wp-dialog .ui-dialog-titlebar {
        -webkit-border-top-left-radius: 3px;
-       -webkit-border-top-right-radius: 3px;
        border-top-left-radius: 3px;
+       -webkit-border-top-right-radius: 3px;
        border-top-right-radius: 3px;
 }
 
+.wp-dialog .ui-dialog-content {
+       padding: 0;
+}
+
 .wp-dialog .ui-dialog-titlebar-close {
-       position: absolute;
+       cursor: pointer;
+       -webkit-appearance: none;
+       border: 0;
        width: 29px;
        height: 16px;
-       top: 2px;
+       top: 13px;
        right: 6px;
        background: url('../js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif') no-repeat -87px -16px;
-       padding: 0;
 }
 
-.rtl .wp-dialog .ui-dialog-titlebar-close {
-       right: auto;
-       left: 6px;
+.wp-dialog .ui-dialog-titlebar-close .ui-button-text {
+       display: none;
 }
 
 .wp-dialog .ui-dialog-titlebar-close:hover,
@@ -1505,11 +1669,17 @@ html[dir="rtl"] .wp-switch-editor {
 }
 
 .ui-widget-overlay {
+       z-index: 300001;
        background-color: #000;
        opacity: 0.6;
        filter: alpha(opacity=60);
 }
 
+.rtl .wp-dialog .ui-dialog-titlebar-close {
+       right: auto;
+       left: 6px;
+}
+
 /*
 RTL
 */
@@ -1678,12 +1848,14 @@ RTL
 }
 
 #wp-fullscreen-title {
-    font-size: 1.7em;
-    line-height: 100%;
-    outline: medium none;
-    padding: 6px 7px;
-    width: 100%;
-    margin-bottom: 30px;
+       font-size: 1.7em;
+       line-height: 100%;
+       outline: medium none;
+       padding: 6px 7px;
+       width: 100%;
+       margin-bottom: 30px;
+       -webkit-box-shadow: none;
+       box-shadow: none;
 }
 
 #wp-fullscreen-container {
@@ -1717,6 +1889,8 @@ RTL
        overflow-y: hidden;
        outline: none;
        resize: none;
+       -webkit-box-shadow: none;
+       box-shadow: none;
 }
 
 #wp-fullscreen-tagline {
@@ -2113,4 +2287,3 @@ RTL
                background-size: 19px 69px;
        }
 }
-
index 4edf0da66cc0b5203c1fac6e4432b3fcb783e0cc..a7c553043a59f34947de03456df0847980226623 100644 (file)
@@ -1 +1,28 @@
-.wp_themeSkin table,.wp_themeSkin tbody,.wp_themeSkin a,.wp_themeSkin img,.wp_themeSkin tr,.wp_themeSkin div,.wp_themeSkin td,.wp_themeSkin iframe,.wp_themeSkin span,.wp_themeSkin *,.wp_themeSkin .mceText{border:0;margin:0;padding:0;white-space:nowrap;text-decoration:none;font-weight:normal;cursor:default;vertical-align:baseline;width:auto;border-collapse:separate}.wp_themeSkin a:hover,.wp_themeSkin a:link,.wp_themeSkin a:visited,.wp_themeSkin a:active{text-decoration:none;font-weight:normal;cursor:default}.wp_themeSkin table td{vertical-align:middle}.wp_themeSkin *,.wp_themeSkin a:hover,.wp_themeSkin a:link,.wp_themeSkin a:visited,.wp_themeSkin a:active{color:#555}.wp_themeSkin iframe{display:block}.wp_themeSkin #mce_fullscreen_ifr{background-color:#fff}.wp_themeSkin .mceToolbar{padding:1px}.wp_themeSkin .mceExternalToolbar{position:absolute;border-bottom:0;display:none}.wp_themeSkin .mceExternalToolbar td.mceToolbar{padding-right:13px}.wp_themeSkin .mceExternalClose{position:absolute;top:3px;right:3px;width:7px;height:7px;background:url("../js/tinymce/themes/advanced/img/icons.gif") -820px 0}.wp_themeSkin table.mceToolbar,.wp_themeSkin tr.mceFirst .mceToolbar tr td,.wp_themeSkin tr.mceLast .mceToolbar tr td{border:0;margin:0;padding:0}.wp_themeSkin table.mceLayout{border:0}.wp_themeSkin .mceStatusbar{display:block;font-family:sans-serif;font-size:12px;line-height:16px;padding:0 0 0 8px;overflow:visible;height:20px;border-top:1px solid #dfdfdf;color:#000;background-color:#f5f5f5}.rtl .wp_themeSkin .mceStatusbar{padding:0 8px 0 0}.wp_themeSkin .mceStatusbar *{color:#555}.wp_themeSkin .mceStatusbar div{float:left;padding:2px}.rtl .wp_themeSkin .mceStatusbar div{float:right}.wp_themeSkin .mceStatusbar a.mceResize{display:block;float:right;background:url("../js/tinymce/themes/advanced/img/icons.gif") -800px 0;width:20px;height:20px;cursor:se-resize}.rtl .wp_themeSkin .mceStatusbar a.mceResize{float:left}.wp_themeSkin .mceStatusbar a:hover{text-decoration:underline}.wp_themeSkin table.mceToolbar{margin:0 6px 2px}.wp_themeSkin table.mceToolbar :active,.wp_themeSkin table.mceToolbar :focus,.wp_themeSkin table.mceToolbar:focus,.wp_themeSkin span.mceSeparator:focus{outline:0}.wp_themeSkin #content_toolbar1{margin-top:2px}.wp_themeSkin .mceToolbar .mceToolbarEndListBox span{display:none}.wp_themeSkin span.mceIcon,.wp_themeSkin img.mceIcon{display:block;width:20px;height:20px}.wp_themeSkin .mceIcon{background:url("../js/tinymce/themes/advanced/img/icons.gif") no-repeat 20px 20px}.wp_themeSkin .mceButton{display:block;width:20px;height:20px;cursor:default;padding:1px 2px;margin:1px;-webkit-border-radius:2px;border-radius:2px}.wp_themeSkin a.mceButtonEnabled:hover{background-image:inherit 0 -10px}.wp_themeSkin .mceOldBoxModel a.mceButton span,.wp_themeSkin .mceOldBoxModel a.mceButton img{margin:0 0 0 1px}.wp_themeSkin .mceButtonDisabled .mceIcon{opacity:.2;filter:alpha(opacity=20)}.wp_themeSkin .mceSeparator{display:none}.wp_themeSkin .mceListBox,.wp_themeSkin .mceListBox a{display:block}.wp_themeSkin .mceListBox .mceText{padding:1px 4px 1px 5px;width:70px;text-align:left;text-decoration:none;-webkit-border-bottom-left-radius:2px;-webkit-border-top-left-radius:2px;border-bottom-left-radius:2px;border-top-left-radius:2px;font-family:sans-serif;font-size:12px;height:20px;line-height:20px;overflow:hidden}.wp_themeSkin .mceListBox{margin:1px;direction:ltr;background-color:#fff;border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 1px -1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px -1px rgba(0,0,0,.2)}.wp_themeSkin .mceListBox .mceOpen{width:12px;height:20px;border-collapse:separate;padding:1px;-webkit-border-bottom-left-radius:0;-webkit-border-top-left-radius:0;border-bottom-left-radius:0;border-top-left-radius:0}.wp_themeSkin .mceListBox .mceFirst a{border-style:solid;border-width:1px;border-bottom-right-radius:2px;border-top-right-radius:2px}.wp_themeSkin .mceListBox .mceOpen,.wp_themeSkin .mceListBoxHover .mceOpen,.wp_themeSkin .mceListBoxSelected .mceOpen,.wp_themeSkin table.mceListBoxEnabled .mceOpen{background-image:url("../images/down_arrow.gif");background-position:3px 1px;background-repeat:no-repeat}.wp_themeSkin .mceListBoxDisabled .mceText{color:gray}.wp_themeSkin .mceListBoxMenu{overflow:auto;overflow-x:hidden}.wp_themeSkin .mceOldBoxModel .mceListBox .mceText{height:22px}.wp_themeSkin select.mceListBox{font-family:sans-serif;font-size:12px;border-color:#b2b2b2;background-color:#fff}.wp_themeSkin .mceSplitButton a,.wp_themeSkin .mceSplitButton span{display:block;height:20px}.wp_themeSkin .mceSplitButton{display:block;direction:ltr}.wp_themeSkin table.mceSplitButton td{padding:2px;-webkit-border-radius:2px;border-radius:2px}.wp_themeSkin table.mceSplitButton:hover td{background-image:inherit 0 -10px}.wp_themeSkin .mceSplitButton a.mceAction{height:20px;width:20px;padding:1px 2px;border-right:0 none}.wp_themeSkin .mceSplitButton span.mceAction{background-image:url("../js/tinymce/themes/advanced/img/icons.gif");background-repeat:no-repeat;background-color:transparent;width:20px}.wp_themeSkin .mceSplitButton a.mceOpen{width:11px;height:20px;background-position:0 2px;background-repeat:no-repeat;padding:1px 0}.wp_themeSkin .mceSplitButton span.mceOpen{display:none}.wp_themeSkin .mceSplitButtonDisabled .mceAction{opacity:.3;filter:alpha(opacity=30)}.wp_themeSkin .mceListBox a.mceText,.wp_themeSkin .mceSplitButton a.mceAction{-webkit-border-bottom-left-radius:2px;-webkit-border-top-left-radius:2px;border-bottom-left-radius:2px;border-top-left-radius:2px}.wp_themeSkin .mceSplitButton a.mceOpen,.wp_themeSkin .mceListBox a.mceOpen{-webkit-border-bottom-right-radius:2px;-webkit-border-top-right-radius:2px;border-bottom-right-radius:2px;border-top-right-radius:2px}.wp_themeSkin span.mce_undo,.wp_themeSkin span.mce_redo,.wp_themeSkin span.mce_bullist,.wp_themeSkin span.mce_numlist,.wp_themeSkin span.mce_blockquote,.wp_themeSkin span.mce_charmap,.wp_themeSkin span.mce_bold,.wp_themeSkin span.mce_italic,.wp_themeSkin span.mce_underline,.wp_themeSkin span.mce_justifyleft,.wp_themeSkin span.mce_justifyright,.wp_themeSkin span.mce_justifycenter,.wp_themeSkin span.mce_justifyfull,.wp_themeSkin span.mce_indent,.wp_themeSkin span.mce_outdent,.wp_themeSkin span.mce_link,.wp_themeSkin span.mce_unlink,.wp_themeSkin span.mce_help,.wp_themeSkin span.mce_removeformat,.wp_themeSkin span.mce_fullscreen,.wp_themeSkin span.mce_wp_fullscreen,.wp_themeSkin span.mce_media,.wp_themeSkin span.mce_pastetext,.wp_themeSkin span.mce_pasteword,.wp_themeSkin span.mce_wp_help,.wp_themeSkin span.mce_wp_adv,.wp_themeSkin span.mce_wp_more,.wp_themeSkin span.mce_strikethrough,.wp_themeSkin span.mce_spellchecker,.wp_themeSkin span.mce_forecolor,.wp_themeSkin .mce_forecolorpicker,.wp_themeSkin .mceSplitButton .mce_spellchecker span.mce_spellchecker,.wp_themeSkin .mceSplitButton .mce_forecolor span.mce_forecolor,.wp_themeSkin .mceSplitButton span.mce_numlist,.wp_themeSkin .mceSplitButton span.mce_bullist{background-image:url('../images/wpicons.png?ver=20120720')}.wp_themeSkin div.mceColorSplitMenu table{background-color:#ebebeb;border-color:#bbb}.wp_themeSkin .mceColorSplitMenu td{padding:2px}.wp_themeSkin .mceColorSplitMenu a{display:block;width:9px;height:9px;overflow:hidden;border-color:#b2b2b2}.wp_themeSkin .mceColorSplitMenu td.mceMoreColors{padding:1px 3px 1px 1px}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors{width:100%;height:auto;text-align:center;font-family:Tahoma,Verdana,Arial,Helvetica;font-size:11px;line-height:20px;border-color:#fff}.wp_themeSkin .mceColorPreview{margin:-5px 0 0 2px;width:16px;height:4px;overflow:hidden}.wp_themeSkin .mceMenu{position:absolute;left:0;top:0;z-index:1000;border-color:#ddd;direction:ltr}.wp_themeSkin .mceNoIcons span.mceIcon{width:0}.wp_themeSkin .mceNoIcons a .mceText{padding-left:10px}.wp_themeSkin .mceMenu table{background-color:#ebeaeb}.wp_themeSkin .mceMenu a,.wp_themeSkin .mceMenu span,.wp_themeSkin .mceMenu{display:block}.wp_themeSkin .mceMenu td{height:20px;overflow:hidden}.wp_themeSkin .mceMenu a{position:relative;padding:3px 0 4px 0;text-decoration:none!important}.wp_themeSkin .mceMenu .mceText{position:relative;display:block;font-family:Tahoma,Verdana,Arial,Helvetica;cursor:default;margin:0;padding:0 25px;color:#000}.wp_themeSkin .mceMenu span.mceText,.wp_themeSkin .mceMenu .mcePreview{font-size:12px}.wp_themeSkin .mceMenu pre.mceText{font-family:Monospace}.wp_themeSkin .mceMenu .mceIcon{position:absolute;top:0;left:0;width:22px}.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,.wp_themeSkin .mceMenu .mceMenuItemActive{background-color:#f5f5f5}.wp_themeSkin td.mceMenuItemSeparator{height:1px;background-color:#aaa}.wp_themeSkin .mceMenuItemTitle a{border-top:0;border-right:0;border-left:0;border-bottom:1px solid #aaa;text-decoration:none!important;background-color:#ccc}.wp_themeSkin .mceMenuItemTitle span.mceText{font-weight:bold;padding-left:4px;color:#000}.wp_themeSkin .mceMenuItemSelected .mceIcon{background:url("../js/tinymce/themes/advanced/skins/default/img/menu_check.gif");color:#888}.wp_themeSkin .mceNoIcons .mceMenuItemSelected a{background:url("../js/tinymce/themes/advanced/skins/default/img/menu_arrow.gif") no-repeat -6px center}.wp_themeSkin .mceMenu span.mceMenuLine{display:none}.wp_themeSkin .mceMenuItemSub a{background:url("../js/tinymce/themes/advanced/skins/default/img/menu_arrow.gif") no-repeat top right}.wp_themeSkin .mceBlocker{position:absolute;left:0;top:0;z-index:1000;opacity:.5;filter:alpha(opacity=50);background:#FFF}.wp_themeSkin .mceProgress{position:absolute;left:0;top:0;z-index:1001;background:url("../js/tinymce/themes/advanced/skins/default/img/progress.gif") no-repeat;width:32px;height:32px;margin:-16px 0 0 -16px}.wp_themeSkin .mcePlaceHolder{border:1px dotted gray}.mceRtl .mceListBox .mceText{text-align:right;padding:0 4px 0 0}.mceRtl .mceMenuItem .mceText{text-align:right}.wp_themeSkin .mce_address span.mceText{font-style:italic}.wp_themeSkin .mce_pre span.mceText{font-family:monospace}.wp_themeSkin .mce_h1 span.mceText{font-weight:bolder;font-size:17px}.wp_themeSkin .mce_h2 span.mceText{font-weight:bolder;font-size:16px}.wp_themeSkin .mce_h3 span.mceText{font-weight:bolder;font-size:15px}.wp_themeSkin .mce_h4 span.mceText{font-weight:bolder;font-size:14px}.wp_themeSkin .mce_h5 span.mceText{font-weight:bolder;font-size:13px}.wp_themeSkin .mce_h6 span.mceText{font-weight:bolder;font-size:12px}.wp_themeSkin span.mce_undo{background-position:-500px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_undo,.wp_themeSkin .mceButtonActive span.mce_undo{background-position:-500px 0}.wp_themeSkin span.mce_redo{background-position:-480px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_redo,.wp_themeSkin .mceButtonActive span.mce_redo{background-position:-480px 0}.wp_themeSkin span.mce_bullist{background-position:-40px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_bullist,.wp_themeSkin .mceButtonActive span.mce_bullist,.wp_themeSkin .mceSplitButton:hover span.mce_bullist{background-position:-40px 0}.wp_themeSkin span.mce_numlist{background-position:-60px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_numlist,.wp_themeSkin .mceButtonActive span.mce_numlist,.wp_themeSkin .mceSplitButton:hover span.mce_numlist{background-position:-60px 0}.wp_themeSkin span.mce_blockquote{background-position:-80px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_blockquote,.wp_themeSkin .mceButtonActive span.mce_blockquote{background-position:-80px 0}.wp_themeSkin span.mce_charmap{background-position:-420px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_charmap,.wp_themeSkin .mceButtonActive span.mce_charmap{background-position:-420px 0}.wp_themeSkin span.mce_bold{background-position:0 -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_bold,.wp_themeSkin .mceButtonActive span.mce_bold{background-position:0 0}.wp_themeSkin span.mce_italic{background-position:-20px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_italic,.wp_themeSkin .mceButtonActive span.mce_italic{background-position:-20px 0}.wp_themeSkin span.mce_underline{background-position:-280px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_underline,.wp_themeSkin .mceButtonActive span.mce_underline{background-position:-280px 0}.wp_themeSkin span.mce_justifyleft{background-position:-100px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_justifyleft,.wp_themeSkin .mceButtonActive span.mce_justifyleft{background-position:-100px 0}.wp_themeSkin span.mce_justifyright{background-position:-140px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_justifyright,.wp_themeSkin .mceButtonActive span.mce_justifyright{background-position:-140px 0}.wp_themeSkin span.mce_justifycenter{background-position:-120px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_justifycenter,.wp_themeSkin .mceButtonActive span.mce_justifycenter{background-position:-120px 0}.wp_themeSkin span.mce_justifyfull{background-position:-300px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_justifyfull,.wp_themeSkin .mceButtonActive span.mce_justifyfull{background-position:-300px 0}.wp_themeSkin span.mce_indent{background-position:-460px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_indent,.wp_themeSkin .mceButtonActive span.mce_indent{background-position:-460px 0}.wp_themeSkin span.mce_outdent{background-position:-440px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_outdent,.wp_themeSkin .mceButtonActive span.mce_outdent{background-position:-440px 0}.wp_themeSkin span.mce_link{background-position:-160px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_link,.wp_themeSkin .mceButtonActive span.mce_link{background-position:-160px 0}.wp_themeSkin span.mce_unlink{background-position:-180px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_unlink,.wp_themeSkin .mceButtonActive span.mce_unlink{background-position:-180px 0}.wp_themeSkin span.mce_help{background-position:-520px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_help,.wp_themeSkin .mceButtonActive span.mce_help{background-position:-520px 0}.wp_themeSkin span.mce_removeformat{background-position:-380px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_removeformat,.wp_themeSkin .mceButtonActive span.mce_removeformat{background-position:-380px 0}.wp_themeSkin span.mce_strikethrough{background-position:-540px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_strikethrough,.wp_themeSkin .mceButtonActive span.mce_strikethrough{background-position:-540px 0}.wp_themeSkin .mceSplitButton .mce_forecolor span.mce_forecolor{background-position:-320px -20px}.wp_themeSkin .mceSplitButtonEnabled:hover span.mce_forecolor,.wp_themeSkin .mceSplitButtonSelected span.mce_forecolor{background-position:-320px 0}.wp_themeSkin .mce_forecolorpicker{background-position:-320px -20px}.wp_themeSkin span.mce_fullscreen{background-position:-240px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_fullscreen,.wp_themeSkin .mceButtonActive span.mce_fullscreen{background-position:-240px 0}.wp_themeSkin span.mce_wp_fullscreen{background-position:-240px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_wp_fullscreen,.wp_themeSkin .mceButtonActive span.mce_wp_fullscreen{background-position:-240px 0}.wp_themeSkin span.mce_media{background-position:-400px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_media,.wp_themeSkin .mceButtonActive span.mce_media{background-position:-400px 0}.wp_themeSkin span.mce_pastetext{background-position:-340px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_pastetext,.wp_themeSkin .mceButtonActive span.mce_pastetext{background-position:-340px 0}.wp_themeSkin span.mce_pasteword{background-position:-360px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_pasteword,.wp_themeSkin .mceButtonActive span.mce_pasteword{background-position:-360px 0}.wp_themeSkin span.mce_spellchecker{background-position:-220px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_spellchecker,.wp_themeSkin .mceSplitButtonEnabled:hover span.mce_spellchecker,.wp_themeSkin .mceButtonActive span.mce_spellchecker,.wp_themeSkin .mceSplitButtonSelected span.mce_spellchecker{background-position:-220px 0}.wp_themeSkin span.mce_wp_help{background-position:-520px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_wp_help,.wp_themeSkin .mceButtonActive span.mce_wp_help{background-position:-520px 0}.wp_themeSkin span.mce_wp_adv{background-position:-260px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_wp_adv,.wp_themeSkin .mceButtonActive span.mce_wp_adv{background-position:-260px 0}.wp_themeSkin span.mce_wp_more{background-position:-200px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_wp_more,.wp_themeSkin .mceButtonActive span.mce_wp_more{background-position:-200px 0}.wp_themeSkin span.mce_cleanup{background-position:-380px -20px}.wp_themeSkin span.mce_anchor{background-position:-200px 0}.wp_themeSkin span.mce_sub{background-position:-600px 0}.wp_themeSkin span.mce_sup{background-position:-620px 0}.wp_themeSkin span.mce_newdocument{background-position:-520px 0}.wp_themeSkin span.mce_image{background-position:-380px 0}.wp_themeSkin span.mce_code{background-position:-260px 0}.wp_themeSkin span.mce_hr{background-position:-360px 0}.wp_themeSkin span.mce_visualaid{background-position:-660px 0}.wp_themeSkin span.mce_paste{background-position:-560px 0}.wp_themeSkin span.mce_copy{background-position:-700px 0}.wp_themeSkin span.mce_cut{background-position:-680px 0}.wp_themeSkin .mce_backcolor span.mceAction{background-position:-760px 0}.wp_themeSkin .mce_backcolorpicker{background-position:-760px 0}.wp_themeSkin span.mce_advhr{background-position:-0px -20px}.wp_themeSkin span.mce_ltr{background-position:-20px -20px}.wp_themeSkin span.mce_rtl{background-position:-40px -20px}.wp_themeSkin span.mce_emotions{background-position:-60px -20px}.wp_themeSkin span.mce_fullpage{background-position:-80px -20px}.wp_themeSkin span.mce_iespell{background-position:-120px -20px}.wp_themeSkin span.mce_insertdate{background-position:-140px -20px}.wp_themeSkin span.mce_inserttime{background-position:-160px -20px}.wp_themeSkin span.mce_absolute{background-position:-180px -20px}.wp_themeSkin span.mce_backward{background-position:-200px -20px}.wp_themeSkin span.mce_forward{background-position:-220px -20px}.wp_themeSkin span.mce_insert_layer{background-position:-240px -20px}.wp_themeSkin span.mce_insertlayer{background-position:-260px -20px}.wp_themeSkin span.mce_movebackward{background-position:-280px -20px}.wp_themeSkin span.mce_moveforward{background-position:-300px -20px}.wp_themeSkin span.mce_nonbreaking{background-position:-340px -20px}.wp_themeSkin span.mce_selectall{background-position:-400px -20px}.wp_themeSkin span.mce_preview{background-position:-420px -20px}.wp_themeSkin span.mce_print{background-position:-440px -20px}.wp_themeSkin span.mce_cancel{background-position:-460px -20px}.wp_themeSkin span.mce_save{background-position:-480px -20px}.wp_themeSkin span.mce_replace{background-position:-500px -20px}.wp_themeSkin span.mce_search{background-position:-520px -20px}.wp_themeSkin span.mce_styleprops{background-position:-560px -20px}.wp_themeSkin span.mce_table{background-position:-580px -20px}.wp_themeSkin span.mce_cell_props{background-position:-600px -20px}.wp_themeSkin span.mce_delete_table{background-position:-620px -20px}.wp_themeSkin span.mce_delete_col{background-position:-640px -20px}.wp_themeSkin span.mce_delete_row{background-position:-660px -20px}.wp_themeSkin span.mce_col_after{background-position:-680px -20px}.wp_themeSkin span.mce_col_before{background-position:-700px -20px}.wp_themeSkin span.mce_row_after{background-position:-720px -20px}.wp_themeSkin span.mce_row_before{background-position:-740px -20px}.wp_themeSkin span.mce_merge_cells{background-position:-760px -20px}.wp_themeSkin span.mce_table_props{background-position:-980px -20px}.wp_themeSkin span.mce_row_props{background-position:-780px -20px}.wp_themeSkin span.mce_split_cells{background-position:-800px -20px}.wp_themeSkin span.mce_template{background-position:-820px -20px}.wp_themeSkin span.mce_visualchars{background-position:-840px -20px}.wp_themeSkin span.mce_abbr{background-position:-860px -20px}.wp_themeSkin span.mce_acronym{background-position:-880px -20px}.wp_themeSkin span.mce_attribs{background-position:-900px -20px}.wp_themeSkin span.mce_cite{background-position:-920px -20px}.wp_themeSkin span.mce_del{background-position:-940px -20px}.wp_themeSkin span.mce_ins{background-position:-960px -20px}.wp_themeSkin span.mce_pagebreak{background-position:0 -40px}.wp_themeSkin span.mce_restoredraft{background-position:-20px -40px}.wp_themeSkin span.mce_visualblocks{background-position:-40px -40px}.wp_themeSkin .mceExternalToolbar,.wp_themeSkin .mceButton,.wp_themeSkin a.mceButtonEnabled:hover,.wp_themeSkin a.mceButtonActive,.wp_themeSkin a.mceButtonSelected,.wp_themeSkin .mceListBox .mceText,.wp_themeSkin .mceListBox .mceOpen,.wp_themeSkin select.mceListBox,.wp_themeSkin .mceSplitButton a.mceAction,.wp_themeSkin .mceSplitButton a.mceOpen,.wp_themeSkin .mceSplitButton a.mceOpen:hover,.wp_themeSkin .mceSplitButtonSelected a.mceOpen,.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,.wp_themeSkin .mceSplitButton a.mceAction:hover,.wp_themeSkin div.mceColorSplitMenu table,.wp_themeSkin .mceColorSplitMenu a,.wp_themeSkin .mceColorSplitMenu a.mceMoreColors,.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover,.wp_themeSkin a.mceMoreColors:hover,.wp_themeSkin .mceMenu{border-style:solid;border-width:1px}.wp_themeSkin .mceListBox .mceText{border-right:0 none}.wp_themeSkin iframe{background:transparent}.wp_themeSkin .mceButton{border-color:transparent}.wp_themeSkin .mceListBox .mceText,.wp_themeSkin .mceListBox .mceOpen{border-color:transparent}.wp_themeSkin a.mceButtonEnabled:hover,.wp_themeSkin table.mceSplitButton:hover{border-color:#bbb;background:#eee;background-image:-webkit-gradient(linear,left bottom,left top,from(#e5e5e5),to(#fff));background-image:-webkit-linear-gradient(bottom,#e5e5e5,#fff);background-image:-moz-linear-gradient(bottom,#e5e5e5,#fff);background-image:-o-linear-gradient(bottom,#e5e5e5,#fff);background-image:linear-gradient(to top,#e5e5e5,#fff)}.wp_themeSkin a.mceButton:active,.wp_themeSkin a.mceButtonEnabled:active,.wp_themeSkin a.mceButtonSelected:active,.wp_themeSkin a.mceButtonActive,.wp_themeSkin a.mceButtonActive:active,.wp_themeSkin a.mceButtonActive:hover,.wp_themeSkin .mceSplitButtonSelected table,.wp_themeSkin .mceSplitButtonSelected table:hover{outline:0;border-color:#999 #ccc #ccc #999;background:#eee;background-image:-webkit-gradient(linear,left bottom,left top,from(#f6f6f6),to(#e3e3e3));background-image:-webkit-linear-gradient(bottom,#f6f6f6,#e3e3e3);background-image:-moz-linear-gradient(bottom,#f6f6f6,#e3e3e3);background-image:-o-linear-gradient(bottom,#f6f6f6,#e3e3e3);background-image:linear-gradient(to top,#f6f6f6,#e3e3e3)}.wp_themeSkin .mceSplitButtonSelected table a.mceOpen,.wp_themeSkin .mceSplitButtonSelected table a.mceAction{border-color:#999 #ccc #ccc #999}.wp_themeSkin .mceButtonDisabled{border-color:transparent}.wp_themeSkin .mceListBox .mceOpen{border-left:0}.wp_themeSkin .mceListBoxEnabled:hover,.wp_themeSkin .mceListBoxEnabled:active,.wp_themeSkin .mceListBoxHover,.wp_themeSkin .mceListBoxHover:active,.wp_themeSkin .mceListBoxSelected{-webkit-box-shadow:inset 0 1px 1px -1px rgba(0,0,0,.3);box-shadow:inset 0 1px 1px -1px rgba(0,0,0,.3);border-color:#bbb}.wp_themeSkin .mceSplitButton .mceLast span.mceOpen .mceIconOnly{display:block}.wp_themeSkin .mceSplitButton a.mceAction,.wp_themeSkin .mceSplitButton a.mceOpen{border-color:transparent}.wp_themeSkin .mceSplitButton:hover a{border-color:#bbb}.wp_themeSkin .mceSplitButtonEnabled a.mceOpen,.wp_themeSkin .mceSplitButtonSelected a.mceOpen,.wp_themeSkin .mceSplitButtonActive a.mceOpen,.wp_themeSkin .mceSplitButtonEnabled:hover a.mceOpen{background-image:url("../images/down_arrow.gif");background-position:1px 2px;background-repeat:no-repeat;border-left:0}.wp_themeSkin .mceSplitButtonActive td{-webkit-border-radius:3px;border-radius:3px}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover{border-color:#0a246a;background-color:#b6bdd2}.wp_themeSkin a.mceMoreColors:hover{border-color:#0a246a}.wp_themeSkin .mceMenuItemDisabled .mceText{color:#888}#mceModalBlocker{background:#000}.wp-editor-wrap{position:relative}.wp-editor-area{font-family:Consolas,Monaco,monospace;padding:10px;margin:1px 0 0;line-height:150%;border:0 none;outline:0;display:block;resize:vertical;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.wp-editor-tools{height:30px;padding:0 10px 0 0}.rtl .wp-editor-tools{padding:0 0 0 10px}.wp-editor-container{border-width:1px;border-style:solid;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px;border-color:#ccc #ccc #dfdfdf}.wp-editor-container textarea.wp-editor-area{width:100%;margin:0;-webkit-box-shadow:none;box-shadow:none}.quicktags-toolbar,.wp_themeSkin tr.mceFirst td.mceToolbar{border-bottom:1px solid #d1d1d1;background:#eee;background-image:-webkit-gradient(linear,left bottom,left top,from(#e5e5e5),to(#f4f4f4));background-image:-webkit-linear-gradient(bottom,#e5e5e5,#f4f4f4);background-image:-moz-linear-gradient(bottom,#e5e5e5,#f4f4f4);background-image:-o-linear-gradient(bottom,#e5e5e5,#f4f4f4);background-image:linear-gradient(to top,#e5e5e5,#f4f4f4)}.wp-switch-editor{height:18px;font:13px/18px Arial,Helvetica,sans-serif normal;margin:5px 5px 0 0;padding:4px 5px 2px;float:right;cursor:pointer;border-width:1px;border-style:solid;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px;background-color:#f1f1f1;border-color:#dfdfdf #dfdfdf #ccc;color:#999}html[dir="rtl"] .wp-switch-editor{float:left}.wp-switch-editor:active{background-color:#f1f1f1}.wp-switch-editor:hover{text-decoration:none!important}.js .tmce-active .wp-editor-area{color:white}.tmce-active .quicktags-toolbar{display:none}.tmce-active .switch-tmce,.html-active .switch-html{border-color:#ccc #ccc #f4f4f4;background-color:#f4f4f4;color:#555}.wp-media-buttons .button{margin-right:5px}.rtl .wp-media-buttons .button{margin-right:0;margin-left:5px}.wp-media-buttons .insert-media{padding-left:.4em}.rtl .wp-media-buttons .insert-media{padding-left:10px;padding-right:.4em}.wp-media-buttons a{text-decoration:none;color:#464646;font-size:12px}.wp-media-buttons img{padding:0 4px;vertical-align:middle}.wp-media-buttons span.wp-media-buttons-icon{display:inline-block;width:16px;height:16px;vertical-align:text-top;margin:0 2px}.wp-media-buttons .add_media span.wp-media-buttons-icon{background:url('../../wp-admin/images/media-button.png') no-repeat top left}.quicktags-toolbar{border-bottom-style:solid;border-bottom-width:1px;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px;padding:2px 8px 0;min-height:29px}.quicktags-toolbar>div{padding:2px 4px 0}.quicktags-toolbar input{margin:2px 1px 4px;line-height:18px;display:inline-block;min-width:26px;padding:2px 4px;font:12px/18px Arial,Helvetica,sans-serif normal;color:#464646;border:1px solid #c3c3c3;-webkit-border-radius:3px;border-radius:3px;background:#eee;background-image:-webkit-gradient(linear,left bottom,left top,from(#e3e3e3),to(#fff));background-image:-webkit-linear-gradient(bottom,#e3e3e3,#fff);background-image:-moz-linear-gradient(bottom,#e3e3e3,#fff);background-image:-o-linear-gradient(bottom,#e3e3e3,#fff);background-image:linear-gradient(to top,#e3e3e3,#fff)}.quicktags-toolbar input:hover{border-color:#aaa;background:#ddd}.quicktags-toolbar input[value="link"]{text-decoration:underline}.quicktags-toolbar input[value="del"]{text-decoration:line-through}.quicktags-toolbar input[value="i"]{font-style:italic}.quicktags-toolbar input[value="b"]{font-weight:bold}#wp_editbtns,#wp_gallerybtns{padding:2px;position:absolute;display:none;z-index:155000}#wp_editimgbtn,#wp_delimgbtn,#wp_editgallery,#wp_delgallery{border-color:#999;background-color:#eee;margin:2px;padding:2px;border-width:1px;border-style:solid;-webkit-border-radius:3px;border-radius:3px}#wp_editimgbtn:hover,#wp_delimgbtn:hover,#wp_editgallery:hover,#wp_delgallery:hover{border-color:#555;background-color:#ccc}#wp-link{background-color:#f5f5f5;line-height:1.4em;font-size:12px}#wp-link ol,#wp-link ul{list-style:none;margin:0;padding:0}#wp-link input[type="text"]{-webkit-box-sizing:border-box}#wp-link input[type="text"],#wp-link textarea{border-width:1px;border-style:solid;-webkit-border-radius:4px;border-radius:4px;font-size:12px;margin:1px;padding:3px}#wp-link #link-options{padding:10px 0 14px;border-bottom:1px solid #dfdfdf;margin:0 6px 14px}#wp-link p.howto{margin:3px}#wp-link #internal-toggle{display:inline-block;cursor:pointer;padding-left:18px}#wp-link .toggle-arrow{background:transparent url('../images/toggle-arrow.png') top left no-repeat;height:23px;line-height:23px}#wp-link .toggle-arrow-active{background-position:center left}#wp-link label input[type="text"]{width:360px;margin-top:5px}#wp-link #link-options label span,#wp-link #search-panel label span.search-label{display:inline-block;width:80px;text-align:right;padding-right:5px}#wp-link .link-search-field{float:left;width:220px}#wp-link .link-search-wrapper{margin:5px 6px 9px;display:block;overflow:hidden}#wp-link .link-search-wrapper span{float:left;margin-top:4px}#wp-link .link-search-wrapper .spinner{display:none;vertical-align:text-bottom}#wp-link .link-target{width:auto;padding:3px 0 0;margin:0 0 0 87px;font-size:11px}#wp-link .query-results{border:1px #dfdfdf solid;margin:0 5px 5px;background:#fff;height:185px;overflow:auto;position:relative}#wp-link li,#wp-link .query-notice{clear:both;margin-bottom:0;border-bottom:1px solid #f1f1f1;color:#333;padding:4px 6px;cursor:pointer;position:relative}#wp-link li:hover{background:#eaf2fa;color:#151515}#wp-link li.unselectable{border-bottom:1px solid #dfdfdf}#wp-link li.unselectable:hover{background:#fff;cursor:auto;color:#333}#wp-link li.selected{background:#ddd;color:#333}#wp-link li.selected .item-title{font-weight:bold}#wp-link .item-title{display:inline-block;width:80%}#wp-link .item-info{text-transform:uppercase;color:#666;font-size:11px;position:absolute;right:5px;top:4px;bottom:0}#wp-link #search-results{display:none}#wp-link #search-panel{float:left;width:100%}#wp-link .river-waiting{display:none;padding:10px 0}#wp-link .river-waiting .spinner{margin:0 auto;display:block}#wp-link .submitbox{padding:5px 10px;font-size:11px;overflow:auto;height:29px}#wp-link-cancel{line-height:25px;float:left}#wp-link-update{line-height:23px;float:right}.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{position:absolute;left:-99999999px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}.ui-helper-clearfix{display:inline-block}/*\*/* html .ui-helper-clearfix{height:1%}.ui-helper-clearfix{display:block}/**/.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;z-index:99999;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.wp-dialog{position:absolute;width:300px;overflow:hidden}.wp-dialog .ui-dialog-titlebar{position:relative}.wp-dialog .ui-dialog-titlebar-close span{display:block;margin:1px}.wp-dialog .ui-dialog-content{position:relative;border:0;padding:0;background:0;overflow:auto;zoom:1}.wp-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin:.5em 0 0 0;padding:.3em 1em .5em .4em}.wp-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.wp-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.wp-dialog .ui-resizable-se{width:14px;height:14px;right:3px;bottom:3px}.ui-draggable .ui-dialog-titlebar{cursor:move}.wp-dialog{border:1px solid #999;-webkit-box-shadow:0 0 16px rgba(0,0,0,0.3);box-shadow:0 0 16px rgba(0,0,0,0.3)}.wp-dialog .ui-dialog-title{display:block;text-align:center;padding:1px 0 2px}.wp-dialog .ui-dialog-titlebar{padding:0 1em;background-color:#444;font-weight:bold;font-size:11px;line-height:18px;color:#e5e5e5}.wp-dialog{background-color:#fff;-webkit-border-top-left-radius:4px;-webkit-border-top-right-radius:4px;border-top-left-radius:4px;border-top-right-radius:4px}.wp-dialog .ui-dialog-titlebar{-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-left-radius:3px;border-top-right-radius:3px}.wp-dialog .ui-dialog-titlebar-close{position:absolute;width:29px;height:16px;top:2px;right:6px;background:url('../js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif') no-repeat -87px -16px;padding:0}.rtl .wp-dialog .ui-dialog-titlebar-close{right:auto;left:6px}.wp-dialog .ui-dialog-titlebar-close:hover,.wp-dialog .ui-dialog-titlebar-close:focus{background-position:-87px -32px}.ui-widget-overlay{background-color:#000;opacity:.6;filter:alpha(opacity=60)}.rtl #wp-link #internal-toggle{padding-right:18px;padding-left:0}.rtl #wp-link #link-options label span,.rtl #wp-link #search-panel label span.search-label{text-align:left;padding-right:0;padding-left:5px}.rtl #wp-link #link-options label #url-field{direction:ltr}.rtl #wp-link .link-search-field,.rtl #wp-link .link-search-wrapper span{float:right}.rtl #wp-link .link-target{margin-right:87px;margin-left:0}.rtl #wp-link .item-info{left:5px;right:auto;top:4px;bottom:0}.rtl #wp-link #search-panel{float:right}.rtl #wp-link-cancel{float:right}.rtl #wp-link-update{float:left}.rtl #wp-link .toggle-arrow{background-position:top right}.rtl #wp-link .toggle-arrow-active{background-position:center right}.rtl .wp_themeSkin .mceListBox .mceText{text-align:right}.rtl .wp_themeSkin .mceNoIcons a .mceText{padding-right:10px;padding-left:25px}.rtl .mceListBoxMenu.mceNoIcons{direction:rtl}.clearlooks2 .mceFocus .mceTop .mceLeft{background:#444;border-left:1px solid #999;border-top:1px solid #999;-webkit-border-top-left-radius:3px;border-top-left-radius:3px}.clearlooks2 .mceFocus .mceTop .mceRight{background:#444;border-right:1px solid #999;border-top:1px solid #999;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.clearlooks2 .mceMiddle .mceLeft{background:#f1f1f1;border-left:1px solid #999}.clearlooks2 .mceMiddle .mceRight{background:#f1f1f1;border-right:1px solid #999}.clearlooks2 .mceBottom{background:#f1f1f1;border-bottom:1px solid #999}.clearlooks2 .mceBottom .mceLeft{background:#f1f1f1;border-bottom:1px solid #999;border-left:1px solid #999}.clearlooks2 .mceBottom .mceCenter{background:#f1f1f1;border-bottom:1px solid #999}.clearlooks2 .mceBottom .mceRight{background:#f1f1f1;border-bottom:1px solid #999;border-right:1px solid #999}.clearlooks2 .mceFocus .mceTop span{color:#e5e5e5}.fullscreen-overlay{z-index:149999;display:none;position:fixed;top:0;bottom:0;left:0;right:0;filter:inherit}.fullscreen-active .fullscreen-overlay,.fullscreen-active #wp-fullscreen-body{display:block}.fullscreen-fader{z-index:200000}.fullscreen-active .fullscreen-fader{display:none}#wp-fullscreen-body{width:100%;z-index:150005;display:none;position:absolute;top:0;left:0;font-size:12px}#wp-fullscreen-wrap{margin:0 auto 50px;position:relative;padding-top:60px}#wp-fullscreen-title{font-size:1.7em;line-height:100%;outline:medium none;padding:6px 7px;width:100%;margin-bottom:30px}#wp-fullscreen-container{padding:4px 10px 50px}#wp-fullscreen-title,#wp-fullscreen-container{-webkit-border-radius:0;border-radius:0;border:1px dashed transparent;background:transparent;-moz-transition-property:border-color;-moz-transition-duration:.6s;-webkit-transition-property:border-color;-webkit-transition-duration:.6s;-o-transition-property:border-color;-o-transition-duration:.6s;transition-property:border-color;transition-duration:.6s}#wp_mce_fullscreen{width:100%;min-height:300px;border:0;background:transparent;font-family:Consolas,Monaco,monospace;line-height:1.6em;padding:0;overflow-y:hidden;outline:0;resize:none}#wp-fullscreen-tagline{color:#bbb;font-size:18px;float:right;padding-top:5px}#fullscreen-topbar{position:fixed;top:0;left:0;z-index:150050;border-bottom-style:solid;border-bottom-width:1px;min-width:800px;width:100%;height:40px}#wp-fullscreen-toolbar{padding:6px 10px 0;clear:both;max-width:1100px;min-width:820px;margin:0 auto}#wp-fullscreen-mode-bar,#wp-fullscreen-button-bar,#wp-fullscreen-close,#wp-fullscreen-count{float:left}#wp-fullscreen-save{float:right;padding:2px 2px 0 5px}#wp-fullscreen-count,#wp-fullscreen-close{padding-top:5px}#wp-fullscreen-central-toolbar{margin:auto;padding:0}#wp-fullscreen-buttons>div{float:left}#wp-fullscreen-mode-bar{padding:1px 14px 0 0}#wp-fullscreen-modes a{display:block;font-size:11px;text-decoration:none;float:left;margin:1px 0 0 0;padding:2px 6px 2px;border-width:1px 1px 1px 0;border-style:solid;border-color:#bbb;color:#777;text-shadow:0 1px 0 #fff;background-color:#f4f4f4;background:#f4f4f4;background-image:-webkit-gradient(linear,left bottom,left top,from(#e4e4e4),to(#f9f9f9));background-image:-webkit-linear-gradient(bottom,#e4e4e4,#f9f9f9);background-image:-moz-linear-gradient(bottom,#e4e4e4,#f9f9f9);background-image:-o-linear-gradient(bottom,#e4e4e4,#f9f9f9);background-image:linear-gradient(to top,#e4e4e4,#f9f9f9)}#wp-fullscreen-modes a:hover,.wp-html-mode #wp-fullscreen-modes a:last-child,.wp-tmce-mode #wp-fullscreen-modes a:first-child{color:#333;border-color:#999;background:#eee;background-image:-webkit-gradient(linear,left top,left bottom,from(#e4e4e4),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#e4e4e4,#f9f9f9);background-image:-moz-linear-gradient(top,#e4e4e4,#f9f9f9);background-image:-o-linear-gradient(top,#e4e4e4,#f9f9f9);background-image:linear-gradient(to bottom,#e4e4e4,#f9f9f9)}#wp-fullscreen-modes a:first-child{border-width:1px;-webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-top-left-radius:3px;border-bottom-left-radius:3px}#wp-fullscreen-modes a:last-child{-webkit-border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px}#wp-fullscreen-buttons .active a{background:inherit}#wp-fullscreen-buttons .hidden{display:none}#wp-fullscreen-buttons .disabled{opacity:.5}.wp-html-mode #wp-fullscreen-buttons div{display:none}.wp-html-mode #wp-fullscreen-buttons div.wp-fullscreen-both{display:block}#fullscreen-topbar.fullscreen-make-sticky{display:block!important}#wp-fullscreen-save img{vertical-align:middle}#wp-fullscreen-save img,#wp-fullscreen-save span{padding-right:4px;display:none}#wp-fullscreen-buttons #wp_fs_image span.mce_image{background-image:url('../../wp-admin/images/media-button.png');background-position:2px 2px}.fullscreen-active #TB_overlay{z-index:150100}.fullscreen-active #TB_window{z-index:150102}#wp_mce_fullscreen_ifr{background:transparent}#wp_mce_fullscreen_parent #wp_mce_fullscreen_tbl tr.mceFirst{display:none}#wp-fullscreen-container .wp_themeSkin table td{vertical-align:top}.fullscreen-overlay{background:#fff}.wp-fullscreen-focus #wp-fullscreen-title,.wp-fullscreen-focus #wp-fullscreen-container{border-color:#ccc}#fullscreen-topbar{border-bottom-color:#dfdfdf;background:#f1f1f1;background-image:-webkit-gradient(linear,left bottom,left top,from(#ececec),to(#f9f9f9));background-image:-webkit-linear-gradient(bottom,#ececec,#f9f9f9);background-image:-moz-linear-gradient(bottom,#ececec,#f9f9f9);background-image:-o-linear-gradient(bottom,#ececec,#f9f9f9);background-image:linear-gradient(to top,#ececec,#f9f9f9)}.fade-1000,.fade-600,.fade-400,.fade-300{opacity:0;-moz-transition-property:opacity;-webkit-transition-property:opacity;-o-transition-property:opacity;transition-property:opacity}.fade-1000{-moz-transition-duration:1s;-webkit-transition-duration:1s;-o-transition-duration:1s;transition-duration:1s}.fade-600{-moz-transition-duration:.6s;-webkit-transition-duration:.6s;-o-transition-duration:.6s;transition-duration:.6s}.fade-400{-moz-transition-duration:.4s;-webkit-transition-duration:.4s;-o-transition-duration:.4s;transition-duration:.4s}.fade-300{-moz-transition-duration:.3s;-webkit-transition-duration:.3s;-o-transition-duration:.3s;transition-duration:.3s}.fade-trigger{opacity:1}.rtl #wp-fullscreen-tagline{float:left}.rtl #fullscreen-topbar{left:auto;right:0}.rtl #wp-fullscreen-mode-bar,.rtl #wp-fullscreen-button-bar,.rtl #wp-fullscreen-close,.rtl #wp-fullscreen-count{float:right}.rtl #wp-fullscreen-save{float:left}.rtl #wp-fullscreen-save{padding:2px 5px 0 2px}.rtl #wp-fullscreen-buttons>div{float:right}.rtl #wp-fullscreen-mode-bar{padding:1px 0 0 14px}.rtl #wp-fullscreen-modes a{float:right;border-width:1px 0 1px 1px}.rtl #wp-fullscreen-modes a:first-child{-webkit-border-top-left-radius:0;-webkit-border-top-right-radius:3px;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:3px;border-width:1px;border-top-left-radius:0;border-top-right-radius:3px;border-bottom-left-radius:0;border-bottom-right-radius:3px}.rtl #wp-fullscreen-modes a:last-child{-webkit-border-top-right-radius:0;-webkit-border-top-left-radius:3px;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:3px;border-top-right-radius:0;border-top-left-radius:3px;border-bottom-right-radius:0;border-bottom-left-radius:3px}.rtl #wp-fullscreen-save img,.rtl #wp-fullscreen-save span{padding-right:0;padding-left:4px}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.wp_themeSkin span.mce_undo,.wp_themeSkin span.mce_redo,.wp_themeSkin span.mce_bullist,.wp_themeSkin span.mce_numlist,.wp_themeSkin span.mce_blockquote,.wp_themeSkin span.mce_charmap,.wp_themeSkin span.mce_bold,.wp_themeSkin span.mce_italic,.wp_themeSkin span.mce_underline,.wp_themeSkin span.mce_justifyleft,.wp_themeSkin span.mce_justifyright,.wp_themeSkin span.mce_justifycenter,.wp_themeSkin span.mce_justifyfull,.wp_themeSkin span.mce_indent,.wp_themeSkin span.mce_outdent,.wp_themeSkin span.mce_link,.wp_themeSkin span.mce_unlink,.wp_themeSkin span.mce_help,.wp_themeSkin span.mce_removeformat,.wp_themeSkin span.mce_fullscreen,.wp_themeSkin span.mce_wp_fullscreen,.wp_themeSkin span.mce_media,.wp_themeSkin span.mce_pastetext,.wp_themeSkin span.mce_pasteword,.wp_themeSkin span.mce_wp_help,.wp_themeSkin span.mce_wp_adv,.wp_themeSkin span.mce_wp_more,.wp_themeSkin span.mce_strikethrough,.wp_themeSkin span.mce_spellchecker,.wp_themeSkin span.mce_forecolor,.wp_themeSkin .mce_forecolorpicker,.wp_themeSkin .mceSplitButton .mce_spellchecker span.mce_spellchecker,.wp_themeSkin .mceSplitButton .mce_forecolor span.mce_forecolor,.wp_themeSkin .mceSplitButton span.mce_numlist,.wp_themeSkin .mceSplitButton span.mce_bullist{background-image:url('../images/wpicons-2x.png?ver=20120720');background-size:560px 40px}.wp-media-buttons .add_media span.wp-media-buttons-icon,#wp-fullscreen-buttons #wp_fs_image span.mce_image{background-image:url('../../wp-admin/images/media-button-2x.png');background-size:16px 16px}.wp_themeSkin .mceListBox .mceOpen,.wp_themeSkin .mceListBoxHover .mceOpen,.wp_themeSkin .mceListBoxSelected .mceOpen,.wp_themeSkin table.mceListBoxEnabled .mceOpen{background-image:url('../images/down_arrow-2x.gif');background-size:10px 20px}.wp_themeSkin .mceSplitButtonEnabled a.mceOpen,.wp_themeSkin .mceSplitButtonSelected a.mceOpen,.wp_themeSkin .mceSplitButtonActive a.mceOpen,.wp_themeSkin .mceSplitButtonEnabled:hover a.mceOpen{background-image:url('../images/down_arrow-2x.gif');background-size:10px 20px}#wp-link .toggle-arrow{background:transparent url('../images/toggle-arrow-2x.png') top left no-repeat;background-size:19px 69px}}
\ No newline at end of file
+.wp_themeSkin table,.wp_themeSkin tbody,.wp_themeSkin a,.wp_themeSkin img,.wp_themeSkin tr,.wp_themeSkin div,.wp_themeSkin td,.wp_themeSkin iframe,.wp_themeSkin span,.wp_themeSkin *,.wp_themeSkin .mceText{border:0;margin:0;padding:0;white-space:nowrap;text-decoration:none;font-weight:normal;cursor:default;vertical-align:baseline;width:auto;border-collapse:separate}.wp_themeSkin a:hover,.wp_themeSkin a:link,.wp_themeSkin a:visited,.wp_themeSkin a:active{text-decoration:none;font-weight:normal;cursor:default}.wp_themeSkin table td{vertical-align:middle}.wp_themeSkin *,.wp_themeSkin a:hover,.wp_themeSkin a:link,.wp_themeSkin a:visited,.wp_themeSkin a:active{color:#555}.wp_themeSkin iframe{display:block}.wp_themeSkin #mce_fullscreen_ifr{background-color:#fff}.wp_themeSkin .mceToolbar{padding:1px}.wp_themeSkin .mceExternalToolbar{position:absolute;border-bottom:0;display:none}.wp_themeSkin .mceExternalToolbar td.mceToolbar{padding-right:13px}.wp_themeSkin .mceExternalClose{position:absolute;top:3px;right:3px;width:7px;height:7px;background:url("../js/tinymce/themes/advanced/img/icons.gif") -820px 0}.wp_themeSkin table.mceToolbar,.wp_themeSkin tr.mceFirst .mceToolbar tr td,.wp_themeSkin tr.mceLast .mceToolbar tr td{border:0;margin:0;padding:0}.wp_themeSkin table.mceLayout{border:0}.wp_themeSkin .mceStatusbar{display:block;font-family:sans-serif;font-size:12px;line-height:16px;padding:0 0 0 8px;overflow:visible;height:20px;border-top:1px solid #dfdfdf;color:#000;background-color:#f5f5f5}.rtl .wp_themeSkin .mceStatusbar{padding:0 8px 0 0}.wp_themeSkin .mceStatusbar *{color:#555}.wp_themeSkin .mceStatusbar div{float:left;padding:2px}.rtl .wp_themeSkin .mceStatusbar div{float:right}.wp_themeSkin .mceStatusbar a.mceResize{display:block;float:right;background:url("../js/tinymce/themes/advanced/img/icons.gif") -800px 0;width:20px;height:20px;cursor:se-resize}.rtl .wp_themeSkin .mceStatusbar a.mceResize{float:left}.wp_themeSkin .mceStatusbar a:hover{text-decoration:underline}.wp_themeSkin table.mceToolbar{margin:0 6px 2px}.wp_themeSkin table.mceToolbar :active,.wp_themeSkin table.mceToolbar :focus,.wp_themeSkin table.mceToolbar:focus,.wp_themeSkin span.mceSeparator:focus{outline:0}.wp_themeSkin #content_toolbar1{margin-top:2px}.wp_themeSkin .mceToolbar .mceToolbarEndListBox span{display:none}.wp_themeSkin span.mceIcon,.wp_themeSkin img.mceIcon{display:block;width:20px;height:20px}.wp_themeSkin .mceIcon{background:url("../js/tinymce/themes/advanced/img/icons.gif") no-repeat 20px 20px}.wp_themeSkin .mceButton{display:block;width:20px;height:20px;cursor:default;padding:1px 2px;margin:1px;-webkit-border-radius:2px;border-radius:2px}.wp_themeSkin a.mceButtonEnabled:hover{background-image:inherit 0 -10px}.wp_themeSkin .mceOldBoxModel a.mceButton span,.wp_themeSkin .mceOldBoxModel a.mceButton img{margin:0 0 0 1px}.wp_themeSkin .mceButtonDisabled .mceIcon{opacity:.2;filter:alpha(opacity=20)}.wp_themeSkin .mceSeparator{display:none}.wp_themeSkin .mceListBox,.wp_themeSkin .mceListBox a{display:block}.wp_themeSkin .mceListBox .mceText{padding:1px 4px 1px 5px;width:70px;text-align:left;text-decoration:none;-webkit-border-bottom-left-radius:2px;-webkit-border-top-left-radius:2px;border-bottom-left-radius:2px;border-top-left-radius:2px;font-family:sans-serif;font-size:12px;height:20px;line-height:20px;overflow:hidden}.wp_themeSkin .mceListBox{margin:1px;direction:ltr;background-color:#fff;border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 1px -1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px -1px rgba(0,0,0,.2)}.wp_themeSkin .mceListBox .mceOpen{width:12px;height:20px;border-collapse:separate;padding:1px;-webkit-border-bottom-left-radius:0;-webkit-border-top-left-radius:0;border-bottom-left-radius:0;border-top-left-radius:0}.wp_themeSkin .mceListBox .mceFirst a{border-style:solid;border-width:1px;border-bottom-right-radius:2px;border-top-right-radius:2px}.wp_themeSkin .mceListBoxMenu .mce_formatPreview{line-height:normal}.wp_themeSkin .mceListBox .mceOpen,.wp_themeSkin .mceListBoxHover .mceOpen,.wp_themeSkin .mceListBoxSelected .mceOpen,.wp_themeSkin table.mceListBoxEnabled .mceOpen{background-image:url("../images/down_arrow.gif");background-position:3px 1px;background-repeat:no-repeat}.wp_themeSkin .mceListBoxDisabled .mceText{color:gray}.wp_themeSkin .mceListBoxMenu{overflow:auto;overflow-x:hidden}.wp_themeSkin .mceOldBoxModel .mceListBox .mceText{height:22px}.wp_themeSkin select.mceListBox{font-family:sans-serif;font-size:12px;border-color:#b2b2b2;background-color:#fff}.wp_themeSkin .mceSplitButton a,.wp_themeSkin .mceSplitButton span{display:block;height:20px}.wp_themeSkin .mceSplitButton{display:block;direction:ltr}.wp_themeSkin table.mceSplitButton td{padding:2px;-webkit-border-radius:2px;border-radius:2px}.wp_themeSkin table.mceSplitButton:hover td{background-image:inherit 0 -10px}.wp_themeSkin .mceSplitButton a.mceAction{height:20px;width:20px;padding:1px 2px;border-right:0 none}.wp_themeSkin .mceSplitButton span.mceAction{background-image:url("../js/tinymce/themes/advanced/img/icons.gif");background-repeat:no-repeat;background-color:transparent;width:20px}.wp_themeSkin .mceSplitButton a.mceOpen{width:11px;height:20px;background-position:0 2px;background-repeat:no-repeat;padding:1px 0}.wp_themeSkin .mceSplitButton span.mceOpen{display:none}.wp_themeSkin .mceSplitButtonDisabled .mceAction{opacity:.3;filter:alpha(opacity=30)}.wp_themeSkin .mceListBox a.mceText,.wp_themeSkin .mceSplitButton a.mceAction{-webkit-border-bottom-left-radius:2px;-webkit-border-top-left-radius:2px;border-bottom-left-radius:2px;border-top-left-radius:2px}.wp_themeSkin .mceSplitButton a.mceOpen,.wp_themeSkin .mceListBox a.mceOpen{-webkit-border-bottom-right-radius:2px;-webkit-border-top-right-radius:2px;border-bottom-right-radius:2px;border-top-right-radius:2px}.wp_themeSkin span.mce_undo,.wp_themeSkin span.mce_redo,.wp_themeSkin span.mce_bullist,.wp_themeSkin span.mce_numlist,.wp_themeSkin span.mce_blockquote,.wp_themeSkin span.mce_charmap,.wp_themeSkin span.mce_bold,.wp_themeSkin span.mce_italic,.wp_themeSkin span.mce_underline,.wp_themeSkin span.mce_justifyleft,.wp_themeSkin span.mce_justifyright,.wp_themeSkin span.mce_justifycenter,.wp_themeSkin span.mce_justifyfull,.wp_themeSkin span.mce_indent,.wp_themeSkin span.mce_outdent,.wp_themeSkin span.mce_link,.wp_themeSkin span.mce_unlink,.wp_themeSkin span.mce_help,.wp_themeSkin span.mce_removeformat,.wp_themeSkin span.mce_fullscreen,.wp_themeSkin span.mce_wp_fullscreen,.wp_themeSkin span.mce_media,.wp_themeSkin span.mce_pastetext,.wp_themeSkin span.mce_pasteword,.wp_themeSkin span.mce_wp_help,.wp_themeSkin span.mce_wp_adv,.wp_themeSkin span.mce_wp_more,.wp_themeSkin span.mce_strikethrough,.wp_themeSkin span.mce_spellchecker,.wp_themeSkin span.mce_forecolor,.wp_themeSkin .mce_forecolorpicker,.wp_themeSkin .mceSplitButton .mce_spellchecker span.mce_spellchecker,.wp_themeSkin .mceSplitButton .mce_forecolor span.mce_forecolor,.wp_themeSkin .mceSplitButton span.mce_numlist,.wp_themeSkin .mceSplitButton span.mce_bullist{background-image:url('../images/wpicons.png?ver=20120720')}.wp_themeSkin div.mceColorSplitMenu table{background-color:#ebebeb;border-color:#bbb}.wp_themeSkin .mceColorSplitMenu td{padding:2px}.wp_themeSkin .mceColorSplitMenu a{display:block;width:9px;height:9px;overflow:hidden;border-color:#b2b2b2}.wp_themeSkin .mceColorSplitMenu td.mceMoreColors{padding:1px 3px 1px 1px}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors{width:100%;height:auto;text-align:center;font-family:Tahoma,Verdana,Arial,Helvetica;font-size:11px;line-height:20px;border-color:#fff}.wp_themeSkin .mceColorPreview{margin:-5px 0 0 2px;width:16px;height:4px;overflow:hidden}.wp_themeSkin .mceMenu{position:absolute;left:0;top:0;z-index:1000;border-color:#ddd;direction:ltr}.wp_themeSkin .mceNoIcons span.mceIcon{width:0}.wp_themeSkin .mceNoIcons a .mceText{padding-left:10px}.wp_themeSkin .mceMenu table{background-color:#ebeaeb}.wp_themeSkin .mceMenu a,.wp_themeSkin .mceMenu span,.wp_themeSkin .mceMenu{display:block}.wp_themeSkin .mceMenu td{height:20px;overflow:hidden}.wp_themeSkin .mceMenu a{position:relative;padding:3px 0 4px 0;text-decoration:none!important}.wp_themeSkin .mceMenu .mceText{position:relative;display:block;font-family:Tahoma,Verdana,Arial,Helvetica;cursor:default;margin:0;padding:0 25px;color:#000}.wp_themeSkin .mceMenu span.mceText,.wp_themeSkin .mceMenu .mcePreview{font-size:12px}.wp_themeSkin .mceMenu pre.mceText{font-family:Monospace}.wp_themeSkin .mceMenu .mceIcon{position:absolute;top:0;left:0;width:22px}.wp_themeSkin .mceMenu .mceMenuItemEnabled a:hover,.wp_themeSkin .mceMenu .mceMenuItemActive{background-color:#f5f5f5}.wp_themeSkin td.mceMenuItemSeparator{height:1px;background-color:#aaa}.wp_themeSkin .mceMenuItemTitle a{border-top:0;border-right:0;border-left:0;border-bottom:1px solid #aaa;text-decoration:none!important;background-color:#ccc}.wp_themeSkin .mceMenuItemTitle span.mceText{font-weight:bold;padding-left:4px;color:#000}.wp_themeSkin .mceMenuItemSelected .mceIcon{background:url("../js/tinymce/themes/advanced/skins/default/img/menu_check.gif");color:#888}.wp_themeSkin .mceNoIcons .mceMenuItemSelected a{background:url("../js/tinymce/themes/advanced/skins/default/img/menu_arrow.gif") no-repeat -6px center}.wp_themeSkin .mceMenu span.mceMenuLine{display:none}.wp_themeSkin .mceMenuItemSub a{background:url("../js/tinymce/themes/advanced/skins/default/img/menu_arrow.gif") no-repeat top right}.wp_themeSkin .mceBlocker{position:absolute;left:0;top:0;z-index:1000;opacity:.5;filter:alpha(opacity=50);background:#FFF}.wp_themeSkin .mceProgress{position:absolute;left:0;top:0;z-index:1001;background:url("../js/tinymce/themes/advanced/skins/default/img/progress.gif") no-repeat;width:32px;height:32px;margin:-16px 0 0 -16px}.wp_themeSkin .mcePlaceHolder{border:1px dotted gray}.mceRtl .mceListBox .mceText{text-align:right;padding:0 4px 0 0}.mceRtl .mceMenuItem .mceText{text-align:right}.wp_themeSkin .mce_address span.mceText{font-style:italic}.wp_themeSkin .mce_pre span.mceText{font-family:monospace}.wp_themeSkin .mce_h1 span.mceText{font-weight:bolder;font-size:18px}.wp_themeSkin .mce_h2 span.mceText{font-weight:bolder;font-size:16px}.wp_themeSkin .mce_h3 span.mceText{font-weight:bolder;font-size:14px}.wp_themeSkin .mce_h4 span.mceText{font-weight:bolder;font-size:12px}.wp_themeSkin .mce_h5 span.mceText{font-weight:bolder;font-size:11px}.wp_themeSkin .mce_h6 span.mceText{font-weight:bolder;font-size:10px}.wp_themeSkin span.mce_undo{background-position:-500px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_undo,.wp_themeSkin .mceButtonActive span.mce_undo{background-position:-500px 0}.wp_themeSkin span.mce_redo{background-position:-480px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_redo,.wp_themeSkin .mceButtonActive span.mce_redo{background-position:-480px 0}.wp_themeSkin span.mce_bullist{background-position:-40px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_bullist,.wp_themeSkin .mceButtonActive span.mce_bullist,.wp_themeSkin .mceSplitButton:hover span.mce_bullist{background-position:-40px 0}.wp_themeSkin span.mce_numlist{background-position:-60px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_numlist,.wp_themeSkin .mceButtonActive span.mce_numlist,.wp_themeSkin .mceSplitButton:hover span.mce_numlist{background-position:-60px 0}.wp_themeSkin span.mce_blockquote{background-position:-80px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_blockquote,.wp_themeSkin .mceButtonActive span.mce_blockquote{background-position:-80px 0}.wp_themeSkin span.mce_charmap{background-position:-420px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_charmap,.wp_themeSkin .mceButtonActive span.mce_charmap{background-position:-420px 0}.wp_themeSkin span.mce_bold{background-position:0 -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_bold,.wp_themeSkin .mceButtonActive span.mce_bold{background-position:0 0}.wp_themeSkin span.mce_italic{background-position:-20px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_italic,.wp_themeSkin .mceButtonActive span.mce_italic{background-position:-20px 0}.wp_themeSkin span.mce_underline{background-position:-280px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_underline,.wp_themeSkin .mceButtonActive span.mce_underline{background-position:-280px 0}.wp_themeSkin span.mce_justifyleft{background-position:-100px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_justifyleft,.wp_themeSkin .mceButtonActive span.mce_justifyleft{background-position:-100px 0}.wp_themeSkin span.mce_justifyright{background-position:-140px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_justifyright,.wp_themeSkin .mceButtonActive span.mce_justifyright{background-position:-140px 0}.wp_themeSkin span.mce_justifycenter{background-position:-120px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_justifycenter,.wp_themeSkin .mceButtonActive span.mce_justifycenter{background-position:-120px 0}.wp_themeSkin span.mce_justifyfull{background-position:-300px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_justifyfull,.wp_themeSkin .mceButtonActive span.mce_justifyfull{background-position:-300px 0}.wp_themeSkin span.mce_indent{background-position:-460px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_indent,.wp_themeSkin .mceButtonActive span.mce_indent{background-position:-460px 0}.wp_themeSkin span.mce_outdent{background-position:-440px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_outdent,.wp_themeSkin .mceButtonActive span.mce_outdent{background-position:-440px 0}.wp_themeSkin span.mce_link{background-position:-160px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_link,.wp_themeSkin .mceButtonActive span.mce_link{background-position:-160px 0}.wp_themeSkin span.mce_unlink{background-position:-180px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_unlink,.wp_themeSkin .mceButtonActive span.mce_unlink{background-position:-180px 0}.wp_themeSkin span.mce_help{background-position:-520px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_help,.wp_themeSkin .mceButtonActive span.mce_help{background-position:-520px 0}.wp_themeSkin span.mce_removeformat{background-position:-380px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_removeformat,.wp_themeSkin .mceButtonActive span.mce_removeformat{background-position:-380px 0}.wp_themeSkin span.mce_strikethrough{background-position:-540px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_strikethrough,.wp_themeSkin .mceButtonActive span.mce_strikethrough{background-position:-540px 0}.wp_themeSkin .mceSplitButton .mce_forecolor span.mce_forecolor{background-position:-320px -20px}.wp_themeSkin .mceSplitButtonEnabled:hover span.mce_forecolor,.wp_themeSkin .mceSplitButtonSelected span.mce_forecolor{background-position:-320px 0}.wp_themeSkin .mce_forecolorpicker{background-position:-320px -20px}.wp_themeSkin span.mce_fullscreen{background-position:-240px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_fullscreen,.wp_themeSkin .mceButtonActive span.mce_fullscreen{background-position:-240px 0}.wp_themeSkin span.mce_wp_fullscreen{background-position:-240px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_wp_fullscreen,.wp_themeSkin .mceButtonActive span.mce_wp_fullscreen{background-position:-240px 0}.wp_themeSkin span.mce_media{background-position:-400px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_media,.wp_themeSkin .mceButtonActive span.mce_media{background-position:-400px 0}.wp_themeSkin span.mce_pastetext{background-position:-340px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_pastetext,.wp_themeSkin .mceButtonActive span.mce_pastetext{background-position:-340px 0}.wp_themeSkin span.mce_pasteword{background-position:-360px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_pasteword,.wp_themeSkin .mceButtonActive span.mce_pasteword{background-position:-360px 0}.wp_themeSkin span.mce_spellchecker{background-position:-220px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_spellchecker,.wp_themeSkin .mceSplitButtonEnabled:hover span.mce_spellchecker,.wp_themeSkin .mceButtonActive span.mce_spellchecker,.wp_themeSkin .mceSplitButtonSelected span.mce_spellchecker{background-position:-220px 0}.wp_themeSkin span.mce_wp_help{background-position:-520px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_wp_help,.wp_themeSkin .mceButtonActive span.mce_wp_help{background-position:-520px 0}.wp_themeSkin span.mce_wp_adv{background-position:-260px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_wp_adv,.wp_themeSkin .mceButtonActive span.mce_wp_adv{background-position:-260px 0}.wp_themeSkin span.mce_wp_more{background-position:-200px -20px}.wp_themeSkin .mceButtonEnabled:hover span.mce_wp_more,.wp_themeSkin .mceButtonActive span.mce_wp_more{background-position:-200px 0}.wp_themeSkin span.mce_cleanup{background-position:-380px -20px}.wp_themeSkin span.mce_anchor{background-position:-200px 0}.wp_themeSkin span.mce_sub{background-position:-600px 0}.wp_themeSkin span.mce_sup{background-position:-620px 0}.wp_themeSkin span.mce_newdocument{background-position:-520px 0}.wp_themeSkin span.mce_image{background-position:-380px 0}.wp_themeSkin span.mce_code{background-position:-260px 0}.wp_themeSkin span.mce_hr{background-position:-360px 0}.wp_themeSkin span.mce_visualaid{background-position:-660px 0}.wp_themeSkin span.mce_paste{background-position:-560px 0}.wp_themeSkin span.mce_copy{background-position:-700px 0}.wp_themeSkin span.mce_cut{background-position:-680px 0}.wp_themeSkin .mce_backcolor span.mceAction{background-position:-760px 0}.wp_themeSkin .mce_backcolorpicker{background-position:-760px 0}.wp_themeSkin span.mce_advhr{background-position:-0px -20px}.wp_themeSkin span.mce_ltr{background-position:-20px -20px}.wp_themeSkin span.mce_rtl{background-position:-40px -20px}.wp_themeSkin span.mce_emotions{background-position:-60px -20px}.wp_themeSkin span.mce_fullpage{background-position:-80px -20px}.wp_themeSkin span.mce_iespell{background-position:-120px -20px}.wp_themeSkin span.mce_insertdate{background-position:-140px -20px}.wp_themeSkin span.mce_inserttime{background-position:-160px -20px}.wp_themeSkin span.mce_absolute{background-position:-180px -20px}.wp_themeSkin span.mce_backward{background-position:-200px -20px}.wp_themeSkin span.mce_forward{background-position:-220px -20px}.wp_themeSkin span.mce_insert_layer{background-position:-240px -20px}.wp_themeSkin span.mce_insertlayer{background-position:-260px -20px}.wp_themeSkin span.mce_movebackward{background-position:-280px -20px}.wp_themeSkin span.mce_moveforward{background-position:-300px -20px}.wp_themeSkin span.mce_nonbreaking{background-position:-340px -20px}.wp_themeSkin span.mce_selectall{background-position:-400px -20px}.wp_themeSkin span.mce_preview{background-position:-420px -20px}.wp_themeSkin span.mce_print{background-position:-440px -20px}.wp_themeSkin span.mce_cancel{background-position:-460px -20px}.wp_themeSkin span.mce_save{background-position:-480px -20px}.wp_themeSkin span.mce_replace{background-position:-500px -20px}.wp_themeSkin span.mce_search{background-position:-520px -20px}.wp_themeSkin span.mce_styleprops{background-position:-560px -20px}.wp_themeSkin span.mce_table{background-position:-580px -20px}.wp_themeSkin span.mce_cell_props{background-position:-600px -20px}.wp_themeSkin span.mce_delete_table{background-position:-620px -20px}.wp_themeSkin span.mce_delete_col{background-position:-640px -20px}.wp_themeSkin span.mce_delete_row{background-position:-660px -20px}.wp_themeSkin span.mce_col_after{background-position:-680px -20px}.wp_themeSkin span.mce_col_before{background-position:-700px -20px}.wp_themeSkin span.mce_row_after{background-position:-720px -20px}.wp_themeSkin span.mce_row_before{background-position:-740px -20px}.wp_themeSkin span.mce_merge_cells{background-position:-760px -20px}.wp_themeSkin span.mce_table_props{background-position:-980px -20px}.wp_themeSkin span.mce_row_props{background-position:-780px -20px}.wp_themeSkin span.mce_split_cells{background-position:-800px -20px}.wp_themeSkin span.mce_template{background-position:-820px -20px}.wp_themeSkin span.mce_visualchars{background-position:-840px -20px}.wp_themeSkin span.mce_abbr{background-position:-860px -20px}.wp_themeSkin span.mce_acronym{background-position:-880px -20px}.wp_themeSkin span.mce_attribs{background-position:-900px -20px}.wp_themeSkin span.mce_cite{background-position:-920px -20px}.wp_themeSkin span.mce_del{background-position:-940px -20px}.wp_themeSkin span.mce_ins{background-position:-960px -20px}.wp_themeSkin span.mce_pagebreak{background-position:0 -40px}.wp_themeSkin span.mce_restoredraft{background-position:-20px -40px}.wp_themeSkin span.mce_visualblocks{background-position:-40px -40px}.wp_themeSkin .mceExternalToolbar,.wp_themeSkin .mceButton,.wp_themeSkin a.mceButtonEnabled:hover,.wp_themeSkin a.mceButtonActive,.wp_themeSkin a.mceButtonSelected,.wp_themeSkin .mceListBox .mceText,.wp_themeSkin .mceListBox .mceOpen,.wp_themeSkin select.mceListBox,.wp_themeSkin .mceSplitButton a.mceAction,.wp_themeSkin .mceSplitButton a.mceOpen,.wp_themeSkin .mceSplitButton a.mceOpen:hover,.wp_themeSkin .mceSplitButtonSelected a.mceOpen,.wp_themeSkin table.mceSplitButtonEnabled:hover a.mceAction,.wp_themeSkin .mceSplitButton a.mceAction:hover,.wp_themeSkin div.mceColorSplitMenu table,.wp_themeSkin .mceColorSplitMenu a,.wp_themeSkin .mceColorSplitMenu a.mceMoreColors,.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover,.wp_themeSkin a.mceMoreColors:hover,.wp_themeSkin .mceMenu{border-style:solid;border-width:1px}.wp_themeSkin .mceListBox .mceText{border-right:0 none}.wp_themeSkin iframe{background:transparent}.wp_themeSkin .mceButton{border-color:transparent}.wp_themeSkin .mceListBox .mceText,.wp_themeSkin .mceListBox .mceOpen{border-color:transparent}.wp_themeSkin a.mceButtonEnabled:hover,.wp_themeSkin table.mceSplitButton:hover{border-color:#bbb;background:#eee;background-image:-webkit-gradient(linear,left bottom,left top,from(#e5e5e5),to(#fff));background-image:-webkit-linear-gradient(bottom,#e5e5e5,#fff);background-image:-moz-linear-gradient(bottom,#e5e5e5,#fff);background-image:-o-linear-gradient(bottom,#e5e5e5,#fff);background-image:linear-gradient(to top,#e5e5e5,#fff)}.wp_themeSkin a.mceButton:active,.wp_themeSkin a.mceButtonEnabled:active,.wp_themeSkin a.mceButtonSelected:active,.wp_themeSkin a.mceButtonActive,.wp_themeSkin a.mceButtonActive:active,.wp_themeSkin a.mceButtonActive:hover,.wp_themeSkin .mceSplitButtonSelected table,.wp_themeSkin .mceSplitButtonSelected table:hover{outline:0;border-color:#999 #ccc #ccc #999;background:#eee;background-image:-webkit-gradient(linear,left bottom,left top,from(#f6f6f6),to(#e3e3e3));background-image:-webkit-linear-gradient(bottom,#f6f6f6,#e3e3e3);background-image:-moz-linear-gradient(bottom,#f6f6f6,#e3e3e3);background-image:-o-linear-gradient(bottom,#f6f6f6,#e3e3e3);background-image:linear-gradient(to top,#f6f6f6,#e3e3e3)}.wp_themeSkin .mceSplitButtonSelected table a.mceOpen,.wp_themeSkin .mceSplitButtonSelected table a.mceAction{border-color:#999 #ccc #ccc #999}.wp_themeSkin .mceButtonDisabled{border-color:transparent}.wp_themeSkin .mceListBox .mceOpen{border-left:0}.wp_themeSkin .mceListBoxEnabled:hover,.wp_themeSkin .mceListBoxEnabled:active,.wp_themeSkin .mceListBoxHover,.wp_themeSkin .mceListBoxHover:active,.wp_themeSkin .mceListBoxSelected{-webkit-box-shadow:inset 0 1px 1px -1px rgba(0,0,0,.3);box-shadow:inset 0 1px 1px -1px rgba(0,0,0,.3);border-color:#bbb}.wp_themeSkin .mceSplitButton .mceLast span.mceOpen .mceIconOnly{display:block}.wp_themeSkin .mceSplitButton a.mceAction,.wp_themeSkin .mceSplitButton a.mceOpen{border-color:transparent}.wp_themeSkin .mceSplitButton:hover a{border-color:#bbb}.wp_themeSkin .mceSplitButtonEnabled a.mceOpen,.wp_themeSkin .mceSplitButtonSelected a.mceOpen,.wp_themeSkin .mceSplitButtonActive a.mceOpen,.wp_themeSkin .mceSplitButtonEnabled:hover a.mceOpen{background-image:url("../images/down_arrow.gif");background-position:1px 2px;background-repeat:no-repeat;border-left:0}.wp_themeSkin .mceSplitButtonActive td{-webkit-border-radius:3px;border-radius:3px}.wp_themeSkin .mceColorSplitMenu a.mceMoreColors:hover{border-color:#0a246a;background-color:#b6bdd2}.wp_themeSkin a.mceMoreColors:hover{border-color:#0a246a}.wp_themeSkin .mceMenuItemDisabled .mceText{color:#888}#mceModalBlocker{background:#000}.wp-editor-wrap{position:relative}.wp-editor-area{font-family:Consolas,Monaco,monospace;padding:10px;margin:1px 0 0;line-height:150%;border:0 none;outline:0;display:block;resize:vertical;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.wp-editor-tools{height:30px;padding:0 10px 0 0}.rtl .wp-editor-tools{padding:0 0 0 10px}.wp-editor-container{border-width:1px;border-style:solid;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px;border-color:#ccc #ccc #dfdfdf}.wp-editor-container textarea.wp-editor-area{width:100%;margin:0;-webkit-box-shadow:none;box-shadow:none}.quicktags-toolbar,.wp_themeSkin tr.mceFirst td.mceToolbar{border-bottom:1px solid #d1d1d1;background:#eee;background-image:-webkit-gradient(linear,left bottom,left top,from(#e5e5e5),to(#f4f4f4));background-image:-webkit-linear-gradient(bottom,#e5e5e5,#f4f4f4);background-image:-moz-linear-gradient(bottom,#e5e5e5,#f4f4f4);background-image:-o-linear-gradient(bottom,#e5e5e5,#f4f4f4);background-image:linear-gradient(to top,#e5e5e5,#f4f4f4)}.wp-switch-editor{height:18px;font:13px/18px Arial,Helvetica,sans-serif normal;margin:5px 5px 0 0;padding:4px 5px 2px;float:right;cursor:pointer;border-width:1px;border-style:solid;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px;background-color:#f1f1f1;border-color:#dfdfdf #dfdfdf #ccc;color:#999}html[dir="rtl"] .wp-switch-editor{float:left}.wp-switch-editor:active{background-color:#f1f1f1}.wp-switch-editor:hover{text-decoration:none!important}.js .tmce-active .wp-editor-area{color:white}.tmce-active .quicktags-toolbar{display:none}.tmce-active .switch-tmce,.html-active .switch-html{border-color:#ccc #ccc #f4f4f4;background-color:#f4f4f4;color:#555}.wp-media-buttons .button{margin-right:5px}.rtl .wp-media-buttons .button{margin-right:0;margin-left:5px}.wp-media-buttons .insert-media{padding-left:.4em}.rtl .wp-media-buttons .insert-media{padding-left:10px;padding-right:.4em}.wp-media-buttons a{text-decoration:none;color:#464646;font-size:12px}.wp-media-buttons img{padding:0 4px;vertical-align:middle}.wp-media-buttons span.wp-media-buttons-icon{display:inline-block;width:16px;height:16px;vertical-align:text-top;margin:0 2px}.wp-media-buttons .add_media span.wp-media-buttons-icon{background:url('../../wp-admin/images/media-button.png') no-repeat top left}.quicktags-toolbar{border-bottom-style:solid;border-bottom-width:1px;-webkit-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;border-top-right-radius:3px;border-top-left-radius:3px;padding:2px 8px 0;min-height:29px}.quicktags-toolbar>div{padding:2px 4px 0}.quicktags-toolbar input{margin:2px 1px 4px;line-height:18px;display:inline-block;min-width:26px;padding:2px 4px;font:12px/18px Arial,Helvetica,sans-serif normal;color:#464646;border:1px solid #c3c3c3;-webkit-border-radius:3px;border-radius:3px;background:#eee;background-image:-webkit-gradient(linear,left bottom,left top,from(#e3e3e3),to(#fff));background-image:-webkit-linear-gradient(bottom,#e3e3e3,#fff);background-image:-moz-linear-gradient(bottom,#e3e3e3,#fff);background-image:-o-linear-gradient(bottom,#e3e3e3,#fff);background-image:linear-gradient(to top,#e3e3e3,#fff)}.quicktags-toolbar input:hover{border-color:#aaa;background:#ddd}.quicktags-toolbar input[value="link"]{text-decoration:underline}.quicktags-toolbar input[value="del"]{text-decoration:line-through}.quicktags-toolbar input[value="i"]{font-style:italic}.quicktags-toolbar input[value="b"]{font-weight:bold}#wp_editbtns,#wp_gallerybtns{padding:2px;position:absolute;display:none;z-index:155000}#wp_editimgbtn,#wp_delimgbtn,#wp_editgallery,#wp_delgallery{border-color:#999;background-color:#eee;margin:2px;padding:2px;border-width:1px;border-style:solid;-webkit-border-radius:3px;border-radius:3px}#wp_editimgbtn:hover,#wp_delimgbtn:hover,#wp_editgallery:hover,#wp_delgallery:hover{border-color:#555;background-color:#ccc}#wp-link{background-color:#f5f5f5;line-height:1.4em;font-size:12px}#wp-link ol,#wp-link ul{list-style:none;margin:0;padding:0}#wp-link input[type="text"]{-webkit-box-sizing:border-box}#wp-link input[type="text"],#wp-link textarea{border-width:1px;border-style:solid;-webkit-border-radius:4px;border-radius:4px;font-size:12px;margin:1px;padding:3px}#wp-link #link-options{padding:10px 0 14px;border-bottom:1px solid #dfdfdf;margin:0 6px 14px}#wp-link p.howto{margin:3px}#wp-link #internal-toggle{display:inline-block;cursor:pointer;padding-left:18px}#wp-link .toggle-arrow{background:transparent url('../images/toggle-arrow.png') top left no-repeat;height:23px;line-height:23px}#wp-link .toggle-arrow-active{background-position:center left}#wp-link label input[type="text"]{width:360px;margin-top:5px}#wp-link #link-options label span,#wp-link #search-panel label span.search-label{display:inline-block;width:80px;text-align:right;padding-right:5px}#wp-link .link-search-field{float:left;width:220px}#wp-link .link-search-wrapper{margin:5px 6px 9px;display:block;overflow:hidden}#wp-link .link-search-wrapper span{float:left;margin-top:4px}#wp-link .link-search-wrapper .spinner{display:none;vertical-align:text-bottom}#wp-link .link-target{width:auto;padding:3px 0 0;margin:0 0 0 87px;font-size:11px}#wp-link .query-results{border:1px #dfdfdf solid;margin:0 5px 5px;background:#fff;height:185px;overflow:auto;position:relative}#wp-link li,#wp-link .query-notice{clear:both;margin-bottom:0;border-bottom:1px solid #f1f1f1;color:#333;padding:4px 6px;cursor:pointer;position:relative}#wp-link li:hover{background:#eaf2fa;color:#151515}#wp-link li.unselectable{border-bottom:1px solid #dfdfdf}#wp-link li.unselectable:hover{background:#fff;cursor:auto;color:#333}#wp-link li.selected{background:#ddd;color:#333}#wp-link li.selected .item-title{font-weight:bold}#wp-link .item-title{display:inline-block;width:80%}#wp-link .item-info{text-transform:uppercase;color:#666;font-size:11px;position:absolute;right:5px;top:4px;bottom:0}#wp-link #search-results{display:none}#wp-link #search-panel{float:left;width:100%}#wp-link .river-waiting{display:none;padding:10px 0}#wp-link .river-waiting .spinner{margin:0 auto;display:block}#wp-link .submitbox{padding:5px 10px;font-size:11px;overflow:auto;height:29px}#wp-link-cancel{line-height:25px;float:left}#wp-link-update{line-height:23px;float:right}/*!
+ * jQuery UI CSS Framework 1.10.1
+ * http://jqueryui.com
+ *
+ * Copyright 2013 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Theming/API
+ */.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}/*!
+ * jQuery UI Resizable 1.10.1
+ * http://jqueryui.com
+ *
+ * Copyright 2013 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Resizable#theming
+ */.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}/*!
+ * jQuery UI Dialog 1.10.1
+ * http://jqueryui.com
+ *
+ * Copyright 2013 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Dialog#theming
+ */.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:21px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.wp-dialog{padding:0;z-index:300002;border:1px solid #999;-webkit-box-shadow:0 0 16px rgba(0,0,0,0.3);box-shadow:0 0 16px rgba(0,0,0,0.3);background-color:#f5f5f5;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px}.wp-dialog .ui-dialog-title{display:block;text-align:center;padding:1px 0 2px}.wp-dialog .ui-dialog-titlebar{padding:0 1em;background-color:#444;font-weight:bold;font-size:11px;line-height:18px;color:#e5e5e5;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.wp-dialog .ui-dialog-content{padding:0}.wp-dialog .ui-dialog-titlebar-close{cursor:pointer;-webkit-appearance:none;border:0;width:29px;height:16px;top:13px;right:6px;background:url('../js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif') no-repeat -87px -16px}.wp-dialog .ui-dialog-titlebar-close .ui-button-text{display:none}.wp-dialog .ui-dialog-titlebar-close:hover,.wp-dialog .ui-dialog-titlebar-close:focus{background-position:-87px -32px}.ui-widget-overlay{z-index:300001;background-color:#000;opacity:.6;filter:alpha(opacity=60)}.rtl .wp-dialog .ui-dialog-titlebar-close{right:auto;left:6px}.rtl #wp-link #internal-toggle{padding-right:18px;padding-left:0}.rtl #wp-link #link-options label span,.rtl #wp-link #search-panel label span.search-label{text-align:left;padding-right:0;padding-left:5px}.rtl #wp-link #link-options label #url-field{direction:ltr}.rtl #wp-link .link-search-field,.rtl #wp-link .link-search-wrapper span{float:right}.rtl #wp-link .link-target{margin-right:87px;margin-left:0}.rtl #wp-link .item-info{left:5px;right:auto;top:4px;bottom:0}.rtl #wp-link #search-panel{float:right}.rtl #wp-link-cancel{float:right}.rtl #wp-link-update{float:left}.rtl #wp-link .toggle-arrow{background-position:top right}.rtl #wp-link .toggle-arrow-active{background-position:center right}.rtl .wp_themeSkin .mceListBox .mceText{text-align:right}.rtl .wp_themeSkin .mceNoIcons a .mceText{padding-right:10px;padding-left:25px}.rtl .mceListBoxMenu.mceNoIcons{direction:rtl}.clearlooks2 .mceFocus .mceTop .mceLeft{background:#444;border-left:1px solid #999;border-top:1px solid #999;-webkit-border-top-left-radius:3px;border-top-left-radius:3px}.clearlooks2 .mceFocus .mceTop .mceRight{background:#444;border-right:1px solid #999;border-top:1px solid #999;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.clearlooks2 .mceMiddle .mceLeft{background:#f1f1f1;border-left:1px solid #999}.clearlooks2 .mceMiddle .mceRight{background:#f1f1f1;border-right:1px solid #999}.clearlooks2 .mceBottom{background:#f1f1f1;border-bottom:1px solid #999}.clearlooks2 .mceBottom .mceLeft{background:#f1f1f1;border-bottom:1px solid #999;border-left:1px solid #999}.clearlooks2 .mceBottom .mceCenter{background:#f1f1f1;border-bottom:1px solid #999}.clearlooks2 .mceBottom .mceRight{background:#f1f1f1;border-bottom:1px solid #999;border-right:1px solid #999}.clearlooks2 .mceFocus .mceTop span{color:#e5e5e5}.fullscreen-overlay{z-index:149999;display:none;position:fixed;top:0;bottom:0;left:0;right:0;filter:inherit}.fullscreen-active .fullscreen-overlay,.fullscreen-active #wp-fullscreen-body{display:block}.fullscreen-fader{z-index:200000}.fullscreen-active .fullscreen-fader{display:none}#wp-fullscreen-body{width:100%;z-index:150005;display:none;position:absolute;top:0;left:0;font-size:12px}#wp-fullscreen-wrap{margin:0 auto 50px;position:relative;padding-top:60px}#wp-fullscreen-title{font-size:1.7em;line-height:100%;outline:medium none;padding:6px 7px;width:100%;margin-bottom:30px;-webkit-box-shadow:none;box-shadow:none}#wp-fullscreen-container{padding:4px 10px 50px}#wp-fullscreen-title,#wp-fullscreen-container{-webkit-border-radius:0;border-radius:0;border:1px dashed transparent;background:transparent;-moz-transition-property:border-color;-moz-transition-duration:.6s;-webkit-transition-property:border-color;-webkit-transition-duration:.6s;-o-transition-property:border-color;-o-transition-duration:.6s;transition-property:border-color;transition-duration:.6s}#wp_mce_fullscreen{width:100%;min-height:300px;border:0;background:transparent;font-family:Consolas,Monaco,monospace;line-height:1.6em;padding:0;overflow-y:hidden;outline:0;resize:none;-webkit-box-shadow:none;box-shadow:none}#wp-fullscreen-tagline{color:#bbb;font-size:18px;float:right;padding-top:5px}#fullscreen-topbar{position:fixed;top:0;left:0;z-index:150050;border-bottom-style:solid;border-bottom-width:1px;min-width:800px;width:100%;height:40px}#wp-fullscreen-toolbar{padding:6px 10px 0;clear:both;max-width:1100px;min-width:820px;margin:0 auto}#wp-fullscreen-mode-bar,#wp-fullscreen-button-bar,#wp-fullscreen-close,#wp-fullscreen-count{float:left}#wp-fullscreen-save{float:right;padding:2px 2px 0 5px}#wp-fullscreen-count,#wp-fullscreen-close{padding-top:5px}#wp-fullscreen-central-toolbar{margin:auto;padding:0}#wp-fullscreen-buttons>div{float:left}#wp-fullscreen-mode-bar{padding:1px 14px 0 0}#wp-fullscreen-modes a{display:block;font-size:11px;text-decoration:none;float:left;margin:1px 0 0 0;padding:2px 6px 2px;border-width:1px 1px 1px 0;border-style:solid;border-color:#bbb;color:#777;text-shadow:0 1px 0 #fff;background-color:#f4f4f4;background:#f4f4f4;background-image:-webkit-gradient(linear,left bottom,left top,from(#e4e4e4),to(#f9f9f9));background-image:-webkit-linear-gradient(bottom,#e4e4e4,#f9f9f9);background-image:-moz-linear-gradient(bottom,#e4e4e4,#f9f9f9);background-image:-o-linear-gradient(bottom,#e4e4e4,#f9f9f9);background-image:linear-gradient(to top,#e4e4e4,#f9f9f9)}#wp-fullscreen-modes a:hover,.wp-html-mode #wp-fullscreen-modes a:last-child,.wp-tmce-mode #wp-fullscreen-modes a:first-child{color:#333;border-color:#999;background:#eee;background-image:-webkit-gradient(linear,left top,left bottom,from(#e4e4e4),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#e4e4e4,#f9f9f9);background-image:-moz-linear-gradient(top,#e4e4e4,#f9f9f9);background-image:-o-linear-gradient(top,#e4e4e4,#f9f9f9);background-image:linear-gradient(to bottom,#e4e4e4,#f9f9f9)}#wp-fullscreen-modes a:first-child{border-width:1px;-webkit-border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;border-top-left-radius:3px;border-bottom-left-radius:3px}#wp-fullscreen-modes a:last-child{-webkit-border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px}#wp-fullscreen-buttons .active a{background:inherit}#wp-fullscreen-buttons .hidden{display:none}#wp-fullscreen-buttons .disabled{opacity:.5}.wp-html-mode #wp-fullscreen-buttons div{display:none}.wp-html-mode #wp-fullscreen-buttons div.wp-fullscreen-both{display:block}#fullscreen-topbar.fullscreen-make-sticky{display:block!important}#wp-fullscreen-save img{vertical-align:middle}#wp-fullscreen-save img,#wp-fullscreen-save span{padding-right:4px;display:none}#wp-fullscreen-buttons #wp_fs_image span.mce_image{background-image:url('../../wp-admin/images/media-button.png');background-position:2px 2px}.fullscreen-active #TB_overlay{z-index:150100}.fullscreen-active #TB_window{z-index:150102}#wp_mce_fullscreen_ifr{background:transparent}#wp_mce_fullscreen_parent #wp_mce_fullscreen_tbl tr.mceFirst{display:none}#wp-fullscreen-container .wp_themeSkin table td{vertical-align:top}.fullscreen-overlay{background:#fff}.wp-fullscreen-focus #wp-fullscreen-title,.wp-fullscreen-focus #wp-fullscreen-container{border-color:#ccc}#fullscreen-topbar{border-bottom-color:#dfdfdf;background:#f1f1f1;background-image:-webkit-gradient(linear,left bottom,left top,from(#ececec),to(#f9f9f9));background-image:-webkit-linear-gradient(bottom,#ececec,#f9f9f9);background-image:-moz-linear-gradient(bottom,#ececec,#f9f9f9);background-image:-o-linear-gradient(bottom,#ececec,#f9f9f9);background-image:linear-gradient(to top,#ececec,#f9f9f9)}.fade-1000,.fade-600,.fade-400,.fade-300{opacity:0;-moz-transition-property:opacity;-webkit-transition-property:opacity;-o-transition-property:opacity;transition-property:opacity}.fade-1000{-moz-transition-duration:1s;-webkit-transition-duration:1s;-o-transition-duration:1s;transition-duration:1s}.fade-600{-moz-transition-duration:.6s;-webkit-transition-duration:.6s;-o-transition-duration:.6s;transition-duration:.6s}.fade-400{-moz-transition-duration:.4s;-webkit-transition-duration:.4s;-o-transition-duration:.4s;transition-duration:.4s}.fade-300{-moz-transition-duration:.3s;-webkit-transition-duration:.3s;-o-transition-duration:.3s;transition-duration:.3s}.fade-trigger{opacity:1}.rtl #wp-fullscreen-tagline{float:left}.rtl #fullscreen-topbar{left:auto;right:0}.rtl #wp-fullscreen-mode-bar,.rtl #wp-fullscreen-button-bar,.rtl #wp-fullscreen-close,.rtl #wp-fullscreen-count{float:right}.rtl #wp-fullscreen-save{float:left}.rtl #wp-fullscreen-save{padding:2px 5px 0 2px}.rtl #wp-fullscreen-buttons>div{float:right}.rtl #wp-fullscreen-mode-bar{padding:1px 0 0 14px}.rtl #wp-fullscreen-modes a{float:right;border-width:1px 0 1px 1px}.rtl #wp-fullscreen-modes a:first-child{-webkit-border-top-left-radius:0;-webkit-border-top-right-radius:3px;-webkit-border-bottom-left-radius:0;-webkit-border-bottom-right-radius:3px;border-width:1px;border-top-left-radius:0;border-top-right-radius:3px;border-bottom-left-radius:0;border-bottom-right-radius:3px}.rtl #wp-fullscreen-modes a:last-child{-webkit-border-top-right-radius:0;-webkit-border-top-left-radius:3px;-webkit-border-bottom-right-radius:0;-webkit-border-bottom-left-radius:3px;border-top-right-radius:0;border-top-left-radius:3px;border-bottom-right-radius:0;border-bottom-left-radius:3px}.rtl #wp-fullscreen-save img,.rtl #wp-fullscreen-save span{padding-right:0;padding-left:4px}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.wp_themeSkin span.mce_undo,.wp_themeSkin span.mce_redo,.wp_themeSkin span.mce_bullist,.wp_themeSkin span.mce_numlist,.wp_themeSkin span.mce_blockquote,.wp_themeSkin span.mce_charmap,.wp_themeSkin span.mce_bold,.wp_themeSkin span.mce_italic,.wp_themeSkin span.mce_underline,.wp_themeSkin span.mce_justifyleft,.wp_themeSkin span.mce_justifyright,.wp_themeSkin span.mce_justifycenter,.wp_themeSkin span.mce_justifyfull,.wp_themeSkin span.mce_indent,.wp_themeSkin span.mce_outdent,.wp_themeSkin span.mce_link,.wp_themeSkin span.mce_unlink,.wp_themeSkin span.mce_help,.wp_themeSkin span.mce_removeformat,.wp_themeSkin span.mce_fullscreen,.wp_themeSkin span.mce_wp_fullscreen,.wp_themeSkin span.mce_media,.wp_themeSkin span.mce_pastetext,.wp_themeSkin span.mce_pasteword,.wp_themeSkin span.mce_wp_help,.wp_themeSkin span.mce_wp_adv,.wp_themeSkin span.mce_wp_more,.wp_themeSkin span.mce_strikethrough,.wp_themeSkin span.mce_spellchecker,.wp_themeSkin span.mce_forecolor,.wp_themeSkin .mce_forecolorpicker,.wp_themeSkin .mceSplitButton .mce_spellchecker span.mce_spellchecker,.wp_themeSkin .mceSplitButton .mce_forecolor span.mce_forecolor,.wp_themeSkin .mceSplitButton span.mce_numlist,.wp_themeSkin .mceSplitButton span.mce_bullist{background-image:url('../images/wpicons-2x.png?ver=20120720');background-size:560px 40px}.wp-media-buttons .add_media span.wp-media-buttons-icon,#wp-fullscreen-buttons #wp_fs_image span.mce_image{background-image:url('../../wp-admin/images/media-button-2x.png');background-size:16px 16px}.wp_themeSkin .mceListBox .mceOpen,.wp_themeSkin .mceListBoxHover .mceOpen,.wp_themeSkin .mceListBoxSelected .mceOpen,.wp_themeSkin table.mceListBoxEnabled .mceOpen{background-image:url('../images/down_arrow-2x.gif');background-size:10px 20px}.wp_themeSkin .mceSplitButtonEnabled a.mceOpen,.wp_themeSkin .mceSplitButtonSelected a.mceOpen,.wp_themeSkin .mceSplitButtonActive a.mceOpen,.wp_themeSkin .mceSplitButtonEnabled:hover a.mceOpen{background-image:url('../images/down_arrow-2x.gif');background-size:10px 20px}#wp-link .toggle-arrow{background:transparent url('../images/toggle-arrow-2x.png') top left no-repeat;background-size:19px 69px}}
\ No newline at end of file
index a29e4f651acdbf2fc5d15fc8b1bcf06c3f1a5a12..9c75fbdfc8e9175a7070410bb5e4d66ac4e2e8a7 100644 (file)
@@ -1,8 +1,9 @@
-/*
- * jQuery UI CSS Framework @VERSION
+/*!
+ * jQuery UI CSS Framework 1.10.1
+ * http://jqueryui.com
  *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
+ * Copyright 2013 jQuery Foundation and other contributors
+ * Released under the MIT license.
  * http://jquery.org/license
  *
  * http://docs.jquery.com/UI/Theming/API
 
 /* Layout helpers
 ----------------------------------*/
-.ui-helper-hidden { display: none; }
-.ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
-.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
-.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
-.ui-helper-clearfix { display: inline-block; }
-/* required comment for clearfix to work in Opera \*/
-* html .ui-helper-clearfix { height:1%; }
-.ui-helper-clearfix { display:block; }
-/* end clearfix */
-.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
+.ui-helper-hidden {
+       display: none;
+}
+.ui-helper-hidden-accessible {
+       border: 0;
+       clip: rect(0 0 0 0);
+       height: 1px;
+       margin: -1px;
+       overflow: hidden;
+       padding: 0;
+       position: absolute;
+       width: 1px;
+}
+.ui-helper-reset {
+       margin: 0;
+       padding: 0;
+       border: 0;
+       outline: 0;
+       line-height: 1.3;
+       text-decoration: none;
+       font-size: 100%;
+       list-style: none;
+}
+.ui-helper-clearfix:before,
+.ui-helper-clearfix:after {
+       content: "";
+       display: table;
+       border-collapse: collapse;
+}
+.ui-helper-clearfix:after {
+       clear: both;
+}
+.ui-helper-clearfix {
+       min-height: 0; /* support: IE7 */
+}
+.ui-helper-zfix {
+       width: 100%;
+       height: 100%;
+       top: 0;
+       left: 0;
+       position: absolute;
+       opacity: 0;
+       filter:Alpha(Opacity=0);
+}
+
+.ui-front {
+       z-index: 100;
+}
 
 
 /* Interaction Cues
 ----------------------------------*/
-.ui-state-disabled { cursor: default !important; }
+.ui-state-disabled {
+       cursor: default !important;
+}
 
 
 /* Icons
 ----------------------------------*/
 
 /* states and images */
-.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
+.ui-icon {
+       display: block;
+       text-indent: -99999px;
+       overflow: hidden;
+       background-repeat: no-repeat;
+}
 
 
 /* Misc visuals
 ----------------------------------*/
 
 /* Overlays */
-.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
+.ui-widget-overlay {
+       position: fixed;
+       top: 0;
+       left: 0;
+       width: 100%;
+       height: 100%;
+}
 
-/*
- * jQuery UI Resizable
+
+/*!
+ * jQuery UI Resizable 1.10.1
+ * http://jqueryui.com
  *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
+ * Copyright 2013 jQuery Foundation and other contributors
+ * Released under the MIT license.
  * http://jquery.org/license
  *
  * http://docs.jquery.com/UI/Resizable#theming
  */
-.ui-resizable { position: relative;}
-.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
-.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
-.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
-.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
-.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
-.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
-.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
-.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
-.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
-.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}
-
-/*
- * jQuery UI Dialog
+.ui-resizable {
+       position: relative;
+}
+.ui-resizable-handle {
+       position: absolute;
+       font-size: 0.1px;
+       display: block;
+}
+.ui-resizable-disabled .ui-resizable-handle,
+.ui-resizable-autohide .ui-resizable-handle {
+       display: none;
+}
+.ui-resizable-n {
+       cursor: n-resize;
+       height: 7px;
+       width: 100%;
+       top: -5px;
+       left: 0;
+}
+.ui-resizable-s {
+       cursor: s-resize;
+       height: 7px;
+       width: 100%;
+       bottom: -5px;
+       left: 0;
+}
+.ui-resizable-e {
+       cursor: e-resize;
+       width: 7px;
+       right: -5px;
+       top: 0;
+       height: 100%;
+}
+.ui-resizable-w {
+       cursor: w-resize;
+       width: 7px;
+       left: -5px;
+       top: 0;
+       height: 100%;
+}
+.ui-resizable-se {
+       cursor: se-resize;
+       width: 12px;
+       height: 12px;
+       right: 1px;
+       bottom: 1px;
+}
+.ui-resizable-sw {
+       cursor: sw-resize;
+       width: 9px;
+       height: 9px;
+       left: -5px;
+       bottom: -5px;
+}
+.ui-resizable-nw {
+       cursor: nw-resize;
+       width: 9px;
+       height: 9px;
+       left: -5px;
+       top: -5px;
+}
+.ui-resizable-ne {
+       cursor: ne-resize;
+       width: 9px;
+       height: 9px;
+       right: -5px;
+       top: -5px;
+}
+
+/*!
+ * jQuery UI Dialog 1.10.1
+ * http://jqueryui.com
  *
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
+ * Copyright 2013 jQuery Foundation and other contributors
+ * Released under the MIT license.
  * http://jquery.org/license
  *
  * http://docs.jquery.com/UI/Dialog#theming
  */
-.wp-dialog { position: absolute; width: 300px; overflow: hidden; }
-.wp-dialog .ui-dialog-titlebar { position: relative; }
-.wp-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
-.wp-dialog .ui-dialog-content { position: relative; border: 0; padding: 0; background: none; overflow: auto; zoom: 1; }
-.wp-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
-.wp-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
-.wp-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
-.wp-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
-.ui-draggable .ui-dialog-titlebar { cursor: move; }
+.ui-dialog {
+       position: absolute;
+       top: 0;
+       left: 0;
+       padding: .2em;
+       outline: 0;
+}
+.ui-dialog .ui-dialog-titlebar {
+       padding: .4em 1em;
+       position: relative;
+}
+.ui-dialog .ui-dialog-title {
+       float: left;
+       margin: .1em 0;
+       white-space: nowrap;
+       width: 90%;
+       overflow: hidden;
+       text-overflow: ellipsis;
+}
+.ui-dialog .ui-dialog-titlebar-close {
+       position: absolute;
+       right: .3em;
+       top: 50%;
+       width: 21px;
+       margin: -10px 0 0 0;
+       padding: 1px;
+       height: 20px;
+}
+.ui-dialog .ui-dialog-content {
+       position: relative;
+       border: 0;
+       padding: .5em 1em;
+       background: none;
+       overflow: auto;
+}
+.ui-dialog .ui-dialog-buttonpane {
+       text-align: left;
+       border-width: 1px 0 0 0;
+       background-image: none;
+       margin-top: .5em;
+       padding: .3em 1em .5em .4em;
+}
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
+       float: right;
+}
+.ui-dialog .ui-dialog-buttonpane button {
+       margin: .5em .4em .5em 0;
+       cursor: pointer;
+}
+.ui-dialog .ui-resizable-se {
+       width: 12px;
+       height: 12px;
+       right: -5px;
+       bottom: -5px;
+       background-position: 16px 16px;
+}
+.ui-draggable .ui-dialog-titlebar {
+       cursor: move;
+}
 
 /* WP jQuery Dialog Theme */
 .wp-dialog {
+       padding: 0;
+       z-index: 300002;
        border: 1px solid #999;
        -webkit-box-shadow: 0px 0px 16px rgba( 0,0,0,0.3 );
        box-shadow: 0px 0px 16px rgba( 0,0,0,0.3 );
+       background-color: #f5f5f5;
+       -webkit-border-top-left-radius: 4px;
+       border-top-left-radius: 4px;
+       -webkit-border-top-right-radius: 4px;
+       border-top-right-radius: 4px;
 }
 
 .wp-dialog .ui-dialog-title {
        font-size: 11px;
        line-height: 18px;
        color: #e5e5e5;
-}
-
-.wp-dialog {
-       background-color: #f5f5f5;
-       -webkit-border-top-left-radius: 4px;
-       border-top-left-radius: 4px;
-       -webkit-border-top-right-radius: 4px;
-       border-top-right-radius: 4px;
-}
-
-.wp-dialog .ui-dialog-titlebar {
        -webkit-border-top-left-radius: 3px;
        border-top-left-radius: 3px;
        -webkit-border-top-right-radius: 3px;
        border-top-right-radius: 3px;
 }
 
+.wp-dialog .ui-dialog-content {
+       padding: 0;
+}
+
 .wp-dialog .ui-dialog-titlebar-close {
-       position: absolute;
+       cursor: pointer;
+       -webkit-appearance: none;
+       border: 0;
        width: 29px;
        height: 16px;
-       top: 2px;
+       top: 13px;
        right: 6px;
        background: url('../js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif') no-repeat -87px -16px;
-       padding: 0;
+}
+
+.wp-dialog .ui-dialog-titlebar-close .ui-button-text {
+       display: none;
 }
 
 .wp-dialog .ui-dialog-titlebar-close:hover,
 }
 
 .ui-widget-overlay {
+       z-index: 300001;
        background-color: #000;
        opacity: 0.6;
        filter: alpha(opacity=60);
index 1e3c78f53cc29dbd6f8802aa720c48fae37c3b90..9a9d48e39e035b3512c2ae450a120a64f8bf00f4 100644 (file)
@@ -1 +1,28 @@
-.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{position:absolute;left:-99999999px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden}.ui-helper-clearfix{display:inline-block}/*\*/* html .ui-helper-clearfix{height:1%}.ui-helper-clearfix{display:block}/**/.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;z-index:99999;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.wp-dialog{position:absolute;width:300px;overflow:hidden}.wp-dialog .ui-dialog-titlebar{position:relative}.wp-dialog .ui-dialog-titlebar-close span{display:block;margin:1px}.wp-dialog .ui-dialog-content{position:relative;border:0;padding:0;background:0;overflow:auto;zoom:1}.wp-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin:.5em 0 0 0;padding:.3em 1em .5em .4em}.wp-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.wp-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.wp-dialog .ui-resizable-se{width:14px;height:14px;right:3px;bottom:3px}.ui-draggable .ui-dialog-titlebar{cursor:move}.wp-dialog{border:1px solid #999;-webkit-box-shadow:0 0 16px rgba(0,0,0,0.3);box-shadow:0 0 16px rgba(0,0,0,0.3)}.wp-dialog .ui-dialog-title{display:block;text-align:center;padding:1px 0 2px}.wp-dialog .ui-dialog-titlebar{padding:0 1em;background-color:#444;font-weight:bold;font-size:11px;line-height:18px;color:#e5e5e5}.wp-dialog{background-color:#f5f5f5;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px}.wp-dialog .ui-dialog-titlebar{-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.wp-dialog .ui-dialog-titlebar-close{position:absolute;width:29px;height:16px;top:2px;right:6px;background:url('../js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif') no-repeat -87px -16px;padding:0}.wp-dialog .ui-dialog-titlebar-close:hover,.wp-dialog .ui-dialog-titlebar-close:focus{background-position:-87px -32px}.ui-widget-overlay{background-color:#000;opacity:.6;filter:alpha(opacity=60)}
\ No newline at end of file
+/*!
+ * jQuery UI CSS Framework 1.10.1
+ * http://jqueryui.com
+ *
+ * Copyright 2013 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Theming/API
+ */.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}/*!
+ * jQuery UI Resizable 1.10.1
+ * http://jqueryui.com
+ *
+ * Copyright 2013 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Resizable#theming
+ */.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}/*!
+ * jQuery UI Dialog 1.10.1
+ * http://jqueryui.com
+ *
+ * Copyright 2013 jQuery Foundation and other contributors
+ * Released under the MIT license.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Dialog#theming
+ */.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:21px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.wp-dialog{padding:0;z-index:300002;border:1px solid #999;-webkit-box-shadow:0 0 16px rgba(0,0,0,0.3);box-shadow:0 0 16px rgba(0,0,0,0.3);background-color:#f5f5f5;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-webkit-border-top-right-radius:4px;border-top-right-radius:4px}.wp-dialog .ui-dialog-title{display:block;text-align:center;padding:1px 0 2px}.wp-dialog .ui-dialog-titlebar{padding:0 1em;background-color:#444;font-weight:bold;font-size:11px;line-height:18px;color:#e5e5e5;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-top-right-radius:3px}.wp-dialog .ui-dialog-content{padding:0}.wp-dialog .ui-dialog-titlebar-close{cursor:pointer;-webkit-appearance:none;border:0;width:29px;height:16px;top:13px;right:6px;background:url('../js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif') no-repeat -87px -16px}.wp-dialog .ui-dialog-titlebar-close .ui-button-text{display:none}.wp-dialog .ui-dialog-titlebar-close:hover,.wp-dialog .ui-dialog-titlebar-close:focus{background-position:-87px -32px}.ui-widget-overlay{z-index:300001;background-color:#000;opacity:.6;filter:alpha(opacity=60)}
\ No newline at end of file
index 28c78b267adb962ee34004a3769c5067deac5871..f260bb2313f0035e4010ebd646959d71765007bb 100644 (file)
        float: right;
 }
 
+.media-sidebar .setting .link-to-custom {
+       direction: ltr;
+}
+
 .media-sidebar .setting span {
        margin-right: 0;
        margin-left: 4%;
        float: right;
 }
 
+.media-frame .embed-url input,
+.media-frame .link-to-custom {
+       direction: ltr;
+}
+
 /**
  * Responsive layout
  */
index 5b98dc219ee6f2efd775500a1f8df413e84991f6..2636945dfdad65f8ffbad981d0a7c51aebbd8cbe 100644 (file)
@@ -1 +1 @@
-.media-modal-close{right:auto;left:7px}.media-toolbar-primary{float:left}.media-toolbar-secondary{float:right}.media-toolbar-primary>.media-button,.media-toolbar-primary>.media-button-group{margin-left:0;margin-right:10px;float:right}.media-toolbar-secondary>.media-button,.media-toolbar-secondary>.media-button-group{margin-right:0;margin-left:10px;float:right}.media-sidebar{right:auto;left:0;border-left:0;border-right:1px solid #dfdfdf}.media-sidebar .setting{float:right}.media-sidebar .setting span{margin-right:0;margin-left:4%}.media-sidebar .setting span,.compat-item label span{float:right;text-align:left}.media-sidebar .setting input,.media-sidebar .setting textarea{float:left}.compat-item{float:right}.compat-item .label{margin-right:0;margin-left:4%;float:right;text-align:left}.compat-item .field{float:left;padding-right:0;padding-left:1px}.media-menu{border-right:0;border-left:1px solid #d9d9d9;box-shadow:inset 6px 0 6px -6px rgba(0,0,0,0.2)}.media-router>a{float:right;border-right:0;border-left:1px solid #dfdfdf}.media-router>a:last-child{border-left:0}.media-frame-menu{left:auto;right:0}.media-frame-title,.media-frame-router,.media-frame-content,.media-frame-toolbar{left:0;right:200px}.media-frame.hide-menu .media-frame-title,.media-frame.hide-menu .media-frame-router,.media-frame.hide-menu .media-frame-toolbar,.media-frame.hide-menu .media-frame-content{right:0}.media-frame.hide-menu .media-frame-menu{left:auto;right:-200px}.media-frame select.attachment-filters{margin-right:0;margin-left:10px}.media-toolbar-secondary .search{margin-right:0;margin-left:16px}.attachments{padding-right:0;padding-left:16px}.attachment{float:right}.attachment .thumbnail{left:auto;right:0}.attachment .close{right:auto;left:5px}.attachment .check{right:auto;left:-7px}.attachments-browser .media-toolbar{right:0;left:300px}.attachments-browser .attachments,.attachments-browser .uploader-inline{right:0;left:300px}.attachment-preview .media-progress-bar{left:auto;right:15%}.media-sidebar .media-uploader-status .upload-dismiss-errors{right:auto;left:0}.upload-errors .upload-error-label{margin-right:0;margin-left:8px;float:right;margin-top:-3px}.media-selection{right:0;left:350px;padding:0 16px 0 0}.media-selection .selection-info{margin-right:0;margin-left:10px}.media-selection .selection-info a{float:right;border-right:0;border-left:1px solid #dfdfdf;margin:1px -8px 1px 8px}.media-selection .selection-info a:last-child{border-right:1px;border-left:0;margin-left:0;margin-right:-8px}.media-selection:after{right:auto;left:0;background-image:-webkit-gradient(linear,left top,right top,from(rgba(255,255,255,1)),to(rgba(255,255,255,0)));background-image:-webkit-linear-gradient(left,rgba(255,255,255,1),rgba(255,255,255,0));background-image:-moz-linear-gradient(left,rgba(255,255,255,1),rgba(255,255,255,0));background-image:-o-linear-gradient(left,rgba(255,255,255,1),rgba(255,255,255,0));background-image:linear-gradient(to right,rgba(255,255,255,1),rgba(255,255,255,0))}.attachment-info .thumbnail{float:right;margin-right:0;margin-left:10px}.attachment-info .details{float:right}.attachment-display-settings{float:right}.embed-url span{display:block;padding:4px 2px 6px 0}.media-embed .thumbnail{float:right}.media-embed .setting{float:right}@media only screen and (max-width:900px){.media-frame-title,.media-frame-router,.media-frame-content,.media-frame-toolbar{left:0;right:140px}.attachments-browser .attachments,.attachments-browser .uploader-inline,.attachments-browser .media-toolbar{right:0;left:180px}}
\ No newline at end of file
+.media-modal-close{right:auto;left:7px}.media-toolbar-primary{float:left}.media-toolbar-secondary{float:right}.media-toolbar-primary>.media-button,.media-toolbar-primary>.media-button-group{margin-left:0;margin-right:10px;float:right}.media-toolbar-secondary>.media-button,.media-toolbar-secondary>.media-button-group{margin-right:0;margin-left:10px;float:right}.media-sidebar{right:auto;left:0;border-left:0;border-right:1px solid #dfdfdf}.media-sidebar .setting{float:right}.media-sidebar .setting .link-to-custom{direction:ltr}.media-sidebar .setting span{margin-right:0;margin-left:4%}.media-sidebar .setting span,.compat-item label span{float:right;text-align:left}.media-sidebar .setting input,.media-sidebar .setting textarea{float:left}.compat-item{float:right}.compat-item .label{margin-right:0;margin-left:4%;float:right;text-align:left}.compat-item .field{float:left;padding-right:0;padding-left:1px}.media-menu{border-right:0;border-left:1px solid #d9d9d9;box-shadow:inset 6px 0 6px -6px rgba(0,0,0,0.2)}.media-router>a{float:right;border-right:0;border-left:1px solid #dfdfdf}.media-router>a:last-child{border-left:0}.media-frame-menu{left:auto;right:0}.media-frame-title,.media-frame-router,.media-frame-content,.media-frame-toolbar{left:0;right:200px}.media-frame.hide-menu .media-frame-title,.media-frame.hide-menu .media-frame-router,.media-frame.hide-menu .media-frame-toolbar,.media-frame.hide-menu .media-frame-content{right:0}.media-frame.hide-menu .media-frame-menu{left:auto;right:-200px}.media-frame select.attachment-filters{margin-right:0;margin-left:10px}.media-toolbar-secondary .search{margin-right:0;margin-left:16px}.attachments{padding-right:0;padding-left:16px}.attachment{float:right}.attachment .thumbnail{left:auto;right:0}.attachment .close{right:auto;left:5px}.attachment .check{right:auto;left:-7px}.attachments-browser .media-toolbar{right:0;left:300px}.attachments-browser .attachments,.attachments-browser .uploader-inline{right:0;left:300px}.attachment-preview .media-progress-bar{left:auto;right:15%}.media-sidebar .media-uploader-status .upload-dismiss-errors{right:auto;left:0}.upload-errors .upload-error-label{margin-right:0;margin-left:8px;float:right;margin-top:-3px}.media-selection{right:0;left:350px;padding:0 16px 0 0}.media-selection .selection-info{margin-right:0;margin-left:10px}.media-selection .selection-info a{float:right;border-right:0;border-left:1px solid #dfdfdf;margin:1px -8px 1px 8px}.media-selection .selection-info a:last-child{border-right:1px;border-left:0;margin-left:0;margin-right:-8px}.media-selection:after{right:auto;left:0;background-image:-webkit-gradient(linear,left top,right top,from(rgba(255,255,255,1)),to(rgba(255,255,255,0)));background-image:-webkit-linear-gradient(left,rgba(255,255,255,1),rgba(255,255,255,0));background-image:-moz-linear-gradient(left,rgba(255,255,255,1),rgba(255,255,255,0));background-image:-o-linear-gradient(left,rgba(255,255,255,1),rgba(255,255,255,0));background-image:linear-gradient(to right,rgba(255,255,255,1),rgba(255,255,255,0))}.attachment-info .thumbnail{float:right;margin-right:0;margin-left:10px}.attachment-info .details{float:right}.attachment-display-settings{float:right}.embed-url span{display:block;padding:4px 2px 6px 0}.media-embed .thumbnail{float:right}.media-embed .setting{float:right}.media-frame .embed-url input,.media-frame .link-to-custom{direction:ltr}@media only screen and (max-width:900px){.media-frame-title,.media-frame-router,.media-frame-content,.media-frame-toolbar{left:0;right:140px}.attachments-browser .attachments,.attachments-browser .uploader-inline,.attachments-browser .media-toolbar{right:0;left:180px}}
\ No newline at end of file
diff --git a/wp-includes/css/wp-auth-check.css b/wp-includes/css/wp-auth-check.css
new file mode 100644 (file)
index 0000000..f51017b
--- /dev/null
@@ -0,0 +1,94 @@
+/*------------------------------------------------------------------------------
+ Interim login dialog
+------------------------------------------------------------------------------*/
+
+#wp-auth-check-wrap.hidden {
+       display: none;
+}
+
+#wp-auth-check-wrap #wp-auth-check-bg {
+       position: fixed;
+       top: 0;
+       bottom: 0;
+       left: 0;
+       right: 0;
+       background: #000;
+       opacity: 0.5;
+       filter: alpha(opacity=50);
+       z-index: 1000000;
+}
+
+#wp-auth-check-wrap #wp-auth-check {
+       position: fixed;
+       left: 50%;
+       overflow: hidden;
+       top: 40px;
+       bottom: 20px;
+       max-height: 415px;
+       width: 380px;
+       margin: 0 0 0 -190px;
+       padding: 30px 0 0;
+       background-color: #fbfbfb;
+       -webkit-border-radius: 3px;
+       border-radius: 3px;
+       z-index: 1000001;
+}
+
+#wp-auth-check-wrap.fallback #wp-auth-check {
+       max-height: 180px;
+       overflow: auto;
+}
+
+#wp-auth-check-wrap #wp-auth-check-form {
+       background: url(../images/wpspin-2x.gif) no-repeat center center;
+       background-size: 16px 16px;
+       height: 100%;
+}
+
+#wp-auth-check-wrap #wp-auth-check-form iframe {
+       height: 100%;
+       width: 100%;
+       overflow: auto;
+}
+
+#wp-auth-check-wrap .wp-auth-check-close {
+       position: absolute;
+       top: 8px;
+       right: 8px;
+       height: 14px;
+       width: 14px;
+       cursor: pointer;
+       background-image: url(../images/uploader-icons.png);
+       background-repeat: no-repeat;
+       background-position: -100px 0;
+}
+
+#wp-auth-check-wrap .wp-auth-check-close:focus {
+       outline: 1px dotted #888;
+}
+
+#wp-auth-check-wrap .wp-auth-fallback-expired {
+       outline: 0;
+}
+
+#wp-auth-check-wrap .wp-auth-fallback {
+       font-size: 14px;
+       line-height: 21px;
+       padding: 0 25px;
+       display: none;
+}
+
+#wp-auth-check-wrap.fallback .wp-auth-fallback,
+#wp-auth-check-wrap.fallback .wp-auth-check-close {
+       display: block;
+}
+
+@media print,
+  (-o-min-device-pixel-ratio: 5/4),
+  (-webkit-min-device-pixel-ratio: 1.25),
+  (min-resolution: 120dpi) {
+       #wp-auth-check-wrap .wp-auth-check-close {
+               background-image: url(../images/uploader-icons-2x.png);
+               background-size: 134px 15px;
+       }
+}
diff --git a/wp-includes/css/wp-auth-check.min.css b/wp-includes/css/wp-auth-check.min.css
new file mode 100644 (file)
index 0000000..734525c
--- /dev/null
@@ -0,0 +1 @@
+#wp-auth-check-wrap.hidden{display:none}#wp-auth-check-wrap #wp-auth-check-bg{position:fixed;top:0;bottom:0;left:0;right:0;background:#000;opacity:.5;filter:alpha(opacity=50);z-index:1000000}#wp-auth-check-wrap #wp-auth-check{position:fixed;left:50%;overflow:hidden;top:40px;bottom:20px;max-height:415px;width:380px;margin:0 0 0 -190px;padding:30px 0 0;background-color:#fbfbfb;-webkit-border-radius:3px;border-radius:3px;z-index:1000001}#wp-auth-check-wrap.fallback #wp-auth-check{max-height:180px;overflow:auto}#wp-auth-check-wrap #wp-auth-check-form{background:url(../images/wpspin-2x.gif) no-repeat center center;background-size:16px 16px;height:100%}#wp-auth-check-wrap #wp-auth-check-form iframe{height:100%;width:100%;overflow:auto}#wp-auth-check-wrap .wp-auth-check-close{position:absolute;top:8px;right:8px;height:14px;width:14px;cursor:pointer;background-image:url(../images/uploader-icons.png);background-repeat:no-repeat;background-position:-100px 0}#wp-auth-check-wrap .wp-auth-check-close:focus{outline:1px dotted #888}#wp-auth-check-wrap .wp-auth-fallback-expired{outline:0}#wp-auth-check-wrap .wp-auth-fallback{font-size:14px;line-height:21px;padding:0 25px;display:none}#wp-auth-check-wrap.fallback .wp-auth-fallback,#wp-auth-check-wrap.fallback .wp-auth-check-close{display:block}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){#wp-auth-check-wrap .wp-auth-check-close{background-image:url(../images/uploader-icons-2x.png);background-size:134px 15px}}
\ No newline at end of file
index bc537a5e0610a3ec3418988bf6ac4154a913560c..358c1018f33275566d61123488074bb9618376e6 100644 (file)
@@ -12,7 +12,7 @@
  *
  * @since 3.0.0
  */
-function wp_initial_constants( ) {
+function wp_initial_constants() {
        global $blog_id;
 
        // set memory limits
@@ -75,11 +75,11 @@ function wp_initial_constants( ) {
 
        // Constants for expressing human-readable intervals
        // in their respective number of seconds.
-       define( 'MINUTE_IN_SECONDS', 60 );
-       define( 'HOUR_IN_SECONDS',   60 * MINUTE_IN_SECONDS );
-       define( 'DAY_IN_SECONDS',    24 * HOUR_IN_SECONDS   );
+       define( 'MINUTE_IN_SECONDS', 60 );
+       define( 'HOUR_IN_SECONDS',   60 * MINUTE_IN_SECONDS );
+       define( 'DAY_IN_SECONDS',    24 * HOUR_IN_SECONDS   );
        define( 'WEEK_IN_SECONDS',    7 * DAY_IN_SECONDS    );
-       define( 'YEAR_IN_SECONDS',  365 * DAY_IN_SECONDS    );
+       define( 'YEAR_IN_SECONDS',  365 * DAY_IN_SECONDS    );
 }
 
 /**
@@ -89,7 +89,7 @@ function wp_initial_constants( ) {
  *
  * @since 3.0.0
  */
-function wp_plugin_directory_constants( ) {
+function wp_plugin_directory_constants() {
        if ( !defined('WP_CONTENT_URL') )
                define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up
 
@@ -150,7 +150,7 @@ function wp_plugin_directory_constants( ) {
  * Defines constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies().
  * @since 3.0.0
  */
-function wp_cookie_constants( ) {
+function wp_cookie_constants() {
        /**
         * Used to guarantee unique hash cookies
         * @since 1.5
@@ -235,7 +235,7 @@ function wp_cookie_constants( ) {
  *
  * @since 3.0.0
  */
-function wp_ssl_constants( ) {
+function wp_ssl_constants() {
        /**
         * @since 2.6.0
         */
@@ -256,7 +256,7 @@ function wp_ssl_constants( ) {
  *
  * @since 3.0.0
  */
-function wp_functionality_constants( ) {
+function wp_functionality_constants() {
        /**
         * @since 2.5.0
         */
@@ -284,7 +284,7 @@ function wp_functionality_constants( ) {
  *
  * @since 3.0.0
  */
-function wp_templating_constants( ) {
+function wp_templating_constants() {
        /**
         * Filesystem path to the current active template directory
         * @since 1.5.0
@@ -304,6 +304,6 @@ function wp_templating_constants( ) {
         * @since 3.0.0
         */
        if ( !defined('WP_DEFAULT_THEME') )
-               define( 'WP_DEFAULT_THEME', 'twentytwelve' );
+               define( 'WP_DEFAULT_THEME', 'twentythirteen' );
 
 }
index cc6e07fa97ce3f46d56d520675a4862712f485b9..89b39769218acb882b26b4331f5615ff1a6af3b2 100644 (file)
@@ -175,6 +175,7 @@ add_filter( 'the_author',         'ent2ncr',      8 );
 // Misc filters
 add_filter( 'option_ping_sites',        'privacy_ping_filter'                 );
 add_filter( 'option_blog_charset',      '_wp_specialchars'                    ); // IMPORTANT: This must not be wp_specialchars() or esc_html() or it'll cause an infinite loop
+add_filter( 'option_blog_charset',      '_canonical_charset'                  );
 add_filter( 'option_home',              '_config_wp_home'                     );
 add_filter( 'option_siteurl',           '_config_wp_siteurl'                  );
 add_filter( 'tiny_mce_before_init',     '_mce_set_direction'                  );
@@ -195,6 +196,8 @@ add_filter( 'nav_menu_meta_box_object', '_wp_nav_menu_meta_box_object'        );
 add_filter( 'pingback_ping_source_uri', 'pingback_ping_source_uri'            );
 add_filter( 'xmlrpc_pingback_error',    'xmlrpc_pingback_error'               );
 
+add_filter( 'http_request_host_is_external', 'allowed_http_request_hosts', 10, 2 );
+
 // Actions
 add_action( 'wp_head',             'wp_enqueue_scripts',              1     );
 add_action( 'wp_head',             'feed_links',                      2     );
@@ -249,7 +252,7 @@ add_action( 'init',                       'smilies_init',
 add_action( 'plugins_loaded',             'wp_maybe_load_widgets',                    0    );
 add_action( 'plugins_loaded',             'wp_maybe_load_embeds',                     0    );
 add_action( 'shutdown',                   'wp_ob_end_flush_all',                      1    );
-add_action( 'pre_post_update',            'wp_save_post_revision'                          );
+add_action( 'post_updated',               'wp_save_post_revision',                   10, 1 );
 add_action( 'publish_post',               '_publish_post_hook',                       5, 1 );
 add_action( 'transition_post_status',     '_transition_post_status',                  5, 3 );
 add_action( 'transition_post_status',     '_update_term_count_on_transition_post_status', 10, 3 );
@@ -290,4 +293,12 @@ add_filter( 'default_option_link_manager_enabled', '__return_true' );
 // This option no longer exists; tell plugins we always support auto-embedding.
 add_filter( 'default_option_embed_autourls', '__return_true' );
 
+// Default settings for heartbeat
+add_filter( 'heartbeat_settings', 'wp_heartbeat_settings' );
+
+// Check if the user is logged out
+add_action( 'admin_enqueue_scripts',     'wp_auth_check_load'   );
+add_filter( 'heartbeat_received',        'wp_auth_check', 10, 2 );
+add_filter( 'heartbeat_nopriv_received', 'wp_auth_check', 10, 2 );
+
 unset($filter, $action);
index bcbae03dee6d975e729c84fbd1b1976a9bb30790..09d5811f1c26fa8f22a9a9c505bcff8296be001f 100644 (file)
@@ -315,10 +315,11 @@ class WP_Widget_Meta extends WP_Widget {
                        <li><?php wp_loginout(); ?></li>
                        <li><a href="<?php bloginfo('rss2_url'); ?>" title="<?php echo esc_attr(__('Syndicate this site using RSS 2.0')); ?>"><?php _e('Entries <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
                        <li><a href="<?php bloginfo('comments_rss2_url'); ?>" title="<?php echo esc_attr(__('The latest comments to all posts in RSS')); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
-                       <li><a href="<?php esc_attr_e( 'http://wordpress.org/' ); ?>" title="<?php echo esc_attr(__('Powered by WordPress, state-of-the-art semantic personal publishing platform.')); ?>"><?php
-                       /* translators: meta widget link text */
-                       _e( 'WordPress.org' );
-                       ?></a></li>
+                       <?php echo apply_filters( 'widget_meta_poweredby', sprintf( '<li><a href="%s" title="%s">%s</a></li>',
+                               esc_url( __( 'http://wordpress.org/' ) ),
+                               esc_attr__( 'Powered by WordPress, state-of-the-art semantic personal publishing platform.' ),
+                               _x( 'WordPress.org', 'meta widget link text' )
+                       ) ); ?>
                        <?php wp_meta(); ?>
                        </ul>
 <?php
@@ -558,8 +559,10 @@ class WP_Widget_Recent_Posts extends WP_Widget {
                ob_start();
                extract($args);
 
-               $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts') : $instance['title'], $instance, $this->id_base);
-               if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) )
+               $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Posts' );
+               $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
+               $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 10;
+               if ( ! $number )
                        $number = 10;
                $show_date = isset( $instance['show_date'] ) ? $instance['show_date'] : false;
 
@@ -593,7 +596,7 @@ class WP_Widget_Recent_Posts extends WP_Widget {
                $instance = $old_instance;
                $instance['title'] = strip_tags($new_instance['title']);
                $instance['number'] = (int) $new_instance['number'];
-               $instance['show_date'] = (bool) $new_instance['show_date'];
+               $instance['show_date'] = isset( $new_instance['show_date'] ) ? (bool) $new_instance['show_date'] : false;
                $this->flush_widget_cache();
 
                $alloptions = wp_cache_get( 'alloptions', 'options' );
@@ -674,9 +677,11 @@ class WP_Widget_Recent_Comments extends WP_Widget {
 
                extract($args, EXTR_SKIP);
                $output = '';
-               $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Recent Comments' ) : $instance['title'], $instance, $this->id_base );
 
-               if ( empty( $instance['number'] ) || ! $number = absint( $instance['number'] ) )
+               $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : __( 'Recent Comments' );
+               $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
+               $number = ( ! empty( $instance['number'] ) ) ? absint( $instance['number'] ) : 5;
+               if ( ! $number )
                        $number = 5;
 
                $comments = get_comments( apply_filters( 'widget_comments_args', array( 'number' => $number, 'status' => 'approve', 'post_status' => 'publish' ) ) );
@@ -716,14 +721,14 @@ class WP_Widget_Recent_Comments extends WP_Widget {
        }
 
        function form( $instance ) {
-               $title = isset($instance['title']) ? esc_attr($instance['title']) : '';
-               $number = isset($instance['number']) ? absint($instance['number']) : 5;
+               $title  = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
+               $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 5;
 ?>
-               <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label>
-               <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>
+               <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
+               <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
 
-               <p><label for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of comments to show:'); ?></label>
-               <input id="<?php echo $this->get_field_id('number'); ?>" name="<?php echo $this->get_field_name('number'); ?>" type="text" value="<?php echo $number; ?>" size="3" /></p>
+               <p><label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of comments to show:' ); ?></label>
+               <input id="<?php echo $this->get_field_id( 'number' ); ?>" name="<?php echo $this->get_field_name( 'number' ); ?>" type="text" value="<?php echo $number; ?>" size="3" /></p>
 <?php
        }
 }
@@ -861,18 +866,18 @@ function wp_widget_rss_output( $rss, $args = array() ) {
                        $title = __('Untitled');
 
                $desc = str_replace( array("\n", "\r"), ' ', esc_attr( strip_tags( @html_entity_decode( $item->get_description(), ENT_QUOTES, get_option('blog_charset') ) ) ) );
-               $desc = wp_html_excerpt( $desc, 360 );
+               $excerpt = wp_html_excerpt( $desc, 360 );
 
                // Append ellipsis. Change existing [...] to [&hellip;].
-               if ( '[...]' == substr( $desc, -5 ) )
-                       $desc = substr( $desc, 0, -5 ) . '[&hellip;]';
-               elseif ( '[&hellip;]' != substr( $desc, -10 ) )
-                       $desc .= ' [&hellip;]';
+               if ( '[...]' == substr( $excerpt, -5 ) )
+                       $excerpt = substr( $excerpt, 0, -5 ) . '[&hellip;]';
+               elseif ( '[&hellip;]' != substr( $excerpt, -10 ) && $desc != $excerpt )
+                       $excerpt .= ' [&hellip;]';
 
-               $desc = esc_html( $desc );
+               $excerpt = esc_html( $excerpt );
 
                if ( $show_summary ) {
-                       $summary = "<div class='rssSummary'>$desc</div>";
+                       $summary = "<div class='rssSummary'>$excerpt</div>";
                } else {
                        $summary = '';
                }
index 655316a0a985ff7140e1e94f1c747a0bb4a7fbfd..d86709a74b7ffe4e70c018b9873ce6979e4f6c5c 100644 (file)
@@ -394,7 +394,7 @@ function user_can_edit_user($user_id, $other_user) {
  * @param string $cat_name Optional. The category name to use. If no match is found uses all.
  * @param string $before Optional. The html to output before the link.
  * @param string $after Optional. The html to output after the link.
- * @param string $between Optional. The html to output between the link/image and it's description. Not used if no image or $show_images is true.
+ * @param string $between Optional. The html to output between the link/image and its description. Not used if no image or $show_images is true.
  * @param bool $show_images Optional. Whether to show images (if defined).
  * @param string $orderby Optional. The order to output the links. E.g. 'id', 'name', 'url', 'description' or 'rating'. Or maybe owner.
  *             If you start the name with an underscore the order will be reversed. You can also specify 'rand' as the order which will return links in a
@@ -547,7 +547,7 @@ function get_linkobjects($category = 0, $orderby = 'name', $limit = 0) {
  * @param string $cat_name The category name to use. If no match is found uses all
  * @param string $before The html to output before the link
  * @param string $after The html to output after the link
- * @param string $between The html to output between the link/image and it's description. Not used if no image or show_images is true
+ * @param string $between The html to output between the link/image and its description. Not used if no image or show_images is true
  * @param bool $show_images Whether to show images (if defined).
  * @param string $orderby the order to output the links. E.g. 'id', 'name', 'url',
  *             'description', or 'rating'. Or maybe owner. If you start the name with an
@@ -575,7 +575,7 @@ function get_linksbyname_withrating($cat_name = "noname", $before = '', $after =
  * @param int $category The category to use. If no category supplied uses all
  * @param string $before The html to output before the link
  * @param string $after The html to output after the link
- * @param string $between The html to output between the link/image and it's description. Not used if no image or show_images == true
+ * @param string $between The html to output between the link/image and its description. Not used if no image or show_images == true
  * @param bool $show_images Whether to show images (if defined).
  * @param string $orderby The order to output the links. E.g. 'id', 'name', 'url',
  *             'description', or 'rating'. Or maybe owner. If you start the name with an
@@ -794,12 +794,12 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after
  * @deprecated Use get_author_posts_url()
  * @see get_author_posts_url()
  *
- * @param bool $echo Optional.
- * @param int $author_id Required.
+ * @param bool $echo
+ * @param int $author_id
  * @param string $author_nicename Optional.
  * @return string|null
  */
-function get_author_link($echo = false, $author_id, $author_nicename = '') {
+function get_author_link($echo, $author_id, $author_nicename = '') {
        _deprecated_function( __FUNCTION__, '2.1', 'get_author_posts_url()' );
 
        $link = get_author_posts_url($author_id, $author_nicename);
@@ -1087,18 +1087,6 @@ function get_links_list($order = 'name') {
  */
 function links_popup_script($text = 'Links', $width=400, $height=400, $file='links.all.php', $count = true) {
        _deprecated_function( __FUNCTION__, '2.1' );
-
-       if ( $count )
-               $counts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->links");
-
-       $javascript = "<a href=\"#\" onclick=\"javascript:window.open('$file?popup=1', '_blank', 'width=$width,height=$height,scrollbars=yes,status=no'); return false\">";
-       $javascript .= $text;
-
-       if ( $count )
-               $javascript .= " ($counts)";
-
-       $javascript .= "</a>\n\n";
-               echo $javascript;
 }
 
 /**
@@ -1691,8 +1679,6 @@ function the_author_ID() {
  * @subpackage Feed
  * @since 0.71
  * @uses apply_filters() Calls 'the_content_rss' on the content before processing.
- * @see get_the_content() For the $more_link_text, $stripteaser, and $more_file
- *             parameters.
  *
  * @deprecated 2.9.0
  * @deprecated Use the_content_feed()
@@ -1706,7 +1692,7 @@ function the_author_ID() {
  */
 function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) {
        _deprecated_function( __FUNCTION__, '2.9', 'the_content_feed' );
-       $content = get_the_content($more_link_text, $stripteaser, $more_file);
+       $content = get_the_content($more_link_text, $stripteaser);
        $content = apply_filters('the_content_rss', $content);
        if ( $cut && !$encode_html )
                $encode_html = 2;
@@ -3335,7 +3321,7 @@ function _save_post_hook() {}
  *
  * @since 2.9.0
  * @deprecated 3.5.0
- * see wp_image_editor_supports()
+ * @see wp_image_editor_supports()
  *
  * @param string $mime_type
  * @return bool
@@ -3364,3 +3350,31 @@ function gd_edit_image_support($mime_type) {
        }
        return false;
 }
+
+/**
+ * Converts an integer byte value to a shorthand byte value.
+ *
+ * @since 2.3.0
+ * @deprecated 3.6.0
+ * @deprecated Use size_format()
+ *
+ * @param int $bytes An integer byte value.
+ * @return string A shorthand byte value.
+ */
+function wp_convert_bytes_to_hr( $bytes ) {
+       _deprecated_function( __FUNCTION__, '3.6', 'size_format()' );
+
+       $units = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB', 4 => 'TB' );
+       $log   = log( $bytes, 1024 );
+       $power = (int) $log;
+       $size  = pow( 1024, $log - $power );
+
+       if ( ! is_nan( $size ) && array_key_exists( $power, $units ) ) {
+               $unit = $units[ $power ];
+       } else {
+               $size = $bytes;
+               $unit = $units[0];
+       }
+
+       return $size . $unit;
+}
index 174670379c7c16d67844cd4452eaf787c86fda5a..1a89c47955bb91f4e04b94708eacd7a9bc326714 100644 (file)
@@ -75,7 +75,7 @@ if ( have_comments() ) : while ( have_comments() ) : the_comment();
                <thr:in-reply-to ref="<?php the_guid(); ?>" href="<?php the_permalink_rss() ?>" type="<?php bloginfo_rss('html_type'); ?>" />
 <?php else : // This comment is in reply to another comment
        $parent_comment = get_comment($comment->comment_parent);
-       // The rel attribute below and the id tag above should be GUIDs, but WP doesn't create them for comments (unlike posts). Either way, its more important that they both use the same system
+       // The rel attribute below and the id tag above should be GUIDs, but WP doesn't create them for comments (unlike posts). Either way, it's more important that they both use the same system
 ?>
                <thr:in-reply-to ref="<?php comment_guid($parent_comment) ?>" href="<?php echo get_comment_link($parent_comment) ?>" type="<?php bloginfo_rss('html_type'); ?>" />
 <?php endif;
index 61825f8958d67a1dc2ab2a6f8d01ddfbf66df12f..e6b9ae0e68212b23923bc206297020a2d58ff362 100644 (file)
@@ -198,7 +198,7 @@ function the_permalink_rss() {
  * @return none
  */
 function comments_link_feed() {
-       echo esc_url( get_comments_link() );
+       echo esc_url( apply_filters( 'comments_link_feed', get_comments_link() ) );
 }
 
 /**
@@ -239,7 +239,7 @@ function get_comment_guid($comment_id = null) {
  * @since 1.5.0
  */
 function comment_link() {
-       echo esc_url( get_comment_link() );
+       echo esc_url( apply_filters( 'comment_link', get_comment_link() ) );
 }
 
 /**
@@ -391,7 +391,7 @@ function rss_enclosure() {
                        foreach ( (array) $val as $enc ) {
                                $enclosure = explode("\n", $enc);
 
-                               //only get the the first element eg, audio/mpeg from 'audio/mpeg mpga mp2 mp3'
+                               // only get the first element, e.g. audio/mpeg from 'audio/mpeg mpga mp2 mp3'
                                $t = preg_split('/[ \t]/', trim($enclosure[2]) );
                                $type = $t[0];
 
@@ -488,7 +488,7 @@ function prep_atom_text_construct($data) {
  */
 function self_link() {
        $host = @parse_url(home_url());
-       echo esc_url( set_url_scheme( 'http://' . $host['host'] . stripslashes($_SERVER['REQUEST_URI']) ) );
+       echo esc_url( apply_filters( 'self_link', set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
 }
 
 /**
@@ -520,11 +520,14 @@ function feed_content_type( $type = '' ) {
  *
  * @since 2.8
  *
- * @param string $url URL to retrieve feed
+ * @param mixed $url URL of feed to retrieve. If an array of URLs, the feeds are merged
+ * using SimplePie's multifeed feature.
+ * See also {@link â€‹http://simplepie.org/wiki/faq/typical_multifeed_gotchas}
+ *
  * @return WP_Error|SimplePie WP_Error object on failure or SimplePie object on success
  */
-function fetch_feed($url) {
-       require_once (ABSPATH . WPINC . '/class-feed.php');
+function fetch_feed( $url ) {
+       require_once ( ABSPATH . WPINC . '/class-feed.php' );
 
        $feed = new SimplePie();
 
@@ -536,14 +539,14 @@ function fetch_feed($url) {
        $feed->set_cache_class( 'WP_Feed_Cache' );
        $feed->set_file_class( 'WP_SimplePie_File' );
 
-       $feed->set_feed_url($url);
+       $feed->set_feed_url( $url );
        $feed->set_cache_duration( apply_filters( 'wp_feed_cache_transient_lifetime', 12 * HOUR_IN_SECONDS, $url ) );
        do_action_ref_array( 'wp_feed_options', array( &$feed, $url ) );
        $feed->init();
        $feed->handle_content_type();
 
        if ( $feed->error() )
-               return new WP_Error('simplepie-error', $feed->error());
+               return new WP_Error( 'simplepie-error', $feed->error() );
 
        return $feed;
 }
index a4e429a7f0b1dfc762b858acb7edb3c9636b6b75..aef2b6378caf83ca27b3482818ce406e782bc54f 100644 (file)
@@ -5,7 +5,7 @@
  * Handles many functions for formatting output.
  *
  * @package WordPress
- **/
+ */
 
 /**
  * Replaces common plain text characters into formatted entities
@@ -134,8 +134,8 @@ function wptexturize($text) {
  * Search for disabled element tags. Push element to stack on tag open and pop
  * on tag close. Assumes first character of $text is tag opening.
  *
- * @access private
  * @since 2.9.0
+ * @access private
  *
  * @param string $text Text to check. First character is assumed to be $opening
  * @param array $stack Array used as stack of opened tag elements
@@ -220,7 +220,7 @@ function wpautop($pee, $br = true) {
 
        $pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee);
        // Space things out a little
-       $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|noscript|samp|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)';
+       $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|option|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|noscript|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)';
        $pee = preg_replace('!(<' . $allblocks . '[^>]*>)!', "\n$1", $pee);
        $pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee);
        $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines
@@ -262,6 +262,7 @@ function wpautop($pee, $br = true) {
  *
  * @since 3.1.0
  * @access private
+ *
  * @param array $matches preg_replace_callback matches array
  * @return string
  */
@@ -363,6 +364,7 @@ function seems_utf8($str) {
  * &quot;, or ENT_QUOTES to do both. Default is ENT_NOQUOTES where no quotes are encoded.
  *
  * @since 1.2.2
+ * @access private
  *
  * @param string $string The text which is to be encoded.
  * @param mixed $quote_style Optional. Converts double quotes if set to ENT_COMPAT, both single and double if set to ENT_QUOTES or none if set to ENT_NOQUOTES. Also compatible with old values; converting single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default is ENT_NOQUOTES.
@@ -442,7 +444,7 @@ function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = fals
  * $quote_style can be set to ENT_COMPAT to decode " entities,
  * or ENT_QUOTES to do both " and '. Default is ENT_NOQUOTES where no quotes are decoded.
  *
- * @since 2.8
+ * @since 2.8.0
  *
  * @param string $string The text which is to be decoded.
  * @param mixed $quote_style Optional. Converts double quotes if set to ENT_COMPAT, both single and double if set to ENT_QUOTES or none if set to ENT_NOQUOTES. Also compatible with old _wp_specialchars() values; converting single quotes if set to 'single', double if set to 'double' or both if otherwise set. Default is ENT_NOQUOTES.
@@ -499,7 +501,7 @@ function wp_specialchars_decode( $string, $quote_style = ENT_NOQUOTES ) {
 /**
  * Checks for invalid UTF8 in a string.
  *
- * @since 2.8
+ * @since 2.8.0
  *
  * @param string $string The text which is to be checked.
  * @param boolean $strip Optional. Whether to attempt to strip out invalid UTF8. Default is false.
@@ -785,6 +787,19 @@ function remove_accents($string) {
                chr(199).chr(155) => 'U', chr(199).chr(156) => 'u',
                );
 
+               // Used for locale-specific rules
+               $locale = get_locale();
+
+               if ( 'de_DE' == $locale ) {
+                       $chars[ chr(195).chr(132) ] = 'Ae';
+                       $chars[ chr(195).chr(164) ] = 'ae';
+                       $chars[ chr(195).chr(150) ] = 'Oe';
+                       $chars[ chr(195).chr(182) ] = 'oe';
+                       $chars[ chr(195).chr(156) ] = 'Ue';
+                       $chars[ chr(195).chr(188) ] = 'ue';
+                       $chars[ chr(195).chr(159) ] = 'ss';
+               }
+
                $string = strtr($string, $chars);
        } else {
                // Assume ISO-8859-1 if not UTF-8
@@ -811,12 +826,12 @@ function remove_accents($string) {
 }
 
 /**
- * Sanitizes a filename replacing whitespace with dashes
+ * Sanitizes a filename, replacing whitespace with dashes.
  *
  * Removes special characters that are illegal in filenames on certain
  * operating systems and special characters requiring special escaping
  * to manipulate at the command line. Replaces spaces and consecutive
- * dashes with a single dash. Trim period, dash and underscore from beginning
+ * dashes with a single dash. Trims period, dash and underscore from beginning
  * and end of filename.
  *
  * @since 2.1.0
@@ -868,7 +883,7 @@ function sanitize_file_name( $filename ) {
 }
 
 /**
- * Sanitize username stripping out unsafe characters.
+ * Sanitizes a username, stripping out unsafe characters.
  *
  * Removes tags, octets, entities, and if strict is enabled, will only keep
  * alphanumeric, _, space, ., -, @. After sanitizing, it passes the username,
@@ -903,7 +918,7 @@ function sanitize_user( $username, $strict = false ) {
 }
 
 /**
- * Sanitize a string key.
+ * Sanitizes a string key.
  *
  * Keys are used as internal identifiers. Lowercase alphanumeric characters, dashes and underscores are allowed.
  *
@@ -920,7 +935,7 @@ function sanitize_key( $key ) {
 }
 
 /**
- * Sanitizes title or use fallback title.
+ * Sanitizes a title, or returns a fallback title.
  *
  * Specifically, HTML and PHP tags are stripped. Further actions can be added
  * via the plugin API. If $title is empty and $fallback_title is set, the latter
@@ -933,7 +948,7 @@ function sanitize_key( $key ) {
  * @param string $context Optional. The operation for which the string is sanitized
  * @return string The sanitized string.
  */
-function sanitize_title($title, $fallback_title = '', $context = 'save') {
+function sanitize_title( $title, $fallback_title = '', $context = 'save' ) {
        $raw_title = $title;
 
        if ( 'save' == $context )
@@ -947,12 +962,23 @@ function sanitize_title($title, $fallback_title = '', $context = 'save') {
        return $title;
 }
 
-function sanitize_title_for_query($title) {
-       return sanitize_title($title, '', 'query');
+/**
+ * Sanitizes a title with the 'query' context.
+ *
+ * Used for querying the database for a value from URL.
+ *
+ * @since 3.1.0
+ * @uses sanitize_title()
+ *
+ * @param string $title The string to be sanitized.
+ * @return string The sanitized string.
+ */
+function sanitize_title_for_query( $title ) {
+       return sanitize_title( $title, '', 'query' );
 }
 
 /**
- * Sanitizes title, replacing whitespace and a few other characters with dashes.
+ * Sanitizes title, replacing whitespace and a few other characters with dashes.
  *
  * Limits the output to alphanumeric characters, underscore (_) and dash (-).
  * Whitespace becomes a dash.
@@ -964,7 +990,7 @@ function sanitize_title_for_query($title) {
  * @param string $context Optional. The operation for which the string is sanitized.
  * @return string The sanitized title.
  */
-function sanitize_title_with_dashes($title, $raw_title = '', $context = 'display') {
+function sanitize_title_with_dashes( $title, $raw_title = '', $context = 'display' ) {
        $title = strip_tags($title);
        // Preserve escaped octets.
        $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);
@@ -999,8 +1025,10 @@ function sanitize_title_with_dashes($title, $raw_title = '', $context = 'display
                        '%e2%80%9a', '%e2%80%9b', '%e2%80%9e', '%e2%80%9f',
                        // copy, reg, deg, hellip and trade
                        '%c2%a9', '%c2%ae', '%c2%b0', '%e2%80%a6', '%e2%84%a2',
-                       // grave accent, acute accent, macron, caron
-                       '%cc%80', '%cc%81', '%cc%84', '%cc%8c',
+                       // acute accents
+                       '%c2%b4', '%cb%8a', '%cc%81', '%cd%81',
+                       // grave accent, macron, caron
+                       '%cc%80', '%cc%84', '%cc%8c',
                ), '', $title );
 
                // Convert times to x
@@ -1034,7 +1062,7 @@ function sanitize_sql_orderby( $orderby ){
 }
 
 /**
- * Santizes a html classname to ensure it only contains valid characters
+ * Sanitizes an HTML classname to ensure it only contains valid characters.
  *
  * Strips the string down to A-Z,a-z,0-9,_,-. If this results in an empty
  * string then it will return the alternative value supplied.
@@ -1132,9 +1160,7 @@ function convert_chars($content, $deprecated = '') {
 }
 
 /**
- * Will only balance the tags if forced to and the option is set to balance tags.
- *
- * The option 'use_balanceTags' is used to determine whether the tags will be balanced.
+ * Balances tags if forced to, or if the 'use_balanceTags' option is set to true.
  *
  * @since 0.71
  *
@@ -1143,9 +1169,10 @@ function convert_chars($content, $deprecated = '') {
  * @return string Balanced text
  */
 function balanceTags( $text, $force = false ) {
-       if ( !$force && get_option('use_balanceTags') == 0 )
+       if ( $force || get_option('use_balanceTags') == 1 )
+               return force_balance_tags( $text );
+       else
                return $text;
-       return force_balance_tags( $text );
 }
 
 /**
@@ -1342,9 +1369,9 @@ function zeroise($number, $threshold) {
  * @return string String with backslashes inserted.
  */
 function backslashit($string) {
-       $string = preg_replace('/^([0-9])/', '\\\\\\\\\1', $string);
-       $string = preg_replace('/([a-z])/i', '\\\\\1', $string);
-       return $string;
+       if ( isset( $string[0] ) && $string[0] >= '0' && $string[0] <= '9' )
+               $string = '\\\\' . $string;
+       return addcslashes( $string, 'A..Za..z' );
 }
 
 /**
@@ -1396,7 +1423,7 @@ function addslashes_gpc($gpc) {
        if ( get_magic_quotes_gpc() )
                $gpc = stripslashes($gpc);
 
-       return esc_sql($gpc);
+       return wp_slash($gpc);
 }
 
 /**
@@ -1692,12 +1719,12 @@ function wp_rel_nofollow( $text ) {
        // This is a pre save filter, so text is already escaped.
        $text = stripslashes($text);
        $text = preg_replace_callback('|<a (.+?)>|i', 'wp_rel_nofollow_callback', $text);
-       $text = esc_sql($text);
+       $text = wp_slash($text);
        return $text;
 }
 
 /**
- * Callback to used to add rel=nofollow string to HTML A element.
+ * Callback to add rel=nofollow string to HTML A element.
  *
  * Will remove already existing rel="nofollow" and rel='nofollow' from the
  * string to prevent from invalidating (X)HTML.
@@ -1868,6 +1895,7 @@ function wp_iso_descrambler($string) {
  *
  * @since 3.1.0
  * @access private
+ *
  * @param array $match The preg_replace_callback matches array
  * @return array Converted chars
  */
@@ -1878,39 +1906,31 @@ function _wp_iso_convert( $match ) {
 /**
  * Returns a date in the GMT equivalent.
  *
- * Requires and returns a date in the Y-m-d H:i:s format. Simply subtracts the
- * value of the 'gmt_offset' option. Return format can be overridden using the
- * $format parameter. The DateTime and DateTimeZone classes are used to respect
- * time zone differences in DST.
+ * Requires and returns a date in the Y-m-d H:i:s format. If there is a
+ * timezone_string available, the date is assumed to be in that timezone,
+ * otherwise it simply subtracts the value of the 'gmt_offset' option. Return
+ * format can be overridden using the $format parameter.
  *
  * @since 1.2.0
  *
- * @uses get_option() to retrieve the the value of 'gmt_offset'.
+ * @uses get_option() to retrieve the value of 'gmt_offset'.
  * @param string $string The date to be converted.
  * @param string $format The format string for the returned date (default is Y-m-d H:i:s)
  * @return string GMT version of the date provided.
  */
-function get_gmt_from_date($string, $format = 'Y-m-d H:i:s') {
-       preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches);
-       if ( ! $matches )
-               return date( $format, 0 );
-
-       $tz = get_option('timezone_string');
+function get_gmt_from_date( $string, $format = 'Y-m-d H:i:s' ) {
+       $tz = get_option( 'timezone_string' );
        if ( $tz ) {
-               date_default_timezone_set( $tz );
-               $datetime = date_create( $string );
+               $datetime = date_create( $string, new DateTimeZone( $tz ) );
                if ( ! $datetime )
-                       return date( $format, 0 );
-
-               $datetime->setTimezone( new DateTimeZone('UTC') );
-               $offset = $datetime->getOffset();
-               $datetime->modify( '+' . $offset / HOUR_IN_SECONDS . ' hours');
-               $string_gmt = gmdate($format, $datetime->format('U'));
-
-               date_default_timezone_set('UTC');
+                       return gmdate( $format, 0 );
+               $datetime->setTimezone( new DateTimeZone( 'UTC' ) );
+               $string_gmt = $datetime->format( $format );
        } else {
-               $string_time = gmmktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
-               $string_gmt = gmdate($format, $string_time - get_option('gmt_offset') * HOUR_IN_SECONDS);
+               if ( ! preg_match( '#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches ) )
+                       return gmdate( $format, 0 );
+               $string_time = gmmktime( $matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1] );
+               $string_gmt = gmdate( $format, $string_time - get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
        }
        return $string_gmt;
 }
@@ -1918,19 +1938,31 @@ function get_gmt_from_date($string, $format = 'Y-m-d H:i:s') {
 /**
  * Converts a GMT date into the correct format for the blog.
  *
- * Requires and returns in the Y-m-d H:i:s format. Simply adds the value of
- * gmt_offset.Return format can be overridden using the $format parameter
+ * Requires and returns a date in the Y-m-d H:i:s format. If there is a
+ * timezone_string available, the returned date is in that timezone, otherwise
+ * it simply adds the value of gmt_offset. Return format can be overridden
+ * using the $format parameter
  *
  * @since 1.2.0
  *
  * @param string $string The date to be converted.
  * @param string $format The format string for the returned date (default is Y-m-d H:i:s)
- * @return string Formatted date relative to the GMT offset.
+ * @return string Formatted date relative to the timezone / GMT offset.
  */
-function get_date_from_gmt($string, $format = 'Y-m-d H:i:s') {
-       preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches);
-       $string_time = gmmktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]);
-       $string_localtime = gmdate($format, $string_time + get_option('gmt_offset') * HOUR_IN_SECONDS);
+function get_date_from_gmt( $string, $format = 'Y-m-d H:i:s' ) {
+       $tz = get_option( 'timezone_string' );
+       if ( $tz ) {
+               $datetime = date_create( $string, new DateTimeZone( 'UTC' ) );
+               if ( ! $datetime )
+                       return date( $format, 0 );
+               $datetime->setTimezone( new DateTimeZone( $tz ) );
+               $string_localtime = $datetime->format( $format );
+       } else {
+               if ( ! preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches) )
+                       return date( $format, 0 );
+               $string_time = gmmktime( $matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1] );
+               $string_localtime = gmdate( $format, $string_time + get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
+       }
        return $string_localtime;
 }
 
@@ -2101,27 +2133,42 @@ function sanitize_email( $email ) {
 function human_time_diff( $from, $to = '' ) {
        if ( empty( $to ) )
                $to = time();
+
        $diff = (int) abs( $to - $from );
-       if ( $diff <= HOUR_IN_SECONDS ) {
+
+       if ( $diff < HOUR_IN_SECONDS ) {
                $mins = round( $diff / MINUTE_IN_SECONDS );
-               if ( $mins <= 1 ) {
+               if ( $mins <= 1 )
                        $mins = 1;
-               }
                /* translators: min=minute */
                $since = sprintf( _n( '%s min', '%s mins', $mins ), $mins );
-       } elseif ( ( $diff <= DAY_IN_SECONDS ) && ( $diff > HOUR_IN_SECONDS ) ) {
+       } elseif ( $diff < DAY_IN_SECONDS && $diff >= HOUR_IN_SECONDS ) {
                $hours = round( $diff / HOUR_IN_SECONDS );
-               if ( $hours <= 1 ) {
+               if ( $hours <= 1 )
                        $hours = 1;
-               }
                $since = sprintf( _n( '%s hour', '%s hours', $hours ), $hours );
-       } elseif ( $diff >= DAY_IN_SECONDS ) {
+       } elseif ( $diff < WEEK_IN_SECONDS && $diff >= DAY_IN_SECONDS ) {
                $days = round( $diff / DAY_IN_SECONDS );
-               if ( $days <= 1 ) {
+               if ( $days <= 1 )
                        $days = 1;
-               }
                $since = sprintf( _n( '%s day', '%s days', $days ), $days );
+       } elseif ( $diff < 30 * DAY_IN_SECONDS && $diff >= WEEK_IN_SECONDS ) {
+               $weeks = round( $diff / WEEK_IN_SECONDS );
+               if ( $weeks <= 1 )
+                       $weeks = 1;
+               $since = sprintf( _n( '%s week', '%s weeks', $weeks ), $weeks );
+       } elseif ( $diff < YEAR_IN_SECONDS && $diff >= 30 * DAY_IN_SECONDS ) {
+               $months = round( $diff / ( 30 * DAY_IN_SECONDS ) );
+               if ( $months <= 1 )
+                       $months = 1;
+               $since = sprintf( _n( '%s month', '%s months', $months ), $months );
+       } elseif ( $diff >= YEAR_IN_SECONDS ) {
+               $years = round( $diff / YEAR_IN_SECONDS );
+               if ( $years <= 1 )
+                       $years = 1;
+               $since = sprintf( _n( '%s year', '%s years', $years ), $years );
        }
+
        return $since;
 }
 
@@ -2129,11 +2176,11 @@ function human_time_diff( $from, $to = '' ) {
  * Generates an excerpt from the content, if needed.
  *
  * The excerpt word amount will be 55 words and if the amount is greater than
- * that, then the string ' [...]' will be appended to the excerpt. If the string
+ * that, then the string ' [&hellip;]' will be appended to the excerpt. If the string
  * is less than 55 words, then the content will be returned as is.
  *
  * The 55 word limit can be modified by plugins/themes using the excerpt_length filter
- * The ' [...]' string can be modified by plugins/themes using the excerpt_more filter
+ * The ' [&hellip;]' string can be modified by plugins/themes using the excerpt_more filter
  *
  * @since 1.5.0
  *
@@ -2150,7 +2197,7 @@ function wp_trim_excerpt($text = '') {
                $text = apply_filters('the_content', $text);
                $text = str_replace(']]>', ']]&gt;', $text);
                $excerpt_length = apply_filters('excerpt_length', 55);
-               $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');
+               $excerpt_more = apply_filters('excerpt_more', ' ' . '[&hellip;]');
                $text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
        }
        return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);
@@ -2167,7 +2214,7 @@ function wp_trim_excerpt($text = '') {
  *
  * @param string $text Text to trim.
  * @param int $num_words Number of words. Default 55.
- * @param string $more What to append if $text needs to be trimmed. Default '&hellip;'.
+ * @param string $more Optional. What to append if $text needs to be trimmed. Default '&hellip;'.
  * @return string Trimmed text.
  */
 function wp_trim_words( $text, $num_words = 55, $more = null ) {
@@ -2214,7 +2261,6 @@ function ent2ncr($text) {
        $to_ncr = array(
                '&quot;' => '&#34;',
                '&amp;' => '&#38;',
-               '&frasl;' => '&#47;',
                '&lt;' => '&#60;',
                '&gt;' => '&#62;',
                '|' => '&#124;',
@@ -2491,7 +2537,7 @@ function wp_richedit_pre($text) {
 
        $output = convert_chars($text);
        $output = wpautop($output);
-       $output = htmlspecialchars($output, ENT_NOQUOTES);
+       $output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) );
 
        return apply_filters('richedit_pre', $output);
 }
@@ -2509,7 +2555,7 @@ function wp_richedit_pre($text) {
  */
 function wp_htmledit_pre($output) {
        if ( !empty($output) )
-               $output = htmlspecialchars($output, ENT_NOQUOTES); // convert only < > &
+               $output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) ); // convert only < > &
 
        return apply_filters('htmledit_pre', $output);
 }
@@ -2545,17 +2591,19 @@ function _deep_replace( $search, $subject ) {
 }
 
 /**
- * Escapes data for use in a MySQL query
+ * Escapes data for use in a MySQL query.
  *
- * This is just a handy shortcut for $wpdb->escape(), for completeness' sake
+ * Usually you should prepare queries using wpdb::prepare().
+ * Sometimes, spot-escaping is required or useful. One example
+ * is preparing an array for use in an IN clause.
  *
  * @since 2.8.0
- * @param string $sql Unescaped SQL data
- * @return string The cleaned $sql
+ * @param string $data Unescaped data
+ * @return string Escaped data
  */
-function esc_sql( $sql ) {
+function esc_sql( $data ) {
        global $wpdb;
-       return $wpdb->escape( $sql );
+       return $wpdb->_escape( $data );
 }
 
 /**
@@ -2599,11 +2647,15 @@ function esc_url( $url, $protocols = null, $_context = 'display' ) {
                $url = str_replace( "'", '&#039;', $url );
        }
 
-       if ( ! is_array( $protocols ) )
-               $protocols = wp_allowed_protocols();
-       $good_protocol_url = wp_kses_bad_protocol( $url, $protocols );
-       if ( strtolower( $good_protocol_url ) != strtolower( $url ) )
-               return '';
+       if ( '/' === $url[0] ) {
+               $good_protocol_url = $url;
+       } else {
+               if ( ! is_array( $protocols ) )
+                       $protocols = wp_allowed_protocols();
+               $good_protocol_url = wp_kses_bad_protocol( $url, $protocols );
+               if ( strtolower( $good_protocol_url ) != strtolower( $url ) )
+                       return '';
+       }
 
        return apply_filters('clean_url', $good_protocol_url, $original_url, $_context);
 }
@@ -2690,18 +2742,18 @@ function esc_attr( $text ) {
 /**
  * Escaping for textarea values.
  *
- * @since 3.1
+ * @since 3.1.0
  *
  * @param string $text
  * @return string
  */
 function esc_textarea( $text ) {
-       $safe_text = htmlspecialchars( $text, ENT_QUOTES );
+       $safe_text = htmlspecialchars( $text, ENT_QUOTES, get_option( 'blog_charset' ) );
        return apply_filters( 'esc_textarea', $safe_text, $text );
 }
 
 /**
- * Escape a HTML tag name.
+ * Escape an HTML tag name.
  *
  * @since 2.5.0
  *
@@ -2976,7 +3028,7 @@ function wp_pre_kses_less_than_callback( $matches ) {
  * @return string The formatted string.
  */
 function wp_sprintf( $pattern ) {
-       $args = func_get_args( );
+       $args = func_get_args();
        $len = strlen($pattern);
        $start = 0;
        $result = '';
@@ -3085,16 +3137,21 @@ function wp_sprintf_l($pattern, $args) {
  *
  * @since 2.5.0
  *
- * @param integer $str String to get the excerpt from.
+ * @param string $str String to get the excerpt from.
  * @param integer $count Maximum number of characters to take.
+ * @param string $more Optional. What to append if $str needs to be trimmed. Defaults to empty string.
  * @return string The excerpt.
  */
-function wp_html_excerpt( $str, $count ) {
+function wp_html_excerpt( $str, $count, $more = null ) {
+       if ( null === $more )
+               $more = '';
        $str = wp_strip_all_tags( $str, true );
-       $str = mb_substr( $str, 0, $count );
+       $excerpt = mb_substr( $str, 0, $count );
        // remove part of an entity at the end
-       $str = preg_replace( '/&[^;\s]{0,6}$/', '', $str );
-       return $str;
+       $excerpt = preg_replace( '/&[^;\s]{0,6}$/', '', $excerpt );
+       if ( $str != $excerpt )
+               $excerpt = trim( $excerpt ) . $more;
+       return $excerpt;
 }
 
 /**
@@ -3170,14 +3227,21 @@ function links_add_target( $content, $target = '_blank', $tags = array('a') ) {
 function _links_add_target( $m ) {
        global $_links_add_target;
        $tag = $m[1];
-       $link = preg_replace('|(target=[\'"](.*?)[\'"])|i', '', $m[2]);
+       $link = preg_replace('|(target=([\'"])(.*?)\2)|i', '', $m[2]);
        return '<' . $tag . $link . ' target="' . esc_attr( $_links_add_target ) . '">';
 }
 
-// normalize EOL characters and strip duplicate whitespace
+/**
+ * Normalize EOL characters and strip duplicate whitespace.
+ *
+ * @since 2.7.0
+ *
+ * @param string $str The string to normalize.
+ * @return string The normalized string.
+ */
 function normalize_whitespace( $str ) {
-       $str  = trim($str);
-       $str  = str_replace("\r", "\n", $str);
+       $str  = trim( $str );
+       $str  = str_replace( "\r", "\n", $str );
        $str  = preg_replace( array( '/\n+/', '/[ \t]+/' ), array( "\n", ' ' ), $str );
        return $str;
 }
@@ -3226,7 +3290,6 @@ function sanitize_text_field($str) {
                $filtered = trim( preg_replace('/[\r\n\t ]+/', ' ', $filtered) );
        }
 
-       $match = array();
        $found = false;
        while ( preg_match('/%[a-f0-9]{2}/i', $filtered, $match) ) {
                $filtered = str_replace($match[0], '', $filtered);
@@ -3307,3 +3370,63 @@ function sanitize_trackback_urls( $to_ping ) {
        $urls_to_ping = implode( "\n", $urls_to_ping );
        return apply_filters( 'sanitize_trackback_urls', $urls_to_ping, $to_ping );
 }
+
+/**
+ * Add slashes to a string or array of strings.
+ *
+ * This should be used when preparing data for core API that expects slashed data.
+ * This should not be used to escape data going directly into an SQL query.
+ *
+ * @since 3.6.0
+ *
+ * @param string|array $value String or array of strings to slash.
+ * @return string|array Slashed $value
+ */
+function wp_slash( $value ) {
+       if ( is_array( $value ) ) {
+               foreach ( $value as $k => $v ) {
+                       if ( is_array( $v ) ) {
+                               $value[$k] = wp_slash( $v );
+                       } else {
+                               $value[$k] = addslashes( $v );
+                       }
+               }
+       } else {
+               $value = addslashes( $value );
+       }
+
+       return $value;
+}
+
+/**
+ * Remove slashes from a string or array of strings.
+ *
+ * This should be used to remove slashes from data passed to core API that
+ * expects data to be unslashed.
+ *
+ * @since 3.6.0
+ *
+ * @param string|array $value String or array of strings to unslash.
+ * @return string|array Unslashed $value
+ */
+function wp_unslash( $value ) {
+       return stripslashes_deep( $value );
+}
+
+/**
+ * Extract and return the first URL from passed content.
+ *
+ * @since 3.6.0
+ *
+ * @param string $content A string which might contain a URL.
+ * @return string The found URL.
+ */
+function get_url_in_content( $content ) {
+       if ( empty( $content ) )
+               return '';
+
+       if ( preg_match( '/<a\s[^>]*?href=([\'"])(.+?)\1/is', $content, $matches ) )
+               return esc_url_raw( $matches[2] );
+
+       return false;
+}
index e30a014223b60deefbe78efe9abf0aa84e67c1d6..f8b424a8b57e4f39fff8a836a04c670b46a91d29 100644 (file)
@@ -496,14 +496,13 @@ function wp_get_http( $url, $file_path = false, $red = 1 ) {
 
        $options = array();
        $options['redirection'] = 5;
-       $options['reject_unsafe_urls'] = true;
 
        if ( false == $file_path )
                $options['method'] = 'HEAD';
        else
                $options['method'] = 'GET';
 
-       $response = wp_remote_request($url, $options);
+       $response = wp_safe_remote_request( $url, $options );
 
        if ( is_wp_error( $response ) )
                return false;
@@ -544,7 +543,7 @@ function wp_get_http_headers( $url, $deprecated = false ) {
        if ( !empty( $deprecated ) )
                _deprecated_argument( __FUNCTION__, '2.7' );
 
-       $response = wp_remote_head( $url, array( 'reject_unsafe_urls' => true ) );
+       $response = wp_safe_remote_head( $url );
 
        if ( is_wp_error( $response ) )
                return false;
@@ -728,7 +727,7 @@ function remove_query_arg( $key, $query=false ) {
  *
  * @since 0.71
  *
- * @param array $array Array to used to walk while sanitizing contents.
+ * @param array $array Array to walk while sanitizing contents.
  * @return array Sanitized $array.
  */
 function add_magic_quotes( $array ) {
@@ -759,9 +758,8 @@ function wp_remote_fopen( $uri ) {
 
        $options = array();
        $options['timeout'] = 10;
-       $options['reject_unsafe_urls'] = true;
 
-       $response = wp_remote_get( $uri, $options );
+       $response = wp_safe_remote_get( $uri, $options );
 
        if ( is_wp_error( $response ) )
                return false;
@@ -1170,13 +1168,14 @@ function is_blog_installed() {
  * @subpackage Security
  * @since 2.0.4
  *
- * @param string $actionurl URL to add nonce action
- * @param string $action Optional. Nonce action name
+ * @param string $actionurl URL to add nonce action.
+ * @param string $action Optional. Nonce action name.
+ * @param string $name Optional. Nonce name.
  * @return string URL with nonce action added.
  */
-function wp_nonce_url( $actionurl, $action = -1 ) {
+function wp_nonce_url( $actionurl, $action = -1, $name = '_wpnonce' ) {
        $actionurl = str_replace( '&amp;', '&', $actionurl );
-       return esc_html( add_query_arg( '_wpnonce', wp_create_nonce( $action ), $actionurl ) );
+       return esc_html( add_query_arg( $name, wp_create_nonce( $action ), $actionurl ) );
 }
 
 /**
@@ -1234,8 +1233,7 @@ function wp_nonce_field( $action = -1, $name = "_wpnonce", $referer = true , $ec
  * @return string Referer field.
  */
 function wp_referer_field( $echo = true ) {
-       $ref = esc_attr( $_SERVER['REQUEST_URI'] );
-       $referer_field = '<input type="hidden" name="_wp_http_referer" value="'. $ref . '" />';
+       $referer_field = '<input type="hidden" name="_wp_http_referer" value="'. esc_attr( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '" />';
 
        if ( $echo )
                echo $referer_field;
@@ -1258,9 +1256,10 @@ function wp_referer_field( $echo = true ) {
  * @return string Original referer field.
  */
 function wp_original_referer_field( $echo = true, $jump_back_to = 'current' ) {
-       $jump_back_to = ( 'previous' == $jump_back_to ) ? wp_get_referer() : $_SERVER['REQUEST_URI'];
-       $ref = ( wp_get_original_referer() ) ? wp_get_original_referer() : $jump_back_to;
-       $orig_referer_field = '<input type="hidden" name="_wp_original_http_referer" value="' . esc_attr( stripslashes( $ref ) ) . '" />';
+       if ( ! $ref = wp_get_original_referer() ) {
+               $ref = 'previous' == $jump_back_to ? wp_get_referer() : wp_unslash( $_SERVER['REQUEST_URI'] );
+       }
+       $orig_referer_field = '<input type="hidden" name="_wp_original_http_referer" value="' . esc_attr( $ref ) . '" />';
        if ( $echo )
                echo $orig_referer_field;
        return $orig_referer_field;
@@ -1279,12 +1278,12 @@ function wp_original_referer_field( $echo = true, $jump_back_to = 'current' ) {
 function wp_get_referer() {
        $ref = false;
        if ( ! empty( $_REQUEST['_wp_http_referer'] ) )
-               $ref = $_REQUEST['_wp_http_referer'];
+               $ref = wp_unslash( $_REQUEST['_wp_http_referer'] );
        else if ( ! empty( $_SERVER['HTTP_REFERER'] ) )
-               $ref = $_SERVER['HTTP_REFERER'];
+               $ref = wp_unslash( $_SERVER['HTTP_REFERER'] );
 
-       if ( $ref && $ref !== $_SERVER['REQUEST_URI'] )
-               return $ref;
+       if ( $ref && $ref !== wp_unslash( $_SERVER['REQUEST_URI'] ) )
+               return wp_unslash( $ref );
        return false;
 }
 
@@ -1299,7 +1298,7 @@ function wp_get_referer() {
  */
 function wp_get_original_referer() {
        if ( !empty( $_REQUEST['_wp_original_http_referer'] ) )
-               return $_REQUEST['_wp_original_http_referer'];
+               return wp_unslash( $_REQUEST['_wp_original_http_referer'] );
        return false;
 }
 
@@ -1418,46 +1417,67 @@ function get_temp_dir() {
        if ( $temp )
                return trailingslashit( rtrim( $temp, '\\' ) );
 
-       $is_win = ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) );
-
        if ( function_exists('sys_get_temp_dir') ) {
                $temp = sys_get_temp_dir();
-               if ( @is_dir( $temp ) && ( $is_win ? win_is_writable( $temp ) : @is_writable( $temp ) ) ) {
+               if ( @is_dir( $temp ) && wp_is_writable( $temp ) )
                        return trailingslashit( rtrim( $temp, '\\' ) );
-               }
        }
 
        $temp = ini_get('upload_tmp_dir');
-       if ( is_dir( $temp ) && ( $is_win ? win_is_writable( $temp ) : @is_writable( $temp ) ) )
+       if ( is_dir( $temp ) && wp_is_writable( $temp ) )
                return trailingslashit( rtrim( $temp, '\\' ) );
 
        $temp = WP_CONTENT_DIR . '/';
-       if ( is_dir( $temp ) && ( $is_win ? win_is_writable( $temp ) : @is_writable( $temp ) ) )
+       if ( is_dir( $temp ) && wp_is_writable( $temp ) )
                return $temp;
 
        $temp = '/tmp/';
        return $temp;
 }
 
+/**
+ * Determine if a directory is writable.
+ *
+ * This function is used to work around certain ACL issues
+ * in PHP primarily affecting Windows Servers.
+ *
+ * @see win_is_writable()
+ *
+ * @since 3.6.0
+ *
+ * @param string $path
+ * @return bool
+ */
+function wp_is_writable( $path ) {
+       if ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) )
+               return win_is_writable( $path );
+       else
+               return @is_writable( $path );
+}
+
 /**
  * Workaround for Windows bug in is_writable() function
  *
+ * PHP has issues with Windows ACL's for determine if a
+ * directory is writable or not, this works around them by
+ * checking the ability to open files rather than relying
+ * upon PHP to interprate the OS ACL.
+ *
+ * @link http://bugs.php.net/bug.php?id=27609
+ * @link http://bugs.php.net/bug.php?id=30931
+ *
  * @since 2.8.0
  *
  * @param string $path
  * @return bool
  */
 function win_is_writable( $path ) {
-       /* will work in despite of Windows ACLs bug
-        * NOTE: use a trailing slash for folders!!!
-        * see http://bugs.php.net/bug.php?id=27609
-        * see http://bugs.php.net/bug.php?id=30931
-        */
 
-       if ( $path[strlen( $path ) - 1] == '/' ) // recursively return a temporary file path
+       if ( $path[strlen( $path ) - 1] == '/' ) // if it looks like a directory, check a random file within the directory
                return win_is_writable( $path . uniqid( mt_rand() ) . '.tmp');
-       else if ( is_dir( $path ) )
+       else if ( is_dir( $path ) ) // If it's a directory (and not a file) check a random file within the directory
                return win_is_writable( $path . '/' . uniqid( mt_rand() ) . '.tmp' );
+
        // check tmp file for read/write capabilities
        $should_delete_tmp_file = !file_exists( $path );
        $f = @fopen( $path, 'a' );
@@ -1893,7 +1913,10 @@ function wp_get_mime_types() {
        'tif|tiff' => 'image/tiff',
        'ico' => 'image/x-icon',
        // Video formats
-       'asf|asx|wax|wmv|wmx' => 'video/asf',
+       'asf|asx' => 'video/x-ms-asf',
+       'wmv' => 'video/x-ms-wmv',
+       'wmx' => 'video/x-ms-wmx',
+       'wm' => 'video/x-ms-wm',
        'avi' => 'video/avi',
        'divx' => 'video/divx',
        'flv' => 'video/x-flv',
@@ -1901,6 +1924,7 @@ function wp_get_mime_types() {
        'mpeg|mpg|mpe' => 'video/mpeg',
        'mp4|m4v' => 'video/mp4',
        'ogv' => 'video/ogg',
+       'webm' => 'video/webm',
        'mkv' => 'video/x-matroska',
        // Text formats
        'txt|asc|c|cc|h' => 'text/plain',
@@ -1916,7 +1940,8 @@ function wp_get_mime_types() {
        'wav' => 'audio/wav',
        'ogg|oga' => 'audio/ogg',
        'mid|midi' => 'audio/midi',
-       'wma' => 'audio/wma',
+       'wma' => 'audio/x-ms-wma',
+       'wax' => 'audio/x-ms-wax',
        'mka' => 'audio/x-matroska',
        // Misc application formats
        'rtf' => 'application/rtf',
@@ -1967,6 +1992,10 @@ function wp_get_mime_types() {
        'odf' => 'application/vnd.oasis.opendocument.formula',
        // WordPerfect formats
        'wp|wpd' => 'application/wordperfect',
+       // iWork formats
+       'key' => 'application/vnd.apple.keynote',
+       'numbers' => 'application/vnd.apple.numbers',
+       'pages' => 'application/vnd.apple.pages',
        ) );
 }
 /**
@@ -2718,8 +2747,8 @@ function wp_ob_end_flush_all() {
  * search engines from caching the message. Custom DB messages should do the
  * same.
  *
- * This function was backported to the the WordPress 2.3.2, but originally was
- * added in WordPress 2.5.0.
+ * This function was backported to WordPress 2.3.2, but originally was added
+ * in WordPress 2.5.0.
  *
  * @since 2.3.2
  * @uses $wpdb
@@ -2837,10 +2866,17 @@ function _deprecated_function( $function, $version, $replacement = null ) {
 
        // Allow plugin to filter the output error trigger
        if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) {
-               if ( ! is_null($replacement) )
-                       trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );
-               else
-                       trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );
+               if ( function_exists( '__' ) ) {
+                       if ( ! is_null( $replacement ) )
+                               trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );
+                       else
+                               trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );
+               } else {
+                       if ( ! is_null( $replacement ) )
+                               trigger_error( sprintf( '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $function, $version, $replacement ) );
+                       else
+                               trigger_error( sprintf( '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', $function, $version ) );
+               }
        }
 }
 
@@ -2877,10 +2913,17 @@ function _deprecated_file( $file, $version, $replacement = null, $message = '' )
        // Allow plugin to filter the output error trigger
        if ( WP_DEBUG && apply_filters( 'deprecated_file_trigger_error', true ) ) {
                $message = empty( $message ) ? '' : ' ' . $message;
-               if ( ! is_null( $replacement ) )
-                       trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) . $message );
-               else
-                       trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version ) . $message );
+               if ( function_exists( '__' ) ) {
+                       if ( ! is_null( $replacement ) )
+                               trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) . $message );
+                       else
+                               trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version ) . $message );
+               } else {
+                       if ( ! is_null( $replacement ) )
+                               trigger_error( sprintf( '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $file, $version, $replacement ) . $message );
+                       else
+                               trigger_error( sprintf( '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', $file, $version ) . $message );
+               }
        }
 }
 /**
@@ -2921,10 +2964,17 @@ function _deprecated_argument( $function, $version, $message = null ) {
 
        // Allow plugin to filter the output error trigger
        if ( WP_DEBUG && apply_filters( 'deprecated_argument_trigger_error', true ) ) {
-               if ( ! is_null( $message ) )
-                       trigger_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s'), $function, $version, $message ) );
-               else
-                       trigger_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );
+               if ( function_exists( '__' ) ) {
+                       if ( ! is_null( $message ) )
+                               trigger_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s'), $function, $version, $message ) );
+                       else
+                               trigger_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );
+               } else {
+                       if ( ! is_null( $message ) )
+                               trigger_error( sprintf( '%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s', $function, $version, $message ) );
+                       else
+                               trigger_error( sprintf( '%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.', $function, $version ) );
+               }
        }
 }
 
@@ -3011,7 +3061,7 @@ function apache_mod_loaded($mod, $default = false) {
 }
 
 /**
- * Check if IIS 7 supports pretty permalinks.
+ * Check if IIS 7+ supports pretty permalinks.
  *
  * @since 2.8.0
  *
@@ -3022,11 +3072,10 @@ function iis7_supports_permalinks() {
 
        $supports_permalinks = false;
        if ( $is_iis7 ) {
-               /* First we check if the DOMDocument class exists. If it does not exist,
-                * which is the case for PHP 4.X, then we cannot easily update the xml configuration file,
-                * hence we just bail out and tell user that pretty permalinks cannot be used.
-                * This is not a big issue because PHP 4.X is going to be deprecated and for IIS it
-                * is recommended to use PHP 5.X NTS.
+               /* First we check if the DOMDocument class exists. If it does not exist, then we cannot
+                * easily update the xml configuration file, hence we just bail out and tell user that
+                * pretty permalinks cannot be used.
+                *
                 * Next we check if the URL Rewrite Module 1.1 is loaded and enabled for the web site. When
                 * URL Rewrite 1.1 is loaded it always sets a server variable called 'IIS_UrlRewriteModule'.
                 * Lastly we make sure that PHP is running via FastCGI. This is important because if it runs
@@ -3308,7 +3357,7 @@ function _wp_timezone_choice_usort_callback( $a, $b ) {
 }
 
 /**
- * Gives a nicely formatted list of timezone strings. // temporary! Not in final
+ * Gives a nicely formatted list of timezone strings.
  *
  * @since 2.9.0
  *
@@ -3866,3 +3915,129 @@ function wp_is_stream( $path ) {
 function wp_checkdate( $month, $day, $year, $source_date ) {
        return apply_filters( 'wp_checkdate', checkdate( $month, $day, $year ), $source_date );
 }
+
+/**
+ * Load the auth check for monitoring whether the user is still logged in.
+ *
+ * Can be disabled with remove_action( 'admin_enqueue_scripts', 'wp_auth_check_load' );
+ *
+ * This is disabled for certain screens where a login screen could cause an
+ * inconvenient interruption. A filter called wp_auth_check_load can be used
+ * for fine-grained control.
+ *
+ * @since 3.6.0
+ */
+function wp_auth_check_load() {
+       if ( ! is_admin() && ! is_user_logged_in() )
+               return;
+
+       if ( defined( 'IFRAME_REQUEST' ) )
+               return;
+
+       $screen = get_current_screen();
+       $hidden = array( 'update', 'update-network', 'update-core', 'update-core-network', 'upgrade', 'upgrade-network', 'network' );
+       $show = ! in_array( $screen->id, $hidden );
+
+       if ( apply_filters( 'wp_auth_check_load', $show, $screen ) ) {
+               wp_enqueue_style( 'wp-auth-check' );
+               wp_enqueue_script( 'wp-auth-check' );
+
+               add_action( 'admin_print_footer_scripts', 'wp_auth_check_html', 5 );
+               add_action( 'wp_print_footer_scripts', 'wp_auth_check_html', 5 );
+       }
+}
+
+/**
+ * Output the HTML that shows the wp-login dialog when the user is no longer logged in.
+ *
+ * @since 3.6.0
+ */
+function wp_auth_check_html() {
+       $login_url = wp_login_url();
+       $current_domain = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'];
+       $same_domain = ( strpos( $login_url, $current_domain ) === 0 );
+
+       if ( $same_domain && force_ssl_login() && ! force_ssl_admin() )
+               $same_domain = false;
+
+       // Let plugins change this if they know better.
+       $same_domain = apply_filters( 'wp_auth_check_same_domain', $same_domain );
+       $wrap_class = $same_domain ? 'hidden' : 'hidden fallback';
+
+       ?>
+       <div id="wp-auth-check-wrap" class="<?php echo $wrap_class; ?>">
+       <div id="wp-auth-check-bg"></div>
+       <div id="wp-auth-check">
+       <div class="wp-auth-check-close" tabindex="0" title="<?php esc_attr_e('Close'); ?>"></div>
+       <?php
+
+       if ( $same_domain ) {
+               ?>
+               <div id="wp-auth-check-form" data-src="<?php echo esc_url( add_query_arg( array( 'interim-login' => 1 ), $login_url ) ); ?>"></div>
+               <?php
+       }
+
+       ?>
+       <div class="wp-auth-fallback">
+               <p><b class="wp-auth-fallback-expired" tabindex="0"><?php _e('Session expired'); ?></b></p>
+               <p><a href="<?php echo esc_url( $login_url ); ?>" target="_blank"><?php _e('Please log in again.'); ?></a>
+               <?php _e('The login page will open in a new window. After logging in you can close it and return to this page.'); ?></p>
+       </div>
+       </div>
+       </div>
+       <?php
+}
+
+/**
+ * Check whether a user is still logged in, for the heartbeat.
+ *
+ * Send a result that shows a log-in box if the user is no longer logged in,
+ * or if their cookie is within the grace period.
+ *
+ * @since 3.6.0
+ */
+function wp_auth_check( $response, $data ) {
+       $response['wp-auth-check'] = is_user_logged_in() && empty( $GLOBALS['login_grace_period'] );
+       return $response;
+}
+
+/**
+ * Return RegEx body to liberally match an opening HTML tag that:
+ * 1. Is self-closing or
+ * 2. Has no body but has a closing tag of the same name or
+ * 3. Contains a body and a closing tag of the same name
+ *
+ * Note: this RegEx does not balance inner tags and does not attempt to produce valid HTML
+ *
+ * @since 3.6.0
+ *
+ * @param string $tag An HTML tag name. Example: 'video'
+ * @return string
+ */
+function get_tag_regex( $tag ) {
+       if ( empty( $tag ) )
+               return;
+       return sprintf( '<%1$s[^<]*(?:>[\s\S]*<\/%1$s>|\s*\/>)', tag_escape( $tag ) );
+}
+
+/**
+ * Return a canonical form of the provided charset appropriate for passing to PHP
+ * functions such as htmlspecialchars() and charset html attributes.
+ *
+ * @link http://core.trac.wordpress.org/ticket/23688
+ * @since 3.6.0
+ *
+ * @param string A charset name
+ * @return string The canonical form of the charset
+ */
+function _canonical_charset( $charset ) {
+       if ( 'UTF-8' === $charset || 'utf-8' === $charset || 'utf8' === $charset ||
+               'UTF8' === $charset )
+               return 'UTF-8';
+
+       if ( 'ISO-8859-1' === $charset || 'iso-8859-1' === $charset ||
+               'iso8859-1' === $charset || 'ISO8859-1' === $charset )
+               return 'ISO-8859-1';
+
+       return $charset;
+}
index 49b760f04ae80b3cc8155fb65b63cee753fc8bca..32778ab5a215fa46eefdc52e494b11a366d76ed7 100644 (file)
@@ -27,7 +27,7 @@ function wp_print_scripts( $handles = false ) {
        if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
                if ( ! did_action( 'init' ) )
                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
 
                if ( !$handles )
                        return array(); // No need to instantiate if nothing is there.
@@ -54,7 +54,7 @@ function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_f
        if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
                if ( ! did_action( 'init' ) )
                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
                $wp_scripts = new WP_Scripts();
        }
 
@@ -66,7 +66,7 @@ function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_f
 /**
  * Wrapper for $wp_scripts->localize().
  *
- * Used to localizes a script.
+ * Used to localize a script.
  * Works only if the script has already been added.
  * Accepts an associative array $l10n and creates JS object:
  * "$object_name" = {
@@ -88,7 +88,7 @@ function wp_localize_script( $handle, $object_name, $l10n ) {
        if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
                if ( ! did_action( 'init' ) )
                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
 
                return false;
        }
@@ -107,10 +107,30 @@ function wp_deregister_script( $handle ) {
        if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
                if ( ! did_action( 'init' ) )
                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
                $wp_scripts = new WP_Scripts();
        }
 
+       // Do not allow accidental or negligent deregistering of critical scripts in the admin. Show minimal remorse if the correct hook is used.
+       if ( is_admin() && 'admin_enqueue_scripts' !== current_filter() ) {
+               $no = array(
+                       'jquery', 'jquery-core', 'jquery-migrate', 'jquery-ui-core', 'jquery-ui-accordion',
+                       'jquery-ui-autocomplete', 'jquery-ui-button', 'jquery-ui-datepicker', 'jquery-ui-dialog',
+                       'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-menu', 'jquery-ui-mouse',
+                       'jquery-ui-position', 'jquery-ui-progressbar', 'jquery-ui-resizable', 'jquery-ui-selectable',
+                       'jquery-ui-slider', 'jquery-ui-sortable', 'jquery-ui-spinner', 'jquery-ui-tabs',
+                       'jquery-ui-tooltip', 'jquery-ui-widget',
+                       'underscore', 'backbone',
+               );
+
+               if ( in_array( $handle, $no ) ) {
+                       $message = sprintf( __( 'Do not deregister the %1$s script in the administration area. To target the frontend theme, use the %2$s hook.' ),
+                               "<code>$handle</code>", '<code>wp_enqueue_scripts</code>' );
+                       _doing_it_wrong( __FUNCTION__, $message, '3.6' );
+                       return;
+               }
+       }
+
        $wp_scripts->remove( $handle );
 }
 
@@ -127,7 +147,7 @@ function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false
        if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
                if ( ! did_action( 'init' ) )
                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
                $wp_scripts = new WP_Scripts();
        }
 
@@ -151,7 +171,7 @@ function wp_dequeue_script( $handle ) {
        if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
                if ( ! did_action( 'init' ) )
                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
                $wp_scripts = new WP_Scripts();
        }
 
@@ -177,7 +197,7 @@ function wp_script_is( $handle, $list = 'enqueued' ) {
        if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {
                if ( ! did_action( 'init' ) )
                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
                $wp_scripts = new WP_Scripts();
        }
 
index 49095f3b7ae16a90f22f80678789e01a63e757c6..617fd8241d18782e452666cbacdae50c18dfa8be 100644 (file)
@@ -28,7 +28,7 @@ function wp_print_styles( $handles = false ) {
        if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
                if ( ! did_action( 'init' ) )
                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
 
                if ( !$handles )
                        return array(); // No need to instantiate if nothing is there.
@@ -55,7 +55,7 @@ function wp_add_inline_style( $handle, $data ) {
        if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
                if ( ! did_action( 'init' ) )
                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
                $wp_styles = new WP_Styles();
        }
 
@@ -83,7 +83,7 @@ function wp_register_style( $handle, $src, $deps = array(), $ver = false, $media
        if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
                if ( ! did_action( 'init' ) )
                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
                $wp_styles = new WP_Styles();
        }
 
@@ -104,7 +104,7 @@ function wp_deregister_style( $handle ) {
        if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
                if ( ! did_action( 'init' ) )
                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
                $wp_styles = new WP_Styles();
        }
 
@@ -135,7 +135,7 @@ function wp_enqueue_style( $handle, $src = false, $deps = array(), $ver = false,
        if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
                if ( ! did_action( 'init' ) )
                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
                $wp_styles = new WP_Styles();
        }
 
@@ -157,7 +157,7 @@ function wp_dequeue_style( $handle ) {
        if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
                if ( ! did_action( 'init' ) )
                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
                $wp_styles = new WP_Styles();
        }
 
@@ -184,9 +184,35 @@ function wp_style_is( $handle, $list = 'enqueued' ) {
        if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {
                if ( ! did_action( 'init' ) )
                        _doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),
-                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );
+                               '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>' ), '3.3' );
                $wp_styles = new WP_Styles();
        }
 
        return (bool) $wp_styles->query( $handle, $list );
 }
+
+/**
+ * Add metadata to CSS style files.
+ *
+ * Works only if the stylesheet has already been added.
+ * Possible values for $key and $value:
+ *
+ * conditional string      comments for IE 6, lte IE 7 etc.
+ * rtl         bool|string to declare an RTL stylesheet
+ * suffix      string      optional suffix, used in combination with RTL
+ * alt         bool        for rel="alternate stylesheet"
+ * title       string      for preferred/alternate stylesheets
+ *
+ * @since 3.6.0
+ * @see WP_Dependencies::add_data()
+ *
+ * @param string $handle Script name.
+ * @param string $key Name of data point for which we're storing a value.
+ *  Values are 'conditional', 'rtl', and 'suffix', and 'alt', 'title'.
+ * @param mixed $data
+ * @return bool True on success, false on failure.
+ */
+function wp_style_add_data( $handle, $key, $value ) {
+       global $wp_styles;
+       return $wp_styles->add_data( $handle, $key, $value );
+}
index af3d572e5916d9867a6b52b16fd04634145caa11..b586762473e4b85a9860f2181d924b4e76658ba0 100644 (file)
@@ -25,7 +25,8 @@ function get_header( $name = null ) {
        do_action( 'get_header', $name );
 
        $templates = array();
-       if ( isset($name) )
+       $name = (string) $name;
+       if ( '' !== $name )
                $templates[] = "header-{$name}.php";
 
        $templates[] = 'header.php';
@@ -54,7 +55,8 @@ function get_footer( $name = null ) {
        do_action( 'get_footer', $name );
 
        $templates = array();
-       if ( isset($name) )
+       $name = (string) $name;
+       if ( '' !== $name )
                $templates[] = "footer-{$name}.php";
 
        $templates[] = 'footer.php';
@@ -83,7 +85,8 @@ function get_sidebar( $name = null ) {
        do_action( 'get_sidebar', $name );
 
        $templates = array();
-       if ( isset($name) )
+       $name = (string) $name;
+       if ( '' !== $name )
                $templates[] = "sidebar-{$name}.php";
 
        $templates[] = 'sidebar.php';
@@ -120,7 +123,8 @@ function get_template_part( $slug, $name = null ) {
        do_action( "get_template_part_{$slug}", $slug, $name );
 
        $templates = array();
-       if ( isset($name) )
+       $name = (string) $name;
+       if ( '' !== $name )
                $templates[] = "{$slug}-{$name}.php";
 
        $templates[] = "{$slug}.php";
@@ -141,34 +145,56 @@ function get_template_part( $slug, $name = null ) {
  * form into the sidebar and also by the search widget in WordPress.
  *
  * There is also an action that is called whenever the function is run called,
- * 'get_search_form'. This can be useful for outputting JavaScript that the
+ * 'pre_get_search_form'. This can be useful for outputting JavaScript that the
  * search relies on or various formatting that applies to the beginning of the
  * search. To give a few examples of what it can be used for.
  *
  * @since 2.7.0
+ * @uses apply_filters() Calls 'search_form_format' filter to determine which type to use for the search field.
+ *  If set to 'html5', it changes to search input type and adds placeholder text.
+ *
  * @param boolean $echo Default to echo and not return the form.
  * @return string|null String when retrieving, null when displaying or if searchform.php exists.
  */
-function get_search_form($echo = true) {
-       do_action( 'get_search_form' );
+function get_search_form( $echo = true ) {
+       do_action( 'pre_get_search_form' );
+
+       $format = current_theme_supports( 'html5', 'search-form' ) ? 'html5' : 'xhtml';
+       $format = apply_filters( 'search_form_format', $format );
 
-       $search_form_template = locate_template('searchform.php');
+       $search_form_template = locate_template( 'searchform.php' );
        if ( '' != $search_form_template ) {
-               require($search_form_template);
-               return;
+               ob_start();
+               require( $search_form_template );
+               $form = ob_get_clean();
+       } else {
+               if ( 'html5' == $format ) {
+                       $form = '<form role="search" method="get" class="search-form" action="' . esc_url( home_url( '/' ) ) . '">
+                               <label>
+                                       <span class="screen-reader-text">' . _x( 'Search for:', 'label' ) . '</span>
+                                       <input type="search" class="search-field" placeholder="' . esc_attr_x( 'Search &hellip;', 'placeholder' ) . '" value="' . get_search_query() . '" name="s" title="' . _x( 'Search for:', 'label' ) . '" />
+                               </label>
+                               <input type="submit" class="search-submit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
+                       </form>';
+               } else {
+                       $form = '<form role="search" method="get" id="searchform" class="searchform" action="' . esc_url( home_url( '/' ) ) . '">
+                               <div>
+                                       <label class="screen-reader-text" for="s">' . _x( 'Search for:', 'label' ) . '</label>
+                                       <input type="text" value="' . get_search_query() . '" name="s" id="s" />
+                                       <input type="submit" id="searchsubmit" value="'. esc_attr_x( 'Search', 'submit button' ) .'" />
+                               </div>
+                       </form>';
+               }
        }
 
-       $form = '<form role="search" method="get" id="searchform" action="' . esc_url( home_url( '/' ) ) . '" >
-       <div><label class="screen-reader-text" for="s">' . __('Search for:') . '</label>
-       <input type="text" value="' . get_search_query() . '" name="s" id="s" />
-       <input type="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" />
-       </div>
-       </form>';
+       $result = apply_filters( 'get_search_form', $form );
+       if ( null === $result )
+               $result = $form;
 
        if ( $echo )
-               echo apply_filters('get_search_form', $form);
+               echo $result;
        else
-               return apply_filters('get_search_form', $form);
+               return $result;
 }
 
 /**
@@ -199,12 +225,12 @@ function wp_loginout($redirect = '', $echo = true) {
 /**
  * Returns the Log Out URL.
  *
- * Returns the URL that allows the user to log out of the site
+ * Returns the URL that allows the user to log out of the site.
  *
  * @since 2.7.0
- * @uses wp_nonce_url() To protect against CSRF
- * @uses site_url() To generate the log in URL
- * @uses apply_filters() calls 'logout_url' hook on final logout url
+ * @uses wp_nonce_url() To protect against CSRF.
+ * @uses site_url() To generate the log out URL.
+ * @uses apply_filters() calls 'logout_url' hook on final logout URL.
  *
  * @param string $redirect Path to redirect to on logout.
  * @return string A log out URL.
@@ -224,11 +250,11 @@ function wp_logout_url($redirect = '') {
 /**
  * Returns the Log In URL.
  *
- * Returns the URL that allows the user to log in to the site
+ * Returns the URL that allows the user to log in to the site.
  *
  * @since 2.7.0
- * @uses site_url() To generate the log in URL
- * @uses apply_filters() calls 'login_url' hook on final login url
+ * @uses site_url() To generate the log in URL.
+ * @uses apply_filters() calls 'login_url' hook on final login URL.
  *
  * @param string $redirect Path to redirect to on login.
  * @param bool $force_reauth Whether to force reauthorization, even if a cookie is present. Default is false.
@@ -246,6 +272,21 @@ function wp_login_url($redirect = '', $force_reauth = false) {
        return apply_filters('login_url', $login_url, $redirect);
 }
 
+/**
+ * Returns the user registration URL.
+ *
+ * Returns the URL that allows the user to register on the site.
+ *
+ * @since 3.6.0
+ * @uses site_url() To generate the registration URL.
+ * @uses apply_filters() calls 'register_url' hook on final URL.
+ *
+ * @return string
+ */
+function wp_registration_url() {
+       return apply_filters( 'register_url', site_url( 'wp-login.php?action=register', 'login' ) );
+}
+
 /**
  * Provides a simple login form for use anywhere within WordPress. By default, it echoes
  * the HTML immediately. Pass array('echo'=>false) to return the string instead.
@@ -255,21 +296,22 @@ function wp_login_url($redirect = '', $force_reauth = false) {
  * @return string|null String when retrieving, null when displaying.
  */
 function wp_login_form( $args = array() ) {
-       $defaults = array( 'echo' => true,
-                                               'redirect' => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], // Default redirect is back to the current page
-                                               'form_id' => 'loginform',
-                                               'label_username' => __( 'Username' ),
-                                               'label_password' => __( 'Password' ),
-                                               'label_remember' => __( 'Remember Me' ),
-                                               'label_log_in' => __( 'Log In' ),
-                                               'id_username' => 'user_login',
-                                               'id_password' => 'user_pass',
-                                               'id_remember' => 'rememberme',
-                                               'id_submit' => 'wp-submit',
-                                               'remember' => true,
-                                               'value_username' => '',
-                                               'value_remember' => false, // Set this to true to default the "Remember me" checkbox to checked
-                                       );
+       $defaults = array(
+               'echo' => true,
+               'redirect' => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], // Default redirect is back to the current page
+               'form_id' => 'loginform',
+               'label_username' => __( 'Username' ),
+               'label_password' => __( 'Password' ),
+               'label_remember' => __( 'Remember Me' ),
+               'label_log_in' => __( 'Log In' ),
+               'id_username' => 'user_login',
+               'id_password' => 'user_pass',
+               'id_remember' => 'rememberme',
+               'id_submit' => 'wp-submit',
+               'remember' => true,
+               'value_username' => '',
+               'value_remember' => false, // Set this to true to default the "Remember me" checkbox to checked
+       );
        $args = wp_parse_args( $args, apply_filters( 'login_form_defaults', $defaults ) );
 
        $form = '
@@ -338,7 +380,7 @@ function wp_register( $before = '<li>', $after = '</li>', $echo = true ) {
 
        if ( ! is_user_logged_in() ) {
                if ( get_option('users_can_register') )
-                       $link = $before . '<a href="' . site_url('wp-login.php?action=register', 'login') . '">' . __('Register') . '</a>' . $after;
+                       $link = $before . '<a href="' . esc_url( wp_registration_url() ) . '">' . __('Register') . '</a>' . $after;
                else
                        $link = '';
        } else {
@@ -912,103 +954,97 @@ function wp_get_archives($args = '') {
                $archive_week_end_date_format = get_option('date_format');
        }
 
-       //filters
        $where = apply_filters( 'getarchives_where', "WHERE post_type = 'post' AND post_status = 'publish'", $r );
        $join = apply_filters( 'getarchives_join', '', $r );
 
        $output = '';
 
+       $last_changed = wp_cache_get( 'last_changed', 'posts' );
+       if ( ! $last_changed ) {
+               $last_changed = microtime();
+               wp_cache_set( 'last_changed', $last_changed, 'posts' );
+       }
+
        if ( 'monthly' == $type ) {
                $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date $order $limit";
-               $key = md5($query);
-               $cache = wp_cache_get( 'wp_get_archives' , 'general');
-               if ( !isset( $cache[ $key ] ) ) {
-                       $arcresults = $wpdb->get_results($query);
-                       $cache[ $key ] = $arcresults;
-                       wp_cache_set( 'wp_get_archives', $cache, 'general' );
-               } else {
-                       $arcresults = $cache[ $key ];
+               $key = md5( $query );
+               $key = "wp_get_archives:$key:$last_changed";
+               if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
+                       $results = $wpdb->get_results( $query );
+                       wp_cache_set( $key, $results, 'posts' );
                }
-               if ( $arcresults ) {
+               if ( $results ) {
                        $afterafter = $after;
-                       foreach ( (array) $arcresults as $arcresult ) {
-                               $url = get_month_link( $arcresult->year, $arcresult->month );
+                       foreach ( (array) $results as $result ) {
+                               $url = get_month_link( $result->year, $result->month );
                                /* translators: 1: month name, 2: 4-digit year */
-                               $text = sprintf(__('%1$s %2$d'), $wp_locale->get_month($arcresult->month), $arcresult->year);
+                               $text = sprintf(__('%1$s %2$d'), $wp_locale->get_month($result->month), $result->year);
                                if ( $show_post_count )
-                                       $after = '&nbsp;('.$arcresult->posts.')' . $afterafter;
+                                       $after = '&nbsp;('.$result->posts.')' . $afterafter;
                                $output .= get_archives_link($url, $text, $format, $before, $after);
                        }
                }
        } elseif ('yearly' == $type) {
                $query = "SELECT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date) ORDER BY post_date $order $limit";
-               $key = md5($query);
-               $cache = wp_cache_get( 'wp_get_archives' , 'general');
-               if ( !isset( $cache[ $key ] ) ) {
-                       $arcresults = $wpdb->get_results($query);
-                       $cache[ $key ] = $arcresults;
-                       wp_cache_set( 'wp_get_archives', $cache, 'general' );
-               } else {
-                       $arcresults = $cache[ $key ];
+               $key = md5( $query );
+               $key = "wp_get_archives:$key:$last_changed";
+               if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
+                       $results = $wpdb->get_results( $query );
+                       wp_cache_set( $key, $results, 'posts' );
                }
-               if ($arcresults) {
+               if ( $results ) {
                        $afterafter = $after;
-                       foreach ( (array) $arcresults as $arcresult) {
-                               $url = get_year_link($arcresult->year);
-                               $text = sprintf('%d', $arcresult->year);
+                       foreach ( (array) $results as $result) {
+                               $url = get_year_link($result->year);
+                               $text = sprintf('%d', $result->year);
                                if ($show_post_count)
-                                       $after = '&nbsp;('.$arcresult->posts.')' . $afterafter;
+                                       $after = '&nbsp;('.$result->posts.')' . $afterafter;
                                $output .= get_archives_link($url, $text, $format, $before, $after);
                        }
                }
        } elseif ( 'daily' == $type ) {
                $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date $order $limit";
-               $key = md5($query);
-               $cache = wp_cache_get( 'wp_get_archives' , 'general');
-               if ( !isset( $cache[ $key ] ) ) {
-                       $arcresults = $wpdb->get_results($query);
-                       $cache[ $key ] = $arcresults;
-                       wp_cache_set( 'wp_get_archives', $cache, 'general' );
-               } else {
-                       $arcresults = $cache[ $key ];
+               $key = md5( $query );
+               $key = "wp_get_archives:$key:$last_changed";
+               if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
+                       $results = $wpdb->get_results( $query );
+                       $cache[ $key ] = $results;
+                       wp_cache_set( $key, $results, 'posts' );
                }
-               if ( $arcresults ) {
+               if ( $results ) {
                        $afterafter = $after;
-                       foreach ( (array) $arcresults as $arcresult ) {
-                               $url    = get_day_link($arcresult->year, $arcresult->month, $arcresult->dayofmonth);
-                               $date = sprintf('%1$d-%2$02d-%3$02d 00:00:00', $arcresult->year, $arcresult->month, $arcresult->dayofmonth);
+                       foreach ( (array) $results as $result ) {
+                               $url    = get_day_link($result->year, $result->month, $result->dayofmonth);
+                               $date = sprintf('%1$d-%2$02d-%3$02d 00:00:00', $result->year, $result->month, $result->dayofmonth);
                                $text = mysql2date($archive_day_date_format, $date);
                                if ($show_post_count)
-                                       $after = '&nbsp;('.$arcresult->posts.')'.$afterafter;
+                                       $after = '&nbsp;('.$result->posts.')'.$afterafter;
                                $output .= get_archives_link($url, $text, $format, $before, $after);
                        }
                }
        } elseif ( 'weekly' == $type ) {
                $week = _wp_mysql_week( '`post_date`' );
                $query = "SELECT DISTINCT $week AS `week`, YEAR( `post_date` ) AS `yr`, DATE_FORMAT( `post_date`, '%Y-%m-%d' ) AS `yyyymmdd`, count( `ID` ) AS `posts` FROM `$wpdb->posts` $join $where GROUP BY $week, YEAR( `post_date` ) ORDER BY `post_date` $order $limit";
-               $key = md5($query);
-               $cache = wp_cache_get( 'wp_get_archives' , 'general');
-               if ( !isset( $cache[ $key ] ) ) {
-                       $arcresults = $wpdb->get_results($query);
-                       $cache[ $key ] = $arcresults;
-                       wp_cache_set( 'wp_get_archives', $cache, 'general' );
-               } else {
-                       $arcresults = $cache[ $key ];
+               $key = md5( $query );
+               $key = "wp_get_archives:$key:$last_changed";
+               if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
+                       $results = $wpdb->get_results( $query );
+                       wp_cache_set( $key, $results, 'posts' );
                }
                $arc_w_last = '';
                $afterafter = $after;
-               if ( $arcresults ) {
-                               foreach ( (array) $arcresults as $arcresult ) {
-                                       if ( $arcresult->week != $arc_w_last ) {
-                                               $arc_year = $arcresult->yr;
-                                               $arc_w_last = $arcresult->week;
-                                               $arc_week = get_weekstartend($arcresult->yyyymmdd, get_option('start_of_week'));
+               if ( $results ) {
+                               foreach ( (array) $results as $result ) {
+                                       if ( $result->week != $arc_w_last ) {
+                                               $arc_year = $result->yr;
+                                               $arc_w_last = $result->week;
+                                               $arc_week = get_weekstartend($result->yyyymmdd, get_option('start_of_week'));
                                                $arc_week_start = date_i18n($archive_week_start_date_format, $arc_week['start']);
                                                $arc_week_end = date_i18n($archive_week_end_date_format, $arc_week['end']);
-                                               $url  = sprintf('%1$s/%2$s%3$sm%4$s%5$s%6$sw%7$s%8$d', home_url(), '', '?', '=', $arc_year, '&amp;', '=', $arcresult->week);
+                                               $url  = sprintf('%1$s/%2$s%3$sm%4$s%5$s%6$sw%7$s%8$d', home_url(), '', '?', '=', $arc_year, '&amp;', '=', $result->week);
                                                $text = $arc_week_start . $archive_week_separator . $arc_week_end;
                                                if ($show_post_count)
-                                                       $after = '&nbsp;('.$arcresult->posts.')'.$afterafter;
+                                                       $after = '&nbsp;('.$result->posts.')'.$afterafter;
                                                $output .= get_archives_link($url, $text, $format, $before, $after);
                                        }
                                }
@@ -1016,23 +1052,20 @@ function wp_get_archives($args = '') {
        } elseif ( ( 'postbypost' == $type ) || ('alpha' == $type) ) {
                $orderby = ('alpha' == $type) ? 'post_title ASC ' : 'post_date DESC ';
                $query = "SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit";
-               $key = md5($query);
-               $cache = wp_cache_get( 'wp_get_archives' , 'general');
-               if ( !isset( $cache[ $key ] ) ) {
-                       $arcresults = $wpdb->get_results($query);
-                       $cache[ $key ] = $arcresults;
-                       wp_cache_set( 'wp_get_archives', $cache, 'general' );
-               } else {
-                       $arcresults = $cache[ $key ];
+               $key = md5( $query );
+               $key = "wp_get_archives:$key:$last_changed";
+               if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
+                       $results = $wpdb->get_results( $query );
+                       wp_cache_set( $key, $results, 'posts' );
                }
-               if ( $arcresults ) {
-                       foreach ( (array) $arcresults as $arcresult ) {
-                               if ( $arcresult->post_date != '0000-00-00 00:00:00' ) {
-                                       $url  = get_permalink( $arcresult );
-                                       if ( $arcresult->post_title )
-                                               $text = strip_tags( apply_filters( 'the_title', $arcresult->post_title, $arcresult->ID ) );
+               if ( $results ) {
+                       foreach ( (array) $results as $result ) {
+                               if ( $result->post_date != '0000-00-00 00:00:00' ) {
+                                       $url  = get_permalink( $result );
+                                       if ( $result->post_title )
+                                               $text = strip_tags( apply_filters( 'the_title', $result->post_title, $result->ID ) );
                                        else
-                                               $text = $arcresult->ID;
+                                               $text = $result->ID;
                                        $output .= get_archives_link($url, $text, $format, $before, $after);
                                }
                        }
@@ -1552,7 +1585,7 @@ function the_weekday() {
  * @param string $after Optional Output after the date.
  */
 function the_weekday_date($before='',$after='') {
-       global $wp_locale, $day, $previousweekday;
+       global $wp_locale, $currentday, $previousweekday;
        $the_weekday_date = '';
        if ( $currentday != $previousweekday ) {
                $the_weekday_date .= $before;
@@ -1600,7 +1633,7 @@ function feed_links( $args = array() ) {
                'separator'     => _x('&raquo;', 'feed link'),
                /* translators: 1: blog title, 2: separator (raquo) */
                'feedtitle'     => __('%1$s %2$s Feed'),
-               /* translators: %s: blog title, 2: separator (raquo) */
+               /* translators: 1: blog title, 2: separator (raquo) */
                'comstitle'     => __('%1$s %2$s Comments Feed'),
        );
 
@@ -2284,3 +2317,23 @@ function __checked_selected_helper( $helper, $current, $echo, $type ) {
 
        return $result;
 }
+
+/**
+ * Default settings for heartbeat
+ *
+ * Outputs the nonce used in the heartbeat XHR
+ *
+ * @since 3.6.0
+ *
+ * @param array $settings
+ * @return array $settings
+ */
+function wp_heartbeat_settings( $settings ) {
+       if ( ! is_admin() )
+               $settings['ajaxurl'] = admin_url( 'admin-ajax.php', 'relative' );
+
+       if ( is_user_logged_in() )
+               $settings['nonce'] = wp_create_nonce( 'heartbeat-nonce' );
+
+       return $settings;
+}
index a196f688b8031c5d1d5e4775454938435d20f490..59dfa55ce9f11d338399bbfa410a9f1bd861b9c2 100644 (file)
@@ -28,6 +28,90 @@ function _wp_http_get_object() {
        return $http;
 }
 
+/**
+ * Retrieve the raw response from a safe HTTP request.
+ *
+ * This function is ideal when the HTTP request is being made to an arbitrary
+ * URL. The URL is validated to avoid redirection and request forgery attacks.
+ *
+ * @see wp_remote_request() For more information on the response array format
+ *     and default arguments.
+ *
+ * @since 3.6.0
+ *
+ * @param string $url Site URL to retrieve.
+ * @param array $args Optional. Override the defaults.
+ * @return WP_Error|array The response or WP_Error on failure.
+ */
+function wp_safe_remote_request( $url, $args = array() ) {
+       $args['reject_unsafe_urls'] = true;
+       $http = _wp_http_get_object();
+       return $http->request( $url, $args );
+}
+
+/**
+ * Retrieve the raw response from a safe HTTP request using the GET method.
+ *
+ * This function is ideal when the HTTP request is being made to an arbitrary
+ * URL. The URL is validated to avoid redirection and request forgery attacks.
+ *
+ * @see wp_remote_request() For more information on the response array format
+ *     and default arguments.
+ *
+ * @since 3.6.0
+ *
+ * @param string $url Site URL to retrieve.
+ * @param array $args Optional. Override the defaults.
+ * @return WP_Error|array The response or WP_Error on failure.
+ */
+function wp_safe_remote_get( $url, $args = array() ) {
+       $args['reject_unsafe_urls'] = true;
+       $http = _wp_http_get_object();
+       return $http->get( $url, $args );
+}
+
+/**
+ * Retrieve the raw response from a safe HTTP request using the POST method.
+ *
+ * This function is ideal when the HTTP request is being made to an arbitrary
+ * URL. The URL is validated to avoid redirection and request forgery attacks.
+ *
+ * @see wp_remote_request() For more information on the response array format
+ *     and default arguments.
+ *
+ * @since 3.6.0
+ *
+ * @param string $url Site URL to retrieve.
+ * @param array $args Optional. Override the defaults.
+ * @return WP_Error|array The response or WP_Error on failure.
+ */
+function wp_safe_remote_post( $url, $args = array() ) {
+       $args['reject_unsafe_urls'] = true;
+       $http = _wp_http_get_object();
+       return $http->post( $url, $args );
+}
+
+/**
+ * Retrieve the raw response from a safe HTTP request using the HEAD method.
+ *
+ * This function is ideal when the HTTP request is being made to an arbitrary
+ * URL. The URL is validated to avoid redirection and request forgery attacks.
+ *
+ * @see wp_remote_request() For more information on the response array format
+ *     and default arguments.
+ *
+ * @since 3.6.0
+ *
+ * @param string $url Site URL to retrieve.
+ * @param array $args Optional. Override the defaults.
+ * @return WP_Error|array The response or WP_Error on failure.
+ */
+function wp_safe_remote_head( $url, $args = array() ) {
+       $args['reject_unsafe_urls'] = true;
+       $http = _wp_http_get_object();
+       return $http->head( $url, $args );
+}
+
 /**
  * Retrieve the raw response from the HTTP request.
  *
@@ -49,6 +133,25 @@ function _wp_http_get_object() {
  * This function is called first to make the request and there are other API
  * functions to abstract out the above convoluted setup.
  *
+ * List of default arguments:
+ * 'method'      => 'GET'
+ *  - Default 'GET'  for wp_remote_get()
+ *  - Default 'POST' for wp_remote_post()
+ *  - Default 'HEAD' for wp_remote_head()
+ * 'timeout'     => 5
+ * 'redirection' => 5
+ * 'httpversion' => '1.0'
+ * 'user-agent'  => 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' )
+ * 'blocking'    => true
+ * 'headers'     => array()
+ * 'cookies'     => array()
+ * 'body'        => null
+ * 'compress'    => false,
+ * 'decompress'  => true,
+ * 'sslverify'   => true,
+ * 'stream'      => false,
+ * 'filename'    => null
+ *
  * @since 2.7.0
  *
  * @param string $url Site URL to retrieve.
@@ -63,7 +166,7 @@ function wp_remote_request($url, $args = array()) {
 /**
  * Retrieve the raw response from the HTTP request using the GET method.
  *
- * @see wp_remote_request() For more information on the response array format.
+ * @see wp_remote_request() For more information on the response array format and default arguments.
  *
  * @since 2.7.0
  *
@@ -79,7 +182,7 @@ function wp_remote_get($url, $args = array()) {
 /**
  * Retrieve the raw response from the HTTP request using the POST method.
  *
- * @see wp_remote_request() For more information on the response array format.
+ * @see wp_remote_request() For more information on the response array format and default arguments.
  *
  * @since 2.7.0
  *
@@ -95,7 +198,7 @@ function wp_remote_post($url, $args = array()) {
 /**
  * Retrieve the raw response from the HTTP request using the HEAD method.
  *
- * @see wp_remote_request() For more information on the response array format.
+ * @see wp_remote_request() For more information on the response array format and default arguments.
  *
  * @since 2.7.0
  *
@@ -320,12 +423,12 @@ function send_origin_headers() {
  * @return mixed URL or false on failure.
  */
 function wp_http_validate_url( $url ) {
-       $url = esc_url_raw( $url, array( 'http', 'https' ) );
+       $url = wp_kses_bad_protocol( $url, array( 'http', 'https' ) );
        if ( ! $url )
                return false;
 
        $parsed_url = @parse_url( $url );
-       if ( ! $parsed_url )
+       if ( ! $parsed_url || empty( $parsed_url['host'] ) )
                return false;
 
        if ( isset( $parsed_url['user'] ) || isset( $parsed_url['pass'] ) )
@@ -348,15 +451,16 @@ function wp_http_validate_url( $url ) {
                                $ip = false;
                }
                if ( $ip ) {
-                       if ( '127.0.0.1' === $ip )
-                               return false;
                        $parts = array_map( 'intval', explode( '.', $ip ) );
-                       if ( 10 === $parts[0] )
-                               return false;
-                       if ( 172 === $parts[0] && 16 <= $parts[1] && 31 >= $parts[1] )
-                               return false;
-                       if ( 192 === $parts[0] && 168 === $parts[1] )
-                               return false;
+                       if ( '127.0.0.1' === $ip
+                               || ( 10 === $parts[0] )
+                               || ( 172 === $parts[0] && 16 <= $parts[1] && 31 >= $parts[1] )
+                               || ( 192 === $parts[0] && 168 === $parts[1] )
+                       ) {
+                               // If host appears local, reject unless specifically allowed.
+                               if ( ! apply_filters( 'http_request_host_is_external', false, $host, $url ) )
+                                       return false;
+                       }
                }
        }
 
@@ -372,3 +476,44 @@ function wp_http_validate_url( $url ) {
 
        return false;
 }
+
+/**
+ * Whitelists allowed redirect hosts for safe HTTP requests as well.
+ *
+ * Attached to the http_request_host_is_external filter.
+ *
+ * @since 3.6.0
+ *
+ * @param bool $is_external
+ * @param string $host
+ * @return bool
+ */
+function allowed_http_request_hosts( $is_external, $host ) {
+       if ( ! $is_external && wp_validate_redirect( 'http://' . $host ) )
+               $is_external = true;
+       return $is_external;
+}
+
+/**
+ * Whitelists any domain in a multisite installation for safe HTTP requests.
+ *
+ * Attached to the http_request_host_is_external filter.
+ *
+ * @since 3.6.0
+ *
+ * @param bool $is_external
+ * @param string $host
+ * @return bool
+ */
+function ms_allowed_http_request_hosts( $is_external, $host ) {
+       global $wpdb, $current_site;
+       static $queried = array();
+       if ( $is_external )
+               return $is_external;
+       if ( $host === $current_site->domain )
+               return true;
+       if ( isset( $queried[ $host ] ) )
+               return $queried[ $host ];
+       $queried[ $host ] = (bool) $wpdb->get_var( $wpdb->prepare( "SELECT domain FROM $wpdb->blogs WHERE domain = %s LIMIT 1", $host ) );
+       return $queried[ $host ];
+}
index cb4e1184918136d8ffda237ccf9cf86a249db440..b75823ce8b700ac97bd0419e344ce401f61d2ad0 100644 (file)
@@ -1,8 +1,9 @@
 // use jQuery and hoverIntent if loaded
 if ( typeof(jQuery) != 'undefined' ) {
-       if ( typeof(jQuery.fn.hoverIntent) == 'undefined' )
-               (function(a){a.fn.hoverIntent=function(l,j){var m={sensitivity:7,interval:100,timeout:0};m=a.extend(m,j?{over:l,out:j}:l);var o,n,h,d;var e=function(f){o=f.pageX;n=f.pageY};var c=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);if((Math.abs(h-o)+Math.abs(d-n))<m.sensitivity){a(f).unbind("mousemove",e);f.hoverIntent_s=1;return m.over.apply(f,[g])}else{h=o;d=n;f.hoverIntent_t=setTimeout(function(){c(g,f)},m.interval)}};var i=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);f.hoverIntent_s=0;return m.out.apply(f,[g])};var b=function(q){var f=this;var g=(q.type=="mouseover"?q.fromElement:q.toElement)||q.relatedTarget;while(g&&g!=this){try{g=g.parentNode}catch(q){g=this}}if(g==this){if(a.browser.mozilla){if(q.type=="mouseout"){f.mtout=setTimeout(function(){k(q,f)},30)}else{if(f.mtout){f.mtout=clearTimeout(f.mtout)}}}return}else{if(f.mtout){f.mtout=clearTimeout(f.mtout)}k(q,f)}};var k=function(p,f){var g=jQuery.extend({},p);if(f.hoverIntent_t){f.hoverIntent_t=clearTimeout(f.hoverIntent_t)}if(p.type=="mouseover"){h=g.pageX;d=g.pageY;a(f).bind("mousemove",e);if(f.hoverIntent_s!=1){f.hoverIntent_t=setTimeout(function(){c(g,f)},m.interval)}}else{a(f).unbind("mousemove",e);if(f.hoverIntent_s==1){f.hoverIntent_t=setTimeout(function(){i(g,f)},m.timeout)}}};return this.mouseover(b).mouseout(b)}})(jQuery);
-
+       if ( typeof(jQuery.fn.hoverIntent) == 'undefined' ) {
+               // hoverIntent r6 - Copy of wp-includes/js/hoverIntent.min.js
+               (function(a){a.fn.hoverIntent=function(m,d,h){var j={interval:100,sensitivity:7,timeout:0};if(typeof m==="object"){j=a.extend(j,m)}else{if(a.isFunction(d)){j=a.extend(j,{over:m,out:d,selector:h})}else{j=a.extend(j,{over:m,out:m,selector:d})}}var l,k,g,f;var e=function(n){l=n.pageX;k=n.pageY};var c=function(o,n){n.hoverIntent_t=clearTimeout(n.hoverIntent_t);if((Math.abs(g-l)+Math.abs(f-k))<j.sensitivity){a(n).off("mousemove.hoverIntent",e);n.hoverIntent_s=1;return j.over.apply(n,[o])}else{g=l;f=k;n.hoverIntent_t=setTimeout(function(){c(o,n)},j.interval)}};var i=function(o,n){n.hoverIntent_t=clearTimeout(n.hoverIntent_t);n.hoverIntent_s=0;return j.out.apply(n,[o])};var b=function(p){var o=jQuery.extend({},p);var n=this;if(n.hoverIntent_t){n.hoverIntent_t=clearTimeout(n.hoverIntent_t)}if(p.type=="mouseenter"){g=o.pageX;f=o.pageY;a(n).on("mousemove.hoverIntent",e);if(n.hoverIntent_s!=1){n.hoverIntent_t=setTimeout(function(){c(o,n)},j.interval)}}else{a(n).off("mousemove.hoverIntent",e);if(n.hoverIntent_s==1){n.hoverIntent_t=setTimeout(function(){i(o,n)},j.timeout)}}};return this.on({"mouseenter.hoverIntent":b,"mouseleave.hoverIntent":b},j.selector)}})(jQuery);
+       }
        jQuery(document).ready(function($){
                var adminbar = $('#wpadminbar'), refresh, touchOpen, touchClose, disableHoverIntent = false;
 
@@ -124,12 +125,25 @@ if ( typeof(jQuery) != 'undefined' ) {
 
                        var id = $(this).attr('href');
 
-                       if ( $.browser.webkit && id && id.charAt(0) == '#' ) {
+                       var ua = navigator.userAgent.toLowerCase();
+                       if ( ua.indexOf('applewebkit') != -1 && id && id.charAt(0) == '#' ) {
                                setTimeout(function () {
                                        $(id).focus();
                                }, 100);
                        }
                });
+
+               // Empty sessionStorage on logging out
+               if ( 'sessionStorage' in window ) {
+                       $('#wp-admin-bar-logout a').click( function() {
+                               try {
+                                       for ( var key in sessionStorage ) {
+                                               if ( key.indexOf('wp-autosave-') != -1 )
+                                                       sessionStorage.removeItem(key);
+                                       }
+                               } catch(e) {}
+                       });
+               }
        });
 } else {
        (function(d, w) {
@@ -308,6 +322,17 @@ if ( typeof(jQuery) != 'undefined' ) {
                                addEvent(aB, 'click', function(e) {
                                        scrollToTop( e.target || e.srcElement );
                                });
+
+                               addEvent( document.getElementById('wp-admin-bar-logout'), 'click', function() {
+                                       if ( 'sessionStorage' in window ) {
+                                               try {
+                                                       for ( var key in sessionStorage ) {
+                                                               if ( key.indexOf('wp-autosave-') != -1 )
+                                                                       sessionStorage.removeItem(key);
+                                                       }
+                                               } catch(e) {}
+                                       }
+                               });
                        }
 
                        if ( w.location.hash )
index b876704ca6f9c0e5e8bf926b15cc28bfe5e48971..0da00594a103c69e4d1853bcf74a98e80818e4d4 100644 (file)
@@ -1 +1 @@
-if(typeof(jQuery)!="undefined"){if(typeof(jQuery.fn.hoverIntent)=="undefined"){(function(b){b.fn.hoverIntent=function(p,r){var g={sensitivity:7,interval:100,timeout:0};g=b.extend(g,r?{over:p,out:r}:p);var a,f,t,v;var u=function(c){a=c.pageX;f=c.pageY};var w=function(c,d){d.hoverIntent_t=clearTimeout(d.hoverIntent_t);if((Math.abs(t-a)+Math.abs(v-f))<g.sensitivity){b(d).unbind("mousemove",u);d.hoverIntent_s=1;return g.over.apply(d,[c])}else{t=a;v=f;d.hoverIntent_t=setTimeout(function(){w(c,d)},g.interval)}};var s=function(c,d){d.hoverIntent_t=clearTimeout(d.hoverIntent_t);d.hoverIntent_s=0;return g.out.apply(d,[c])};var x=function(e){var d=this;var c=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(c&&c!=this){try{c=c.parentNode}catch(e){c=this}}if(c==this){if(b.browser.mozilla){if(e.type=="mouseout"){d.mtout=setTimeout(function(){q(e,d)},30)}else{if(d.mtout){d.mtout=clearTimeout(d.mtout)}}}return}else{if(d.mtout){d.mtout=clearTimeout(d.mtout)}q(e,d)}};var q=function(e,d){var c=jQuery.extend({},e);if(d.hoverIntent_t){d.hoverIntent_t=clearTimeout(d.hoverIntent_t)}if(e.type=="mouseover"){t=c.pageX;v=c.pageY;b(d).bind("mousemove",u);if(d.hoverIntent_s!=1){d.hoverIntent_t=setTimeout(function(){w(c,d)},g.interval)}}else{b(d).unbind("mousemove",u);if(d.hoverIntent_s==1){d.hoverIntent_t=setTimeout(function(){s(c,d)},g.timeout)}}};return this.mouseover(x).mouseout(x)}})(jQuery)}jQuery(document).ready(function(e){var d=e("#wpadminbar"),c,a,b,f=false;c=function(g,j){var k=e(j),h=k.attr("tabindex");if(h){k.attr("tabindex","0").attr("tabindex",h)}};a=function(g){d.find("li.menupop").on("click.wp-mobile-hover",function(i){var h=e(this);if(!h.hasClass("hover")){i.preventDefault();d.find("li.menupop.hover").removeClass("hover");h.addClass("hover")}if(g){e("li.menupop").off("click.wp-mobile-hover");f=false}})};b=function(){var g=/Mobile\/.+Safari/.test(navigator.userAgent)?"touchstart":"click";e(document.body).on(g+".wp-mobile-hover",function(h){if(!e(h.target).closest("#wpadminbar").length){d.find("li.menupop.hover").removeClass("hover")}})};d.removeClass("nojq").removeClass("nojs");if("ontouchstart" in window){d.on("touchstart",function(){a(true);f=true});b()}else{if(/IEMobile\/[1-9]/.test(navigator.userAgent)){a();b()}}d.find("li.menupop").hoverIntent({over:function(g){if(f){return}e(this).addClass("hover")},out:function(g){if(f){return}e(this).removeClass("hover")},timeout:180,sensitivity:7,interval:100});if(window.location.hash){window.scrollBy(0,-32)}e("#wp-admin-bar-get-shortlink").click(function(g){g.preventDefault();e(this).addClass("selected").children(".shortlink-input").blur(function(){e(this).parents("#wp-admin-bar-get-shortlink").removeClass("selected")}).focus().select()});e("#wpadminbar li.menupop > .ab-item").bind("keydown.adminbar",function(i){if(i.which!=13){return}var h=e(i.target),g=h.closest("ab-sub-wrapper");i.stopPropagation();i.preventDefault();if(!g.length){g=e("#wpadminbar .quicklinks")}g.find(".menupop").removeClass("hover");h.parent().toggleClass("hover");h.siblings(".ab-sub-wrapper").find(".ab-item").each(c)}).each(c);e("#wpadminbar .ab-item").bind("keydown.adminbar",function(h){if(h.which!=27){return}var g=e(h.target);h.stopPropagation();h.preventDefault();g.closest(".hover").removeClass("hover").children(".ab-item").focus();g.siblings(".ab-sub-wrapper").find(".ab-item").each(c)});e("#wpadminbar").click(function(g){if(g.target.id!="wpadminbar"&&g.target.id!="wp-admin-bar-top-secondary"){return}g.preventDefault();e("html, body").animate({scrollTop:0},"fast")});e(".screen-reader-shortcut").keydown(function(g){if(13!=g.which){return}var h=e(this).attr("href");if(e.browser.webkit&&h&&h.charAt(0)=="#"){setTimeout(function(){e(h).focus()},100)}})})}else{(function(j,l){var e=function(o,n,d){if(o.addEventListener){o.addEventListener(n,d,false)}else{if(o.attachEvent){o.attachEvent("on"+n,function(){return d.call(o,window.event)})}}},f,g=new RegExp("\\bhover\\b","g"),b=[],k=new RegExp("\\bselected\\b","g"),h=function(n){var d=b.length;while(d--){if(b[d]&&n==b[d][1]){return b[d][0]}}return false},i=function(u){var o,d,r,n,q,s,v=[],p=0;while(u&&u!=f&&u!=j){if("LI"==u.nodeName.toUpperCase()){v[v.length]=u;d=h(u);if(d){clearTimeout(d)}u.className=u.className?(u.className.replace(g,"")+" hover"):"hover";n=u}u=u.parentNode}if(n&&n.parentNode){q=n.parentNode;if(q&&"UL"==q.nodeName.toUpperCase()){o=q.childNodes.length;while(o--){s=q.childNodes[o];if(s!=n){s.className=s.className?s.className.replace(k,""):""}}}}o=b.length;while(o--){r=false;p=v.length;while(p--){if(v[p]==b[o][1]){r=true}}if(!r){b[o][1].className=b[o][1].className?b[o][1].className.replace(g,""):""}}},m=function(d){while(d&&d!=f&&d!=j){if("LI"==d.nodeName.toUpperCase()){(function(n){var o=setTimeout(function(){n.className=n.className?n.className.replace(g,""):""},500);b[b.length]=[o,n]})(d)}d=d.parentNode}},c=function(q){var o,d,p,n=q.target||q.srcElement;while(true){if(!n||n==j||n==f){return}if(n.id&&n.id=="wp-admin-bar-get-shortlink"){break}n=n.parentNode}if(q.preventDefault){q.preventDefault()}q.returnValue=false;if(-1==n.className.indexOf("selected")){n.className+=" selected"}for(o=0,d=n.childNodes.length;o<d;o++){p=n.childNodes[o];if(p.className&&-1!=p.className.indexOf("shortlink-input")){p.focus();p.select();p.onblur=function(){n.className=n.className?n.className.replace(k,""):""};break}}return false},a=function(n){var s,q,p,d,r,o;if(n.id!="wpadminbar"&&n.id!="wp-admin-bar-top-secondary"){return}s=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;if(s<1){return}o=s>800?130:100;q=Math.min(12,Math.round(s/o));p=s>800?Math.round(s/30):Math.round(s/20);d=[];r=0;while(s){s-=p;if(s<0){s=0}d.push(s);setTimeout(function(){window.scrollTo(0,d.shift())},r*q);r++}};e(l,"load",function(){f=j.getElementById("wpadminbar");if(j.body&&f){j.body.appendChild(f);if(f.className){f.className=f.className.replace(/nojs/,"")}e(f,"mouseover",function(d){i(d.target||d.srcElement)});e(f,"mouseout",function(d){m(d.target||d.srcElement)});e(f,"click",c);e(f,"click",function(d){a(d.target||d.srcElement)})}if(l.location.hash){l.scrollBy(0,-32)}})})(document,window)};
\ No newline at end of file
+if(typeof(jQuery)!="undefined"){if(typeof(jQuery.fn.hoverIntent)=="undefined"){(function(b){b.fn.hoverIntent=function(a,v,r){var p={interval:100,sensitivity:7,timeout:0};if(typeof a==="object"){p=b.extend(p,a)}else{if(b.isFunction(v)){p=b.extend(p,{over:a,out:v,selector:r})}else{p=b.extend(p,{over:a,out:a,selector:v})}}var n,o,s,t;var u=function(c){n=c.pageX;o=c.pageY};var w=function(c,d){d.hoverIntent_t=clearTimeout(d.hoverIntent_t);if((Math.abs(s-n)+Math.abs(t-o))<p.sensitivity){b(d).off("mousemove.hoverIntent",u);d.hoverIntent_s=1;return p.over.apply(d,[c])}else{s=n;t=o;d.hoverIntent_t=setTimeout(function(){w(c,d)},p.interval)}};var q=function(c,d){d.hoverIntent_t=clearTimeout(d.hoverIntent_t);d.hoverIntent_s=0;return p.out.apply(d,[c])};var x=function(c){var d=jQuery.extend({},c);var e=this;if(e.hoverIntent_t){e.hoverIntent_t=clearTimeout(e.hoverIntent_t)}if(c.type=="mouseenter"){s=d.pageX;t=d.pageY;b(e).on("mousemove.hoverIntent",u);if(e.hoverIntent_s!=1){e.hoverIntent_t=setTimeout(function(){w(d,e)},p.interval)}}else{b(e).off("mousemove.hoverIntent",u);if(e.hoverIntent_s==1){e.hoverIntent_t=setTimeout(function(){q(d,e)},p.timeout)}}};return this.on({"mouseenter.hoverIntent":x,"mouseleave.hoverIntent":x},p.selector)}})(jQuery)}jQuery(document).ready(function(e){var d=e("#wpadminbar"),c,a,b,f=false;c=function(g,j){var k=e(j),h=k.attr("tabindex");if(h){k.attr("tabindex","0").attr("tabindex",h)}};a=function(g){d.find("li.menupop").on("click.wp-mobile-hover",function(i){var h=e(this);if(!h.hasClass("hover")){i.preventDefault();d.find("li.menupop.hover").removeClass("hover");h.addClass("hover")}if(g){e("li.menupop").off("click.wp-mobile-hover");f=false}})};b=function(){var g=/Mobile\/.+Safari/.test(navigator.userAgent)?"touchstart":"click";e(document.body).on(g+".wp-mobile-hover",function(h){if(!e(h.target).closest("#wpadminbar").length){d.find("li.menupop.hover").removeClass("hover")}})};d.removeClass("nojq").removeClass("nojs");if("ontouchstart" in window){d.on("touchstart",function(){a(true);f=true});b()}else{if(/IEMobile\/[1-9]/.test(navigator.userAgent)){a();b()}}d.find("li.menupop").hoverIntent({over:function(g){if(f){return}e(this).addClass("hover")},out:function(g){if(f){return}e(this).removeClass("hover")},timeout:180,sensitivity:7,interval:100});if(window.location.hash){window.scrollBy(0,-32)}e("#wp-admin-bar-get-shortlink").click(function(g){g.preventDefault();e(this).addClass("selected").children(".shortlink-input").blur(function(){e(this).parents("#wp-admin-bar-get-shortlink").removeClass("selected")}).focus().select()});e("#wpadminbar li.menupop > .ab-item").bind("keydown.adminbar",function(i){if(i.which!=13){return}var h=e(i.target),g=h.closest("ab-sub-wrapper");i.stopPropagation();i.preventDefault();if(!g.length){g=e("#wpadminbar .quicklinks")}g.find(".menupop").removeClass("hover");h.parent().toggleClass("hover");h.siblings(".ab-sub-wrapper").find(".ab-item").each(c)}).each(c);e("#wpadminbar .ab-item").bind("keydown.adminbar",function(h){if(h.which!=27){return}var g=e(h.target);h.stopPropagation();h.preventDefault();g.closest(".hover").removeClass("hover").children(".ab-item").focus();g.siblings(".ab-sub-wrapper").find(".ab-item").each(c)});e("#wpadminbar").click(function(g){if(g.target.id!="wpadminbar"&&g.target.id!="wp-admin-bar-top-secondary"){return}g.preventDefault();e("html, body").animate({scrollTop:0},"fast")});e(".screen-reader-shortcut").keydown(function(h){if(13!=h.which){return}var i=e(this).attr("href");var g=navigator.userAgent.toLowerCase();if(g.indexOf("applewebkit")!=-1&&i&&i.charAt(0)=="#"){setTimeout(function(){e(i).focus()},100)}});if("sessionStorage" in window){e("#wp-admin-bar-logout a").click(function(){try{for(var g in sessionStorage){if(g.indexOf("wp-autosave-")!=-1){sessionStorage.removeItem(g)}}}catch(h){}})}})}else{(function(j,l){var e=function(o,n,d){if(o.addEventListener){o.addEventListener(n,d,false)}else{if(o.attachEvent){o.attachEvent("on"+n,function(){return d.call(o,window.event)})}}},f,g=new RegExp("\\bhover\\b","g"),b=[],k=new RegExp("\\bselected\\b","g"),h=function(n){var d=b.length;while(d--){if(b[d]&&n==b[d][1]){return b[d][0]}}return false},i=function(u){var o,d,r,n,q,s,v=[],p=0;while(u&&u!=f&&u!=j){if("LI"==u.nodeName.toUpperCase()){v[v.length]=u;d=h(u);if(d){clearTimeout(d)}u.className=u.className?(u.className.replace(g,"")+" hover"):"hover";n=u}u=u.parentNode}if(n&&n.parentNode){q=n.parentNode;if(q&&"UL"==q.nodeName.toUpperCase()){o=q.childNodes.length;while(o--){s=q.childNodes[o];if(s!=n){s.className=s.className?s.className.replace(k,""):""}}}}o=b.length;while(o--){r=false;p=v.length;while(p--){if(v[p]==b[o][1]){r=true}}if(!r){b[o][1].className=b[o][1].className?b[o][1].className.replace(g,""):""}}},m=function(d){while(d&&d!=f&&d!=j){if("LI"==d.nodeName.toUpperCase()){(function(n){var o=setTimeout(function(){n.className=n.className?n.className.replace(g,""):""},500);b[b.length]=[o,n]})(d)}d=d.parentNode}},c=function(q){var o,d,p,n=q.target||q.srcElement;while(true){if(!n||n==j||n==f){return}if(n.id&&n.id=="wp-admin-bar-get-shortlink"){break}n=n.parentNode}if(q.preventDefault){q.preventDefault()}q.returnValue=false;if(-1==n.className.indexOf("selected")){n.className+=" selected"}for(o=0,d=n.childNodes.length;o<d;o++){p=n.childNodes[o];if(p.className&&-1!=p.className.indexOf("shortlink-input")){p.focus();p.select();p.onblur=function(){n.className=n.className?n.className.replace(k,""):""};break}}return false},a=function(n){var s,q,p,d,r,o;if(n.id!="wpadminbar"&&n.id!="wp-admin-bar-top-secondary"){return}s=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;if(s<1){return}o=s>800?130:100;q=Math.min(12,Math.round(s/o));p=s>800?Math.round(s/30):Math.round(s/20);d=[];r=0;while(s){s-=p;if(s<0){s=0}d.push(s);setTimeout(function(){window.scrollTo(0,d.shift())},r*q);r++}};e(l,"load",function(){f=j.getElementById("wpadminbar");if(j.body&&f){j.body.appendChild(f);if(f.className){f.className=f.className.replace(/nojs/,"")}e(f,"mouseover",function(d){i(d.target||d.srcElement)});e(f,"mouseout",function(d){m(d.target||d.srcElement)});e(f,"click",c);e(f,"click",function(d){a(d.target||d.srcElement)});e(document.getElementById("wp-admin-bar-logout"),"click",function(){if("sessionStorage" in window){try{for(var d in sessionStorage){if(d.indexOf("wp-autosave-")!=-1){sessionStorage.removeItem(d)}}}catch(n){}}})}if(l.location.hash){l.scrollBy(0,-32)}})})(document,window)};
\ No newline at end of file
index 3920d36061c733fe92eee655c397474224f7f7c6..6cd6a47fd7c7c7b24564c65920118338f1bcfab6 100644 (file)
@@ -1,8 +1,17 @@
-var autosave, autosaveLast = '', autosavePeriodical, autosaveOldMessage = '', autosaveDelayPreview = false, notSaved = true, blockSave = false, fullscreen, autosaveLockRelease = true;
+var autosave, autosaveLast = '', autosavePeriodical, autosaveDelayPreview = false, notSaved = true, blockSave = false, fullscreen, autosaveLockRelease = true;
 
 jQuery(document).ready( function($) {
 
-       autosaveLast = ( $('#post #title').val() || '' ) + ( $('#post #content').val() || '' );
+       if ( $('#wp-content-wrap').hasClass('tmce-active') && typeof switchEditors != 'undefined' ) {
+               autosaveLast = wp.autosave.getCompareString({
+                       post_title : $('#title').val() || '',
+                       content : switchEditors.pre_wpautop( $('#content').val() ) || '',
+                       excerpt : $('#excerpt').val() || ''
+               });
+       } else {
+               autosaveLast = wp.autosave.getCompareString();
+       }
+
        autosavePeriodical = $.schedule({time: autosaveL10n.autosaveInterval * 1000, func: function() { autosave(); }, repeat: true, protect: true});
 
        //Disable autosave after the form has been submitted
@@ -28,21 +37,23 @@ jQuery(document).ready( function($) {
        });
 
        window.onbeforeunload = function(){
-               var mce = typeof(tinymce) != 'undefined' ? tinymce.activeEditor : false, title, content;
+               var editor = typeof(tinymce) != 'undefined' ? tinymce.activeEditor : false, compareString;
 
-               if ( mce && !mce.isHidden() ) {
-                       if ( mce.isDirty() )
+               if ( editor && ! editor.isHidden() ) {
+                       if ( editor.isDirty() )
                                return autosaveL10n.saveAlert;
                } else {
                        if ( fullscreen && fullscreen.settings.visible ) {
-                               title = $('#wp-fullscreen-title').val() || '';
-                               content = $("#wp_mce_fullscreen").val() || '';
+                               compareString = wp.autosave.getCompareString({
+                                       post_title: $('#wp-fullscreen-title').val() || '',
+                                       content: $('#wp_mce_fullscreen').val() || '',
+                                       excerpt: $('#excerpt').val() || ''
+                               });
                        } else {
-                               title = $('#post #title').val() || '';
-                               content = $('#post #content').val() || '';
+                               compareString = wp.autosave.getCompareString();
                        }
 
-                       if ( ( title || content ) && title + content != autosaveLast )
+                       if ( compareString != autosaveLast )
                                return autosaveL10n.saveAlert;
                }
        };
@@ -87,7 +98,8 @@ jQuery(document).ready( function($) {
                 * Workaround for WebKit bug preventing a form submitting twice to the same action.
                 * https://bugs.webkit.org/show_bug.cgi?id=28633
                 */
-               if ( $.browser.safari ) {
+               var ua = navigator.userAgent.toLowerCase();
+               if ( ua.indexOf('safari') != -1 && ua.indexOf('chrome') == -1 ) {
                        $('form#post').attr('action', function(index, value) {
                                return value + '?t=' + new Date().getTime();
                        });
@@ -127,51 +139,46 @@ jQuery(document).ready( function($) {
                        delayed_autosave();
                });
        }
+
+       // When connection is lost, keep user from submitting changes.
+       $(document).on('heartbeat-connection-lost.autosave', function( e, error ) {
+               if ( 'timeout' === error ) {
+                       var notice = $('#lost-connection-notice');
+                       if ( ! wp.autosave.local.hasStorage ) {
+                               notice.find('.hide-if-no-sessionstorage').hide();
+                       }
+                       notice.show();
+                       autosave_disable_buttons();
+               }
+       }).on('heartbeat-connection-restored.autosave', function() {
+               $('#lost-connection-notice').hide();
+               autosave_enable_buttons();
+       });
 });
 
-function autosave_parse_response(response) {
-       var res = wpAjax.parseAjaxResponse(response, 'autosave'), message = '', postID, sup;
+function autosave_parse_response( response ) {
+       var res = wpAjax.parseAjaxResponse(response, 'autosave'), post_id, sup;
 
        if ( res && res.responses && res.responses.length ) {
-               message = res.responses[0].data; // The saved message or error.
-               // someone else is editing: disable autosave, set errors
                if ( res.responses[0].supplemental ) {
                        sup = res.responses[0].supplemental;
-                       if ( 'disable' == sup['disable_autosave'] ) {
-                               autosave = function() {};
-                               autosaveLockRelease = false;
-                               res = { errors: true };
-                       }
-
-                       if ( sup['active-post-lock'] ) {
-                               jQuery('#active_post_lock').val( sup['active-post-lock'] );
-                       }
-
-                       if ( sup['alert'] ) {
-                               jQuery('#autosave-alert').remove();
-                               jQuery('#titlediv').after('<div id="autosave-alert" class="error below-h2"><p>' + sup['alert'] + '</p></div>');
-                       }
 
-                       jQuery.each(sup, function(selector, value) {
-                               if ( selector.match(/^replace-/) ) {
-                                       jQuery('#'+selector.replace('replace-', '')).val(value);
-                               }
+                       jQuery.each( sup, function( selector, value ) {
+                               if ( selector.match(/^replace-/) )
+                                       jQuery( '#' + selector.replace('replace-', '') ).val( value );
                        });
                }
 
-               // if no errors: add slug UI
+               // if no errors: add slug UI and update autosave-message
                if ( !res.errors ) {
-                       postID = parseInt( res.responses[0].id, 10 );
-                       if ( !isNaN(postID) && postID > 0 ) {
-                               autosave_update_slug(postID);
-                       }
+                       if ( post_id = parseInt( res.responses[0].id, 10 ) )
+                               autosave_update_slug( post_id );
+
+                       if ( res.responses[0].data ) // update autosave message
+                               jQuery('.autosave-message').text( res.responses[0].data );
                }
        }
-       if ( message ) { // update autosave message
-               jQuery('.autosave-message').html(message);
-       } else if ( autosaveOldMessage && res ) {
-               jQuery('.autosave-message').html( autosaveOldMessage );
-       }
+
        return res;
 }
 
@@ -185,15 +192,19 @@ function autosave_saved(response) {
 // called when autosaving new post
 function autosave_saved_new(response) {
        blockSave = false;
-       var res = autosave_parse_response(response), postID;
+       var res = autosave_parse_response(response), post_id;
+
        if ( res && res.responses.length && !res.errors ) {
                // An ID is sent only for real auto-saves, not for autosave=0 "keepalive" saves
-               postID = parseInt( res.responses[0].id, 10 );
-               if ( !isNaN(postID) && postID > 0 ) {
+               post_id = parseInt( res.responses[0].id, 10 );
+
+               if ( post_id ) {
                        notSaved = false;
                        jQuery('#auto_draft').val('0'); // No longer an auto-draft
                }
+
                autosave_enable_buttons();
+
                if ( autosaveDelayPreview ) {
                        autosaveDelayPreview = false;
                        doPreview();
@@ -214,7 +225,13 @@ function autosave_update_slug(post_id) {
                        },
                        function(data) {
                                if ( data !== '-1' ) {
-                                       jQuery('#edit-slug-box').html(data);
+                                       var box = jQuery('#edit-slug-box');
+                                       box.html(data);
+                                       if (box.hasClass('hidden')) {
+                                               box.fadeIn('fast', function () {
+                                                       box.removeClass('hidden');
+                                               });
+                                       }
                                        makeSlugeditClickable();
                                }
                        }
@@ -227,17 +244,22 @@ function autosave_loading() {
 }
 
 function autosave_enable_buttons() {
-       // delay that a bit to avoid some rare collisions while the DOM is being updated.
-       setTimeout(function(){
-               jQuery(':button, :submit', '#submitpost').removeAttr('disabled');
-               jQuery('.spinner', '#submitpost').hide();
-       }, 500);
+       jQuery(document).trigger('autosave-enable-buttons');
+       if ( ! wp.heartbeat || ! wp.heartbeat.hasConnectionError() ) {
+               // delay that a bit to avoid some rare collisions while the DOM is being updated.
+               setTimeout(function(){
+                       var parent = jQuery('#submitpost');
+                       parent.find(':button, :submit').removeAttr('disabled');
+                       parent.find('.spinner').hide();
+               }, 500);
+       }
 }
 
 function autosave_disable_buttons() {
-       jQuery(':button, :submit', '#submitpost').prop('disabled', true);
+       jQuery(document).trigger('autosave-disable-buttons');
+       jQuery('#submitpost').find(':button, :submit').prop('disabled', true);
        // Re-enable 5 sec later. Just gives autosave a head start to avoid collisions.
-       setTimeout(autosave_enable_buttons, 5000);
+       setTimeout( autosave_enable_buttons, 5000 );
 }
 
 function delayed_autosave() {
@@ -249,103 +271,432 @@ function delayed_autosave() {
 }
 
 autosave = function() {
-       // (bool) is rich editor enabled and active
+       var post_data = wp.autosave.getPostData(),
+               compareString,
+               successCallback;
+
        blockSave = true;
-       var rich = (typeof tinymce != "undefined") && tinymce.activeEditor && !tinymce.activeEditor.isHidden(),
-               post_data, doAutoSave, ed, origStatus, successCallback;
 
-       autosave_disable_buttons();
+       // post_data.content cannot be retrieved at the moment
+       if ( ! post_data.autosave )
+               return false;
 
-       post_data = {
-               action: "autosave",
-               post_ID:  jQuery("#post_ID").val() || 0,
-               autosavenonce: jQuery('#autosavenonce').val(),
-               post_type: jQuery('#post_type').val() || "",
-               autosave: 1
-       };
+       // No autosave while thickbox is open (media buttons)
+       if ( jQuery("#TB_window").css('display') == 'block' )
+               return false;
 
-       jQuery('.tags-input').each( function() {
-               post_data[this.name] = this.value;
-       } );
+       compareString = wp.autosave.getCompareString( post_data );
 
-       // We always send the ajax request in order to keep the post lock fresh.
-       // This (bool) tells whether or not to write the post to the DB during the ajax request.
-       doAutoSave = true;
+       // Nothing to save or no change.
+       if ( compareString == autosaveLast )
+               return false;
 
-       // No autosave while thickbox is open (media buttons)
-       if ( jQuery("#TB_window").css('display') == 'block' )
-               doAutoSave = false;
+       autosaveLast = compareString;
+       jQuery(document).triggerHandler('wpcountwords', [ post_data["content"] ]);
+
+       // Disable buttons until we know the save completed.
+       autosave_disable_buttons();
+
+       if ( post_data["auto_draft"] == '1' ) {
+               successCallback = autosave_saved_new; // new post
+       } else {
+               successCallback = autosave_saved; // pre-existing post
+       }
+
+       jQuery.ajax({
+               data: post_data,
+               beforeSend: autosave_loading,
+               type: "POST",
+               url: ajaxurl,
+               success: successCallback
+       });
+
+       return true;
+}
 
-       /* Gotta do this up here so we can check the length when tinymce is in use */
-       if ( rich && doAutoSave ) {
-               ed = tinymce.activeEditor;
+// Autosave in localStorage
+// set as simple object/mixin for now
+window.wp = window.wp || {};
+wp.autosave = wp.autosave || {};
+
+(function($){
+// Returns the data for saving in both localStorage and autosaves to the server
+wp.autosave.getPostData = function() {
+       var ed = typeof tinymce != 'undefined' ? tinymce.activeEditor : null, post_name, parent_id, cats = [],
+               data = {
+                       action: 'autosave',
+                       autosave: true,
+                       post_id: $('#post_ID').val() || 0,
+                       autosavenonce: $('#autosavenonce').val() || '',
+                       post_type: $('#post_type').val() || '',
+                       post_author: $('#post_author').val() || '',
+                       excerpt: $('#excerpt').val() || ''
+               };
+
+       if ( ed && !ed.isHidden() ) {
                // Don't run while the tinymce spellcheck is on. It resets all found words.
                if ( ed.plugins.spellchecker && ed.plugins.spellchecker.active ) {
-                       doAutoSave = false;
+                       data.autosave = false;
+                       return data;
                } else {
-                       if ( 'mce_fullscreen' == ed.id || 'wp_mce_fullscreen' == ed.id )
+                       if ( 'mce_fullscreen' == ed.id )
                                tinymce.get('content').setContent(ed.getContent({format : 'raw'}), {format : 'raw'});
+
                        tinymce.triggerSave();
                }
        }
 
-       if ( fullscreen && fullscreen.settings.visible ) {
-               post_data["post_title"] = jQuery('#wp-fullscreen-title').val() || '';
-               post_data["content"] = jQuery("#wp_mce_fullscreen").val() || '';
+       if ( typeof fullscreen != 'undefined' && fullscreen.settings.visible ) {
+               data['post_title'] = $('#wp-fullscreen-title').val() || '';
+               data['content'] = $('#wp_mce_fullscreen').val() || '';
        } else {
-               post_data["post_title"] = jQuery("#title").val() || '';
-               post_data["content"] = jQuery("#content").val() || '';
+               data['post_title'] = $('#title').val() || '';
+               data['content'] = $('#content').val() || '';
        }
 
-       if ( jQuery('#post_name').val() )
-               post_data["post_name"] = jQuery('#post_name').val();
+       /*
+       // We haven't been saving tags with autosave since 2.8... Start again?
+       $('.the-tags').each( function() {
+               data[this.name] = this.value;
+       });
+       */
 
-       // Nothing to save or no change.
-       if ( ( post_data["post_title"].length == 0 && post_data["content"].length == 0 ) || post_data["post_title"] + post_data["content"] == autosaveLast ) {
-               doAutoSave = false;
-       }
+       $('input[id^="in-category-"]:checked').each( function() {
+               cats.push(this.value);
+       });
+       data['catslist'] = cats.join(',');
 
-       origStatus = jQuery('#original_post_status').val();
+       if ( post_name = $('#post_name').val() )
+               data['post_name'] = post_name;
 
-       goodcats = ([]);
-       jQuery("[name='post_category[]']:checked").each( function(i) {
-               goodcats.push(this.value);
-       } );
-       post_data["catslist"] = goodcats.join(",");
-
-       if ( jQuery("#comment_status").prop("checked") )
-               post_data["comment_status"] = 'open';
-       if ( jQuery("#ping_status").prop("checked") )
-               post_data["ping_status"] = 'open';
-       if ( jQuery("#excerpt").size() )
-               post_data["excerpt"] = jQuery("#excerpt").val();
-       if ( jQuery("#post_author").size() )
-               post_data["post_author"] = jQuery("#post_author").val();
-       if ( jQuery("#parent_id").val() )
-               post_data["parent_id"] = jQuery("#parent_id").val();
-       post_data["user_ID"] = jQuery("#user-id").val();
-       if ( jQuery('#auto_draft').val() == '1' )
-               post_data["auto_draft"] = '1';
-
-       if ( doAutoSave ) {
-               autosaveLast = post_data["post_title"] + post_data["content"];
-               jQuery(document).triggerHandler('wpcountwords', [ post_data["content"] ]);
-       } else {
-               post_data['autosave'] = 0;
+       if ( parent_id = $('#parent_id').val() )
+               data['parent_id'] = parent_id;
+
+       if ( $('#comment_status').prop('checked') )
+               data['comment_status'] = 'open';
+
+       if ( $('#ping_status').prop('checked') )
+               data['ping_status'] = 'open';
+
+       if ( $('#auto_draft').val() == '1' )
+               data['auto_draft'] = '1';
+
+       return data;
+};
+
+// Concatenate title, content and excerpt. Used to track changes when auto-saving.
+wp.autosave.getCompareString = function( post_data ) {
+       if ( typeof post_data === 'object' ) {
+               return ( post_data.post_title || '' ) + '::' + ( post_data.content || '' ) + '::' + ( post_data.excerpt || '' );
        }
 
-       if ( post_data["auto_draft"] == '1' ) {
-               successCallback = autosave_saved_new; // new post
-       } else {
-               successCallback = autosave_saved; // pre-existing post
+       return ( $('#title').val() || '' ) + '::' + ( $('#content').val() || '' ) + '::' + ( $('#excerpt').val() || '' );
+};
+
+wp.autosave.local = {
+
+       lastSavedData: '',
+       blog_id: 0,
+       hasStorage: false,
+
+       // Check if the browser supports sessionStorage and it's not disabled
+       checkStorage: function() {
+               var test = Math.random(), result = false;
+
+               try {
+                       sessionStorage.setItem('wp-test', test);
+                       result = sessionStorage.getItem('wp-test') == test;
+                       sessionStorage.removeItem('wp-test');
+               } catch(e) {}
+
+               this.hasStorage = result;
+               return result;
+    },
+
+       /**
+        * Initialize the local storage
+        *
+        * @return mixed False if no sessionStorage in the browser or an Object containing all post_data for this blog
+        */
+       getStorage: function() {
+               var stored_obj = false;
+               // Separate local storage containers for each blog_id
+               if ( this.hasStorage && this.blog_id ) {
+                       stored_obj = sessionStorage.getItem( 'wp-autosave-' + this.blog_id );
+
+                       if ( stored_obj )
+                               stored_obj = JSON.parse( stored_obj );
+                       else
+                               stored_obj = {};
+               }
+
+               return stored_obj;
+       },
+
+       /**
+        * Set the storage for this blog
+        *
+        * Confirms that the data was saved successfully.
+        *
+        * @return bool
+        */
+       setStorage: function( stored_obj ) {
+               var key;
+
+               if ( this.hasStorage && this.blog_id ) {
+                       key = 'wp-autosave-' + this.blog_id;
+                       sessionStorage.setItem( key, JSON.stringify( stored_obj ) );
+                       return sessionStorage.getItem( key ) !== null;
+               }
+
+               return false;
+       },
+
+       /**
+        * Get the saved post data for the current post
+        *
+        * @return mixed False if no storage or no data or the post_data as an Object
+        */
+       getData: function() {
+               var stored = this.getStorage(), post_id = $('#post_ID').val();
+
+               if ( !stored || !post_id )
+                       return false;
+
+               return stored[ 'post_' + post_id ] || false;
+       },
+
+       /**
+        * Set (save or delete) post data in the storage.
+        *
+        * If stored_data evaluates to 'false' the storage key for the current post will be removed
+        *
+        * $param stored_data The post data to store or null/false/empty to delete the key
+        * @return bool
+        */
+       setData: function( stored_data ) {
+               var stored = this.getStorage(), post_id = $('#post_ID').val();
+
+               if ( !stored || !post_id )
+                       return false;
+
+               if ( stored_data )
+                       stored[ 'post_' + post_id ] = stored_data;
+               else if ( stored.hasOwnProperty( 'post_' + post_id ) )
+                       delete stored[ 'post_' + post_id ];
+               else
+                       return false;
+
+               return this.setStorage(stored);
+       },
+
+       /**
+        * Save post data for the current post
+        *
+        * Runs on a 15 sec. schedule, saves when there are differences in the post title or content.
+        * When the optional data is provided, updates the last saved post data.
+        *
+        * $param data optional Object The post data for saving, minimum 'post_title' and 'content'
+        * @return bool
+        */
+       save: function( data ) {
+               var result = false, post_data, compareString;
+
+               if ( ! data ) {
+                       post_data = wp.autosave.getPostData();
+               } else {
+                       post_data = this.getData() || {};
+                       $.extend( post_data, data );
+                       post_data.autosave = true;
+               }
+
+               // Cannot get the post data at the moment
+               if ( ! post_data.autosave )
+                       return false;
+
+               compareString = wp.autosave.getCompareString( post_data );
+
+               // If the content, title and excerpt did not change since the last save, don't save again
+               if ( compareString == this.lastSavedData )
+                       return false;
+
+               post_data['save_time'] = (new Date()).getTime();
+               post_data['status'] = $('#post_status').val() || '';
+               result = this.setData( post_data );
+
+               if ( result )
+                       this.lastSavedData = compareString;
+
+               return result;
+       },
+
+       // Initialize and run checkPost() on loading the script (before TinyMCE init)
+       init: function( settings ) {
+               var self = this;
+
+               // Check if the browser supports sessionStorage and it's not disabled
+               if ( ! this.checkStorage() )
+                       return;
+
+               // Don't run if the post type supports neither 'editor' (textarea#content) nor 'excerpt'.
+               if ( ! $('#content').length && ! $('#excerpt').length )
+                       return;
+
+               if ( settings )
+                       $.extend( this, settings );
+
+               if ( !this.blog_id )
+                       this.blog_id = typeof window.autosaveL10n != 'undefined' ? window.autosaveL10n.blog_id : 0;
+
+               $(document).ready( function(){ self.run(); } );
+       },
+
+       // Run on DOM ready
+       run: function() {
+               var self = this;
+
+               // Check if the local post data is different than the loaded post data.
+               this.checkPost();
+
+               // Set the schedule
+               this.schedule = $.schedule({
+                       time: 15 * 1000,
+                       func: function() { wp.autosave.local.save(); },
+                       repeat: true,
+                       protect: true
+               });
+
+               $('form#post').on('submit.autosave-local', function() {
+                       var editor = typeof tinymce != 'undefined' && tinymce.get('content'), post_id = $('#post_ID').val() || 0;
+
+                       if ( editor && ! editor.isHidden() ) {
+                               // Last onSubmit event in the editor, needs to run after the content has been moved to the textarea.
+                               editor.onSubmit.add( function() {
+                                       wp.autosave.local.save({
+                                               post_title: $('#title').val() || '',
+                                               content: $('#content').val() || '',
+                                               excerpt: $('#excerpt').val() || ''
+                                       });
+                               });
+                       } else {
+                               self.save({
+                                       post_title: $('#title').val() || '',
+                                       content: $('#content').val() || '',
+                                       excerpt: $('#excerpt').val() || ''
+                               });
+                       }
+
+                       wpCookies.set( 'wp-saving-post-' + post_id, 'check' );
+               });
+       },
+
+       // Strip whitespace and compare two strings
+       compare: function( str1, str2 ) {
+               function remove( string ) {
+                       return string.toString().replace(/[\x20\t\r\n\f]+/g, '');
+               }
+
+               return ( remove( str1 || '' ) == remove( str2 || '' ) );
+       },
+
+       /**
+        * Check if the saved data for the current post (if any) is different than the loaded post data on the screen
+        *
+        * Shows a standard message letting the user restore the post data if different.
+        *
+        * @return void
+        */
+       checkPost: function() {
+               var self = this, post_data = this.getData(), content, post_title, excerpt, notice,
+                       post_id = $('#post_ID').val() || 0, cookie = wpCookies.get( 'wp-saving-post-' + post_id );
+
+               if ( ! post_data )
+                       return;
+
+               if ( cookie ) {
+                       wpCookies.remove( 'wp-saving-post-' + post_id );
+
+                       if ( cookie == 'saved' ) {
+                               // The post was saved properly, remove old data and bail
+                               this.setData( false );
+                               return;
+                       }
+               }
+
+               // There is a newer autosave. Don't show two "restore" notices at the same time.
+               if ( $('#has-newer-autosave').length )
+                       return;
+
+               content = $('#content').val() || '';
+               post_title = $('#title').val() || '';
+               excerpt = $('#excerpt').val() || '';
+
+               if ( $('#wp-content-wrap').hasClass('tmce-active') && typeof switchEditors != 'undefined' )
+                       content = switchEditors.pre_wpautop( content );
+
+               // cookie == 'check' means the post was not saved properly, always show #local-storage-notice
+               if ( cookie != 'check' && this.compare( content, post_data.content ) && this.compare( post_title, post_data.post_title ) && this.compare( excerpt, post_data.excerpt ) ) {
+                       return;
+               }
+
+               this.restore_post_data = post_data;
+               this.undo_post_data = {
+                       content: content,
+                       post_title: post_title,
+                       excerpt: excerpt
+               };
+
+               notice = $('#local-storage-notice');
+               $('.wrap h2').first().after( notice.addClass('updated').show() );
+
+               notice.on( 'click', function(e) {
+                       var target = $( e.target );
+
+                       if ( target.hasClass('restore-backup') ) {
+                               self.restorePost( self.restore_post_data );
+                               target.parent().hide();
+                               $(this).find('p.undo-restore').show();
+                       } else if ( target.hasClass('undo-restore-backup') ) {
+                               self.restorePost( self.undo_post_data );
+                               target.parent().hide();
+                               $(this).find('p.local-restore').show();
+                       }
+
+                       e.preventDefault();
+               });
+       },
+
+       // Restore the current title, content and excerpt from post_data.
+       restorePost: function( post_data ) {
+               var editor;
+
+               if ( post_data ) {
+                       // Set the last saved data
+                       this.lastSavedData = wp.autosave.getCompareString( post_data );
+
+                       if ( $('#title').val() != post_data.post_title )
+                               $('#title').focus().val( post_data.post_title || '' );
+
+                       $('#excerpt').val( post_data.excerpt || '' );
+                       editor = typeof tinymce != 'undefined' && tinymce.get('content');
+
+                       if ( editor && ! editor.isHidden() && typeof switchEditors != 'undefined' ) {
+                               // Make sure there's an undo level in the editor
+                               editor.undoManager.add();
+                               editor.setContent( post_data.content ? switchEditors.wpautop( post_data.content ) : '' );
+                       } else {
+                               // Make sure the Text editor is selected
+                               $('#content-html').click();
+                               $('#content').val( post_data.content );
+                       }
+
+                       return true;
+               }
+
+               return false;
        }
+};
 
-       autosaveOldMessage = jQuery('#autosave').html();
-       jQuery.ajax({
-               data: post_data,
-               beforeSend: doAutoSave ? autosave_loading : null,
-               type: "POST",
-               url: ajaxurl,
-               success: successCallback
-       });
-}
+wp.autosave.local.init();
+
+}(jQuery));
index 864401f630710a93dd29063366a7313bedf5ab75..96a5bc6e36cd0f92d1a55c248ad5ca91250ea71e 100644 (file)
@@ -1 +1 @@
-var autosave,autosaveLast="",autosavePeriodical,autosaveOldMessage="",autosaveDelayPreview=false,notSaved=true,blockSave=false,fullscreen,autosaveLockRelease=true;jQuery(document).ready(function(a){autosaveLast=(a("#post #title").val()||"")+(a("#post #content").val()||"");autosavePeriodical=a.schedule({time:autosaveL10n.autosaveInterval*1000,func:function(){autosave()},repeat:true,protect:true});a("#post").submit(function(){a.cancel(autosavePeriodical);autosaveLockRelease=false});a('input[type="submit"], a.submitdelete',"#submitpost").click(function(){blockSave=true;window.onbeforeunload=null;a(":button, :submit","#submitpost").each(function(){var b=a(this);if(b.hasClass("button-primary")){b.addClass("button-primary-disabled")}else{b.addClass("button-disabled")}});if(a(this).attr("id")=="publish"){a("#major-publishing-actions .spinner").show()}else{a("#minor-publishing .spinner").show()}});window.onbeforeunload=function(){var b=typeof(tinymce)!="undefined"?tinymce.activeEditor:false,d,c;if(b&&!b.isHidden()){if(b.isDirty()){return autosaveL10n.saveAlert}}else{if(fullscreen&&fullscreen.settings.visible){d=a("#wp-fullscreen-title").val()||"";c=a("#wp_mce_fullscreen").val()||""}else{d=a("#post #title").val()||"";c=a("#post #content").val()||""}if((d||c)&&d+c!=autosaveLast){return autosaveL10n.saveAlert}}};a(window).unload(function(b){if(!autosaveLockRelease){return}if(b.target&&b.target.nodeName!="#document"){return}a.ajax({type:"POST",url:ajaxurl,async:false,data:{action:"wp-remove-post-lock",_wpnonce:a("#_wpnonce").val(),post_ID:a("#post_ID").val(),active_post_lock:a("#active_post_lock").val()}})});a("#post-preview").click(function(){if(a("#auto_draft").val()=="1"&&notSaved){autosaveDelayPreview=true;autosave();return false}doPreview();return false});doPreview=function(){a("input#wp-preview").val("dopreview");a("form#post").attr("target","wp-preview").submit().attr("target","");if(a.browser.safari){a("form#post").attr("action",function(b,c){return c+"?t="+new Date().getTime()})}a("input#wp-preview").val("")};a("#title").on("keydown.editor-focus",function(c){var b;if(c.which!=9){return}if(!c.ctrlKey&&!c.altKey&&!c.shiftKey){if(typeof(tinymce)!="undefined"){b=tinymce.get("content")}if(b&&!b.isHidden()){a(this).one("keyup",function(d){a("#content_tbl td.mceToolbar > a").focus()})}else{a("#content").focus()}c.preventDefault()}});if("1"==a("#auto_draft").val()){a("#title").blur(function(){if(!this.value||a("#auto_draft").val()!="1"){return}delayed_autosave()})}});function autosave_parse_response(c){var d=wpAjax.parseAjaxResponse(c,"autosave"),e="",a,b;if(d&&d.responses&&d.responses.length){e=d.responses[0].data;if(d.responses[0].supplemental){b=d.responses[0].supplemental;if("disable"==b.disable_autosave){autosave=function(){};autosaveLockRelease=false;d={errors:true}}if(b["active-post-lock"]){jQuery("#active_post_lock").val(b["active-post-lock"])}if(b.alert){jQuery("#autosave-alert").remove();jQuery("#titlediv").after('<div id="autosave-alert" class="error below-h2"><p>'+b.alert+"</p></div>")}jQuery.each(b,function(f,g){if(f.match(/^replace-/)){jQuery("#"+f.replace("replace-","")).val(g)}})}if(!d.errors){a=parseInt(d.responses[0].id,10);if(!isNaN(a)&&a>0){autosave_update_slug(a)}}}if(e){jQuery(".autosave-message").html(e)}else{if(autosaveOldMessage&&d){jQuery(".autosave-message").html(autosaveOldMessage)}}return d}function autosave_saved(a){blockSave=false;autosave_parse_response(a);autosave_enable_buttons()}function autosave_saved_new(b){blockSave=false;var c=autosave_parse_response(b),a;if(c&&c.responses.length&&!c.errors){a=parseInt(c.responses[0].id,10);if(!isNaN(a)&&a>0){notSaved=false;jQuery("#auto_draft").val("0")}autosave_enable_buttons();if(autosaveDelayPreview){autosaveDelayPreview=false;doPreview()}}else{autosave_enable_buttons()}}function autosave_update_slug(a){if("undefined"!=makeSlugeditClickable&&jQuery.isFunction(makeSlugeditClickable)&&!jQuery("#edit-slug-box > *").size()){jQuery.post(ajaxurl,{action:"sample-permalink",post_id:a,new_title:fullscreen&&fullscreen.settings.visible?jQuery("#wp-fullscreen-title").val():jQuery("#title").val(),samplepermalinknonce:jQuery("#samplepermalinknonce").val()},function(b){if(b!=="-1"){jQuery("#edit-slug-box").html(b);makeSlugeditClickable()}})}}function autosave_loading(){jQuery(".autosave-message").html(autosaveL10n.savingText)}function autosave_enable_buttons(){setTimeout(function(){jQuery(":button, :submit","#submitpost").removeAttr("disabled");jQuery(".spinner","#submitpost").hide()},500)}function autosave_disable_buttons(){jQuery(":button, :submit","#submitpost").prop("disabled",true);setTimeout(autosave_enable_buttons,5000)}function delayed_autosave(){setTimeout(function(){if(blockSave){return}autosave()},200)}autosave=function(){blockSave=true;var c=(typeof tinymce!="undefined")&&tinymce.activeEditor&&!tinymce.activeEditor.isHidden(),d,f,b,e,a;autosave_disable_buttons();d={action:"autosave",post_ID:jQuery("#post_ID").val()||0,autosavenonce:jQuery("#autosavenonce").val(),post_type:jQuery("#post_type").val()||"",autosave:1};jQuery(".tags-input").each(function(){d[this.name]=this.value});f=true;if(jQuery("#TB_window").css("display")=="block"){f=false}if(c&&f){b=tinymce.activeEditor;if(b.plugins.spellchecker&&b.plugins.spellchecker.active){f=false}else{if("mce_fullscreen"==b.id||"wp_mce_fullscreen"==b.id){tinymce.get("content").setContent(b.getContent({format:"raw"}),{format:"raw"})}tinymce.triggerSave()}}if(fullscreen&&fullscreen.settings.visible){d.post_title=jQuery("#wp-fullscreen-title").val()||"";d.content=jQuery("#wp_mce_fullscreen").val()||""}else{d.post_title=jQuery("#title").val()||"";d.content=jQuery("#content").val()||""}if(jQuery("#post_name").val()){d.post_name=jQuery("#post_name").val()}if((d.post_title.length==0&&d.content.length==0)||d.post_title+d.content==autosaveLast){f=false}e=jQuery("#original_post_status").val();goodcats=([]);jQuery("[name='post_category[]']:checked").each(function(g){goodcats.push(this.value)});d.catslist=goodcats.join(",");if(jQuery("#comment_status").prop("checked")){d.comment_status="open"}if(jQuery("#ping_status").prop("checked")){d.ping_status="open"}if(jQuery("#excerpt").size()){d.excerpt=jQuery("#excerpt").val()}if(jQuery("#post_author").size()){d.post_author=jQuery("#post_author").val()}if(jQuery("#parent_id").val()){d.parent_id=jQuery("#parent_id").val()}d.user_ID=jQuery("#user-id").val();if(jQuery("#auto_draft").val()=="1"){d.auto_draft="1"}if(f){autosaveLast=d.post_title+d.content;jQuery(document).triggerHandler("wpcountwords",[d.content])}else{d.autosave=0}if(d.auto_draft=="1"){a=autosave_saved_new}else{a=autosave_saved}autosaveOldMessage=jQuery("#autosave").html();jQuery.ajax({data:d,beforeSend:f?autosave_loading:null,type:"POST",url:ajaxurl,success:a})};
\ No newline at end of file
+var autosave,autosaveLast="",autosavePeriodical,autosaveDelayPreview=false,notSaved=true,blockSave=false,fullscreen,autosaveLockRelease=true;jQuery(document).ready(function(a){if(a("#wp-content-wrap").hasClass("tmce-active")&&typeof switchEditors!="undefined"){autosaveLast=wp.autosave.getCompareString({post_title:a("#title").val()||"",content:switchEditors.pre_wpautop(a("#content").val())||"",excerpt:a("#excerpt").val()||""})}else{autosaveLast=wp.autosave.getCompareString()}autosavePeriodical=a.schedule({time:autosaveL10n.autosaveInterval*1000,func:function(){autosave()},repeat:true,protect:true});a("#post").submit(function(){a.cancel(autosavePeriodical);autosaveLockRelease=false});a('input[type="submit"], a.submitdelete',"#submitpost").click(function(){blockSave=true;window.onbeforeunload=null;a(":button, :submit","#submitpost").each(function(){var b=a(this);if(b.hasClass("button-primary")){b.addClass("button-primary-disabled")}else{b.addClass("button-disabled")}});if(a(this).attr("id")=="publish"){a("#major-publishing-actions .spinner").show()}else{a("#minor-publishing .spinner").show()}});window.onbeforeunload=function(){var b=typeof(tinymce)!="undefined"?tinymce.activeEditor:false,c;if(b&&!b.isHidden()){if(b.isDirty()){return autosaveL10n.saveAlert}}else{if(fullscreen&&fullscreen.settings.visible){c=wp.autosave.getCompareString({post_title:a("#wp-fullscreen-title").val()||"",content:a("#wp_mce_fullscreen").val()||"",excerpt:a("#excerpt").val()||""})}else{c=wp.autosave.getCompareString()}if(c!=autosaveLast){return autosaveL10n.saveAlert}}};a(window).unload(function(b){if(!autosaveLockRelease){return}if(b.target&&b.target.nodeName!="#document"){return}a.ajax({type:"POST",url:ajaxurl,async:false,data:{action:"wp-remove-post-lock",_wpnonce:a("#_wpnonce").val(),post_ID:a("#post_ID").val(),active_post_lock:a("#active_post_lock").val()}})});a("#post-preview").click(function(){if(a("#auto_draft").val()=="1"&&notSaved){autosaveDelayPreview=true;autosave();return false}doPreview();return false});doPreview=function(){a("input#wp-preview").val("dopreview");a("form#post").attr("target","wp-preview").submit().attr("target","");var b=navigator.userAgent.toLowerCase();if(b.indexOf("safari")!=-1&&b.indexOf("chrome")==-1){a("form#post").attr("action",function(c,d){return d+"?t="+new Date().getTime()})}a("input#wp-preview").val("")};a("#title").on("keydown.editor-focus",function(c){var b;if(c.which!=9){return}if(!c.ctrlKey&&!c.altKey&&!c.shiftKey){if(typeof(tinymce)!="undefined"){b=tinymce.get("content")}if(b&&!b.isHidden()){a(this).one("keyup",function(d){a("#content_tbl td.mceToolbar > a").focus()})}else{a("#content").focus()}c.preventDefault()}});if("1"==a("#auto_draft").val()){a("#title").blur(function(){if(!this.value||a("#auto_draft").val()!="1"){return}delayed_autosave()})}a(document).on("heartbeat-connection-lost.autosave",function(d,b){if("timeout"===b){var c=a("#lost-connection-notice");if(!wp.autosave.local.hasStorage){c.find(".hide-if-no-sessionstorage").hide()}c.show();autosave_disable_buttons()}}).on("heartbeat-connection-restored.autosave",function(){a("#lost-connection-notice").hide();autosave_enable_buttons()})});function autosave_parse_response(b){var d=wpAjax.parseAjaxResponse(b,"autosave"),c,a;if(d&&d.responses&&d.responses.length){if(d.responses[0].supplemental){a=d.responses[0].supplemental;jQuery.each(a,function(e,f){if(e.match(/^replace-/)){jQuery("#"+e.replace("replace-","")).val(f)}})}if(!d.errors){if(c=parseInt(d.responses[0].id,10)){autosave_update_slug(c)}if(d.responses[0].data){jQuery(".autosave-message").text(d.responses[0].data)}}}return d}function autosave_saved(a){blockSave=false;autosave_parse_response(a);autosave_enable_buttons()}function autosave_saved_new(a){blockSave=false;var c=autosave_parse_response(a),b;if(c&&c.responses.length&&!c.errors){b=parseInt(c.responses[0].id,10);if(b){notSaved=false;jQuery("#auto_draft").val("0")}autosave_enable_buttons();if(autosaveDelayPreview){autosaveDelayPreview=false;doPreview()}}else{autosave_enable_buttons()}}function autosave_update_slug(a){if("undefined"!=makeSlugeditClickable&&jQuery.isFunction(makeSlugeditClickable)&&!jQuery("#edit-slug-box > *").size()){jQuery.post(ajaxurl,{action:"sample-permalink",post_id:a,new_title:fullscreen&&fullscreen.settings.visible?jQuery("#wp-fullscreen-title").val():jQuery("#title").val(),samplepermalinknonce:jQuery("#samplepermalinknonce").val()},function(c){if(c!=="-1"){var b=jQuery("#edit-slug-box");b.html(c);if(b.hasClass("hidden")){b.fadeIn("fast",function(){b.removeClass("hidden")})}makeSlugeditClickable()}})}}function autosave_loading(){jQuery(".autosave-message").html(autosaveL10n.savingText)}function autosave_enable_buttons(){jQuery(document).trigger("autosave-enable-buttons");if(!wp.heartbeat||!wp.heartbeat.hasConnectionError()){setTimeout(function(){var a=jQuery("#submitpost");a.find(":button, :submit").removeAttr("disabled");a.find(".spinner").hide()},500)}}function autosave_disable_buttons(){jQuery(document).trigger("autosave-disable-buttons");jQuery("#submitpost").find(":button, :submit").prop("disabled",true);setTimeout(autosave_enable_buttons,5000)}function delayed_autosave(){setTimeout(function(){if(blockSave){return}autosave()},200)}autosave=function(){var c=wp.autosave.getPostData(),b,a;blockSave=true;if(!c.autosave){return false}if(jQuery("#TB_window").css("display")=="block"){return false}b=wp.autosave.getCompareString(c);if(b==autosaveLast){return false}autosaveLast=b;jQuery(document).triggerHandler("wpcountwords",[c.content]);autosave_disable_buttons();if(c.auto_draft=="1"){a=autosave_saved_new}else{a=autosave_saved}jQuery.ajax({data:c,beforeSend:autosave_loading,type:"POST",url:ajaxurl,success:a});return true};window.wp=window.wp||{};wp.autosave=wp.autosave||{};(function(a){wp.autosave.getPostData=function(){var b=typeof tinymce!="undefined"?tinymce.activeEditor:null,d,f,c=[],e={action:"autosave",autosave:true,post_id:a("#post_ID").val()||0,autosavenonce:a("#autosavenonce").val()||"",post_type:a("#post_type").val()||"",post_author:a("#post_author").val()||"",excerpt:a("#excerpt").val()||""};if(b&&!b.isHidden()){if(b.plugins.spellchecker&&b.plugins.spellchecker.active){e.autosave=false;return e}else{if("mce_fullscreen"==b.id){tinymce.get("content").setContent(b.getContent({format:"raw"}),{format:"raw"})}tinymce.triggerSave()}}if(typeof fullscreen!="undefined"&&fullscreen.settings.visible){e.post_title=a("#wp-fullscreen-title").val()||"";e.content=a("#wp_mce_fullscreen").val()||""}else{e.post_title=a("#title").val()||"";e.content=a("#content").val()||""}a('input[id^="in-category-"]:checked').each(function(){c.push(this.value)});e.catslist=c.join(",");if(d=a("#post_name").val()){e.post_name=d}if(f=a("#parent_id").val()){e.parent_id=f}if(a("#comment_status").prop("checked")){e.comment_status="open"}if(a("#ping_status").prop("checked")){e.ping_status="open"}if(a("#auto_draft").val()=="1"){e.auto_draft="1"}return e};wp.autosave.getCompareString=function(b){if(typeof b==="object"){return(b.post_title||"")+"::"+(b.content||"")+"::"+(b.excerpt||"")}return(a("#title").val()||"")+"::"+(a("#content").val()||"")+"::"+(a("#excerpt").val()||"")};wp.autosave.local={lastSavedData:"",blog_id:0,hasStorage:false,checkStorage:function(){var d=Math.random(),b=false;try{sessionStorage.setItem("wp-test",d);b=sessionStorage.getItem("wp-test")==d;sessionStorage.removeItem("wp-test")}catch(c){}this.hasStorage=b;return b},getStorage:function(){var b=false;if(this.hasStorage&&this.blog_id){b=sessionStorage.getItem("wp-autosave-"+this.blog_id);if(b){b=JSON.parse(b)}else{b={}}}return b},setStorage:function(b){var c;if(this.hasStorage&&this.blog_id){c="wp-autosave-"+this.blog_id;sessionStorage.setItem(c,JSON.stringify(b));return sessionStorage.getItem(c)!==null}return false},getData:function(){var c=this.getStorage(),b=a("#post_ID").val();if(!c||!b){return false}return c["post_"+b]||false},setData:function(b){var d=this.getStorage(),c=a("#post_ID").val();if(!d||!c){return false}if(b){d["post_"+c]=b}else{if(d.hasOwnProperty("post_"+c)){delete d["post_"+c]}else{return false}}return this.setStorage(d)},save:function(d){var b=false,e,c;if(!d){e=wp.autosave.getPostData()}else{e=this.getData()||{};a.extend(e,d);e.autosave=true}if(!e.autosave){return false}c=wp.autosave.getCompareString(e);if(c==this.lastSavedData){return false}e.save_time=(new Date()).getTime();e.status=a("#post_status").val()||"";b=this.setData(e);if(b){this.lastSavedData=c}return b},init:function(c){var b=this;if(!this.checkStorage()){return}if(!a("#content").length&&!a("#excerpt").length){return}if(c){a.extend(this,c)}if(!this.blog_id){this.blog_id=typeof window.autosaveL10n!="undefined"?window.autosaveL10n.blog_id:0}a(document).ready(function(){b.run()})},run:function(){var b=this;this.checkPost();this.schedule=a.schedule({time:15*1000,func:function(){wp.autosave.local.save()},repeat:true,protect:true});a("form#post").on("submit.autosave-local",function(){var d=typeof tinymce!="undefined"&&tinymce.get("content"),c=a("#post_ID").val()||0;if(d&&!d.isHidden()){d.onSubmit.add(function(){wp.autosave.local.save({post_title:a("#title").val()||"",content:a("#content").val()||"",excerpt:a("#excerpt").val()||""})})}else{b.save({post_title:a("#title").val()||"",content:a("#content").val()||"",excerpt:a("#excerpt").val()||""})}wpCookies.set("wp-saving-post-"+c,"check")})},compare:function(d,c){function b(e){return e.toString().replace(/[\x20\t\r\n\f]+/g,"")}return(b(d||"")==b(c||""))},checkPost:function(){var c=this,i=this.getData(),g,f,b,h,d=a("#post_ID").val()||0,e=wpCookies.get("wp-saving-post-"+d);if(!i){return}if(e){wpCookies.remove("wp-saving-post-"+d);if(e=="saved"){this.setData(false);return}}if(a("#has-newer-autosave").length){return}g=a("#content").val()||"";f=a("#title").val()||"";b=a("#excerpt").val()||"";if(a("#wp-content-wrap").hasClass("tmce-active")&&typeof switchEditors!="undefined"){g=switchEditors.pre_wpautop(g)}if(e!="check"&&this.compare(g,i.content)&&this.compare(f,i.post_title)&&this.compare(b,i.excerpt)){return}this.restore_post_data=i;this.undo_post_data={content:g,post_title:f,excerpt:b};h=a("#local-storage-notice");a(".wrap h2").first().after(h.addClass("updated").show());h.on("click",function(k){var j=a(k.target);if(j.hasClass("restore-backup")){c.restorePost(c.restore_post_data);j.parent().hide();a(this).find("p.undo-restore").show()}else{if(j.hasClass("undo-restore-backup")){c.restorePost(c.undo_post_data);j.parent().hide();a(this).find("p.local-restore").show()}}k.preventDefault()})},restorePost:function(c){var b;if(c){this.lastSavedData=wp.autosave.getCompareString(c);if(a("#title").val()!=c.post_title){a("#title").focus().val(c.post_title||"")}a("#excerpt").val(c.excerpt||"");b=typeof tinymce!="undefined"&&tinymce.get("content");if(b&&!b.isHidden()&&typeof switchEditors!="undefined"){b.undoManager.add();b.setContent(c.content?switchEditors.wpautop(c.content):"")}else{a("#content-html").click();a("#content").val(c.content)}return true}return false}};wp.autosave.local.init()}(jQuery));
\ No newline at end of file
index c1c0d4fff28ffcc865d0d47397f284f0ccdcc516..8555ecaf292a57bb1dcc3c33c78d9a6da30f30cb 100644 (file)
@@ -1,38 +1,7 @@
-// Backbone.js 0.9.2
+// Backbone.js 1.0.0
 
-// (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
+// (c) 2010-2013 Jeremy Ashkenas, DocumentCloud Inc.
 // Backbone may be freely distributed under the MIT license.
 // For all details and documentation:
 // http://backbonejs.org
-(function(){var l=this,y=l.Backbone,z=Array.prototype.slice,A=Array.prototype.splice,g;g="undefined"!==typeof exports?exports:l.Backbone={};g.VERSION="0.9.2";var f=l._;!f&&"undefined"!==typeof require&&(f=require("underscore"));var i=l.jQuery||l.Zepto||l.ender;g.setDomLibrary=function(a){i=a};g.noConflict=function(){l.Backbone=y;return this};g.emulateHTTP=!1;g.emulateJSON=!1;var p=/\s+/,k=g.Events={on:function(a,b,c){var d,e,f,g,j;if(!b)return this;a=a.split(p);for(d=this._callbacks||(this._callbacks=
-{});e=a.shift();)f=(j=d[e])?j.tail:{},f.next=g={},f.context=c,f.callback=b,d[e]={tail:g,next:j?j.next:f};return this},off:function(a,b,c){var d,e,h,g,j,q;if(e=this._callbacks){if(!a&&!b&&!c)return delete this._callbacks,this;for(a=a?a.split(p):f.keys(e);d=a.shift();)if(h=e[d],delete e[d],h&&(b||c))for(g=h.tail;(h=h.next)!==g;)if(j=h.callback,q=h.context,b&&j!==b||c&&q!==c)this.on(d,j,q);return this}},trigger:function(a){var b,c,d,e,f,g;if(!(d=this._callbacks))return this;f=d.all;a=a.split(p);for(g=
-z.call(arguments,1);b=a.shift();){if(c=d[b])for(e=c.tail;(c=c.next)!==e;)c.callback.apply(c.context||this,g);if(c=f){e=c.tail;for(b=[b].concat(g);(c=c.next)!==e;)c.callback.apply(c.context||this,b)}}return this}};k.bind=k.on;k.unbind=k.off;var o=g.Model=function(a,b){var c;a||(a={});b&&b.parse&&(a=this.parse(a));if(c=n(this,"defaults"))a=f.extend({},c,a);b&&b.collection&&(this.collection=b.collection);this.attributes={};this._escapedAttributes={};this.cid=f.uniqueId("c");this.changed={};this._silent=
-{};this._pending={};this.set(a,{silent:!0});this.changed={};this._silent={};this._pending={};this._previousAttributes=f.clone(this.attributes);this.initialize.apply(this,arguments)};f.extend(o.prototype,k,{changed:null,_silent:null,_pending:null,idAttribute:"id",initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;b=this.get(a);return this._escapedAttributes[a]=f.escape(null==
-b?"":""+b)},has:function(a){return null!=this.get(a)},set:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c||(c={});if(!d)return this;d instanceof o&&(d=d.attributes);if(c.unset)for(e in d)d[e]=void 0;if(!this._validate(d,c))return!1;this.idAttribute in d&&(this.id=d[this.idAttribute]);var b=c.changes={},h=this.attributes,g=this._escapedAttributes,j=this._previousAttributes||{};for(e in d){a=d[e];if(!f.isEqual(h[e],a)||c.unset&&f.has(h,e))delete g[e],(c.silent?this._silent:
-b)[e]=!0;c.unset?delete h[e]:h[e]=a;!f.isEqual(j[e],a)||f.has(h,e)!=f.has(j,e)?(this.changed[e]=a,c.silent||(this._pending[e]=!0)):(delete this.changed[e],delete this._pending[e])}c.silent||this.change(c);return this},unset:function(a,b){(b||(b={})).unset=!0;return this.set(a,null,b)},clear:function(a){(a||(a={})).unset=!0;return this.set(f.clone(this.attributes),a)},fetch:function(a){var a=a?f.clone(a):{},b=this,c=a.success;a.success=function(d,e,f){if(!b.set(b.parse(d,f),a))return!1;c&&c(b,d)};
-a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,"read",this,a)},save:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c=c?f.clone(c):{};if(c.wait){if(!this._validate(d,c))return!1;e=f.clone(this.attributes)}a=f.extend({},c,{silent:!0});if(d&&!this.set(d,c.wait?a:c))return!1;var h=this,i=c.success;c.success=function(a,b,e){b=h.parse(a,e);if(c.wait){delete c.wait;b=f.extend(d||{},b)}if(!h.set(b,c))return false;i?i(h,a):h.trigger("sync",h,a,c)};c.error=g.wrapError(c.error,
-h,c);b=this.isNew()?"create":"update";b=(this.sync||g.sync).call(this,b,this,c);c.wait&&this.set(e,a);return b},destroy:function(a){var a=a?f.clone(a):{},b=this,c=a.success,d=function(){b.trigger("destroy",b,b.collection,a)};if(this.isNew())return d(),!1;a.success=function(e){a.wait&&d();c?c(b,e):b.trigger("sync",b,e,a)};a.error=g.wrapError(a.error,b,a);var e=(this.sync||g.sync).call(this,"delete",this,a);a.wait||d();return e},url:function(){var a=n(this,"urlRoot")||n(this.collection,"url")||t();
-return this.isNew()?a:a+("/"==a.charAt(a.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},change:function(a){a||(a={});var b=this._changing;this._changing=!0;for(var c in this._silent)this._pending[c]=!0;var d=f.extend({},a.changes,this._silent);this._silent={};for(c in d)this.trigger("change:"+c,this,this.get(c),a);if(b)return this;for(;!f.isEmpty(this._pending);){this._pending=
-{};this.trigger("change",this,a);for(c in this.changed)!this._pending[c]&&!this._silent[c]&&delete this.changed[c];this._previousAttributes=f.clone(this.attributes)}this._changing=!1;return this},hasChanged:function(a){return!arguments.length?!f.isEmpty(this.changed):f.has(this.changed,a)},changedAttributes:function(a){if(!a)return this.hasChanged()?f.clone(this.changed):!1;var b,c=!1,d=this._previousAttributes,e;for(e in a)if(!f.isEqual(d[e],b=a[e]))(c||(c={}))[e]=b;return c},previous:function(a){return!arguments.length||
-!this._previousAttributes?null:this._previousAttributes[a]},previousAttributes:function(){return f.clone(this._previousAttributes)},isValid:function(){return!this.validate(this.attributes)},_validate:function(a,b){if(b.silent||!this.validate)return!0;var a=f.extend({},this.attributes,a),c=this.validate(a,b);if(!c)return!0;b&&b.error?b.error(this,c,b):this.trigger("error",this,c,b);return!1}});var r=g.Collection=function(a,b){b||(b={});b.model&&(this.model=b.model);b.comparator&&(this.comparator=b.comparator);
-this._reset();this.initialize.apply(this,arguments);a&&this.reset(a,{silent:!0,parse:b.parse})};f.extend(r.prototype,k,{model:o,initialize:function(){},toJSON:function(a){return this.map(function(b){return b.toJSON(a)})},add:function(a,b){var c,d,e,g,i,j={},k={},l=[];b||(b={});a=f.isArray(a)?a.slice():[a];c=0;for(d=a.length;c<d;c++){if(!(e=a[c]=this._prepareModel(a[c],b)))throw Error("Can't add an invalid model to a collection");g=e.cid;i=e.id;j[g]||this._byCid[g]||null!=i&&(k[i]||this._byId[i])?
-l.push(c):j[g]=k[i]=e}for(c=l.length;c--;)a.splice(l[c],1);c=0;for(d=a.length;c<d;c++)(e=a[c]).on("all",this._onModelEvent,this),this._byCid[e.cid]=e,null!=e.id&&(this._byId[e.id]=e);this.length+=d;A.apply(this.models,[null!=b.at?b.at:this.models.length,0].concat(a));this.comparator&&this.sort({silent:!0});if(b.silent)return this;c=0;for(d=this.models.length;c<d;c++)if(j[(e=this.models[c]).cid])b.index=c,e.trigger("add",e,this,b);return this},remove:function(a,b){var c,d,e,g;b||(b={});a=f.isArray(a)?
-a.slice():[a];c=0;for(d=a.length;c<d;c++)if(g=this.getByCid(a[c])||this.get(a[c]))delete this._byId[g.id],delete this._byCid[g.cid],e=this.indexOf(g),this.models.splice(e,1),this.length--,b.silent||(b.index=e,g.trigger("remove",g,this,b)),this._removeReference(g);return this},push:function(a,b){a=this._prepareModel(a,b);this.add(a,b);return a},pop:function(a){var b=this.at(this.length-1);this.remove(b,a);return b},unshift:function(a,b){a=this._prepareModel(a,b);this.add(a,f.extend({at:0},b));return a},
-shift:function(a){var b=this.at(0);this.remove(b,a);return b},get:function(a){return null==a?void 0:this._byId[null!=a.id?a.id:a]},getByCid:function(a){return a&&this._byCid[a.cid||a]},at:function(a){return this.models[a]},where:function(a){return f.isEmpty(a)?[]:this.filter(function(b){for(var c in a)if(a[c]!==b.get(c))return!1;return!0})},sort:function(a){a||(a={});if(!this.comparator)throw Error("Cannot sort a set without a comparator");var b=f.bind(this.comparator,this);1==this.comparator.length?
-this.models=this.sortBy(b):this.models.sort(b);a.silent||this.trigger("reset",this,a);return this},pluck:function(a){return f.map(this.models,function(b){return b.get(a)})},reset:function(a,b){a||(a=[]);b||(b={});for(var c=0,d=this.models.length;c<d;c++)this._removeReference(this.models[c]);this._reset();this.add(a,f.extend({silent:!0},b));b.silent||this.trigger("reset",this,b);return this},fetch:function(a){a=a?f.clone(a):{};void 0===a.parse&&(a.parse=!0);var b=this,c=a.success;a.success=function(d,
-e,f){b[a.add?"add":"reset"](b.parse(d,f),a);c&&c(b,d)};a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,"read",this,a)},create:function(a,b){var c=this,b=b?f.clone(b):{},a=this._prepareModel(a,b);if(!a)return!1;b.wait||c.add(a,b);var d=b.success;b.success=function(e,f){b.wait&&c.add(e,b);d?d(e,f):e.trigger("sync",a,f,b)};a.save(null,b);return a},parse:function(a){return a},chain:function(){return f(this.models).chain()},_reset:function(){this.length=0;this.models=[];this._byId=
-{};this._byCid={}},_prepareModel:function(a,b){b||(b={});a instanceof o?a.collection||(a.collection=this):(b.collection=this,a=new this.model(a,b),a._validate(a.attributes,b)||(a=!1));return a},_removeReference:function(a){this==a.collection&&delete a.collection;a.off("all",this._onModelEvent,this)},_onModelEvent:function(a,b,c,d){("add"==a||"remove"==a)&&c!=this||("destroy"==a&&this.remove(b,d),b&&a==="change:"+b.idAttribute&&(delete this._byId[b.previous(b.idAttribute)],this._byId[b.id]=b),this.trigger.apply(this,
-arguments))}});f.each("forEach,each,map,reduce,reduceRight,find,detect,filter,select,reject,every,all,some,any,include,contains,invoke,max,min,sortBy,sortedIndex,toArray,size,first,initial,rest,last,without,indexOf,shuffle,lastIndexOf,isEmpty,groupBy".split(","),function(a){r.prototype[a]=function(){return f[a].apply(f,[this.models].concat(f.toArray(arguments)))}});var u=g.Router=function(a){a||(a={});a.routes&&(this.routes=a.routes);this._bindRoutes();this.initialize.apply(this,arguments)},B=/:\w+/g,
-C=/\*\w+/g,D=/[-[\]{}()+?.,\\^$|#\s]/g;f.extend(u.prototype,k,{initialize:function(){},route:function(a,b,c){g.history||(g.history=new m);f.isRegExp(a)||(a=this._routeToRegExp(a));c||(c=this[b]);g.history.route(a,f.bind(function(d){d=this._extractParameters(a,d);c&&c.apply(this,d);this.trigger.apply(this,["route:"+b].concat(d));g.history.trigger("route",this,b,d)},this));return this},navigate:function(a,b){g.history.navigate(a,b)},_bindRoutes:function(){if(this.routes){var a=[],b;for(b in this.routes)a.unshift([b,
-this.routes[b]]);b=0;for(var c=a.length;b<c;b++)this.route(a[b][0],a[b][1],this[a[b][1]])}},_routeToRegExp:function(a){a=a.replace(D,"\\$&").replace(B,"([^/]+)").replace(C,"(.*?)");return RegExp("^"+a+"$")},_extractParameters:function(a,b){return a.exec(b).slice(1)}});var m=g.History=function(){this.handlers=[];f.bindAll(this,"checkUrl")},s=/^[#\/]/,E=/msie [\w.]+/;m.started=!1;f.extend(m.prototype,k,{interval:50,getHash:function(a){return(a=(a?a.location:window.location).href.match(/#(.*)$/))?a[1]:
-""},getFragment:function(a,b){if(null==a)if(this._hasPushState||b){var a=window.location.pathname,c=window.location.search;c&&(a+=c)}else a=this.getHash();a.indexOf(this.options.root)||(a=a.substr(this.options.root.length));return a.replace(s,"")},start:function(a){if(m.started)throw Error("Backbone.history has already been started");m.started=!0;this.options=f.extend({},{root:"/"},this.options,a);this._wantsHashChange=!1!==this.options.hashChange;this._wantsPushState=!!this.options.pushState;this._hasPushState=
-!(!this.options.pushState||!window.history||!window.history.pushState);var a=this.getFragment(),b=document.documentMode;if(b=E.exec(navigator.userAgent.toLowerCase())&&(!b||7>=b))this.iframe=i('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(a);this._hasPushState?i(window).bind("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!b?i(window).bind("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,
-this.interval));this.fragment=a;a=window.location;b=a.pathname==this.options.root;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!b)return this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment),!0;this._wantsPushState&&this._hasPushState&&b&&a.hash&&(this.fragment=this.getHash().replace(s,""),window.history.replaceState({},document.title,a.protocol+"//"+a.host+this.options.root+this.fragment));if(!this.options.silent)return this.loadUrl()},
-stop:function(){i(window).unbind("popstate",this.checkUrl).unbind("hashchange",this.checkUrl);clearInterval(this._checkUrlInterval);m.started=!1},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(){var a=this.getFragment();a==this.fragment&&this.iframe&&(a=this.getFragment(this.getHash(this.iframe)));if(a==this.fragment)return!1;this.iframe&&this.navigate(a);this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(a){var b=this.fragment=this.getFragment(a);return f.any(this.handlers,
-function(a){if(a.route.test(b))return a.callback(b),!0})},navigate:function(a,b){if(!m.started)return!1;if(!b||!0===b)b={trigger:b};var c=(a||"").replace(s,"");this.fragment!=c&&(this._hasPushState?(0!=c.indexOf(this.options.root)&&(c=this.options.root+c),this.fragment=c,window.history[b.replace?"replaceState":"pushState"]({},document.title,c)):this._wantsHashChange?(this.fragment=c,this._updateHash(window.location,c,b.replace),this.iframe&&c!=this.getFragment(this.getHash(this.iframe))&&(b.replace||
-this.iframe.document.open().close(),this._updateHash(this.iframe.location,c,b.replace))):window.location.assign(this.options.root+a),b.trigger&&this.loadUrl(a))},_updateHash:function(a,b,c){c?a.replace(a.toString().replace(/(javascript:|#).*$/,"")+"#"+b):a.hash=b}});var v=g.View=function(a){this.cid=f.uniqueId("view");this._configure(a||{});this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()},F=/^(\S+)\s*(.*)$/,w="model,collection,el,id,attributes,className,tagName".split(",");
-f.extend(v.prototype,k,{tagName:"div",$:function(a){return this.$el.find(a)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();return this},make:function(a,b,c){a=document.createElement(a);b&&i(a).attr(b);c&&i(a).html(c);return a},setElement:function(a,b){this.$el&&this.undelegateEvents();this.$el=a instanceof i?a:i(a);this.el=this.$el[0];!1!==b&&this.delegateEvents();return this},delegateEvents:function(a){if(a||(a=n(this,"events"))){this.undelegateEvents();
-for(var b in a){var c=a[b];f.isFunction(c)||(c=this[a[b]]);if(!c)throw Error('Method "'+a[b]+'" does not exist');var d=b.match(F),e=d[1],d=d[2],c=f.bind(c,this),e=e+(".delegateEvents"+this.cid);""===d?this.$el.bind(e,c):this.$el.delegate(d,e,c)}}},undelegateEvents:function(){this.$el.unbind(".delegateEvents"+this.cid)},_configure:function(a){this.options&&(a=f.extend({},this.options,a));for(var b=0,c=w.length;b<c;b++){var d=w[b];a[d]&&(this[d]=a[d])}this.options=a},_ensureElement:function(){if(this.el)this.setElement(this.el,
-!1);else{var a=n(this,"attributes")||{};this.id&&(a.id=this.id);this.className&&(a["class"]=this.className);this.setElement(this.make(this.tagName,a),!1)}}});o.extend=r.extend=u.extend=v.extend=function(a,b){var c=G(this,a,b);c.extend=this.extend;return c};var H={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};g.sync=function(a,b,c){var d=H[a];c||(c={});var e={type:d,dataType:"json"};c.url||(e.url=n(b,"url")||t());if(!c.data&&b&&("create"==a||"update"==a))e.contentType="application/json",
-e.data=JSON.stringify(b.toJSON());g.emulateJSON&&(e.contentType="application/x-www-form-urlencoded",e.data=e.data?{model:e.data}:{});if(g.emulateHTTP&&("PUT"===d||"DELETE"===d))g.emulateJSON&&(e.data._method=d),e.type="POST",e.beforeSend=function(a){a.setRequestHeader("X-HTTP-Method-Override",d)};"GET"!==e.type&&!g.emulateJSON&&(e.processData=!1);return i.ajax(f.extend(e,c))};g.wrapError=function(a,b,c){return function(d,e){e=d===b?e:d;a?a(b,e,c):b.trigger("error",b,e,c)}};var x=function(){},G=function(a,
-b,c){var d;d=b&&b.hasOwnProperty("constructor")?b.constructor:function(){a.apply(this,arguments)};f.extend(d,a);x.prototype=a.prototype;d.prototype=new x;b&&f.extend(d.prototype,b);c&&f.extend(d,c);d.prototype.constructor=d;d.__super__=a.prototype;return d},n=function(a,b){return!a||!a[b]?null:f.isFunction(a[b])?a[b]():a[b]},t=function(){throw Error('A "url" property or function must be specified');}}).call(this);
+(function(){var t=this;var e=t.Backbone;var i=[];var r=i.push;var s=i.slice;var n=i.splice;var a;if(typeof exports!=="undefined"){a=exports}else{a=t.Backbone={}}a.VERSION="1.0.0";var h=t._;if(!h&&typeof require!=="undefined")h=require("underscore");a.$=t.jQuery||t.Zepto||t.ender||t.$;a.noConflict=function(){t.Backbone=e;return this};a.emulateHTTP=false;a.emulateJSON=false;var o=a.Events={on:function(t,e,i){if(!l(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,i){if(!l(this,"once",t,[e,i])||!e)return this;var r=this;var s=h.once(function(){r.off(t,s);e.apply(this,arguments)});s._callback=e;return this.on(t,s,i)},off:function(t,e,i){var r,s,n,a,o,u,c,f;if(!this._events||!l(this,"off",t,[e,i]))return this;if(!t&&!e&&!i){this._events={};return this}a=t?[t]:h.keys(this._events);for(o=0,u=a.length;o<u;o++){t=a[o];if(n=this._events[t]){this._events[t]=r=[];if(e||i){for(c=0,f=n.length;c<f;c++){s=n[c];if(e&&e!==s.callback&&e!==s.callback._callback||i&&i!==s.context){r.push(s)}}}if(!r.length)delete this._events[t]}}return this},trigger:function(t){if(!this._events)return this;var e=s.call(arguments,1);if(!l(this,"trigger",t,e))return this;var i=this._events[t];var r=this._events.all;if(i)c(i,e);if(r)c(r,arguments);return this},stopListening:function(t,e,i){var r=this._listeners;if(!r)return this;var s=!e&&!i;if(typeof e==="object")i=this;if(t)(r={})[t._listenerId]=t;for(var n in r){r[n].off(e,i,this);if(s)delete this._listeners[n]}return this}};var u=/\s+/;var l=function(t,e,i,r){if(!i)return true;if(typeof i==="object"){for(var s in i){t[e].apply(t,[s,i[s]].concat(r))}return false}if(u.test(i)){var n=i.split(u);for(var a=0,h=n.length;a<h;a++){t[e].apply(t,[n[a]].concat(r))}return false}return true};var c=function(t,e){var i,r=-1,s=t.length,n=e[0],a=e[1],h=e[2];switch(e.length){case 0:while(++r<s)(i=t[r]).callback.call(i.ctx);return;case 1:while(++r<s)(i=t[r]).callback.call(i.ctx,n);return;case 2:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a);return;case 3:while(++r<s)(i=t[r]).callback.call(i.ctx,n,a,h);return;default:while(++r<s)(i=t[r]).callback.apply(i.ctx,e)}};var f={listenTo:"on",listenToOnce:"once"};h.each(f,function(t,e){o[e]=function(e,i,r){var s=this._listeners||(this._listeners={});var n=e._listenerId||(e._listenerId=h.uniqueId("l"));s[n]=e;if(typeof i==="object")r=this;e[t](i,r,this);return this}});o.bind=o.on;o.unbind=o.off;h.extend(a,o);var d=a.Model=function(t,e){var i;var r=t||{};e||(e={});this.cid=h.uniqueId("c");this.attributes={};h.extend(this,h.pick(e,p));if(e.parse)r=this.parse(r,e)||{};if(i=h.result(this,"defaults")){r=h.defaults({},r,i)}this.set(r,e);this.changed={};this.initialize.apply(this,arguments)};var p=["url","urlRoot","collection"];h.extend(d.prototype,o,{changed:null,validationError:null,idAttribute:"id",initialize:function(){},toJSON:function(t){return h.clone(this.attributes)},sync:function(){return a.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return h.escape(this.get(t))},has:function(t){return this.get(t)!=null},set:function(t,e,i){var r,s,n,a,o,u,l,c;if(t==null)return this;if(typeof t==="object"){s=t;i=e}else{(s={})[t]=e}i||(i={});if(!this._validate(s,i))return false;n=i.unset;o=i.silent;a=[];u=this._changing;this._changing=true;if(!u){this._previousAttributes=h.clone(this.attributes);this.changed={}}c=this.attributes,l=this._previousAttributes;if(this.idAttribute in s)this.id=s[this.idAttribute];for(r in s){e=s[r];if(!h.isEqual(c[r],e))a.push(r);if(!h.isEqual(l[r],e)){this.changed[r]=e}else{delete this.changed[r]}n?delete c[r]:c[r]=e}if(!o){if(a.length)this._pending=true;for(var f=0,d=a.length;f<d;f++){this.trigger("change:"+a[f],this,c[a[f]],i)}}if(u)return this;if(!o){while(this._pending){this._pending=false;this.trigger("change",this,i)}}this._pending=false;this._changing=false;return this},unset:function(t,e){return this.set(t,void 0,h.extend({},e,{unset:true}))},clear:function(t){var e={};for(var i in this.attributes)e[i]=void 0;return this.set(e,h.extend({},t,{unset:true}))},hasChanged:function(t){if(t==null)return!h.isEmpty(this.changed);return h.has(this.changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?h.clone(this.changed):false;var e,i=false;var r=this._changing?this._previousAttributes:this.attributes;for(var s in t){if(h.isEqual(r[s],e=t[s]))continue;(i||(i={}))[s]=e}return i},previous:function(t){if(t==null||!this._previousAttributes)return null;return this._previousAttributes[t]},previousAttributes:function(){return h.clone(this._previousAttributes)},fetch:function(t){t=t?h.clone(t):{};if(t.parse===void 0)t.parse=true;var e=this;var i=t.success;t.success=function(r){if(!e.set(e.parse(r,t),t))return false;if(i)i(e,r,t);e.trigger("sync",e,r,t)};R(this,t);return this.sync("read",this,t)},save:function(t,e,i){var r,s,n,a=this.attributes;if(t==null||typeof t==="object"){r=t;i=e}else{(r={})[t]=e}if(r&&(!i||!i.wait)&&!this.set(r,i))return false;i=h.extend({validate:true},i);if(!this._validate(r,i))return false;if(r&&i.wait){this.attributes=h.extend({},a,r)}if(i.parse===void 0)i.parse=true;var o=this;var u=i.success;i.success=function(t){o.attributes=a;var e=o.parse(t,i);if(i.wait)e=h.extend(r||{},e);if(h.isObject(e)&&!o.set(e,i)){return false}if(u)u(o,t,i);o.trigger("sync",o,t,i)};R(this,i);s=this.isNew()?"create":i.patch?"patch":"update";if(s==="patch")i.attrs=r;n=this.sync(s,this,i);if(r&&i.wait)this.attributes=a;return n},destroy:function(t){t=t?h.clone(t):{};var e=this;var i=t.success;var r=function(){e.trigger("destroy",e,e.collection,t)};t.success=function(s){if(t.wait||e.isNew())r();if(i)i(e,s,t);if(!e.isNew())e.trigger("sync",e,s,t)};if(this.isNew()){t.success();return false}R(this,t);var s=this.sync("delete",this,t);if(!t.wait)r();return s},url:function(){var t=h.result(this,"urlRoot")||h.result(this.collection,"url")||U();if(this.isNew())return t;return t+(t.charAt(t.length-1)==="/"?"":"/")+encodeURIComponent(this.id)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return this.id==null},isValid:function(t){return this._validate({},h.extend(t||{},{validate:true}))},_validate:function(t,e){if(!e.validate||!this.validate)return true;t=h.extend({},this.attributes,t);var i=this.validationError=this.validate(t,e)||null;if(!i)return true;this.trigger("invalid",this,i,h.extend(e||{},{validationError:i}));return false}});var v=["keys","values","pairs","invert","pick","omit"];h.each(v,function(t){d.prototype[t]=function(){var e=s.call(arguments);e.unshift(this.attributes);return h[t].apply(h,e)}});var g=a.Collection=function(t,e){e||(e={});if(e.url)this.url=e.url;if(e.model)this.model=e.model;if(e.comparator!==void 0)this.comparator=e.comparator;this._reset();this.initialize.apply(this,arguments);if(t)this.reset(t,h.extend({silent:true},e))};var m={add:true,remove:true,merge:true};var y={add:true,merge:false,remove:false};h.extend(g.prototype,o,{model:d,initialize:function(){},toJSON:function(t){return this.map(function(e){return e.toJSON(t)})},sync:function(){return a.sync.apply(this,arguments)},add:function(t,e){return this.set(t,h.defaults(e||{},y))},remove:function(t,e){t=h.isArray(t)?t.slice():[t];e||(e={});var i,r,s,n;for(i=0,r=t.length;i<r;i++){n=this.get(t[i]);if(!n)continue;delete this._byId[n.id];delete this._byId[n.cid];s=this.indexOf(n);this.models.splice(s,1);this.length--;if(!e.silent){e.index=s;n.trigger("remove",n,this,e)}this._removeReference(n)}return this},set:function(t,e){e=h.defaults(e||{},m);if(e.parse)t=this.parse(t,e);if(!h.isArray(t))t=t?[t]:[];var i,s,a,o,u,l;var c=e.at;var f=this.comparator&&c==null&&e.sort!==false;var d=h.isString(this.comparator)?this.comparator:null;var p=[],v=[],g={};for(i=0,s=t.length;i<s;i++){if(!(a=this._prepareModel(t[i],e)))continue;if(u=this.get(a)){if(e.remove)g[u.cid]=true;if(e.merge){u.set(a.attributes,e);if(f&&!l&&u.hasChanged(d))l=true}}else if(e.add){p.push(a);a.on("all",this._onModelEvent,this);this._byId[a.cid]=a;if(a.id!=null)this._byId[a.id]=a}}if(e.remove){for(i=0,s=this.length;i<s;++i){if(!g[(a=this.models[i]).cid])v.push(a)}if(v.length)this.remove(v,e)}if(p.length){if(f)l=true;this.length+=p.length;if(c!=null){n.apply(this.models,[c,0].concat(p))}else{r.apply(this.models,p)}}if(l)this.sort({silent:true});if(e.silent)return this;for(i=0,s=p.length;i<s;i++){(a=p[i]).trigger("add",a,this,e)}if(l)this.trigger("sort",this,e);return this},reset:function(t,e){e||(e={});for(var i=0,r=this.models.length;i<r;i++){this._removeReference(this.models[i])}e.previousModels=this.models;this._reset();this.add(t,h.extend({silent:true},e));if(!e.silent)this.trigger("reset",this,e);return this},push:function(t,e){t=this._prepareModel(t,e);this.add(t,h.extend({at:this.length},e));return t},pop:function(t){var e=this.at(this.length-1);this.remove(e,t);return e},unshift:function(t,e){t=this._prepareModel(t,e);this.add(t,h.extend({at:0},e));return t},shift:function(t){var e=this.at(0);this.remove(e,t);return e},slice:function(t,e){return this.models.slice(t,e)},get:function(t){if(t==null)return void 0;return this._byId[t.id!=null?t.id:t.cid||t]},at:function(t){return this.models[t]},where:function(t,e){if(h.isEmpty(t))return e?void 0:[];return this[e?"find":"filter"](function(e){for(var i in t){if(t[i]!==e.get(i))return false}return true})},findWhere:function(t){return this.where(t,true)},sort:function(t){if(!this.comparator)throw new Error("Cannot sort a set without a comparator");t||(t={});if(h.isString(this.comparator)||this.comparator.length===1){this.models=this.sortBy(this.comparator,this)}else{this.models.sort(h.bind(this.comparator,this))}if(!t.silent)this.trigger("sort",this,t);return this},sortedIndex:function(t,e,i){e||(e=this.comparator);var r=h.isFunction(e)?e:function(t){return t.get(e)};return h.sortedIndex(this.models,t,r,i)},pluck:function(t){return h.invoke(this.models,"get",t)},fetch:function(t){t=t?h.clone(t):{};if(t.parse===void 0)t.parse=true;var e=t.success;var i=this;t.success=function(r){var s=t.reset?"reset":"set";i[s](r,t);if(e)e(i,r,t);i.trigger("sync",i,r,t)};R(this,t);return this.sync("read",this,t)},create:function(t,e){e=e?h.clone(e):{};if(!(t=this._prepareModel(t,e)))return false;if(!e.wait)this.add(t,e);var i=this;var r=e.success;e.success=function(s){if(e.wait)i.add(t,e);if(r)r(t,s,e)};t.save(null,e);return t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models)},_reset:function(){this.length=0;this.models=[];this._byId={}},_prepareModel:function(t,e){if(t instanceof d){if(!t.collection)t.collection=this;return t}e||(e={});e.collection=this;var i=new this.model(t,e);if(!i._validate(t,e)){this.trigger("invalid",this,t,e);return false}return i},_removeReference:function(t){if(this===t.collection)delete t.collection;t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,r){if((t==="add"||t==="remove")&&i!==this)return;if(t==="destroy")this.remove(e,r);if(e&&t==="change:"+e.idAttribute){delete this._byId[e.previous(e.idAttribute)];if(e.id!=null)this._byId[e.id]=e}this.trigger.apply(this,arguments)}});var _=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","indexOf","shuffle","lastIndexOf","isEmpty","chain"];h.each(_,function(t){g.prototype[t]=function(){var e=s.call(arguments);e.unshift(this.models);return h[t].apply(h,e)}});var w=["groupBy","countBy","sortBy"];h.each(w,function(t){g.prototype[t]=function(e,i){var r=h.isFunction(e)?e:function(t){return t.get(e)};return h[t](this.models,r,i)}});var b=a.View=function(t){this.cid=h.uniqueId("view");this._configure(t||{});this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()};var x=/^(\S+)\s*(.*)$/;var E=["model","collection","el","id","attributes","className","tagName","events"];h.extend(b.prototype,o,{tagName:"div",$:function(t){return this.$el.find(t)},initialize:function(){},render:function(){return this},remove:function(){this.$el.remove();this.stopListening();return this},setElement:function(t,e){if(this.$el)this.undelegateEvents();this.$el=t instanceof a.$?t:a.$(t);this.el=this.$el[0];if(e!==false)this.delegateEvents();return this},delegateEvents:function(t){if(!(t||(t=h.result(this,"events"))))return this;this.undelegateEvents();for(var e in t){var i=t[e];if(!h.isFunction(i))i=this[t[e]];if(!i)continue;var r=e.match(x);var s=r[1],n=r[2];i=h.bind(i,this);s+=".delegateEvents"+this.cid;if(n===""){this.$el.on(s,i)}else{this.$el.on(s,n,i)}}return this},undelegateEvents:function(){this.$el.off(".delegateEvents"+this.cid);return this},_configure:function(t){if(this.options)t=h.extend({},h.result(this,"options"),t);h.extend(this,h.pick(t,E));this.options=t},_ensureElement:function(){if(!this.el){var t=h.extend({},h.result(this,"attributes"));if(this.id)t.id=h.result(this,"id");if(this.className)t["class"]=h.result(this,"className");var e=a.$("<"+h.result(this,"tagName")+">").attr(t);this.setElement(e,false)}else{this.setElement(h.result(this,"el"),false)}}});a.sync=function(t,e,i){var r=k[t];h.defaults(i||(i={}),{emulateHTTP:a.emulateHTTP,emulateJSON:a.emulateJSON});var s={type:r,dataType:"json"};if(!i.url){s.url=h.result(e,"url")||U()}if(i.data==null&&e&&(t==="create"||t==="update"||t==="patch")){s.contentType="application/json";s.data=JSON.stringify(i.attrs||e.toJSON(i))}if(i.emulateJSON){s.contentType="application/x-www-form-urlencoded";s.data=s.data?{model:s.data}:{}}if(i.emulateHTTP&&(r==="PUT"||r==="DELETE"||r==="PATCH")){s.type="POST";if(i.emulateJSON)s.data._method=r;var n=i.beforeSend;i.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",r);if(n)return n.apply(this,arguments)}}if(s.type!=="GET"&&!i.emulateJSON){s.processData=false}if(s.type==="PATCH"&&window.ActiveXObject&&!(window.external&&window.external.msActiveXFilteringEnabled)){s.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var o=i.xhr=a.ajax(h.extend(s,i));e.trigger("request",e,o,i);return o};var k={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};a.ajax=function(){return a.$.ajax.apply(a.$,arguments)};var S=a.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var $=/\((.*?)\)/g;var T=/(\(\?)?:\w+/g;var H=/\*\w+/g;var A=/[\-{}\[\]+?.,\\\^$|#\s]/g;h.extend(S.prototype,o,{initialize:function(){},route:function(t,e,i){if(!h.isRegExp(t))t=this._routeToRegExp(t);if(h.isFunction(e)){i=e;e=""}if(!i)i=this[e];var r=this;a.history.route(t,function(s){var n=r._extractParameters(t,s);i&&i.apply(r,n);r.trigger.apply(r,["route:"+e].concat(n));r.trigger("route",e,n);a.history.trigger("route",r,e,n)});return this},navigate:function(t,e){a.history.navigate(t,e);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=h.result(this,"routes");var t,e=h.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(A,"\\$&").replace($,"(?:$1)?").replace(T,function(t,e){return e?t:"([^/]+)"}).replace(H,"(.*?)");return new RegExp("^"+t+"$")},_extractParameters:function(t,e){var i=t.exec(e).slice(1);return h.map(i,function(t){return t?decodeURIComponent(t):null})}});var I=a.History=function(){this.handlers=[];h.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var N=/^[#\/]|\s+$/g;var P=/^\/+|\/+$/g;var O=/msie [\w.]+/;var C=/\/$/;I.started=false;h.extend(I.prototype,o,{interval:50,getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=this.location.pathname;var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.substr(i.length)}else{t=this.getHash()}}return t.replace(N,"")},start:function(t){if(I.started)throw new Error("Backbone.history has already been started");I.started=true;this.options=h.extend({},{root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var e=this.getFragment();var i=document.documentMode;var r=O.exec(navigator.userAgent.toLowerCase())&&(!i||i<=7);this.root=("/"+this.root+"/").replace(P,"/");if(r&&this._wantsHashChange){this.iframe=a.$('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow;this.navigate(e)}if(this._hasPushState){a.$(window).on("popstate",this.checkUrl)}else if(this._wantsHashChange&&"onhashchange"in window&&!r){a.$(window).on("hashchange",this.checkUrl)}else if(this._wantsHashChange){this._checkUrlInterval=setInterval(this.checkUrl,this.interval)}this.fragment=e;var s=this.location;var n=s.pathname.replace(/[^\/]$/,"$&/")===this.root;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!n){this.fragment=this.getFragment(null,true);this.location.replace(this.root+this.location.search+"#"+this.fragment);return true}else if(this._wantsPushState&&this._hasPushState&&n&&s.hash){this.fragment=this.getHash().replace(N,"");this.history.replaceState({},document.title,this.root+this.fragment+s.search)}if(!this.options.silent)return this.loadUrl()},stop:function(){a.$(window).off("popstate",this.checkUrl).off("hashchange",this.checkUrl);clearInterval(this._checkUrlInterval);I.started=false},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe){e=this.getFragment(this.getHash(this.iframe))}if(e===this.fragment)return false;if(this.iframe)this.navigate(e);this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(t){var e=this.fragment=this.getFragment(t);var i=h.any(this.handlers,function(t){if(t.route.test(e)){t.callback(e);return true}});return i},navigate:function(t,e){if(!I.started)return false;if(!e||e===true)e={trigger:e};t=this.getFragment(t||"");if(this.fragment===t)return;this.fragment=t;var i=this.root+t;if(this._hasPushState){this.history[e.replace?"replaceState":"pushState"]({},document.title,i)}else if(this._wantsHashChange){this._updateHash(this.location,t,e.replace);if(this.iframe&&t!==this.getFragment(this.getHash(this.iframe))){if(!e.replace)this.iframe.document.open().close();this._updateHash(this.iframe.location,t,e.replace)}}else{return this.location.assign(i)}if(e.trigger)this.loadUrl(t)},_updateHash:function(t,e,i){if(i){var r=t.href.replace(/(javascript:|#).*$/,"");t.replace(r+"#"+e)}else{t.hash="#"+e}}});a.history=new I;var j=function(t,e){var i=this;var r;if(t&&h.has(t,"constructor")){r=t.constructor}else{r=function(){return i.apply(this,arguments)}}h.extend(r,i,e);var s=function(){this.constructor=r};s.prototype=i.prototype;r.prototype=new s;if(t)h.extend(r.prototype,t);r.__super__=i.prototype;return r};d.extend=g.extend=S.extend=b.extend=I.extend=j;var U=function(){throw new Error('A "url" property or function must be specified')};var R=function(t,e){var i=e.error;e.error=function(r){if(i)i(t,r,e);t.trigger("error",t,r,e)}}}).call(this);
index 973f17849cd81459d82ae4b2603a0a312b4928e1..b2799c49a577079fee661a454060800d042f56cb 100644 (file)
@@ -5,7 +5,7 @@
        cursor: crosshair;
 }
 
-/* an extra classname is applied for Opera < 9.0 to fix it's lack of opacity support */
+/* an extra classname is applied for Opera < 9.0 to fix its lack of opacity support */
 .imgCrop_wrap.opera8 .imgCrop_overlay,
 .imgCrop_wrap.opera8 .imgCrop_clickArea { 
        background-color: transparent;
diff --git a/wp-includes/js/heartbeat.js b/wp-includes/js/heartbeat.js
new file mode 100644 (file)
index 0000000..8023600
--- /dev/null
@@ -0,0 +1,461 @@
+/**
+ * Heartbeat API
+ *
+ * Note: this API is "experimental" meaning it will likely change a lot
+ * in the next few releases based on feedback from 3.6.0. If you intend
+ * to use it, please follow the development closely.
+ *
+ * Heartbeat is a simple server polling API that sends XHR requests to
+ * the server every 15 seconds and triggers events (or callbacks) upon
+ * receiving data. Currently these 'ticks' handle transports for post locking,
+ * login-expiration warnings, and related tasks while a user is logged in.
+ *
+ * Available filters in ajax-actions.php:
+ * - heartbeat_received
+ * - heartbeat_send
+ * - heartbeat_tick
+ * - heartbeat_nopriv_received
+ * - heartbeat_nopriv_send
+ * - heartbeat_nopriv_tick
+ * @see wp_ajax_nopriv_heartbeat(), wp_ajax_heartbeat()
+ *
+ * @since 3.6.0
+ */
+
+ // Ensure the global `wp` object exists.
+window.wp = window.wp || {};
+
+(function($){
+       var Heartbeat = function() {
+               var self = this,
+                       running,
+                       beat,
+                       screenId = typeof pagenow != 'undefined' ? pagenow : '',
+                       url = typeof ajaxurl != 'undefined' ? ajaxurl : '',
+                       settings,
+                       tick = 0,
+                       queue = {},
+                       interval,
+                       connecting,
+                       countdown = 0,
+                       errorcount = 0,
+                       tempInterval,
+                       hasFocus = true,
+                       isUserActive,
+                       userActiveEvents,
+                       winBlurTimeout,
+                       frameBlurTimeout = -1,
+                       hasConnectionError = false;
+
+               /**
+                * Returns a boolean that's indicative of whether or not there is a connection error
+                *
+                * @returns boolean
+                */
+               this.hasConnectionError = function() {
+                       return hasConnectionError;
+               };
+
+               if ( typeof( window.heartbeatSettings ) == 'object' ) {
+                       settings = $.extend( {}, window.heartbeatSettings );
+
+                       // Add private vars
+                       url = settings.ajaxurl || url;
+                       delete settings.ajaxurl;
+                       delete settings.nonce;
+
+                       interval = settings.interval || 15; // default interval
+                       delete settings.interval;
+                       // The interval can be from 15 to 60 sec. and can be set temporarily to 5 sec.
+                       if ( interval < 15 )
+                               interval = 15;
+                       else if ( interval > 60 )
+                               interval = 60;
+
+                       interval = interval * 1000;
+
+                       // 'screenId' can be added from settings on the front-end where the JS global 'pagenow' is not set
+                       screenId = screenId || settings.screenId || 'front';
+                       delete settings.screenId;
+
+                       // Add or overwrite public vars
+                       $.extend( this, settings );
+               }
+
+               function time(s) {
+                       if ( s )
+                               return parseInt( (new Date()).getTime() / 1000 );
+
+                       return (new Date()).getTime();
+               }
+
+               function isLocalFrame( frame ) {
+                       var origin, src = frame.src;
+
+                       if ( src && /^https?:\/\//.test( src ) ) {
+                               origin = window.location.origin ? window.location.origin : window.location.protocol + '//' + window.location.host;
+
+                               if ( src.indexOf( origin ) !== 0 )
+                                       return false;
+                       }
+
+                       try {
+                               if ( frame.contentWindow.document )
+                                       return true;
+                       } catch(e) {}
+
+                       return false;
+               }
+
+               // Set error state and fire an event on XHR errors or timeout
+               function errorstate( error ) {
+                       var trigger;
+
+                       if ( error ) {
+                               switch ( error ) {
+                                       case 'abort':
+                                               // do nothing
+                                               break;
+                                       case 'timeout':
+                                               // no response for 30 sec.
+                                               trigger = true;
+                                               break;
+                                       case 'parsererror':
+                                       case 'error':
+                                       case 'empty':
+                                       case 'unknown':
+                                               errorcount++;
+
+                                               if ( errorcount > 2 )
+                                                       trigger = true;
+
+                                               break;
+                               }
+
+                               if ( trigger && ! self.hasConnectionError() ) {
+                                       hasConnectionError = true;
+                                       $(document).trigger( 'heartbeat-connection-lost', [error] );
+                               }
+                       } else if ( self.hasConnectionError() ) {
+                               errorcount = 0;
+                               hasConnectionError = false;
+                               $(document).trigger( 'heartbeat-connection-restored' );
+                       }
+               }
+
+               function connect() {
+                       var send = {}, data, i, empty = true,
+                       nonce = typeof window.heartbeatSettings == 'object' ? window.heartbeatSettings.nonce : '';
+                       tick = time();
+
+                       data = $.extend( {}, queue );
+                       // Clear the data queue, anything added after this point will be send on the next tick
+                       queue = {};
+
+                       $(document).trigger( 'heartbeat-send', [data] );
+
+                       for ( i in data ) {
+                               if ( data.hasOwnProperty( i ) ) {
+                                       empty = false;
+                                       break;
+                               }
+                       }
+
+                       // If nothing to send (nothing is expecting a response),
+                       // schedule the next tick and bail
+                       if ( empty && ! self.hasConnectionError() ) {
+                               connecting = false;
+                               next();
+                               return;
+                       }
+
+                       send.data = data;
+                       send.interval = interval / 1000;
+                       send._nonce = nonce;
+                       send.action = 'heartbeat';
+                       send.screen_id = screenId;
+                       send.has_focus = hasFocus;
+
+                       connecting = true;
+                       self.xhr = $.ajax({
+                               url: url,
+                               type: 'post',
+                               timeout: 30000, // throw an error if not completed after 30 sec.
+                               data: send,
+                               dataType: 'json'
+                       }).done( function( response, textStatus, jqXHR ) {
+                               var new_interval;
+
+                               if ( ! response )
+                                       return errorstate( 'empty' );
+
+                               // Clear error state
+                               if ( self.hasConnectionError() )
+                                       errorstate();
+
+                               if ( response.nonces_expired ) {
+                                       $(document).trigger( 'heartbeat-nonces-expired' );
+                                       return;
+                               }
+
+                               // Change the interval from PHP
+                               if ( response.heartbeat_interval ) {
+                                       new_interval = response.heartbeat_interval;
+                                       delete response.heartbeat_interval;
+                               }
+
+                               self.tick( response, textStatus, jqXHR );
+
+                               // do this last, can trigger the next XHR if connection time > 5 sec. and new_interval == 'fast'
+                               if ( new_interval )
+                                       self.interval.call( self, new_interval );
+                       }).always( function() {
+                               connecting = false;
+                               next();
+                       }).fail( function( jqXHR, textStatus, error ) {
+                               errorstate( textStatus || 'unknown' );
+                               self.error( jqXHR, textStatus, error );
+                       });
+               }
+
+               function next() {
+                       var delta = time() - tick, t = interval;
+
+                       if ( ! running )
+                               return;
+
+                       if ( ! hasFocus ) {
+                               t = 100000; // 100 sec. Post locks expire after 120 sec.
+                       } else if ( countdown > 0 && tempInterval ) {
+                               t = tempInterval;
+                               countdown--;
+                       }
+
+                       window.clearTimeout(beat);
+
+                       if ( delta < t ) {
+                               beat = window.setTimeout(
+                                       function(){
+                                               if ( running )
+                                                       connect();
+                                       },
+                                       t - delta
+                               );
+                       } else {
+                               connect();
+                       }
+               }
+
+               function blurred() {
+                       window.clearTimeout(winBlurTimeout);
+                       window.clearTimeout(frameBlurTimeout);
+                       winBlurTimeout = frameBlurTimeout = 0;
+
+                       hasFocus = false;
+               }
+
+               function focused() {
+                       window.clearTimeout(winBlurTimeout);
+                       window.clearTimeout(frameBlurTimeout);
+                       winBlurTimeout = frameBlurTimeout = 0;
+
+                       isUserActive = time();
+
+                       if ( hasFocus )
+                               return;
+
+                       hasFocus = true;
+                       window.clearTimeout(beat);
+
+                       if ( ! connecting )
+                               next();
+               }
+
+               function setFrameEvents() {
+                       $('iframe').each( function( i, frame ){
+                               if ( ! isLocalFrame( frame ) )
+                                       return;
+
+                               if ( $.data( frame, 'wp-heartbeat-focus' ) )
+                                       return;
+
+                               $.data( frame, 'wp-heartbeat-focus', 1 );
+
+                               $( frame.contentWindow ).on( 'focus.wp-heartbeat-focus', function(e) {
+                                       focused();
+                               }).on('blur.wp-heartbeat-focus', function(e) {
+                                       setFrameEvents();
+                                       frameBlurTimeout = window.setTimeout( function(){ blurred(); }, 500 );
+                               });
+                       });
+               }
+
+               $(window).on( 'blur.wp-heartbeat-focus', function(e) {
+                       setFrameEvents();
+                       winBlurTimeout = window.setTimeout( function(){ blurred(); }, 500 );
+               }).on( 'focus.wp-heartbeat-focus', function() {
+                       $('iframe').each( function( i, frame ) {
+                               if ( !isLocalFrame( frame ) )
+                                       return;
+
+                               $.removeData( frame, 'wp-heartbeat-focus' );
+                               $( frame.contentWindow ).off( '.wp-heartbeat-focus' );
+                       });
+
+                       focused();
+               });
+
+               function userIsActive() {
+                       userActiveEvents = false;
+                       $(document).off( '.wp-heartbeat-active' );
+                       $('iframe').each( function( i, frame ) {
+                               if ( ! isLocalFrame( frame ) )
+                                       return;
+
+                               $( frame.contentWindow ).off( '.wp-heartbeat-active' );
+                       });
+
+                       focused();
+               }
+
+               // Set 'hasFocus = true' if user is active and the window is in the background.
+               // Set 'hasFocus = false' if the user has been inactive (no mouse or keyboard activity) for 5 min. even when the window has focus.
+               function checkUserActive() {
+                       var lastActive = isUserActive ? time() - isUserActive : 0;
+
+                       // Throttle down when no mouse or keyboard activity for 5 min
+                       if ( lastActive > 300000 && hasFocus )
+                                blurred();
+
+                       if ( ! userActiveEvents ) {
+                               $(document).on( 'mouseover.wp-heartbeat-active keyup.wp-heartbeat-active', function(){ userIsActive(); } );
+
+                               $('iframe').each( function( i, frame ) {
+                                       if ( ! isLocalFrame( frame ) )
+                                               return;
+
+                                       $( frame.contentWindow ).on( 'mouseover.wp-heartbeat-active keyup.wp-heartbeat-active', function(){ userIsActive(); } );
+                               });
+
+                               userActiveEvents = true;
+                       }
+               }
+
+               // Check for user activity every 30 seconds.
+               window.setInterval( function(){ checkUserActive(); }, 30000 );
+               $(document).ready( function() {
+                       // Start one tick (15 sec) after DOM ready
+                       running = true;
+                       tick = time();
+                       next();
+               });
+
+               this.hasFocus = function() {
+                       return hasFocus;
+               };
+
+               /**
+                * Get/Set the interval
+                *
+                * When setting to 'fast', the interval is 5 sec. for the next 30 ticks (for 2 min and 30 sec).
+                * If the window doesn't have focus, the interval slows down to 2 min.
+                *
+                * @param string speed Interval speed: 'fast' (5sec), 'standard' (15sec) default, 'slow' (60sec)
+                * @param string ticks Used with speed = 'fast', how many ticks before the speed reverts back
+                * @return int Current interval in seconds
+                */
+               this.interval = function( speed, ticks ) {
+                       var reset, seconds;
+                       ticks = parseInt( ticks, 10 ) || 30;
+                       ticks = ticks < 1 || ticks > 30 ? 30 : ticks;
+
+                       if ( speed ) {
+                               switch ( speed ) {
+                                       case 'fast':
+                                               seconds = 5;
+                                               countdown = ticks;
+                                               break;
+                                       case 'slow':
+                                               seconds = 60;
+                                               countdown = 0;
+                                               break;
+                                       case 'long-polling':
+                                               // Allow long polling, (experimental)
+                                               interval = 0;
+                                               return 0;
+                                               break;
+                                       default:
+                                               seconds = 15;
+                                               countdown = 0;
+                               }
+
+                               // Reset when the new interval value is lower than the current one
+                               reset = seconds * 1000 < interval;
+
+                               if ( countdown > 0 ) {
+                                       tempInterval = seconds * 1000;
+                               } else {
+                                       interval = seconds * 1000;
+                                       tempInterval = 0;
+                               }
+
+                               if ( reset )
+                                       next();
+                       }
+
+                       if ( ! hasFocus )
+                               return 120;
+
+                       return tempInterval ? tempInterval / 1000 : interval / 1000;
+               };
+
+               /**
+                * Enqueue data to send with the next XHR
+                *
+                * As the data is sent later, this function doesn't return the XHR response.
+                * To see the response, use the custom jQuery event 'heartbeat-tick' on the document, example:
+                *              $(document).on( 'heartbeat-tick.myname', function( event, data, textStatus, jqXHR ) {
+                *                      // code
+                *              });
+                * If the same 'handle' is used more than once, the data is not overwritten when the third argument is 'true'.
+                * Use wp.heartbeat.isQueued('handle') to see if any data is already queued for that handle.
+                *
+                * $param string handle Unique handle for the data. The handle is used in PHP to receive the data.
+                * $param mixed data The data to send.
+                * $param bool dont_overwrite Whether to overwrite existing data in the queue.
+                * $return bool Whether the data was queued or not.
+                */
+               this.enqueue = function( handle, data, dont_overwrite ) {
+                       if ( handle ) {
+                               if ( queue.hasOwnProperty( handle ) && dont_overwrite )
+                                       return false;
+
+                               queue[handle] = data;
+                               return true;
+                       }
+                       return false;
+               };
+
+               /**
+                * Check if data with a particular handle is queued
+                *
+                * $param string handle The handle for the data
+                * $return mixed The data queued with that handle or null
+                */
+               this.isQueued = function( handle ) {
+                       return queue[handle];
+               };
+       };
+
+       $.extend( Heartbeat.prototype, {
+               tick: function( data, textStatus, jqXHR ) {
+                       $(document).trigger( 'heartbeat-tick', [data, textStatus, jqXHR] );
+               },
+               error: function( jqXHR, textStatus, error ) {
+                       $(document).trigger( 'heartbeat-error', [jqXHR, textStatus, error] );
+               }
+       });
+
+       wp.heartbeat = new Heartbeat();
+
+}(jQuery));
diff --git a/wp-includes/js/heartbeat.min.js b/wp-includes/js/heartbeat.min.js
new file mode 100644 (file)
index 0000000..2158028
--- /dev/null
@@ -0,0 +1 @@
+window.wp=window.wp||{};(function(a){var b=function(){var t=this,e,c,q=typeof pagenow!="undefined"?pagenow:"",h=typeof ajaxurl!="undefined"?ajaxurl:"",C,B=0,x={},D,i,r=0,A=0,y,f=true,p,j,g,w=-1,l=false;this.hasConnectionError=function(){return l};if(typeof(window.heartbeatSettings)=="object"){C=a.extend({},window.heartbeatSettings);h=C.ajaxurl||h;delete C.ajaxurl;delete C.nonce;D=C.interval||15;delete C.interval;if(D<15){D=15}else{if(D>60){D=60}}D=D*1000;q=q||C.screenId||"front";delete C.screenId;a.extend(this,C)}function k(F){if(F){return parseInt((new Date()).getTime()/1000)}return(new Date()).getTime()}function z(I){var F,H=I.src;if(H&&/^https?:\/\//.test(H)){F=window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.host;if(H.indexOf(F)!==0){return false}}try{if(I.contentWindow.document){return true}}catch(G){}return false}function v(G){var F;if(G){switch(G){case"abort":break;case"timeout":F=true;break;case"parsererror":case"error":case"empty":case"unknown":A++;if(A>2){F=true}break}if(F&&!t.hasConnectionError()){l=true;a(document).trigger("heartbeat-connection-lost",[G])}}else{if(t.hasConnectionError()){A=0;l=false;a(document).trigger("heartbeat-connection-restored")}}}function d(){var J={},I,F,H=true,G=typeof window.heartbeatSettings=="object"?window.heartbeatSettings.nonce:"";B=k();I=a.extend({},x);x={};a(document).trigger("heartbeat-send",[I]);for(F in I){if(I.hasOwnProperty(F)){H=false;break}}if(H&&!t.hasConnectionError()){i=false;u();return}J.data=I;J.interval=D/1000;J._nonce=G;J.action="heartbeat";J.screen_id=q;J.has_focus=f;i=true;t.xhr=a.ajax({url:h,type:"post",timeout:30000,data:J,dataType:"json"}).done(function(K,N,L){var M;if(!K){return v("empty")}if(t.hasConnectionError()){v()}if(K.nonces_expired){a(document).trigger("heartbeat-nonces-expired");return}if(K.heartbeat_interval){M=K.heartbeat_interval;delete K.heartbeat_interval}t.tick(K,N,L);if(M){t.interval.call(t,M)}}).always(function(){i=false;u()}).fail(function(L,M,K){v(M||"unknown");t.error(L,M,K)})}function u(){var G=k()-B,F=D;if(!e){return}if(!f){F=100000}else{if(r>0&&y){F=y;r--}}window.clearTimeout(c);if(G<F){c=window.setTimeout(function(){if(e){d()}},F-G)}else{d()}}function o(){window.clearTimeout(g);window.clearTimeout(w);g=w=0;f=false}function n(){window.clearTimeout(g);window.clearTimeout(w);g=w=0;p=k();if(f){return}f=true;window.clearTimeout(c);if(!i){u()}}function s(){a("iframe").each(function(F,G){if(!z(G)){return}if(a.data(G,"wp-heartbeat-focus")){return}a.data(G,"wp-heartbeat-focus",1);a(G.contentWindow).on("focus.wp-heartbeat-focus",function(H){n()}).on("blur.wp-heartbeat-focus",function(H){s();w=window.setTimeout(function(){o()},500)})})}a(window).on("blur.wp-heartbeat-focus",function(F){s();g=window.setTimeout(function(){o()},500)}).on("focus.wp-heartbeat-focus",function(){a("iframe").each(function(F,G){if(!z(G)){return}a.removeData(G,"wp-heartbeat-focus");a(G.contentWindow).off(".wp-heartbeat-focus")});n()});function E(){j=false;a(document).off(".wp-heartbeat-active");a("iframe").each(function(F,G){if(!z(G)){return}a(G.contentWindow).off(".wp-heartbeat-active")});n()}function m(){var F=p?k()-p:0;if(F>300000&&f){o()}if(!j){a(document).on("mouseover.wp-heartbeat-active keyup.wp-heartbeat-active",function(){E()});a("iframe").each(function(G,H){if(!z(H)){return}a(H.contentWindow).on("mouseover.wp-heartbeat-active keyup.wp-heartbeat-active",function(){E()})});j=true}}window.setInterval(function(){m()},30000);a(document).ready(function(){e=true;B=k();u()});this.hasFocus=function(){return f};this.interval=function(H,G){var F,I;G=parseInt(G,10)||30;G=G<1||G>30?30:G;if(H){switch(H){case"fast":I=5;r=G;break;case"slow":I=60;r=0;break;case"long-polling":D=0;return 0;break;default:I=15;r=0}F=I*1000<D;if(r>0){y=I*1000}else{D=I*1000;y=0}if(F){u()}}if(!f){return 120}return y?y/1000:D/1000};this.enqueue=function(H,G,F){if(H){if(x.hasOwnProperty(H)&&F){return false}x[H]=G;return true}return false};this.isQueued=function(F){return x[F]}};a.extend(b.prototype,{tick:function(d,e,c){a(document).trigger("heartbeat-tick",[d,e,c])},error:function(d,e,c){a(document).trigger("heartbeat-error",[d,e,c])}});wp.heartbeat=new b()}(jQuery));
\ No newline at end of file
index 3dcff261f60ef642177abd6fa806a1a5a1ec9ed1..88e0e8a241d6baf7a3e5fd4c44e666810c221662 100644 (file)
-/**
-* hoverIntent is similar to jQuery's built-in "hover" function except that
-* instead of firing the onMouseOver event immediately, hoverIntent checks
-* to see if the user's mouse has slowed down (beneath the sensitivity
-* threshold) before firing the onMouseOver event.
-* 
-* hoverIntent r6 // 2011.02.26 // jQuery 1.5.1+
-* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
-* 
-* hoverIntent is currently available for use in all personal or commercial 
-* projects under both MIT and GPL licenses. This means that you can choose 
-* the license that best suits your project, and use it accordingly.
-* 
-* // basic usage (just like .hover) receives onMouseOver and onMouseOut functions
-* $("ul li").hoverIntent( showNav , hideNav );
-* 
-* // advanced usage receives configuration object only
-* $("ul li").hoverIntent({
-*      sensitivity: 7, // number = sensitivity threshold (must be 1 or higher)
-*      interval: 100,   // number = milliseconds of polling interval
-*      over: showNav,  // function = onMouseOver callback (required)
-*      timeout: 0,   // number = milliseconds delay before onMouseOut function call
-*      out: hideNav    // function = onMouseOut callback (required)
-* });
-* 
-* @param  f  onMouseOver function || An object with configuration options
-* @param  g  onMouseOut function  || Nothing (use configuration options object)
-* @author    Brian Cherne brian(at)cherne(dot)net
-*/
+/*!
+ * hoverIntent r7 // 2013.03.11 // jQuery 1.9.1+
+ * http://cherne.net/brian/resources/jquery.hoverIntent.html
+ *
+ * You may use hoverIntent under the terms of the MIT license. Basically that
+ * means you are free to use hoverIntent as long as this header is left intact.
+ * Copyright 2007, 2013 Brian Cherne
+ */
+
+/* hoverIntent is similar to jQuery's built-in "hover" method except that
+ * instead of firing the handlerIn function immediately, hoverIntent checks
+ * to see if the user's mouse has slowed down (beneath the sensitivity
+ * threshold) before firing the event. The handlerOut function is only
+ * called after a matching handlerIn.
+ *
+ * // basic usage ... just like .hover()
+ * .hoverIntent( handlerIn, handlerOut )
+ * .hoverIntent( handlerInOut )
+ *
+ * // basic usage ... with event delegation!
+ * .hoverIntent( handlerIn, handlerOut, selector )
+ * .hoverIntent( handlerInOut, selector )
+ *
+ * // using a basic configuration object
+ * .hoverIntent( config )
+ *
+ * @param  handlerIn   function OR configuration object
+ * @param  handlerOut  function OR selector for delegation OR undefined
+ * @param  selector    selector OR undefined
+ * @author Brian Cherne <brian(at)cherne(dot)net>
+ */
 (function($) {
-       $.fn.hoverIntent = function(f,g) {
-               // default configuration options
-               var cfg = {
-                       sensitivity: 7,
-                       interval: 100,
-                       timeout: 0
-               };
-               // override configuration options with user supplied object
-               cfg = $.extend(cfg, g ? { over: f, out: g } : f );
+    $.fn.hoverIntent = function(handlerIn,handlerOut,selector) {
+
+        // default configuration values
+        var cfg = {
+            interval: 100,
+            sensitivity: 7,
+            timeout: 0
+        };
+
+        if ( typeof handlerIn === "object" ) {
+            cfg = $.extend(cfg, handlerIn );
+        } else if ($.isFunction(handlerOut)) {
+            cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } );
+        } else {
+            cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } );
+        }
 
-               // instantiate variables
-               // cX, cY = current X and Y position of mouse, updated by mousemove event
-               // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
-               var cX, cY, pX, pY;
+        // instantiate variables
+        // cX, cY = current X and Y position of mouse, updated by mousemove event
+        // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
+        var cX, cY, pX, pY;
 
-               // A private function for getting mouse position
-               var track = function(ev) {
-                       cX = ev.pageX;
-                       cY = ev.pageY;
-               };
+        // A private function for getting mouse position
+        var track = function(ev) {
+            cX = ev.pageX;
+            cY = ev.pageY;
+        };
 
-               // A private function for comparing current and previous mouse position
-               var compare = function(ev,ob) {
-                       ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
-                       // compare mouse positions to see if they've crossed the threshold
-                       if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {
-                               $(ob).unbind("mousemove",track);
-                               // set hoverIntent state to true (so mouseOut can be called)
-                               ob.hoverIntent_s = 1;
-                               return cfg.over.apply(ob,[ev]);
-                       } else {
-                               // set previous coordinates for next time
-                               pX = cX; pY = cY;
-                               // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
-                               ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
-                       }
-               };
+        // A private function for comparing current and previous mouse position
+        var compare = function(ev,ob) {
+            ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
+            // compare mouse positions to see if they've crossed the threshold
+            if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {
+                $(ob).off("mousemove.hoverIntent",track);
+                // set hoverIntent state to true (so mouseOut can be called)
+                ob.hoverIntent_s = 1;
+                return cfg.over.apply(ob,[ev]);
+            } else {
+                // set previous coordinates for next time
+                pX = cX; pY = cY;
+                // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
+                ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
+            }
+        };
 
-               // A private function for delaying the mouseOut function
-               var delay = function(ev,ob) {
-                       ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
-                       ob.hoverIntent_s = 0;
-                       return cfg.out.apply(ob,[ev]);
-               };
+        // A private function for delaying the mouseOut function
+        var delay = function(ev,ob) {
+            ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
+            ob.hoverIntent_s = 0;
+            return cfg.out.apply(ob,[ev]);
+        };
 
-               // A private function for handling mouse 'hovering'
-               var handleHover = function(e) {
-                       // copy objects to be passed into t (required for event object to be passed in IE)
-                       var ev = jQuery.extend({},e);
-                       var ob = this;
+        // A private function for handling mouse 'hovering'
+        var handleHover = function(e) {
+            // copy objects to be passed into t (required for event object to be passed in IE)
+            var ev = jQuery.extend({},e);
+            var ob = this;
 
-                       // cancel hoverIntent timer if it exists
-                       if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }
+            // cancel hoverIntent timer if it exists
+            if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }
 
-                       // if e.type == "mouseenter"
-                       if (e.type == "mouseenter") {
-                               // set "previous" X and Y position based on initial entry point
-                               pX = ev.pageX; pY = ev.pageY;
-                               // update "current" X and Y position based on mousemove
-                               $(ob).bind("mousemove",track);
-                               // start polling interval (self-calling timeout) to compare mouse coordinates over time
-                               if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}
+            // if e.type == "mouseenter"
+            if (e.type == "mouseenter") {
+                // set "previous" X and Y position based on initial entry point
+                pX = ev.pageX; pY = ev.pageY;
+                // update "current" X and Y position based on mousemove
+                $(ob).on("mousemove.hoverIntent",track);
+                // start polling interval (self-calling timeout) to compare mouse coordinates over time
+                if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}
 
-                       // else e.type == "mouseleave"
-                       } else {
-                               // unbind expensive mousemove event
-                               $(ob).unbind("mousemove",track);
-                               // if hoverIntent state is true, then call the mouseOut function after the specified delay
-                               if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
-                       }
-               };
+                // else e.type == "mouseleave"
+            } else {
+                // unbind expensive mousemove event
+                $(ob).off("mousemove.hoverIntent",track);
+                // if hoverIntent state is true, then call the mouseOut function after the specified delay
+                if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
+            }
+        };
 
-               // bind the function to the two event listeners
-               return this.bind('mouseenter',handleHover).bind('mouseleave',handleHover);
-       };
-})(jQuery);
\ No newline at end of file
+        // listen for mouseenter and mouseleave
+        return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector);
+    };
+})(jQuery);
index 1576592de003088fff484b95c30c906c062fa1a5..9a7644cbaaa4321799ca28fa35eca6450038acf0 100644 (file)
@@ -1 +1,9 @@
-(function(a){a.fn.hoverIntent=function(k,j){var l={sensitivity:7,interval:100,timeout:0};l=a.extend(l,j?{over:k,out:j}:k);var n,m,h,d;var e=function(f){n=f.pageX;m=f.pageY};var c=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);if((Math.abs(h-n)+Math.abs(d-m))<l.sensitivity){a(f).unbind("mousemove",e);f.hoverIntent_s=1;return l.over.apply(f,[g])}else{h=n;d=m;f.hoverIntent_t=setTimeout(function(){c(g,f)},l.interval)}};var i=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);f.hoverIntent_s=0;return l.out.apply(f,[g])};var b=function(o){var g=jQuery.extend({},o);var f=this;if(f.hoverIntent_t){f.hoverIntent_t=clearTimeout(f.hoverIntent_t)}if(o.type=="mouseenter"){h=g.pageX;d=g.pageY;a(f).bind("mousemove",e);if(f.hoverIntent_s!=1){f.hoverIntent_t=setTimeout(function(){c(g,f)},l.interval)}}else{a(f).unbind("mousemove",e);if(f.hoverIntent_s==1){f.hoverIntent_t=setTimeout(function(){i(g,f)},l.timeout)}}};return this.bind("mouseenter",b).bind("mouseleave",b)}})(jQuery);
\ No newline at end of file
+/*!
+ * hoverIntent r7 // 2013.03.11 // jQuery 1.9.1+
+ * http://cherne.net/brian/resources/jquery.hoverIntent.html
+ *
+ * You may use hoverIntent under the terms of the MIT license. Basically that
+ * means you are free to use hoverIntent as long as this header is left intact.
+ * Copyright 2007, 2013 Brian Cherne
+ */
+(function(a){a.fn.hoverIntent=function(m,d,h){var j={interval:100,sensitivity:7,timeout:0};if(typeof m==="object"){j=a.extend(j,m)}else{if(a.isFunction(d)){j=a.extend(j,{over:m,out:d,selector:h})}else{j=a.extend(j,{over:m,out:m,selector:d})}}var l,k,g,f;var e=function(n){l=n.pageX;k=n.pageY};var c=function(o,n){n.hoverIntent_t=clearTimeout(n.hoverIntent_t);if((Math.abs(g-l)+Math.abs(f-k))<j.sensitivity){a(n).off("mousemove.hoverIntent",e);n.hoverIntent_s=1;return j.over.apply(n,[o])}else{g=l;f=k;n.hoverIntent_t=setTimeout(function(){c(o,n)},j.interval)}};var i=function(o,n){n.hoverIntent_t=clearTimeout(n.hoverIntent_t);n.hoverIntent_s=0;return j.out.apply(n,[o])};var b=function(p){var o=jQuery.extend({},p);var n=this;if(n.hoverIntent_t){n.hoverIntent_t=clearTimeout(n.hoverIntent_t)}if(p.type=="mouseenter"){g=o.pageX;f=o.pageY;a(n).on("mousemove.hoverIntent",e);if(n.hoverIntent_s!=1){n.hoverIntent_t=setTimeout(function(){c(o,n)},j.interval)}}else{a(n).off("mousemove.hoverIntent",e);if(n.hoverIntent_s==1){n.hoverIntent_t=setTimeout(function(){i(o,n)},j.timeout)}}};return this.on({"mouseenter.hoverIntent":b,"mouseleave.hoverIntent":b},j.selector)}})(jQuery);
\ No newline at end of file
diff --git a/wp-includes/js/jquery/jquery-migrate.js b/wp-includes/js/jquery/jquery-migrate.js
new file mode 100644 (file)
index 0000000..dbe8cbd
--- /dev/null
@@ -0,0 +1,521 @@
+/*!\r
+ * jQuery Migrate - v1.2.1 - 2013-05-08\r
+ * https://github.com/jquery/jquery-migrate\r
+ * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT\r
+ */\r
+(function( jQuery, window, undefined ) {\r
+// See http://bugs.jquery.com/ticket/13335\r
+// "use strict";\r
+\r
+\r
+var warnedAbout = {};\r
+\r
+// List of warnings already given; public read only\r
+jQuery.migrateWarnings = [];\r
+\r
+// Set to true to prevent console output; migrateWarnings still maintained\r
+// jQuery.migrateMute = false;\r
+\r
+// Show a message on the console so devs know we're active\r
+if ( !jQuery.migrateMute && window.console && window.console.log ) {\r
+       window.console.log("JQMIGRATE: Logging is active");\r
+}\r
+\r
+// Set to false to disable traces that appear with warnings\r
+if ( jQuery.migrateTrace === undefined ) {\r
+       jQuery.migrateTrace = true;\r
+}\r
+\r
+// Forget any warnings we've already given; public\r
+jQuery.migrateReset = function() {\r
+       warnedAbout = {};\r
+       jQuery.migrateWarnings.length = 0;\r
+};\r
+\r
+function migrateWarn( msg) {\r
+       var console = window.console;\r
+       if ( !warnedAbout[ msg ] ) {\r
+               warnedAbout[ msg ] = true;\r
+               jQuery.migrateWarnings.push( msg );\r
+               if ( console && console.warn && !jQuery.migrateMute ) {\r
+                       console.warn( "JQMIGRATE: " + msg );\r
+                       if ( jQuery.migrateTrace && console.trace ) {\r
+                               console.trace();\r
+                       }\r
+               }\r
+       }\r
+}\r
+\r
+function migrateWarnProp( obj, prop, value, msg ) {\r
+       if ( Object.defineProperty ) {\r
+               // On ES5 browsers (non-oldIE), warn if the code tries to get prop;\r
+               // allow property to be overwritten in case some other plugin wants it\r
+               try {\r
+                       Object.defineProperty( obj, prop, {\r
+                               configurable: true,\r
+                               enumerable: true,\r
+                               get: function() {\r
+                                       migrateWarn( msg );\r
+                                       return value;\r
+                               },\r
+                               set: function( newValue ) {\r
+                                       migrateWarn( msg );\r
+                                       value = newValue;\r
+                               }\r
+                       });\r
+                       return;\r
+               } catch( err ) {\r
+                       // IE8 is a dope about Object.defineProperty, can't warn there\r
+               }\r
+       }\r
+\r
+       // Non-ES5 (or broken) browser; just set the property\r
+       jQuery._definePropertyBroken = true;\r
+       obj[ prop ] = value;\r
+}\r
+\r
+if ( document.compatMode === "BackCompat" ) {\r
+       // jQuery has never supported or tested Quirks Mode\r
+       migrateWarn( "jQuery is not compatible with Quirks Mode" );\r
+}\r
+\r
+\r
+var attrFn = jQuery( "<input/>", { size: 1 } ).attr("size") && jQuery.attrFn,\r
+       oldAttr = jQuery.attr,\r
+       valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get ||\r
+               function() { return null; },\r
+       valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set ||\r
+               function() { return undefined; },\r
+       rnoType = /^(?:input|button)$/i,\r
+       rnoAttrNodeType = /^[238]$/,\r
+       rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,\r
+       ruseDefault = /^(?:checked|selected)$/i;\r
+\r
+// jQuery.attrFn\r
+migrateWarnProp( jQuery, "attrFn", attrFn || {}, "jQuery.attrFn is deprecated" );\r
+\r
+jQuery.attr = function( elem, name, value, pass ) {\r
+       var lowerName = name.toLowerCase(),\r
+               nType = elem && elem.nodeType;\r
+\r
+       if ( pass ) {\r
+               // Since pass is used internally, we only warn for new jQuery\r
+               // versions where there isn't a pass arg in the formal params\r
+               if ( oldAttr.length < 4 ) {\r
+                       migrateWarn("jQuery.fn.attr( props, pass ) is deprecated");\r
+               }\r
+               if ( elem && !rnoAttrNodeType.test( nType ) &&\r
+                       (attrFn ? name in attrFn : jQuery.isFunction(jQuery.fn[name])) ) {\r
+                       return jQuery( elem )[ name ]( value );\r
+               }\r
+       }\r
+\r
+       // Warn if user tries to set `type`, since it breaks on IE 6/7/8; by checking\r
+       // for disconnected elements we don't warn on $( "<button>", { type: "button" } ).\r
+       if ( name === "type" && value !== undefined && rnoType.test( elem.nodeName ) && elem.parentNode ) {\r
+               migrateWarn("Can't change the 'type' of an input or button in IE 6/7/8");\r
+       }\r
+\r
+       // Restore boolHook for boolean property/attribute synchronization\r
+       if ( !jQuery.attrHooks[ lowerName ] && rboolean.test( lowerName ) ) {\r
+               jQuery.attrHooks[ lowerName ] = {\r
+                       get: function( elem, name ) {\r
+                               // Align boolean attributes with corresponding properties\r
+                               // Fall back to attribute presence where some booleans are not supported\r
+                               var attrNode,\r
+                                       property = jQuery.prop( elem, name );\r
+                               return property === true || typeof property !== "boolean" &&\r
+                                       ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?\r
+\r
+                                       name.toLowerCase() :\r
+                                       undefined;\r
+                       },\r
+                       set: function( elem, value, name ) {\r
+                               var propName;\r
+                               if ( value === false ) {\r
+                                       // Remove boolean attributes when set to false\r
+                                       jQuery.removeAttr( elem, name );\r
+                               } else {\r
+                                       // value is true since we know at this point it's type boolean and not false\r
+                                       // Set boolean attributes to the same name and set the DOM property\r
+                                       propName = jQuery.propFix[ name ] || name;\r
+                                       if ( propName in elem ) {\r
+                                               // Only set the IDL specifically if it already exists on the element\r
+                                               elem[ propName ] = true;\r
+                                       }\r
+\r
+                                       elem.setAttribute( name, name.toLowerCase() );\r
+                               }\r
+                               return name;\r
+                       }\r
+               };\r
+\r
+               // Warn only for attributes that can remain distinct from their properties post-1.9\r
+               if ( ruseDefault.test( lowerName ) ) {\r
+                       migrateWarn( "jQuery.fn.attr('" + lowerName + "') may use property instead of attribute" );\r
+               }\r
+       }\r
+\r
+       return oldAttr.call( jQuery, elem, name, value );\r
+};\r
+\r
+// attrHooks: value\r
+jQuery.attrHooks.value = {\r
+       get: function( elem, name ) {\r
+               var nodeName = ( elem.nodeName || "" ).toLowerCase();\r
+               if ( nodeName === "button" ) {\r
+                       return valueAttrGet.apply( this, arguments );\r
+               }\r
+               if ( nodeName !== "input" && nodeName !== "option" ) {\r
+                       migrateWarn("jQuery.fn.attr('value') no longer gets properties");\r
+               }\r
+               return name in elem ?\r
+                       elem.value :\r
+                       null;\r
+       },\r
+       set: function( elem, value ) {\r
+               var nodeName = ( elem.nodeName || "" ).toLowerCase();\r
+               if ( nodeName === "button" ) {\r
+                       return valueAttrSet.apply( this, arguments );\r
+               }\r
+               if ( nodeName !== "input" && nodeName !== "option" ) {\r
+                       migrateWarn("jQuery.fn.attr('value', val) no longer sets properties");\r
+               }\r
+               // Does not return so that setAttribute is also used\r
+               elem.value = value;\r
+       }\r
+};\r
+\r
+\r
+var matched, browser,\r
+       oldInit = jQuery.fn.init,\r
+       oldParseJSON = jQuery.parseJSON,\r
+       // Note: XSS check is done below after string is trimmed\r
+       rquickExpr = /^([^<]*)(<[\w\W]+>)([^>]*)$/;\r
+\r
+// $(html) "looks like html" rule change\r
+jQuery.fn.init = function( selector, context, rootjQuery ) {\r
+       var match;\r
+\r
+       if ( selector && typeof selector === "string" && !jQuery.isPlainObject( context ) &&\r
+                       (match = rquickExpr.exec( jQuery.trim( selector ) )) && match[ 0 ] ) {\r
+               // This is an HTML string according to the "old" rules; is it still?\r
+               if ( selector.charAt( 0 ) !== "<" ) {\r
+                       migrateWarn("$(html) HTML strings must start with '<' character");\r
+               }\r
+               if ( match[ 3 ] ) {\r
+                       migrateWarn("$(html) HTML text after last tag is ignored");\r
+               }\r
+               // Consistently reject any HTML-like string starting with a hash (#9521)\r
+               // Note that this may break jQuery 1.6.x code that otherwise would work.\r
+               if ( match[ 0 ].charAt( 0 ) === "#" ) {\r
+                       migrateWarn("HTML string cannot start with a '#' character");\r
+                       jQuery.error("JQMIGRATE: Invalid selector string (XSS)");\r
+               }\r
+               // Now process using loose rules; let pre-1.8 play too\r
+               if ( context && context.context ) {\r
+                       // jQuery object as context; parseHTML expects a DOM object\r
+                       context = context.context;\r
+               }\r
+               if ( jQuery.parseHTML ) {\r
+                       return oldInit.call( this, jQuery.parseHTML( match[ 2 ], context, true ),\r
+                                       context, rootjQuery );\r
+               }\r
+       }\r
+       return oldInit.apply( this, arguments );\r
+};\r
+jQuery.fn.init.prototype = jQuery.fn;\r
+\r
+// Let $.parseJSON(falsy_value) return null\r
+jQuery.parseJSON = function( json ) {\r
+       if ( !json && json !== null ) {\r
+               migrateWarn("jQuery.parseJSON requires a valid JSON string");\r
+               return null;\r
+       }\r
+       return oldParseJSON.apply( this, arguments );\r
+};\r
+\r
+jQuery.uaMatch = function( ua ) {\r
+       ua = ua.toLowerCase();\r
+\r
+       var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||\r
+               /(webkit)[ \/]([\w.]+)/.exec( ua ) ||\r
+               /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||\r
+               /(msie) ([\w.]+)/.exec( ua ) ||\r
+               ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||\r
+               [];\r
+\r
+       return {\r
+               browser: match[ 1 ] || "",\r
+               version: match[ 2 ] || "0"\r
+       };\r
+};\r
+\r
+// Don't clobber any existing jQuery.browser in case it's different\r
+if ( !jQuery.browser ) {\r
+       matched = jQuery.uaMatch( navigator.userAgent );\r
+       browser = {};\r
+\r
+       if ( matched.browser ) {\r
+               browser[ matched.browser ] = true;\r
+               browser.version = matched.version;\r
+       }\r
+\r
+       // Chrome is Webkit, but Webkit is also Safari.\r
+       if ( browser.chrome ) {\r
+               browser.webkit = true;\r
+       } else if ( browser.webkit ) {\r
+               browser.safari = true;\r
+       }\r
+\r
+       jQuery.browser = browser;\r
+}\r
+\r
+// Warn if the code tries to get jQuery.browser\r
+migrateWarnProp( jQuery, "browser", jQuery.browser, "jQuery.browser is deprecated" );\r
+\r
+jQuery.sub = function() {\r
+       function jQuerySub( selector, context ) {\r
+               return new jQuerySub.fn.init( selector, context );\r
+       }\r
+       jQuery.extend( true, jQuerySub, this );\r
+       jQuerySub.superclass = this;\r
+       jQuerySub.fn = jQuerySub.prototype = this();\r
+       jQuerySub.fn.constructor = jQuerySub;\r
+       jQuerySub.sub = this.sub;\r
+       jQuerySub.fn.init = function init( selector, context ) {\r
+               if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {\r
+                       context = jQuerySub( context );\r
+               }\r
+\r
+               return jQuery.fn.init.call( this, selector, context, rootjQuerySub );\r
+       };\r
+       jQuerySub.fn.init.prototype = jQuerySub.fn;\r
+       var rootjQuerySub = jQuerySub(document);\r
+       migrateWarn( "jQuery.sub() is deprecated" );\r
+       return jQuerySub;\r
+};\r
+\r
+\r
+// Ensure that $.ajax gets the new parseJSON defined in core.js\r
+jQuery.ajaxSetup({\r
+       converters: {\r
+               "text json": jQuery.parseJSON\r
+       }\r
+});\r
+\r
+\r
+var oldFnData = jQuery.fn.data;\r
+\r
+jQuery.fn.data = function( name ) {\r
+       var ret, evt,\r
+               elem = this[0];\r
+\r
+       // Handles 1.7 which has this behavior and 1.8 which doesn't\r
+       if ( elem && name === "events" && arguments.length === 1 ) {\r
+               ret = jQuery.data( elem, name );\r
+               evt = jQuery._data( elem, name );\r
+               if ( ( ret === undefined || ret === evt ) && evt !== undefined ) {\r
+                       migrateWarn("Use of jQuery.fn.data('events') is deprecated");\r
+                       return evt;\r
+               }\r
+       }\r
+       return oldFnData.apply( this, arguments );\r
+};\r
+\r
+\r
+var rscriptType = /\/(java|ecma)script/i,\r
+       oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack;\r
+\r
+jQuery.fn.andSelf = function() {\r
+       migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()");\r
+       return oldSelf.apply( this, arguments );\r
+};\r
+\r
+// Since jQuery.clean is used internally on older versions, we only shim if it's missing\r
+if ( !jQuery.clean ) {\r
+       jQuery.clean = function( elems, context, fragment, scripts ) {\r
+               // Set context per 1.8 logic\r
+               context = context || document;\r
+               context = !context.nodeType && context[0] || context;\r
+               context = context.ownerDocument || context;\r
+\r
+               migrateWarn("jQuery.clean() is deprecated");\r
+\r
+               var i, elem, handleScript, jsTags,\r
+                       ret = [];\r
+\r
+               jQuery.merge( ret, jQuery.buildFragment( elems, context ).childNodes );\r
+\r
+               // Complex logic lifted directly from jQuery 1.8\r
+               if ( fragment ) {\r
+                       // Special handling of each script element\r
+                       handleScript = function( elem ) {\r
+                               // Check if we consider it executable\r
+                               if ( !elem.type || rscriptType.test( elem.type ) ) {\r
+                                       // Detach the script and store it in the scripts array (if provided) or the fragment\r
+                                       // Return truthy to indicate that it has been handled\r
+                                       return scripts ?\r
+                                               scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) :\r
+                                               fragment.appendChild( elem );\r
+                               }\r
+                       };\r
+\r
+                       for ( i = 0; (elem = ret[i]) != null; i++ ) {\r
+                               // Check if we're done after handling an executable script\r
+                               if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) {\r
+                                       // Append to fragment and handle embedded scripts\r
+                                       fragment.appendChild( elem );\r
+                                       if ( typeof elem.getElementsByTagName !== "undefined" ) {\r
+                                               // handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration\r
+                                               jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript );\r
+\r
+                                               // Splice the scripts into ret after their former ancestor and advance our index beyond them\r
+                                               ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );\r
+                                               i += jsTags.length;\r
+                                       }\r
+                               }\r
+                       }\r
+               }\r
+\r
+               return ret;\r
+       };\r
+}\r
+\r
+var eventAdd = jQuery.event.add,\r
+       eventRemove = jQuery.event.remove,\r
+       eventTrigger = jQuery.event.trigger,\r
+       oldToggle = jQuery.fn.toggle,\r
+       oldLive = jQuery.fn.live,\r
+       oldDie = jQuery.fn.die,\r
+       ajaxEvents = "ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",\r
+       rajaxEvent = new RegExp( "\\b(?:" + ajaxEvents + ")\\b" ),\r
+       rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,\r
+       hoverHack = function( events ) {\r
+               if ( typeof( events ) !== "string" || jQuery.event.special.hover ) {\r
+                       return events;\r
+               }\r
+               if ( rhoverHack.test( events ) ) {\r
+                       migrateWarn("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'");\r
+               }\r
+               return events && events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );\r
+       };\r
+\r
+// Event props removed in 1.9, put them back if needed; no practical way to warn them\r
+if ( jQuery.event.props && jQuery.event.props[ 0 ] !== "attrChange" ) {\r
+       jQuery.event.props.unshift( "attrChange", "attrName", "relatedNode", "srcElement" );\r
+}\r
+\r
+// Undocumented jQuery.event.handle was "deprecated" in jQuery 1.7\r
+if ( jQuery.event.dispatch ) {\r
+       migrateWarnProp( jQuery.event, "handle", jQuery.event.dispatch, "jQuery.event.handle is undocumented and deprecated" );\r
+}\r
+\r
+// Support for 'hover' pseudo-event and ajax event warnings\r
+jQuery.event.add = function( elem, types, handler, data, selector ){\r
+       if ( elem !== document && rajaxEvent.test( types ) ) {\r
+               migrateWarn( "AJAX events should be attached to document: " + types );\r
+       }\r
+       eventAdd.call( this, elem, hoverHack( types || "" ), handler, data, selector );\r
+};\r
+jQuery.event.remove = function( elem, types, handler, selector, mappedTypes ){\r
+       eventRemove.call( this, elem, hoverHack( types ) || "", handler, selector, mappedTypes );\r
+};\r
+\r
+jQuery.fn.error = function() {\r
+       var args = Array.prototype.slice.call( arguments, 0);\r
+       migrateWarn("jQuery.fn.error() is deprecated");\r
+       args.splice( 0, 0, "error" );\r
+       if ( arguments.length ) {\r
+               return this.bind.apply( this, args );\r
+       }\r
+       // error event should not bubble to window, although it does pre-1.7\r
+       this.triggerHandler.apply( this, args );\r
+       return this;\r
+};\r
+\r
+jQuery.fn.toggle = function( fn, fn2 ) {\r
+\r
+       // Don't mess with animation or css toggles\r
+       if ( !jQuery.isFunction( fn ) || !jQuery.isFunction( fn2 ) ) {\r
+               return oldToggle.apply( this, arguments );\r
+       }\r
+       migrateWarn("jQuery.fn.toggle(handler, handler...) is deprecated");\r
+\r
+       // Save reference to arguments for access in closure\r
+       var args = arguments,\r
+               guid = fn.guid || jQuery.guid++,\r
+               i = 0,\r
+               toggler = function( event ) {\r
+                       // Figure out which function to execute\r
+                       var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;\r
+                       jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );\r
+\r
+                       // Make sure that clicks stop\r
+                       event.preventDefault();\r
+\r
+                       // and execute the function\r
+                       return args[ lastToggle ].apply( this, arguments ) || false;\r
+               };\r
+\r
+       // link all the functions, so any of them can unbind this click handler\r
+       toggler.guid = guid;\r
+       while ( i < args.length ) {\r
+               args[ i++ ].guid = guid;\r
+       }\r
+\r
+       return this.click( toggler );\r
+};\r
+\r
+jQuery.fn.live = function( types, data, fn ) {\r
+       migrateWarn("jQuery.fn.live() is deprecated");\r
+       if ( oldLive ) {\r
+               return oldLive.apply( this, arguments );\r
+       }\r
+       jQuery( this.context ).on( types, this.selector, data, fn );\r
+       return this;\r
+};\r
+\r
+jQuery.fn.die = function( types, fn ) {\r
+       migrateWarn("jQuery.fn.die() is deprecated");\r
+       if ( oldDie ) {\r
+               return oldDie.apply( this, arguments );\r
+       }\r
+       jQuery( this.context ).off( types, this.selector || "**", fn );\r
+       return this;\r
+};\r
+\r
+// Turn global events into document-triggered events\r
+jQuery.event.trigger = function( event, data, elem, onlyHandlers  ){\r
+       if ( !elem && !rajaxEvent.test( event ) ) {\r
+               migrateWarn( "Global events are undocumented and deprecated" );\r
+       }\r
+       return eventTrigger.call( this,  event, data, elem || document, onlyHandlers  );\r
+};\r
+jQuery.each( ajaxEvents.split("|"),\r
+       function( _, name ) {\r
+               jQuery.event.special[ name ] = {\r
+                       setup: function() {\r
+                               var elem = this;\r
+\r
+                               // The document needs no shimming; must be !== for oldIE\r
+                               if ( elem !== document ) {\r
+                                       jQuery.event.add( document, name + "." + jQuery.guid, function() {\r
+                                               jQuery.event.trigger( name, null, elem, true );\r
+                                       });\r
+                                       jQuery._data( this, name, jQuery.guid++ );\r
+                               }\r
+                               return false;\r
+                       },\r
+                       teardown: function() {\r
+                               if ( this !== document ) {\r
+                                       jQuery.event.remove( document, name + "." + jQuery._data( this, name ) );\r
+                               }\r
+                               return false;\r
+                       }\r
+               };\r
+       }\r
+);\r
+\r
+\r
+})( jQuery, window );\r
diff --git a/wp-includes/js/jquery/jquery-migrate.min.js b/wp-includes/js/jquery/jquery-migrate.min.js
new file mode 100644 (file)
index 0000000..8b7ec47
--- /dev/null
@@ -0,0 +1,2 @@
+/*! jQuery Migrate v1.2.1 | (c) 2005, 2013 jQuery Foundation, Inc. and other contributors | jquery.org/license */\r
+jQuery.migrateMute===void 0&&(jQuery.migrateMute=!0),function(e,t,n){function r(n){var r=t.console;i[n]||(i[n]=!0,e.migrateWarnings.push(n),r&&r.warn&&!e.migrateMute&&(r.warn("JQMIGRATE: "+n),e.migrateTrace&&r.trace&&r.trace()))}function a(t,a,i,o){if(Object.defineProperty)try{return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){return r(o),i},set:function(e){r(o),i=e}}),n}catch(s){}e._definePropertyBroken=!0,t[a]=i}var i={};e.migrateWarnings=[],!e.migrateMute&&t.console&&t.console.log&&t.console.log("JQMIGRATE: Logging is active"),e.migrateTrace===n&&(e.migrateTrace=!0),e.migrateReset=function(){i={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var o=e("<input/>",{size:1}).attr("size")&&e.attrFn,s=e.attr,u=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},l=/^(?:input|button)$/i,d=/^[238]$/,p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,f=/^(?:checked|selected)$/i;a(e,"attrFn",o||{},"jQuery.attrFn is deprecated"),e.attr=function(t,a,i,u){var c=a.toLowerCase(),g=t&&t.nodeType;return u&&(4>s.length&&r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!d.test(g)&&(o?a in o:e.isFunction(e.fn[a])))?e(t)[a](i):("type"===a&&i!==n&&l.test(t.nodeName)&&t.parentNode&&r("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[c]&&p.test(c)&&(e.attrHooks[c]={get:function(t,r){var a,i=e.prop(t,r);return i===!0||"boolean"!=typeof i&&(a=t.getAttributeNode(r))&&a.nodeValue!==!1?r.toLowerCase():n},set:function(t,n,r){var a;return n===!1?e.removeAttr(t,r):(a=e.propFix[r]||r,a in t&&(t[a]=!0),t.setAttribute(r,r.toLowerCase())),r}},f.test(c)&&r("jQuery.fn.attr('"+c+"') may use property instead of attribute")),s.call(e,t,a,i))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?u.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var a=(e.nodeName||"").toLowerCase();return"button"===a?c.apply(this,arguments):("input"!==a&&"option"!==a&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t,n)}};var g,h,v=e.fn.init,m=e.parseJSON,y=/^([^<]*)(<[\w\W]+>)([^>]*)$/;e.fn.init=function(t,n,a){var i;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(i=y.exec(e.trim(t)))&&i[0]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),i[3]&&r("$(html) HTML text after last tag is ignored"),"#"===i[0].charAt(0)&&(r("HTML string cannot start with a '#' character"),e.error("JQMIGRATE: Invalid selector string (XSS)")),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(i[2],n,!0),n,a):v.apply(this,arguments)},e.fn.init.prototype=e.fn,e.parseJSON=function(e){return e||null===e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g=e.uaMatch(navigator.userAgent),h={},g.browser&&(h[g.browser]=!0,h.version=g.version),h.chrome?h.webkit=!0:h.webkit&&(h.safari=!0),e.browser=h),a(e,"browser",e.browser,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,a){return a&&a instanceof e&&!(a instanceof t)&&(a=t(a)),e.fn.init.call(this,r,a,n)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.ajaxSetup({converters:{"text json":e.parseJSON}});var b=e.fn.data;e.fn.data=function(t){var a,i,o=this[0];return!o||"events"!==t||1!==arguments.length||(a=e.data(o,t),i=e._data(o,t),a!==n&&a!==i||i===n)?b.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),i)};var j=/\/(java|ecma)script/i,w=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)},e.clean||(e.clean=function(t,a,i,o){a=a||document,a=!a.nodeType&&a[0]||a,a=a.ownerDocument||a,r("jQuery.clean() is deprecated");var s,u,c,l,d=[];if(e.merge(d,e.buildFragment(t,a).childNodes),i)for(c=function(e){return!e.type||j.test(e.type)?o?o.push(e.parentNode?e.parentNode.removeChild(e):e):i.appendChild(e):n},s=0;null!=(u=d[s]);s++)e.nodeName(u,"script")&&c(u)||(i.appendChild(u),u.getElementsByTagName!==n&&(l=e.grep(e.merge([],u.getElementsByTagName("script")),c),d.splice.apply(d,[s+1,0].concat(l)),s+=l.length));return d});var Q=e.event.add,x=e.event.remove,k=e.event.trigger,N=e.fn.toggle,T=e.fn.live,M=e.fn.die,S="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",C=RegExp("\\b(?:"+S+")\\b"),H=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(H.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(H,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&a(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,a,i){e!==document&&C.test(t)&&r("AJAX events should be attached to document: "+t),Q.call(this,e,A(t||""),n,a,i)},e.event.remove=function(e,t,n,r,a){x.call(this,e,A(t)||"",n,r,a)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return r("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return N.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var a=arguments,i=t.guid||e.guid++,o=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%o;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),a[r].apply(this,arguments)||!1};for(s.guid=i;a.length>o;)a[o++].guid=i;return this.click(s)},e.fn.live=function(t,n,a){return r("jQuery.fn.live() is deprecated"),T?T.apply(this,arguments):(e(this.context).on(t,this.selector,n,a),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),M?M.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,a){return n||C.test(e)||r("Global events are undocumented and deprecated"),k.call(this,e,t,n||document,a)},e.each(S.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,null,t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}})}(jQuery,window);
\ No newline at end of file
index 936b44505b9fc16baf36ca5d619bbf968cd51c4b..d0dbfa83ffb9c5250afbc7aafba494c8ffae25c4 100644 (file)
@@ -1,2 +1,2 @@
-/*! jQuery Color v@2.1.0 with SVG Color Names http://github.com/jquery/jquery-color | jquery.org/license */
-(function(a,b){function m(a,b,c){var d=h[b.type]||{};return a==null?c||!b.def?null:b.def:(a=d.floor?~~a:parseFloat(a),isNaN(a)?b.def:d.mod?(a+d.mod)%d.mod:0>a?0:d.max<a?d.max:a)}function n(b){var c=f(),d=c._rgba=[];return b=b.toLowerCase(),l(e,function(a,e){var f,h=e.re.exec(b),i=h&&e.parse(h),j=e.space||"rgba";if(i)return f=c[j](i),c[g[j].cache]=f[g[j].cache],d=c._rgba=f._rgba,!1}),d.length?(d.join()==="0,0,0,0"&&a.extend(d,k.transparent),c):k[b]}function o(a,b,c){return c=(c+1)%1,c*6<1?a+(b-a)*c*6:c*2<1?b:c*3<2?a+(b-a)*(2/3-c)*6:a}var c="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",d=/^([\-+])=\s*(\d+\.?\d*)/,e=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(a){return[a[1],a[2],a[3],a[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(a){return[a[1]*2.55,a[2]*2.55,a[3]*2.55,a[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(a){return[a[1],a[2]/100,a[3]/100,a[4]]}}],f=a.Color=function(b,c,d,e){return new a.Color.fn.parse(b,c,d,e)},g={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},h={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},i=f.support={},j=a("<p>")[0],k,l=a.each;j.style.cssText="background-color:rgba(1,1,1,.5)",i.rgba=j.style.backgroundColor.indexOf("rgba")>-1,l(g,function(a,b){b.cache="_"+a,b.props.alpha={idx:3,type:"percent",def:1}}),f.fn=a.extend(f.prototype,{parse:function(c,d,e,h){if(c===b)return this._rgba=[null,null,null,null],this;if(c.jquery||c.nodeType)c=a(c).css(d),d=b;var i=this,j=a.type(c),o=this._rgba=[],p;d!==b&&(c=[c,d,e,h],j="array");if(j==="string")return this.parse(n(c)||k._default);if(j==="array")return l(g.rgba.props,function(a,b){o[b.idx]=m(c[b.idx],b)}),this;if(j==="object")return c instanceof f?l(g,function(a,b){c[b.cache]&&(i[b.cache]=c[b.cache].slice())}):l(g,function(b,d){var e=d.cache;l(d.props,function(a,b){if(!i[e]&&d.to){if(a==="alpha"||c[a]==null)return;i[e]=d.to(i._rgba)}i[e][b.idx]=m(c[a],b,!0)}),i[e]&&a.inArray(null,i[e].slice(0,3))<0&&(i[e][3]=1,d.from&&(i._rgba=d.from(i[e])))}),this},is:function(a){var b=f(a),c=!0,d=this;return l(g,function(a,e){var f,g=b[e.cache];return g&&(f=d[e.cache]||e.to&&e.to(d._rgba)||[],l(e.props,function(a,b){if(g[b.idx]!=null)return c=g[b.idx]===f[b.idx],c})),c}),c},_space:function(){var a=[],b=this;return l(g,function(c,d){b[d.cache]&&a.push(c)}),a.pop()},transition:function(a,b){var c=f(a),d=c._space(),e=g[d],i=this.alpha()===0?f("transparent"):this,j=i[e.cache]||e.to(i._rgba),k=j.slice();return c=c[e.cache],l(e.props,function(a,d){var e=d.idx,f=j[e],g=c[e],i=h[d.type]||{};if(g===null)return;f===null?k[e]=g:(i.mod&&(g-f>i.mod/2?f+=i.mod:f-g>i.mod/2&&(f-=i.mod)),k[e]=m((g-f)*b+f,d))}),this[d](k)},blend:function(b){if(this._rgba[3]===1)return this;var c=this._rgba.slice(),d=c.pop(),e=f(b)._rgba;return f(a.map(c,function(a,b){return(1-d)*e[b]+d*a}))},toRgbaString:function(){var b="rgba(",c=a.map(this._rgba,function(a,b){return a==null?b>2?1:0:a});return c[3]===1&&(c.pop(),b="rgb("),b+c.join()+")"},toHslaString:function(){var b="hsla(",c=a.map(this.hsla(),function(a,b){return a==null&&(a=b>2?1:0),b&&b<3&&(a=Math.round(a*100)+"%"),a});return c[3]===1&&(c.pop(),b="hsl("),b+c.join()+")"},toHexString:function(b){var c=this._rgba.slice(),d=c.pop();return b&&c.push(~~(d*255)),"#"+a.map(c,function(a,b){return a=(a||0).toString(16),a.length===1?"0"+a:a}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}}),f.fn.parse.prototype=f.fn,g.hsla.to=function(a){if(a[0]==null||a[1]==null||a[2]==null)return[null,null,null,a[3]];var b=a[0]/255,c=a[1]/255,d=a[2]/255,e=a[3],f=Math.max(b,c,d),g=Math.min(b,c,d),h=f-g,i=f+g,j=i*.5,k,l;return g===f?k=0:b===f?k=60*(c-d)/h+360:c===f?k=60*(d-b)/h+120:k=60*(b-c)/h+240,j===0||j===1?l=j:j<=.5?l=h/i:l=h/(2-i),[Math.round(k)%360,l,j,e==null?1:e]},g.hsla.from=function(a){if(a[0]==null||a[1]==null||a[2]==null)return[null,null,null,a[3]];var b=a[0]/360,c=a[1],d=a[2],e=a[3],f=d<=.5?d*(1+c):d+c-d*c,g=2*d-f,h,i,j;return[Math.round(o(g,f,b+1/3)*255),Math.round(o(g,f,b)*255),Math.round(o(g,f,b-1/3)*255),e]},l(g,function(c,e){var g=e.props,h=e.cache,i=e.to,j=e.from;f.fn[c]=function(c){i&&!this[h]&&(this[h]=i(this._rgba));if(c===b)return this[h].slice();var d,e=a.type(c),k=e==="array"||e==="object"?c:arguments,n=this[h].slice();return l(g,function(a,b){var c=k[e==="object"?a:b.idx];c==null&&(c=n[b.idx]),n[b.idx]=m(c,b)}),j?(d=f(j(n)),d[h]=n,d):f(n)},l(g,function(b,e){if(f.fn[b])return;f.fn[b]=function(f){var g=a.type(f),h=b==="alpha"?this._hsla?"hsla":"rgba":c,i=this[h](),j=i[e.idx],k;return g==="undefined"?j:(g==="function"&&(f=f.call(this,j),g=a.type(f)),f==null&&e.empty?this:(g==="string"&&(k=d.exec(f),k&&(f=j+parseFloat(k[2])*(k[1]==="+"?1:-1))),i[e.idx]=f,this[h](i)))}})}),f.hook=function(b){var c=b.split(" ");l(c,function(b,c){a.cssHooks[c]={set:function(b,d){var e,g,h="";if(a.type(d)!=="string"||(e=n(d))){d=f(e||d);if(!i.rgba&&d._rgba[3]!==1){g=c==="backgroundColor"?b.parentNode:b;while((h===""||h==="transparent")&&g&&g.style)try{h=a.css(g,"backgroundColor"),g=g.parentNode}catch(j){}d=d.blend(h&&h!=="transparent"?h:"_default")}d=d.toRgbaString()}try{b.style[c]=d}catch(d){}}},a.fx.step[c]=function(b){b.colorInit||(b.start=f(b.elem,c),b.end=f(b.end),b.colorInit=!0),a.cssHooks[c].set(b.elem,b.start.transition(b.end,b.pos))}})},f.hook(c),a.cssHooks.borderColor={expand:function(a){var b={};return l(["Top","Right","Bottom","Left"],function(c,d){b["border"+d+"Color"]=a}),b}},k=a.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}})(jQuery),jQuery.extend(jQuery.Color.names,{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",blanchedalmond:"#ffebcd",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",limegreen:"#32cd32",linen:"#faf0e6",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",oldlace:"#fdf5e6",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",whitesmoke:"#f5f5f5",yellowgreen:"#9acd32"});
\ No newline at end of file
+/*! jQuery Color v@2.1.1 with SVG Color Names http://github.com/jquery/jquery-color | jquery.org/license */
+(function(a,b){function m(a,b,c){var d=h[b.type]||{};return a==null?c||!b.def?null:b.def:(a=d.floor?~~a:parseFloat(a),isNaN(a)?b.def:d.mod?(a+d.mod)%d.mod:0>a?0:d.max<a?d.max:a)}function n(b){var c=f(),d=c._rgba=[];return b=b.toLowerCase(),l(e,function(a,e){var f,h=e.re.exec(b),i=h&&e.parse(h),j=e.space||"rgba";if(i)return f=c[j](i),c[g[j].cache]=f[g[j].cache],d=c._rgba=f._rgba,!1}),d.length?(d.join()==="0,0,0,0"&&a.extend(d,k.transparent),c):k[b]}function o(a,b,c){return c=(c+1)%1,c*6<1?a+(b-a)*c*6:c*2<1?b:c*3<2?a+(b-a)*(2/3-c)*6:a}var c="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",d=/^([\-+])=\s*(\d+\.?\d*)/,e=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(a){return[a[1],a[2],a[3],a[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(a){return[a[1]*2.55,a[2]*2.55,a[3]*2.55,a[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(a){return[a[1],a[2]/100,a[3]/100,a[4]]}}],f=a.Color=function(b,c,d,e){return new a.Color.fn.parse(b,c,d,e)},g={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},h={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},i=f.support={},j=a("<p>")[0],k,l=a.each;j.style.cssText="background-color:rgba(1,1,1,.5)",i.rgba=j.style.backgroundColor.indexOf("rgba")>-1,l(g,function(a,b){b.cache="_"+a,b.props.alpha={idx:3,type:"percent",def:1}}),f.fn=a.extend(f.prototype,{parse:function(c,d,e,h){if(c===b)return this._rgba=[null,null,null,null],this;if(c.jquery||c.nodeType)c=a(c).css(d),d=b;var i=this,j=a.type(c),o=this._rgba=[];d!==b&&(c=[c,d,e,h],j="array");if(j==="string")return this.parse(n(c)||k._default);if(j==="array")return l(g.rgba.props,function(a,b){o[b.idx]=m(c[b.idx],b)}),this;if(j==="object")return c instanceof f?l(g,function(a,b){c[b.cache]&&(i[b.cache]=c[b.cache].slice())}):l(g,function(b,d){var e=d.cache;l(d.props,function(a,b){if(!i[e]&&d.to){if(a==="alpha"||c[a]==null)return;i[e]=d.to(i._rgba)}i[e][b.idx]=m(c[a],b,!0)}),i[e]&&a.inArray(null,i[e].slice(0,3))<0&&(i[e][3]=1,d.from&&(i._rgba=d.from(i[e])))}),this},is:function(a){var b=f(a),c=!0,d=this;return l(g,function(a,e){var f,g=b[e.cache];return g&&(f=d[e.cache]||e.to&&e.to(d._rgba)||[],l(e.props,function(a,b){if(g[b.idx]!=null)return c=g[b.idx]===f[b.idx],c})),c}),c},_space:function(){var a=[],b=this;return l(g,function(c,d){b[d.cache]&&a.push(c)}),a.pop()},transition:function(a,b){var c=f(a),d=c._space(),e=g[d],i=this.alpha()===0?f("transparent"):this,j=i[e.cache]||e.to(i._rgba),k=j.slice();return c=c[e.cache],l(e.props,function(a,d){var e=d.idx,f=j[e],g=c[e],i=h[d.type]||{};if(g===null)return;f===null?k[e]=g:(i.mod&&(g-f>i.mod/2?f+=i.mod:f-g>i.mod/2&&(f-=i.mod)),k[e]=m((g-f)*b+f,d))}),this[d](k)},blend:function(b){if(this._rgba[3]===1)return this;var c=this._rgba.slice(),d=c.pop(),e=f(b)._rgba;return f(a.map(c,function(a,b){return(1-d)*e[b]+d*a}))},toRgbaString:function(){var b="rgba(",c=a.map(this._rgba,function(a,b){return a==null?b>2?1:0:a});return c[3]===1&&(c.pop(),b="rgb("),b+c.join()+")"},toHslaString:function(){var b="hsla(",c=a.map(this.hsla(),function(a,b){return a==null&&(a=b>2?1:0),b&&b<3&&(a=Math.round(a*100)+"%"),a});return c[3]===1&&(c.pop(),b="hsl("),b+c.join()+")"},toHexString:function(b){var c=this._rgba.slice(),d=c.pop();return b&&c.push(~~(d*255)),"#"+a.map(c,function(a){return a=(a||0).toString(16),a.length===1?"0"+a:a}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}}),f.fn.parse.prototype=f.fn,g.hsla.to=function(a){if(a[0]==null||a[1]==null||a[2]==null)return[null,null,null,a[3]];var b=a[0]/255,c=a[1]/255,d=a[2]/255,e=a[3],f=Math.max(b,c,d),g=Math.min(b,c,d),h=f-g,i=f+g,j=i*.5,k,l;return g===f?k=0:b===f?k=60*(c-d)/h+360:c===f?k=60*(d-b)/h+120:k=60*(b-c)/h+240,h===0?l=0:j<=.5?l=h/i:l=h/(2-i),[Math.round(k)%360,l,j,e==null?1:e]},g.hsla.from=function(a){if(a[0]==null||a[1]==null||a[2]==null)return[null,null,null,a[3]];var b=a[0]/360,c=a[1],d=a[2],e=a[3],f=d<=.5?d*(1+c):d+c-d*c,g=2*d-f;return[Math.round(o(g,f,b+1/3)*255),Math.round(o(g,f,b)*255),Math.round(o(g,f,b-1/3)*255),e]},l(g,function(c,e){var g=e.props,h=e.cache,i=e.to,j=e.from;f.fn[c]=function(c){i&&!this[h]&&(this[h]=i(this._rgba));if(c===b)return this[h].slice();var d,e=a.type(c),k=e==="array"||e==="object"?c:arguments,n=this[h].slice();return l(g,function(a,b){var c=k[e==="object"?a:b.idx];c==null&&(c=n[b.idx]),n[b.idx]=m(c,b)}),j?(d=f(j(n)),d[h]=n,d):f(n)},l(g,function(b,e){if(f.fn[b])return;f.fn[b]=function(f){var g=a.type(f),h=b==="alpha"?this._hsla?"hsla":"rgba":c,i=this[h](),j=i[e.idx],k;return g==="undefined"?j:(g==="function"&&(f=f.call(this,j),g=a.type(f)),f==null&&e.empty?this:(g==="string"&&(k=d.exec(f),k&&(f=j+parseFloat(k[2])*(k[1]==="+"?1:-1))),i[e.idx]=f,this[h](i)))}})}),f.hook=function(b){var c=b.split(" ");l(c,function(b,c){a.cssHooks[c]={set:function(b,d){var e,g,h="";if(a.type(d)!=="string"||(e=n(d))){d=f(e||d);if(!i.rgba&&d._rgba[3]!==1){g=c==="backgroundColor"?b.parentNode:b;while((h===""||h==="transparent")&&g&&g.style)try{h=a.css(g,"backgroundColor"),g=g.parentNode}catch(j){}d=d.blend(h&&h!=="transparent"?h:"_default")}d=d.toRgbaString()}try{b.style[c]=d}catch(j){}}},a.fx.step[c]=function(b){b.colorInit||(b.start=f(b.elem,c),b.end=f(b.end),b.colorInit=!0),a.cssHooks[c].set(b.elem,b.start.transition(b.end,b.pos))}})},f.hook(c),a.cssHooks.borderColor={expand:function(a){var b={};return l(["Top","Right","Bottom","Left"],function(c,d){b["border"+d+"Color"]=a}),b}},k=a.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}})(jQuery),jQuery.extend(jQuery.Color.names,{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",blanchedalmond:"#ffebcd",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",limegreen:"#32cd32",linen:"#faf0e6",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",oldlace:"#fdf5e6",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",whitesmoke:"#f5f5f5",yellowgreen:"#9acd32"});
index 6db2afa8cd84be34f98bc12657411c7e6c9ff1f0..40c1aa10092a91a1ffe34366eba34a720a71b09a 100644 (file)
@@ -1,3 +1,7 @@
-/*! jQuery v1.8.3 jquery.com | jquery.org/license */
-(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r<i;r++)v.event.add(t,n,u[n][r])}o.data&&(o.data=v.extend({},o.data))}function Ot(e,t){var n;if(t.nodeType!==1)return;t.clearAttributes&&t.clearAttributes(),t.mergeAttributes&&t.mergeAttributes(e),n=t.nodeName.toLowerCase(),n==="object"?(t.parentNode&&(t.outerHTML=e.outerHTML),v.support.html5Clone&&e.innerHTML&&!v.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):n==="input"&&Et.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):n==="option"?t.selected=e.defaultSelected:n==="input"||n==="textarea"?t.defaultValue=e.defaultValue:n==="script"&&t.text!==e.text&&(t.text=e.text),t.removeAttribute(v.expando)}function Mt(e){return typeof e.getElementsByTagName!="undefined"?e.getElementsByTagName("*"):typeof e.querySelectorAll!="undefined"?e.querySelectorAll("*"):[]}function _t(e){Et.test(e.type)&&(e.defaultChecked=e.checked)}function Qt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Jt.length;while(i--){t=Jt[i]+n;if(t in e)return t}return r}function Gt(e,t){return e=t||e,v.css(e,"display")==="none"||!v.contains(e.ownerDocument,e)}function Yt(e,t){var n,r,i=[],s=0,o=e.length;for(;s<o;s++){n=e[s];if(!n.style)continue;i[s]=v._data(n,"olddisplay"),t?(!i[s]&&n.style.display==="none"&&(n.style.display=""),n.style.display===""&&Gt(n)&&(i[s]=v._data(n,"olddisplay",nn(n.nodeName)))):(r=Dt(n,"display"),!i[s]&&r!=="none"&&v._data(n,"olddisplay",r))}for(s=0;s<o;s++){n=e[s];if(!n.style)continue;if(!t||n.style.display==="none"||n.style.display==="")n.style.display=t?i[s]||"":"none"}return e}function Zt(e,t,n){var r=Rt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function en(e,t,n,r){var i=n===(r?"border":"content")?4:t==="width"?1:0,s=0;for(;i<4;i+=2)n==="margin"&&(s+=v.css(e,n+$t[i],!0)),r?(n==="content"&&(s-=parseFloat(Dt(e,"padding"+$t[i]))||0),n!=="margin"&&(s-=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0)):(s+=parseFloat(Dt(e,"padding"+$t[i]))||0,n!=="padding"&&(s+=parseFloat(Dt(e,"border"+$t[i]+"Width"))||0));return s}function tn(e,t,n){var r=t==="width"?e.offsetWidth:e.offsetHeight,i=!0,s=v.support.boxSizing&&v.css(e,"boxSizing")==="border-box";if(r<=0||r==null){r=Dt(e,t);if(r<0||r==null)r=e.style[t];if(Ut.test(r))return r;i=s&&(v.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+en(e,t,n||(s?"border":"content"),i)+"px"}function nn(e){if(Wt[e])return Wt[e];var t=v("<"+e+">").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write("<!doctype html><html><body>"),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u<a;u++)r=o[u],s=/^\+/.test(r),s&&(r=r.substr(1)||"*"),i=e[r]=e[r]||[],i[s?"unshift":"push"](n)}}function kn(e,n,r,i,s,o){s=s||n.dataTypes[0],o=o||{},o[s]=!0;var u,a=e[s],f=0,l=a?a.length:0,c=e===Sn;for(;f<l&&(c||!u);f++)u=a[f](n,r,i),typeof u=="string"&&(!c||o[u]?u=t:(n.dataTypes.unshift(u),u=kn(e,n,r,i,u,o)));return(c||!u)&&!o["*"]&&(u=kn(e,n,r,i,"*",o)),u}function Ln(e,n){var r,i,s=v.ajaxSettings.flatOptions||{};for(r in n)n[r]!==t&&((s[r]?e:i||(i={}))[r]=n[r]);i&&v.extend(!0,e,i)}function An(e,n,r){var i,s,o,u,a=e.contents,f=e.dataTypes,l=e.responseFields;for(s in l)s in r&&(n[l[s]]=r[s]);while(f[0]==="*")f.shift(),i===t&&(i=e.mimeType||n.getResponseHeader("content-type"));if(i)for(s in a)if(a[s]&&a[s].test(i)){f.unshift(s);break}if(f[0]in r)o=f[0];else{for(s in r){if(!f[0]||e.converters[s+" "+f[0]]){o=s;break}u||(u=s)}o=o||u}if(o)return o!==f[0]&&f.unshift(o),r[o]}function On(e,t){var n,r,i,s,o=e.dataTypes.slice(),u=o[0],a={},f=0;e.dataFilter&&(t=e.dataFilter(t,e.dataType));if(o[1])for(n in e.converters)a[n.toLowerCase()]=e.converters[n];for(;i=o[++f];)if(i!=="*"){if(u!=="*"&&u!==i){n=a[u+" "+i]||a["* "+i];if(!n)for(r in a){s=r.split(" ");if(s[1]===i){n=a[u+" "+s[0]]||a["* "+s[0]];if(n){n===!0?n=a[r]:a[r]!==!0&&(i=s[0],o.splice(f--,0,i));break}}}if(n!==!0)if(n&&e["throws"])t=n(t);else try{t=n(t)}catch(l){return{state:"parsererror",error:n?l:"No conversion from "+u+" to "+i}}}u=i}return{state:"success",data:t}}function Fn(){try{return new e.XMLHttpRequest}catch(t){}}function In(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}function $n(){return setTimeout(function(){qn=t},0),qn=v.now()}function Jn(e,t){v.each(t,function(t,n){var r=(Vn[t]||[]).concat(Vn["*"]),i=0,s=r.length;for(;i<s;i++)if(r[i].call(e,t,n))return})}function Kn(e,t,n){var r,i=0,s=0,o=Xn.length,u=v.Deferred().always(function(){delete a.elem}),a=function(){var t=qn||$n(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,i=1-r,s=0,o=f.tweens.length;for(;s<o;s++)f.tweens[s].run(i);return u.notifyWith(e,[f,i,n]),i<1&&o?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:v.extend({},t),opts:v.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:qn||$n(),duration:n.duration,tweens:[],createTween:function(t,n,r){var i=v.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(i),i},stop:function(t){var n=0,r=t?f.tweens.length:0;for(;n<r;n++)f.tweens[n].run(1);return t?u.resolveWith(e,[f,t]):u.rejectWith(e,[f,t]),this}}),l=f.props;Qn(l,f.opts.specialEasing);for(;i<o;i++){r=Xn[i].call(f,e,l,f.opts);if(r)return r}return Jn(f,l),v.isFunction(f.opts.start)&&f.opts.start.call(e,f),v.fx.timer(v.extend(a,{anim:f,queue:f.opts.queue,elem:e})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function Qn(e,t){var n,r,i,s,o;for(n in e){r=v.camelCase(n),i=t[r],s=e[n],v.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=v.cssHooks[r];if(o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}}function Gn(e,t,n){var r,i,s,o,u,a,f,l,c,h=this,p=e.style,d={},m=[],g=e.nodeType&&Gt(e);n.queue||(l=v._queueHooks(e,"fx"),l.unqueued==null&&(l.unqueued=0,c=l.empty.fire,l.empty.fire=function(){l.unqueued||c()}),l.unqueued++,h.always(function(){h.always(function(){l.unqueued--,v.queue(e,"fx").length||l.empty.fire()})})),e.nodeType===1&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],v.css(e,"display")==="inline"&&v.css(e,"float")==="none"&&(!v.support.inlineBlockNeedsLayout||nn(e.nodeName)==="inline"?p.display="inline-block":p.zoom=1)),n.overflow&&(p.overflow="hidden",v.support.shrinkWrapBlocks||h.done(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t){s=t[r];if(Un.exec(s)){delete t[r],a=a||s==="toggle";if(s===(g?"hide":"show"))continue;m.push(r)}}o=m.length;if(o){u=v._data(e,"fxshow")||v._data(e,"fxshow",{}),"hidden"in u&&(g=u.hidden),a&&(u.hidden=!g),g?v(e).show():h.done(function(){v(e).hide()}),h.done(function(){var t;v.removeData(e,"fxshow",!0);for(t in d)v.style(e,t,d[t])});for(r=0;r<o;r++)i=m[r],f=h.createTween(i,g?u[i]:0),d[i]=u[i]||v.style(e,i),i in u||(u[i]=f.start,g&&(f.end=f.start,f.start=i==="width"||i==="height"?1:0))}}function Yn(e,t,n,r,i){return new Yn.prototype.init(e,t,n,r,i)}function Zn(e,t){var n,r={height:e},i=0;t=t?1:0;for(;i<4;i+=2-t)n=$t[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function tr(e){return v.isWindow(e)?e:e.nodeType===9?e.defaultView||e.parentWindow:!1}var n,r,i=e.document,s=e.location,o=e.navigator,u=e.jQuery,a=e.$,f=Array.prototype.push,l=Array.prototype.slice,c=Array.prototype.indexOf,h=Object.prototype.toString,p=Object.prototype.hasOwnProperty,d=String.prototype.trim,v=function(e,t){return new v.fn.init(e,t,n)},m=/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,g=/\S/,y=/\s+/,b=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,w=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a<f;a++)if((e=arguments[a])!=null)for(n in e){r=u[n],i=e[n];if(u===i)continue;l&&i&&(v.isPlainObject(i)||(s=v.isArray(i)))?(s?(s=!1,o=r&&v.isArray(r)?r:[]):o=r&&v.isPlainObject(r)?r:{},u[n]=v.extend(l,o,i)):i!==t&&(u[n]=i)}return u},v.extend({noConflict:function(t){return e.$===v&&(e.$=a),t&&e.jQuery===v&&(e.jQuery=u),v},isReady:!1,readyWait:1,holdReady:function(e){e?v.readyWait++:v.ready(!0)},ready:function(e){if(e===!0?--v.readyWait:v.isReady)return;if(!i.body)return setTimeout(v.ready,1);v.isReady=!0;if(e!==!0&&--v.readyWait>0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s<o;)if(n.apply(e[s++],r)===!1)break}else if(u){for(i in e)if(n.call(e[i],i,e[i])===!1)break}else for(;s<o;)if(n.call(e[s],s,e[s++])===!1)break;return e},trim:d&&!d.call("\ufeff\u00a0")?function(e){return e==null?"":d.call(e)}:function(e){return e==null?"":(e+"").replace(b,"")},makeArray:function(e,t){var n,r=t||[];return e!=null&&(n=v.type(e),e.length==null||n==="string"||n==="function"||n==="regexp"||v.isWindow(e)?f.call(r,e):v.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(c)return c.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,s=0;if(typeof r=="number")for(;s<r;s++)e[i++]=n[s];else while(n[s]!==t)e[i++]=n[s++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length;n=!!n;for(;s<o;s++)r=!!t(e[s],s),n!==r&&i.push(e[s]);return i},map:function(e,n,r){var i,s,o=[],u=0,a=e.length,f=e instanceof v||a!==t&&typeof a=="number"&&(a>0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u<a;u++)i=n(e[u],u,r),i!=null&&(o[o.length]=i);else for(s in e)i=n(e[s],s,r),i!=null&&(o[o.length]=i);return o.concat.apply([],o)},guid:1,proxy:function(e,n){var r,i,s;return typeof n=="string"&&(r=e[n],n=e,e=r),v.isFunction(e)?(i=l.call(arguments,2),s=function(){return e.apply(n,i.concat(l.call(arguments)))},s.guid=e.guid=e.guid||v.guid++,s):t},access:function(e,n,r,i,s,o,u){var a,f=r==null,l=0,c=e.length;if(r&&typeof r=="object"){for(l in r)v.access(e,n,l,r[l],1,o,i);s=1}else if(i!==t){a=u===t&&v.isFunction(i),f&&(a?(a=n,n=function(e,t,n){return a.call(v(e),n)}):(n.call(e,i),n=null));if(n)for(;l<c;l++)n(e[l],r,a?i.call(e[l],l,n(e[l],r)):i,u);s=1}return s?e:f?n.call(e):c?n(e[0],r):o},now:function(){return(new Date).getTime()}}),v.ready.promise=function(t){if(!r){r=v.Deferred();if(i.readyState==="complete")setTimeout(v.ready,1);else if(i.addEventListener)i.addEventListener("DOMContentLoaded",A,!1),e.addEventListener("load",v.ready,!1);else{i.attachEvent("onreadystatechange",A),e.attachEvent("onload",v.ready);var n=!1;try{n=e.frameElement==null&&i.documentElement}catch(s){}n&&n.doScroll&&function o(){if(!v.isReady){try{n.doScroll("left")}catch(e){return setTimeout(o,50)}v.ready()}}()}}return r.promise(t)},v.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(e,t){O["[object "+t+"]"]=t.toLowerCase()}),n=v(i);var M={};v.Callbacks=function(e){e=typeof e=="string"?M[e]||_(e):v.extend({},e);var n,r,i,s,o,u,a=[],f=!e.once&&[],l=function(t){n=e.memory&&t,r=!0,u=s||0,s=0,o=a.length,i=!0;for(;a&&u<o;u++)if(a[u].apply(t[0],t[1])===!1&&e.stopOnFalse){n=!1;break}i=!1,a&&(f?f.length&&l(f.shift()):n?a=[]:c.disable())},c={add:function(){if(a){var t=a.length;(function r(t){v.each(t,function(t,n){var i=v.type(n);i==="function"?(!e.unique||!c.has(n))&&a.push(n):n&&n.length&&i!=="string"&&r(n)})})(arguments),i?o=a.length:n&&(s=t,l(n))}return this},remove:function(){return a&&v.each(arguments,function(e,t){var n;while((n=v.inArray(t,a,n))>-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t<r;t++)n[t]&&v.isFunction(n[t].promise)?n[t].promise().done(o(t,f,n)).fail(s.reject).progress(o(t,a,u)):--i}return i||s.resolveWith(f,n),s.promise()}}),v.support=function(){var t,n,r,s,o,u,a,f,l,c,h,p=i.createElement("div");p.setAttribute("className","t"),p.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="<table><tr><td></td><td>t</td></tr></table>",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="<div></div>",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i<s;i++)delete r[t[i]];if(!(n?B:v.isEmptyObject)(r))return}}if(!n){delete u[a].data;if(!B(u[a]))return}o?v.cleanData([e],!0):v.support.deleteExpando||u!=u.window?delete u[a]:u[a]=null},_data:function(e,t,n){return v.data(e,t,n,!0)},acceptData:function(e){var t=e.nodeName&&v.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),v.fn.extend({data:function(e,n){var r,i,s,o,u,a=this[0],f=0,l=null;if(e===t){if(this.length){l=v.data(a);if(a.nodeType===1&&!v._data(a,"parsedAttrs")){s=a.attributes;for(u=s.length;f<u;f++)o=s[f].name,o.indexOf("data-")||(o=v.camelCase(o.substring(5)),H(a,o,l[o]));v._data(a,"parsedAttrs",!0)}}return l}return typeof e=="object"?this.each(function(){v.data(this,e)}):(r=e.split(".",2),r[1]=r[1]?"."+r[1]:"",i=r[1]+"!",v.access(this,function(n){if(n===t)return l=this.triggerHandler("getData"+i,[r[0]]),l===t&&a&&(l=v.data(a,e),l=H(a,e,l)),l===t&&r[1]?this.data(r[0]):l;r[1]=n,this.each(function(){var t=v(this);t.triggerHandler("setData"+i,r),v.data(this,e,n),t.triggerHandler("changeData"+i,r)})},null,n,arguments.length>1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length<r?v.queue(this[0],e):n===t?this:this.each(function(){var t=v.queue(this,e,n);v._queueHooks(this,e),e==="fx"&&t[0]!=="inprogress"&&v.dequeue(this,e)})},dequeue:function(e){return this.each(function(){v.dequeue(this,e)})},delay:function(e,t){return e=v.fx?v.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,s=v.Deferred(),o=this,u=this.length,a=function(){--i||s.resolveWith(o,[o])};typeof e!="string"&&(n=e,e=t),e=e||"fx";while(u--)r=v._data(o[u],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(a));return a(),s.promise(n)}});var j,F,I,q=/[\t\r\n]/g,R=/\r/g,U=/^(?:button|input)$/i,z=/^(?:button|input|object|select|textarea)$/i,W=/^a(?:rea|)$/i,X=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,V=v.support.getSetAttribute;v.fn.extend({attr:function(e,t){return v.access(this,v.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n<r;n++){i=this[n];if(i.nodeType===1)if(!i.className&&t.length===1)i.className=e;else{s=" "+i.className+" ";for(o=0,u=t.length;o<u;o++)s.indexOf(" "+t[o]+" ")<0&&(s+=t[o]+" ");i.className=v.trim(s)}}}return this},removeClass:function(e){var n,r,i,s,o,u,a;if(v.isFunction(e))return this.each(function(t){v(this).removeClass(e.call(this,t,this.className))});if(e&&typeof e=="string"||e===t){n=(e||"").split(y);for(u=0,a=this.length;u<a;u++){i=this[u];if(i.nodeType===1&&i.className){r=(" "+i.className+" ").replace(q," ");for(s=0,o=n.length;s<o;s++)while(r.indexOf(" "+n[s]+" ")>=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n<r;n++)if(this[n].nodeType===1&&(" "+this[n].className+" ").replace(q," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a<u;a++){n=r[a];if((n.selected||a===i)&&(v.support.optDisabled?!n.disabled:n.getAttribute("disabled")===null)&&(!n.parentNode.disabled||!v.nodeName(n.parentNode,"optgroup"))){t=v(n).val();if(s)return t;o.push(t)}}return o},set:function(e,t){var n=v.makeArray(t);return v(e).find("option").each(function(){this.selected=v.inArray(v(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o<r.length;o++)i=r[o],i&&(n=v.propFix[i]||i,s=X.test(i),s||v.attr(e,i,""),e.removeAttribute(V?i:n),s&&n in e&&(e[n]=!1))}},attrHooks:{type:{set:function(e,t){if(U.test(e.nodeName)&&e.parentNode)v.error("type property can't be changed");else if(!v.support.radioValue&&t==="radio"&&v.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}},value:{get:function(e,t){return j&&v.nodeName(e,"button")?j.get(e,t):t in e?e.value:null},set:function(e,t,n){if(j&&v.nodeName(e,"button"))return j.set(e,t,n);e.value=t}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,s,o,u=e.nodeType;if(!e||u===3||u===8||u===2)return;return o=u!==1||!v.isXMLDoc(e),o&&(n=v.propFix[n]||n,s=v.propHooks[n]),r!==t?s&&"set"in s&&(i=s.set(e,r,n))!==t?i:e[n]=r:s&&"get"in s&&(i=s.get(e,n))!==null?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):z.test(e.nodeName)||W.test(e.nodeName)&&e.href?0:t}}}}),F={get:function(e,n){var r,i=v.prop(e,n);return i===!0||typeof i!="boolean"&&(r=e.getAttributeNode(n))&&r.nodeValue!==!1?n.toLowerCase():t},set:function(e,t,n){var r;return t===!1?v.removeAttr(e,n):(r=v.propFix[n]||n,r in e&&(e[r]=!0),e.setAttribute(n,n.toLowerCase())),n}},V||(I={name:!0,id:!0,coords:!0},j=v.valHooks.button={get:function(e,n){var r;return r=e.getAttributeNode(n),r&&(I[n]?r.value!=="":r.specified)?r.value:t},set:function(e,t,n){var r=e.getAttributeNode(n);return r||(r=i.createAttribute(n),e.setAttributeNode(r)),r.value=t+""}},v.each(["width","height"],function(e,t){v.attrHooks[t]=v.extend(v.attrHooks[t],{set:function(e,n){if(n==="")return e.setAttribute(t,"auto"),n}})}),v.attrHooks.contenteditable={get:j.get,set:function(e,t,n){t===""&&(t="false"),j.set(e,t,n)}}),v.support.hrefNormalized||v.each(["href","src","width","height"],function(e,n){v.attrHooks[n]=v.extend(v.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return r===null?t:r}})}),v.support.style||(v.attrHooks.style={get:function(e){return e.style.cssText.toLowerCase()||t},set:function(e,t){return e.style.cssText=t+""}}),v.support.optSelected||(v.propHooks.selected=v.extend(v.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),v.support.enctype||(v.propFix.enctype="encoding"),v.support.checkOn||v.each(["radio","checkbox"],function(){v.valHooks[this]={get:function(e){return e.getAttribute("value")===null?"on":e.value}}}),v.each(["radio","checkbox"],function(){v.valHooks[this]=v.extend(v.valHooks[this],{set:function(e,t){if(v.isArray(t))return e.checked=v.inArray(v(e).val(),t)>=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f<n.length;f++){l=J.exec(n[f])||[],c=l[1],h=(l[2]||"").split(".").sort(),g=v.event.special[c]||{},c=(s?g.delegateType:g.bindType)||c,g=v.event.special[c]||{},p=v.extend({type:c,origType:l[1],data:i,handler:r,guid:r.guid,selector:s,needsContext:s&&v.expr.match.needsContext.test(s),namespace:h.join(".")},d),m=a[c];if(!m){m=a[c]=[],m.delegateCount=0;if(!g.setup||g.setup.call(e,i,h,u)===!1)e.addEventListener?e.addEventListener(c,u,!1):e.attachEvent&&e.attachEvent("on"+c,u)}g.add&&(g.add.call(e,p),p.handler.guid||(p.handler.guid=r.guid)),s?m.splice(m.delegateCount++,0,p):m.push(p),v.event.global[c]=!0}e=null},global:{},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,m,g=v.hasData(e)&&v._data(e);if(!g||!(h=g.events))return;t=v.trim(Z(t||"")).split(" ");for(s=0;s<t.length;s++){o=J.exec(t[s])||[],u=a=o[1],f=o[2];if(!u){for(u in h)v.event.remove(e,u+t[s],n,r,!0);continue}p=v.event.special[u]||{},u=(r?p.delegateType:p.bindType)||u,d=h[u]||[],l=d.length,f=f?new RegExp("(^|\\.)"+f.split(".").sort().join("\\.(?:.*\\.|)")+"(\\.|$)"):null;for(c=0;c<d.length;c++)m=d[c],(i||a===m.origType)&&(!n||n.guid===m.guid)&&(!f||f.test(m.namespace))&&(!r||r===m.selector||r==="**"&&m.selector)&&(d.splice(c--,1),m.selector&&d.delegateCount--,p.remove&&p.remove.call(e,m));d.length===0&&l!==d.length&&((!p.teardown||p.teardown.call(e,f,g.handle)===!1)&&v.removeEvent(e,u,g.handle),delete h[u])}v.isEmptyObject(h)&&(delete g.handle,v.removeData(e,"events",!0))},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(n,r,s,o){if(!s||s.nodeType!==3&&s.nodeType!==8){var u,a,f,l,c,h,p,d,m,g,y=n.type||n,b=[];if(Y.test(y+v.event.triggered))return;y.indexOf("!")>=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f<m.length&&!n.isPropagationStopped();f++)l=m[f][0],n.type=m[f][1],d=(v._data(l,"events")||{})[n.type]&&v._data(l,"handle"),d&&d.apply(l,r),d=h&&l[h],d&&v.acceptData(l)&&d.apply&&d.apply(l,r)===!1&&n.preventDefault();return n.type=y,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(s.ownerDocument,r)===!1)&&(y!=="click"||!v.nodeName(s,"a"))&&v.acceptData(s)&&h&&s[y]&&(y!=="focus"&&y!=="blur"||n.target.offsetWidth!==0)&&!v.isWindow(s)&&(c=s[h],c&&(s[h]=null),v.event.triggered=y,s[y](),v.event.triggered=t,c&&(s[h]=c)),n.result}return},dispatch:function(n){n=v.event.fix(n||e.event);var r,i,s,o,u,a,f,c,h,p,d=(v._data(this,"events")||{})[n.type]||[],m=d.delegateCount,g=l.call(arguments),y=!n.exclusive&&!n.namespace,b=v.event.special[n.type]||{},w=[];g[0]=n,n.delegateTarget=this;if(b.preDispatch&&b.preDispatch.call(this,n)===!1)return;if(m&&(!n.button||n.type!=="click"))for(s=n.target;s!=this;s=s.parentNode||this)if(s.disabled!==!0||n.type!=="click"){u={},f=[];for(r=0;r<m;r++)c=d[r],h=c.selector,u[h]===t&&(u[h]=c.needsContext?v(h,this).index(s)>=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r<w.length&&!n.isPropagationStopped();r++){a=w[r],n.currentTarget=a.elem;for(i=0;i<a.matches.length&&!n.isImmediatePropagationStopped();i++){c=a.matches[i];if(y||!n.namespace&&!c.namespace||n.namespace_re&&n.namespace_re.test(c.namespace))n.data=c.data,n.handleObj=c,o=((v.event.special[c.origType]||{}).handle||c.handler).apply(a.elem,g),o!==t&&(n.result=o,o===!1&&(n.preventDefault(),n.stopPropagation()))}}return b.postDispatch&&b.postDispatch.call(this,n),n.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return e.which==null&&(e.which=t.charCode!=null?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,s,o,u=n.button,a=n.fromElement;return e.pageX==null&&n.clientX!=null&&(r=e.target.ownerDocument||i,s=r.documentElement,o=r.body,e.pageX=n.clientX+(s&&s.scrollLeft||o&&o.scrollLeft||0)-(s&&s.clientLeft||o&&o.clientLeft||0),e.pageY=n.clientY+(s&&s.scrollTop||o&&o.scrollTop||0)-(s&&s.clientTop||o&&o.clientTop||0)),!e.relatedTarget&&a&&(e.relatedTarget=a===e.target?n.toElement:a),!e.which&&u!==t&&(e.which=u&1?1:u&2?3:u&4?2:0),e}},fix:function(e){if(e[v.expando])return e;var t,n,r=e,s=v.event.fixHooks[e.type]||{},o=s.props?this.props.concat(s.props):this.props;e=v.Event(r);for(t=o.length;t;)n=o[--t],e[n]=r[n];return e.target||(e.target=r.srcElement||i),e.target.nodeType===3&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,r):e},special:{load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(e,t,n){v.isWindow(this)&&(this.onbeforeunload=n)},teardown:function(e,t){this.onbeforeunload===t&&(this.onbeforeunload=null)}}},simulate:function(e,t,n,r){var i=v.extend(new v.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?v.event.trigger(i,null,t):v.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},v.event.handle=v.event.dispatch,v.removeEvent=i.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]=="undefined"&&(e[r]=null),e.detachEvent(r,n))},v.Event=function(e,t){if(!(this instanceof v.Event))return new v.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?tt:et):this.type=e,t&&v.extend(this,t),this.timeStamp=e&&e.timeStamp||v.now(),this[v.expando]=!0},v.Event.prototype={preventDefault:function(){this.isDefaultPrevented=tt;var e=this.originalEvent;if(!e)return;e.preventDefault?e.preventDefault():e.returnValue=!1},stopPropagation:function(){this.isPropagationStopped=tt;var e=this.originalEvent;if(!e)return;e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=tt,this.stopPropagation()},isDefaultPrevented:et,isPropagationStopped:et,isImmediatePropagationStopped:et},v.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){v.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj,o=s.selector;if(!i||i!==r&&!v.contains(r,i))e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t;return n}}}),v.support.submitBubbles||(v.event.special.submit={setup:function(){if(v.nodeName(this,"form"))return!1;v.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=v.nodeName(n,"input")||v.nodeName(n,"button")?n.form:t;r&&!v._data(r,"_submit_attached")&&(v.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),v._data(r,"_submit_attached",!0))})},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&v.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){if(v.nodeName(this,"form"))return!1;v.event.remove(this,"._submit")}}),v.support.changeBubbles||(v.event.special.change={setup:function(){if($.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")v.event.add(this,"propertychange._change",function(e){e.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),v.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),v.event.simulate("change",this,e,!0)});return!1}v.event.add(this,"beforeactivate._change",function(e){var t=e.target;$.test(t.nodeName)&&!v._data(t,"_change_attached")&&(v.event.add(t,"change._change",function(e){this.parentNode&&!e.isSimulated&&!e.isTrigger&&v.event.simulate("change",this.parentNode,e,!0)}),v._data(t,"_change_attached",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||t.type!=="radio"&&t.type!=="checkbox")return e.handleObj.handler.apply(this,arguments)},teardown:function(){return v.event.remove(this,"._change"),!$.test(this.nodeName)}}),v.support.focusinBubbles||v.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){v.event.simulate(t,e.target,v.event.fix(e),!0)};v.event.special[t]={setup:function(){n++===0&&i.addEventListener(e,r,!0)},teardown:function(){--n===0&&i.removeEventListener(e,r,!0)}}}),v.fn.extend({on:function(e,n,r,i,s){var o,u;if(typeof e=="object"){typeof n!="string"&&(r=r||n,n=t);for(u in e)this.on(u,n,r,e[u],s);return this}r==null&&i==null?(i=n,r=n=t):i==null&&(typeof n=="string"?(i=r,r=t):(i=r,r=n,n=t));if(i===!1)i=et;else if(!i)return this;return s===1&&(o=i,i=function(e){return v().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=v.guid++)),this.each(function(){v.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,s;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,v(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if(typeof e=="object"){for(s in e)this.off(s,n,e[s]);return this}if(n===!1||typeof n=="function")r=n,n=t;return r===!1&&(r=et),this.each(function(){v.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},live:function(e,t,n){return v(this.context).on(e,this.selector,t,n),this},die:function(e,t){return v(this.context).off(e,this.selector||"**",t),this},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return arguments.length===1?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){v.event.trigger(e,t,this)})},triggerHandler:function(e,t){if(this[0])return v.event.trigger(e,t,this[0],!0)},toggle:function(e){var t=arguments,n=e.guid||v.guid++,r=0,i=function(n){var i=(v._data(this,"lastToggle"+e.guid)||0)%r;return v._data(this,"lastToggle"+e.guid,i+1),n.preventDefault(),t[i].apply(this,arguments)||!1};i.guid=n;while(r<t.length)t[r++].guid=n;return this.click(i)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),v.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){v.fn[t]=function(e,n){return n==null&&(n=e,e=null),arguments.length>0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u<a;u++)if(s=e[u])if(!n||n(s,r,i))o.push(s),f&&t.push(u);return o}function ct(e,t,n,r,i,s){return r&&!r[d]&&(r=ct(r)),i&&!i[d]&&(i=ct(i,s)),N(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||dt(t||"*",u.nodeType?[u]:u,[]),m=e&&(s||!t)?lt(v,h,e,u,a):v,g=n?i||(s?e:d||r)?[]:o:m;n&&n(m,g,u,a);if(r){f=lt(g,p),r(f,[],u,a),l=f.length;while(l--)if(c=f[l])g[p[l]]=!(m[p[l]]=c)}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?T.call(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a<s;a++)if(n=i.relative[e[a].type])h=[at(ft(h),n)];else{n=i.filter[e[a].type].apply(null,e[a].matches);if(n[d]){r=++a;for(;r<s;r++)if(i.relative[e[r].type])break;return ct(a>1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a<r&&ht(e.slice(a,r)),r<s&&ht(e=e.slice(r)),r<s&&e.join(""))}h.push(n)}return ft(h)}function pt(e,t){var r=t.length>0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r<i;r++)nt(e,t[r],n);return n}function vt(e,t,n,r,s){var o,u,f,l,c,h=ut(e),p=h.length;if(!r&&h.length===1){u=h[0]=h[0].slice(0);if(u.length>2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;t<n;t++)if(this[t]===e)return t;return-1},N=function(e,t){return e[d]=t==null||t,e},C=function(){var e={},t=[];return N(function(n,r){return t.push(n)>i.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="<a name='"+d+"'></a><div name='"+d+"'></div>",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:st(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:st(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},f=y.compareDocumentPosition?function(e,t){return e===t?(l=!0,0):(!e.compareDocumentPosition||!t.compareDocumentPosition?e.compareDocumentPosition:e.compareDocumentPosition(t)&4)?-1:1}:function(e,t){if(e===t)return l=!0,0;if(e.sourceIndex&&t.sourceIndex)return e.sourceIndex-t.sourceIndex;var n,r,i=[],s=[],o=e.parentNode,u=t.parentNode,a=o;if(o===u)return ot(e,t);if(!o)return-1;if(!u)return 1;while(a)i.unshift(a),a=a.parentNode;a=u;while(a)s.unshift(a),a=a.parentNode;n=i.length,r=s.length;for(var f=0;f<n&&f<r;f++)if(i[f]!==s[f])return ot(i[f],s[f]);return f===n?ot(e,s[f],-1):ot(i[f],t,1)},[0,0].sort(f),h=!l,nt.uniqueSort=function(e){var t,n=[],r=1,i=0;l=h,e.sort(f);if(l){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e},nt.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},a=nt.compile=function(e,t){var n,r=[],i=[],s=A[d][e+" "];if(!s){t||(t=ut(e)),n=t.length;while(n--)s=ht(t[n]),s[d]?r.push(s):i.push(s);s=A(e,pt(i,r))}return s},g.querySelectorAll&&function(){var e,t=vt,n=/'|\\/g,r=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,i=[":focus"],s=[":active"],u=y.matchesSelector||y.mozMatchesSelector||y.webkitMatchesSelector||y.oMatchesSelector||y.msMatchesSelector;K(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="<p test=''></p>",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="<input type='hidden'/>",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t<n;t++)if(v.contains(u[t],this))return!0});o=this.pushStack("","find",e);for(t=0,n=this.length;t<n;t++){r=o.length,v.find(e,this[t],o);if(t>0)for(i=r;i<o.length;i++)for(s=0;s<r;s++)if(o[s]===o[i]){o.splice(i--,1);break}}return o},has:function(e){var t,n=v(e,this),r=n.length;return this.filter(function(){for(t=0;t<r;t++)if(v.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1),"not",e)},filter:function(e){return this.pushStack(ft(this,e,!0),"filter",e)},is:function(e){return!!e&&(typeof e=="string"?st.test(e)?v(e,this.context).index(this[0])>=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r<i;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&n.nodeType!==11){if(o?o.index(n)>-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/<tbody/i,gt=/<|&#?\w+;/,yt=/<(?:script|style|link)/i,bt=/<(?:script|object|embed|option|style)/i,wt=new RegExp("<(?:"+ct+")[\\s/>]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,Nt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X<div>","</div>"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1></$2>");try{for(;r<i;r++)n=this[r]||{},n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),n.innerHTML=e);n=0}catch(s){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){return ut(this[0])?this.length?this.pushStack(v(v.isFunction(e)?e():e),"replaceWith",e):this:v.isFunction(e)?this.each(function(t){var n=v(this),r=n.html();n.replaceWith(e.call(this,t,r))}):(typeof e!="string"&&(e=v(e).detach()),this.each(function(){var t=this.nextSibling,n=this.parentNode;v(this).remove(),t?v(t).before(e):v(n).append(e)}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=[].concat.apply([],e);var i,s,o,u,a=0,f=e[0],l=[],c=this.length;if(!v.support.checkClone&&c>1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a<c;a++)r.call(n&&v.nodeName(this[a],"table")?Lt(this[a],"tbody"):this[a],a===u?o:v.clone(o,!0,!0))}o=s=null,l.length&&v.each(l,function(e,t){t.src?v.ajax?v.ajax({url:t.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):v.error("no ajax"):v.globalEval((t.text||t.textContent||t.innerHTML||"").replace(Tt,"")),t.parentNode&&t.parentNode.removeChild(t)})}return this}}),v.buildFragment=function(e,n,r){var s,o,u,a=e[0];return n=n||i,n=!n.nodeType&&n[0]||n,n=n.ownerDocument||n,e.length===1&&typeof a=="string"&&a.length<512&&n===i&&a.charAt(0)==="<"&&!bt.test(a)&&(v.support.checkClone||!St.test(a))&&(v.support.html5Clone||!wt.test(a))&&(o=!0,s=v.fragments[a],u=s!==t),s||(s=n.createDocumentFragment(),v.clean(e,n,s,r),o&&(v.fragments[a]=u&&s)),{fragment:s,cacheable:o}},v.fragments={},v.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){v.fn[e]=function(n){var r,i=0,s=[],o=v(n),u=o.length,a=this.length===1&&this[0].parentNode;if((a==null||a&&a.nodeType===11&&a.childNodes.length===1)&&u===1)return o[t](this[0]),this;for(;i<u;i++)r=(i>0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1></$2>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]==="<table>"&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("<div>").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r<i;r++)n=e[r],Vn[n]=Vn[n]||[],Vn[n].unshift(t)},prefilter:function(e,t){t?Xn.unshift(e):Xn.push(e)}}),v.Tween=Yn,Yn.prototype={constructor:Yn,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(v.cssNumber[n]?"":"px")},cur:function(){var e=Yn.propHooks[this.prop];return e&&e.get?e.get(this):Yn.propHooks._default.get(this)},run:function(e){var t,n=Yn.propHooks[this.prop];return this.options.duration?this.pos=t=v.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Yn.propHooks._default.set(this),this}},Yn.prototype.init.prototype=Yn.prototype,Yn.propHooks={_default:{get:function(e){var t;return e.elem[e.prop]==null||!!e.elem.style&&e.elem.style[e.prop]!=null?(t=v.css(e.elem,e.prop,!1,""),!t||t==="auto"?0:t):e.elem[e.prop]},set:function(e){v.fx.step[e.prop]?v.fx.step[e.prop](e):e.elem.style&&(e.elem.style[v.cssProps[e.prop]]!=null||v.cssHooks[e.prop])?v.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},Yn.propHooks.scrollTop=Yn.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},v.each(["toggle","show","hide"],function(e,t){var n=v.fn[t];v.fn[t]=function(r,i,s){return r==null||typeof r=="boolean"||!e&&v.isFunction(r)&&v.isFunction(i)?n.apply(this,arguments):this.animate(Zn(t,!0),r,i,s)}}),v.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Gt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=v.isEmptyObject(e),s=v.speed(t,n,r),o=function(){var t=Kn(this,v.extend({},e),s);i&&t.stop(!0)};return i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return typeof e!="string"&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=e!=null&&e+"queueHooks",s=v.timers,o=v._data(this);if(n)o[n]&&o[n].stop&&i(o[n]);else for(n in o)o[n]&&o[n].stop&&Wn.test(n)&&i(o[n]);for(n=s.length;n--;)s[n].elem===this&&(e==null||s[n].queue===e)&&(s[n].anim.stop(r),t=!1,s.splice(n,1));(t||!r)&&v.dequeue(this,e)})}}),v.each({slideDown:Zn("show"),slideUp:Zn("hide"),slideToggle:Zn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){v.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),v.speed=function(e,t,n){var r=e&&typeof e=="object"?v.extend({},e):{complete:n||!n&&t||v.isFunction(e)&&e,duration:e,easing:n&&t||t&&!v.isFunction(t)&&t};r.duration=v.fx.off?0:typeof r.duration=="number"?r.duration:r.duration in v.fx.speeds?v.fx.speeds[r.duration]:v.fx.speeds._default;if(r.queue==null||r.queue===!0)r.queue="fx";return r.old=r.complete,r.complete=function(){v.isFunction(r.old)&&r.old.call(this),r.queue&&v.dequeue(this,r.queue)},r},v.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},v.timers=[],v.fx=Yn.prototype.init,v.fx.tick=function(){var e,n=v.timers,r=0;qn=v.now();for(;r<n.length;r++)e=n[r],!e()&&n[r]===e&&n.splice(r--,1);n.length||v.fx.stop(),qn=t},v.fx.timer=function(e){e()&&v.timers.push(e)&&!Rn&&(Rn=setInterval(v.fx.tick,v.fx.interval))},v.fx.interval=13,v.fx.stop=function(){clearInterval(Rn),Rn=null},v.fx.speeds={slow:600,fast:200,_default:400},v.fx.step={},v.expr&&v.expr.filters&&(v.expr.filters.animated=function(e){return v.grep(v.timers,function(t){return e===t.elem}).length});var er=/^(?:body|html)$/i;v.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){v.offset.setOffset(this,e,t)});var n,r,i,s,o,u,a,f={top:0,left:0},l=this[0],c=l&&l.ownerDocument;if(!c)return;return(r=c.body)===l?v.offset.bodyOffset(l):(n=c.documentElement,v.contains(n,l)?(typeof l.getBoundingClientRect!="undefined"&&(f=l.getBoundingClientRect()),i=tr(c),s=n.clientTop||r.clientTop||0,o=n.clientLeft||r.clientLeft||0,u=i.pageYOffset||n.scrollTop,a=i.pageXOffset||n.scrollLeft,{top:f.top+u-s,left:f.left+a-o}):f)},v.offset={bodyOffset:function(e){var t=e.offsetTop,n=e.offsetLeft;return v.support.doesNotIncludeMarginInBodyOffset&&(t+=parseFloat(v.css(e,"marginTop"))||0,n+=parseFloat(v.css(e,"marginLeft"))||0),{top:t,left:n}},setOffset:function(e,t,n){var r=v.css(e,"position");r==="static"&&(e.style.position="relative");var i=v(e),s=i.offset(),o=v.css(e,"top"),u=v.css(e,"left"),a=(r==="absolute"||r==="fixed")&&v.inArray("auto",[o,u])>-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window);
+/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
+//@ sourceMappingURL=jquery-1.10.2.min.map
+*/
+(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav></:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t
+}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle);
+u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=un(e,t),Pt.detach()),Gt[e]=n),n}function un(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,n){x.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(x.css(e,"display"))?x.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x.support.opacity||(x.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=x.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===x.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,n){return n?x.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,n){x.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?x(e).position()[n]+"px":r):t}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!x.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||x.css(e,"display"))},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(x.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Ct.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),x.param=function(e,n){var r,i=[],o=function(e,t){t=x.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,yn,vn=x.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Cn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Nn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=x.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=o.href}catch(Ln){yn=a.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(T)||[];if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(l){var u;return o[l]=!0,x.each(e[l]||[],function(e,l){var c=l(n,r,i);return"string"!=typeof c||a||o[c]?a?!(u=c):t:(n.dataTypes.unshift(c),s(c),!1)}),u}return s(n.dataTypes[0])||!o["*"]&&s("*")}function _n(e,n){var r,i,o=x.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,l=e.indexOf(" ");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),x.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&x.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?x("<div>").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+" "+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(p){return{state:"parsererror",error:a?p:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function Zn(e,t,n){var r,i=(Qn[t]||[]).concat(Qn["*"]),o=0,a=i.length;for(;a>o;o++)if(r=i[o].call(n,t,e))return r}function er(e,t,n){var r,i,o=0,a=Gn.length,s=x.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;for(;l>a;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),1>o&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(tr(c,u.opts.specialEasing);a>o;o++)if(r=Gn[o].call(u,e,c,u.opts))return r;return x.map(c,Zn,u),x.isFunction(u.opts.start)&&u.opts.start.call(e,u),x.fx.timer(x.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function tr(e,t){var n,r,i,o,a;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=x.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,l,u=this,c={},p=e.style,f=e.nodeType&&nn(e),d=x._data(e,"fxshow");n.queue||(s=x._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,x.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(x.support.inlineBlockNeedsLayout&&"inline"!==ln(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",x.support.shrinkWrapBlocks||u.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Vn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show"))continue;c[r]=d&&d[r]||x.style(e,r)}if(!x.isEmptyObject(c)){d?"hidden"in d&&(f=d.hidden):d=x._data(e,"fxshow",{}),o&&(d.hidden=!f),f?x(e).show():u.done(function(){x(e).hide()}),u.done(function(){var t;x._removeData(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)a=Zn(f?d[r]:0,r,u),r in d||(d[r]=a.start,f&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=x._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},x.offset={setOffset:function(e,t,n){var r=x.css(e,"position");"static"===r&&(e.style.position="relative");var i=x(e),o=i.offset(),a=x.css(e,"top"),s=x.css(e,"left"),l=("absolute"===r||"fixed"===r)&&x.inArray("auto",[a,s])>-1,u={},c={},p,f;l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),"using"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===x.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(n=e.offset()),n.top+=x.css(e[0],"borderTopWidth",!0),n.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-x.css(r,"marginTop",!0),left:t.left-n.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return x.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}x.each({Height:"height",Width:"width"},function(e,n){x.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}))})(window);
 jQuery.noConflict();
index 214ca3696b2a8a10eb6c6c518349763472c358e6..ea5801ff2b820f44fca1eed89799414ab037198a 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/**
  * jQuery.query - Query String Modification and Creation for jQuery
  * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
  * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
index 7f46cbc643f4b1e070489082025d2762482a16e0..3060507ff8459f614853280b6d9b43b6836a15c2 100644 (file)
@@ -18,7 +18,7 @@
                var $input, $results, timeout, prevLength, cache, cacheSize;
 
                $input = $(input).attr("autocomplete", "off");
-               $results = $(document.createElement("ul"));
+               $results = $("<ul/>");
 
                timeout = false;                // hold timeout ID for suggestion results to appear
                prevLength = 0;                 // last recorded length of $input.val()
                        setTimeout(function() { $results.hide() }, 200);
                });
 
-
-               // help IE users if possible
-               if ( $.browser.msie ) {
-                       try {
-                               $results.bgiframe();
-                       } catch(e) { }
-               }
-
-               // I really hate browser detection, but I don't see any other way
-               if ($.browser.mozilla)
-                       $input.keypress(processKey);    // onkeypress repeats arrow keys in Mozilla/Opera
-               else
-                       $input.keydown(processKey);             // onkeydown repeats arrow keys in IE/Safari
-
-
-
+               $input.keydown(processKey);
 
                function resetPosition() {
                        // requires jquery.dimension plugin
 
        };
 
-})(jQuery);
\ No newline at end of file
+})(jQuery);
index 904936f3de5491ba8b484db8ea24adfb82257b30..d28a7fb26947402f3c53aff7c97eb7c3d9e28585 100644 (file)
@@ -1 +1 @@
-(function(a){a.suggest=function(o,g){var c,f,n,d,q,p;c=a(o).attr("autocomplete","off");f=a(document.createElement("ul"));n=false;d=0;q=[];p=0;f.addClass(g.resultsClass).appendTo("body");j();a(window).load(j).resize(j);c.blur(function(){setTimeout(function(){f.hide()},200)});if(a.browser.msie){try{f.bgiframe()}catch(s){}}if(a.browser.mozilla){c.keypress(m)}else{c.keydown(m)}function j(){var e=c.offset();f.css({top:(e.top+o.offsetHeight)+"px",left:e.left+"px"})}function m(w){if((/27$|38$|40$/.test(w.keyCode)&&f.is(":visible"))||(/^13$|^9$/.test(w.keyCode)&&u())){if(w.preventDefault){w.preventDefault()}if(w.stopPropagation){w.stopPropagation()}w.cancelBubble=true;w.returnValue=false;switch(w.keyCode){case 38:k();break;case 40:t();break;case 9:case 13:r();break;case 27:f.hide();break}}else{if(c.val().length!=d){if(n){clearTimeout(n)}n=setTimeout(l,g.delay);d=c.val().length}}}function l(){var x=a.trim(c.val()),w,e;if(g.multiple){w=x.lastIndexOf(g.multipleSep);if(w!=-1){x=a.trim(x.substr(w+g.multipleSep.length))}}if(x.length>=g.minchars){cached=v(x);if(cached){i(cached.items)}else{a.get(g.source,{q:x},function(y){f.hide();e=b(y,x);i(e);h(x,e,y.length)})}}else{f.hide()}}function v(w){var e;for(e=0;e<q.length;e++){if(q[e]["q"]==w){q.unshift(q.splice(e,1)[0]);return q[0]}}return false}function h(y,e,w){var x;while(q.length&&(p+w>g.maxCacheSize)){x=q.pop();p-=x.size}q.push({q:y,size:w,items:e});p+=w}function i(e){var x="",w;if(!e){return}if(!e.length){f.hide();return}j();for(w=0;w<e.length;w++){x+="<li>"+e[w]+"</li>"}f.html(x).show();f.children("li").mouseover(function(){f.children("li").removeClass(g.selectClass);a(this).addClass(g.selectClass)}).click(function(y){y.preventDefault();y.stopPropagation();r()})}function b(e,z){var w=[],A=e.split(g.delimiter),y,x;for(y=0;y<A.length;y++){x=a.trim(A[y]);if(x){x=x.replace(new RegExp(z,"ig"),function(B){return'<span class="'+g.matchClass+'">'+B+"</span>"});w[w.length]=x}}return w}function u(){var e;if(!f.is(":visible")){return false}e=f.children("li."+g.selectClass);if(!e.length){e=false}return e}function r(){$currentResult=u();if($currentResult){if(g.multiple){if(c.val().indexOf(g.multipleSep)!=-1){$currentVal=c.val().substr(0,(c.val().lastIndexOf(g.multipleSep)+g.multipleSep.length))}else{$currentVal=""}c.val($currentVal+$currentResult.text()+g.multipleSep);c.focus()}else{c.val($currentResult.text())}f.hide();if(g.onSelect){g.onSelect.apply(c[0])}}}function t(){$currentResult=u();if($currentResult){$currentResult.removeClass(g.selectClass).next().addClass(g.selectClass)}else{f.children("li:first-child").addClass(g.selectClass)}}function k(){var e=u();if(e){e.removeClass(g.selectClass).prev().addClass(g.selectClass)}else{f.children("li:last-child").addClass(g.selectClass)}}};a.fn.suggest=function(c,b){if(!c){return}b=b||{};b.multiple=b.multiple||false;b.multipleSep=b.multipleSep||", ";b.source=c;b.delay=b.delay||100;b.resultsClass=b.resultsClass||"ac_results";b.selectClass=b.selectClass||"ac_over";b.matchClass=b.matchClass||"ac_match";b.minchars=b.minchars||2;b.delimiter=b.delimiter||"\n";b.onSelect=b.onSelect||false;b.maxCacheSize=b.maxCacheSize||65536;this.each(function(){new a.suggest(this,b)});return this}})(jQuery);
\ No newline at end of file
+(function(a){a.suggest=function(n,f){var c,e,m,d,p,o;c=a(n).attr("autocomplete","off");e=a("<ul/>");m=false;d=0;p=[];o=0;e.addClass(f.resultsClass).appendTo("body");i();a(window).load(i).resize(i);c.blur(function(){setTimeout(function(){e.hide()},200)});c.keydown(l);function i(){var u=c.offset();e.css({top:(u.top+n.offsetHeight)+"px",left:u.left+"px"})}function l(u){if((/27$|38$|40$/.test(u.keyCode)&&e.is(":visible"))||(/^13$|^9$/.test(u.keyCode)&&s())){if(u.preventDefault){u.preventDefault()}if(u.stopPropagation){u.stopPropagation()}u.cancelBubble=true;u.returnValue=false;switch(u.keyCode){case 38:j();break;case 40:r();break;case 9:case 13:q();break;case 27:e.hide();break}}else{if(c.val().length!=d){if(m){clearTimeout(m)}m=setTimeout(k,f.delay);d=c.val().length}}}function k(){var w=a.trim(c.val()),v,u;if(f.multiple){v=w.lastIndexOf(f.multipleSep);if(v!=-1){w=a.trim(w.substr(v+f.multipleSep.length))}}if(w.length>=f.minchars){cached=t(w);if(cached){h(cached.items)}else{a.get(f.source,{q:w},function(x){e.hide();u=b(x,w);h(u);g(w,u,x.length)})}}else{e.hide()}}function t(v){var u;for(u=0;u<p.length;u++){if(p[u]["q"]==v){p.unshift(p.splice(u,1)[0]);return p[0]}}return false}function g(x,u,v){var w;while(p.length&&(o+v>f.maxCacheSize)){w=p.pop();o-=w.size}p.push({q:x,size:v,items:u});o+=v}function h(u){var w="",v;if(!u){return}if(!u.length){e.hide();return}i();for(v=0;v<u.length;v++){w+="<li>"+u[v]+"</li>"}e.html(w).show();e.children("li").mouseover(function(){e.children("li").removeClass(f.selectClass);a(this).addClass(f.selectClass)}).click(function(x){x.preventDefault();x.stopPropagation();q()})}function b(u,y){var v=[],z=u.split(f.delimiter),x,w;for(x=0;x<z.length;x++){w=a.trim(z[x]);if(w){w=w.replace(new RegExp(y,"ig"),function(A){return'<span class="'+f.matchClass+'">'+A+"</span>"});v[v.length]=w}}return v}function s(){var u;if(!e.is(":visible")){return false}u=e.children("li."+f.selectClass);if(!u.length){u=false}return u}function q(){$currentResult=s();if($currentResult){if(f.multiple){if(c.val().indexOf(f.multipleSep)!=-1){$currentVal=c.val().substr(0,(c.val().lastIndexOf(f.multipleSep)+f.multipleSep.length))}else{$currentVal=""}c.val($currentVal+$currentResult.text()+f.multipleSep);c.focus()}else{c.val($currentResult.text())}e.hide();if(f.onSelect){f.onSelect.apply(c[0])}}}function r(){$currentResult=s();if($currentResult){$currentResult.removeClass(f.selectClass).next().addClass(f.selectClass)}else{e.children("li:first-child").addClass(f.selectClass)}}function j(){var u=s();if(u){u.removeClass(f.selectClass).prev().addClass(f.selectClass)}else{e.children("li:last-child").addClass(f.selectClass)}}};a.fn.suggest=function(c,b){if(!c){return}b=b||{};b.multiple=b.multiple||false;b.multipleSep=b.multipleSep||", ";b.source=c;b.delay=b.delay||100;b.resultsClass=b.resultsClass||"ac_results";b.selectClass=b.selectClass||"ac_over";b.matchClass=b.matchClass||"ac_match";b.minchars=b.minchars||2;b.delimiter=b.delimiter||"\n";b.onSelect=b.onSelect||false;b.maxCacheSize=b.maxCacheSize||65536;this.each(function(){new a.suggest(this,b)});return this}})(jQuery);
\ No newline at end of file
index 1777b0afcb49f1e64acfd1275b00b8409c952b0b..d2e2d573ef5b5345632e3f0c054dc1a04bd0aabe 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.accordion.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){var n=0,r={},i={};r.height=r.paddingTop=r.paddingBottom=r.borderTopWidth=r.borderBottomWidth="hide",i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="show",e.widget("ui.accordion",{version:"1.9.2",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var t=this.accordionId="ui-accordion-"+(this.element.attr("id")||++n),r=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset"),this.headers=this.element.find(r.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this._hoverable(this.headers),this._focusable(this.headers),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").hide(),!r.collapsible&&(r.active===!1||r.active==null)&&(r.active=0),r.active<0&&(r.active+=this.headers.length),this.active=this._findActive(r.active).addClass("ui-accordion-header-active ui-state-active").toggleClass("ui-corner-all ui-corner-top"),this.active.next().addClass("ui-accordion-content-active").show(),this._createIcons(),this.refresh(),this.element.attr("role","tablist"),this.headers.attr("role","tab").each(function(n){var r=e(this),i=r.attr("id"),s=r.next(),o=s.attr("id");i||(i=t+"-header-"+n,r.attr("id",i)),o||(o=t+"-panel-"+n,s.attr("id",o)),r.attr("aria-controls",o),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._on(this.headers,{keydown:"_keydown"}),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._setupEvents(r.event)},_getCreateEventData:function(){return{header:this.active,content:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this.options.heightStyle!=="content"&&e.css("height","")},_setOption:function(e,t){if(e==="active"){this._activate(t);return}e==="event"&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),e==="collapsible"&&!t&&this.options.active===!1&&this._activate(0),e==="icons"&&(this._destroyIcons(),t&&this._createIcons()),e==="disabled"&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)},_keydown:function(t){if(t.altKey||t.ctrlKey)return;var n=e.ui.keyCode,r=this.headers.length,i=this.headers.index(t.target),s=!1;switch(t.keyCode){case n.RIGHT:case n.DOWN:s=this.headers[(i+1)%r];break;case n.LEFT:case n.UP:s=this.headers[(i-1+r)%r];break;case n.SPACE:case n.ENTER:this._eventHandler(t);break;case n.HOME:s=this.headers[0];break;case n.END:s=this.headers[r-1]}s&&(e(t.target).attr("tabIndex",-1),e(s).attr("tabIndex",0),s.focus(),t.preventDefault())},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t,n,r=this.options.heightStyle,i=this.element.parent();r==="fill"?(e.support.minHeight||(n=i.css("overflow"),i.css("overflow","hidden")),t=i.height(),this.element.siblings(":visible").each(function(){var n=e(this),r=n.css("position");if(r==="absolute"||r==="fixed")return;t-=n.outerHeight(!0)}),n&&i.css("overflow",n),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):r==="auto"&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var n=this._findActive(t)[0];if(n===this.active[0])return;n=n||this.active[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return typeof t=="number"?this.headers.eq(t):e()},_setupEvents:function(t){var n={};if(!t)return;e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._on(this.headers,n)},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i[0]===r[0],o=s&&n.collapsible,u=o?e():i.next(),a=r.next(),f={oldHeader:r,oldPanel:a,newHeader:o?e():i,newPanel:u};t.preventDefault();if(s&&!n.collapsible||this._trigger("beforeActivate",t,f)===!1)return;n.active=o?!1:this.headers.index(i),this.active=s?e():i,this._toggle(f),r.removeClass("ui-accordion-header-active ui-state-active"),n.icons&&r.children(".ui-accordion-header-icon").removeClass(n.icons.activeHeader).addClass(n.icons.header),s||(i.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),n.icons&&i.children(".ui-accordion-header-icon").removeClass(n.icons.header).addClass(n.icons.activeHeader),i.next().addClass("ui-accordion-content-active"))},_toggle:function(t){var n=t.newPanel,r=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=n,this.prevHide=r,this.options.animate?this._animate(n,r,t):(r.hide(),n.show(),this._toggleComplete(t)),r.attr({"aria-expanded":"false","aria-hidden":"true"}),r.prev().attr("aria-selected","false"),n.length&&r.length?r.prev().attr("tabIndex",-1):n.length&&this.headers.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),n.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(e,t,n){var s,o,u,a=this,f=0,l=e.length&&(!t.length||e.index()<t.index()),c=this.options.animate||{},h=l&&c.down||c,p=function(){a._toggleComplete(n)};typeof h=="number"&&(u=h),typeof h=="string"&&(o=h),o=o||h.easing||c.easing,u=u||h.duration||c.duration;if(!t.length)return e.animate(i,u,o,p);if(!e.length)return t.animate(r,u,o,p);s=e.show().outerHeight(),t.animate(r,{duration:u,easing:o,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(i,{duration:u,easing:o,complete:p,step:function(e,n){n.now=Math.round(e),n.prop!=="height"?f+=n.now:a.options.heightStyle!=="content"&&(n.now=Math.round(s-t.outerHeight()-f),f=0)}})},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.uiBackCompat!==!1&&(function(e,t){e.extend(t.options,{navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}});var n=t._create;t._create=function(){if(this.options.navigation){var t=this,r=this.element.find(this.options.header),i=r.next(),s=r.add(i).find("a").filter(this.options.navigationFilter)[0];s&&r.add(i).each(function(n){if(e.contains(this,s))return t.options.active=Math.floor(n/2),!1})}n.call(this)}}(jQuery,jQuery.ui.accordion.prototype),function(e,t){e.extend(t.options,{heightStyle:null,autoHeight:!0,clearStyle:!1,fillSpace:!1});var n=t._create,r=t._setOption;e.extend(t,{_create:function(){this.options.heightStyle=this.options.heightStyle||this._mergeHeightStyle(),n.call(this)},_setOption:function(e){if(e==="autoHeight"||e==="clearStyle"||e==="fillSpace")this.options.heightStyle=this._mergeHeightStyle();r.apply(this,arguments)},_mergeHeightStyle:function(){var e=this.options;if(e.fillSpace)return"fill";if(e.clearStyle)return"content";if(e.autoHeight)return"auto"}})}(jQuery,jQuery.ui.accordion.prototype),function(e,t){e.extend(t.options.icons,{activeHeader:null,headerSelected:"ui-icon-triangle-1-s"});var n=t._createIcons;t._createIcons=function(){this.options.icons&&(this.options.icons.activeHeader=this.options.icons.activeHeader||this.options.icons.headerSelected),n.call(this)}}(jQuery,jQuery.ui.accordion.prototype),function(e,t){t.activate=t._activate;var n=t._findActive;t._findActive=function(e){return e===-1&&(e=!1),e&&typeof e!="number"&&(e=this.headers.index(this.headers.filter(e)),e===-1&&(e=!1)),n.call(this,e)}}(jQuery,jQuery.ui.accordion.prototype),jQuery.ui.accordion.prototype.resize=jQuery.ui.accordion.prototype.refresh,function(e,t){e.extend(t.options,{change:null,changestart:null});var n=t._trigger;t._trigger=function(e,t,r){var i=n.apply(this,arguments);return i?(e==="beforeActivate"?i=n.call(this,"changestart",t,{oldHeader:r.oldHeader,oldContent:r.oldPanel,newHeader:r.newHeader,newContent:r.newPanel}):e==="activate"&&(i=n.call(this,"change",t,{oldHeader:r.oldHeader,oldContent:r.oldPanel,newHeader:r.newHeader,newContent:r.newPanel})),i):!1}}(jQuery,jQuery.ui.accordion.prototype),function(e,t){e.extend(t.options,{animate:null,animated:"slide"});var n=t._create;t._create=function(){var e=this.options;e.animate===null&&(e.animated?e.animated==="slide"?e.animate=300:e.animated==="bounceslide"?e.animate={duration:200,down:{easing:"easeOutBounce",duration:1e3}}:e.animate=e.animated:e.animate=!1),n.call(this)}}(jQuery,jQuery.ui.accordion.prototype))})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){var e=0,i={},s={};i.height=i.paddingTop=i.paddingBottom=i.borderTopWidth=i.borderBottomWidth="hide",s.height=s.paddingTop=s.paddingBottom=s.borderTopWidth=s.borderBottomWidth="show",t.widget("ui.accordion",{version:"1.10.3",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t(),content:this.active.length?this.active.next():t()}},_createIcons:function(){var e=this.options.icons;e&&(t("<span>").addClass("ui-accordion-header-icon ui-icon "+e.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(e.header).addClass(e.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?(this._activate(e),undefined):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),"disabled"===t&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!e),undefined)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),a=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:a=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[s-1]}a&&(t(e.target).attr("tabIndex",-1),t(a).attr("tabIndex",0),a.focus(),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().focus()},refresh:function(){var e=this.options;this._processPanels(),e.active===!1&&e.collapsible===!0||!this.headers.length?(e.active=!1,this.active=t()):e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var i,s=this.options,n=s.heightStyle,a=this.element.parent(),o=this.accordionId="ui-accordion-"+(this.element.attr("id")||++e);this.active=this._findActive(s.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(e){var i=t(this),s=i.attr("id"),n=i.next(),a=n.attr("id");s||(s=o+"-header-"+e,i.attr("id",s)),a||(a=o+"-panel-"+e,n.attr("id",a)),i.attr("aria-controls",a),n.attr("aria-labelledby",s)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(s.event),"fill"===n?(i=a.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.headers.each(function(){i-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===n&&(i=0,this.headers.next().each(function(){i=Math.max(i,t(this).css("height","").height())}).height(i))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n[0]===s[0],o=a&&i.collapsible,r=o?t():n.next(),h=s.next(),l={oldHeader:s,oldPanel:h,newHeader:o?t():n,newPanel:r};e.preventDefault(),a&&!i.collapsible||this._trigger("beforeActivate",e,l)===!1||(i.active=o?!1:this.headers.index(n),this.active=a?t():n,this._toggle(l),s.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&s.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(n.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),n.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-expanded":"false","aria-hidden":"true"}),s.prev().attr("aria-selected","false"),i.length&&s.length?s.prev().attr("tabIndex",-1):i.length&&this.headers.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(t,e,n){var a,o,r,h=this,l=0,c=t.length&&(!e.length||t.index()<e.index()),u=this.options.animate||{},d=c&&u.down||u,p=function(){h._toggleComplete(n)};return"number"==typeof d&&(r=d),"string"==typeof d&&(o=d),o=o||d.easing||u.easing,r=r||d.duration||u.duration,e.length?t.length?(a=t.show().outerHeight(),e.animate(i,{duration:r,easing:o,step:function(t,e){e.now=Math.round(t)}}),t.hide().animate(s,{duration:r,easing:o,complete:p,step:function(t,i){i.now=Math.round(t),"height"!==i.prop?l+=i.now:"content"!==h.options.heightStyle&&(i.now=Math.round(a-e.outerHeight()-l),l=0)}}),undefined):e.animate(i,r,o,p):t.animate(s,r,o,p)},_toggleComplete:function(t){var e=t.oldPanel;e.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}})})(jQuery);
\ No newline at end of file
index eab1ac644266406da43eb319f954c46b02fcff61..4081f8c7a6413abcd1e61ab4883711c3ed1f8d6c 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.autocomplete.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){var n=0;e.widget("ui.autocomplete",{version:"1.9.2",defaultElement:"<input>",options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var t,n,r;this.isMultiLine=this._isMultiLine(),this.valueMethod=this.element[this.element.is("input,textarea")?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(i){if(this.element.prop("readOnly")){t=!0,r=!0,n=!0;return}t=!1,r=!1,n=!1;var s=e.ui.keyCode;switch(i.keyCode){case s.PAGE_UP:t=!0,this._move("previousPage",i);break;case s.PAGE_DOWN:t=!0,this._move("nextPage",i);break;case s.UP:t=!0,this._keyEvent("previous",i);break;case s.DOWN:t=!0,this._keyEvent("next",i);break;case s.ENTER:case s.NUMPAD_ENTER:this.menu.active&&(t=!0,i.preventDefault(),this.menu.select(i));break;case s.TAB:this.menu.active&&this.menu.select(i);break;case s.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(i),i.preventDefault());break;default:n=!0,this._searchTimeout(i)}},keypress:function(r){if(t){t=!1,r.preventDefault();return}if(n)return;var i=e.ui.keyCode;switch(r.keyCode){case i.PAGE_UP:this._move("previousPage",r);break;case i.PAGE_DOWN:this._move("nextPage",r);break;case i.UP:this._keyEvent("previous",r);break;case i.DOWN:this._keyEvent("next",r)}},input:function(e){if(r){r=!1,e.preventDefault();return}this._searchTimeout(e)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}clearTimeout(this.searching),this.close(e),this._change(e)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete").appendTo(this.document.find(this.options.appendTo||"body")[0]).menu({input:e(),role:null}).zIndex(this.element.zIndex()+1).hide().data("menu"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var n=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(r){r.target!==t.element[0]&&r.target!==n&&!e.contains(n,r.target)&&t.close()})})},menufocus:function(t,n){if(this.isNewMenu){this.isNewMenu=!1;if(t.originalEvent&&/^mouse/.test(t.originalEvent.type)){this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)});return}}var r=n.item.data("ui-autocomplete-item")||n.item.data("item.autocomplete");!1!==this._trigger("focus",t,{item:r})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(r.value):this.liveRegion.text(r.value)},menuselect:function(e,t){var n=t.item.data("ui-autocomplete-item")||t.item.data("item.autocomplete"),r=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=r,this._delay(function(){this.previous=r,this.selectedItem=n})),!1!==this._trigger("select",e,{item:n})&&this._value(n.value),this.term=this._value(),this.close(e),this.selectedItem=n}}),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertAfter(this.element),e.fn.bgiframe&&this.menu.element.bgiframe(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),e==="source"&&this._initSource(),e==="appendTo"&&this.menu.element.appendTo(this.document.find(t||"body")[0]),e==="disabled"&&t&&this.xhr&&this.xhr.abort()},_isMultiLine:function(){return this.element.is("textarea")?!0:this.element.is("input")?!1:this.element.prop("isContentEditable")},_initSource:function(){var t,n,r=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(n,r){r(e.ui.autocomplete.filter(t,n.term))}):typeof this.options.source=="string"?(n=this.options.source,this.source=function(t,i){r.xhr&&r.xhr.abort(),r.xhr=e.ajax({url:n,data:t,dataType:"json",success:function(e){i(e)},error:function(){i([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){e=e!=null?e:this._value(),this.term=this._value();if(e.length<this.options.minLength)return this.close(t);if(this._trigger("search",t)===!1)return;return this._search(e)},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var e=this,t=++n;return function(r){t===n&&e.__response(r),e.pending--,e.pending||e.element.removeClass("ui-autocomplete-loading")}},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return typeof t=="string"?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var n=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(n,t),this.menu.refresh(),n.show(),this._resizeMenu(),n.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,n){var r=this;e.each(n,function(e,n){r._renderItemData(t,n)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,n){return e("<li>").append(e("<a>").text(n.label)).appendTo(t)},_move:function(e,t){if(!this.menu.element.is(":visible")){this.search(null,t);return}if(this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)){this._value(this.term),this.menu.blur();return}this.menu[e](t)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(e,t),t.preventDefault()}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,n){var r=new RegExp(e.ui.autocomplete.escapeRegex(n),"i");return e.grep(t,function(e){return r.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments);if(this.options.disabled||this.cancelSearch)return;e&&e.length?t=this.options.messages.results(e.length):t=this.options.messages.noResults,this.liveRegion.text(t)}})})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){var e=0;t.widget("ui.autocomplete",{version:"1.10.3",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var e,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,undefined;e=!1,s=!1,i=!1;var a=t.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:e=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case a.UP:e=!0,this._keyEvent("previous",n);break;case a.DOWN:e=!0,this._keyEvent("next",n);break;case a.ENTER:case a.NUMPAD_ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),undefined;if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){return s?(s=!1,t.preventDefault(),undefined):(this._searchTimeout(t),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(t),this._change(t),undefined)}}),this._initSource(),this.menu=t("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];t(e.target).closest(".ui-menu-item").length||this._delay(function(){var e=this;this.document.one("mousedown",function(s){s.target===e.element[0]||s.target===i||t.contains(i,s.target)||e.close()})})},menufocus:function(e,i){if(this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type)))return this.menu.blur(),this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)}),undefined;var s=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",e,{item:s})?e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=t("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e||(e=this.element.closest(".ui-front")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,i,s=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,s){s(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,n){s.xhr&&s.xhr.abort(),s.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){n(t)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):this._trigger("search",e)!==!1?this._search(t):undefined},_search:function(t){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var t=this,i=++e;return function(s){i===e&&t.__response(s),t.pending--,t.pending||t.element.removeClass("ui-autocomplete-loading")}},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({label:e.label||e.value,value:e.value||e.label},e)})},_suggest:function(e){var i=this.menu.element.empty();this._renderMenu(i,e),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var s=this;t.each(i,function(t,i){s._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<a>").text(i.label)).appendTo(e)},_move:function(t,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this._value(this.term),this.menu.blur(),undefined):(this.menu[t](e),undefined):(this.search(null,e),undefined)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(t,e),e.preventDefault())}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var s=RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return s.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.text(e))}})})(jQuery);
\ No newline at end of file
index 9a3c257934fd31b32021ed298713d1f1b1090940..d294ce05fbe8dd42699cc687be894c9fb8d560ec 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.button.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){var n,r,i,s,o="ui-button ui-widget ui-state-default ui-corner-all",u="ui-state-hover ui-state-active ",a="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",f=function(){var t=e(this).find(":ui-button");setTimeout(function(){t.button("refresh")},1)},l=function(t){var n=t.name,r=t.form,i=e([]);return n&&(r?i=e(r).find("[name='"+n+"']"):i=e("[name='"+n+"']",t.ownerDocument).filter(function(){return!this.form})),i};e.widget("ui.button",{version:"1.9.2",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,f),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,u=this.options,a=this.type==="checkbox"||this.type==="radio",c=a?"":"ui-state-active",h="ui-state-focus";u.label===null&&(u.label=this.type==="input"?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(o).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){if(u.disabled)return;this===n&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){if(u.disabled)return;e(this).removeClass(c)}).bind("click"+this.eventNamespace,function(e){u.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){t.buttonElement.addClass(h)}).bind("blur"+this.eventNamespace,function(){t.buttonElement.removeClass(h)}),a&&(this.element.bind("change"+this.eventNamespace,function(){if(s)return;t.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(e){if(u.disabled)return;s=!1,r=e.pageX,i=e.pageY}).bind("mouseup"+this.eventNamespace,function(e){if(u.disabled)return;if(r!==e.pageX||i!==e.pageY)s=!0})),this.type==="checkbox"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1;e(this).toggleClass("ui-state-active"),t.buttonElement.attr("aria-pressed",t.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click"+this.eventNamespace,function(){if(u.disabled||s)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var n=t.element[0];l(n).not(n).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).addClass("ui-state-active"),n=this,t.document.one("mouseup",function(){n=null})}).bind("mouseup"+this.eventNamespace,function(){if(u.disabled)return!1;e(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(t){if(u.disabled)return!1;(t.keyCode===e.ui.keyCode.SPACE||t.keyCode===e.ui.keyCode.ENTER)&&e(this).addClass("ui-state-active")}).bind("keyup"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",u.disabled),this._resetButton()},_determineButtonType:function(){var e,t,n;this.element.is("[type=checkbox]")?this.type="checkbox":this.element.is("[type=radio]")?this.type="radio":this.element.is("input")?this.type="input":this.type="button",this.type==="checkbox"||this.type==="radio"?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),n=this.element.is(":checked"),n&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",n)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(o+" "+u+" "+a).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){this._super(e,t);if(e==="disabled"){t?this.element.prop("disabled",!0):this.element.prop("disabled",!1);return}this._resetButton()},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),this.type==="radio"?l(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input"){this.options.label&&this.element.val(this.options.label);return}var t=this.buttonElement.removeClass(a),n=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),r=this.options.icons,i=r.primary&&r.secondary,s=[];r.primary||r.secondary?(this.options.text&&s.push("ui-button-text-icon"+(i?"s":r.primary?"-primary":"-secondary")),r.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+r.primary+"'></span>"),r.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+r.secondary+"'></span>"),this.options.text||(s.push(i?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(n)))):s.push("ui-button-text-only"),t.addClass(s.join(" "))}}),e.widget("ui.buttonset",{version:"1.9.2",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){e==="disabled"&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){var e,i,s,n,a="ui-button ui-widget ui-state-default ui-corner-all",o="ui-state-hover ui-state-active ",r="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",h=function(){var e=t(this);setTimeout(function(){e.find(":ui-button").button("refresh")},1)},l=function(e){var i=e.name,s=e.form,n=t([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?t(s).find("[name='"+i+"']"):t("[name='"+i+"']",e.ownerDocument).filter(function(){return!this.form})),n};t.widget("ui.button",{version:"1.10.3",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,h),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var o=this,r=this.options,c="checkbox"===this.type||"radio"===this.type,u=c?"":"ui-state-active",d="ui-state-focus";null===r.label&&(r.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(a).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){r.disabled||this===e&&t(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){r.disabled||t(this).removeClass(u)}).bind("click"+this.eventNamespace,function(t){r.disabled&&(t.preventDefault(),t.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){o.buttonElement.addClass(d)}).bind("blur"+this.eventNamespace,function(){o.buttonElement.removeClass(d)}),c&&(this.element.bind("change"+this.eventNamespace,function(){n||o.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(t){r.disabled||(n=!1,i=t.pageX,s=t.pageY)}).bind("mouseup"+this.eventNamespace,function(t){r.disabled||(i!==t.pageX||s!==t.pageY)&&(n=!0)})),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return r.disabled||n?!1:undefined}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(r.disabled||n)return!1;t(this).addClass("ui-state-active"),o.buttonElement.attr("aria-pressed","true");var e=o.element[0];l(e).not(e).map(function(){return t(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return r.disabled?!1:(t(this).addClass("ui-state-active"),e=this,o.document.one("mouseup",function(){e=null}),undefined)}).bind("mouseup"+this.eventNamespace,function(){return r.disabled?!1:(t(this).removeClass("ui-state-active"),undefined)}).bind("keydown"+this.eventNamespace,function(e){return r.disabled?!1:((e.keyCode===t.ui.keyCode.SPACE||e.keyCode===t.ui.keyCode.ENTER)&&t(this).addClass("ui-state-active"),undefined)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){t(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(e){e.keyCode===t.ui.keyCode.SPACE&&t(this).click()})),this._setOption("disabled",r.disabled),this._resetButton()},_determineButtonType:function(){var t,e,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(t=this.element.parents().last(),e="label[for='"+this.element.attr("id")+"']",this.buttonElement=t.find(e),this.buttonElement.length||(t=t.length?t.siblings():this.element.siblings(),this.buttonElement=t.filter(e),this.buttonElement.length||(this.buttonElement=t.find(e))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(a+" "+o+" "+r).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(t,e){return this._super(t,e),"disabled"===t?(e?this.element.prop("disabled",!0):this.element.prop("disabled",!1),undefined):(this._resetButton(),undefined)},refresh:function(){var e=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");e!==this.options.disabled&&this._setOption("disabled",e),"radio"===this.type?l(this.element[0]).each(function(){t(this).is(":checked")?t(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):t(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),undefined;var e=this.buttonElement.removeClass(r),i=t("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(e.empty()).text(),s=this.options.icons,n=s.primary&&s.secondary,a=[];s.primary||s.secondary?(this.options.text&&a.push("ui-button-text-icon"+(n?"s":s.primary?"-primary":"-secondary")),s.primary&&e.prepend("<span class='ui-button-icon-primary ui-icon "+s.primary+"'></span>"),s.secondary&&e.append("<span class='ui-button-icon-secondary ui-icon "+s.secondary+"'></span>"),this.options.text||(a.push(n?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||e.attr("title",t.trim(i)))):a.push("ui-button-text-only"),e.addClass(a.join(" "))}}),t.widget("ui.buttonset",{version:"1.10.3",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(t,e){"disabled"===t&&this.buttons.button("option",t,e),this._super(t,e)},refresh:function(){var e="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(e?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(e?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})})(jQuery);
\ No newline at end of file
index e23ab4c4c2dd7cea9812fd78bcaade6ea0357515..e96efd4ff81870d7203f19950011e0646d4a8c39 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.core.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){function i(t,n){var r,i,o,u=t.nodeName.toLowerCase();return"area"===u?(r=t.parentNode,i=r.name,!t.href||!i||r.nodeName.toLowerCase()!=="map"?!1:(o=e("img[usemap=#"+i+"]")[0],!!o&&s(o))):(/input|select|textarea|button|object/.test(u)?!t.disabled:"a"===u?t.href||n:n)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().andSelf().filter(function(){return e.css(this,"visibility")==="hidden"}).length}var n=0,r=/^ui-id-\d+$/;e.ui=e.ui||{};if(e.ui.version)return;e.extend(e.ui,{version:"1.9.2",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({_focus:e.fn.focus,focus:function(t,n){return typeof t=="number"?this.each(function(){var r=this;setTimeout(function(){e(r).focus(),n&&n.call(r)},t)}):this._focus.apply(this,arguments)},scrollParent:function(){var t;return e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?t=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):t=this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(n){if(n!==t)return this.css("zIndex",n);if(this.length){var r=e(this[0]),i,s;while(r.length&&r[0]!==document){i=r.css("position");if(i==="absolute"||i==="relative"||i==="fixed"){s=parseInt(r.css("zIndex"),10);if(!isNaN(s)&&s!==0)return s}r=r.parent()}}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){r.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),r=isNaN(n);return(r||n>=0)&&i(t,!r)}}),e(function(){var t=document.body,n=t.appendChild(n=document.createElement("div"));n.offsetHeight,e.extend(n.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),e.support.minHeight=n.offsetHeight===100,e.support.selectstart="onselectstart"in n,t.removeChild(n).style.display="none"}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(n,r){function u(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.css(t,"padding"+this))||0,r&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var i=r==="Width"?["Left","Right"]:["Top","Bottom"],s=r.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+r]=function(n){return n===t?o["inner"+r].call(this):this.each(function(){e(this).css(s,u(this,n)+"px")})},e.fn["outer"+r]=function(t,n){return typeof t!="number"?o["outer"+r].call(this,t):this.each(function(){e(this).css(s,u(this,t,!0,n)+"px")})}}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData)),function(){var t=/msie ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[];e.ui.ie=t.length?!0:!1,e.ui.ie6=parseFloat(t[1],10)===6}(),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n){var r,i=e.plugins[t];if(!i||!e.element[0].parentNode||e.element[0].parentNode.nodeType===11)return;for(r=0;r<i.length;r++)e.options[i[r][0]]&&i[r][1].apply(e.element,n)}},contains:e.contains,hasScroll:function(t,n){if(e(t).css("overflow")==="hidden")return!1;var r=n&&n==="left"?"scrollLeft":"scrollTop",i=!1;return t[r]>0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)},isOverAxis:function(e,t,n){return e>t&&e<t+n},isOver:function(t,n,r,i,s,o){return e.ui.isOverAxis(t,r,s)&&e.ui.isOverAxis(n,i,o)}})})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(e,t){function i(t,i){var a,n,r,o=t.nodeName.toLowerCase();return"area"===o?(a=t.parentNode,n=a.name,t.href&&n&&"map"===a.nodeName.toLowerCase()?(r=e("img[usemap=#"+n+"]")[0],!!r&&s(r)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:"a"===o?t.href||i:i)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var a=0,n=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var s,a,n=e(this[0]);n.length&&n[0]!==document;){if(s=n.css("position"),("absolute"===s||"relative"===s||"fixed"===s)&&(a=parseInt(n.css("zIndex"),10),!isNaN(a)&&0!==a))return a;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++a)})},removeUniqueId:function(){return this.each(function(){n.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var s=e.attr(t,"tabindex"),a=isNaN(s);return(a||s>=0)&&i(t,!a)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,s){function a(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===s?["Left","Right"]:["Top","Bottom"],r=s.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+s]=function(i){return i===t?o["inner"+s].call(this):this.each(function(){e(this).css(r,a(this,i)+"px")})},e.fn["outer"+s]=function(t,i){return"number"!=typeof t?o["outer"+s].call(this,t):this.each(function(){e(this).css(r,a(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,s){var a,n=e.ui[t].prototype;for(a in s)n.plugins[a]=n.plugins[a]||[],n.plugins[a].push([i,s[a]])},call:function(e,t,i){var s,a=e.plugins[t];if(a&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(s=0;a.length>s;s++)e.options[a[s][0]]&&a[s][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",a=!1;return t[s]>0?!0:(t[s]=1,a=t[s]>0,t[s]=0,a)}})})(jQuery);
\ No newline at end of file
index 79564b572c3e40d871bfd4015b831b19cbb7336f..bd4b62ed6eb709391a6fd9294007f18e1e337eca 100644 (file)
@@ -1,5 +1,5 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.datepicker.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function($,undefined){function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function bindHover(e){var t="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(t,"mouseout",function(){$(this).removeClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!=-1&&$(this).removeClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!=-1&&$(this).removeClass("ui-datepicker-next-hover")}).delegate(t,"mouseover",function(){$.datepicker._isDisabledDatepicker(instActive.inline?e.parent()[0]:instActive.input[0])||($(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),$(this).addClass("ui-state-hover"),this.className.indexOf("ui-datepicker-prev")!=-1&&$(this).addClass("ui-datepicker-prev-hover"),this.className.indexOf("ui-datepicker-next")!=-1&&$(this).addClass("ui-datepicker-next-hover"))})}function extendRemove(e,t){$.extend(e,t);for(var n in t)if(t[n]==null||t[n]==undefined)e[n]=t[n];return e}$.extend($.ui,{datepicker:{version:"1.9.2"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return extendRemove(this._defaults,e||{}),this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(e,t){var n=e[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:n,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:t,dpDiv:t?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(e,t){var n=$(e);t.append=$([]),t.trigger=$([]);if(n.hasClass(this.markerClassName))return;this._attachments(n,t),n.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,n,r){t.settings[n]=r}).bind("getData.datepicker",function(e,n){return this._get(t,n)}),this._autoSize(t),$.data(e,PROP_NAME,t),t.settings.disabled&&this._disableDatepicker(e)},_attachments:function(e,t){var n=this._get(t,"appendText"),r=this._get(t,"isRTL");t.append&&t.append.remove(),n&&(t.append=$('<span class="'+this._appendClass+'">'+n+"</span>"),e[r?"before":"after"](t.append)),e.unbind("focus",this._showDatepicker),t.trigger&&t.trigger.remove();var i=this._get(t,"showOn");(i=="focus"||i=="both")&&e.focus(this._showDatepicker);if(i=="button"||i=="both"){var s=this._get(t,"buttonText"),o=this._get(t,"buttonImage");t.trigger=$(this._get(t,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:o,alt:s,title:s}):$('<button type="button"></button>').addClass(this._triggerClass).html(o==""?s:$("<img/>").attr({src:o,alt:s,title:s}))),e[r?"before":"after"](t.trigger),t.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==e[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=e[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(e[0])):$.datepicker._showDatepicker(e[0]),!1})}},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t=new Date(2009,11,20),n=this._get(e,"dateFormat");if(n.match(/[DM]/)){var r=function(e){var t=0,n=0;for(var r=0;r<e.length;r++)e[r].length>t&&(t=e[r].length,n=r);return n};t.setMonth(r(this._get(e,n.match(/MM/)?"monthNames":"monthNamesShort"))),t.setDate(r(this._get(e,n.match(/DD/)?"dayNames":"dayNamesShort"))+20-t.getDay())}e.input.attr("size",this._formatDate(e,t).length)}},_inlineDatepicker:function(e,t){var n=$(e);if(n.hasClass(this.markerClassName))return;n.addClass(this.markerClassName).append(t.dpDiv).bind("setData.datepicker",function(e,n,r){t.settings[n]=r}).bind("getData.datepicker",function(e,n){return this._get(t,n)}),$.data(e,PROP_NAME,t),this._setDate(t,this._getDefaultDate(t),!0),this._updateDatepicker(t),this._updateAlternate(t),t.settings.disabled&&this._disableDatepicker(e),t.dpDiv.css("display","block")},_dialogDatepicker:function(e,t,n,r,i){var s=this._dialogInst;if(!s){this.uuid+=1;var o="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+o+'" style="position: absolute; top: -100px; width: 0px;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),s=this._dialogInst=this._newInst(this._dialogInput,!1),s.settings={},$.data(this._dialogInput[0],PROP_NAME,s)}extendRemove(s.settings,r||{}),t=t&&t.constructor==Date?this._formatDate(s,t):t,this._dialogInput.val(t),this._pos=i?i.length?i:[i.pageX,i.pageY]:null;if(!this._pos){var u=document.documentElement.clientWidth,a=document.documentElement.clientHeight,f=document.documentElement.scrollLeft||document.body.scrollLeft,l=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[u/2-100+f,a/2-150+l]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),s.settings.onSelect=n,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,s),this},_destroyDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();$.removeData(e,PROP_NAME),r=="input"?(n.append.remove(),n.trigger.remove(),t.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(r=="div"||r=="span")&&t.removeClass(this.markerClassName).empty()},_enableDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();if(r=="input")e.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(r=="div"||r=="span"){var i=t.children("."+this._inlineClass);i.children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)}this._disabledInputs=$.map(this._disabledInputs,function(t){return t==e?null:t})},_disableDatepicker:function(e){var t=$(e),n=$.data(e,PROP_NAME);if(!t.hasClass(this.markerClassName))return;var r=e.nodeName.toLowerCase();if(r=="input")e.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(r=="div"||r=="span"){var i=t.children("."+this._inlineClass);i.children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)}this._disabledInputs=$.map(this._disabledInputs,function(t){return t==e?null:t}),this._disabledInputs[this._disabledInputs.length]=e},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]==e)return!0;return!1},_getInst:function(e){try{return $.data(e,PROP_NAME)}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,t,n){var r=this._getInst(e);if(arguments.length==2&&typeof t=="string")return t=="defaults"?$.extend({},$.datepicker._defaults):r?t=="all"?$.extend({},r.settings):this._get(r,t):null;var i=t||{};typeof t=="string"&&(i={},i[t]=n);if(r){this._curInst==r&&this._hideDatepicker();var s=this._getDateDatepicker(e,!0),o=this._getMinMaxDate(r,"min"),u=this._getMinMaxDate(r,"max");extendRemove(r.settings,i),o!==null&&i.dateFormat!==undefined&&i.minDate===undefined&&(r.settings.minDate=this._formatDate(r,o)),u!==null&&i.dateFormat!==undefined&&i.maxDate===undefined&&(r.settings.maxDate=this._formatDate(r,u)),this._attachments($(e),r),this._autoSize(r),this._setDate(r,s),this._updateAlternate(r),this._updateDatepicker(r)}},_changeDatepicker:function(e,t,n){this._optionDatepicker(e,t,n)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var n=this._getInst(e);n&&(this._setDate(n,t),this._updateDatepicker(n),this._updateAlternate(n))},_getDateDatepicker:function(e,t){var n=this._getInst(e);return n&&!n.inline&&this._setDateFromField(n,t),n?this._getDate(n):null},_doKeyDown:function(e){var t=$.datepicker._getInst(e.target),n=!0,r=t.dpDiv.is(".ui-datepicker-rtl");t._keyEvent=!0;if($.datepicker._datepickerShowing)switch(e.keyCode){case 9:$.datepicker._hideDatepicker(),n=!1;break;case 13:var i=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",t.dpDiv);i[0]&&$.datepicker._selectDay(e.target,t.selectedMonth,t.selectedYear,i[0]);var s=$.datepicker._get(t,"onSelect");if(s){var o=$.datepicker._formatDate(t);s.apply(t.input?t.input[0]:null,[o,t])}else $.datepicker._hideDatepicker();return!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(e.target,e.ctrlKey?-$.datepicker._get(t,"stepBigMonths"):-$.datepicker._get(t,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(e.target,e.ctrlKey?+$.datepicker._get(t,"stepBigMonths"):+$.datepicker._get(t,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&$.datepicker._clearDate(e.target),n=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&$.datepicker._gotoToday(e.target),n=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,r?1:-1,"D"),n=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&$.datepicker._adjustDate(e.target,e.ctrlKey?-$.datepicker._get(t,"stepBigMonths"):-$.datepicker._get(t,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,-7,"D"),n=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,r?-1:1,"D"),n=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&$.datepicker._adjustDate(e.target,e.ctrlKey?+$.datepicker._get(t,"stepBigMonths"):+$.datepicker._get(t,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&$.datepicker._adjustDate(e.target,7,"D"),n=e.ctrlKey||e.metaKey;break;default:n=!1}else e.keyCode==36&&e.ctrlKey?$.datepicker._showDatepicker(this):n=!1;n&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var t=$.datepicker._getInst(e.target);if($.datepicker._get(t,"constrainInput")){var n=$.datepicker._possibleChars($.datepicker._get(t,"dateFormat")),r=String.fromCharCode(e.charCode==undefined?e.keyCode:e.charCode);return e.ctrlKey||e.metaKey||r<" "||!n||n.indexOf(r)>-1}},_doKeyUp:function(e){var t=$.datepicker._getInst(e.target);if(t.input.val()!=t.lastVal)try{var n=$.datepicker.parseDate($.datepicker._get(t,"dateFormat"),t.input?t.input.val():null,$.datepicker._getFormatConfig(t));n&&($.datepicker._setDateFromField(t),$.datepicker._updateAlternate(t),$.datepicker._updateDatepicker(t))}catch(r){$.datepicker.log(r)}return!0},_showDatepicker:function(e){e=e.target||e,e.nodeName.toLowerCase()!="input"&&(e=$("input",e.parentNode)[0]);if($.datepicker._isDisabledDatepicker(e)||$.datepicker._lastInput==e)return;var t=$.datepicker._getInst(e);$.datepicker._curInst&&$.datepicker._curInst!=t&&($.datepicker._curInst.dpDiv.stop(!0,!0),t&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var n=$.datepicker._get(t,"beforeShow"),r=n?n.apply(e,[e,t]):{};if(r===!1)return;extendRemove(t.settings,r),t.lastVal=null,$.datepicker._lastInput=e,$.datepicker._setDateFromField(t),$.datepicker._inDialog&&(e.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(e),$.datepicker._pos[1]+=e.offsetHeight);var i=!1;$(e).parents().each(function(){return i|=$(this).css("position")=="fixed",!i});var s={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,t.dpDiv.empty(),t.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(t),s=$.datepicker._checkOffset(t,s,i),t.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":i?"fixed":"absolute",display:"none",left:s.left+"px",top:s.top+"px"});if(!t.inline){var o=$.datepicker._get(t,"showAnim"),u=$.datepicker._get(t,"duration"),a=function(){var e=t.dpDiv.find("iframe.ui-datepicker-cover");if(!!e.length){var n=$.datepicker._getBorders(t.dpDiv);e.css({left:-n[0],top:-n[1],width:t.dpDiv.outerWidth(),height:t.dpDiv.outerHeight()})}};t.dpDiv.zIndex($(e).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&($.effects.effect[o]||$.effects[o])?t.dpDiv.show(o,$.datepicker._get(t,"showOptions"),u,a):t.dpDiv[o||"show"](o?u:null,a),(!o||!u)&&a(),t.input.is(":visible")&&!t.input.is(":disabled")&&t.input.focus(),$.datepicker._curInst=t}},_updateDatepicker:function(e){this.maxRows=4;var t=$.datepicker._getBorders(e.dpDiv);instActive=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var n=e.dpDiv.find("iframe.ui-datepicker-cover");!n.length||n.css({left:-t[0],top:-t[1],width:e.dpDiv.outerWidth(),height:e.dpDiv.outerHeight()}),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var r=this._getNumberOfMonths(e),i=r[1],s=17;e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),i>1&&e.dpDiv.addClass("ui-datepicker-multi-"+i).css("width",s*i+"em"),e.dpDiv[(r[0]!=1||r[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e==$.datepicker._curInst&&$.datepicker._datepickerShowing&&e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&e.input[0]!=document.activeElement&&e.input.focus();if(e.yearshtml){var o=e.yearshtml;setTimeout(function(){o===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),o=e.yearshtml=null},0)}},_getBorders:function(e){var t=function(e){return{thin:1,medium:2,thick:3}[e]||e};return[parseFloat(t(e.css("border-left-width"))),parseFloat(t(e.css("border-top-width")))]},_checkOffset:function(e,t,n){var r=e.dpDiv.outerWidth(),i=e.dpDiv.outerHeight(),s=e.input?e.input.outerWidth():0,o=e.input?e.input.outerHeight():0,u=document.documentElement.clientWidth+(n?0:$(document).scrollLeft()),a=document.documentElement.clientHeight+(n?0:$(document).scrollTop());return t.left-=this._get(e,"isRTL")?r-s:0,t.left-=n&&t.left==e.input.offset().left?$(document).scrollLeft():0,t.top-=n&&t.top==e.input.offset().top+o?$(document).scrollTop():0,t.left-=Math.min(t.left,t.left+r>u&&u>r?Math.abs(t.left+r-u):0),t.top-=Math.min(t.top,t.top+i>a&&a>i?Math.abs(i+o):0),t},_findPos:function(e){var t=this._getInst(e),n=this._get(t,"isRTL");while(e&&(e.type=="hidden"||e.nodeType!=1||$.expr.filters.hidden(e)))e=e[n?"previousSibling":"nextSibling"];var r=$(e).offset();return[r.left,r.top]},_hideDatepicker:function(e){var t=this._curInst;if(!t||e&&t!=$.data(e,PROP_NAME))return;if(this._datepickerShowing){var n=this._get(t,"showAnim"),r=this._get(t,"duration"),i=function(){$.datepicker._tidyDialog(t)};$.effects&&($.effects.effect[n]||$.effects[n])?t.dpDiv.hide(n,$.datepicker._get(t,"showOptions"),r,i):t.dpDiv[n=="slideDown"?"slideUp":n=="fadeIn"?"fadeOut":"hide"](n?r:null,i),n||i(),this._datepickerShowing=!1;var s=this._get(t,"onClose");s&&s.apply(t.input?t.input[0]:null,[t.input?t.input.val():"",t]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(!$.datepicker._curInst)return;var t=$(e.target),n=$.datepicker._getInst(t[0]);(t[0].id!=$.datepicker._mainDivId&&t.parents("#"+$.datepicker._mainDivId).length==0&&!t.hasClass($.datepicker.markerClassName)&&!t.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||t.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=n)&&$.datepicker._hideDatepicker()},_adjustDate:function(e,t,n){var r=$(e),i=this._getInst(r[0]);if(this._isDisabledDatepicker(r[0]))return;this._adjustInstDate(i,t+(n=="M"?this._get(i,"showCurrentAtPos"):0),n),this._updateDatepicker(i)},_gotoToday:function(e){var t=$(e),n=this._getInst(t[0]);if(this._get(n,"gotoCurrent")&&n.currentDay)n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear;else{var r=new Date;n.selectedDay=r.getDate(),n.drawMonth=n.selectedMonth=r.getMonth(),n.drawYear=n.selectedYear=r.getFullYear()}this._notifyChange(n),this._adjustDate(t)},_selectMonthYear:function(e,t,n){var r=$(e),i=this._getInst(r[0]);i["selected"+(n=="M"?"Month":"Year")]=i["draw"+(n=="M"?"Month":"Year")]=parseInt(t.options[t.selectedIndex].value,10),this._notifyChange(i),this._adjustDate(r)},_selectDay:function(e,t,n,r){var i=$(e);if($(r).hasClass(this._unselectableClass)||this._isDisabledDatepicker(i[0]))return;var s=this._getInst(i[0]);s.selectedDay=s.currentDay=$("a",r).html(),s.selectedMonth=s.currentMonth=t,s.selectedYear=s.currentYear=n,this._selectDate(e,this._formatDate(s,s.currentDay,s.currentMonth,s.currentYear))},_clearDate:function(e){var t=$(e),n=this._getInst(t[0]);this._selectDate(t,"")},_selectDate:function(e,t){var n=$(e),r=this._getInst(n[0]);t=t!=null?t:this._formatDate(r),r.input&&r.input.val(t),this._updateAlternate(r);var i=this._get(r,"onSelect");i?i.apply(r.input?r.input[0]:null,[t,r]):r.input&&r.input.trigger("change"),r.inline?this._updateDatepicker(r):(this._hideDatepicker(),this._lastInput=r.input[0],typeof r.input[0]!="object"&&r.input.focus(),this._lastInput=null)},_updateAlternate:function(e){var t=this._get(e,"altField");if(t){var n=this._get(e,"altFormat")||this._get(e,"dateFormat"),r=this._getDate(e),i=this.formatDate(n,r,this._getFormatConfig(e));$(t).each(function(){$(this).val(i)})}},noWeekends:function(e){var t=e.getDay();return[t>0&&t<6,""]},iso8601Week:function(e){var t=new Date(e.getTime());t.setDate(t.getDate()+4-(t.getDay()||7));var n=t.getTime();return t.setMonth(0),t.setDate(1),Math.floor(Math.round((n-t)/864e5)/7)+1},parseDate:function(e,t,n){if(e==null||t==null)throw"Invalid arguments";t=typeof t=="object"?t.toString():t+"";if(t=="")return null;var r=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff;r=typeof r!="string"?r:(new Date).getFullYear()%100+parseInt(r,10);var i=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,s=(n?n.dayNames:null)||this._defaults.dayNames,o=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,u=(n?n.monthNames:null)||this._defaults.monthNames,a=-1,f=-1,l=-1,c=-1,h=!1,p=function(t){var n=y+1<e.length&&e.charAt(y+1)==t;return n&&y++,n},d=function(e){var n=p(e),r=e=="@"?14:e=="!"?20:e=="y"&&n?4:e=="o"?3:2,i=new RegExp("^\\d{1,"+r+"}"),s=t.substring(g).match(i);if(!s)throw"Missing number at position "+g;return g+=s[0].length,parseInt(s[0],10)},v=function(e,n,r){var i=$.map(p(e)?r:n,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)}),s=-1;$.each(i,function(e,n){var r=n[1];if(t.substr(g,r.length).toLowerCase()==r.toLowerCase())return s=n[0],g+=r.length,!1});if(s!=-1)return s+1;throw"Unknown name at position "+g},m=function(){if(t.charAt(g)!=e.charAt(y))throw"Unexpected literal at position "+g;g++},g=0;for(var y=0;y<e.length;y++)if(h)e.charAt(y)=="'"&&!p("'")?h=!1:m();else switch(e.charAt(y)){case"d":l=d("d");break;case"D":v("D",i,s);break;case"o":c=d("o");break;case"m":f=d("m");break;case"M":f=v("M",o,u);break;case"y":a=d("y");break;case"@":var b=new Date(d("@"));a=b.getFullYear(),f=b.getMonth()+1,l=b.getDate();break;case"!":var b=new Date((d("!")-this._ticksTo1970)/1e4);a=b.getFullYear(),f=b.getMonth()+1,l=b.getDate();break;case"'":p("'")?m():h=!0;break;default:m()}if(g<t.length){var w=t.substr(g);if(!/^\s+/.test(w))throw"Extra/unparsed characters found in date: "+w}a==-1?a=(new Date).getFullYear():a<100&&(a+=(new Date).getFullYear()-(new Date).getFullYear()%100+(a<=r?0:-100));if(c>-1){f=1,l=c;do{var E=this._getDaysInMonth(a,f-1);if(l<=E)break;f++,l-=E}while(!0)}var b=this._daylightSavingAdjust(new Date(a,f-1,l));if(b.getFullYear()!=a||b.getMonth()+1!=f||b.getDate()!=l)throw"Invalid date";return b},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(e,t,n){if(!t)return"";var r=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,i=(n?n.dayNames:null)||this._defaults.dayNames,s=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,o=(n?n.monthNames:null)||this._defaults.monthNames,u=function(t){var n=h+1<e.length&&e.charAt(h+1)==t;return n&&h++,n},a=function(e,t,n){var r=""+t;if(u(e))while(r.length<n)r="0"+r;return r},f=function(e,t,n,r){return u(e)?r[t]:n[t]},l="",c=!1;if(t)for(var h=0;h<e.length;h++)if(c)e.charAt(h)=="'"&&!u("'")?c=!1:l+=e.charAt(h);else switch(e.charAt(h)){case"d":l+=a("d",t.getDate(),2);break;case"D":l+=f("D",t.getDay(),r,i);break;case"o":l+=a("o",Math.round(((new Date(t.getFullYear(),t.getMonth(),t.getDate())).getTime()-(new Date(t.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":l+=a("m",t.getMonth()+1,2);break;case"M":l+=f("M",t.getMonth(),s,o);break;case"y":l+=u("y")?t.getFullYear():(t.getYear()%100<10?"0":"")+t.getYear()%100;break;case"@":l+=t.getTime();break;case"!":l+=t.getTime()*1e4+this._ticksTo1970;break;case"'":u("'")?l+="'":c=!0;break;default:l+=e.charAt(h)}return l},_possibleChars:function(e){var t="",n=!1,r=function(t){var n=i+1<e.length&&e.charAt(i+1)==t;return n&&i++,n};for(var i=0;i<e.length;i++)if(n)e.charAt(i)=="'"&&!r("'")?n=!1:t+=e.charAt(i);else switch(e.charAt(i)){case"d":case"m":case"y":case"@":t+="0123456789";break;case"D":case"M":return null;case"'":r("'")?t+="'":n=!0;break;default:t+=e.charAt(i)}return t},_get:function(e,t){return e.settings[t]!==undefined?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()==e.lastVal)return;var n=this._get(e,"dateFormat"),r=e.lastVal=e.input?e.input.val():null,i,s;i=s=this._getDefaultDate(e);var o=this._getFormatConfig(e);try{i=this.parseDate(n,r,o)||s}catch(u){this.log(u),r=t?"":r}e.selectedDay=i.getDate(),e.drawMonth=e.selectedMonth=i.getMonth(),e.drawYear=e.selectedYear=i.getFullYear(),e.currentDay=r?i.getDate():0,e.currentMonth=r?i.getMonth():0,e.currentYear=r?i.getFullYear():0,this._adjustInstDate(e)},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(e,t,n){var r=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},i=function(t){try{return $.datepicker.parseDate($.datepicker._get(e,"dateFormat"),t,$.datepicker._getFormatConfig(e))}catch(n){}var r=(t.toLowerCase().match(/^c/)?$.datepicker._getDate(e):null)||new Date,i=r.getFullYear(),s=r.getMonth(),o=r.getDate(),u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,a=u.exec(t);while(a){switch(a[2]||"d"){case"d":case"D":o+=parseInt(a[1],10);break;case"w":case"W":o+=parseInt(a[1],10)*7;break;case"m":case"M":s+=parseInt(a[1],10),o=Math.min(o,$.datepicker._getDaysInMonth(i,s));break;case"y":case"Y":i+=parseInt(a[1],10),o=Math.min(o,$.datepicker._getDaysInMonth(i,s))}a=u.exec(t)}return new Date(i,s,o)},s=t==null||t===""?n:typeof t=="string"?i(t):typeof t=="number"?isNaN(t)?n:r(t):new Date(t.getTime());return s=s&&s.toString()=="Invalid Date"?n:s,s&&(s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0)),this._daylightSavingAdjust(s)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,n){var r=!t,i=e.selectedMonth,s=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),(i!=e.selectedMonth||s!=e.selectedYear)&&!n&&this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(r?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&e.input.val()==""?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(e){var t=this._get(e,"stepMonths"),n="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(n,-t,"M")},next:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(n,+t,"M")},hide:function(){window["DP_jQuery_"+dpuuid].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+dpuuid].datepicker._gotoToday(n)},selectDay:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectDay(n,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(n,this,"M"),!1},selectYear:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(n,this,"Y"),!1}};$(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t=new Date;t=this._daylightSavingAdjust(new Date(t.getFullYear(),t.getMonth(),t.getDate()));var n=this._get(e,"isRTL"),r=this._get(e,"showButtonPanel"),i=this._get(e,"hideIfNoPrevNext"),s=this._get(e,"navigationAsDateFormat"),o=this._getNumberOfMonths(e),u=this._get(e,"showCurrentAtPos"),a=this._get(e,"stepMonths"),f=o[0]!=1||o[1]!=1,l=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),c=this._getMinMaxDate(e,"min"),h=this._getMinMaxDate(e,"max"),p=e.drawMonth-u,d=e.drawYear;p<0&&(p+=12,d--);if(h){var v=this._daylightSavingAdjust(new Date(h.getFullYear(),h.getMonth()-o[0]*o[1]+1,h.getDate()));v=c&&v<c?c:v;while(this._daylightSavingAdjust(new Date(d,p,1))>v)p--,p<0&&(p=11,d--)}e.drawMonth=p,e.drawYear=d;var m=this._get(e,"prevText");m=s?this.formatDate(m,this._daylightSavingAdjust(new Date(d,p-a,1)),this._getFormatConfig(e)):m;var g=this._canAdjustMonth(e,-1,d,p)?'<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click" title="'+m+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"e":"w")+'">'+m+"</span></a>":i?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+m+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"e":"w")+'">'+m+"</span></a>",y=this._get(e,"nextText");y=s?this.formatDate(y,this._daylightSavingAdjust(new Date(d,p+a,1)),this._getFormatConfig(e)):y;var b=this._canAdjustMonth(e,1,d,p)?'<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click" title="'+y+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"w":"e")+'">'+y+"</span></a>":i?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+y+'"><span class="ui-icon ui-icon-circle-triangle-'+(n?"w":"e")+'">'+y+"</span></a>",w=this._get(e,"currentText"),E=this._get(e,"gotoCurrent")&&e.currentDay?l:t;w=s?this.formatDate(w,E,this._getFormatConfig(e)):w;var S=e.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">'+this._get(e,"closeText")+"</button>",x=r?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(n?S:"")+(this._isInRange(e,E)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click">'+w+"</button>":"")+(n?"":S)+"</div>":"",T=parseInt(this._get(e,"firstDay"),10);T=isNaN(T)?0:T;var N=this._get(e,"showWeek"),C=this._get(e,"dayNames"),k=this._get(e,"dayNamesShort"),L=this._get(e,"dayNamesMin"),A=this._get(e,"monthNames"),O=this._get(e,"monthNamesShort"),M=this._get(e,"beforeShowDay"),_=this._get(e,"showOtherMonths"),D=this._get(e,"selectOtherMonths"),P=this._get(e,"calculateWeek")||this.iso8601Week,H=this._getDefaultDate(e),B="";for(var j=0;j<o[0];j++){var F="";this.maxRows=4;for(var I=0;I<o[1];I++){var q=this._daylightSavingAdjust(new Date(d,p,e.selectedDay)),R=" ui-corner-all",U="";if(f){U+='<div class="ui-datepicker-group';if(o[1]>1)switch(I){case 0:U+=" ui-datepicker-group-first",R=" ui-corner-"+(n?"right":"left");break;case o[1]-1:U+=" ui-datepicker-group-last",R=" ui-corner-"+(n?"left":"right");break;default:U+=" ui-datepicker-group-middle",R=""}U+='">'}U+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+R+'">'+(/all|left/.test(R)&&j==0?n?b:g:"")+(/all|right/.test(R)&&j==0?n?g:b:"")+this._generateMonthYearHeader(e,p,d,c,h,j>0||I>0,A,O)+'</div><table class="ui-datepicker-calendar"><thead>'+"<tr>";var z=N?'<th class="ui-datepicker-week-col">'+this._get(e,"weekHeader")+"</th>":"";for(var W=0;W<7;W++){var X=(W+T)%7;z+="<th"+((W+T+6)%7>=5?' class="ui-datepicker-week-end"':"")+">"+'<span title="'+C[X]+'">'+L[X]+"</span></th>"}U+=z+"</tr></thead><tbody>";var V=this._getDaysInMonth(d,p);d==e.selectedYear&&p==e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,V));var J=(this._getFirstDayOfMonth(d,p)-T+7)%7,K=Math.ceil((J+V)/7),Q=f?this.maxRows>K?this.maxRows:K:K;this.maxRows=Q;var G=this._daylightSavingAdjust(new Date(d,p,1-J));for(var Y=0;Y<Q;Y++){U+="<tr>";var Z=N?'<td class="ui-datepicker-week-col">'+this._get(e,"calculateWeek")(G)+"</td>":"";for(var W=0;W<7;W++){var et=M?M.apply(e.input?e.input[0]:null,[G]):[!0,""],tt=G.getMonth()!=p,nt=tt&&!D||!et[0]||c&&G<c||h&&G>h;Z+='<td class="'+((W+T+6)%7>=5?" ui-datepicker-week-end":"")+(tt?" ui-datepicker-other-month":"")+(G.getTime()==q.getTime()&&p==e.selectedMonth&&e._keyEvent||H.getTime()==G.getTime()&&H.getTime()==q.getTime()?" "+this._dayOverClass:"")+(nt?" "+this._unselectableClass+" ui-state-disabled":"")+(tt&&!_?"":" "+et[1]+(G.getTime()==l.getTime()?" "+this._currentClass:"")+(G.getTime()==t.getTime()?" ui-datepicker-today":""))+'"'+((!tt||_)&&et[2]?' title="'+et[2]+'"':"")+(nt?"":' data-handler="selectDay" data-event="click" data-month="'+G.getMonth()+'" data-year="'+G.getFullYear()+'"')+">"+(tt&&!_?"&#xa0;":nt?'<span class="ui-state-default">'+G.getDate()+"</span>":'<a class="ui-state-default'+(G.getTime()==t.getTime()?" ui-state-highlight":"")+(G.getTime()==l.getTime()?" ui-state-active":"")+(tt?" ui-priority-secondary":"")+'" href="#">'+G.getDate()+"</a>")+"</td>",G.setDate(G.getDate()+1),G=this._daylightSavingAdjust(G)}U+=Z+"</tr>"}p++,p>11&&(p=0,d++),U+="</tbody></table>"+(f?"</div>"+(o[0]>0&&I==o[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),F+=U}B+=F}return B+=x+($.ui.ie6&&!e.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),e._keyEvent=!1,B},_generateMonthYearHeader:function(e,t,n,r,i,s,o,u){var a=this._get(e,"changeMonth"),f=this._get(e,"changeYear"),l=this._get(e,"showMonthAfterYear"),c='<div class="ui-datepicker-title">',h="";if(s||!a)h+='<span class="ui-datepicker-month">'+o[t]+"</span>";else{var p=r&&r.getFullYear()==n,d=i&&i.getFullYear()==n;h+='<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">';for(var v=0;v<12;v++)(!p||v>=r.getMonth())&&(!d||v<=i.getMonth())&&(h+='<option value="'+v+'"'+(v==t?' selected="selected"':"")+">"+u[v]+"</option>");h+="</select>"}l||(c+=h+(s||!a||!f?"&#xa0;":""));if(!e.yearshtml){e.yearshtml="";if(s||!f)c+='<span class="ui-datepicker-year">'+n+"</span>";else{var m=this._get(e,"yearRange").split(":"),g=(new Date).getFullYear(),y=function(e){var t=e.match(/c[+-].*/)?n+parseInt(e.substring(1),10):e.match(/[+-].*/)?g+parseInt(e,10):parseInt(e,10);return isNaN(t)?g:t},b=y(m[0]),w=Math.max(b,y(m[1]||""));b=r?Math.max(b,r.getFullYear()):b,w=i?Math.min(w,i.getFullYear()):w,e.yearshtml+='<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">';for(;b<=w;b++)e.yearshtml+='<option value="'+b+'"'+(b==n?' selected="selected"':"")+">"+b+"</option>";e.yearshtml+="</select>",c+=e.yearshtml,e.yearshtml=null}}return c+=this._get(e,"yearSuffix"),l&&(c+=(s||!a||!f?"&#xa0;":"")+h),c+="</div>",c},_adjustInstDate:function(e,t,n){var r=e.drawYear+(n=="Y"?t:0),i=e.drawMonth+(n=="M"?t:0),s=Math.min(e.selectedDay,this._getDaysInMonth(r,i))+(n=="D"?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(r,i,s)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),(n=="M"||n=="Y")&&this._notifyChange(e)},_restrictMinMax:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max"),i=n&&t<n?n:t;return i=r&&i>r?r:i,i},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return t==null?[1,1]:typeof t=="number"?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return(new Date(e,t,1)).getDay()},_canAdjustMonth:function(e,t,n,r){var i=this._getNumberOfMonths(e),s=this._daylightSavingAdjust(new Date(n,r+(t<0?t:i[0]*i[1]),1));return t<0&&s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth())),this._isInRange(e,s)},_isInRange:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max");return(!n||t.getTime()>=n.getTime())&&(!r||t.getTime()<=r.getTime())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t=typeof t!="string"?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,n,r){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var i=t?typeof t=="object"?t:this._daylightSavingAdjust(new Date(r,n,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),i,this._getFormatConfig(e))}}),$.fn.datepicker=function(e){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find(document.body).append($.datepicker.dpDiv),$.datepicker.initialized=!0);var t=Array.prototype.slice.call(arguments,1);return typeof e!="string"||e!="isDisabled"&&e!="getDate"&&e!="widget"?e=="option"&&arguments.length==2&&typeof arguments[1]=="string"?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t)):this.each(function(){typeof e=="string"?$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this].concat(t)):$.datepicker._attachDatepicker(this,e)}):$.datepicker["_"+e+"Datepicker"].apply($.datepicker,[this[0]].concat(t))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.9.2",window["DP_jQuery_"+dpuuid]=$})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t,e){function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.dpDiv=s(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function s(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(i,"mouseout",function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){t.datepicker._isDisabledDatepicker(a.inline?e.parent()[0]:a.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))})}function n(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}t.extend(t.ui,{datepicker:{version:"1.10.3"}});var a,r="datepicker";t.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return n(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,a;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),a=this._newInst(t(e),n),a.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,a):n&&this._inlineDatepicker(e,a)},_newInst:function(e,i){var n=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:n,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?s(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),t.data(e,r,i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,a,r=this._get(i,"appendText"),o=this._get(i,"isRTL");i.append&&i.append.remove(),r&&(i.append=t("<span class='"+this._appendClass+"'>"+r+"</span>"),e[o?"before":"after"](i.append)),e.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):t("<button type='button'></button>").addClass(this._triggerClass).html(a?t("<img/>").attr({src:a,alt:n,title:n}):n)),e[o?"before":"after"](i.trigger),i.trigger.click(function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,a=new Date(2009,11,20),r=this._get(t,"dateFormat");r.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},a.setMonth(e(this._get(t,r.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(e(this._get(t,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),t.input.attr("size",this._formatDate(t,a).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,r,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,a,o){var h,l,c,u,d,p=this._dialogInst;return p||(this.uuid+=1,h="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+h+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),t("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},t.data(this._dialogInput[0],r,p)),n(p.settings,a||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(l=document.documentElement.clientWidth,c=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[l/2-100+u,c/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],r,p),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,r);s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,r),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty())},_enableDatepicker:function(e){var i,s,n=t(e),a=t.data(e,r);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),a=t.data(e,r);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,r)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,s,a){var r,o,h,l,c=this._getInst(i);return 2===arguments.length&&"string"==typeof s?"defaults"===s?t.extend({},t.datepicker._defaults):c?"all"===s?t.extend({},c.settings):this._get(c,s):null:(r=s||{},"string"==typeof s&&(r={},r[s]=a),c&&(this._curInst===c&&this._hideDatepicker(),o=this._getDateDatepicker(i,!0),h=this._getMinMaxDate(c,"min"),l=this._getMinMaxDate(c,"max"),n(c.settings,r),null!==h&&r.dateFormat!==e&&r.minDate===e&&(c.settings.minDate=this._formatDate(c,h)),null!==l&&r.dateFormat!==e&&r.maxDate===e&&(c.settings.maxDate=this._formatDate(c,l)),"disabled"in r&&(r.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(t(i),c),this._autoSize(c),this._setDate(c,o),this._updateAlternate(c),this._updateDatepicker(c)),e)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,a=t.datepicker._getInst(e.target),r=!0,o=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),r=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",a.dpDiv),n[0]&&t.datepicker._selectDay(e.target,a.selectedMonth,a.selectedYear,n[0]),i=t.datepicker._get(a,"onSelect"),i?(s=t.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(a,"stepBigMonths"):-t.datepicker._get(a,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(a,"stepBigMonths"):+t.datepicker._get(a,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),r=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),r=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,o?1:-1,"D"),r=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(a,"stepBigMonths"):-t.datepicker._get(a,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),r=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,o?-1:1,"D"),r=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(a,"stepBigMonths"):+t.datepicker._get(a,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),r=e.ctrlKey||e.metaKey;break;default:r=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):r=!1;r&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(i){var s,n,a=t.datepicker._getInst(i.target);return t.datepicker._get(a,"constrainInput")?(s=t.datepicker._possibleChars(t.datepicker._get(a,"dateFormat")),n=String.fromCharCode(null==i.charCode?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||" ">n||!s||s.indexOf(n)>-1):e},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var i,s,a,r,o,h,l;i=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==i&&(t.datepicker._curInst.dpDiv.stop(!0,!0),i&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),s=t.datepicker._get(i,"beforeShow"),a=s?s.apply(e,[e,i]):{},a!==!1&&(n(i.settings,a),i.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(i),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),r=!1,t(e).parents().each(function(){return r|="fixed"===t(this).css("position"),!r}),o={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(i),o=t.datepicker._checkOffset(i,o,r),i.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":r?"fixed":"absolute",display:"none",left:o.left+"px",top:o.top+"px"}),i.inline||(h=t.datepicker._get(i,"showAnim"),l=t.datepicker._get(i,"duration"),i.dpDiv.zIndex(t(e).zIndex()+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[h]?i.dpDiv.show(h,t.datepicker._get(i,"showOptions"),l):i.dpDiv[h||"show"](h?l:null),t.datepicker._shouldFocusInput(i)&&i.input.focus(),t.datepicker._curInst=i))}},_updateDatepicker:function(e){this.maxRows=4,a=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,s=this._getNumberOfMonths(e),n=s[1],r=17;e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",r*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.focus(),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),a=e.dpDiv.outerHeight(),r=e.input?e.input.outerWidth():0,o=e.input?e.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-r:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+o?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+o):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,s,n,a,o=this._curInst;!o||e&&o!==t.data(e,r)||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){t.datepicker._tidyDialog(o)},t.effects&&(t.effects.effect[i]||t.effects[i])?o.dpDiv.hide(i,t.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(e,i,s,n){var a,r=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(r[0])||(a=this._getInst(r[0]),a.selectedDay=a.currentDay=t("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(e,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,a=this._get(e,"altField");a&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(a).each(function(){t(this).val(n)}))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(i,s,n){if(null==i||null==s)throw"Invalid arguments";if(s="object"==typeof s?""+s:s+"",""===s)return null;var a,r,o,h,l=0,c=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof c?c:(new Date).getFullYear()%100+parseInt(c,10),d=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,p=(n?n.dayNames:null)||this._defaults.dayNames,f=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,m=(n?n.monthNames:null)||this._defaults.monthNames,g=-1,v=-1,_=-1,b=-1,y=!1,x=function(t){var e=i.length>a+1&&i.charAt(a+1)===t;return e&&a++,e},k=function(t){var e=x(t),i="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,n=RegExp("^\\d{1,"+i+"}"),a=s.substring(l).match(n);if(!a)throw"Missing number at position "+l;return l+=a[0].length,parseInt(a[0],10)},w=function(i,n,a){var r=-1,o=t.map(x(i)?a:n,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(o,function(t,i){var n=i[1];return s.substr(l,n.length).toLowerCase()===n.toLowerCase()?(r=i[0],l+=n.length,!1):e}),-1!==r)return r+1;throw"Unknown name at position "+l},D=function(){if(s.charAt(l)!==i.charAt(a))throw"Unexpected literal at position "+l;l++};for(a=0;i.length>a;a++)if(y)"'"!==i.charAt(a)||x("'")?D():y=!1;else switch(i.charAt(a)){case"d":_=k("d");break;case"D":w("D",d,p);break;case"o":b=k("o");break;case"m":v=k("m");break;case"M":v=w("M",f,m);break;case"y":g=k("y");break;case"@":h=new Date(k("@")),g=h.getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"!":h=new Date((k("!")-this._ticksTo1970)/1e4),g=h.getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"'":x("'")?D():y=!0;break;default:D()}if(s.length>l&&(o=s.substr(l),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===g?g=(new Date).getFullYear():100>g&&(g+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=g?0:-100)),b>-1)for(v=1,_=b;;){if(r=this._getDaysInMonth(g,v-1),r>=_)break;v++,_-=r}if(h=this._daylightSavingAdjust(new Date(g,v-1,_)),h.getFullYear()!==g||h.getMonth()+1!==v||h.getDate()!==_)throw"Invalid date";return h},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,r=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,o=(i?i.monthNames:null)||this._defaults.monthNames,h=function(e){var i=t.length>s+1&&t.charAt(s+1)===e;return i&&s++,i},l=function(t,e,i){var s=""+e;if(h(t))for(;i>s.length;)s="0"+s;return s},c=function(t,e,i,s){return h(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;t.length>s;s++)if(d)"'"!==t.charAt(s)||h("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=l("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,a);break;case"o":u+=l("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=l("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),r,o);break;case"y":u+=h("y")?e.getFullYear():(10>e.getYear()%100?"0":"")+e.getYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":h("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=t.length>e+1&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;t.length>e;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,i){return t.settings[i]!==e?t.settings[i]:this._defaults[i]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),a=n,r=this._getFormatConfig(t);try{a=this.parseDate(i,s,r)||n}catch(o){s=e?"":s}t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),t.currentDay=s?a.getDate():0,t.currentMonth=s?a.getMonth():0,t.currentYear=s?a.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,s){var n=function(t){var e=new Date;return e.setDate(e.getDate()+t),e},a=function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,a=n.getFullYear(),r=n.getMonth(),o=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":o+=parseInt(l[1],10);break;case"w":case"W":o+=7*parseInt(l[1],10);break;case"m":case"M":r+=parseInt(l[1],10),o=Math.min(o,t.datepicker._getDaysInMonth(a,r));break;case"y":case"Y":a+=parseInt(l[1],10),o=Math.min(o,t.datepicker._getDaysInMonth(a,r))}l=h.exec(i)}return new Date(a,r,o)},r=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return r=r&&"Invalid Date"==""+r?s:r,r&&(r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0)),this._daylightSavingAdjust(r)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,a=t.selectedYear,r=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=r.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=r.getMonth(),t.drawYear=t.selectedYear=t.currentYear=r.getFullYear(),n===t.selectedMonth&&a===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){var e=!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){t.datepicker._adjustDate(s,-i,"M")},next:function(){t.datepicker._adjustDate(s,+i,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(s)},selectDay:function(){return t.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,a,r,o,h,l,c,u,d,p,f,m,g,v,_,b,y,x,k,w,D,T,C,M,S,N,I,P,A,z,H,E,F,O,W,j,R=new Date,L=this._daylightSavingAdjust(new Date(R.getFullYear(),R.getMonth(),R.getDate())),Y=this._get(t,"isRTL"),B=this._get(t,"showButtonPanel"),J=this._get(t,"hideIfNoPrevNext"),K=this._get(t,"navigationAsDateFormat"),Q=this._getNumberOfMonths(t),V=this._get(t,"showCurrentAtPos"),U=this._get(t,"stepMonths"),q=1!==Q[0]||1!==Q[1],X=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),G=this._getMinMaxDate(t,"min"),$=this._getMinMaxDate(t,"max"),Z=t.drawMonth-V,te=t.drawYear;if(0>Z&&(Z+=12,te--),$)for(e=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-Q[0]*Q[1]+1,$.getDate())),e=G&&G>e?G:e;this._daylightSavingAdjust(new Date(te,Z,1))>e;)Z--,0>Z&&(Z=11,te--);for(t.drawMonth=Z,t.drawYear=te,i=this._get(t,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(te,Z-U,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,te,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":J?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(t,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(te,Z+U,1)),this._getFormatConfig(t)):n,a=this._canAdjustMonth(t,1,te,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":J?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",r=this._get(t,"currentText"),o=this._get(t,"gotoCurrent")&&t.currentDay?X:L,r=K?this.formatDate(r,o,this._getFormatConfig(t)):r,h=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",l=B?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(t,o)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+r+"</button>":"")+(Y?"":h)+"</div>":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),m=this._get(t,"monthNamesShort"),g=this._get(t,"beforeShowDay"),v=this._get(t,"showOtherMonths"),_=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;Q[0]>k;k++){for(w="",this.maxRows=4,D=0;Q[1]>D;D++){if(T=this._daylightSavingAdjust(new Date(te,Z,t.selectedDay)),C=" ui-corner-all",M="",q){if(M+="<div class='ui-datepicker-group",Q[1]>1)switch(D){case 0:M+=" ui-datepicker-group-first",C=" ui-corner-"+(Y?"right":"left");break;case Q[1]-1:M+=" ui-datepicker-group-last",C=" ui-corner-"+(Y?"left":"right");break;default:M+=" ui-datepicker-group-middle",C=""}M+="'>"}for(M+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+C+"'>"+(/all|left/.test(C)&&0===k?Y?a:s:"")+(/all|right/.test(C)&&0===k?Y?s:a:"")+this._generateMonthYearHeader(t,Z,te,G,$,k>0||D>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",S=u?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",x=0;7>x;x++)N=(x+c)%7,S+="<th"+((x+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[N]+"'>"+p[N]+"</span></th>";for(M+=S+"</tr></thead><tbody>",I=this._getDaysInMonth(te,Z),te===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,I)),P=(this._getFirstDayOfMonth(te,Z)-c+7)%7,A=Math.ceil((P+I)/7),z=q?this.maxRows>A?this.maxRows:A:A,this.maxRows=z,H=this._daylightSavingAdjust(new Date(te,Z,1-P)),E=0;z>E;E++){for(M+="<tr>",F=u?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(H)+"</td>":"",x=0;7>x;x++)O=g?g.apply(t.input?t.input[0]:null,[H]):[!0,""],W=H.getMonth()!==Z,j=W&&!_||!O[0]||G&&G>H||$&&H>$,F+="<td class='"+((x+c+6)%7>=5?" ui-datepicker-week-end":"")+(W?" ui-datepicker-other-month":"")+(H.getTime()===T.getTime()&&Z===t.selectedMonth&&t._keyEvent||b.getTime()===H.getTime()&&b.getTime()===T.getTime()?" "+this._dayOverClass:"")+(j?" "+this._unselectableClass+" ui-state-disabled":"")+(W&&!v?"":" "+O[1]+(H.getTime()===X.getTime()?" "+this._currentClass:"")+(H.getTime()===L.getTime()?" ui-datepicker-today":""))+"'"+(W&&!v||!O[2]?"":" title='"+O[2].replace(/'/g,"&#39;")+"'")+(j?"":" data-handler='selectDay' data-event='click' data-month='"+H.getMonth()+"' data-year='"+H.getFullYear()+"'")+">"+(W&&!v?"&#xa0;":j?"<span class='ui-state-default'>"+H.getDate()+"</span>":"<a class='ui-state-default"+(H.getTime()===L.getTime()?" ui-state-highlight":"")+(H.getTime()===X.getTime()?" ui-state-active":"")+(W?" ui-priority-secondary":"")+"' href='#'>"+H.getDate()+"</a>")+"</td>",H.setDate(H.getDate()+1),H=this._daylightSavingAdjust(H);M+=F+"</tr>"}Z++,Z>11&&(Z=0,te++),M+="</tbody></table>"+(q?"</div>"+(Q[0]>0&&D===Q[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),w+=M}y+=w}return y+=l,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,a,r,o){var h,l,c,u,d,p,f,m,g=this._get(t,"changeMonth"),v=this._get(t,"changeYear"),_=this._get(t,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(a||!g)y+="<span class='ui-datepicker-month'>"+r[e]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;12>c;c++)(!h||c>=s.getMonth())&&(!l||n.getMonth()>=c)&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+o[c]+"</option>");y+="</select>"}if(_||(b+=y+(!a&&g&&v?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",a||!v)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);
+return isNaN(e)?d:e},f=p(u[0]),m=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";m>=f;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),_&&(b+=(!a&&g&&v?"":"&#xa0;")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.drawYear+("Y"===i?e:0),n=t.drawMonth+("M"===i?e:0),a=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),r=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,a)));t.selectedDay=r.getDate(),t.drawMonth=t.selectedMonth=r.getMonth(),t.drawYear=t.selectedYear=r.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&i>e?i:e;return s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),a=this._daylightSavingAdjust(new Date(i,s+(0>e?e:n[0]*n[1]),1));return 0>e&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(t,a)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),a=this._getMinMaxDate(t,"max"),r=null,o=null,h=this._get(t,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),r=parseInt(i[0],10),o=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(r+=s),i[1].match(/[+\-].*/)&&(o+=s)),(!n||e.getTime()>=n.getTime())&&(!a||e.getTime()<=a.getTime())&&(!r||e.getFullYear()>=r)&&(!o||o>=e.getFullYear())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).mousedown(t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new i,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.10.3"})(jQuery);
\ No newline at end of file
index 2b7310100291feb322e1bda10ff324cebcd5e6ae..990f202196ca106cba70a497f46790ffd01ec812 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.dialog.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){var n="ui-dialog ui-widget ui-widget-content ui-corner-all ",r={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.9.2",options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var n=e(this).css(t).offset().top;n<0&&e(this).css("top",t.top-n)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.oldPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.options.title=this.options.title||this.originalTitle;var t=this,r=this.options,i=r.title||"&#160;",s,o,u,a,f;s=(this.uiDialog=e("<div>")).addClass(n+r.dialogClass).css({display:"none",outline:0,zIndex:r.zIndex}).attr("tabIndex",-1).keydown(function(n){r.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===e.ui.keyCode.ESCAPE&&(t.close(n),n.preventDefault())}).mousedown(function(e){t.moveToTop(!1,e)}).appendTo("body"),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(s),o=(this.uiDialogTitlebar=e("<div>")).addClass("ui-dialog-titlebar  ui-widget-header  ui-corner-all  ui-helper-clearfix").bind("mousedown",function(){s.focus()}).prependTo(s),u=e("<a href='#'></a>").addClass("ui-dialog-titlebar-close  ui-corner-all").attr("role","button").click(function(e){e.preventDefault(),t.close(e)}).appendTo(o),(this.uiDialogTitlebarCloseText=e("<span>")).addClass("ui-icon ui-icon-closethick").text(r.closeText).appendTo(u),a=e("<span>").uniqueId().addClass("ui-dialog-title").html(i).prependTo(o),f=(this.uiDialogButtonPane=e("<div>")).addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),(this.uiButtonSet=e("<div>")).addClass("ui-dialog-buttonset").appendTo(f),s.attr({role:"dialog","aria-labelledby":a.attr("id")}),o.find("*").add(o).disableSelection(),this._hoverable(u),this._focusable(u),r.draggable&&e.fn.draggable&&this._makeDraggable(),r.resizable&&e.fn.resizable&&this._makeResizable(),this._createButtons(r.buttons),this._isOpen=!1,e.fn.bgiframe&&s.bgiframe(),this._on(s,{keydown:function(t){if(!r.modal||t.keyCode!==e.ui.keyCode.TAB)return;var n=e(":tabbable",s),i=n.filter(":first"),o=n.filter(":last");if(t.target===o[0]&&!t.shiftKey)return i.focus(1),!1;if(t.target===i[0]&&t.shiftKey)return o.focus(1),!1}})},_init:function(){this.options.autoOpen&&this.open()},_destroy:function(){var e,t=this.oldPosition;this.overlay&&this.overlay.destroy(),this.uiDialog.hide(),this.element.removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},close:function(t){var n=this,r,i;if(!this._isOpen)return;if(!1===this._trigger("beforeClose",t))return;return this._isOpen=!1,this.overlay&&this.overlay.destroy(),this.options.hide?this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",t)}):(this.uiDialog.hide(),this._trigger("close",t)),e.ui.dialog.overlay.resize(),this.options.modal&&(r=0,e(".ui-dialog").each(function(){this!==n.uiDialog[0]&&(i=e(this).css("z-index"),isNaN(i)||(r=Math.max(r,i)))}),e.ui.dialog.maxZ=r),this},isOpen:function(){return this._isOpen},moveToTop:function(t,n){var r=this.options,i;return r.modal&&!t||!r.stack&&!r.modal?this._trigger("focus",n):(r.zIndex>e.ui.dialog.maxZ&&(e.ui.dialog.maxZ=r.zIndex),this.overlay&&(e.ui.dialog.maxZ+=1,e.ui.dialog.overlay.maxZ=e.ui.dialog.maxZ,this.overlay.$el.css("z-index",e.ui.dialog.overlay.maxZ)),i={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()},e.ui.dialog.maxZ+=1,this.uiDialog.css("z-index",e.ui.dialog.maxZ),this.element.attr(i),this._trigger("focus",n),this)},open:function(){if(this._isOpen)return;var t,n=this.options,r=this.uiDialog;return this._size(),this._position(n.position),r.show(n.show),this.overlay=n.modal?new e.ui.dialog.overlay(this):null,this.moveToTop(!0),t=this.element.find(":tabbable"),t.length||(t=this.uiDialogButtonPane.find(":tabbable"),t.length||(t=r)),t.eq(0).focus(),this._isOpen=!0,this._trigger("open"),this},_createButtons:function(t){var n=this,r=!1;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),typeof t=="object"&&t!==null&&e.each(t,function(){return!(r=!0)}),r?(e.each(t,function(t,r){var i,s;r=e.isFunction(r)?{click:r,text:t}:r,r=e.extend({type:"button"},r),s=r.click,r.click=function(){s.apply(n.element[0],arguments)},i=e("<button></button>",r).appendTo(n.uiButtonSet),e.fn.button&&i.button()}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)):this.uiDialog.removeClass("ui-dialog-buttons")},_makeDraggable:function(){function r(e){return{position:e.position,offset:e.offset}}var t=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,i){e(this).addClass("ui-dialog-dragging"),t._trigger("dragStart",n,r(i))},drag:function(e,n){t._trigger("drag",e,r(n))},stop:function(i,s){n.position=[s.position.left-t.document.scrollLeft(),s.position.top-t.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),t._trigger("dragStop",i,r(s)),e.ui.dialog.overlay.resize()}})},_makeResizable:function(n){function u(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}n=n===t?this.options.resizable:n;var r=this,i=this.options,s=this.uiDialog.css("position"),o=typeof n=="string"?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:i.maxWidth,maxHeight:i.maxHeight,minWidth:i.minWidth,minHeight:this._minHeight(),handles:o,start:function(t,n){e(this).addClass("ui-dialog-resizing"),r._trigger("resizeStart",t,u(n))},resize:function(e,t){r._trigger("resize",e,u(t))},stop:function(t,n){e(this).removeClass("ui-dialog-resizing"),i.height=e(this).height(),i.width=e(this).width(),r._trigger("resizeStop",t,u(n)),e.ui.dialog.overlay.resize()}}).css("position",s).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var e=this.options;return e.height==="auto"?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(t){var n=[],r=[0,0],i;if(t){if(typeof t=="string"||typeof t=="object"&&"0"in t)n=t.split?t.split(" "):[t[0],t[1]],n.length===1&&(n[1]=n[0]),e.each(["left","top"],function(e,t){+n[e]===n[e]&&(r[e]=n[e],n[e]=t)}),t={my:n[0]+(r[0]<0?r[0]:"+"+r[0])+" "+n[1]+(r[1]<0?r[1]:"+"+r[1]),at:n.join(" ")};t=e.extend({},e.ui.dialog.prototype.options.position,t)}else t=e.ui.dialog.prototype.options.position;i=this.uiDialog.is(":visible"),i||this.uiDialog.show(),this.uiDialog.position(t),i||this.uiDialog.hide()},_setOptions:function(t){var n=this,s={},o=!1;e.each(t,function(e,t){n._setOption(e,t),e in r&&(o=!0),e in i&&(s[e]=t)}),o&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",s)},_setOption:function(t,r){var i,s,o=this.uiDialog;switch(t){case"buttons":this._createButtons(r);break;case"closeText":this.uiDialogTitlebarCloseText.text(""+r);break;case"dialogClass":o.removeClass(this.options.dialogClass).addClass(n+r);break;case"disabled":r?o.addClass("ui-dialog-disabled"):o.removeClass("ui-dialog-disabled");break;case"draggable":i=o.is(":data(draggable)"),i&&!r&&o.draggable("destroy"),!i&&r&&this._makeDraggable();break;case"position":this._position(r);break;case"resizable":s=o.is(":data(resizable)"),s&&!r&&o.resizable("destroy"),s&&typeof r=="string"&&o.resizable("option","handles",r),!s&&r!==!1&&this._makeResizable(r);break;case"title":e(".ui-dialog-title",this.uiDialogTitlebar).html(""+(r||"&#160;"))}this._super(t,r)},_size:function(){var t,n,r,i=this.options,s=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),i.minWidth>i.width&&(i.width=i.minWidth),t=this.uiDialog.css({height:"auto",width:i.width}).outerHeight(),n=Math.max(0,i.minHeight-t),i.height==="auto"?e.support.minHeight?this.element.css({minHeight:n,height:"auto"}):(this.uiDialog.show(),r=this.element.css("height","auto").height(),s||this.uiDialog.hide(),this.element.height(Math.max(r,n))):this.element.height(Math.max(i.height-t,0)),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),e.extend(e.ui.dialog,{uuid:0,maxZ:0,getTitleId:function(e){var t=e.attr("id");return t||(this.uuid+=1,t=this.uuid),"ui-dialog-title-"+t},overlay:function(t){this.$el=e.ui.dialog.overlay.create(t)}}),e.extend(e.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:e.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(e){return e+".dialog-overlay"}).join(" "),create:function(t){this.instances.length===0&&(setTimeout(function(){e.ui.dialog.overlay.instances.length&&e(document).bind(e.ui.dialog.overlay.events,function(t){if(e(t.target).zIndex()<e.ui.dialog.overlay.maxZ)return!1})},1),e(window).bind("resize.dialog-overlay",e.ui.dialog.overlay.resize));var n=this.oldInstances.pop()||e("<div>").addClass("ui-widget-overlay");return e(document).bind("keydown.dialog-overlay",function(r){var i=e.ui.dialog.overlay.instances;i.length!==0&&i[i.length-1]===n&&t.options.closeOnEscape&&!r.isDefaultPrevented()&&r.keyCode&&r.keyCode===e.ui.keyCode.ESCAPE&&(t.close(r),r.preventDefault())}),n.appendTo(document.body).css({width:this.width(),height:this.height()}),e.fn.bgiframe&&n.bgiframe(),this.instances.push(n),n},destroy:function(t){var n=e.inArray(t,this.instances),r=0;n!==-1&&this.oldInstances.push(this.instances.splice(n,1)[0]),this.instances.length===0&&e([document,window]).unbind(".dialog-overlay"),t.height(0).width(0).remove(),e.each(this.instances,function(){r=Math.max(r,this.css("z-index"))}),this.maxZ=r},height:function(){var t,n;return e.ui.ie?(t=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),n=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),t<n?e(window).height()+"px":t+"px"):e(document).height()+"px"},width:function(){var t,n;return e.ui.ie?(t=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),n=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),t<n?e(window).width()+"px":t+"px"):e(document).width()+"px"},resize:function(){var t=e([]);e.each(e.ui.dialog.overlay.instances,function(){t=t.add(this)}),t.css({width:0,height:0}).css({width:e.ui.dialog.overlay.width(),height:e.ui.dialog.overlay.height()})}}),e.extend(e.ui.dialog.overlay.prototype,{destroy:function(){e.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){var e={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};t.widget("ui.dialog",{version:"1.10.3",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;0>i&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var i=this;this._isOpen&&this._trigger("beforeClose",e)!==!1&&(this._isOpen=!1,this._destroyOverlay(),this.opener.filter(":focusable").focus().length||t(this.document[0].activeElement).blur(),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",e)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!e&&this._trigger("focus",t),i},open:function(){var e=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),undefined):(this._isOpen=!0,this.opener=t(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._trigger("open"),undefined)},_focusTabbable:function(){var t=this.element.find("[autofocus]");t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).focus()},_keepFocus:function(e){function i(){var e=this.document[0].activeElement,i=this.uiDialog[0]===e||t.contains(this.uiDialog[0],e);i||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),this.close(e),undefined;if(e.keyCode===t.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");e.target!==n[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==s[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(n.focus(1),e.preventDefault()):(s.focus(1),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=t("<button></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(e),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title||t.html("&#160;"),t.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),undefined):(t.each(i,function(i,s){var n,a;s=t.isFunction(s)?{click:s,text:i}:s,s=t.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(e.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,t("<button></button>",s).button(a).appendTo(e.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),undefined)},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){t(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,e(n))},drag:function(t,s){i._trigger("drag",t,e(s))},stop:function(n,a){s.position=[a.position.left-i.document.scrollLeft(),a.position.top-i.document.scrollTop()],t(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,e(a))}})},_makeResizable:function(){function e(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){t(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,e(n))},resize:function(t,s){i._trigger("resize",t,e(s))},stop:function(n,a){s.height=t(this).height(),s.width=t(this).width(),t(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,e(a))}}).css("position",a)},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(s){var n=this,a=!1,o={};t.each(s,function(t,s){n._setOption(t,s),t in e&&(a=!0),t in i&&(o[t]=s)}),a&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",o)},_setOption:function(t,e){var i,s,n=this.uiDialog;"dialogClass"===t&&n.removeClass(this.options.dialogClass).addClass(e),"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:""+e}),"draggable"===t&&(i=n.is(":data(ui-draggable)"),i&&!e&&n.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&(s=n.is(":data(ui-resizable)"),s&&!e&&n.resizable("destroy"),s&&"string"==typeof e&&n.resizable("option","handles",e),s||e===!1||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return t(e.target).closest(".ui-dialog").length?!0:!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=this,i=this.widgetFullName;t.ui.dialog.overlayInstances||this._delay(function(){t.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(s){e._allowInteraction(s)||(s.preventDefault(),t(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=t("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),t.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(t.ui.dialog.overlayInstances--,t.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),t.ui.dialog.overlayInstances=0,t.uiBackCompat!==!1&&t.widget("ui.dialog",t.ui.dialog,{_position:function(){var e,i=this.options.position,s=[],n=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(s=i.split?i.split(" "):[i[0],i[1]],1===s.length&&(s[1]=s[0]),t.each(["left","top"],function(t,e){+s[t]===s[t]&&(n[t]=s[t],s[t]=e)}),i={my:s[0]+(0>n[0]?n[0]:"+"+n[0])+" "+s[1]+(0>n[1]?n[1]:"+"+n[1]),at:s.join(" ")}),i=t.extend({},t.ui.dialog.prototype.options.position,i)):i=t.ui.dialog.prototype.options.position,e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.position(i),e||this.uiDialog.hide()}})})(jQuery);
\ No newline at end of file
index 69f6ff2cab0872c09122b79d79212eeba1cbe1c8..ac92817f3b74cfc3780590c09ff26ab6d73e6c78 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.draggable.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){e.widget("ui.draggable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var n=this.options;return this.helper||n.disabled||e(t.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(t),this.handle?(e(n.iframeFix===!0?"iframe":n.iframeFix).each(function(){e('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),n.containment&&this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,n){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute");if(!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp({}),!1;this.position=r.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=!1;e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1);var r=this.element[0],i=!1;while(r&&(r=r.parentNode))r==document&&(i=!0);if(!i&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!n||this.options.revert=="valid"&&n||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)){var s=this;e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){s._trigger("stop",t)!==!1&&s._clear()})}else this._trigger("stop",t)!==!1&&this._clear();return!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){var n=!this.options.handle||!e(this.options.handle,this.element).length?!0:!1;return e(this.options.handle,this.element).find("*").andSelf().each(function(){this==t.target&&(n=!0)}),n},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t])):n.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return r.parents("body").length||r.appendTo(n.appendTo=="parent"?this.element[0].parentNode:n.appendTo),r[0]!=this.element[0]&&!/(fixed|absolute)/.test(r.css("position"))&&r.css("position","absolute"),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[t.containment=="document"?0:e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t.containment=="document"?0:e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(t.containment=="document"?0:e(window).scrollLeft())+e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(t.containment=="document"?0:e(window).scrollTop())+(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)&&t.containment.constructor!=Array){var n=e(t.containment),r=n[0];if(!r)return;var i=n.offset(),s=e(r).css("overflow")!="hidden";this.containment=[(parseInt(e(r).css("borderLeftWidth"),10)||0)+(parseInt(e(r).css("paddingLeft"),10)||0),(parseInt(e(r).css("borderTopWidth"),10)||0)+(parseInt(e(r).css("paddingTop"),10)||0),(s?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(e(r).css("borderLeftWidth"),10)||0)-(parseInt(e(r).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(s?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(e(r).css("borderTopWidth"),10)||0)-(parseInt(e(r).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=n}else t.containment.constructor==Array&&(this.containment=t.containment)},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName),s=t.pageX,o=t.pageY;if(this.originalPosition){var u;if(this.containment){if(this.relative_container){var a=this.relative_container.offset();u=[this.containment[0]+a.left,this.containment[1]+a.top,this.containment[2]+a.left,this.containment[3]+a.top]}else u=this.containment;t.pageX-this.offset.click.left<u[0]&&(s=u[0]+this.offset.click.left),t.pageY-this.offset.click.top<u[1]&&(o=u[1]+this.offset.click.top),t.pageX-this.offset.click.left>u[2]&&(s=u[2]+this.offset.click.left),t.pageY-this.offset.click.top>u[3]&&(o=u[3]+this.offset.click.top)}if(n.grid){var f=n.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY;o=u?f-this.offset.click.top<u[1]||f-this.offset.click.top>u[3]?f-this.offset.click.top<u[1]?f+n.grid[1]:f-n.grid[1]:f:f;var l=n.grid[0]?this.originalPageX+Math.round((s-this.originalPageX)/n.grid[0])*n.grid[0]:this.originalPageX;s=u?l-this.offset.click.left<u[0]||l-this.offset.click.left>u[2]?l-this.offset.click.left<u[0]?l+n.grid[0]:l-n.grid[0]:l:l}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():i?0:r.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:r.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,n,r){return r=r||this._uiHash(),e.ui.plugin.call(this,t,[n,r]),t=="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,n,r)},plugins:{},_uiHash:function(e){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,n){var r=e(this).data("draggable"),i=r.options,s=e.extend({},n,{item:r.element});r.sortables=[],e(i.connectToSortable).each(function(){var n=e.data(this,"sortable");n&&!n.options.disabled&&(r.sortables.push({instance:n,shouldRevert:n.options.revert}),n.refreshPositions(),n._trigger("activate",t,s))})},stop:function(t,n){var r=e(this).data("draggable"),i=e.extend({},n,{item:r.element});e.each(r.sortables,function(){this.instance.isOver?(this.instance.isOver=0,r.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,r.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,i))})},drag:function(t,n){var r=e(this).data("draggable"),i=this,s=function(t){var n=this.offset.click.top,r=this.offset.click.left,i=this.positionAbs.top,s=this.positionAbs.left,o=t.height,u=t.width,a=t.top,f=t.left;return e.ui.isOver(i+n,s+r,a,f,o,u)};e.each(r.sortables,function(s){var o=!1,u=this;this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,e.each(r.sortables,function(){return this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this!=u&&this.instance._intersectsWith(this.instance.containerCache)&&e.ui.contains(u.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(i).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return n.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=r.offset.click.top,this.instance.offset.click.left=r.offset.click.left,this.instance.offset.parent.left-=r.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=r.offset.parent.top-this.instance.offset.parent.top,r._trigger("toSortable",t),r.dropped=this.instance.element,r.currentItem=r.element,this.instance.fromOutside=r),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),r._trigger("fromSortable",t),r.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,n){var r=e("body"),i=e(this).data("draggable").options;r.css("cursor")&&(i._cursor=r.css("cursor")),r.css("cursor",i.cursor)},stop:function(t,n){var r=e(this).data("draggable").options;r._cursor&&e("body").css("cursor",r._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,n){var r=e(n.helper),i=e(this).data("draggable").options;r.css("opacity")&&(i._opacity=r.css("opacity")),r.css("opacity",i.opacity)},stop:function(t,n){var r=e(this).data("draggable").options;r._opacity&&e(n.helper).css("opacity",r._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(t,n){var r=e(this).data("draggable");r.scrollParent[0]!=document&&r.scrollParent[0].tagName!="HTML"&&(r.overflowOffset=r.scrollParent.offset())},drag:function(t,n){var r=e(this).data("draggable"),i=r.options,s=!1;if(r.scrollParent[0]!=document&&r.scrollParent[0].tagName!="HTML"){if(!i.axis||i.axis!="x")r.overflowOffset.top+r.scrollParent[0].offsetHeight-t.pageY<i.scrollSensitivity?r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop+i.scrollSpeed:t.pageY-r.overflowOffset.top<i.scrollSensitivity&&(r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop-i.scrollSpeed);if(!i.axis||i.axis!="y")r.overflowOffset.left+r.scrollParent[0].offsetWidth-t.pageX<i.scrollSensitivity?r.scrollParent[0].scrollLeft=s=r.scrollParent[0].scrollLeft+i.scrollSpeed:t.pageX-r.overflowOffset.left<i.scrollSensitivity&&(r.scrollParent[0].scrollLeft=s=r.scrollParent[0].scrollLeft-i.scrollSpeed)}else{if(!i.axis||i.axis!="x")t.pageY-e(document).scrollTop()<i.scrollSensitivity?s=e(document).scrollTop(e(document).scrollTop()-i.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<i.scrollSensitivity&&(s=e(document).scrollTop(e(document).scrollTop()+i.scrollSpeed));if(!i.axis||i.axis!="y")t.pageX-e(document).scrollLeft()<i.scrollSensitivity?s=e(document).scrollLeft(e(document).scrollLeft()-i.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<i.scrollSensitivity&&(s=e(document).scrollLeft(e(document).scrollLeft()+i.scrollSpeed))}s!==!1&&e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(r,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,n){var r=e(this).data("draggable"),i=r.options;r.snapElements=[],e(i.snap.constructor!=String?i.snap.items||":data(draggable)":i.snap).each(function(){var t=e(this),n=t.offset();this!=r.element[0]&&r.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:n.top,left:n.left})})},drag:function(t,n){var r=e(this).data("draggable"),i=r.options,s=i.snapTolerance,o=n.offset.left,u=o+r.helperProportions.width,a=n.offset.top,f=a+r.helperProportions.height;for(var l=r.snapElements.length-1;l>=0;l--){var c=r.snapElements[l].left,h=c+r.snapElements[l].width,p=r.snapElements[l].top,d=p+r.snapElements[l].height;if(!(c-s<o&&o<h+s&&p-s<a&&a<d+s||c-s<o&&o<h+s&&p-s<f&&f<d+s||c-s<u&&u<h+s&&p-s<a&&a<d+s||c-s<u&&u<h+s&&p-s<f&&f<d+s)){r.snapElements[l].snapping&&r.options.snap.release&&r.options.snap.release.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[l].item})),r.snapElements[l].snapping=!1;continue}if(i.snapMode!="inner"){var v=Math.abs(p-f)<=s,m=Math.abs(d-a)<=s,g=Math.abs(c-u)<=s,y=Math.abs(h-o)<=s;v&&(n.position.top=r._convertPositionTo("relative",{top:p-r.helperProportions.height,left:0}).top-r.margins.top),m&&(n.position.top=r._convertPositionTo("relative",{top:d,left:0}).top-r.margins.top),g&&(n.position.left=r._convertPositionTo("relative",{top:0,left:c-r.helperProportions.width}).left-r.margins.left),y&&(n.position.left=r._convertPositionTo("relative",{top:0,left:h}).left-r.margins.left)}var b=v||m||g||y;if(i.snapMode!="outer"){var v=Math.abs(p-a)<=s,m=Math.abs(d-f)<=s,g=Math.abs(c-o)<=s,y=Math.abs(h-u)<=s;v&&(n.position.top=r._convertPositionTo("relative",{top:p,left:0}).top-r.margins.top),m&&(n.position.top=r._convertPositionTo("relative",{top:d-r.helperProportions.height,left:0}).top-r.margins.top),g&&(n.position.left=r._convertPositionTo("relative",{top:0,left:c}).left-r.margins.left),y&&(n.position.left=r._convertPositionTo("relative",{top:0,left:h-r.helperProportions.width}).left-r.margins.left)}!r.snapElements[l].snapping&&(v||m||g||y||b)&&r.options.snap.snap&&r.options.snap.snap.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[l].item})),r.snapElements[l].snapping=v||m||g||y||b}}}),e.ui.plugin.add("draggable","stack",{start:function(t,n){var r=e(this).data("draggable").options,i=e.makeArray(e(r.stack)).sort(function(t,n){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(n).css("zIndex"),10)||0)});if(!i.length)return;var s=parseInt(i[0].style.zIndex)||0;e(i).each(function(e){this.style.zIndex=s+e}),this[0].style.zIndex=s+i.length}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,n){var r=e(n.helper),i=e(this).data("draggable").options;r.css("zIndex")&&(i._zIndex=r.css("zIndex")),r.css("zIndex",i.zIndex)},stop:function(t,n){var r=e(this).data("draggable").options;r._zIndex&&e(n.helper).css("zIndex",r._zIndex)}})})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(e){e.widget("ui.draggable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var i=this.options;return this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(e(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){e("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"original"!==this.options.helper||e.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1):!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;return n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===n.containment?(this.containment=[0,0,e(document).width()-this.helperProportions.width-this.margins.left,(e(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):n.containment.constructor===Array?(this.containment=n.containment,undefined):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),undefined):(this.containment=null,undefined)},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:n.scrollTop(),left:n.scrollLeft()}),{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*s}},_generatePosition:function(t){var i,s,n,a,o=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=t.pageX,l=t.pageY;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s]),"drag"===t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i){var s=e(this).data("ui-draggable"),n=s.options,a=e.extend({},i,{item:s.element});s.sortables=[],e(n.connectToSortable).each(function(){var i=e.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",t,a))})},stop:function(t,i){var s=e(this).data("ui-draggable"),n=e.extend({},i,{item:s.element});e.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,n))})},drag:function(t,i){var s=e(this).data("ui-draggable"),n=this;e.each(s.sortables,function(){var a=!1,o=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(a=!0,e.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(o.instance.element[0],this.instance.element[0])&&(a=!1),a})),a?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",t),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",t),s.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(){var t=e("body"),i=e(this).data("ui-draggable").options;t.css("cursor")&&(i._cursor=t.css("cursor")),t.css("cursor",i.cursor)},stop:function(){var t=e(this).data("ui-draggable").options;t._cursor&&e("body").css("cursor",t._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i){var s=e(i.helper),n=e(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(t,i){var s=e(this).data("ui-draggable").options;s._opacity&&e(i.helper).css("opacity",s._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(){var t=e(this).data("ui-draggable");t.scrollParent[0]!==document&&"HTML"!==t.scrollParent[0].tagName&&(t.overflowOffset=t.scrollParent.offset())},drag:function(t){var i=e(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-t.pageY<s.scrollSensitivity?i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop+s.scrollSpeed:t.pageY-i.overflowOffset.top<s.scrollSensitivity&&(i.scrollParent[0].scrollTop=n=i.scrollParent[0].scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-t.pageX<s.scrollSensitivity?i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft+s.scrollSpeed:t.pageX-i.overflowOffset.left<s.scrollSensitivity&&(i.scrollParent[0].scrollLeft=n=i.scrollParent[0].scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(t.pageY-e(document).scrollTop()<s.scrollSensitivity?n=e(document).scrollTop(e(document).scrollTop()-s.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<s.scrollSensitivity&&(n=e(document).scrollTop(e(document).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(t.pageX-e(document).scrollLeft()<s.scrollSensitivity?n=e(document).scrollLeft(e(document).scrollLeft()-s.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<s.scrollSensitivity&&(n=e(document).scrollLeft(e(document).scrollLeft()+s.scrollSpeed)))),n!==!1&&e.ui.ddmanager&&!s.dropBehaviour&&e.ui.ddmanager.prepareOffsets(i,t)}}),e.ui.plugin.add("draggable","snap",{start:function(){var t=e(this).data("ui-draggable"),i=t.options;t.snapElements=[],e(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var i=e(this),s=i.offset();this!==t.element[0]&&t.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:s.top,left:s.left})})},drag:function(t,i){var s,n,a,o,r,h,l,u,c,d,p=e(this).data("ui-draggable"),f=p.options,m=f.snapTolerance,g=i.offset.left,v=g+p.helperProportions.width,b=i.offset.top,y=b+p.helperProportions.height;for(c=p.snapElements.length-1;c>=0;c--)r=p.snapElements[c].left,h=r+p.snapElements[c].width,l=p.snapElements[c].top,u=l+p.snapElements[c].height,r-m>v||g>h+m||l-m>y||b>u+m||!e.contains(p.snapElements[c].item.ownerDocument,p.snapElements[c].item)?(p.snapElements[c].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(s=m>=Math.abs(l-y),n=m>=Math.abs(u-b),a=m>=Math.abs(r-v),o=m>=Math.abs(h-g),s&&(i.position.top=p._convertPositionTo("relative",{top:l-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:u,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h}).left-p.margins.left)),d=s||n||a||o,"outer"!==f.snapMode&&(s=m>=Math.abs(l-b),n=m>=Math.abs(u-y),a=m>=Math.abs(r-g),o=m>=Math.abs(h-v),s&&(i.position.top=p._convertPositionTo("relative",{top:l,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:u-p.helperProportions.height,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[c].snapping&&(s||n||a||o||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=s||n||a||o||d)}}),e.ui.plugin.add("draggable","stack",{start:function(){var t,i=this.data("ui-draggable").options,s=e.makeArray(e(i.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});s.length&&(t=parseInt(e(s[0]).css("zIndex"),10)||0,e(s).each(function(i){e(this).css("zIndex",t+i)}),this.css("zIndex",t+s.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i){var s=e(i.helper),n=e(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(t,i){var s=e(this).data("ui-draggable").options;s._zIndex&&e(i.helper).css("zIndex",s._zIndex)}})})(jQuery);
\ No newline at end of file
index a759e7e78ea3bb1e9310f1cf8d7a4f7929de0e1f..ba7b19400320583d00126d18dd2f1bd4b22eba60 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.droppable.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){e.widget("ui.droppable",{version:"1.9.2",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var t=this.options,n=t.accept;this.isover=0,this.isout=1,this.accept=e.isFunction(n)?n:function(e){return e.is(n)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[],e.ui.ddmanager.droppables[t.scope].push(this),t.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];for(var n=0;n<t.length;n++)t[n]==this&&t.splice(n,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,n){t=="accept"&&(this.accept=e.isFunction(n)?n:function(e){return e.is(n)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),n&&this._trigger("activate",t,this.ui(n))},_deactivate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),n&&this._trigger("deactivate",t,this.ui(n))},_over:function(t){var n=e.ui.ddmanager.current;if(!n||(n.currentItem||n.element)[0]==this.element[0])return;this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(n)))},_out:function(t){var n=e.ui.ddmanager.current;if(!n||(n.currentItem||n.element)[0]==this.element[0])return;this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(n)))},_drop:function(t,n){var r=n||e.ui.ddmanager.current;if(!r||(r.currentItem||r.element)[0]==this.element[0])return!1;var i=!1;return this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"droppable");if(t.options.greedy&&!t.options.disabled&&t.options.scope==r.options.scope&&t.accept.call(t.element[0],r.currentItem||r.element)&&e.ui.intersect(r,e.extend(t,{offset:t.element.offset()}),t.options.tolerance))return i=!0,!1}),i?!1:this.accept.call(this.element[0],r.currentItem||r.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(r)),this.element):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(t,n,r){if(!n.offset)return!1;var i=(t.positionAbs||t.position.absolute).left,s=i+t.helperProportions.width,o=(t.positionAbs||t.position.absolute).top,u=o+t.helperProportions.height,a=n.offset.left,f=a+n.proportions.width,l=n.offset.top,c=l+n.proportions.height;switch(r){case"fit":return a<=i&&s<=f&&l<=o&&u<=c;case"intersect":return a<i+t.helperProportions.width/2&&s-t.helperProportions.width/2<f&&l<o+t.helperProportions.height/2&&u-t.helperProportions.height/2<c;case"pointer":var h=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,p=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,d=e.ui.isOver(p,h,l,a,n.proportions.height,n.proportions.width);return d;case"touch":return(o>=l&&o<=c||u>=l&&u<=c||o<l&&u>c)&&(i>=a&&i<=f||s>=a&&s<=f||i<a&&s>f);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,n){var r=e.ui.ddmanager.droppables[t.options.scope]||[],i=n?n.type:null,s=(t.currentItem||t.element).find(":data(droppable)").andSelf();e:for(var o=0;o<r.length;o++){if(r[o].options.disabled||t&&!r[o].accept.call(r[o].element[0],t.currentItem||t.element))continue;for(var u=0;u<s.length;u++)if(s[u]==r[o].element[0]){r[o].proportions.height=0;continue e}r[o].visible=r[o].element.css("display")!="none";if(!r[o].visible)continue;i=="mousedown"&&r[o]._activate.call(r[o],n),r[o].offset=r[o].element.offset(),r[o].proportions={width:r[o].element[0].offsetWidth,height:r[o].element[0].offsetHeight}}},drop:function(t,n){var r=!1;return e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options)return;!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(r=this._drop.call(this,n)||r),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,n))}),r},dragStart:function(t,n){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)})},drag:function(t,n){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,n),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var r=e.ui.intersect(t,this,this.options.tolerance),i=!r&&this.isover==1?"isout":r&&this.isover==0?"isover":null;if(!i)return;var s;if(this.options.greedy){var o=this.options.scope,u=this.element.parents(":data(droppable)").filter(function(){return e.data(this,"droppable").options.scope===o});u.length&&(s=e.data(u[0],"droppable"),s.greedyChild=i=="isover"?1:0)}s&&i=="isover"&&(s.isover=0,s.isout=1,s._out.call(s,n)),this[i]=1,this[i=="isout"?"isover":"isout"]=0,this[i=="isover"?"_over":"_out"].call(this,n),s&&i=="isout"&&(s.isout=0,s.isover=1,s._over.call(s,n))})},dragStop:function(t,n){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}}})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(e){function t(e,t,i){return e>t&&t+i>e}e.widget("ui.droppable",{version:"1.10.3",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t=this.options,i=t.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(i)?i:function(e){return e.is(i)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[],e.ui.ddmanager.droppables[t.scope].push(this),t.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var t=0,i=e.ui.ddmanager.droppables[this.options.scope];i.length>t;t++)i[t]===this&&i.splice(t,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){"accept"===t&&(this.accept=e.isFunction(i)?i:function(e){return e.is(i)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"ui-droppable");return t.options.greedy&&!t.options.disabled&&t.options.scope===s.options.scope&&t.accept.call(t.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(t,{offset:t.element.offset()}),t.options.tolerance)?(n=!0,!1):undefined}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(e,i,s){if(!i.offset)return!1;var n,a,o=(e.positionAbs||e.position.absolute).left,r=o+e.helperProportions.width,h=(e.positionAbs||e.position.absolute).top,l=h+e.helperProportions.height,u=i.offset.left,c=u+i.proportions.width,d=i.offset.top,p=d+i.proportions.height;switch(s){case"fit":return o>=u&&c>=r&&h>=d&&p>=l;case"intersect":return o+e.helperProportions.width/2>u&&c>r-e.helperProportions.width/2&&h+e.helperProportions.height/2>d&&p>l-e.helperProportions.height/2;case"pointer":return n=(e.positionAbs||e.position.absolute).left+(e.clickOffset||e.offset.click).left,a=(e.positionAbs||e.position.absolute).top+(e.clickOffset||e.offset.click).top,t(a,d,i.proportions.height)&&t(n,u,i.proportions.width);case"touch":return(h>=d&&p>=h||l>=d&&p>=l||d>h&&l>p)&&(o>=u&&c>=o||r>=u&&c>=r||u>o&&r>c);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions.height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions={width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight})}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e.data(this,"ui-droppable").options.scope===n}),a.length&&(s=e.data(a[0],"ui-droppable"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}}})(jQuery);
\ No newline at end of file
index 9a40194760371d8c05926aca549d5aade7ff8e72..ea34c3ccdd03eb7756d4e550d87676cb187d8047 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.effect-blind.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){var n=/up|down|vertical/,r=/up|left|vertical|horizontal/;e.effects.effect.blind=function(t,i){var s=e(this),o=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(s,t.mode||"hide"),a=t.direction||"up",f=n.test(a),l=f?"height":"width",c=f?"top":"left",h=r.test(a),p={},d=u==="show",v,m,g;s.parent().is(".ui-effects-wrapper")?e.effects.save(s.parent(),o):e.effects.save(s,o),s.show(),v=e.effects.createWrapper(s).css({overflow:"hidden"}),m=v[l](),g=parseFloat(v.css(c))||0,p[l]=d?m:0,h||(s.css(f?"bottom":"right",0).css(f?"top":"left","auto").css({position:"absolute"}),p[c]=d?g:m+g),d&&(v.css(l,0),h||v.css(c,g+m)),v.animate(p,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){u==="hide"&&s.hide(),e.effects.restore(s,o),e.effects.removeWrapper(s),i()}})}})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){var e=/up|down|vertical/,i=/up|left|vertical|horizontal/;t.effects.effect.blind=function(s,n){var a,o,r,h=t(this),l=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(h,s.mode||"hide"),u=s.direction||"up",d=e.test(u),p=d?"height":"width",f=d?"top":"left",m=i.test(u),g={},v="show"===c;h.parent().is(".ui-effects-wrapper")?t.effects.save(h.parent(),l):t.effects.save(h,l),h.show(),a=t.effects.createWrapper(h).css({overflow:"hidden"}),o=a[p](),r=parseFloat(a.css(f))||0,g[p]=v?o:0,m||(h.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),g[f]=v?r:o+r),v&&(a.css(p,0),m||a.css(f,r+o)),a.animate(g,{duration:s.duration,easing:s.easing,queue:!1,complete:function(){"hide"===c&&h.hide(),t.effects.restore(h,l),t.effects.removeWrapper(h),n()}})}})(jQuery);
\ No newline at end of file
index 4edb4ebe3c8397f7dd3318ce060580f59e53a15f..05a74f6eb7ef4267d64d33fd75e29ad9cc0e44ce 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.effect-bounce.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){e.effects.effect.bounce=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=s==="hide",u=s==="show",a=t.direction||"up",f=t.distance,l=t.times||5,c=l*2+(u||o?1:0),h=t.duration/c,p=t.easing,d=a==="up"||a==="down"?"top":"left",v=a==="up"||a==="left",m,g,y,b=r.queue(),w=b.length;(u||o)&&i.push("opacity"),e.effects.save(r,i),r.show(),e.effects.createWrapper(r),f||(f=r[d==="top"?"outerHeight":"outerWidth"]()/3),u&&(y={opacity:1},y[d]=0,r.css("opacity",0).css(d,v?-f*2:f*2).animate(y,h,p)),o&&(f/=Math.pow(2,l-1)),y={},y[d]=0;for(m=0;m<l;m++)g={},g[d]=(v?"-=":"+=")+f,r.animate(g,h,p).animate(y,h,p),f=o?f*2:f/2;o&&(g={opacity:0},g[d]=(v?"-=":"+=")+f,r.animate(g,h,p)),r.queue(function(){o&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}),w>1&&b.splice.apply(b,[1,0].concat(b.splice(w,c+1))),r.dequeue()}})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){t.effects.effect.bounce=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(o,e.mode||"effect"),l="hide"===h,c="show"===h,u=e.direction||"up",d=e.distance,p=e.times||5,f=2*p+(c||l?1:0),m=e.duration/f,g=e.easing,v="up"===u||"down"===u?"top":"left",_="up"===u||"left"===u,b=o.queue(),y=b.length;for((c||l)&&r.push("opacity"),t.effects.save(o,r),o.show(),t.effects.createWrapper(o),d||(d=o["top"===v?"outerHeight":"outerWidth"]()/3),c&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,_?2*-d:2*d).animate(a,m,g)),l&&(d/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(_?"-=":"+=")+d,o.animate(n,m,g).animate(a,m,g),d=l?2*d:d/2;l&&(n={opacity:0},n[v]=(_?"-=":"+=")+d,o.animate(n,m,g)),o.queue(function(){l&&o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),o.dequeue()}})(jQuery);
\ No newline at end of file
index e84de1eaf9659c32d8bc17eed8d177ae0ae4729c..5b15f8ef0ac9a9ef506e8cdd1b50c73604c03f5a 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.effect-clip.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){e.effects.effect.clip=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"vertical",a=u==="vertical",f=a?"height":"width",l=a?"top":"left",c={},h,p,d;e.effects.save(r,i),r.show(),h=e.effects.createWrapper(r).css({overflow:"hidden"}),p=r[0].tagName==="IMG"?h:r,d=p[f](),o&&(p.css(f,0),p.css(l,d/2)),c[f]=o?d:0,c[l]=o?0:d/2,p.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o||r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){t.effects.effect.clip=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(o,e.mode||"hide"),l="show"===h,c=e.direction||"vertical",u="vertical"===c,d=u?"height":"width",p=u?"top":"left",f={};t.effects.save(o,r),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[d](),l&&(n.css(d,0),n.css(p,a/2)),f[d]=l?a:0,f[p]=l?0:a/2,n.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){l||o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}})}})(jQuery);
\ No newline at end of file
index c4d1be8a2f7c2b4411693b36ae9b9e9c3c7154ff..02d148a1619522f692247b3679691a0537aa1093 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.effect-drop.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){e.effects.effect.drop=function(t,n){var r=e(this),i=["position","top","bottom","left","right","opacity","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left"?"pos":"neg",l={opacity:o?1:0},c;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),c=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0)/2,o&&r.css("opacity",0).css(a,f==="pos"?-c:c),l[a]=(o?f==="pos"?"+=":"-=":f==="pos"?"-=":"+=")+c,r.animate(l,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){t.effects.effect.drop=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","opacity","height","width"],o=t.effects.setMode(n,e.mode||"hide"),r="show"===o,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h?"pos":"neg",u={opacity:r?1:0};t.effects.save(n,a),n.show(),t.effects.createWrapper(n),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===c?-s:s),u[l]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);
\ No newline at end of file
index 81db79c3687fdb16031150382818d3100df01607..096ff58f5927bc5565136b70526a3afc8c2f6db5 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.effect-explode.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){e.effects.effect.explode=function(t,n){function y(){c.push(this),c.length===r*i&&b()}function b(){s.css({visibility:"visible"}),e(c).remove(),u||s.hide(),n()}var r=t.pieces?Math.round(Math.sqrt(t.pieces)):3,i=r,s=e(this),o=e.effects.setMode(s,t.mode||"hide"),u=o==="show",a=s.show().css("visibility","hidden").offset(),f=Math.ceil(s.outerWidth()/i),l=Math.ceil(s.outerHeight()/r),c=[],h,p,d,v,m,g;for(h=0;h<r;h++){v=a.top+h*l,g=h-(r-1)/2;for(p=0;p<i;p++)d=a.left+p*f,m=p-(i-1)/2,s.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-p*f,top:-h*l}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:f,height:l,left:d+(u?m*f:0),top:v+(u?g*l:0),opacity:u?0:1}).animate({left:d+(u?0:m*f),top:v+(u?0:g*l),opacity:u?1:0},t.duration||500,t.easing,y)}}})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){t.effects.effect.explode=function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),m||p.hide(),i()}var a,o,r,h,l,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=t.effects.setMode(p,e.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/d),_=Math.ceil(p.outerHeight()/u),b=[];for(a=0;u>a;a++)for(h=g.top+a*_,c=a-(u-1)/2,o=0;d>o;o++)r=g.left+o*v,l=o-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*_}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:_,left:r+(m?l*v:0),top:h+(m?c*_:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:c*_),opacity:m?1:0},e.duration||500,e.easing,s)}})(jQuery);
\ No newline at end of file
index f5d93d2ed06cc7969d434c2a7a4543933f837e31..09d3a0ec0453fee942669cc3fe550515faa2eaa7 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.effect-fade.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){e.effects.effect.fade=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"toggle");r.animate({opacity:i},{queue:!1,duration:t.duration,easing:t.easing,complete:n})}})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){t.effects.effect.fade=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}})(jQuery);
\ No newline at end of file
index dd37ef0f559d55153f8b6f963d916f9c9eb068a5..6b323bcd3eb106d6dae1de667435ee0ce42f07eb 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.effect-fold.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){e.effects.effect.fold=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"hide"),o=s==="show",u=s==="hide",a=t.size||15,f=/([0-9]+)%/.exec(a),l=!!t.horizFirst,c=o!==l,h=c?["width","height"]:["height","width"],p=t.duration/2,d,v,m={},g={};e.effects.save(r,i),r.show(),d=e.effects.createWrapper(r).css({overflow:"hidden"}),v=c?[d.width(),d.height()]:[d.height(),d.width()],f&&(a=parseInt(f[1],10)/100*v[u?0:1]),o&&d.css(l?{height:0,width:a}:{height:a,width:0}),m[h[0]]=o?v[0]:a,g[h[1]]=o?v[1]:0,d.animate(m,p,t.easing).animate(g,p,t.easing,function(){u&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()})}})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){t.effects.effect.fold=function(e,i){var s,n,a=t(this),o=["position","top","bottom","left","right","height","width"],r=t.effects.setMode(a,e.mode||"hide"),h="show"===r,l="hide"===r,c=e.size||15,u=/([0-9]+)%/.exec(c),d=!!e.horizFirst,p=h!==d,f=p?["width","height"]:["height","width"],m=e.duration/2,g={},v={};t.effects.save(a,o),a.show(),s=t.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],u&&(c=parseInt(u[1],10)/100*n[l?0:1]),h&&s.css(d?{height:0,width:c}:{height:c,width:0}),g[f[0]]=h?n[0]:c,v[f[1]]=h?n[1]:0,s.animate(g,m,e.easing).animate(v,m,e.easing,function(){l&&a.hide(),t.effects.restore(a,o),t.effects.removeWrapper(a),i()})}})(jQuery);
\ No newline at end of file
index 88a27b7c62c03aba09a49700c0570a7670c5a229..8aac9b31470050129f2ea0a0e7b2da145542eef6 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.effect-highlight.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){e.effects.effect.highlight=function(t,n){var r=e(this),i=["backgroundImage","backgroundColor","opacity"],s=e.effects.setMode(r,t.mode||"show"),o={backgroundColor:r.css("backgroundColor")};s==="hide"&&(o.opacity=0),e.effects.save(r,i),r.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),n()}})}})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){t.effects.effect.highlight=function(e,i){var s=t(this),n=["backgroundImage","backgroundColor","opacity"],a=t.effects.setMode(s,e.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),t.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(o,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&s.hide(),t.effects.restore(s,n),i()}})}})(jQuery);
\ No newline at end of file
index 362f067682bfea160c7729596fd5fa11cc1a4d44..1338dfa979b0cbfa6660a7c6e2b84f2d83cce126 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.effect-pulsate.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){e.effects.effect.pulsate=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"show"),s=i==="show",o=i==="hide",u=s||i==="hide",a=(t.times||5)*2+(u?1:0),f=t.duration/a,l=0,c=r.queue(),h=c.length,p;if(s||!r.is(":visible"))r.css("opacity",0).show(),l=1;for(p=1;p<a;p++)r.animate({opacity:l},f,t.easing),l=1-l;r.animate({opacity:l},f,t.easing),r.queue(function(){o&&r.hide(),n()}),h>1&&c.splice.apply(c,[1,0].concat(c.splice(h,a+1))),r.dequeue()}})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){t.effects.effect.pulsate=function(e,i){var s,n=t(this),a=t.effects.setMode(n,e.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(e.times||5)+(h?1:0),c=e.duration/l,u=0,d=n.queue(),p=d.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),u=1),s=1;l>s;s++)n.animate({opacity:u},c,e.easing),u=1-u;n.animate({opacity:u},c,e.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,l+1))),n.dequeue()}})(jQuery);
\ No newline at end of file
index 8edb3daceee8758999e306c4c7a0ac6ec0153c59..0be8b0f317c17292710a7e156df3d8794fe2986e 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.effect-scale.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){e.effects.effect.puff=function(t,n){var r=e(this),i=e.effects.setMode(r,t.mode||"hide"),s=i==="hide",o=parseInt(t.percent,10)||150,u=o/100,a={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:i,complete:n,percent:s?o:100,from:s?a:{height:a.height*u,width:a.width*u,outerHeight:a.outerHeight*u,outerWidth:a.outerWidth*u}}),r.effect(t)},e.effects.effect.scale=function(t,n){var r=e(this),i=e.extend(!0,{},t),s=e.effects.setMode(r,t.mode||"effect"),o=parseInt(t.percent,10)||(parseInt(t.percent,10)===0?0:s==="hide"?0:100),u=t.direction||"both",a=t.origin,f={height:r.height(),width:r.width(),outerHeight:r.outerHeight(),outerWidth:r.outerWidth()},l={y:u!=="horizontal"?o/100:1,x:u!=="vertical"?o/100:1};i.effect="size",i.queue=!1,i.complete=n,s!=="effect"&&(i.origin=a||["middle","center"],i.restore=!0),i.from=t.from||(s==="show"?{height:0,width:0,outerHeight:0,outerWidth:0}:f),i.to={height:f.height*l.y,width:f.width*l.x,outerHeight:f.outerHeight*l.y,outerWidth:f.outerWidth*l.x},i.fade&&(s==="show"&&(i.from.opacity=0,i.to.opacity=1),s==="hide"&&(i.from.opacity=1,i.to.opacity=0)),r.effect(i)},e.effects.effect.size=function(t,n){var r,i,s,o=e(this),u=["position","top","bottom","left","right","width","height","overflow","opacity"],a=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],l=["fontSize"],c=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),d=t.restore||p!=="effect",v=t.scale||"both",m=t.origin||["middle","center"],g=o.css("position"),y=d?u:a,b={height:0,width:0,outerHeight:0,outerWidth:0};p==="show"&&o.show(),r={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},t.mode==="toggle"&&p==="show"?(o.from=t.to||b,o.to=t.from||r):(o.from=t.from||(p==="show"?b:r),o.to=t.to||(p==="hide"?b:r)),s={from:{y:o.from.height/r.height,x:o.from.width/r.width},to:{y:o.to.height/r.height,x:o.to.width/r.width}};if(v==="box"||v==="both")s.from.y!==s.to.y&&(y=y.concat(c),o.from=e.effects.setTransition(o,c,s.from.y,o.from),o.to=e.effects.setTransition(o,c,s.to.y,o.to)),s.from.x!==s.to.x&&(y=y.concat(h),o.from=e.effects.setTransition(o,h,s.from.x,o.from),o.to=e.effects.setTransition(o,h,s.to.x,o.to));(v==="content"||v==="both")&&s.from.y!==s.to.y&&(y=y.concat(l).concat(f),o.from=e.effects.setTransition(o,l,s.from.y,o.from),o.to=e.effects.setTransition(o,l,s.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),m&&(i=e.effects.getBaseline(m,r),o.from.top=(r.outerHeight-o.outerHeight())*i.y,o.from.left=(r.outerWidth-o.outerWidth())*i.x,o.to.top=(r.outerHeight-o.to.outerHeight)*i.y,o.to.left=(r.outerWidth-o.to.outerWidth)*i.x),o.css(o.from);if(v==="content"||v==="both")c=c.concat(["marginTop","marginBottom"]).concat(l),h=h.concat(["marginLeft","marginRight"]),f=u.concat(c).concat(h),o.find("*[width]").each(function(){var n=e(this),r={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()};d&&e.effects.save(n,f),n.from={height:r.height*s.from.y,width:r.width*s.from.x,outerHeight:r.outerHeight*s.from.y,outerWidth:r.outerWidth*s.from.x},n.to={height:r.height*s.to.y,width:r.width*s.to.x,outerHeight:r.height*s.to.y,outerWidth:r.width*s.to.x},s.from.y!==s.to.y&&(n.from=e.effects.setTransition(n,c,s.from.y,n.from),n.to=e.effects.setTransition(n,c,s.to.y,n.to)),s.from.x!==s.to.x&&(n.from=e.effects.setTransition(n,h,s.from.x,n.from),n.to=e.effects.setTransition(n,h,s.to.x,n.to)),n.css(n.from),n.animate(n.to,t.duration,t.easing,function(){d&&e.effects.restore(n,f)})});o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){o.to.opacity===0&&o.css("opacity",o.from.opacity),p==="hide"&&o.hide(),e.effects.restore(o,y),d||(g==="static"?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,n){var r=parseInt(n,10),i=e?o.to.left:o.to.top;return n==="auto"?i+"px":r+i+"px"})})),e.effects.removeWrapper(o),n()}})}})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){t.effects.effect.puff=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"hide"),a="hide"===n,o=parseInt(e.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(e)},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),a=t.effects.setMode(s,e.mode||"effect"),o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===a?0:100),r=e.direction||"both",h=e.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=e.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*c.y,width:l.width*c.x,outerHeight:l.outerHeight*c.y,outerWidth:l.outerWidth*c.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},t.effects.effect.size=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],c=["fontSize"],u=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],d=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=t.effects.setMode(o,e.mode||"effect"),f=e.restore||"effect"!==p,m=e.scale||"both",g=e.origin||["middle","center"],v=o.css("position"),_=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===e.mode&&"show"===p?(o.from=e.to||b,o.to=e.from||s):(o.from=e.from||("show"===p?b:s),o.to=e.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===m||"both"===m)&&(a.from.y!==a.to.y&&(_=_.concat(u),o.from=t.effects.setTransition(o,u,a.from.y,o.from),o.to=t.effects.setTransition(o,u,a.to.y,o.to)),a.from.x!==a.to.x&&(_=_.concat(d),o.from=t.effects.setTransition(o,d,a.from.x,o.from),o.to=t.effects.setTransition(o,d,a.to.x,o.to))),("content"===m||"both"===m)&&a.from.y!==a.to.y&&(_=_.concat(c).concat(l),o.from=t.effects.setTransition(o,c,a.from.y,o.from),o.to=t.effects.setTransition(o,c,a.to.y,o.to)),t.effects.save(o,_),o.show(),t.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=t.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===m||"both"===m)&&(u=u.concat(["marginTop","marginBottom"]).concat(c),d=d.concat(["marginLeft","marginRight"]),l=r.concat(u).concat(d),o.find("*[width]").each(function(){var i=t(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&t.effects.save(i,l),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=t.effects.setTransition(i,u,a.from.y,i.from),i.to=t.effects.setTransition(i,u,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=t.effects.setTransition(i,d,a.from.x,i.from),i.to=t.effects.setTransition(i,d,a.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){f&&t.effects.restore(i,l)})})),o.animate(o.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),t.effects.restore(o,_),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):t.each(["top","left"],function(t,e){o.css(e,function(e,i){var s=parseInt(i,10),n=t?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(o),i()}})}})(jQuery);
\ No newline at end of file
index dcbf83ef97e08b00fac8d0b496cfab831ed15f9a..8bfffec5f06869dae4163d60235d30679d71bd5c 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.effect-shake.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){e.effects.effect.shake=function(t,n){var r=e(this),i=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(r,t.mode||"effect"),o=t.direction||"left",u=t.distance||20,a=t.times||3,f=a*2+1,l=Math.round(t.duration/f),c=o==="up"||o==="down"?"top":"left",h=o==="up"||o==="left",p={},d={},v={},m,g=r.queue(),y=g.length;e.effects.save(r,i),r.show(),e.effects.createWrapper(r),p[c]=(h?"-=":"+=")+u,d[c]=(h?"+=":"-=")+u*2,v[c]=(h?"-=":"+=")+u*2,r.animate(p,l,t.easing);for(m=1;m<a;m++)r.animate(d,l,t.easing).animate(v,l,t.easing);r.animate(d,l,t.easing).animate(p,l/2,t.easing).queue(function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}),y>1&&g.splice.apply(g,[1,0].concat(g.splice(y,f+1))),r.dequeue()}})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){t.effects.effect.shake=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(n,e.mode||"effect"),r=e.direction||"left",h=e.distance||20,l=e.times||3,c=2*l+1,u=Math.round(e.duration/c),d="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},v=n.queue(),_=v.length;for(t.effects.save(n,a),n.show(),t.effects.createWrapper(n),f[d]=(p?"-=":"+=")+h,m[d]=(p?"+=":"-=")+2*h,g[d]=(p?"-=":"+=")+2*h,n.animate(f,u,e.easing),s=1;l>s;s++)n.animate(m,u,e.easing).animate(g,u,e.easing);n.animate(m,u,e.easing).animate(f,u/2,e.easing).queue(function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,c+1))),n.dequeue()}})(jQuery);
\ No newline at end of file
index d93f8432a0a5e3f176281c38861ac0a87ba015ed..b3de22e04f291f7435312722a3bd81a2ced2e35b 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.effect-slide.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){e.effects.effect.slide=function(t,n){var r=e(this),i=["position","top","bottom","left","right","width","height"],s=e.effects.setMode(r,t.mode||"show"),o=s==="show",u=t.direction||"left",a=u==="up"||u==="down"?"top":"left",f=u==="up"||u==="left",l,c={};e.effects.save(r,i),r.show(),l=t.distance||r[a==="top"?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(r).css({overflow:"hidden"}),o&&r.css(a,f?isNaN(l)?"-"+l:-l:l),c[a]=(o?f?"+=":"-=":f?"-=":"+=")+l,r.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){s==="hide"&&r.hide(),e.effects.restore(r,i),e.effects.removeWrapper(r),n()}})}})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){t.effects.effect.slide=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","width","height"],o=t.effects.setMode(n,e.mode||"show"),r="show"===o,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u={};t.effects.save(n,a),n.show(),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,c?isNaN(s)?"-"+s:-s:s),u[l]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery);
\ No newline at end of file
index 4cd52a4d0c4874813c8da0953dc7eb0dd400059d..cec83690d85d46013ea7024a074d0ba8b16279b6 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.effect-transfer.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){e.effects.effect.transfer=function(t,n){var r=e(this),i=e(t.to),s=i.css("position")==="fixed",o=e("body"),u=s?o.scrollTop():0,a=s?o.scrollLeft():0,f=i.offset(),l={top:f.top-u,left:f.left-a,height:i.innerHeight(),width:i.innerWidth()},c=r.offset(),h=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(t.className).css({top:c.top-u,left:c.left-a,height:r.innerHeight(),width:r.innerWidth(),position:s?"fixed":"absolute"}).animate(l,t.duration,t.easing,function(){h.remove(),n()})}})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){t.effects.effect.transfer=function(e,i){var s=t(this),n=t(e.to),a="fixed"===n.css("position"),o=t("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}})(jQuery);
\ No newline at end of file
index e1c87a7e94741f694bdfe01fc4706aaa3dccad3d..50fbc7992bfbc51c7d396dee97410ce5b273bbd3 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.effect.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-jQuery.effects||function(e,t){var n=e.uiBackCompat!==!1,r="ui-effects-";e.effects={effect:{}},function(t,n){function p(e,t,n){var r=a[t.type]||{};return e==null?n||!t.def?null:t.def:(e=r.floor?~~e:parseFloat(e),isNaN(e)?t.def:r.mod?(e+r.mod)%r.mod:0>e?0:r.max<e?r.max:e)}function d(e){var n=o(),r=n._rgba=[];return e=e.toLowerCase(),h(s,function(t,i){var s,o=i.re.exec(e),a=o&&i.parse(o),f=i.space||"rgba";if(a)return s=n[f](a),n[u[f].cache]=s[u[f].cache],r=n._rgba=s._rgba,!1}),r.length?(r.join()==="0,0,0,0"&&t.extend(r,c.transparent),n):c[e]}function v(e,t,n){return n=(n+1)%1,n*6<1?e+(t-e)*n*6:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}var r="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor".split(" "),i=/^([\-+])=\s*(\d+\.?\d*)/,s=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1]*2.55,e[2]*2.55,e[3]*2.55,e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],o=t.Color=function(e,n,r,i){return new t.Color.fn.parse(e,n,r,i)},u={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},a={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},f=o.support={},l=t("<p>")[0],c,h=t.each;l.style.cssText="background-color:rgba(1,1,1,.5)",f.rgba=l.style.backgroundColor.indexOf("rgba")>-1,h(u,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),o.fn=t.extend(o.prototype,{parse:function(r,i,s,a){if(r===n)return this._rgba=[null,null,null,null],this;if(r.jquery||r.nodeType)r=t(r).css(i),i=n;var f=this,l=t.type(r),v=this._rgba=[];i!==n&&(r=[r,i,s,a],l="array");if(l==="string")return this.parse(d(r)||c._default);if(l==="array")return h(u.rgba.props,function(e,t){v[t.idx]=p(r[t.idx],t)}),this;if(l==="object")return r instanceof o?h(u,function(e,t){r[t.cache]&&(f[t.cache]=r[t.cache].slice())}):h(u,function(t,n){var i=n.cache;h(n.props,function(e,t){if(!f[i]&&n.to){if(e==="alpha"||r[e]==null)return;f[i]=n.to(f._rgba)}f[i][t.idx]=p(r[e],t,!0)}),f[i]&&e.inArray(null,f[i].slice(0,3))<0&&(f[i][3]=1,n.from&&(f._rgba=n.from(f[i])))}),this},is:function(e){var t=o(e),n=!0,r=this;return h(u,function(e,i){var s,o=t[i.cache];return o&&(s=r[i.cache]||i.to&&i.to(r._rgba)||[],h(i.props,function(e,t){if(o[t.idx]!=null)return n=o[t.idx]===s[t.idx],n})),n}),n},_space:function(){var e=[],t=this;return h(u,function(n,r){t[r.cache]&&e.push(n)}),e.pop()},transition:function(e,t){var n=o(e),r=n._space(),i=u[r],s=this.alpha()===0?o("transparent"):this,f=s[i.cache]||i.to(s._rgba),l=f.slice();return n=n[i.cache],h(i.props,function(e,r){var i=r.idx,s=f[i],o=n[i],u=a[r.type]||{};if(o===null)return;s===null?l[i]=o:(u.mod&&(o-s>u.mod/2?s+=u.mod:s-o>u.mod/2&&(s-=u.mod)),l[i]=p((o-s)*t+s,r))}),this[r](l)},blend:function(e){if(this._rgba[3]===1)return this;var n=this._rgba.slice(),r=n.pop(),i=o(e)._rgba;return o(t.map(n,function(e,t){return(1-r)*i[t]+r*e}))},toRgbaString:function(){var e="rgba(",n=t.map(this._rgba,function(e,t){return e==null?t>2?1:0:e});return n[3]===1&&(n.pop(),e="rgb("),e+n.join()+")"},toHslaString:function(){var e="hsla(",n=t.map(this.hsla(),function(e,t){return e==null&&(e=t>2?1:0),t&&t<3&&(e=Math.round(e*100)+"%"),e});return n[3]===1&&(n.pop(),e="hsl("),e+n.join()+")"},toHexString:function(e){var n=this._rgba.slice(),r=n.pop();return e&&n.push(~~(r*255)),"#"+t.map(n,function(e){return e=(e||0).toString(16),e.length===1?"0"+e:e}).join("")},toString:function(){return this._rgba[3]===0?"transparent":this.toRgbaString()}}),o.fn.parse.prototype=o.fn,u.hsla.to=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=e[3],s=Math.max(t,n,r),o=Math.min(t,n,r),u=s-o,a=s+o,f=a*.5,l,c;return o===s?l=0:t===s?l=60*(n-r)/u+360:n===s?l=60*(r-t)/u+120:l=60*(t-n)/u+240,f===0||f===1?c=f:f<=.5?c=u/a:c=u/(2-a),[Math.round(l)%360,c,f,i==null?1:i]},u.hsla.from=function(e){if(e[0]==null||e[1]==null||e[2]==null)return[null,null,null,e[3]];var t=e[0]/360,n=e[1],r=e[2],i=e[3],s=r<=.5?r*(1+n):r+n-r*n,o=2*r-s;return[Math.round(v(o,s,t+1/3)*255),Math.round(v(o,s,t)*255),Math.round(v(o,s,t-1/3)*255),i]},h(u,function(e,r){var s=r.props,u=r.cache,a=r.to,f=r.from;o.fn[e]=function(e){a&&!this[u]&&(this[u]=a(this._rgba));if(e===n)return this[u].slice();var r,i=t.type(e),l=i==="array"||i==="object"?e:arguments,c=this[u].slice();return h(s,function(e,t){var n=l[i==="object"?e:t.idx];n==null&&(n=c[t.idx]),c[t.idx]=p(n,t)}),f?(r=o(f(c)),r[u]=c,r):o(c)},h(s,function(n,r){if(o.fn[n])return;o.fn[n]=function(s){var o=t.type(s),u=n==="alpha"?this._hsla?"hsla":"rgba":e,a=this[u](),f=a[r.idx],l;return o==="undefined"?f:(o==="function"&&(s=s.call(this,f),o=t.type(s)),s==null&&r.empty?this:(o==="string"&&(l=i.exec(s),l&&(s=f+parseFloat(l[2])*(l[1]==="+"?1:-1))),a[r.idx]=s,this[u](a)))}})}),h(r,function(e,n){t.cssHooks[n]={set:function(e,r){var i,s,u="";if(t.type(r)!=="string"||(i=d(r))){r=o(i||r);if(!f.rgba&&r._rgba[3]!==1){s=n==="backgroundColor"?e.parentNode:e;while((u===""||u==="transparent")&&s&&s.style)try{u=t.css(s,"backgroundColor"),s=s.parentNode}catch(a){}r=r.blend(u&&u!=="transparent"?u:"_default")}r=r.toRgbaString()}try{e.style[n]=r}catch(l){}}},t.fx.step[n]=function(e){e.colorInit||(e.start=o(e.elem,n),e.end=o(e.end),e.colorInit=!0),t.cssHooks[n].set(e.elem,e.start.transition(e.end,e.pos))}}),t.cssHooks.borderColor={expand:function(e){var t={};return h(["Top","Right","Bottom","Left"],function(n,r){t["border"+r+"Color"]=e}),t}},c=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(){var t=this.ownerDocument.defaultView?this.ownerDocument.defaultView.getComputedStyle(this,null):this.currentStyle,n={},r,i;if(t&&t.length&&t[0]&&t[t[0]]){i=t.length;while(i--)r=t[i],typeof t[r]=="string"&&(n[e.camelCase(r)]=t[r])}else for(r in t)typeof t[r]=="string"&&(n[r]=t[r]);return n}function s(t,n){var i={},s,o;for(s in n)o=n[s],t[s]!==o&&!r[s]&&(e.fx.step[s]||!isNaN(parseFloat(o)))&&(i[s]=o);return i}var n=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,n){e.fx.step[n]=function(e){if(e.end!=="none"&&!e.setAttr||e.pos===1&&!e.setAttr)jQuery.style(e.elem,n,e.end),e.setAttr=!0}}),e.effects.animateClass=function(t,r,o,u){var a=e.speed(r,o,u);return this.queue(function(){var r=e(this),o=r.attr("class")||"",u,f=a.children?r.find("*").andSelf():r;f=f.map(function(){var t=e(this);return{el:t,start:i.call(this)}}),u=function(){e.each(n,function(e,n){t[n]&&r[n+"Class"](t[n])})},u(),f=f.map(function(){return this.end=i.call(this.el[0]),this.diff=s(this.start,this.end),this}),r.attr("class",o),f=f.map(function(){var t=this,n=e.Deferred(),r=jQuery.extend({},a,{queue:!1,complete:function(){n.resolve(t)}});return this.el.animate(this.diff,r),n.promise()}),e.when.apply(e,f.get()).done(function(){u(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),a.complete.call(r[0])})})},e.fn.extend({_addClass:e.fn.addClass,addClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{add:t},n,r,i):this._addClass(t)},_removeClass:e.fn.removeClass,removeClass:function(t,n,r,i){return n?e.effects.animateClass.call(this,{remove:t},n,r,i):this._removeClass(t)},_toggleClass:e.fn.toggleClass,toggleClass:function(n,r,i,s,o){return typeof r=="boolean"||r===t?i?e.effects.animateClass.call(this,r?{add:n}:{remove:n},i,s,o):this._toggleClass(n,r):e.effects.animateClass.call(this,{toggle:n},r,i,s)},switchClass:function(t,n,r,i,s){return e.effects.animateClass.call(this,{add:n,remove:t},r,i,s)}})}(),function(){function i(t,n,r,i){e.isPlainObject(t)&&(n=t,t=t.effect),t={effect:t},n==null&&(n={}),e.isFunction(n)&&(i=n,r=null,n={});if(typeof n=="number"||e.fx.speeds[n])i=r,r=n,n={};return e.isFunction(r)&&(i=r,r=null),n&&e.extend(t,n),r=r||n.duration,t.duration=e.fx.off?0:typeof r=="number"?r:r in e.fx.speeds?e.fx.speeds[r]:e.fx.speeds._default,t.complete=i||n.complete,t}function s(t){return!t||typeof t=="number"||e.fx.speeds[t]?!0:typeof t=="string"&&!e.effects.effect[t]?n&&e.effects[t]?!1:!0:!1}e.extend(e.effects,{version:"1.9.2",save:function(e,t){for(var n=0;n<t.length;n++)t[n]!==null&&e.data(r+t[n],e[0].style[t[n]])},restore:function(e,n){var i,s;for(s=0;s<n.length;s++)n[s]!==null&&(i=e.data(r+n[s]),i===t&&(i=""),e.css(n[s],i))},setMode:function(e,t){return t==="toggle"&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var n,r;switch(e[0]){case"top":n=0;break;case"middle":n=.5;break;case"bottom":n=1;break;default:n=e[0]/t.height}switch(e[1]){case"left":r=0;break;case"center":r=.5;break;case"right":r=1;break;default:r=e[1]/t.width}return{x:r,y:n}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var n={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},r=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i={width:t.width(),height:t.height()},s=document.activeElement;try{s.id}catch(o){s=document.body}return t.wrap(r),(t[0]===s||e.contains(t[0],s))&&e(s).focus(),r=t.parent(),t.css("position")==="static"?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(i),r.css(n).show()},removeWrapper:function(t){var n=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===n||e.contains(t[0],n))&&e(n).focus()),t},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(){function a(n){function u(){e.isFunction(i)&&i.call(r[0]),e.isFunction(n)&&n()}var r=e(this),i=t.complete,s=t.mode;(r.is(":hidden")?s==="hide":s==="show")?u():o.call(r[0],t,u)}var t=i.apply(this,arguments),r=t.mode,s=t.queue,o=e.effects.effect[t.effect],u=!o&&n&&e.effects[t.effect];return e.fx.off||!o&&!u?r?this[r](t.duration,t.complete):this.each(function(){t.complete&&t.complete.call(this)}):o?s===!1?this.each(a):this.queue(s||"fx",a):u.call(this,{options:t,duration:t.duration,callback:t.complete,mode:t.mode})},_show:e.fn.show,show:function(e){if(s(e))return this._show.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="show",this.effect.call(this,t)},_hide:e.fn.hide,hide:function(e){if(s(e))return this._hide.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)},__toggle:e.fn.toggle,toggle:function(t){if(s(t)||typeof t=="boolean"||e.isFunction(t))return this.__toggle.apply(this,arguments);var n=i.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)},cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,n){t[n]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return e===0||e===1?e:-Math.pow(2,8*(e-1))*Math.sin(((e-1)*80-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){var t,n=4;while(e<((t=Math.pow(2,--n))-1)/11);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)}}),e.each(t,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?n(e*2)/2:1-n(e*-2+2)/2}})}()}(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t,e){var i="ui-effects-";t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(t,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[c[l].cache]=o[c[l].cache],n=s._rgba=o._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,a.transparent),s):a[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,o,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(o),o=e);var u=this,d=t.type(n),p=this._rgba=[];return o!==e&&(n=[n,o,r,h],d="array"),"string"===d?this.parse(s(n)||a._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var a=s.cache;f(s.props,function(t,e){if(!u[a]&&s.to){if("alpha"===t||null==n[t])return;u[a]=s.to(u._rgba)}u[a][e.idx]=i(n[t],e,!0)}),u[a]&&0>t.inArray(null,u[a].slice(0,3))&&(u[a][3]=1,s.from&&(u._rgba=s.from(u[a])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),a=c[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(t,n){var a=n.idx,o=r[a],l=s[a],c=u[n.type]||{};null!==l&&(null===o?h[a]=l:(c.mod&&(l-o>c.mod/2?o+=c.mod:o-l>c.mod/2&&(o-=c.mod)),h[a]=i((l-o)*e+o,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,a=t[2]/255,o=t[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==o?1:o]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],a=t[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,e+1/3)),Math.round(255*n(r,o,e)),Math.round(255*n(r,o,e-1/3)),a]},f(c,function(s,n){var a=n.props,o=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===e)return this[o].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[o].slice();return f(a,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[o]=d,n):l(d)},f(a,function(e,i){l.fn[e]||(l.fn[e]=function(n){var a,o=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===o?c:("function"===o&&(n=n.call(this,c),o=t.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=c+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var a,o,r="";if("transparent"!==n&&("string"!==t.type(n)||(a=s(n)))){if(n=l(a||n),!d.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&o&&o.style;)try{r=t.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(o),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},a=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function s(e,i){var s,n,o={};for(s in i)n=i[s],e[s]!==n&&(a[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(o[s]=n));return o}var n=["add","remove","toggle"],a={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,a,o,r){var h=t.speed(a,o,r);return this.queue(function(){var a,o=t(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var e=t(this);return{el:e,start:i(this)}}),a=function(){t.each(n,function(t,i){e[i]&&o[i+"Class"](e[i])})},a(),l=l.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){a(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(o[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,a){return s?t.effects.animateClass.call(this,{add:i},s,n,a):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,a){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,a):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,a,o,r){return"boolean"==typeof n||n===e?a?t.effects.animateClass.call(this,n?{add:s}:{remove:s},a,o,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,a,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,a){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,a)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.10.3",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,a;for(a=0;s.length>a;a++)null!==s[a]&&(n=t.data(i+s[a]),n===e&&(n=""),t.css(s[a],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return e.wrap(s),(e[0]===a||t.contains(e[0],a))&&t(a).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var a=e.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(a)&&a.call(n[0]),t.isFunction(e)&&e()}var n=t(this),a=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):o.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,a=i.queue,o=t.effects.effect[i.effect];return t.fx.off||!o?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):a===!1?this.each(e):this.queue(a||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()})(jQuery);
\ No newline at end of file
index b6aef9331290c8aa10ba3326a2abed8502eaf29d..113d53fb1c00aa091099e74705c32b045ab76d8a 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.menu.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){var n=!1;e.widget("ui.menu",{version:"1.9.2",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,e.proxy(function(e){this.options.disabled&&e.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(e){e.preventDefault()},"click .ui-state-disabled > a":function(e){e.preventDefault()},"click .ui-menu-item:has(a)":function(t){var r=e(t.target).closest(".ui-menu-item");!n&&r.not(".ui-state-disabled").length&&(n=!0,this.select(t),r.has(".ui-menu").length?this.expand(t):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&this.active.parents(".ui-menu").length===1&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var n=e(t.currentTarget);n.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(t,n)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var n=this.active||this.element.children(".ui-menu-item").eq(0);t||this.focus(e,n)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){e(t.target).closest(".ui-menu").length||this.collapseAll(t),n=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").andSelf().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function a(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var n,r,i,s,o,u=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:u=!1,r=this.previousFilter||"",i=String.fromCharCode(t.keyCode),s=!1,clearTimeout(this.filterTimer),i===r?s=!0:i=r+i,o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())}),n=s&&n.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):n,n.length||(i=String.fromCharCode(t.keyCode),o=new RegExp("^"+a(i),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return o.test(e(this).children("a").text())})),n.length?(this.focus(t,n),n.length>1?(this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}u&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var t,n=this.options.icons.submenu,r=this.element.find(this.options.menus);r.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),r=t.prev("a"),i=e("<span>").addClass("ui-menu-icon ui-icon "+n).data("ui-menu-submenu-carat",!0);r.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",r.attr("id"))}),t=r.add(this.element),t.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),t.children(":not(.ui-menu-item)").each(function(){var t=e(this);/[^\-—–\s]/.test(t.text())||t.addClass("ui-widget-content ui-menu-divider")}),t.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},focus:function(e,t){var n,r;this.blur(e,e&&e.type==="focus"),this._scrollIntoView(t),this.active=t.first(),r=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",r.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),e&&e.type==="keydown"?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=t.children(".ui-menu"),n.length&&/^mouse/.test(e.type)&&this._startOpening(n),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var n,r,i,s,o,u;this._hasScroll()&&(n=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,r=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,i=t.offset().top-this.activeMenu.offset().top-n-r,s=this.activeMenu.scrollTop(),o=this.activeMenu.height(),u=t.height(),i<0?this.activeMenu.scrollTop(s+i):i+u>o&&this.activeMenu.scrollTop(s+i-o+u))},blur:function(e,t){t||clearTimeout(this.timer);if(!this.active)return;this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active})},_startOpening:function(e){clearTimeout(this.timer);if(e.attr("aria-hidden")!=="true")return;this.timer=this._delay(function(){this._close(),this._open(e)},this.delay)},_open:function(t){var n=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(t,n){clearTimeout(this.timer),this.timer=this._delay(function(){var r=n?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));r.length||(r=this.element),this._close(r),this.blur(t),this.activeMenu=r},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,n){var r;this.active&&(e==="first"||e==="last"?r=this.active[e==="first"?"prevAll":"nextAll"](".ui-menu-item").eq(-1):r=this.active[e+"All"](".ui-menu-item").eq(0));if(!r||!r.length||!this.active)r=this.activeMenu.children(".ui-menu-item")[t]();this.focus(n,r)},nextPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isLastItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r-i<0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())},previousPage:function(t){var n,r,i;if(!this.active){this.next(t);return}if(this.isFirstItem())return;this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r+i>0}),this.focus(t,n)):this.focus(t,this.activeMenu.children(".ui-menu-item").first())},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var n={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,n)}})})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){t.widget("ui.menu",{version:"1.10.3",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.mouseHandled=!0,this.select(e),i.has(".ui-menu").length?this.expand(e):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,h=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:h=!1,n=this.previousFilter||"",a=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(a=String.fromCharCode(e.keyCode),r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}h&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),e=s.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(e),undefined)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(e),undefined)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})})(jQuery);
\ No newline at end of file
index 1ef86b0cd36747b2cca51c564562ed70ee2c4021..b7361fb7a909a6562a43e47b4598aca2b0abc9ea 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.mouse.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){var n=!1;e(document).mouseup(function(e){n=!1}),e.widget("ui.mouse",{version:"1.9.2",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(n){if(!0===e.data(n.target,t.widgetName+".preventClickEvent"))return e.removeData(n.target,t.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(n)return;this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var r=this,i=t.which===1,s=typeof this.options.cancel=="string"&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;if(!i||s||!this._mouseCapture(t))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){r.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(t)!==!1;if(!this._mouseStarted)return t.preventDefault(),!0}return!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return r._mouseMove(e)},this._mouseUpDelegate=function(e){return r._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),n=!0,!0},_mouseMove:function(t){return!e.ui.ie||document.documentMode>=9||!!t.button?this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted):this._mouseUp(t)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(e){return this.mouseDelayMet},_mouseStart:function(e){},_mouseDrag:function(e){},_mouseStop:function(e){},_mouseCapture:function(e){return!0}})})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget("ui.mouse",{version:"1.10.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!t){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,a="string"==typeof this.options.cancel&&i.target.nodeName?e(i.target).closest(this.options.cancel).length:!1;return n&&!a&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+".preventClickEvent")&&e.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return s._mouseMove(e)},this._mouseUpDelegate=function(e){return s._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);
\ No newline at end of file
index 115a1bc474cbdbf4bfd45f500c0dff9f5ea7dd48..9bd2ecd47d0b22c014a4105132840fc2160f0e9b 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.position.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){function h(e,t,n){return[parseInt(e[0],10)*(l.test(e[0])?t/100:1),parseInt(e[1],10)*(l.test(e[1])?n/100:1)]}function p(t,n){return parseInt(e.css(t,n),10)||0}e.ui=e.ui||{};var n,r=Math.max,i=Math.abs,s=Math.round,o=/left|center|right/,u=/top|center|bottom/,a=/[\+\-]\d+%?/,f=/^\w+/,l=/%$/,c=e.fn.position;e.position={scrollbarWidth:function(){if(n!==t)return n;var r,i,s=e("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return e("body").append(s),r=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,r===i&&(i=s[0].clientWidth),s.remove(),n=r-i},getScrollInfo:function(t){var n=t.isWindow?"":t.element.css("overflow-x"),r=t.isWindow?"":t.element.css("overflow-y"),i=n==="scroll"||n==="auto"&&t.width<t.element[0].scrollWidth,s=r==="scroll"||r==="auto"&&t.height<t.element[0].scrollHeight;return{width:i?e.position.scrollbarWidth():0,height:s?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var n=e(t||window),r=e.isWindow(n[0]);return{element:n,isWindow:r,offset:n.offset()||{left:0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:r?n.width():n.outerWidth(),height:r?n.height():n.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return c.apply(this,arguments);t=e.extend({},t);var n,l,d,v,m,g=e(t.of),y=e.position.getWithinInfo(t.within),b=e.position.getScrollInfo(y),w=g[0],E=(t.collision||"flip").split(" "),S={};return w.nodeType===9?(l=g.width(),d=g.height(),v={top:0,left:0}):e.isWindow(w)?(l=g.width(),d=g.height(),v={top:g.scrollTop(),left:g.scrollLeft()}):w.preventDefault?(t.at="left top",l=d=0,v={top:w.pageY,left:w.pageX}):(l=g.outerWidth(),d=g.outerHeight(),v=g.offset()),m=e.extend({},v),e.each(["my","at"],function(){var e=(t[this]||"").split(" "),n,r;e.length===1&&(e=o.test(e[0])?e.concat(["center"]):u.test(e[0])?["center"].concat(e):["center","center"]),e[0]=o.test(e[0])?e[0]:"center",e[1]=u.test(e[1])?e[1]:"center",n=a.exec(e[0]),r=a.exec(e[1]),S[this]=[n?n[0]:0,r?r[0]:0],t[this]=[f.exec(e[0])[0],f.exec(e[1])[0]]}),E.length===1&&(E[1]=E[0]),t.at[0]==="right"?m.left+=l:t.at[0]==="center"&&(m.left+=l/2),t.at[1]==="bottom"?m.top+=d:t.at[1]==="center"&&(m.top+=d/2),n=h(S.at,l,d),m.left+=n[0],m.top+=n[1],this.each(function(){var o,u,a=e(this),f=a.outerWidth(),c=a.outerHeight(),w=p(this,"marginLeft"),x=p(this,"marginTop"),T=f+w+p(this,"marginRight")+b.width,N=c+x+p(this,"marginBottom")+b.height,C=e.extend({},m),k=h(S.my,a.outerWidth(),a.outerHeight());t.my[0]==="right"?C.left-=f:t.my[0]==="center"&&(C.left-=f/2),t.my[1]==="bottom"?C.top-=c:t.my[1]==="center"&&(C.top-=c/2),C.left+=k[0],C.top+=k[1],e.support.offsetFractions||(C.left=s(C.left),C.top=s(C.top)),o={marginLeft:w,marginTop:x},e.each(["left","top"],function(r,i){e.ui.position[E[r]]&&e.ui.position[E[r]][i](C,{targetWidth:l,targetHeight:d,elemWidth:f,elemHeight:c,collisionPosition:o,collisionWidth:T,collisionHeight:N,offset:[n[0]+k[0],n[1]+k[1]],my:t.my,at:t.at,within:y,elem:a})}),e.fn.bgiframe&&a.bgiframe(),t.using&&(u=function(e){var n=v.left-C.left,s=n+l-f,o=v.top-C.top,u=o+d-c,h={target:{element:g,left:v.left,top:v.top,width:l,height:d},element:{element:a,left:C.left,top:C.top,width:f,height:c},horizontal:s<0?"left":n>0?"right":"center",vertical:u<0?"top":o>0?"bottom":"middle"};l<f&&i(n+s)<l&&(h.horizontal="center"),d<c&&i(o+u)<d&&(h.vertical="middle"),r(i(n),i(s))>r(i(o),i(u))?h.important="horizontal":h.important="vertical",t.using.call(this,e,h)}),a.offset(e.extend(C,{using:u}))})},e.ui.position={fit:{left:function(e,t){var n=t.within,i=n.isWindow?n.scrollLeft:n.offset.left,s=n.width,o=e.left-t.collisionPosition.marginLeft,u=i-o,a=o+t.collisionWidth-s-i,f;t.collisionWidth>s?u>0&&a<=0?(f=e.left+u+t.collisionWidth-s-i,e.left+=u-f):a>0&&u<=0?e.left=i:u>a?e.left=i+s-t.collisionWidth:e.left=i:u>0?e.left+=u:a>0?e.left-=a:e.left=r(e.left-o,e.left)},top:function(e,t){var n=t.within,i=n.isWindow?n.scrollTop:n.offset.top,s=t.within.height,o=e.top-t.collisionPosition.marginTop,u=i-o,a=o+t.collisionHeight-s-i,f;t.collisionHeight>s?u>0&&a<=0?(f=e.top+u+t.collisionHeight-s-i,e.top+=u-f):a>0&&u<=0?e.top=i:u>a?e.top=i+s-t.collisionHeight:e.top=i:u>0?e.top+=u:a>0?e.top-=a:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var n=t.within,r=n.offset.left+n.scrollLeft,s=n.width,o=n.isWindow?n.scrollLeft:n.offset.left,u=e.left-t.collisionPosition.marginLeft,a=u-o,f=u+t.collisionWidth-s-o,l=t.my[0]==="left"?-t.elemWidth:t.my[0]==="right"?t.elemWidth:0,c=t.at[0]==="left"?t.targetWidth:t.at[0]==="right"?-t.targetWidth:0,h=-2*t.offset[0],p,d;if(a<0){p=e.left+l+c+h+t.collisionWidth-s-r;if(p<0||p<i(a))e.left+=l+c+h}else if(f>0){d=e.left-t.collisionPosition.marginLeft+l+c+h-o;if(d>0||i(d)<f)e.left+=l+c+h}},top:function(e,t){var n=t.within,r=n.offset.top+n.scrollTop,s=n.height,o=n.isWindow?n.scrollTop:n.offset.top,u=e.top-t.collisionPosition.marginTop,a=u-o,f=u+t.collisionHeight-s-o,l=t.my[1]==="top",c=l?-t.elemHeight:t.my[1]==="bottom"?t.elemHeight:0,h=t.at[1]==="top"?t.targetHeight:t.at[1]==="bottom"?-t.targetHeight:0,p=-2*t.offset[1],d,v;a<0?(v=e.top+c+h+p+t.collisionHeight-s-r,e.top+c+h+p>a&&(v<0||v<i(a))&&(e.top+=c+h+p)):f>0&&(d=e.top-t.collisionPosition.marginTop+c+h+p-o,e.top+c+h+p>f&&(d>0||i(d)<f)&&(e.top+=c+h+p))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,n,r,i,s,o=document.getElementsByTagName("body")[0],u=document.createElement("div");t=document.createElement(o?"div":"body"),r={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&e.extend(r,{position:"absolute",left:"-1000px",top:"-1000px"});for(s in r)t.style[s]=r[s];t.appendChild(u),n=o||document.documentElement,n.insertBefore(t,n.firstChild),u.style.cssText="position: absolute; left: 10.7432222px;",i=e(u).offset().left,e.support.offsetFractions=i>10&&i<11,t.innerHTML="",n.removeChild(t)}(),e.uiBackCompat!==!1&&function(e){var n=e.fn.position;e.fn.position=function(r){if(!r||!r.offset)return n.call(this,r);var i=r.offset.split(" "),s=r.at.split(" ");return i.length===1&&(i[1]=i[0]),/^\d/.test(i[0])&&(i[0]="+"+i[0]),/^\d/.test(i[1])&&(i[1]="+"+i[1]),s.length===1&&(/left|center|right/.test(s[0])?s[1]="center":(s[1]=s[0],s[0]="center")),n.call(this,e.extend(r,{at:s[0]+i[0]+" "+s[1]+i[1],offset:t}))}}(jQuery)})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(a!==e)return a;var i,s,n=t("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=n.children()[0];return t("body").append(n),i=o.offsetWidth,n.css("overflow","scroll"),s=o.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),a=i-s},getScrollInfo:function(e){var i=e.isWindow?"":e.element.css("overflow-x"),s=e.isWindow?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,a="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:a?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]);return{element:i,isWindow:s,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=t.extend({},e);var a,p,m,g,v,b,_=t(e.of),y=t.position.getWithinInfo(e.within),w=t.position.getScrollInfo(y),x=(e.collision||"flip").split(" "),k={};return b=n(_),_[0].preventDefault&&(e.at="left top"),p=b.width,m=b.height,g=b.offset,v=t.extend({},g),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=l.test(s[0])?s.concat(["center"]):c.test(s[0])?["center"].concat(s):["center","center"]),s[0]=l.test(s[0])?s[0]:"center",s[1]=c.test(s[1])?s[1]:"center",t=u.exec(s[0]),i=u.exec(s[1]),k[this]=[t?t[0]:0,i?i[0]:0],e[this]=[d.exec(s[0])[0],d.exec(s[1])[0]]}),1===x.length&&(x[1]=x[0]),"right"===e.at[0]?v.left+=p:"center"===e.at[0]&&(v.left+=p/2),"bottom"===e.at[1]?v.top+=m:"center"===e.at[1]&&(v.top+=m/2),a=i(k.at,p,m),v.left+=a[0],v.top+=a[1],this.each(function(){var n,l,c=t(this),u=c.outerWidth(),d=c.outerHeight(),f=s(this,"marginLeft"),b=s(this,"marginTop"),D=u+f+s(this,"marginRight")+w.width,T=d+b+s(this,"marginBottom")+w.height,C=t.extend({},v),M=i(k.my,c.outerWidth(),c.outerHeight());"right"===e.my[0]?C.left-=u:"center"===e.my[0]&&(C.left-=u/2),"bottom"===e.my[1]?C.top-=d:"center"===e.my[1]&&(C.top-=d/2),C.left+=M[0],C.top+=M[1],t.support.offsetFractions||(C.left=h(C.left),C.top=h(C.top)),n={marginLeft:f,marginTop:b},t.each(["left","top"],function(i,s){t.ui.position[x[i]]&&t.ui.position[x[i]][s](C,{targetWidth:p,targetHeight:m,elemWidth:u,elemHeight:d,collisionPosition:n,collisionWidth:D,collisionHeight:T,offset:[a[0]+M[0],a[1]+M[1]],my:e.my,at:e.at,within:y,elem:c})}),e.using&&(l=function(t){var i=g.left-C.left,s=i+p-u,n=g.top-C.top,a=n+m-d,h={target:{element:_,left:g.left,top:g.top,width:p,height:m},element:{element:c,left:C.left,top:C.top,width:u,height:d},horizontal:0>s?"left":i>0?"right":"center",vertical:0>a?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(h.horizontal="center"),d>m&&m>r(n+a)&&(h.vertical="middle"),h.important=o(r(i),r(s))>o(r(n),r(a))?"horizontal":"vertical",e.using.call(this,t,h)}),c.offset(t.extend(C,{using:l}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-o-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-o-a,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-o-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>c?(s=t.top+p+f+m+e.collisionHeight-o-a,t.top+p+f+m>c&&(0>s||r(c)>s)&&(t.top+=p+f+m)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+m-h,t.top+p+f+m>u&&(i>0||u>r(i))&&(t.top+=p+f+m))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,a,o=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(o?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(a in s)e.style[a]=s[a];e.appendChild(r),i=o||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()})(jQuery);
\ No newline at end of file
index 855b23bb762e91a36550437c663efe218888072b..432ec0260a13a33c6ac5500682f83805eac3efb8 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.progressbar.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){e.widget("ui.progressbar",{version:"1.9.2",options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){return e===t?this._value():(this._setOption("value",e),this)},_setOption:function(e,t){e==="value"&&(this.options.value=t,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),this._super(e,t)},_value:function(){var e=this.options.value;return typeof e!="number"&&(e=0),Math.min(this.options.max,Math.max(this.min,e))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var e=this.value(),t=this._percentage();this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),this.valueDiv.toggle(e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(t.toFixed(0)+"%"),this.element.attr("aria-valuenow",e)}})})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t,e){t.widget("ui.progressbar",{version:"1.10.3",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=t("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(t){return t===e?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),e)},_constrainedValue:function(t){return t===e&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})})(jQuery);
\ No newline at end of file
index 560c422e884c985671e3f97f6c5ab9dd7b2e1239..1c29259e4f37dcf77d325ad1d099a963c8b49aad 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.resizable.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){e.widget("ui.resizable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var t=this,n=this.options;this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!n.aspectRatio,aspectRatio:n.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:n.helper||n.ghost||n.animate?n.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=n.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var r=this.handles.split(",");this.handles={};for(var i=0;i<r.length;i++){var s=e.trim(r[i]),o="ui-resizable-"+s,u=e('<div class="ui-resizable-handle '+o+'"></div>');u.css({zIndex:n.zIndex}),"se"==s&&u.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(u)}}this._renderAxis=function(t){t=t||this.element;for(var n in this.handles){this.handles[n].constructor==String&&(this.handles[n]=e(this.handles[n],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var r=e(this.handles[n],this.element),i=0;i=/sw|ne|nw|se|n|s/.test(n)?r.outerHeight():r.outerWidth();var s=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");t.css(s,i),this._proportionallyResize()}if(!e(this.handles[n]).length)continue}},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!t.resizing){if(this.className)var e=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);t.axis=e&&e[1]?e[1]:"se"}}),n.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){if(n.disabled)return;e(this).removeClass("ui-resizable-autohide"),t._handles.show()}).mouseleave(function(){if(n.disabled)return;t.resizing||(e(this).addClass("ui-resizable-autohide"),t._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){t(this.element);var n=this.element;this.originalElement.css({position:n.css("position"),width:n.outerWidth(),height:n.outerHeight(),top:n.css("top"),left:n.css("left")}).insertAfter(n),n.remove()}return this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_mouseCapture:function(t){var n=!1;for(var r in this.handles)e(this.handles[r])[0]==t.target&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(t){var r=this.options,i=this.element.position(),s=this.element;this.resizing=!0,this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()},(s.is(".ui-draggable")||/absolute/.test(s.css("position")))&&s.css({position:"absolute",top:i.top,left:i.left}),this._renderProxy();var o=n(this.helper.css("left")),u=n(this.helper.css("top"));r.containment&&(o+=e(r.containment).scrollLeft()||0,u+=e(r.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:o,top:u},this.size=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.originalSize=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.originalPosition={left:o,top:u},this.sizeDiff={width:s.outerWidth()-s.width(),height:s.outerHeight()-s.height()},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio=typeof r.aspectRatio=="number"?r.aspectRatio:this.originalSize.width/this.originalSize.height||1;var a=e(".ui-resizable-"+this.axis).css("cursor");return e("body").css("cursor",a=="auto"?this.axis+"-resize":a),s.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(e){var t=this.helper,n=this.options,r={},i=this,s=this.originalMousePosition,o=this.axis,u=e.pageX-s.left||0,a=e.pageY-s.top||0,f=this._change[o];if(!f)return!1;var l=f.apply(this,[e,u,a]);this._updateVirtualBoundaries(e.shiftKey);if(this._aspectRatio||e.shiftKey)l=this._updateRatio(l,e);return l=this._respectSize(l,e),this._propagate("resize",e),t.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",e,this.ui()),!1},_mouseStop:function(t){this.resizing=!1;var n=this.options,r=this;if(this._helper){var i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),o=s&&e.ui.hasScroll(i[0],"left")?0:r.sizeDiff.height,u=s?0:r.sizeDiff.width,a={width:r.helper.width()-u,height:r.helper.height()-o},f=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,l=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null;n.animate||this.element.css(e.extend(a,{top:l,left:f})),r.helper.height(r.size.height),r.helper.width(r.size.width),this._helper&&!n.animate&&this._proportionallyResize()}return e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t=this.options,n,i,s,o,u;u={minWidth:r(t.minWidth)?t.minWidth:0,maxWidth:r(t.maxWidth)?t.maxWidth:Infinity,minHeight:r(t.minHeight)?t.minHeight:0,maxHeight:r(t.maxHeight)?t.maxHeight:Infinity};if(this._aspectRatio||e)n=u.minHeight*this.aspectRatio,s=u.minWidth/this.aspectRatio,i=u.maxHeight*this.aspectRatio,o=u.maxWidth/this.aspectRatio,n>u.minWidth&&(u.minWidth=n),s>u.minHeight&&(u.minHeight=s),i<u.maxWidth&&(u.maxWidth=i),o<u.maxHeight&&(u.maxHeight=o);this._vBoundaries=u},_updateCache:function(e){var t=this.options;this.offset=this.helper.offset(),r(e.left)&&(this.position.left=e.left),r(e.top)&&(this.position.top=e.top),r(e.height)&&(this.size.height=e.height),r(e.width)&&(this.size.width=e.width)},_updateRatio:function(e,t){var n=this.options,i=this.position,s=this.size,o=this.axis;return r(e.height)?e.width=e.height*this.aspectRatio:r(e.width)&&(e.height=e.width/this.aspectRatio),o=="sw"&&(e.left=i.left+(s.width-e.width),e.top=null),o=="nw"&&(e.top=i.top+(s.height-e.height),e.left=i.left+(s.width-e.width)),e},_respectSize:function(e,t){var n=this.helper,i=this._vBoundaries,s=this._aspectRatio||t.shiftKey,o=this.axis,u=r(e.width)&&i.maxWidth&&i.maxWidth<e.width,a=r(e.height)&&i.maxHeight&&i.maxHeight<e.height,f=r(e.width)&&i.minWidth&&i.minWidth>e.width,l=r(e.height)&&i.minHeight&&i.minHeight>e.height;f&&(e.width=i.minWidth),l&&(e.height=i.minHeight),u&&(e.width=i.maxWidth),a&&(e.height=i.maxHeight);var c=this.originalPosition.left+this.originalSize.width,h=this.position.top+this.size.height,p=/sw|nw|w/.test(o),d=/nw|ne|n/.test(o);f&&p&&(e.left=c-i.minWidth),u&&p&&(e.left=c-i.maxWidth),l&&d&&(e.top=h-i.minHeight),a&&d&&(e.top=h-i.maxHeight);var v=!e.width&&!e.height;return v&&!e.left&&e.top?e.top=null:v&&!e.top&&e.left&&(e.left=null),e},_proportionallyResize:function(){var t=this.options;if(!this._proportionallyResizeElements.length)return;var n=this.helper||this.element;for(var r=0;r<this._proportionallyResizeElements.length;r++){var i=this._proportionallyResizeElements[r];if(!this.borderDif){var s=[i.css("borderTopWidth"),i.css("borderRightWidth"),i.css("borderBottomWidth"),i.css("borderLeftWidth")],o=[i.css("paddingTop"),i.css("paddingRight"),i.css("paddingBottom"),i.css("paddingLeft")];this.borderDif=e.map(s,function(e,t){var n=parseInt(e,10)||0,r=parseInt(o[t],10)||0;return n+r})}i.css({height:n.height()-this.borderDif[0]-this.borderDif[2]||0,width:n.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var t=this.element,n=this.options;this.elementOffset=t.offset();if(this._helper){this.helper=this.helper||e('<div style="overflow:hidden;"></div>');var r=e.ui.ie6?1:0,i=e.ui.ie6?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+i,height:this.element.outerHeight()+i,position:"absolute",left:this.elementOffset.left-r+"px",top:this.elementOffset.top-r+"px",zIndex:++n.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(e,t,n){return{width:this.originalSize.width+t}},w:function(e,t,n){var r=this.options,i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,n){var r=this.options,i=this.originalSize,s=this.originalPosition;return{top:s.top+n,height:i.height-n}},s:function(e,t,n){return{height:this.originalSize.height+n}},se:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},sw:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,n,r]))},ne:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},nw:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,n,r]))}},_propagate:function(t,n){e.ui.plugin.call(this,t,[n,this.ui()]),t!="resize"&&this._trigger(t,n,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","alsoResize",{start:function(t,n){var r=e(this).data("resizable"),i=r.options,s=function(t){e(t).each(function(){var t=e(this);t.data("resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};typeof i.alsoResize=="object"&&!i.alsoResize.parentNode?i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)}):s(i.alsoResize)},resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.originalSize,o=r.originalPosition,u={height:r.size.height-s.height||0,width:r.size.width-s.width||0,top:r.position.top-o.top||0,left:r.position.left-o.left||0},a=function(t,r){e(t).each(function(){var t=e(this),i=e(this).data("resizable-alsoresize"),s={},o=r&&r.length?r:t.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var n=(i[t]||0)+(u[t]||0);n&&n>=0&&(s[t]=n||null)}),t.css(s)})};typeof i.alsoResize=="object"&&!i.alsoResize.nodeType?e.each(i.alsoResize,function(e,t){a(e,t)}):a(i.alsoResize)},stop:function(t,n){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","animate",{stop:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r._proportionallyResizeElements,o=s.length&&/textarea/i.test(s[0].nodeName),u=o&&e.ui.hasScroll(s[0],"left")?0:r.sizeDiff.height,a=o?0:r.sizeDiff.width,f={width:r.size.width-a,height:r.size.height-u},l=parseInt(r.element.css("left"),10)+(r.position.left-r.originalPosition.left)||null,c=parseInt(r.element.css("top"),10)+(r.position.top-r.originalPosition.top)||null;r.element.animate(e.extend(f,c&&l?{top:c,left:l}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var n={width:parseInt(r.element.css("width"),10),height:parseInt(r.element.css("height"),10),top:parseInt(r.element.css("top"),10),left:parseInt(r.element.css("left"),10)};s&&s.length&&e(s[0]).css({width:n.width,height:n.height}),r._updateCache(n),r._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(t,r){var i=e(this).data("resizable"),s=i.options,o=i.element,u=s.containment,a=u instanceof e?u.get(0):/parent/.test(u)?o.parent().get(0):u;if(!a)return;i.containerElement=e(a);if(/document/.test(u)||u==document)i.containerOffset={left:0,top:0},i.containerPosition={left:0,top:0},i.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight};else{var f=e(a),l=[];e(["Top","Right","Left","Bottom"]).each(function(e,t){l[e]=n(f.css("padding"+t))}),i.containerOffset=f.offset(),i.containerPosition=f.position(),i.containerSize={height:f.innerHeight()-l[3],width:f.innerWidth()-l[1]};var c=i.containerOffset,h=i.containerSize.height,p=i.containerSize.width,d=e.ui.hasScroll(a,"left")?a.scrollWidth:p,v=e.ui.hasScroll(a)?a.scrollHeight:h;i.parentData={element:a,left:c.left,top:c.top,width:d,height:v}}},resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.containerSize,o=r.containerOffset,u=r.size,a=r.position,f=r._aspectRatio||t.shiftKey,l={top:0,left:0},c=r.containerElement;c[0]!=document&&/static/.test(c.css("position"))&&(l=o),a.left<(r._helper?o.left:0)&&(r.size.width=r.size.width+(r._helper?r.position.left-o.left:r.position.left-l.left),f&&(r.size.height=r.size.width/r.aspectRatio),r.position.left=i.helper?o.left:0),a.top<(r._helper?o.top:0)&&(r.size.height=r.size.height+(r._helper?r.position.top-o.top:r.position.top),f&&(r.size.width=r.size.height*r.aspectRatio),r.position.top=r._helper?o.top:0),r.offset.left=r.parentData.left+r.position.left,r.offset.top=r.parentData.top+r.position.top;var h=Math.abs((r._helper?r.offset.left-l.left:r.offset.left-l.left)+r.sizeDiff.width),p=Math.abs((r._helper?r.offset.top-l.top:r.offset.top-o.top)+r.sizeDiff.height),d=r.containerElement.get(0)==r.element.parent().get(0),v=/relative|absolute/.test(r.containerElement.css("position"));d&&v&&(h-=r.parentData.left),h+r.size.width>=r.parentData.width&&(r.size.width=r.parentData.width-h,f&&(r.size.height=r.size.width/r.aspectRatio)),p+r.size.height>=r.parentData.height&&(r.size.height=r.parentData.height-p,f&&(r.size.width=r.size.height*r.aspectRatio))},stop:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.position,o=r.containerOffset,u=r.containerPosition,a=r.containerElement,f=e(r.helper),l=f.offset(),c=f.outerWidth()-r.sizeDiff.width,h=f.outerHeight()-r.sizeDiff.height;r._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:l.left-u.left-o.left,width:c,height:h}),r._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:l.left-u.left-o.left,width:c,height:h})}}),e.ui.plugin.add("resizable","ghost",{start:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size;r.ghost=r.originalElement.clone(),r.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof i.ghost=="string"?i.ghost:""),r.ghost.appendTo(r.helper)},resize:function(t,n){var r=e(this).data("resizable"),i=r.options;r.ghost&&r.ghost.css({position:"relative",height:r.size.height,width:r.size.width})},stop:function(t,n){var r=e(this).data("resizable"),i=r.options;r.ghost&&r.helper&&r.helper.get(0).removeChild(r.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size,o=r.originalSize,u=r.originalPosition,a=r.axis,f=i._aspectRatio||t.shiftKey;i.grid=typeof i.grid=="number"?[i.grid,i.grid]:i.grid;var l=Math.round((s.width-o.width)/(i.grid[0]||1))*(i.grid[0]||1),c=Math.round((s.height-o.height)/(i.grid[1]||1))*(i.grid[1]||1);/^(se|s|e)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c):/^(ne)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c,r.position.top=u.top-c):/^(sw)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c,r.position.left=u.left-l):(r.size.width=o.width+l,r.size.height=o.height+c,r.position.top=u.top-c,r.position.left=u.left-l)}});var n=function(e){return parseInt(e,10)||0},r=function(e){return!isNaN(parseInt(e,10))}})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(e){function t(e){return parseInt(e,10)||0}function i(e){return!isNaN(parseInt(e,10))}e.widget("ui.resizable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("<div class='ui-resizable-handle "+a+"'></div>"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=e(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),e(this.handles[i]).length},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,a,o=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=t(this.helper.css("left")),n=t(this.helper.css("top")),o.containment&&(s+=e(o.containment).scrollLeft()||0,n+=e(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,a=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===a?this.axis+"-resize":a),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(t){var i,s=this.helper,n={},a=this.originalMousePosition,o=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,u=this.size.height,c=t.pageX-a.left||0,d=t.pageY-a.top||0,p=this._change[o];return p?(i=p.apply(this,[t,c,d]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==u&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(n)||this._trigger("resize",t,this.ui()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&e.ui.hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t,s,n,a,o,r=this.options;o={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||e)&&(t=o.minHeight*this.aspectRatio,n=o.minWidth/this.aspectRatio,s=o.maxHeight*this.aspectRatio,a=o.maxWidth/this.aspectRatio,t>o.minWidth&&(o.minWidth=t),n>o.minHeight&&(o.minHeight=n),o.maxWidth>s&&(o.maxWidth=s),o.maxHeight>a&&(o.maxHeight=a)),this._vBoundaries=o},_updateCache:function(e){this.offset=this.helper.offset(),i(e.left)&&(this.position.left=e.left),i(e.top)&&(this.position.top=e.top),i(e.height)&&(this.size.height=e.height),i(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,s=this.size,n=this.axis;return i(e.height)?e.width=e.height*this.aspectRatio:i(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===n&&(e.left=t.left+(s.width-e.width),e.top=null),"nw"===n&&(e.top=t.top+(s.height-e.height),e.left=t.left+(s.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,s=this.axis,n=i(e.width)&&t.maxWidth&&t.maxWidth<e.width,a=i(e.height)&&t.maxHeight&&t.maxHeight<e.height,o=i(e.width)&&t.minWidth&&t.minWidth>e.width,r=i(e.height)&&t.minHeight&&t.minHeight>e.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,u=/sw|nw|w/.test(s),c=/nw|ne|n/.test(s);return o&&(e.width=t.minWidth),r&&(e.height=t.minHeight),n&&(e.width=t.maxWidth),a&&(e.height=t.maxHeight),o&&u&&(e.left=h-t.minWidth),n&&u&&(e.left=h-t.maxWidth),r&&c&&(e.top=l-t.minHeight),a&&c&&(e.top=l-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var e,t,i,s,n,a=this.helper||this.element;for(e=0;this._proportionallyResizeElements.length>e;e++){if(n=this._proportionallyResizeElements[e],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],t=0;i.length>t;t++)this.borderDif[t]=(parseInt(i[t],10)||0)+(parseInt(s[t],10)||0);n.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||0,width:a.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&e.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,a,o,r,h,l=e(this).data("ui-resizable"),u=l.options,c=l.element,d=u.containment,p=d instanceof e?d.get(0):/parent/.test(d)?c.parent().get(0):d;p&&(l.containerElement=e(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(i=e(p),s=[],e(["Top","Right","Left","Bottom"]).each(function(e,n){s[e]=t(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,a=l.containerSize.height,o=l.containerSize.width,r=e.ui.hasScroll(p,"left")?p.scrollWidth:o,h=e.ui.hasScroll(p)?p.scrollHeight:a,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(t){var i,s,n,a,o=e(this).data("ui-resizable"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,c={top:0,left:0},d=o.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(c=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-c.left),u&&(o.size.height=o.size.width/o.aspectRatio),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio),o.position.top=o._helper?h.top:0),o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top,i=Math.abs((o._helper?o.offset.left-c.left:o.offset.left-c.left)+o.sizeDiff.width),s=Math.abs((o._helper?o.offset.top-c.top:o.offset.top-h.top)+o.sizeDiff.height),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a&&(i-=o.parentData.left),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio))},stop:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,s=function(t){e(t).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)})},resize:function(t,i){var s=e(this).data("ui-resizable"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(t,s){e(t).each(function(){var t=e(this),n=e(this).data("ui-resizable-alsoresize"),a={},o=s&&s.length?s:t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var i=(n[t]||0)+(r[t]||0);i&&i>=0&&(a[t]=i||null)}),t.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):e.each(n.alsoResize,function(e,t){h(e,t)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).data("ui-resizable");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).data("ui-resizable");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.size,n=t.originalSize,a=t.originalPosition,o=t.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,u=Math.round((s.width-n.width)/h)*h,c=Math.round((s.height-n.height)/l)*l,d=n.width+u,p=n.height+c,f=i.maxWidth&&d>i.maxWidth,m=i.maxHeight&&p>i.maxHeight,g=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=r,g&&(d+=h),v&&(p+=l),f&&(d-=h),m&&(p-=l),/^(se|s|e)$/.test(o)?(t.size.width=d,t.size.height=p):/^(ne)$/.test(o)?(t.size.width=d,t.size.height=p,t.position.top=a.top-c):/^(sw)$/.test(o)?(t.size.width=d,t.size.height=p,t.position.left=a.left-u):(t.size.width=d,t.size.height=p,t.position.top=a.top-c,t.position.left=a.left-u)}})})(jQuery);
\ No newline at end of file
index 1d433bb0e66a91c7727692a40f9a830bc75008ad..2ac1c60c7ab86c24eb37b1557985c99d4344109c 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.selectable.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){e.widget("ui.selectable",e.ui.mouse,{version:"1.9.2",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var t=this;this.element.addClass("ui-selectable"),this.dragged=!1;var n;this.refresh=function(){n=e(t.options.filter,t.element[0]),n.addClass("ui-selectee"),n.each(function(){var t=e(this),n=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:n.left,top:n.top,right:n.left+t.outerWidth(),bottom:n.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=n.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var n=this;this.opos=[t.pageX,t.pageY];if(this.options.disabled)return;var r=this.options;this.selectees=e(r.filter,this.element[0]),this._trigger("start",t),e(r.appendTo).append(this.helper),this.helper.css({left:t.clientX,top:t.clientY,width:0,height:0}),r.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var r=e.data(this,"selectable-item");r.startselected=!0,!t.metaKey&&!t.ctrlKey&&(r.$element.removeClass("ui-selected"),r.selected=!1,r.$element.addClass("ui-unselecting"),r.unselecting=!0,n._trigger("unselecting",t,{unselecting:r.element}))}),e(t.target).parents().andSelf().each(function(){var r=e.data(this,"selectable-item");if(r){var i=!t.metaKey&&!t.ctrlKey||!r.$element.hasClass("ui-selected");return r.$element.removeClass(i?"ui-unselecting":"ui-selected").addClass(i?"ui-selecting":"ui-unselecting"),r.unselecting=!i,r.selecting=i,r.selected=i,i?n._trigger("selecting",t,{selecting:r.element}):n._trigger("unselecting",t,{unselecting:r.element}),!1}})},_mouseDrag:function(t){var n=this;this.dragged=!0;if(this.options.disabled)return;var r=this.options,i=this.opos[0],s=this.opos[1],o=t.pageX,u=t.pageY;if(i>o){var a=o;o=i,i=a}if(s>u){var a=u;u=s,s=a}return this.helper.css({left:i,top:s,width:o-i,height:u-s}),this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!a||a.element==n.element[0])return;var f=!1;r.tolerance=="touch"?f=!(a.left>o||a.right<i||a.top>u||a.bottom<s):r.tolerance=="fit"&&(f=a.left>i&&a.right<o&&a.top>s&&a.bottom<u),f?(a.selected&&(a.$element.removeClass("ui-selected"),a.selected=!1),a.unselecting&&(a.$element.removeClass("ui-unselecting"),a.unselecting=!1),a.selecting||(a.$element.addClass("ui-selecting"),a.selecting=!0,n._trigger("selecting",t,{selecting:a.element}))):(a.selecting&&((t.metaKey||t.ctrlKey)&&a.startselected?(a.$element.removeClass("ui-selecting"),a.selecting=!1,a.$element.addClass("ui-selected"),a.selected=!0):(a.$element.removeClass("ui-selecting"),a.selecting=!1,a.startselected&&(a.$element.addClass("ui-unselecting"),a.unselecting=!0),n._trigger("unselecting",t,{unselecting:a.element}))),a.selected&&!t.metaKey&&!t.ctrlKey&&!a.startselected&&(a.$element.removeClass("ui-selected"),a.selected=!1,a.$element.addClass("ui-unselecting"),a.unselecting=!0,n._trigger("unselecting",t,{unselecting:a.element})))}),!1},_mouseStop:function(t){var n=this;this.dragged=!1;var r=this.options;return e(".ui-unselecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-unselecting"),r.unselecting=!1,r.startselected=!1,n._trigger("unselected",t,{unselected:r.element})}),e(".ui-selecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");r.$element.removeClass("ui-selecting").addClass("ui-selected"),r.selecting=!1,r.selected=!0,r.startselected=!0,n._trigger("selected",t,{selected:r.element})}),this._trigger("stop",t),this.helper.remove(),!1}})})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(e){e.widget("ui.selectable",e.ui.mouse,{version:"1.10.3",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):undefined}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}})})(jQuery);
\ No newline at end of file
index 92327a9a9879c4d5bf5fbbb7fdccee1ab7e27004..7e319272174d10ed865e52a0d049f9493548668a 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.slider.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){var n=5;e.widget("ui.slider",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var t,r,i=this.options,s=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),o="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",u=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(i.disabled?" ui-slider-disabled ui-disabled":"")),this.range=e([]),i.range&&(i.range===!0&&(i.values||(i.values=[this._valueMin(),this._valueMin()]),i.values.length&&i.values.length!==2&&(i.values=[i.values[0],i.values[0]])),this.range=e("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(i.range==="min"||i.range==="max"?" ui-slider-range-"+i.range:""))),r=i.values&&i.values.length||1;for(t=s.length;t<r;t++)u.push(o);this.handles=s.add(e(u.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(e){e.preventDefault()}).mouseenter(function(){i.disabled||e(this).addClass("ui-state-hover")}).mouseleave(function(){e(this).removeClass("ui-state-hover")}).focus(function(){i.disabled?e(this).blur():(e(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),e(this).addClass("ui-state-focus"))}).blur(function(){e(this).removeClass("ui-state-focus")}),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)}),this._on(this.handles,{keydown:function(t){var r,i,s,o,u=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:t.preventDefault();if(!this._keySliding){this._keySliding=!0,e(t.target).addClass("ui-state-active"),r=this._start(t,u);if(r===!1)return}}o=this.options.step,this.options.values&&this.options.values.length?i=s=this.values(u):i=s=this.value();switch(t.keyCode){case e.ui.keyCode.HOME:s=this._valueMin();break;case e.ui.keyCode.END:s=this._valueMax();break;case e.ui.keyCode.PAGE_UP:s=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.PAGE_DOWN:s=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/n);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(i===this._valueMax())return;s=this._trimAlignValue(i+o);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(i===this._valueMin())return;s=this._trimAlignValue(i-o)}this._slide(t,u,s)},keyup:function(t){var n=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,n),this._change(t,n),e(t.target).removeClass("ui-state-active"))}}),this._refreshValue(),this._animateOff=!1},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var n,r,i,s,o,u,a,f,l=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),n={x:t.pageX,y:t.pageY},r=this._normValueFromMouse(n),i=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var n=Math.abs(r-l.values(t));i>n&&(i=n,s=e(this),o=t)}),c.range===!0&&this.values(1)===c.min&&(o+=1,s=e(this.handles[o])),u=this._start(t,o),u===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,s.addClass("ui-state-active").focus(),a=s.offset(),f=!e(t.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=f?{left:0,top:0}:{left:t.pageX-a.left-s.width()/2,top:t.pageY-a.top-s.height()/2-(parseInt(s.css("borderTopWidth"),10)||0)-(parseInt(s.css("borderBottomWidth"),10)||0)+(parseInt(s.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,r),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,n),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,n,r,i,s;return this.orientation==="horizontal"?(t=this.elementSize.width,n=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,n=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),r=n/t,r>1&&(r=1),r<0&&(r=0),this.orientation==="vertical"&&(r=1-r),i=this._valueMax()-this._valueMin(),s=this._valueMin()+r*i,this._trimAlignValue(s)},_start:function(e,t){var n={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("start",e,n)},_slide:function(e,t,n){var r,i,s;this.options.values&&this.options.values.length?(r=this.values(t?0:1),this.options.values.length===2&&this.options.range===!0&&(t===0&&n>r||t===1&&n<r)&&(n=r),n!==this.values(t)&&(i=this.values(),i[t]=n,s=this._trigger("slide",e,{handle:this.handles[t],value:n,values:i}),r=this.values(t?0:1),s!==!1&&this.values(t,n,!0))):n!==this.value()&&(s=this._trigger("slide",e,{handle:this.handles[t],value:n}),s!==!1&&this.value(n))},_stop:function(e,t){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("stop",e,n)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("change",e,n)}},value:function(e){if(arguments.length){this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0);return}return this._value()},values:function(t,n){var r,i,s;if(arguments.length>1){this.options.values[t]=this._trimAlignValue(n),this._refreshValue(),this._change(null,t);return}if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();r=this.options.values,i=arguments[0];for(s=0;s<r.length;s+=1)r[s]=this._trimAlignValue(i[s]),this._change(null,s);this._refreshValue()},_setOption:function(t,n){var r,i=0;e.isArray(this.options.values)&&(i=this.options.values.length),e.Widget.prototype._setOption.apply(this,arguments);switch(t){case"disabled":n?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.prop("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.prop("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(r=0;r<i;r+=1)this._change(null,r);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e),e},_values:function(e){var t,n,r;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t),t;n=this.options.values.slice();for(r=0;r<n.length;r+=1)n[r]=this._trimAlignValue(n[r]);return n},_trimAlignValue:function(e){if(e<=this._valueMin())return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,n=(e-this._valueMin())%t,r=e-n;return Math.abs(n)*2>=t&&(r+=n>0?t:-t),parseFloat(r.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,n,r,i,s,o=this.options.range,u=this.options,a=this,f=this._animateOff?!1:u.animate,l={};this.options.values&&this.options.values.length?this.handles.each(function(r){n=(a.values(r)-a._valueMin())/(a._valueMax()-a._valueMin())*100,l[a.orientation==="horizontal"?"left":"bottom"]=n+"%",e(this).stop(1,1)[f?"animate":"css"](l,u.animate),a.options.range===!0&&(a.orientation==="horizontal"?(r===0&&a.range.stop(1,1)[f?"animate":"css"]({left:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({width:n-t+"%"},{queue:!1,duration:u.animate})):(r===0&&a.range.stop(1,1)[f?"animate":"css"]({bottom:n+"%"},u.animate),r===1&&a.range[f?"animate":"css"]({height:n-t+"%"},{queue:!1,duration:u.animate}))),t=n}):(r=this.value(),i=this._valueMin(),s=this._valueMax(),n=s!==i?(r-i)/(s-i)*100:0,l[this.orientation==="horizontal"?"left":"bottom"]=n+"%",this.handle.stop(1,1)[f?"animate":"css"](l,u.animate),o==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[f?"animate":"css"]({width:n+"%"},u.animate),o==="max"&&this.orientation==="horizontal"&&this.range[f?"animate":"css"]({width:100-n+"%"},{queue:!1,duration:u.animate}),o==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[f?"animate":"css"]({height:n+"%"},u.animate),o==="max"&&this.orientation==="vertical"&&this.range[f?"animate":"css"]({height:100-n+"%"},{queue:!1,duration:u.animate}))}})})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){var e=5;t.widget("ui.slider",t.ui.mouse,{version:"1.10.3",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)o.push(a);this.handles=n.add(t(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):this.range=t([])},_setupEvents:function(){var t=this.handles.add(this.range).filter("a");this._off(t),this._on(t,this._handleEvents),this._hoverable(t),this._focusable(t)},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,a,o,r,h,l,u=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-u.values(e));(n>i||n===i&&(e===u._lastChangedValue||u.values(e)===c.min))&&(n=i,a=t(this),o=e)}),r=this._start(e,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),h=a.offset(),l=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:e.pageX-h.left-a.width()/2,top:e.pageY-h.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,a;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,a=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),a!==!1&&this.values(e,i,!0))):i!==this.value()&&(a=this._trigger("slide",t,{handle:this.handles[e],value:i}),a!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(e,i){var s,n,a;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),undefined;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,a,o=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[l?"animate":"css"](u,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(i){var s,n,a,o,r=t(i.target).data("ui-slider-handle-index");switch(i.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(i.target).addClass("ui-state-active"),s=this._start(i,r),s===!1))return}switch(o=this.options.step,n=a=this.options.values&&this.options.values.length?this.values(r):this.value(),i.keyCode){case t.ui.keyCode.HOME:a=this._valueMin();break;case t.ui.keyCode.END:a=this._valueMax();break;case t.ui.keyCode.PAGE_UP:a=this._trimAlignValue(n+(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.PAGE_DOWN:a=this._trimAlignValue(n-(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(n===this._valueMax())return;a=this._trimAlignValue(n+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n===this._valueMin())return;a=this._trimAlignValue(n-o)}this._slide(i,r,a)},click:function(t){t.preventDefault()},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}})})(jQuery);
\ No newline at end of file
index 963c4de25f7aaa18e8268cb1f3530a57e34afe81..1a84db7ae1ce2a9ac6c0ec89648373f61682ed01 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.sortable.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){e.widget("ui.sortable",e.ui.mouse,{version:"1.9.2",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var e=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?e.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_setOption:function(t,n){t==="disabled"?(this.options[t]=n,this.widget().toggleClass("ui-sortable-disabled",!!n)):e.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(t,n){var r=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(t);var i=null,s=e(t.target).parents().each(function(){if(e.data(this,r.widgetName+"-item")==r)return i=e(this),!1});e.data(t.target,r.widgetName+"-item")==r&&(i=e(t.target));if(!i)return!1;if(this.options.handle&&!n){var o=!1;e(this.options.handle,i).find("*").andSelf().each(function(){this==t.target&&(o=!0)});if(!o)return!1}return this.currentItem=i,this._removeCurrentsFromItems(),!0},_mouseStart:function(t,n,r){var i=this.options;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),i.containment&&this._setContainment(),i.cursor&&(e("body").css("cursor")&&(this._storedCursor=e("body").css("cursor")),e("body").css("cursor",i.cursor)),i.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",i.opacity)),i.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",i.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!r)for(var s=this.containers.length-1;s>=0;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var n=this.options,r=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<n.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+n.scrollSpeed:t.pageY-this.overflowOffset.top<n.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-n.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<n.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+n.scrollSpeed:t.pageX-this.overflowOffset.left<n.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-n.scrollSpeed)):(t.pageY-e(document).scrollTop()<n.scrollSensitivity?r=e(document).scrollTop(e(document).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<n.scrollSensitivity&&(r=e(document).scrollTop(e(document).scrollTop()+n.scrollSpeed)),t.pageX-e(document).scrollLeft()<n.scrollSensitivity?r=e(document).scrollLeft(e(document).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<n.scrollSensitivity&&(r=e(document).scrollLeft(e(document).scrollLeft()+n.scrollSpeed))),r!==!1&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var i=this.items.length-1;i>=0;i--){var s=this.items[i],o=s.item[0],u=this._intersectsWithPointer(s);if(!u)continue;if(s.instance!==this.currentContainer)continue;if(o!=this.currentItem[0]&&this.placeholder[u==1?"next":"prev"]()[0]!=o&&!e.contains(this.placeholder[0],o)&&(this.options.type=="semi-dynamic"?!e.contains(this.element[0],o):!0)){this.direction=u==1?"down":"up";if(this.options.tolerance!="pointer"&&!this._intersectsWithSides(s))break;this._rearrange(t,s),this._trigger("change",t,this._uiHash());break}}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,n){if(!t)return;e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t);if(this.options.revert){var r=this,i=this.placeholder.offset();this.reverting=!0,e(this.helper).animate({left:i.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:i.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){r._clear(t)})}else this._clear(t,n);return!1},cancel:function(){if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},e(n).each(function(){var n=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[-=_](.+)/);n&&r.push((t.key||n[1]+"[]")+"="+(t.key&&t.expression?n[1]:n[2]))}),!r.length&&t.key&&r.push(t.key+"="),r.join("&")},toArray:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},n.each(function(){r.push(e(t.item||this).attr(t.attribute||"id")||"")}),r},_intersectsWith:function(e){var t=this.positionAbs.left,n=t+this.helperProportions.width,r=this.positionAbs.top,i=r+this.helperProportions.height,s=e.left,o=s+e.width,u=e.top,a=u+e.height,f=this.offset.click.top,l=this.offset.click.left,c=r+f>u&&r+f<a&&t+l>s&&t+l<o;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?c:s<t+this.helperProportions.width/2&&n-this.helperProportions.width/2<o&&u<r+this.helperProportions.height/2&&i-this.helperProportions.height/2<a},_intersectsWithPointer:function(t){var n=this.options.axis==="x"||e.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),r=this.options.axis==="y"||e.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),i=n&&r,s=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return i?this.floating?o&&o=="right"||s=="down"?2:1:s&&(s=="down"?2:1):!1},_intersectsWithSides:function(t){var n=e.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),r=e.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),i=this._getDragVerticalDirection(),s=this._getDragHorizontalDirection();return this.floating&&s?s=="right"&&r||s=="left"&&!r:i&&(i=="down"&&n||i=="up"&&!n)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return e!=0&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return e!=0&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor==String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){var n=[],r=[],i=this._connectWith();if(i&&t)for(var s=i.length-1;s>=0;s--){var o=e(i[s]);for(var u=o.length-1;u>=0;u--){var a=e.data(o[u],this.widgetName);a&&a!=this&&!a.options.disabled&&r.push([e.isFunction(a.options.items)?a.options.items.call(a.element):e(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a])}}r.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var s=r.length-1;s>=0;s--)r[s][0].each(function(){n.push(this)});return e(n)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var n=0;n<t.length;n++)if(t[n]==e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var n=this.items,r=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],i=this._connectWith();if(i&&this.ready)for(var s=i.length-1;s>=0;s--){var o=e(i[s]);for(var u=o.length-1;u>=0;u--){var a=e.data(o[u],this.widgetName);a&&a!=this&&!a.options.disabled&&(r.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a))}}for(var s=r.length-1;s>=0;s--){var f=r[s][1],l=r[s][0];for(var u=0,c=l.length;u<c;u++){var h=e(l[u]);h.data(this.widgetName+"-item",f),n.push({item:h,instance:f,width:0,height:0,left:0,top:0})}}},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var n=this.items.length-1;n>=0;n--){var r=this.items[n];if(r.instance!=this.currentContainer&&this.currentContainer&&r.item[0]!=this.currentItem[0])continue;var i=this.options.toleranceElement?e(this.options.toleranceElement,r.item):r.item;t||(r.width=i.outerWidth(),r.height=i.outerHeight());var s=i.offset();r.left=s.left,r.top=s.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var n=this.containers.length-1;n>=0;n--){var s=this.containers[n].element.offset();this.containers[n].containerCache.left=s.left,this.containers[n].containerCache.top=s.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight()}return this},_createPlaceholder:function(t){t=t||this;var n=t.options;if(!n.placeholder||n.placeholder.constructor==String){var r=n.placeholder;n.placeholder={element:function(){var n=e(document.createElement(t.currentItem[0].nodeName)).addClass(r||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return r||(n.style.visibility="hidden"),n},update:function(e,i){if(r&&!n.forcePlaceholderSize)return;i.height()||i.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),i.width()||i.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10))}}}t.placeholder=e(n.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),n.placeholder.update(t,t.placeholder)},_contactContainers:function(t){var n=null,r=null;for(var i=this.containers.length-1;i>=0;i--){if(e.contains(this.currentItem[0],this.containers[i].element[0]))continue;if(this._intersectsWith(this.containers[i].containerCache)){if(n&&e.contains(this.containers[i].element[0],n.element[0]))continue;n=this.containers[i],r=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",t,this._uiHash(this)),this.containers[i].containerCache.over=0)}if(!n)return;if(this.containers.length===1)this.containers[r]._trigger("over",t,this._uiHash(this)),this.containers[r].containerCache.over=1;else{var s=1e4,o=null,u=this.containers[r].floating?"left":"top",a=this.containers[r].floating?"width":"height",f=this.positionAbs[u]+this.offset.click[u];for(var l=this.items.length-1;l>=0;l--){if(!e.contains(this.containers[r].element[0],this.items[l].item[0]))continue;if(this.items[l].item[0]==this.currentItem[0])continue;var c=this.items[l].item.offset()[u],h=!1;Math.abs(c-f)>Math.abs(c+this.items[l][a]-f)&&(h=!0,c+=this.items[l][a]),Math.abs(c-f)<s&&(s=Math.abs(c-f),o=this.items[l],this.direction=h?"up":"down")}if(!o&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[r],o?this._rearrange(t,o,null,!0):this._rearrange(t,null,this.containers[r].element,!0),this._trigger("change",t,this._uiHash()),this.containers[r]._trigger("change",t,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[r]._trigger("over",t,this._uiHash(this)),this.containers[r].containerCache.over=1}},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t,this.currentItem])):n.helper=="clone"?this.currentItem.clone():this.currentItem;return r.parents("body").length||e(n.appendTo!="parent"?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(r[0]),r[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(r[0].style.width==""||n.forceHelperSize)&&r.width(this.currentItem.width()),(r[0].style.height==""||n.forceHelperSize)&&r.height(this.currentItem.height()),r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t=this.options;t.containment=="parent"&&(t.containment=this.helper[0].parentNode);if(t.containment=="document"||t.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e(t.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(e(t.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(t.containment)){var n=e(t.containment)[0],r=e(t.containment).offset(),i=e(n).css("overflow")!="hidden";this.containment=[r.left+(parseInt(e(n).css("borderLeftWidth"),10)||0)+(parseInt(e(n).css("paddingLeft"),10)||0)-this.margins.left,r.top+(parseInt(e(n).css("borderTopWidth"),10)||0)+(parseInt(e(n).css("paddingTop"),10)||0)-this.margins.top,r.left+(i?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(e(n).css("borderLeftWidth"),10)||0)-(parseInt(e(n).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,r.top+(i?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(e(n).css("borderTopWidth"),10)||0)-(parseInt(e(n).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(t,n){n||(n=this.position);var r=t=="absolute"?1:-1,i=this.options,s=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var s=t.pageX,o=t.pageY;if(this.originalPosition){this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(s=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(s=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top));if(n.grid){var u=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1];o=this.containment?u-this.offset.click.top<this.containment[1]||u-this.offset.click.top>this.containment[3]?u-this.offset.click.top<this.containment[1]?u+n.grid[1]:u-n.grid[1]:u:u;var a=this.originalPageX+Math.round((s-this.originalPageX)/n.grid[0])*n.grid[0];s=this.containment?a-this.offset.click.left<this.containment[0]||a-this.offset.click.left>this.containment[2]?a-this.offset.click.left<this.containment[0]?a+n.grid[0]:a-n.grid[0]:a:a}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():i?0:r.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:r.scrollLeft())}},_rearrange:function(e,t,n,r){n?n[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var i=this.counter;this._delay(function(){i==this.counter&&this.refreshPositions(!r)})},_clear:function(t,n){this.reverting=!1;var r=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var i in this._storedCSS)if(this._storedCSS[i]=="auto"||this._storedCSS[i]=="static")this._storedCSS[i]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!n&&r.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!n&&r.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(n||(r.push(function(e){this._trigger("remove",e,this._uiHash())}),r.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),r.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer))));for(var i=this.containers.length-1;i>=0;i--)n||r.push(function(e){return function(t){e._trigger("deactivate",t,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over&&(r.push(function(e){return function(t){e._trigger("out",t,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over=0);this._storedCursor&&e("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!n){this._trigger("beforeStop",t,this._uiHash());for(var i=0;i<r.length;i++)r[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}n||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!n){for(var i=0;i<r.length;i++)r[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var n=t||this;return{helper:n.helper,placeholder:n.placeholder||e([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:t?t.element:null}}})})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){function e(t,e,i){return t>e&&e+i>t}function i(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.3",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===t.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,a.widgetName+"-item")===a?(s=t(this),!1):undefined}),t.data(e.target,a.widgetName+"-item")===a&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=t("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!o.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+o.scrollSpeed:e.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+o.scrollSpeed:e.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(e.pageY-t(document).scrollTop()<o.scrollSensitivity?r=t(document).scrollTop(t(document).scrollTop()-o.scrollSpeed):t(window).height()-(e.pageY-t(document).scrollTop())<o.scrollSensitivity&&(r=t(document).scrollTop(t(document).scrollTop()+o.scrollSpeed)),e.pageX-t(document).scrollLeft()<o.scrollSensitivity?r=t(document).scrollLeft(t(document).scrollLeft()-o.scrollSpeed):t(window).width()-(e.pageX-t(document).scrollLeft())<o.scrollSensitivity&&(r=t(document).scrollLeft(t(document).scrollLeft()+o.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!o.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=t.left,o=a+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>a&&o>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var i="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=i&&s,a=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return n?this.floating?o&&"right"===o||"down"===a?2:1:a&&("down"===a?2:1):!1},_intersectsWithSides:function(t){var i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),s=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return this.floating&&a?"right"===a&&s||"left"===a&&!s:n&&("down"===n&&i||"up"===n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var i,s,n,a,o=[],r=[],h=this._connectWith();if(h&&e)for(i=h.length-1;i>=0;i--)for(n=t(h[i]),s=n.length-1;s>=0;s--)a=t.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&r.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(r.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=r.length-1;i>=0;i--)r[i][0].each(function(){o.push(this)});return t(o)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i]),s=n.length-1;s>=0;s--)a=t.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(u.push([t.isFunction(a.options.items)?a.options.items.call(a.element[0],e,{item:this.currentItem}):t(a.options.items,a.element),a]),this.containers.push(a));for(i=u.length-1;i>=0;i--)for(o=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",o),c.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?e.currentItem.children().each(function(){t("<td>&#160;</td>",e.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(n)}):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_contactContainers:function(s){var n,a,o,r,h,l,c,u,d,p,f=null,m=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(f&&t.contains(this.containers[n].element[0],f.element[0]))continue;f=this.containers[n],m=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",s,this._uiHash(this)),this.containers[n].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[m].containerCache.over||(this.containers[m]._trigger("over",s,this._uiHash(this)),this.containers[m].containerCache.over=1);else{for(o=1e4,r=null,p=f.floating||i(this.currentItem),h=p?"left":"top",l=p?"width":"height",c=this.positionAbs[h]+this.offset.click[h],a=this.items.length-1;a>=0;a--)t.contains(this.containers[m].element[0],this.items[a].item[0])&&this.items[a].item[0]!==this.currentItem[0]&&(!p||e(this.positionAbs.top+this.offset.click.top,this.items[a].top,this.items[a].height))&&(u=this.items[a].item.offset()[h],d=!1,Math.abs(u-c)>Math.abs(u+this.items[a][l]-c)&&(d=!0,u+=this.items[a][l]),o>Math.abs(u-c)&&(o=Math.abs(u-c),r=this.items[a],this.direction=d?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[m])return;r?this._rearrange(s,r,null,!0):this._rearrange(s,null,this.containers[m].element,!0),this._trigger("change",s,this._uiHash()),this.containers[m]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[m],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[m]._trigger("over",s,this._uiHash(this)),this.containers[m].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,a=e.pageX,o=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)("auto"===this._storedCSS[i]||"static"===this._storedCSS[i])&&(this._storedCSS[i]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;i>=0;i--)e||s.push(function(t){return function(e){t._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(function(t){return function(e){t._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),i=0;s.length>i;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(i=0;s.length>i;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})})(jQuery);
\ No newline at end of file
index d29427228a33bd268642104307b6226189130a1b..62cd8de6a7408bce216d262bc31a3846c006c3e1 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.spinner.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e){function t(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.widget("ui.spinner",{version:"1.9.2",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},n=this.element;return e.each(["min","max","step"],function(e,r){var i=n.attr(r);i!==undefined&&i.length&&(t[r]=i)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){if(this.cancelBlur){delete this.cancelBlur;return}this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e)},mousewheel:function(e,t){if(!t)return;if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()},"mousedown .ui-spinner-button":function(t){function r(){var e=this.element[0]===this.document[0].activeElement;e||(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n}))}var n;n=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),r.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,r.call(this)});if(this._start(t)===!1)return;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(!e(t.currentTarget).hasClass("ui-state-active"))return;if(this._start(t)===!1)return!1;this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(e.height()*.5)&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var n=this.options,r=e.ui.keyCode;switch(t.keyCode){case r.UP:return this._repeat(null,1,t),!0;case r.DOWN:return this._repeat(null,-1,t),!0;case r.PAGE_UP:return this._repeat(null,n.page,t),!0;case r.PAGE_DOWN:return this._repeat(null,-n.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(e){return!this.spinning&&this._trigger("start",e)===!1?!1:(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(e,t,n){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,n)},e),this._spin(t*this.options.step,n)},_spin:function(e,t){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+e*this._increment(this.counter));if(!this.spinning||this._trigger("spin",t,{value:n})!==!1)this._value(n),this.counter++},_increment:function(t){var n=this.options.incremental;return n?e.isFunction(n)?n(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return this.options.min!==null&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),n=t.indexOf(".");return n===-1?0:t.length-n-1},_adjustValue:function(e){var t,n,r=this.options;return t=r.min!==null?r.min:0,n=e-t,n=Math.round(n/r.step)*r.step,e=t+n,e=parseFloat(e.toFixed(this._precision())),r.max!==null&&e>r.max?r.max:r.min!==null&&e<r.min?r.min:e},_stop:function(e){if(!this.spinning)return;clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e)},_setOption:function(e,t){if(e==="culture"||e==="numberFormat"){var n=this._parse(this.element.val());this.options[e]=t,this.element.val(this._format(n));return}(e==="max"||e==="min"||e==="step")&&typeof t=="string"&&(t=this._parse(t)),this._super(e,t),e==="disabled"&&(t?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:t(function(e){this._super(e),this._value(this.element.val())}),_parse:function(e){return typeof e=="string"&&e!==""&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),e===""||isNaN(e)?null:e},_format:function(e){return e===""?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(e,t){var n;e!==""&&(n=this._parse(e),n!==null&&(t||(n=this._adjustValue(n)),e=this._format(n))),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:t(function(e){this._stepUp(e)}),_stepUp:function(e){this._spin((e||1)*this.options.step)},stepDown:t(function(e){this._stepDown(e)}),_stepDown:function(e){this._spin((e||1)*-this.options.step)},pageUp:t(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:t(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){if(!arguments.length)return this._parse(this.element.val());t(this._value).call(this,e)},widget:function(){return this.uiSpinner}})})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.widget("ui.spinner",{version:"1.10.3",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);void 0!==n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var t=this.element[0]===this.document[0].activeElement;t||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span>"+"</a>"+"<a class='ui-spinner-button ui-spinner-down ui-corner-br'>"+"<span class='ui-icon "+this.options.icons.down+"'>&#9660;</span>"+"</a>"},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){if("culture"===t||"numberFormat"===t){var i=this._parse(this.element.val());return this.options[t]=e,this.element.val(this._format(i)),void 0}("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(e.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(e.down)),this._super(t,e),"disabled"===t&&(e?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:e(function(t){this._super(t),this._value(this.element.val())}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:e(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:e(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:e(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(e(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}})})(jQuery);
\ No newline at end of file
index bb6a64000c058a75dd86510a3f4e1fa4e9dfad04..e2f2ecb168bf9e35bdf2ff3b888929816993b418 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.tabs.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){function i(){return++n}function s(e){return e.hash.length>1&&e.href.replace(r,"")===location.href.replace(r,"").replace(/\s/g,"%20")}var n=0,r=/#.*$/;e.widget("ui.tabs",{version:"1.9.2",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var t=this,n=this.options,r=n.active,i=location.hash.substring(1);this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",n.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs();if(r===null){i&&this.tabs.each(function(t,n){if(e(n).attr("aria-controls")===i)return r=t,!1}),r===null&&(r=this.tabs.index(this.tabs.filter(".ui-tabs-active")));if(r===null||r===-1)r=this.tabs.length?0:!1}r!==!1&&(r=this.tabs.index(this.tabs.eq(r)),r===-1&&(r=n.collapsible?!1:0)),n.active=r,!n.collapsible&&n.active===!1&&this.anchors.length&&(n.active=0),e.isArray(n.disabled)&&(n.disabled=e.unique(n.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.options.active!==!1&&this.anchors.length?this.active=this._findActive(this.options.active):this.active=e(),this._refresh(),this.active.length&&this.load(n.active)},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var n=e(this.document[0].activeElement).closest("li"),r=this.tabs.index(n),i=!0;if(this._handlePageNav(t))return;switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:r++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:i=!1,r--;break;case e.ui.keyCode.END:r=this.anchors.length-1;break;case e.ui.keyCode.HOME:r=0;break;case e.ui.keyCode.SPACE:t.preventDefault(),clearTimeout(this.activating),this._activate(r);return;case e.ui.keyCode.ENTER:t.preventDefault(),clearTimeout(this.activating),this._activate(r===this.options.active?!1:r);return;default:return}t.preventDefault(),clearTimeout(this.activating),r=this._focusNextTab(r,i),t.ctrlKey||(n.attr("aria-selected","false"),this.tabs.eq(r).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",r)},this.delay))},_panelKeydown:function(t){if(this._handlePageNav(t))return;t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP)return this._activate(this._focusNextTab(this.options.active-1,!1)),!0;if(t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN)return this._activate(this._focusNextTab(this.options.active+1,!0)),!0},_findNextTab:function(t,n){function i(){return t>r&&(t=0),t<0&&(t=r),t}var r=this.tabs.length-1;while(e.inArray(i(),this.options.disabled)!==-1)t=n?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){if(e==="active"){this._activate(t);return}if(e==="disabled"){this._setupDisabled(t);return}this._super(e,t),e==="collapsible"&&(this.element.toggleClass("ui-tabs-collapsible",t),!t&&this.options.active===!1&&this._activate(0)),e==="event"&&this._setupEvents(t),e==="heightStyle"&&this._setupHeightStyle(t)},_tabId:function(e){return e.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,n=this.tablist.children(":has(a[href])");t.disabled=e.map(n.filter(".ui-state-disabled"),function(e){return n.index(e)}),this._processTabs(),t.active===!1||!this.anchors.length?(t.active=!1,this.active=e()):this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(n,r){var i,o,u,a=e(r).uniqueId().attr("id"),f=e(r).closest("li"),l=f.attr("aria-controls");s(r)?(i=r.hash,o=t.element.find(t._sanitizeSelector(i))):(u=t._tabId(f),i="#"+u,o=t.element.find(i),o.length||(o=t._createPanel(u),o.insertAfter(t.panels[n-1]||t.tablist)),o.attr("aria-live","polite")),o.length&&(t.panels=t.panels.add(o)),l&&f.data("ui-tabs-aria-controls",l),f.attr({"aria-controls":i.substring(1),"aria-labelledby":a}),o.attr("aria-labelledby",a)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var n=0,r;r=this.tabs[n];n++)t===!0||e.inArray(n,t)!==-1?e(r).addClass("ui-state-disabled").attr("aria-disabled","true"):e(r).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var n={click:function(e){e.preventDefault()}};t&&e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var n,r,i=this.element.parent();t==="fill"?(e.support.minHeight||(r=i.css("overflow"),i.css("overflow","hidden")),n=i.height(),this.element.siblings(":visible").each(function(){var t=e(this),r=t.css("position");if(r==="absolute"||r==="fixed")return;n-=t.outerHeight(!0)}),r&&i.css("overflow",r),this.element.children().not(this.panels).each(function(){n-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,n-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):t==="auto"&&(n=0,this.panels.each(function(){n=Math.max(n,e(this).height("").height())}).height(n))},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i.closest("li"),o=s[0]===r[0],u=o&&n.collapsible,a=u?e():this._getPanelForTab(s),f=r.length?this._getPanelForTab(r):e(),l={oldTab:r,oldPanel:f,newTab:u?e():s,newPanel:a};t.preventDefault();if(s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||o&&!n.collapsible||this._trigger("beforeActivate",t,l)===!1)return;n.active=u?!1:this.tabs.index(s),this.active=o?e():s,this.xhr&&this.xhr.abort(),!f.length&&!a.length&&e.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,l)},_toggle:function(t,n){function o(){r.running=!1,r._trigger("activate",t,n)}function u(){n.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),i.length&&r.options.show?r._show(i,r.options.show,o):(i.show(),o())}var r=this,i=n.newPanel,s=n.oldPanel;this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(n.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s.hide(),u()),s.attr({"aria-expanded":"false","aria-hidden":"true"}),n.oldTab.attr("aria-selected","false"),i.length&&s.length?n.oldTab.attr("tabIndex",-1):i.length&&this.tabs.filter(function(){return e(this).attr("tabIndex")===0}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}),n.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(t){var n,r=this._findActive(t);if(r[0]===this.active[0])return;r.length||(r=this.active),n=r.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop})},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(e){return typeof e=="string"&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeData("href.tabs").removeData("load.tabs").removeUniqueId(),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),n=t.data("ui-tabs-aria-controls");n?t.attr("aria-controls",n):t.removeAttr("aria-controls")}),this.panels.show(),this.options.heightStyle!=="content"&&this.panels.css("height","")},enable:function(n){var r=this.options.disabled;if(r===!1)return;n===t?r=!1:(n=this._getIndex(n),e.isArray(r)?r=e.map(r,function(e){return e!==n?e:null}):r=e.map(this.tabs,function(e,t){return t!==n?t:null})),this._setupDisabled(r)},disable:function(n){var r=this.options.disabled;if(r===!0)return;if(n===t)r=!0;else{n=this._getIndex(n);if(e.inArray(n,r)!==-1)return;e.isArray(r)?r=e.merge([n],r).sort():r=[n]}this._setupDisabled(r)},load:function(t,n){t=this._getIndex(t);var r=this,i=this.tabs.eq(t),o=i.find(".ui-tabs-anchor"),u=this._getPanelForTab(i),a={tab:i,panel:u};if(s(o[0]))return;this.xhr=e.ajax(this._ajaxSettings(o,n,a)),this.xhr&&this.xhr.statusText!=="canceled"&&(i.addClass("ui-tabs-loading"),u.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){u.html(e),r._trigger("load",n,a)},1)}).complete(function(e,t){setTimeout(function(){t==="abort"&&r.panels.stop(!1,!0),i.removeClass("ui-tabs-loading"),u.removeAttr("aria-busy"),e===r.xhr&&delete r.xhr},1)}))},_ajaxSettings:function(t,n,r){var i=this;return{url:t.attr("href"),beforeSend:function(t,s){return i._trigger("beforeLoad",n,e.extend({jqXHR:t,ajaxSettings:s},r))}}},_getPanelForTab:function(t){var n=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+n))}}),e.uiBackCompat!==!1&&(e.ui.tabs.prototype._ui=function(e,t){return{tab:e,panel:t,index:this.anchors.index(e)}},e.widget("ui.tabs",e.ui.tabs,{url:function(e,t){this.anchors.eq(e).attr("href",t)}}),e.widget("ui.tabs",e.ui.tabs,{options:{ajaxOptions:null,cache:!1},_create:function(){this._super();var t=this;this._on({tabsbeforeload:function(n,r){if(e.data(r.tab[0],"cache.tabs")){n.preventDefault();return}r.jqXHR.success(function(){t.options.cache&&e.data(r.tab[0],"cache.tabs",!0)})}})},_ajaxSettings:function(t,n,r){var i=this.options.ajaxOptions;return e.extend({},i,{error:function(e,t){try{i.error(e,t,r.tab.closest("li").index(),r.tab[0])}catch(n){}}},this._superApply(arguments))},_setOption:function(e,t){e==="cache"&&t===!1&&this.anchors.removeData("cache.tabs"),this._super(e,t)},_destroy:function(){this.anchors.removeData("cache.tabs"),this._super()},url:function(e){this.anchors.eq(e).removeData("cache.tabs"),this._superApply(arguments)}}),e.widget("ui.tabs",e.ui.tabs,{abort:function(){this.xhr&&this.xhr.abort()}}),e.widget("ui.tabs",e.ui.tabs,{options:{spinner:"<em>Loading&#8230;</em>"},_create:function(){this._super(),this._on({tabsbeforeload:function(e,t){if(e.target!==this.element[0]||!this.options.spinner)return;var n=t.tab.find("span"),r=n.html();n.html(this.options.spinner),t.jqXHR.complete(function(){n.html(r)})}})}}),e.widget("ui.tabs",e.ui.tabs,{options:{enable:null,disable:null},enable:function(t){var n=this.options,r;if(t&&n.disabled===!0||e.isArray(n.disabled)&&e.inArray(t,n.disabled)!==-1)r=!0;this._superApply(arguments),r&&this._trigger("enable",null,this._ui(this.anchors[t],this.panels[t]))},disable:function(t){var n=this.options,r;if(t&&n.disabled===!1||e.isArray(n.disabled)&&e.inArray(t,n.disabled)===-1)r=!0;this._superApply(arguments),r&&this._trigger("disable",null,this._ui(this.anchors[t],this.panels[t]))}}),e.widget("ui.tabs",e.ui.tabs,{options:{add:null,remove:null,tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},add:function(n,r,i){i===t&&(i=this.anchors.length);var s,o,u=this.options,a=e(u.tabTemplate.replace(/#\{href\}/g,n).replace(/#\{label\}/g,r)),f=n.indexOf("#")?this._tabId(a):n.replace("#","");return a.addClass("ui-state-default ui-corner-top").data("ui-tabs-destroy",!0),a.attr("aria-controls",f),s=i>=this.tabs.length,o=this.element.find("#"+f),o.length||(o=this._createPanel(f),s?i>0?o.insertAfter(this.panels.eq(-1)):o.appendTo(this.element):o.insertBefore(this.panels[i])),o.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").hide(),s?a.appendTo(this.tablist):a.insertBefore(this.tabs[i]),u.disabled=e.map(u.disabled,function(e){return e>=i?++e:e}),this.refresh(),this.tabs.length===1&&u.active===!1&&this.option("active",0),this._trigger("add",null,this._ui(this.anchors[i],this.panels[i])),this},remove:function(t){t=this._getIndex(t);var n=this.options,r=this.tabs.eq(t).remove(),i=this._getPanelForTab(r).remove();return r.hasClass("ui-tabs-active")&&this.anchors.length>2&&this._activate(t+(t+1<this.anchors.length?1:-1)),n.disabled=e.map(e.grep(n.disabled,function(e){return e!==t}),function(e){return e>=t?--e:e}),this.refresh(),this._trigger("remove",null,this._ui(r.find("a")[0],i[0])),this}}),e.widget("ui.tabs",e.ui.tabs,{length:function(){return this.anchors.length}}),e.widget("ui.tabs",e.ui.tabs,{options:{idPrefix:"ui-tabs-"},_tabId:function(t){var n=t.is("li")?t.find("a[href]"):t;return n=n[0],e(n).closest("li").attr("aria-controls")||n.title&&n.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF\-]/g,"")||this.options.idPrefix+i()}}),e.widget("ui.tabs",e.ui.tabs,{options:{panelTemplate:"<div></div>"},_createPanel:function(t){return e(this.options.panelTemplate).attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)}}),e.widget("ui.tabs",e.ui.tabs,{_create:function(){var e=this.options;e.active===null&&e.selected!==t&&(e.active=e.selected===-1?!1:e.selected),this._super(),e.selected=e.active,e.selected===!1&&(e.selected=-1)},_setOption:function(e,t){if(e!=="selected")return this._super(e,t);var n=this.options;this._super("active",t===-1?!1:t),n.selected=n.active,n.selected===!1&&(n.selected=-1)},_eventHandler:function(){this._superApply(arguments),this.options.selected=this.options.active,this.options.selected===!1&&(this.options.selected=-1)}}),e.widget("ui.tabs",e.ui.tabs,{options:{show:null,select:null},_create:function(){this._super(),this.options.active!==!1&&this._trigger("show",null,this._ui(this.active.find(".ui-tabs-anchor")[0],this._getPanelForTab(this.active)[0]))},_trigger:function(e,t,n){var r,i,s=this._superApply(arguments);return s?(e==="beforeActivate"?(r=n.newTab.length?n.newTab:n.oldTab,i=n.newPanel.length?n.newPanel:n.oldPanel,s=this._super("select",t,{tab:r.find(".ui-tabs-anchor")[0],panel:i[0],index:r.closest("li").index()})):e==="activate"&&n.newTab.length&&(s=this._super("show",t,{tab:n.newTab.find(".ui-tabs-anchor")[0],panel:n.newPanel[0],index:n.newTab.closest("li").index()})),s):!1}}),e.widget("ui.tabs",e.ui.tabs,{select:function(e){e=this._getIndex(e);if(e===-1){if(!this.options.collapsible||this.options.selected===-1)return;e=this.options.selected}this.anchors.eq(e).trigger(this.options.event+this.eventNamespace)}}),function(){var t=0;e.widget("ui.tabs",e.ui.tabs,{options:{cookie:null},_create:function(){var e=this.options,t;e.active==null&&e.cookie&&(t=parseInt(this._cookie(),10),t===-1&&(t=!1),e.active=t),this._super()},_cookie:function(n){var r=[this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+ ++t)];return arguments.length&&(r.push(n===!1?-1:n),r.push(this.options.cookie)),e.cookie.apply(null,r)},_refresh:function(){this._super(),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_eventHandler:function(){this._superApply(arguments),this.options.cookie&&this._cookie(this.options.active,this.options.cookie)},_destroy:function(){this._super(),this.options.cookie&&this._cookie(null,this.options.cookie)}})}(),e.widget("ui.tabs",e.ui.tabs,{_trigger:function(t,n,r){var i=e.extend({},r);return t==="load"&&(i.panel=i.panel[0],i.tab=i.tab.find(".ui-tabs-anchor")[0]),this._super(t,n,i)}}),e.widget("ui.tabs",e.ui.tabs,{options:{fx:null},_getFx:function(){var t,n,r=this.options.fx;return r&&(e.isArray(r)?(t=r[0],n=r[1]):t=n=r),r?{show:n,hide:t}:null},_toggle:function(e,t){function o(){n.running=!1,n._trigger("activate",e,t)}function u(){t.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),r.length&&s.show?r.animate(s.show,s.show.duration,function(){o()}):(r.show(),o())}var n=this,r=t.newPanel,i=t.oldPanel,s=this._getFx();if(!s)return this._super(e,t);n.running=!0,i.length&&s.hide?i.animate(s.hide,s.hide.duration,function(){t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),u()}):(t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),i.hide(),u())}}))})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t,e){function i(){return++n}function s(t){return t.hash.length>1&&decodeURIComponent(t.href.replace(a,""))===decodeURIComponent(location.href.replace(a,""))}var n=0,a=/#.*$/;t.widget("ui.tabs",{version:"1.10.3",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var i=this.options.active,s=this.options.collapsible,n=location.hash.substring(1);return null===i&&(n&&this.tabs.each(function(s,a){return t(a).attr("aria-controls")===n?(i=s,!1):e}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===i||-1===i)&&(i=this.tabs.length?0:!1)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),-1===i&&(i=s?!1:0)),!s&&i===!1&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(i){var s=t(this.document[0].activeElement).closest("li"),n=this.tabs.index(s),a=!0;if(!this._handlePageNav(i)){switch(i.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:a=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return i.preventDefault(),clearTimeout(this.activating),this._activate(n),e;case t.ui.keyCode.ENTER:return i.preventDefault(),clearTimeout(this.activating),this._activate(n===this.options.active?!1:n),e;default:return}i.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,a),i.ctrlKey||(s.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(i){return i.altKey&&i.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):i.altKey&&i.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):e},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,i){return"active"===t?(this._activate(i),e):"disabled"===t?(this._setupDisabled(i),e):(this._super(t,i),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",i),i||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(i),"heightStyle"===t&&this._setupHeightStyle(i),e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(i,n){var a,o,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),u=l.attr("aria-controls");s(n)?(a=n.hash,o=e.element.find(e._sanitizeSelector(a))):(r=e._tabId(l),a="#"+r,o=e.element.find(a),o.length||(o=e._createPanel(r),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),u&&l.data("ui-tabs-aria-controls",u),l.attr({"aria-controls":a.substring(1),"aria-labelledby":h}),o.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)e===!0||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?t():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):t(),u={oldTab:s,oldPanel:l,newTab:r?t():a,newPanel:h};e.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",e,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?t():a,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),e),this._toggle(e,u))},_toggle:function(e,i){function s(){a.running=!1,a._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var s=this.options.disabled;s!==!1&&(i===e?s=!1:(i=this._getIndex(i),s=t.isArray(s)?t.map(s,function(t){return t!==i?t:null}):t.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(s))},disable:function(i){var s=this.options.disabled;if(s!==!0){if(i===e)s=!0;else{if(i=this._getIndex(i),-1!==t.inArray(i,s))return;s=t.isArray(s)?t.merge([i],s).sort():[i]}this._setupDisabled(s)}},load:function(e,i){e=this._getIndex(e);var n=this,a=this.tabs.eq(e),o=a.find(".ui-tabs-anchor"),r=this._getPanelForTab(a),h={tab:a,panel:r};s(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(a.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),a.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,a){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:a},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})})(jQuery);
\ No newline at end of file
index 5077d911a7c5557b54e99aae1a5bba215eb379e2..48e52d93031634addac906f89aa5a1bd2a78f452 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.tooltip.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e){function n(t,n){var r=(t.attr("aria-describedby")||"").split(/\s+/);r.push(n),t.data("ui-tooltip-id",n).attr("aria-describedby",e.trim(r.join(" ")))}function r(t){var n=t.data("ui-tooltip-id"),r=(t.attr("aria-describedby")||"").split(/\s+/),i=e.inArray(n,r);i!==-1&&r.splice(i,1),t.removeData("ui-tooltip-id"),r=e.trim(r.join(" ")),r?t.attr("aria-describedby",r):t.removeAttr("aria-describedby")}var t=0;e.widget("ui.tooltip",{version:"1.9.2",options:{content:function(){return e(this).attr("title")},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(t,n){var r=this;if(t==="disabled"){this[n?"_disable":"_enable"](),this.options[t]=n;return}this._super(t,n),t==="content"&&e.each(this.tooltips,function(e,t){r._updateContent(t)})},_disable:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0)}),this.element.find(this.options.items).andSelf().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).andSelf().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var n=this,r=e(t?t.target:this.element).closest(this.options.items);if(!r.length||r.data("ui-tooltip-id"))return;r.attr("title")&&r.data("ui-tooltip-title",r.attr("title")),r.data("ui-tooltip-open",!0),t&&t.type==="mouseover"&&r.parents().each(function(){var t=e(this),r;t.data("ui-tooltip-open")&&(r=e.Event("blur"),r.target=r.currentTarget=this,n.close(r,!0)),t.attr("title")&&(t.uniqueId(),n.parents[this.id]={element:this,title:t.attr("title")},t.attr("title",""))}),this._updateContent(r,t)},_updateContent:function(e,t){var n,r=this.options.content,i=this,s=t?t.type:null;if(typeof r=="string")return this._open(t,e,r);n=r.call(e[0],function(n){if(!e.data("ui-tooltip-open"))return;i._delay(function(){t&&(t.type=s),this._open(t,e,n)})}),n&&this._open(t,e,n)},_open:function(t,r,i){function f(e){a.of=e;if(s.is(":hidden"))return;s.position(a)}var s,o,u,a=e.extend({},this.options.position);if(!i)return;s=this._find(r);if(s.length){s.find(".ui-tooltip-content").html(i);return}r.is("[title]")&&(t&&t.type==="mouseover"?r.attr("title",""):r.removeAttr("title")),s=this._tooltip(r),n(r,s.attr("id")),s.find(".ui-tooltip-content").html(i),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:f}),f(t)):s.position(e.extend({of:r},this.options.position)),s.hide(),this._show(s,this.options.show),this.options.show&&this.options.show.delay&&(u=setInterval(function(){s.is(":visible")&&(f(a.of),clearInterval(u))},e.fx.interval)),this._trigger("open",t,{tooltip:s}),o={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var n=e.Event(t);n.currentTarget=r[0],this.close(n,!0)}},remove:function(){this._removeTooltip(s)}};if(!t||t.type==="mouseover")o.mouseleave="close";if(!t||t.type==="focusin")o.focusout="close";this._on(!0,r,o)},close:function(t){var n=this,i=e(t?t.currentTarget:this.element),s=this._find(i);if(this.closing)return;i.data("ui-tooltip-title")&&i.attr("title",i.data("ui-tooltip-title")),r(i),s.stop(!0),this._hide(s,this.options.hide,function(){n._removeTooltip(e(this))}),i.removeData("ui-tooltip-open"),this._off(i,"mouseleave focusout keyup"),i[0]!==this.element[0]&&this._off(i,"remove"),this._off(this.document,"mousemove"),t&&t.type==="mouseleave"&&e.each(this.parents,function(t,r){e(r.element).attr("title",r.title),delete n.parents[t]}),this.closing=!0,this._trigger("close",t,{tooltip:s}),this.closing=!1},_tooltip:function(n){var r="ui-tooltip-"+t++,i=e("<div>").attr({id:r,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return e("<div>").addClass("ui-tooltip-content").appendTo(i),i.appendTo(this.document[0].body),e.fn.bgiframe&&i.bgiframe(),this.tooltips[r]=n,i},_find:function(t){var n=t.data("ui-tooltip-id");return n?e("#"+n):e()},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r[0],t.close(i,!0),e("#"+n).remove(),r.data("ui-tooltip-title")&&(r.attr("title",r.data("ui-tooltip-title")),r.removeData("ui-tooltip-title"))})}})})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(t){function e(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))}function i(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")}var s=0;t.widget("ui.tooltip",{version:"1.10.3",options:{content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,i){var s=this;return"disabled"===e?(this[i?"_disable":"_enable"](),this.options[e]=i,void 0):(this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e)}),void 0)},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,a=e?e.type:null;return"string"==typeof s?this._open(e,t,s):(i=s.call(t[0],function(i){t.data("ui-tooltip-open")&&n._delay(function(){e&&(e.type=a),this._open(e,t,i)})}),i&&this._open(e,t,i),void 0)},_open:function(i,s,n){function a(t){l.of=t,o.is(":hidden")||o.position(l)}var o,r,h,l=t.extend({},this.options.position);if(n){if(o=this._find(s),o.length)return o.find(".ui-tooltip-content").html(n),void 0;s.is("[title]")&&(i&&"mouseover"===i.type?s.attr("title",""):s.removeAttr("title")),o=this._tooltip(s),e(s,o.attr("id")),o.find(".ui-tooltip-content").html(n),this.options.track&&i&&/^mouse/.test(i.type)?(this._on(this.document,{mousemove:a}),a(i)):o.position(t.extend({of:s},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.show&&this.options.show.delay&&(h=this.delayedShow=setInterval(function(){o.is(":visible")&&(a(l.of),clearInterval(h))},t.fx.interval)),this._trigger("open",i,{tooltip:o}),r={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var i=t.Event(e);i.currentTarget=s[0],this.close(i,!0)}},remove:function(){this._removeTooltip(o)}},i&&"mouseover"!==i.type||(r.mouseleave="close"),i&&"focusin"!==i.type||(r.focusout="close"),this._on(!0,s,r)}},close:function(e){var s=this,n=t(e?e.currentTarget:this.element),a=this._find(n);this.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&n.attr("title",n.data("ui-tooltip-title")),i(n),a.stop(!0),this._hide(a,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:a}),this.closing=!1)},_tooltip:function(e){var i="ui-tooltip-"+s++,n=t("<div>").attr({id:i,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("<div>").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),this.tooltips[i]=e,n},_find:function(e){var i=e.data("ui-tooltip-id");return i?t("#"+i):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0),t("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))})}})})(jQuery);
\ No newline at end of file
index 865bc98d42b4648d766787ec83b36fa9d8720706..d2358d39d567f07c1337c890b4b4b405754cd1d4 100644 (file)
@@ -1,5 +1,4 @@
-/*! jQuery UI - v1.9.2 - 2012-11-23
+/*! jQuery UI - v1.10.3 - 2013-05-03
 * http://jqueryui.com
-* Includes: jquery.ui.widget.js
-* Copyright 2012 jQuery Foundation and other contributors; Licensed MIT */
-(function(e,t){var n=0,r=Array.prototype.slice,i=e.cleanData;e.cleanData=function(t){for(var n=0,r;(r=t[n])!=null;n++)try{e(r).triggerHandler("remove")}catch(s){}i(t)},e.widget=function(t,n,r){var i,s,o,u,a=t.split(".")[0];t=t.split(".")[1],i=a+"-"+t,r||(r=n,n=e.Widget),e.expr[":"][i.toLowerCase()]=function(t){return!!e.data(t,i)},e[a]=e[a]||{},s=e[a][t],o=e[a][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,s,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),u=new n,u.options=e.widget.extend({},u.options),e.each(r,function(t,i){e.isFunction(i)&&(r[t]=function(){var e=function(){return n.prototype[t].apply(this,arguments)},r=function(e){return n.prototype[t].apply(this,e)};return function(){var t=this._super,n=this._superApply,s;return this._super=e,this._superApply=r,s=i.apply(this,arguments),this._super=t,this._superApply=n,s}}())}),o.prototype=e.widget.extend(u,{widgetEventPrefix:s?u.widgetEventPrefix:t},r,{constructor:o,namespace:a,widgetName:t,widgetBaseClass:i,widgetFullName:i}),s?(e.each(s._childConstructors,function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,o,n._proto)}),delete s._childConstructors):n._childConstructors.push(o),e.widget.bridge(t,o)},e.widget.extend=function(n){var i=r.call(arguments,1),s=0,o=i.length,u,a;for(;s<o;s++)for(u in i[s])a=i[s][u],i[s].hasOwnProperty(u)&&a!==t&&(e.isPlainObject(a)?n[u]=e.isPlainObject(n[u])?e.widget.extend({},n[u],a):e.widget.extend({},a):n[u]=a);return n},e.widget.bridge=function(n,i){var s=i.prototype.widgetFullName||n;e.fn[n]=function(o){var u=typeof o=="string",a=r.call(arguments,1),f=this;return o=!u&&a.length?e.widget.extend.apply(null,[o].concat(a)):o,u?this.each(function(){var r,i=e.data(this,s);if(!i)return e.error("cannot call methods on "+n+" prior to initialization; "+"attempted to call method '"+o+"'");if(!e.isFunction(i[o])||o.charAt(0)==="_")return e.error("no such method '"+o+"' for "+n+" widget instance");r=i[o].apply(i,a);if(r!==i&&r!==t)return f=r&&r.jquery?f.pushStack(r.get()):r,!1}):this.each(function(){var t=e.data(this,s);t?t.option(o||{})._init():e.data(this,s,new i(o,this))}),f}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,r){r=e(r||this.defaultElement||this)[0],this.element=e(r),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),r!==this&&(e.data(r,this.widgetName,this),e.data(r,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===r&&this.destroy()}}),this.document=e(r.style?r.ownerDocument:r.document||r),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(n,r){var i=n,s,o,u;if(arguments.length===0)return e.widget.extend({},this.options);if(typeof n=="string"){i={},s=n.split("."),n=s.shift();if(s.length){o=i[n]=e.widget.extend({},this.options[n]);for(u=0;u<s.length-1;u++)o[s[u]]=o[s[u]]||{},o=o[s[u]];n=s.pop();if(r===t)return o[n]===t?null:o[n];o[n]=r}else{if(r===t)return this.options[n]===t?null:this.options[n];i[n]=r}}return this._setOptions(i),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,e==="disabled"&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(t,n,r){var i,s=this;typeof t!="boolean"&&(r=n,n=t,t=!1),r?(n=i=e(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,i=this.widget()),e.each(r,function(r,o){function u(){if(!t&&(s.options.disabled===!0||e(this).hasClass("ui-state-disabled")))return;return(typeof o=="string"?s[o]:o).apply(s,arguments)}typeof o!="string"&&(u.guid=o.guid=o.guid||u.guid||e.guid++);var a=r.match(/^(\w+)\s*(.*)$/),f=a[1]+s.eventNamespace,l=a[2];l?i.delegate(l,f,u):n.bind(f,u)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function n(){return(typeof e=="string"?r[e]:e).apply(r,arguments)}var r=this;return setTimeout(n,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,n,r){var i,s,o=this.options[t];r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent;if(s)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&o.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(r,i,s){typeof i=="string"&&(i={effect:i});var o,u=i?i===!0||typeof i=="number"?n:i.effect||n:t;i=i||{},typeof i=="number"&&(i={duration:i}),o=!e.isEmptyObject(i),i.complete=s,i.delay&&r.delay(i.delay),o&&e.effects&&(e.effects.effect[u]||e.uiBackCompat!==!1&&e.effects[u])?r[t](i):u!==t&&r[u]?r[u](i.duration,i.easing,s):r.queue(function(n){e(this)[t](),s&&s.call(r[0]),n()})}}),e.uiBackCompat!==!1&&(e.Widget.prototype._getCreateOptions=function(){return e.metadata&&e.metadata.get(this.element[0])[this.widgetName]})})(jQuery);
\ No newline at end of file
+* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
+(function(e,t){var i=0,s=Array.prototype.slice,n=e.cleanData;e.cleanData=function(t){for(var i,s=0;null!=(i=t[s]);s++)try{e(i).triggerHandler("remove")}catch(a){}n(t)},e.widget=function(i,s,n){var a,r,o,h,l={},u=i.split(".")[0];i=i.split(".")[1],a=u+"-"+i,n||(n=s,s=e.Widget),e.expr[":"][a.toLowerCase()]=function(t){return!!e.data(t,a)},e[u]=e[u]||{},r=e[u][i],o=e[u][i]=function(e,i){return this._createWidget?(arguments.length&&this._createWidget(e,i),t):new o(e,i)},e.extend(o,r,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),h=new s,h.options=e.widget.extend({},h.options),e.each(n,function(i,n){return e.isFunction(n)?(l[i]=function(){var e=function(){return s.prototype[i].apply(this,arguments)},t=function(e){return s.prototype[i].apply(this,e)};return function(){var i,s=this._super,a=this._superApply;return this._super=e,this._superApply=t,i=n.apply(this,arguments),this._super=s,this._superApply=a,i}}(),t):(l[i]=n,t)}),o.prototype=e.widget.extend(h,{widgetEventPrefix:r?h.widgetEventPrefix:i},l,{constructor:o,namespace:u,widgetName:i,widgetFullName:a}),r?(e.each(r._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete r._childConstructors):s._childConstructors.push(o),e.widget.bridge(i,o)},e.widget.extend=function(i){for(var n,a,r=s.call(arguments,1),o=0,h=r.length;h>o;o++)for(n in r[o])a=r[o][n],r[o].hasOwnProperty(n)&&a!==t&&(i[n]=e.isPlainObject(a)?e.isPlainObject(i[n])?e.widget.extend({},i[n],a):e.widget.extend({},a):a);return i},e.widget.bridge=function(i,n){var a=n.prototype.widgetFullName||i;e.fn[i]=function(r){var o="string"==typeof r,h=s.call(arguments,1),l=this;return r=!o&&h.length?e.widget.extend.apply(null,[r].concat(h)):r,o?this.each(function(){var s,n=e.data(this,a);return n?e.isFunction(n[r])&&"_"!==r.charAt(0)?(s=n[r].apply(n,h),s!==n&&s!==t?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):t):e.error("no such method '"+r+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+r+"'")}):this.each(function(){var t=e.data(this,a);t?t.option(r||{})._init():e.data(this,a,new n(r,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(i,s){var n,a,r,o=i;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof i)if(o={},n=i.split("."),i=n.shift(),n.length){for(a=o[i]=e.widget.extend({},this.options[i]),r=0;n.length-1>r;r++)a[n[r]]=a[n[r]]||{},a=a[n[r]];if(i=n.pop(),s===t)return a[i]===t?null:a[i];a[i]=s}else{if(s===t)return this.options[i]===t?null:this.options[i];o[i]=s}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var a,r=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=a=e(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,a=this.widget()),e.each(n,function(n,o){function h(){return i||r.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?r[o]:o).apply(r,arguments):t}"string"!=typeof o&&(h.guid=o.guid=o.guid||h.guid||e.guid++);var l=n.match(/^(\w+)\s*(.*)$/),u=l[1]+r.eventNamespace,c=l[2];c?a.delegate(c,u,h):s.bind(u,h)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,r=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var r,o=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),r=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),r&&e.effects&&e.effects.effect[o]?s[t](n):o!==t&&s[o]?s[o](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}})})(jQuery);
\ No newline at end of file
index 5a77d50a5a94da8243f293629e29c7435f68304e..fc497cd84dabc40d98e1fe633570859338c6508f 100644 (file)
@@ -45,7 +45,7 @@
                        props.title = props.title || attachment.title;
 
                        link = props.link || defaultProps.link || getUserSetting( 'urlbutton', 'file' );
-                       if ( 'file' === link )
+                       if ( 'file' === link || 'embed' === link )
                                linkUrl = attachment.url;
                        else if ( 'post' === link )
                                linkUrl = attachment.link;
@@ -66,7 +66,8 @@
                                        src:       size.url,
                                        captionId: 'attachment_' + attachment.id
                                });
-
+                       } else if ( 'video' === attachment.type || 'audio' === attachment.type ) {
+                               _.extend( props, _.pick( attachment, 'title', 'type', 'icon', 'mime' ) );
                        // Format properties for non-images.
                        } else {
                                props.title = props.title || attachment.filename;
                        return wp.html.string( options );
                },
 
+               audio: function( props, attachment ) {
+                       return wp.media.string._audioVideo( 'audio', props, attachment );
+               },
+
+               video: function( props, attachment ) {
+                       return wp.media.string._audioVideo( 'video', props, attachment );
+               },
+
+               _audioVideo: function( type, props, attachment ) {
+                       var shortcode, html, extension;
+
+                       props = wp.media.string.props( props, attachment );
+                       if ( props.link !== 'embed' )
+                               return wp.media.string.link( props );
+
+                       shortcode = {};
+
+                       if ( 'video' === type ) {
+                               if ( attachment.width )
+                                       shortcode.width = attachment.width;
+
+                               if ( attachment.height )
+                                       shortcode.height = attachment.height;
+                       }
+
+                       extension = attachment.filename.split('.').pop();
+
+                       if ( _.contains( wp.media.view.settings.embedExts, extension ) ) {
+                               shortcode[extension] = attachment.url;
+                       } else {
+                               // Render unsupported audio and video files as links.
+                               return wp.media.string.link( props );
+                       }
+
+                       html = wp.shortcode.string({
+                               tag:     type,
+                               attrs:   shortcode
+                       });
+
+                       return html;
+               },
+
                image: function( props, attachment ) {
                        var img = {},
                                options, classes, shortcode, html;
                        props = wp.media.string.props( props, attachment );
                        classes = props.classes || [];
 
-                       img.src = props.url;
+                       img.src = typeof attachment !== 'undefined' ? attachment.url : props.url;
                        _.extend( img, _.pick( props, 'width', 'height', 'alt' ) );
 
                        // Only assign the align class to the image if we're not printing
                add: function( id, options ) {
                        var workflow = this.get( id );
 
-                       if ( workflow )
+                       if ( workflow ) // only add once: if exists return existing
                                return workflow;
 
                        workflow = workflows[ id ] = wp.media( _.defaults( options || {}, {
                                                if ( props[ prop ] )
                                                        options[ option ] = props[ prop ];
                                        });
-
+                               } else if ( 'video' === attachment.type ) {
+                                       html = wp.media.string.video( props, attachment );
+                               } else if ( 'audio' === attachment.type ) {
+                                       html = wp.media.string.audio( props, attachment );
                                } else {
                                        html = wp.media.string.link( props );
                                        options.post_title = props.title;
                        }
                },
 
-               open: function( id ) {
+               open: function( id, options ) {
                        var workflow, editor;
 
+                       options = options || {};
+
                        id = this.id( id );
 
                        // Save a bookmark of the caret position in IE.
 
                        workflow = this.get( id );
 
-                       // Initialize the editor's workflow if we haven't yet.
-                       if ( ! workflow )
-                               workflow = this.add( id );
+                       // Redo workflow if state has changed
+                       if ( ! workflow || ( workflow.options && options.state !== workflow.options.state ) )
+                               workflow = this.add( id, options );
 
                        return workflow.open();
                },
                init: function() {
                        $(document.body).on( 'click', '.insert-media', function( event ) {
                                var $this = $(this),
-                                       editor = $this.data('editor');
+                                       editor = $this.data('editor'),
+                                       options = {
+                                               frame:    'post',
+                                               state:    'insert',
+                                               title:    wp.media.view.l10n.addMedia,
+                                               multiple: true
+                                       };
 
                                event.preventDefault();
 
                                // See: http://core.trac.wordpress.org/ticket/22445
                                $this.blur();
 
-                               wp.media.editor.open( editor );
+                               if ( $this.hasClass( 'gallery' ) ) {
+                                       options.state = 'gallery';
+                                       options.title = wp.media.view.l10n.createGalleryTitle;
+                               }
+
+                               wp.media.editor.open( editor, options );
                        });
                }
        };
index 2f2d4f17084ae0572d9d775066603c0c621c1da4..091450afa0adba570c0b24b8d089a4a459eaf9c9 100644 (file)
@@ -1 +1 @@
-(function(b){var a={};wp.media.string={props:function(f,i){var h,c,e,g,d,j=wp.media.view.settings.defaultProps;d=function(k){if("image"===k.type&&!k.alt){k.alt=k.caption||k.title||"";k.alt=k.alt.replace(/<\/?[^>]+>/g,"");k.alt=k.alt.replace(/[\r\n]+/g," ")}return k};f=f?_.clone(f):{};if(i&&i.type){f.type=i.type}if("image"===f.type){f=_.defaults(f||{},{align:j.align||getUserSetting("align","none"),size:j.size||getUserSetting("imgsize","medium"),url:"",classes:[]})}if(!i){return d(f)}f.title=f.title||i.title;h=f.link||j.link||getUserSetting("urlbutton","file");if("file"===h){c=i.url}else{if("post"===h){c=i.link}else{if("custom"===h){c=f.linkUrl}}}f.linkUrl=c||"";if("image"===i.type){f.classes.push("wp-image-"+i.id);g=i.sizes;e=g&&g[f.size]?g[f.size]:i;_.extend(f,_.pick(i,"align","caption","alt"),{width:e.width,height:e.height,src:e.url,captionId:"attachment_"+i.id})}else{f.title=f.title||i.filename;f.rel=f.rel||"attachment wp-att-"+i.id}return d(f)},link:function(d,e){var c;d=wp.media.string.props(d,e);c={tag:"a",content:d.title,attrs:{href:d.linkUrl}};if(d.rel){c.attrs.rel=d.rel}return wp.html.string(c)},image:function(g,i){var c={},d,f,h,e;g=wp.media.string.props(g,i);f=g.classes||[];c.src=g.url;_.extend(c,_.pick(g,"width","height","alt"));if(g.align&&!g.caption){f.push("align"+g.align)}if(g.size){f.push("size-"+g.size)}c["class"]=_.compact(f).join(" ");d={tag:"img",attrs:c,single:true};if(g.linkUrl){d={tag:"a",attrs:{href:g.linkUrl},content:d}}e=wp.html.string(d);if(g.caption){h={};if(c.width){h.width=c.width}if(g.captionId){h.id=g.captionId}if(g.align){h.align="align"+g.align}e=wp.shortcode.string({tag:"caption",attrs:h,content:e+" "+g.caption})}return e}};wp.media.gallery=(function(){var c={};return{defaults:{order:"ASC",id:wp.media.view.settings.post.id,itemtag:"dl",icontag:"dt",captiontag:"dd",columns:"3",link:"post",size:"thumbnail",orderby:"menu_order ID"},attachments:function(h){var j=h.string(),d=c[j],f,e,i,g;delete c[j];if(d){return d}f=_.defaults(h.attrs.named,wp.media.gallery.defaults);e=_.pick(f,"orderby","order");e.type="image";e.perPage=-1;if("rand"===f.orderby){f._orderbyRandom=true}if(!f.orderby||/^menu_order(?: ID)?$/i.test(f.orderby)){e.orderby="menuOrder"}if(f.ids){e.post__in=f.ids.split(",");e.orderby="post__in"}else{if(f.include){e.post__in=f.include.split(",")}}if(f.exclude){e.post__not_in=f.exclude.split(",")}if(!e.post__in){e.uploadedTo=f.id}g=_.omit(f,"id","ids","include","exclude","orderby","order");i=wp.media.query(e);i.gallery=new Backbone.Model(g);return i},shortcode:function(d){var f=d.props.toJSON(),e=_.pick(f,"orderby","order"),g,h;if(d.gallery){_.extend(e,d.gallery.toJSON())}e.ids=d.pluck("id");if(f.uploadedTo){e.id=f.uploadedTo}if(e._orderbyRandom){e.orderby="rand"}delete e._orderbyRandom;if(e.ids&&"post__in"===e.orderby){delete e.orderby}_.each(wp.media.gallery.defaults,function(j,i){if(j===e[i]){delete e[i]}});g=new wp.shortcode({tag:"gallery",attrs:e,type:"single"});h=new wp.media.model.Attachments(d.models,{props:f});h.gallery=d.gallery;c[g.string()]=h;return g},edit:function(g){var f=wp.shortcode.next("gallery",g),h=wp.media.gallery.defaults.id,d,e;if(!f||f.content!==g){return}f=f.shortcode;if(_.isUndefined(f.get("id"))&&!_.isUndefined(h)){f.set("id",h)}d=wp.media.gallery.attachments(f);e=new wp.media.model.Selection(d.models,{props:d.props.toJSON(),multiple:true});e.gallery=d.gallery;e.more().done(function(){e.props.set({query:false});e.unmirror();e.props.unset("orderby")});if(this.frame){this.frame.dispose()}this.frame=wp.media({frame:"post",state:"gallery-edit",title:wp.media.view.l10n.editGalleryTitle,editing:true,multiple:true,selection:e}).open();return this.frame}}}());wp.media.featuredImage={get:function(){return wp.media.view.settings.post.featuredImageId},set:function(d){var c=wp.media.view.settings;c.post.featuredImageId=d;wp.media.post("set-post-thumbnail",{json:true,post_id:c.post.id,thumbnail_id:c.post.featuredImageId,_wpnonce:c.post.nonce}).done(function(e){b(".inside","#postimagediv").html(e)})},frame:function(){if(this._frame){return this._frame}this._frame=wp.media({state:"featured-image",states:[new wp.media.controller.FeaturedImage()]});this._frame.on("toolbar:create:featured-image",function(c){this.createSelectToolbar(c,{text:wp.media.view.l10n.setFeaturedImage})},this._frame);this._frame.state("featured-image").on("select",this.select);return this._frame},select:function(){var d=wp.media.view.settings,c=this.get("selection").single();if(!d.post.featuredImageId){return}wp.media.featuredImage.set(c?c.id:-1)},init:function(){b("#postimagediv").on("click","#set-post-thumbnail",function(c){c.preventDefault();c.stopPropagation();wp.media.featuredImage.frame().open()}).on("click","#remove-post-thumbnail",function(){wp.media.view.settings.post.featuredImageId=-1})}};b(wp.media.featuredImage.init);wp.media.editor={insert:function(g){var d=typeof(tinymce)!="undefined",j=typeof(QTags)!="undefined",c=window.wpActiveEditor,f;if(window.send_to_editor){return window.send_to_editor.apply(this,arguments)}if(!c){if(d&&tinymce.activeEditor){f=tinymce.activeEditor;c=window.wpActiveEditor=f.id}else{if(!j){return false}}}else{if(d){if(tinymce.activeEditor&&(tinymce.activeEditor.id=="mce_fullscreen"||tinymce.activeEditor.id=="wp_mce_fullscreen")){f=tinymce.activeEditor}else{f=tinymce.get(c)}}}if(f&&!f.isHidden()){if(tinymce.isIE&&f.windowManager.insertimagebookmark){f.selection.moveToBookmark(f.windowManager.insertimagebookmark)}if(g.indexOf("[caption")!==-1){if(f.wpSetImgCaption){g=f.wpSetImgCaption(g)}}else{if(g.indexOf("[gallery")!==-1){if(f.plugins.wpgallery){g=f.plugins.wpgallery._do_gallery(g)}}else{if(g.indexOf("[embed")===0){if(f.plugins.wordpress){g=f.plugins.wordpress._setEmbed(g)}}}}f.execCommand("mceInsertContent",false,g)}else{if(j){QTags.insertContent(g)}else{document.getElementById(c).value+=g}}if(window.tb_remove){try{window.tb_remove()}catch(i){}}},add:function(e,c){var d=this.get(e);if(d){return d}d=a[e]=wp.media(_.defaults(c||{},{frame:"post",state:"insert",title:wp.media.view.l10n.addMedia,multiple:true}));d.on("insert",function(f){var g=d.state();f=f||g.get("selection");if(!f){return}b.when.apply(b,f.map(function(i){var h=g.display(i).toJSON();return this.send.attachment(h,i.toJSON())},this)).done(function(){wp.media.editor.insert(_.toArray(arguments).join("\n\n"))})},this);d.state("gallery-edit").on("update",function(f){this.insert(wp.media.gallery.shortcode(f).string())},this);d.state("embed").on("select",function(){var g=d.state(),f=g.get("type"),h=g.props.toJSON();h.url=h.url||"";if("link"===f){_.defaults(h,{title:h.url,linkUrl:h.url});this.send.link(h).done(function(i){wp.media.editor.insert(i)})}else{if("image"===f){_.defaults(h,{title:h.url,linkUrl:"",align:"none",link:"none"});if("none"===h.link){h.linkUrl=""}else{if("file"===h.link){h.linkUrl=h.url}}this.insert(wp.media.string.image(h))}}},this);d.state("featured-image").on("select",wp.media.featuredImage.select);d.setState(d.options.state);return d},id:function(c){if(c){return c}c=wpActiveEditor;if(!c&&typeof tinymce!=="undefined"&&tinymce.activeEditor){c=tinymce.activeEditor.id}c=c||"";return c},get:function(c){c=this.id(c);return a[c]},remove:function(c){c=this.id(c);delete a[c]},send:{attachment:function(f,g){var c=g.caption,d,e;if(!wp.media.view.settings.captions){delete g.caption}f=wp.media.string.props(f,g);d={id:g.id,post_content:g.description,post_excerpt:c};if(f.linkUrl){d.url=f.linkUrl}if("image"===g.type){e=wp.media.string.image(f);_.each({align:"align",size:"image-size",alt:"image_alt"},function(h,i){if(f[i]){d[h]=f[i]}})}else{e=wp.media.string.link(f);d.post_title=f.title}return wp.media.post("send-attachment-to-editor",{nonce:wp.media.view.settings.nonce.sendToEditor,attachment:d,html:e,post_id:wp.media.view.settings.post.id})},link:function(c){return wp.media.post("send-link-to-editor",{nonce:wp.media.view.settings.nonce.sendToEditor,src:c.linkUrl,title:c.title,html:wp.media.string.link(c),post_id:wp.media.view.settings.post.id})}},open:function(e){var d,c;e=this.id(e);if(typeof tinymce!=="undefined"){c=tinymce.get(e);if(tinymce.isIE&&c&&!c.isHidden()){c.focus();c.windowManager.insertimagebookmark=c.selection.getBookmark()}}d=this.get(e);if(!d){d=this.add(e)}return d.open()},init:function(){b(document.body).on("click",".insert-media",function(d){var e=b(this),c=e.data("editor");d.preventDefault();e.blur();wp.media.editor.open(c)})}};_.bindAll(wp.media.editor,"open");b(wp.media.editor.init)}(jQuery));
\ No newline at end of file
+(function(b){var a={};wp.media.string={props:function(f,i){var h,c,e,g,d,j=wp.media.view.settings.defaultProps;d=function(k){if("image"===k.type&&!k.alt){k.alt=k.caption||k.title||"";k.alt=k.alt.replace(/<\/?[^>]+>/g,"");k.alt=k.alt.replace(/[\r\n]+/g," ")}return k};f=f?_.clone(f):{};if(i&&i.type){f.type=i.type}if("image"===f.type){f=_.defaults(f||{},{align:j.align||getUserSetting("align","none"),size:j.size||getUserSetting("imgsize","medium"),url:"",classes:[]})}if(!i){return d(f)}f.title=f.title||i.title;h=f.link||j.link||getUserSetting("urlbutton","file");if("file"===h||"embed"===h){c=i.url}else{if("post"===h){c=i.link}else{if("custom"===h){c=f.linkUrl}}}f.linkUrl=c||"";if("image"===i.type){f.classes.push("wp-image-"+i.id);g=i.sizes;e=g&&g[f.size]?g[f.size]:i;_.extend(f,_.pick(i,"align","caption","alt"),{width:e.width,height:e.height,src:e.url,captionId:"attachment_"+i.id})}else{if("video"===i.type||"audio"===i.type){_.extend(f,_.pick(i,"title","type","icon","mime"))}else{f.title=f.title||i.filename;f.rel=f.rel||"attachment wp-att-"+i.id}}return d(f)},link:function(d,e){var c;d=wp.media.string.props(d,e);c={tag:"a",content:d.title,attrs:{href:d.linkUrl}};if(d.rel){c.attrs.rel=d.rel}return wp.html.string(c)},audio:function(c,d){return wp.media.string._audioVideo("audio",c,d)},video:function(c,d){return wp.media.string._audioVideo("video",c,d)},_audioVideo:function(e,d,g){var f,c,h;d=wp.media.string.props(d,g);if(d.link!=="embed"){return wp.media.string.link(d)}f={};if("video"===e){if(g.width){f.width=g.width}if(g.height){f.height=g.height}}h=g.filename.split(".").pop();if(_.contains(wp.media.view.settings.embedExts,h)){f[h]=g.url}else{return wp.media.string.link(d)}c=wp.shortcode.string({tag:e,attrs:f});return c},image:function(g,i){var c={},d,f,h,e;g=wp.media.string.props(g,i);f=g.classes||[];c.src=typeof i!=="undefined"?i.url:g.url;_.extend(c,_.pick(g,"width","height","alt"));if(g.align&&!g.caption){f.push("align"+g.align)}if(g.size){f.push("size-"+g.size)}c["class"]=_.compact(f).join(" ");d={tag:"img",attrs:c,single:true};if(g.linkUrl){d={tag:"a",attrs:{href:g.linkUrl},content:d}}e=wp.html.string(d);if(g.caption){h={};if(c.width){h.width=c.width}if(g.captionId){h.id=g.captionId}if(g.align){h.align="align"+g.align}e=wp.shortcode.string({tag:"caption",attrs:h,content:e+" "+g.caption})}return e}};wp.media.gallery=(function(){var c={};return{defaults:{order:"ASC",id:wp.media.view.settings.post.id,itemtag:"dl",icontag:"dt",captiontag:"dd",columns:"3",link:"post",size:"thumbnail",orderby:"menu_order ID"},attachments:function(h){var j=h.string(),d=c[j],f,e,i,g;delete c[j];if(d){return d}f=_.defaults(h.attrs.named,wp.media.gallery.defaults);e=_.pick(f,"orderby","order");e.type="image";e.perPage=-1;if("rand"===f.orderby){f._orderbyRandom=true}if(!f.orderby||/^menu_order(?: ID)?$/i.test(f.orderby)){e.orderby="menuOrder"}if(f.ids){e.post__in=f.ids.split(",");e.orderby="post__in"}else{if(f.include){e.post__in=f.include.split(",")}}if(f.exclude){e.post__not_in=f.exclude.split(",")}if(!e.post__in){e.uploadedTo=f.id}g=_.omit(f,"id","ids","include","exclude","orderby","order");i=wp.media.query(e);i.gallery=new Backbone.Model(g);return i},shortcode:function(d){var f=d.props.toJSON(),e=_.pick(f,"orderby","order"),g,h;if(d.gallery){_.extend(e,d.gallery.toJSON())}e.ids=d.pluck("id");if(f.uploadedTo){e.id=f.uploadedTo}if(e._orderbyRandom){e.orderby="rand"}delete e._orderbyRandom;if(e.ids&&"post__in"===e.orderby){delete e.orderby}_.each(wp.media.gallery.defaults,function(j,i){if(j===e[i]){delete e[i]}});g=new wp.shortcode({tag:"gallery",attrs:e,type:"single"});h=new wp.media.model.Attachments(d.models,{props:f});h.gallery=d.gallery;c[g.string()]=h;return g},edit:function(g){var f=wp.shortcode.next("gallery",g),h=wp.media.gallery.defaults.id,d,e;if(!f||f.content!==g){return}f=f.shortcode;if(_.isUndefined(f.get("id"))&&!_.isUndefined(h)){f.set("id",h)}d=wp.media.gallery.attachments(f);e=new wp.media.model.Selection(d.models,{props:d.props.toJSON(),multiple:true});e.gallery=d.gallery;e.more().done(function(){e.props.set({query:false});e.unmirror();e.props.unset("orderby")});if(this.frame){this.frame.dispose()}this.frame=wp.media({frame:"post",state:"gallery-edit",title:wp.media.view.l10n.editGalleryTitle,editing:true,multiple:true,selection:e}).open();return this.frame}}}());wp.media.featuredImage={get:function(){return wp.media.view.settings.post.featuredImageId},set:function(d){var c=wp.media.view.settings;c.post.featuredImageId=d;wp.media.post("set-post-thumbnail",{json:true,post_id:c.post.id,thumbnail_id:c.post.featuredImageId,_wpnonce:c.post.nonce}).done(function(e){b(".inside","#postimagediv").html(e)})},frame:function(){if(this._frame){return this._frame}this._frame=wp.media({state:"featured-image",states:[new wp.media.controller.FeaturedImage()]});this._frame.on("toolbar:create:featured-image",function(c){this.createSelectToolbar(c,{text:wp.media.view.l10n.setFeaturedImage})},this._frame);this._frame.state("featured-image").on("select",this.select);return this._frame},select:function(){var d=wp.media.view.settings,c=this.get("selection").single();if(!d.post.featuredImageId){return}wp.media.featuredImage.set(c?c.id:-1)},init:function(){b("#postimagediv").on("click","#set-post-thumbnail",function(c){c.preventDefault();c.stopPropagation();wp.media.featuredImage.frame().open()}).on("click","#remove-post-thumbnail",function(){wp.media.view.settings.post.featuredImageId=-1})}};b(wp.media.featuredImage.init);wp.media.editor={insert:function(g){var d=typeof(tinymce)!="undefined",j=typeof(QTags)!="undefined",c=window.wpActiveEditor,f;if(window.send_to_editor){return window.send_to_editor.apply(this,arguments)}if(!c){if(d&&tinymce.activeEditor){f=tinymce.activeEditor;c=window.wpActiveEditor=f.id}else{if(!j){return false}}}else{if(d){if(tinymce.activeEditor&&(tinymce.activeEditor.id=="mce_fullscreen"||tinymce.activeEditor.id=="wp_mce_fullscreen")){f=tinymce.activeEditor}else{f=tinymce.get(c)}}}if(f&&!f.isHidden()){if(tinymce.isIE&&f.windowManager.insertimagebookmark){f.selection.moveToBookmark(f.windowManager.insertimagebookmark)}if(g.indexOf("[caption")!==-1){if(f.wpSetImgCaption){g=f.wpSetImgCaption(g)}}else{if(g.indexOf("[gallery")!==-1){if(f.plugins.wpgallery){g=f.plugins.wpgallery._do_gallery(g)}}else{if(g.indexOf("[embed")===0){if(f.plugins.wordpress){g=f.plugins.wordpress._setEmbed(g)}}}}f.execCommand("mceInsertContent",false,g)}else{if(j){QTags.insertContent(g)}else{document.getElementById(c).value+=g}}if(window.tb_remove){try{window.tb_remove()}catch(i){}}},add:function(e,c){var d=this.get(e);if(d){return d}d=a[e]=wp.media(_.defaults(c||{},{frame:"post",state:"insert",title:wp.media.view.l10n.addMedia,multiple:true}));d.on("insert",function(f){var g=d.state();f=f||g.get("selection");if(!f){return}b.when.apply(b,f.map(function(i){var h=g.display(i).toJSON();return this.send.attachment(h,i.toJSON())},this)).done(function(){wp.media.editor.insert(_.toArray(arguments).join("\n\n"))})},this);d.state("gallery-edit").on("update",function(f){this.insert(wp.media.gallery.shortcode(f).string())},this);d.state("embed").on("select",function(){var g=d.state(),f=g.get("type"),h=g.props.toJSON();h.url=h.url||"";if("link"===f){_.defaults(h,{title:h.url,linkUrl:h.url});this.send.link(h).done(function(i){wp.media.editor.insert(i)})}else{if("image"===f){_.defaults(h,{title:h.url,linkUrl:"",align:"none",link:"none"});if("none"===h.link){h.linkUrl=""}else{if("file"===h.link){h.linkUrl=h.url}}this.insert(wp.media.string.image(h))}}},this);d.state("featured-image").on("select",wp.media.featuredImage.select);d.setState(d.options.state);return d},id:function(c){if(c){return c}c=wpActiveEditor;if(!c&&typeof tinymce!=="undefined"&&tinymce.activeEditor){c=tinymce.activeEditor.id}c=c||"";return c},get:function(c){c=this.id(c);return a[c]},remove:function(c){c=this.id(c);delete a[c]},send:{attachment:function(f,g){var c=g.caption,d,e;if(!wp.media.view.settings.captions){delete g.caption}f=wp.media.string.props(f,g);d={id:g.id,post_content:g.description,post_excerpt:c};if(f.linkUrl){d.url=f.linkUrl}if("image"===g.type){e=wp.media.string.image(f);_.each({align:"align",size:"image-size",alt:"image_alt"},function(h,i){if(f[i]){d[h]=f[i]}})}else{if("video"===g.type){e=wp.media.string.video(f,g)}else{if("audio"===g.type){e=wp.media.string.audio(f,g)}else{e=wp.media.string.link(f);d.post_title=f.title}}}return wp.media.post("send-attachment-to-editor",{nonce:wp.media.view.settings.nonce.sendToEditor,attachment:d,html:e,post_id:wp.media.view.settings.post.id})},link:function(c){return wp.media.post("send-link-to-editor",{nonce:wp.media.view.settings.nonce.sendToEditor,src:c.linkUrl,title:c.title,html:wp.media.string.link(c),post_id:wp.media.view.settings.post.id})}},open:function(f,c){var e,d;c=c||{};f=this.id(f);if(typeof tinymce!=="undefined"){d=tinymce.get(f);if(tinymce.isIE&&d&&!d.isHidden()){d.focus();d.windowManager.insertimagebookmark=d.selection.getBookmark()}}e=this.get(f);if(!e||(e.options&&c.state!==e.options.state)){e=this.add(f,c)}return e.open()},init:function(){b(document.body).on("click",".insert-media",function(e){var f=b(this),d=f.data("editor"),c={frame:"post",state:"insert",title:wp.media.view.l10n.addMedia,multiple:true};e.preventDefault();f.blur();if(f.hasClass("gallery")){c.state="gallery";c.title=wp.media.view.l10n.createGalleryTitle}wp.media.editor.open(d,c)})}};_.bindAll(wp.media.editor,"open");b(wp.media.editor.init)}(jQuery));
\ No newline at end of file
index 34cce0b7adc9e7355286b9c2488ef8a73366f44c..f501b69fc632e54056d445da582feecff6745161 100644 (file)
@@ -72,90 +72,25 @@ window.wp = window.wp || {};
                 * media.template( id )
                 *
                 * Fetches a template by id.
-                *
-                * @param  {string} id   A string that corresponds to a DOM element with an id prefixed with "tmpl-".
-                *                       For example, "attachment" maps to "tmpl-attachment".
-                * @return {function}    A function that lazily-compiles the template requested.
+                * See wp.template() in `wp-includes/js/wp-util.js`.
                 */
-               template: _.memoize( function( id ) {
-                       var compiled,
-                               options = {
-                                       evaluate:    /<#([\s\S]+?)#>/g,
-                                       interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
-                                       escape:      /\{\{([^\}]+?)\}\}(?!\})/g,
-                                       variable:    'data'
-                               };
-
-                       return function( data ) {
-                               compiled = compiled || _.template( $( '#tmpl-' + id ).html(), null, options );
-                               return compiled( data );
-                       };
-               }),
+               template: wp.template,
 
                /**
                 * media.post( [action], [data] )
                 *
                 * Sends a POST request to WordPress.
-                *
-                * @param  {string} action The slug of the action to fire in WordPress.
-                * @param  {object} data   The data to populate $_POST with.
-                * @return {$.promise}     A jQuery promise that represents the request.
+                * See wp.ajax.post() in `wp-includes/js/wp-util.js`.
                 */
-               post: function( action, data ) {
-                       return media.ajax({
-                               data: _.isObject( action ) ? action : _.extend( data || {}, { action: action })
-                       });
-               },
+               post: wp.ajax.post,
 
                /**
                 * media.ajax( [action], [options] )
                 *
-                * Sends a POST request to WordPress.
-                *
-                * @param  {string} action  The slug of the action to fire in WordPress.
-                * @param  {object} options The options passed to jQuery.ajax.
-                * @return {$.promise}      A jQuery promise that represents the request.
+                * Sends an XHR request to WordPress.
+                * See wp.ajax.send() in `wp-includes/js/wp-util.js`.
                 */
-               ajax: function( action, options ) {
-                       if ( _.isObject( action ) ) {
-                               options = action;
-                       } else {
-                               options = options || {};
-                               options.data = _.extend( options.data || {}, { action: action });
-                       }
-
-                       options = _.defaults( options || {}, {
-                               type:    'POST',
-                               url:     media.model.settings.ajaxurl,
-                               context: this
-                       });
-
-                       return $.Deferred( function( deferred ) {
-                               // Transfer success/error callbacks.
-                               if ( options.success )
-                                       deferred.done( options.success );
-                               if ( options.error )
-                                       deferred.fail( options.error );
-
-                               delete options.success;
-                               delete options.error;
-
-                               // Use with PHP's wp_send_json_success() and wp_send_json_error()
-                               $.ajax( options ).done( function( response ) {
-                                       // Treat a response of `1` as successful for backwards
-                                       // compatibility with existing handlers.
-                                       if ( response === '1' || response === 1 )
-                                               response = { success: true };
-
-                                       if ( _.isObject( response ) && ! _.isUndefined( response.success ) )
-                                               deferred[ response.success ? 'resolveWith' : 'rejectWith' ]( this, [response.data] );
-                                       else
-                                               deferred.rejectWith( this, [response] );
-                               }).fail( function() {
-                                       deferred.rejectWith( this, arguments );
-                               });
-                       }).promise();
-               },
+               ajax: wp.ajax.send,
 
                // Scales a set of dimensions to fit within bounding dimensions.
                fit: function( dimensions ) {
@@ -261,13 +196,12 @@ window.wp = window.wp || {};
                                });
 
                                // Record the values of the changed attributes.
-                               if ( options.changes ) {
-                                       _.each( options.changes, function( value, key ) {
-                                               options.changes[ key ] = this.get( key );
-                                       }, this );
+                               if ( model.hasChanged() ) {
+                                       options.data.changes = {};
 
-                                       options.data.changes = options.changes;
-                                       delete options.changes;
+                                       _.each( model.changed, function( value, key ) {
+                                               options.data.changes[ key ] = this.get( key );
+                                       }, this );
                                }
 
                                return media.ajax( options );
@@ -292,6 +226,10 @@ window.wp = window.wp || {};
                                }).fail( function() {
                                        this.destroyed = false;
                                });
+
+                       // Otherwise, fall back to `Backbone.sync()`.
+                       } else {
+                               return Backbone.Model.prototype.sync.apply( this, arguments );
                        }
                },
 
@@ -392,7 +330,7 @@ window.wp = window.wp || {};
                        if ( this.props.get('query') )
                                return;
 
-                       var changed = _.chain( options.changes ).map( function( t, prop ) {
+                       var changed = _.chain( model.changed ).map( function( t, prop ) {
                                var filter = Attachments.filters[ prop ],
                                        term = model.get( prop );
 
@@ -434,7 +372,7 @@ window.wp = window.wp || {};
 
                validate: function( attachment, options ) {
                        var valid = this.validator( attachment ),
-                               hasAttachment = !! this.getByCid( attachment.cid );
+                               hasAttachment = !! this.get( attachment.cid );
 
                        if ( ! valid && hasAttachment )
                                this.remove( attachment, options );
@@ -463,7 +401,6 @@ window.wp = window.wp || {};
 
                        attachments.on( 'add change remove', this._validateHandler, this );
                        attachments.on( 'reset', this._validateAllHandler, this );
-
                        this.validateAll( attachments );
                        return this;
                },
@@ -545,9 +482,26 @@ window.wp = window.wp || {};
                },
 
                parse: function( resp, xhr ) {
+                       if ( ! _.isArray( resp ) )
+                               resp = [resp];
+
                        return _.map( resp, function( attrs ) {
-                               var attachment = Attachment.get( attrs.id );
-                               return attachment.set( attachment.parse( attrs, xhr ) );
+                               var id, attachment, newAttributes;
+
+                               if ( attrs instanceof Backbone.Model ) {
+                                       id = attrs.get( 'id' );
+                                       attrs = attrs.attributes;
+                               } else {
+                                       id = attrs.id;
+                               }
+
+                               attachment = Attachment.get( id );
+                               newAttributes = attachment.parse( attrs, xhr );
+
+                               if ( ! _.isEqual( attachment.attributes, newAttributes ) )
+                                       attachment.set( newAttributes );
+
+                               return attachment;
                        });
                },
 
@@ -718,7 +672,7 @@ window.wp = window.wp || {};
                                return $.Deferred().resolveWith( this ).promise();
 
                        options = options || {};
-                       options.add = true;
+                       options.remove = false;
 
                        return this._more = this.fetch( options ).done( function( resp ) {
                                if ( _.isEmpty( resp ) || -1 === this.args.posts_per_page || resp.length < this.args.posts_per_page )
@@ -876,7 +830,7 @@ window.wp = window.wp || {};
                                this._single = model;
 
                        // If the single model isn't in the selection, remove it.
-                       if ( this._single && ! this.getByCid( this._single.cid ) )
+                       if ( this._single && ! this.get( this._single.cid ) )
                                delete this._single;
 
                        this._single = this._single || this.last();
@@ -888,7 +842,7 @@ window.wp = window.wp || {};
 
                                        // If the model was already removed, trigger the collection
                                        // event manually.
-                                       if ( ! this.getByCid( previous.cid ) )
+                                       if ( ! this.get( previous.cid ) )
                                                this.trigger( 'selection:unsingle', previous, this );
                                }
                                if ( this._single )
index 9acf7751ad829a6bbff1748c4d9fb4afda2c7331..04bc333c6eec33f7dd7c0a54f865a40aea4829a2 100644 (file)
@@ -1 +1 @@
-window.wp=window.wp||{};(function(f){var d,c,a,e,b,g;g=wp.media=function(h){var i=g.view.MediaFrame,j;if(!i){return}h=_.defaults(h||{},{frame:"select"});if("select"===h.frame&&i.Select){j=new i.Select(h)}else{if("post"===h.frame&&i.Post){j=new i.Post(h)}}delete h.frame;return j};_.extend(g,{model:{},view:{},controller:{},frames:{}});b=g.model.l10n=typeof _wpMediaModelsL10n==="undefined"?{}:_wpMediaModelsL10n;g.model.settings=b.settings||{};delete b.settings;e=function(i,h,j,k){if(_.isEqual(i,h)){return j===k?0:(j>k?-1:1)}else{return i>h?-1:1}};_.extend(g,{template:_.memoize(function(j){var i,h={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(k){i=i||_.template(f("#tmpl-"+j).html(),null,h);return i(k)}}),post:function(i,h){return g.ajax({data:_.isObject(i)?i:_.extend(h||{},{action:i})})},ajax:function(i,h){if(_.isObject(i)){h=i}else{h=h||{};h.data=_.extend(h.data||{},{action:i})}h=_.defaults(h||{},{type:"POST",url:g.model.settings.ajaxurl,context:this});return f.Deferred(function(j){if(h.success){j.done(h.success)}if(h.error){j.fail(h.error)}delete h.success;delete h.error;f.ajax(h).done(function(k){if(k==="1"||k===1){k={success:true}}if(_.isObject(k)&&!_.isUndefined(k.success)){j[k.success?"resolveWith":"rejectWith"](this,[k.data])}else{j.rejectWith(this,[k])}}).fail(function(){j.rejectWith(this,arguments)})}).promise()},fit:function(l){var i=l.width,h=l.height,k=l.maxWidth,j=l.maxHeight,m;if(!_.isUndefined(k)&&!_.isUndefined(j)){m=(i/h>k/j)?"width":"height"}else{if(_.isUndefined(j)){m="width"}else{if(_.isUndefined(k)&&h>j){m="height"}}}if("width"===m&&i>k){return{width:k,height:Math.round(k*h/i)}}else{if("height"===m&&h>j){return{width:Math.round(j*i/h),height:j}}else{return{width:i,height:h}}}},truncate:function(h,j,i){j=j||30;i=i||"&hellip;";if(h.length<=j){return h}return h.substr(0,j/2)+i+h.substr(-1*j/2)}});g.attachment=function(h){return d.get(h)};d=g.model.Attachment=Backbone.Model.extend({sync:function(j,i,h){if(_.isUndefined(this.id)){return f.Deferred().rejectWith(this).promise()}if("read"===j){h=h||{};h.context=this;h.data=_.extend(h.data||{},{action:"get-attachment",id:this.id});return g.ajax(h)}else{if("update"===j){if(!this.get("nonces")||!this.get("nonces").update){return f.Deferred().rejectWith(this).promise()}h=h||{};h.context=this;h.data=_.extend(h.data||{},{action:"save-attachment",id:this.id,nonce:this.get("nonces").update,post_id:g.model.settings.post.id});if(h.changes){_.each(h.changes,function(l,k){h.changes[k]=this.get(k)},this);h.data.changes=h.changes;delete h.changes}return g.ajax(h)}else{if("delete"===j){h=h||{};if(!h.wait){this.destroyed=true}h.context=this;h.data=_.extend(h.data||{},{action:"delete-post",id:this.id,_wpnonce:this.get("nonces")["delete"]});return g.ajax(h).done(function(){this.destroyed=true}).fail(function(){this.destroyed=false})}}}},parse:function(i,h){if(!i){return i}i.date=new Date(i.date);i.modified=new Date(i.modified);return i},saveCompat:function(j,i){var h=this;if(!this.get("nonces")||!this.get("nonces").update){return f.Deferred().rejectWith(this).promise()}return g.post("save-attachment-compat",_.defaults({id:this.id,nonce:this.get("nonces").update,post_id:g.model.settings.post.id},j)).done(function(m,k,l){h.set(h.parse(m,l),i)})}},{create:function(h){return c.all.push(h)},get:_.memoize(function(i,h){return c.all.push(h||{id:i})})});c=g.model.Attachments=Backbone.Collection.extend({model:d,initialize:function(i,h){h=h||{};this.props=new Backbone.Model();this.filters=h.filters||{};this.props.on("change",this._changeFilteredProps,this);this.props.on("change:order",this._changeOrder,this);this.props.on("change:orderby",this._changeOrderby,this);this.props.on("change:query",this._changeQuery,this);this.props.set(_.defaults(h.props||{}));if(h.observe){this.observe(h.observe)}},_changeOrder:function(i,h){if(this.comparator){this.sort()}},_changeOrderby:function(h,i){if(this.comparator&&this.comparator!==c.comparator){return}if(i&&"post__in"!==i){this.comparator=c.comparator}else{delete this.comparator}},_changeQuery:function(h,i){if(i){this.props.on("change",this._requery,this);this._requery()}else{this.props.off("change",this._requery,this)}},_changeFilteredProps:function(i,h){if(this.props.get("query")){return}var j=_.chain(h.changes).map(function(l,n){var m=c.filters[n],k=i.get(n);if(!m){return}if(k&&!this.filters[n]){this.filters[n]=m}else{if(!k&&this.filters[n]===m){delete this.filters[n]}else{return}}return true},this).any().value();if(!j){return}if(!this._source){this._source=new c(this.models)}this.reset(this._source.filter(this.validator,this))},validateDestroyed:false,validator:function(h){if(!this.validateDestroyed&&h.destroyed){return false}return _.all(this.filters,function(j,i){return !!j.call(this,h)},this)},validate:function(k,i){var j=this.validator(k),h=!!this.getByCid(k.cid);if(!j&&h){this.remove(k,i)}else{if(j&&!h){this.add(k,i)}}return this},validateAll:function(h,i){i=i||{};_.each(h.models,function(j){this.validate(j,{silent:true})},this);if(!i.silent){this.trigger("reset",this,i)}return this},observe:function(h){this.observers=this.observers||[];this.observers.push(h);h.on("add change remove",this._validateHandler,this);h.on("reset",this._validateAllHandler,this);this.validateAll(h);return this},unobserve:function(h){if(h){h.off(null,null,this);this.observers=_.without(this.observers,h)}else{_.each(this.observers,function(i){i.off(null,null,this)},this);delete this.observers}return this},_validateHandler:function(j,h,i){i=h===this.mirroring?i:{silent:i&&i.silent};return this.validate(j,i)},_validateAllHandler:function(h,i){return this.validateAll(h,i)},mirror:function(h){if(this.mirroring&&this.mirroring===h){return this}this.unmirror();this.mirroring=h;this.reset([],{silent:true});this.observe(h);return this},unmirror:function(){if(!this.mirroring){return}this.unobserve(this.mirroring);delete this.mirroring},more:function(j){var i=f.Deferred(),k=this.mirroring,h=this;if(!k||!k.more){return i.resolveWith(this).promise()}k.more(j).done(function(){if(this===h.mirroring){i.resolveWith(this)}});return i.promise()},hasMore:function(){return this.mirroring?this.mirroring.hasMore():false},parse:function(i,h){return _.map(i,function(j){var k=d.get(j.id);return k.set(k.parse(j,h))})},_requery:function(){if(this.props.get("query")){this.mirror(a.get(this.props.toJSON()))}},saveMenuOrder:function(){if("menuOrder"!==this.props.get("orderby")){return}var h=this.chain().filter(function(i){return !_.isUndefined(i.id)}).map(function(j,i){i=i+1;j.set("menuOrder",i);return[j.id,i]}).object().value();if(_.isEmpty(h)){return}return g.post("save-attachment-order",{nonce:g.model.settings.post.nonce,post_id:g.model.settings.post.id,attachments:h})}},{comparator:function(j,i,k){var l=this.props.get("orderby"),h=this.props.get("order")||"DESC",m=j.cid,n=i.cid;j=j.get(l);i=i.get(l);if("date"===l||"modified"===l){j=j||new Date();i=i||new Date()}if(k&&k.ties){m=n=null}return("DESC"===h)?e(j,i,m,n):e(i,j,n,m)},filters:{search:function(h){if(!this.props.get("search")){return true}return _.any(["title","filename","description","caption","name"],function(i){var j=h.get(i);return j&&-1!==j.search(this.props.get("search"))},this)},type:function(i){var h=this.props.get("type");return !h||-1!==h.indexOf(i.get("type"))},uploadedTo:function(i){var h=this.props.get("uploadedTo");if(_.isUndefined(h)){return true}return h===i.get("uploadedTo")}}});c.all=new c();g.query=function(h){return new c(null,{props:_.extend(_.defaults(h||{},{orderby:"date"}),{query:true})})};a=g.model.Query=c.extend({initialize:function(j,h){var i;h=h||{};c.prototype.initialize.apply(this,arguments);this.args=h.args;this._hasMore=true;this.created=new Date();this.filters.order=function(m){var l=this.props.get("orderby"),k=this.props.get("order");if(!this.comparator){return true}if(this.length){return 1!==this.comparator(m,this.last(),{ties:true})}else{if("DESC"===k&&("date"===l||"modified"===l)){return m.get(l)>=this.created}else{if("ASC"===k&&"menuOrder"===l){return m.get(l)===0}}}return false};i=["s","order","orderby","posts_per_page","post_mime_type","post_parent"];if(wp.Uploader&&_(this.args).chain().keys().difference(i).isEmpty().value()){this.observe(wp.Uploader.queue)}},hasMore:function(){return this._hasMore},more:function(h){var i=this;if(this._more&&"pending"===this._more.state()){return this._more}if(!this.hasMore()){return f.Deferred().resolveWith(this).promise()}h=h||{};h.add=true;return this._more=this.fetch(h).done(function(j){if(_.isEmpty(j)||-1===this.args.posts_per_page||j.length<this.args.posts_per_page){i._hasMore=false}})},sync:function(k,i,h){var j;if("read"===k){h=h||{};h.context=this;h.data=_.extend(h.data||{},{action:"query-attachments",post_id:g.model.settings.post.id});args=_.clone(this.args);if(-1!==args.posts_per_page){args.paged=Math.floor(this.length/args.posts_per_page)+1}h.data.query=args;return g.ajax(h)}else{j=c.prototype.sync?c.prototype:Backbone;return j.sync.apply(this,arguments)}}},{defaultProps:{orderby:"date",order:"DESC"},defaultArgs:{posts_per_page:40},orderby:{allowed:["name","author","date","title","modified","uploadedTo","id","post__in","menuOrder"],valuemap:{id:"ID",uploadedTo:"parent",menuOrder:"menu_order ID"}},propmap:{search:"s",type:"post_mime_type",perPage:"posts_per_page",menuOrder:"menu_order",uploadedTo:"post_parent"},get:(function(){var h=[];return function(k,j){var i={},m=a.orderby,n=a.defaultProps,l;delete k.query;_.defaults(k,n);k.order=k.order.toUpperCase();if("DESC"!==k.order&&"ASC"!==k.order){k.order=n.order.toUpperCase()}if(!_.contains(m.allowed,k.orderby)){k.orderby=n.orderby}_.each(k,function(o,p){if(_.isNull(o)){return}i[a.propmap[p]||p]=o});_.defaults(i,a.defaultArgs);i.orderby=m.valuemap[k.orderby]||k.orderby;l=_.find(h,function(o){return _.isEqual(o.args,i)});if(!l){l=new a([],_.extend(j||{},{props:k,args:i}));h.push(l)}return l}}())});g.model.Selection=c.extend({initialize:function(i,h){c.prototype.initialize.apply(this,arguments);this.multiple=h&&h.multiple;this.on("add remove reset",_.bind(this.single,this,false))},add:function(i,h){if(!this.multiple){this.remove(this.models)}return c.prototype.add.call(this,i,h)},single:function(h){var i=this._single;if(h){this._single=h}if(this._single&&!this.getByCid(this._single.cid)){delete this._single}this._single=this._single||this.last();if(this._single!==i){if(i){i.trigger("selection:unsingle",i,this);if(!this.getByCid(i.cid)){this.trigger("selection:unsingle",i,this)}}if(this._single){this._single.trigger("selection:single",this._single,this)}}return this._single}});f(window).on("unload",function(){window.wp=null})}(jQuery));
\ No newline at end of file
+window.wp=window.wp||{};(function(f){var d,c,a,e,b,g;g=wp.media=function(h){var i=g.view.MediaFrame,j;if(!i){return}h=_.defaults(h||{},{frame:"select"});if("select"===h.frame&&i.Select){j=new i.Select(h)}else{if("post"===h.frame&&i.Post){j=new i.Post(h)}}delete h.frame;return j};_.extend(g,{model:{},view:{},controller:{},frames:{}});b=g.model.l10n=typeof _wpMediaModelsL10n==="undefined"?{}:_wpMediaModelsL10n;g.model.settings=b.settings||{};delete b.settings;e=function(i,h,j,k){if(_.isEqual(i,h)){return j===k?0:(j>k?-1:1)}else{return i>h?-1:1}};_.extend(g,{template:wp.template,post:wp.ajax.post,ajax:wp.ajax.send,fit:function(l){var i=l.width,h=l.height,k=l.maxWidth,j=l.maxHeight,m;if(!_.isUndefined(k)&&!_.isUndefined(j)){m=(i/h>k/j)?"width":"height"}else{if(_.isUndefined(j)){m="width"}else{if(_.isUndefined(k)&&h>j){m="height"}}}if("width"===m&&i>k){return{width:k,height:Math.round(k*h/i)}}else{if("height"===m&&h>j){return{width:Math.round(j*i/h),height:j}}else{return{width:i,height:h}}}},truncate:function(h,j,i){j=j||30;i=i||"&hellip;";if(h.length<=j){return h}return h.substr(0,j/2)+i+h.substr(-1*j/2)}});g.attachment=function(h){return d.get(h)};d=g.model.Attachment=Backbone.Model.extend({sync:function(j,i,h){if(_.isUndefined(this.id)){return f.Deferred().rejectWith(this).promise()}if("read"===j){h=h||{};h.context=this;h.data=_.extend(h.data||{},{action:"get-attachment",id:this.id});return g.ajax(h)}else{if("update"===j){if(!this.get("nonces")||!this.get("nonces").update){return f.Deferred().rejectWith(this).promise()}h=h||{};h.context=this;h.data=_.extend(h.data||{},{action:"save-attachment",id:this.id,nonce:this.get("nonces").update,post_id:g.model.settings.post.id});if(i.hasChanged()){h.data.changes={};_.each(i.changed,function(l,k){h.data.changes[k]=this.get(k)},this)}return g.ajax(h)}else{if("delete"===j){h=h||{};if(!h.wait){this.destroyed=true}h.context=this;h.data=_.extend(h.data||{},{action:"delete-post",id:this.id,_wpnonce:this.get("nonces")["delete"]});return g.ajax(h).done(function(){this.destroyed=true}).fail(function(){this.destroyed=false})}else{return Backbone.Model.prototype.sync.apply(this,arguments)}}}},parse:function(i,h){if(!i){return i}i.date=new Date(i.date);i.modified=new Date(i.modified);return i},saveCompat:function(j,i){var h=this;if(!this.get("nonces")||!this.get("nonces").update){return f.Deferred().rejectWith(this).promise()}return g.post("save-attachment-compat",_.defaults({id:this.id,nonce:this.get("nonces").update,post_id:g.model.settings.post.id},j)).done(function(m,k,l){h.set(h.parse(m,l),i)})}},{create:function(h){return c.all.push(h)},get:_.memoize(function(i,h){return c.all.push(h||{id:i})})});c=g.model.Attachments=Backbone.Collection.extend({model:d,initialize:function(i,h){h=h||{};this.props=new Backbone.Model();this.filters=h.filters||{};this.props.on("change",this._changeFilteredProps,this);this.props.on("change:order",this._changeOrder,this);this.props.on("change:orderby",this._changeOrderby,this);this.props.on("change:query",this._changeQuery,this);this.props.set(_.defaults(h.props||{}));if(h.observe){this.observe(h.observe)}},_changeOrder:function(i,h){if(this.comparator){this.sort()}},_changeOrderby:function(h,i){if(this.comparator&&this.comparator!==c.comparator){return}if(i&&"post__in"!==i){this.comparator=c.comparator}else{delete this.comparator}},_changeQuery:function(h,i){if(i){this.props.on("change",this._requery,this);this._requery()}else{this.props.off("change",this._requery,this)}},_changeFilteredProps:function(i,h){if(this.props.get("query")){return}var j=_.chain(i.changed).map(function(l,n){var m=c.filters[n],k=i.get(n);if(!m){return}if(k&&!this.filters[n]){this.filters[n]=m}else{if(!k&&this.filters[n]===m){delete this.filters[n]}else{return}}return true},this).any().value();if(!j){return}if(!this._source){this._source=new c(this.models)}this.reset(this._source.filter(this.validator,this))},validateDestroyed:false,validator:function(h){if(!this.validateDestroyed&&h.destroyed){return false}return _.all(this.filters,function(j,i){return !!j.call(this,h)},this)},validate:function(k,i){var j=this.validator(k),h=!!this.get(k.cid);if(!j&&h){this.remove(k,i)}else{if(j&&!h){this.add(k,i)}}return this},validateAll:function(h,i){i=i||{};_.each(h.models,function(j){this.validate(j,{silent:true})},this);if(!i.silent){this.trigger("reset",this,i)}return this},observe:function(h){this.observers=this.observers||[];this.observers.push(h);h.on("add change remove",this._validateHandler,this);h.on("reset",this._validateAllHandler,this);this.validateAll(h);return this},unobserve:function(h){if(h){h.off(null,null,this);this.observers=_.without(this.observers,h)}else{_.each(this.observers,function(i){i.off(null,null,this)},this);delete this.observers}return this},_validateHandler:function(j,h,i){i=h===this.mirroring?i:{silent:i&&i.silent};return this.validate(j,i)},_validateAllHandler:function(h,i){return this.validateAll(h,i)},mirror:function(h){if(this.mirroring&&this.mirroring===h){return this}this.unmirror();this.mirroring=h;this.reset([],{silent:true});this.observe(h);return this},unmirror:function(){if(!this.mirroring){return}this.unobserve(this.mirroring);delete this.mirroring},more:function(j){var i=f.Deferred(),k=this.mirroring,h=this;if(!k||!k.more){return i.resolveWith(this).promise()}k.more(j).done(function(){if(this===h.mirroring){i.resolveWith(this)}});return i.promise()},hasMore:function(){return this.mirroring?this.mirroring.hasMore():false},parse:function(i,h){if(!_.isArray(i)){i=[i]}return _.map(i,function(j){var m,l,k;if(j instanceof Backbone.Model){m=j.get("id");j=j.attributes}else{m=j.id}l=d.get(m);k=l.parse(j,h);if(!_.isEqual(l.attributes,k)){l.set(k)}return l})},_requery:function(){if(this.props.get("query")){this.mirror(a.get(this.props.toJSON()))}},saveMenuOrder:function(){if("menuOrder"!==this.props.get("orderby")){return}var h=this.chain().filter(function(i){return !_.isUndefined(i.id)}).map(function(j,i){i=i+1;j.set("menuOrder",i);return[j.id,i]}).object().value();if(_.isEmpty(h)){return}return g.post("save-attachment-order",{nonce:g.model.settings.post.nonce,post_id:g.model.settings.post.id,attachments:h})}},{comparator:function(j,i,k){var l=this.props.get("orderby"),h=this.props.get("order")||"DESC",m=j.cid,n=i.cid;j=j.get(l);i=i.get(l);if("date"===l||"modified"===l){j=j||new Date();i=i||new Date()}if(k&&k.ties){m=n=null}return("DESC"===h)?e(j,i,m,n):e(i,j,n,m)},filters:{search:function(h){if(!this.props.get("search")){return true}return _.any(["title","filename","description","caption","name"],function(i){var j=h.get(i);return j&&-1!==j.search(this.props.get("search"))},this)},type:function(i){var h=this.props.get("type");return !h||-1!==h.indexOf(i.get("type"))},uploadedTo:function(i){var h=this.props.get("uploadedTo");if(_.isUndefined(h)){return true}return h===i.get("uploadedTo")}}});c.all=new c();g.query=function(h){return new c(null,{props:_.extend(_.defaults(h||{},{orderby:"date"}),{query:true})})};a=g.model.Query=c.extend({initialize:function(j,h){var i;h=h||{};c.prototype.initialize.apply(this,arguments);this.args=h.args;this._hasMore=true;this.created=new Date();this.filters.order=function(m){var l=this.props.get("orderby"),k=this.props.get("order");if(!this.comparator){return true}if(this.length){return 1!==this.comparator(m,this.last(),{ties:true})}else{if("DESC"===k&&("date"===l||"modified"===l)){return m.get(l)>=this.created}else{if("ASC"===k&&"menuOrder"===l){return m.get(l)===0}}}return false};i=["s","order","orderby","posts_per_page","post_mime_type","post_parent"];if(wp.Uploader&&_(this.args).chain().keys().difference(i).isEmpty().value()){this.observe(wp.Uploader.queue)}},hasMore:function(){return this._hasMore},more:function(h){var i=this;if(this._more&&"pending"===this._more.state()){return this._more}if(!this.hasMore()){return f.Deferred().resolveWith(this).promise()}h=h||{};h.remove=false;return this._more=this.fetch(h).done(function(j){if(_.isEmpty(j)||-1===this.args.posts_per_page||j.length<this.args.posts_per_page){i._hasMore=false}})},sync:function(k,i,h){var j;if("read"===k){h=h||{};h.context=this;h.data=_.extend(h.data||{},{action:"query-attachments",post_id:g.model.settings.post.id});args=_.clone(this.args);if(-1!==args.posts_per_page){args.paged=Math.floor(this.length/args.posts_per_page)+1}h.data.query=args;return g.ajax(h)}else{j=c.prototype.sync?c.prototype:Backbone;return j.sync.apply(this,arguments)}}},{defaultProps:{orderby:"date",order:"DESC"},defaultArgs:{posts_per_page:40},orderby:{allowed:["name","author","date","title","modified","uploadedTo","id","post__in","menuOrder"],valuemap:{id:"ID",uploadedTo:"parent",menuOrder:"menu_order ID"}},propmap:{search:"s",type:"post_mime_type",perPage:"posts_per_page",menuOrder:"menu_order",uploadedTo:"post_parent"},get:(function(){var h=[];return function(k,j){var i={},m=a.orderby,n=a.defaultProps,l;delete k.query;_.defaults(k,n);k.order=k.order.toUpperCase();if("DESC"!==k.order&&"ASC"!==k.order){k.order=n.order.toUpperCase()}if(!_.contains(m.allowed,k.orderby)){k.orderby=n.orderby}_.each(k,function(o,p){if(_.isNull(o)){return}i[a.propmap[p]||p]=o});_.defaults(i,a.defaultArgs);i.orderby=m.valuemap[k.orderby]||k.orderby;l=_.find(h,function(o){return _.isEqual(o.args,i)});if(!l){l=new a([],_.extend(j||{},{props:k,args:i}));h.push(l)}return l}}())});g.model.Selection=c.extend({initialize:function(i,h){c.prototype.initialize.apply(this,arguments);this.multiple=h&&h.multiple;this.on("add remove reset",_.bind(this.single,this,false))},add:function(i,h){if(!this.multiple){this.remove(this.models)}return c.prototype.add.call(this,i,h)},single:function(h){var i=this._single;if(h){this._single=h}if(this._single&&!this.get(this._single.cid)){delete this._single}this._single=this._single||this.last();if(this._single!==i){if(i){i.trigger("selection:unsingle",i,this);if(!this.get(i.cid)){this.trigger("selection:unsingle",i,this)}}if(this._single){this._single.trigger("selection:single",this._single,this)}}return this._single}});f(window).on("unload",function(){window.wp=null})}(jQuery));
\ No newline at end of file
index 1434aeb54c1acd5ab8d6e652fb4f836681c65de2..a14a57b042ba3e581fc23032f7246ac124d0d5a0 100644 (file)
                        this.on( 'reset', this.reset, this );
                        this.on( 'ready', this._ready, this );
                        this.on( 'ready', this.ready, this );
-
-                       this.on( 'change:menu', this._updateMenu, this );
-
                        Backbone.Model.apply( this, arguments );
+                       this.on( 'change:menu', this._updateMenu, this );
                },
 
                ready: function() {},
                        var displays = this._displays;
 
                        if ( ! displays[ attachment.cid ] )
-                               displays[ attachment.cid ] = new Backbone.Model( this._defaultDisplaySettings );
+                               displays[ attachment.cid ] = new Backbone.Model( this.defaultDisplaySettings( attachment ) );
 
                        return displays[ attachment.cid ];
                },
 
+               defaultDisplaySettings: function( attachment ) {
+                       settings = this._defaultDisplaySettings;
+                       if ( settings.canEmbed = this.canEmbed( attachment ) )
+                               settings.link = 'embed';
+                       return settings;
+               },
+
+               canEmbed: function( attachment ) {
+                       // If uploading, we know the filename but not the mime type.
+                       if ( ! attachment.get('uploading') ) {
+                               var type = attachment.get('type');
+                               if ( type !== 'audio' && type !== 'video' )
+                                       return false;
+                       }
+
+                       return _.contains( media.view.settings.embedExts, attachment.get('filename').split('.').pop() );
+               },
+
                syncSelection: function() {
                        var selection = this.get('selection'),
                                manager = this.frame._selection;
                        // Accepts attachments that exist in the original library and
                        // that do not exist in gallery's library.
                        library.validator = function( attachment ) {
-                               return !! this.mirroring.getByCid( attachment.cid ) && ! edit.getByCid( attachment.cid ) && media.model.Selection.prototype.validator.apply( this, arguments );
+                               return !! this.mirroring.get( attachment.cid ) && ! edit.get( attachment.cid ) && media.model.Selection.prototype.validator.apply( this, arguments );
                        };
 
                        // Reset the library to ensure that all attachments are re-added
                        // Overload the library's comparator to push items that are not in
                        // the mirrored query to the front of the aggregate collection.
                        library.comparator = function( a, b ) {
-                               var aInQuery = !! this.mirroring.getByCid( a.cid ),
-                                       bInQuery = !! this.mirroring.getByCid( b.cid );
+                               var aInQuery = !! this.mirroring.get( a.cid ),
+                                       bInQuery = !! this.mirroring.get( b.cid );
 
                                if ( ! aInQuery && bInQuery )
                                        return -1;
         * ========================================================================
         */
 
-       // wp.media.Views
-       // -------------
-       //
-       // A subview manager.
-
-       media.Views = function( view, views ) {
-               this.view = view;
-               this._views = _.isArray( views ) ? { '': views } : views || {};
-       };
-
-       media.Views.extend = Backbone.Model.extend;
-
-       _.extend( media.Views.prototype, {
-               // ### Fetch all of the subviews
-               //
-               // Returns an array of all subviews.
-               all: function() {
-                       return _.flatten( this._views );
-               },
-
-               // ### Get a selector's subviews
-               //
-               // Fetches all subviews that match a given `selector`.
-               //
-               // If no `selector` is provided, it will grab all subviews attached
-               // to the view's root.
-               get: function( selector ) {
-                       selector = selector || '';
-                       return this._views[ selector ];
-               },
-
-               // ### Get a selector's first subview
-               //
-               // Fetches the first subview that matches a given `selector`.
-               //
-               // If no `selector` is provided, it will grab the first subview
-               // attached to the view's root.
-               //
-               // Useful when a selector only has one subview at a time.
-               first: function( selector ) {
-                       var views = this.get( selector );
-                       return views && views.length ? views[0] : null;
-               },
-
-               // ### Register subview(s)
-               //
-               // Registers any number of `views` to a `selector`.
-               //
-               // When no `selector` is provided, the root selector (the empty string)
-               // is used. `views` accepts a `Backbone.View` instance or an array of
-               // `Backbone.View` instances.
-               //
-               // ---
-               //
-               // Accepts an `options` object, which has a significant effect on the
-               // resulting behavior.
-               //
-               // `options.silent` &ndash; *boolean, `false`*
-               // > If `options.silent` is true, no DOM modifications will be made.
-               //
-               // `options.add` &ndash; *boolean, `false`*
-               // > Use `Views.add()` as a shortcut for setting `options.add` to true.
-               //
-               // > By default, the provided `views` will replace
-               // any existing views associated with the selector. If `options.add`
-               // is true, the provided `views` will be added to the existing views.
-               //
-               // `options.at` &ndash; *integer, `undefined`*
-               // > When adding, to insert `views` at a specific index, use
-               // `options.at`. By default, `views` are added to the end of the array.
-               set: function( selector, views, options ) {
-                       var existing, next;
-
-                       if ( ! _.isString( selector ) ) {
-                               options  = views;
-                               views    = selector;
-                               selector = '';
-                       }
-
-                       options  = options || {};
-                       views    = _.isArray( views ) ? views : [ views ];
-                       existing = this.get( selector );
-                       next     = views;
-
-                       if ( existing ) {
-                               if ( options.add ) {
-                                       if ( _.isUndefined( options.at ) ) {
-                                               next = existing.concat( views );
-                                       } else {
-                                               next = existing;
-                                               next.splice.apply( next, [ options.at, 0 ].concat( views ) );
-                                       }
-                               } else {
-                                       _.each( next, function( view ) {
-                                               view.__detach = true;
-                                       });
-
-                                       _.each( existing, function( view ) {
-                                               if ( view.__detach )
-                                                       view.$el.detach();
-                                               else
-                                                       view.dispose();
-                                       });
-
-                                       _.each( next, function( view ) {
-                                               delete view.__detach;
-                                       });
-                               }
-                       }
-
-                       this._views[ selector ] = next;
-
-                       _.each( views, function( subview ) {
-                               var constructor = subview.Views || media.Views,
-                                       subviews = subview.views = subview.views || new constructor( subview );
-                               subviews.parent   = this.view;
-                               subviews.selector = selector;
-                       }, this );
-
-                       if ( ! options.silent )
-                               this._attach( selector, views, _.extend({ ready: this._isReady() }, options ) );
-
-                       return this;
-               },
-
-               // ### Add subview(s) to existing subviews
-               //
-               // An alias to `Views.set()`, which defaults `options.add` to true.
-               //
-               // Adds any number of `views` to a `selector`.
-               //
-               // When no `selector` is provided, the root selector (the empty string)
-               // is used. `views` accepts a `Backbone.View` instance or an array of
-               // `Backbone.View` instances.
-               //
-               // Use `Views.set()` when setting `options.add` to `false`.
-               //
-               // Accepts an `options` object. By default, provided `views` will be
-               // inserted at the end of the array of existing views. To insert
-               // `views` at a specific index, use `options.at`. If `options.silent`
-               // is true, no DOM modifications will be made.
-               //
-               // For more information on the `options` object, see `Views.set()`.
-               add: function( selector, views, options ) {
-                       if ( ! _.isString( selector ) ) {
-                               options  = views;
-                               views    = selector;
-                               selector = '';
-                       }
-
-                       return this.set( selector, views, _.extend({ add: true }, options ) );
-               },
-
-               // ### Stop tracking subviews
-               //
-               // Stops tracking `views` registered to a `selector`. If no `views` are
-               // set, then all of the `selector`'s subviews will be unregistered and
-               // disposed.
-               //
-               // Accepts an `options` object. If `options.silent` is set, `dispose`
-               // will *not* be triggered on the unregistered views.
-               unset: function( selector, views, options ) {
-                       var existing;
-
-                       if ( ! _.isString( selector ) ) {
-                               options = views;
-                               views = selector;
-                               selector = '';
-                       }
-
-                       views = views || [];
-
-                       if ( existing = this.get( selector ) ) {
-                               views = _.isArray( views ) ? views : [ views ];
-                               this._views[ selector ] = views.length ? _.difference( existing, views ) : [];
-                       }
-
-                       if ( ! options || ! options.silent )
-                               _.invoke( views, 'dispose' );
-
-                       return this;
-               },
-
-               // ### Detach all subviews
-               //
-               // Detaches all subviews from the DOM.
-               //
-               // Helps to preserve all subview events when re-rendering the master
-               // view. Used in conjunction with `Views.render()`.
-               detach: function() {
-                       $( _.pluck( this.all(), 'el' ) ).detach();
-                       return this;
-               },
-
-               // ### Render all subviews
-               //
-               // Renders all subviews. Used in conjunction with `Views.detach()`.
-               render: function() {
-                       var options = {
-                                       ready: this._isReady()
-                               };
-
-                       _.each( this._views, function( views, selector ) {
-                               this._attach( selector, views, options );
-                       }, this );
-
-                       this.rendered = true;
-                       return this;
-               },
-
-               // ### Dispose all subviews
-               //
-               // Triggers the `dispose()` method on all subviews. Detaches the master
-               // view from its parent. Resets the internals of the views manager.
-               //
-               // Accepts an `options` object. If `options.silent` is set, `unset`
-               // will *not* be triggered on the master view's parent.
-               dispose: function( options ) {
-                       if ( ! options || ! options.silent ) {
-                               if ( this.parent && this.parent.views )
-                                       this.parent.views.unset( this.selector, this.view, { silent: true });
-                               delete this.parent;
-                               delete this.selector;
-                       }
-
-                       _.invoke( this.all(), 'dispose' );
-                       this._views = [];
-                       return this;
-               },
-
-               // ### Replace a selector's subviews
-               //
-               // By default, sets the `$target` selector's html to the subview `els`.
-               //
-               // Can be overridden in subclasses.
-               replace: function( $target, els ) {
-                       $target.html( els );
-                       return this;
-               },
-
-               // ### Insert subviews into a selector
-               //
-               // By default, appends the subview `els` to the end of the `$target`
-               // selector. If `options.at` is set, inserts the subview `els` at the
-               // provided index.
-               //
-               // Can be overridden in subclasses.
-               insert: function( $target, els, options ) {
-                       var at = options && options.at,
-                               $children;
-
-                       if ( _.isNumber( at ) && ($children = $target.children()).length > at )
-                               $children.eq( at ).before( els );
-                       else
-                               $target.append( els );
-
-                       return this;
-               },
-
-               // ### Trigger the ready event
-               //
-               // **Only use this method if you know what you're doing.**
-               // For performance reasons, this method does not check if the view is
-               // actually attached to the DOM. It's taking your word for it.
-               //
-               // Fires the ready event on the current view and all attached subviews.
-               ready: function() {
-                       this.view.trigger('ready');
-
-                       // Find all attached subviews, and call ready on them.
-                       _.chain( this.all() ).map( function( view ) {
-                               return view.views;
-                       }).flatten().where({ attached: true }).invoke('ready');
-               },
-
-               // #### Internal. Attaches a series of views to a selector.
-               //
-               // Checks to see if a matching selector exists, renders the views,
-               // performs the proper DOM operation, and then checks if the view is
-               // attached to the document.
-               _attach: function( selector, views, options ) {
-                       var $selector = selector ? this.view.$( selector ) : this.view.$el,
-                               managers;
-
-                       // Check if we found a location to attach the views.
-                       if ( ! $selector.length )
-                               return this;
-
-                       managers = _.chain( views ).pluck('views').flatten().value();
-
-                       // Render the views if necessary.
-                       _.each( managers, function( manager ) {
-                               if ( manager.rendered )
-                                       return;
-
-                               manager.view.render();
-                               manager.rendered = true;
-                       }, this );
-
-                       // Insert or replace the views.
-                       this[ options.add ? 'insert' : 'replace' ]( $selector, _.pluck( views, 'el' ), options );
-
-                       // Set attached and trigger ready if the current view is already
-                       // attached to the DOM.
-                       _.each( managers, function( manager ) {
-                               manager.attached = true;
-
-                               if ( options.ready )
-                                       manager.ready();
-                       }, this );
-
-                       return this;
-               },
-
-               // #### Internal. Checks if the current view is in the DOM.
-               _isReady: function() {
-                       var node = this.view.el;
-                       while ( node ) {
-                               if ( node === document.body )
-                                       return true;
-                               node = node.parentNode;
-                       }
-
-                       return false;
-               }
-       });
-
        // wp.media.View
        // -------------
        //
        // The base view class.
-       media.View = Backbone.View.extend({
-               // The constructor for the `Views` manager.
-               Views: media.Views,
-
+       //
+       // Undelegating events, removing events from the model, and
+       // removing events from the controller mirror the code for
+       // `Backbone.View.dispose` in Backbone 0.9.8 development.
+       //
+       // This behavior has since been removed, and should not be used
+       // outside of the media manager.
+       media.View = wp.Backbone.View.extend({
                constructor: function( options ) {
-                       this.views = new this.Views( this, this.views );
-                       this.on( 'ready', this.ready, this );
-
                        if ( options && options.controller )
                                this.controller = options.controller;
 
-                       Backbone.View.apply( this, arguments );
+                       wp.Backbone.View.apply( this, arguments );
                },
 
                dispose: function() {
                        // Undelegating events, removing events from the model, and
                        // removing events from the controller mirror the code for
-                       // `Backbone.View.dispose` in Backbone master.
+                       // `Backbone.View.dispose` in Backbone 0.9.8 development.
                        this.undelegateEvents();
 
                        if ( this.model && this.model.off )
                        if ( this.controller && this.controller.off )
                                this.controller.off( null, null, this );
 
-                       // Recursively dispose child views.
-                       if ( this.views )
-                               this.views.dispose();
-
                        return this;
                },
 
                remove: function() {
                        this.dispose();
-                       return Backbone.View.prototype.remove.apply( this, arguments );
-               },
-
-               render: function() {
-                       var options;
-
-                       if ( this.prepare )
-                               options = this.prepare();
-
-                       this.views.detach();
-
-                       if ( this.template ) {
-                               options = options || {};
-                               this.trigger( 'prepare', options );
-                               this.$el.html( this.template( options ) );
-                       }
-
-                       this.views.render();
-                       return this;
-               },
-
-               prepare: function() {
-                       return this.options;
-               },
-
-               ready: function() {}
+                       return wp.Backbone.View.prototype.remove.apply( this, arguments );
+               }
        });
 
        /**
                featuredImageToolbar: function( toolbar ) {
                        this.createSelectToolbar( toolbar, {
                                text:  l10n.setFeaturedImage,
-                               state: this.options.state || 'upload'
+                               state: this.options.state
                        });
                },
 
                                                        controller.close();
                                                        state.trigger( 'update', state.get('library') );
 
+                                                       // Restore and reset the default state.
+                                                       controller.setState( controller.options.state );
                                                        controller.reset();
-                                                       // @todo: Make the state activated dynamic (instead of hardcoded).
-                                                       controller.setState('upload');
                                                }
                                        }
                                }
                                var requires = button.options.requires,
                                        disabled = false;
 
+                               // Prevent insertion of attachments if any of them are still uploading
+                               disabled = _.some( selection.models, function( attachment ) {
+                                       return attachment.get('uploading') === true;
+                               });
+
                                if ( requires.selection && selection && ! selection.length )
                                        disabled = true;
                                else if ( requires.library && library && ! library.length )
                        if ( options.event )
                                controller.state().trigger( options.event );
 
-                       if ( options.reset )
-                               controller.reset();
-
                        if ( options.state )
                                controller.setState( options.state );
+
+                       if ( options.reset )
+                               controller.reset();
                }
        });
 
                selected: function() {
                        var selection = this.options.selection;
                        if ( selection )
-                               return !! selection.getByCid( this.model.cid );
+                               return !! selection.get( this.model.cid );
                },
 
                select: function( model, collection ) {
 
                        this.collection.on( 'add', function( attachment, attachments, options ) {
                                this.views.add( this.createAttachmentView( attachment ), {
-                                       at: options.index
+                                       at: this.collection.indexOf( attachment )
                                });
                        }, this );
 
                        // Build `<option>` elements.
                        this.$el.html( _.chain( this.filters ).map( function( filter, value ) {
                                return {
-                                       el: this.make( 'option', { value: value }, filter.text ),
+                                       el: $('<option></option>').val(value).text(filter.text)[0],
                                        priority: filter.priority || 50
                                };
                        }, this ).sortBy('priority').pluck('el').value() );
                },
 
                updateChanges: function( model, options ) {
-                       if ( options.changes )
-                               _( options.changes ).chain().keys().each( this.update, this );
+                       if ( model.hasChanged() )
+                               _( model.changed ).chain().keys().each( this.update, this );
                }
        });
 
                                $input = this.$('.link-to-custom'),
                                attachment = this.options.attachment;
 
-                       if ( 'none' === linkTo || ( ! attachment && 'custom' !== linkTo ) ) {
+                       if ( 'none' === linkTo || 'embed' === linkTo || ( ! attachment && 'custom' !== linkTo ) ) {
                                $input.hide();
                                return;
                        }
                },
 
                initialize: function() {
-                       this.input = this.make( 'input', {
-                               type:  'text',
-                               value: this.model.get('url') || ''
-                       });
-
-                       this.spinner = this.make( 'span', {
-                               'class': 'spinner'
-                       });
+                       this.$input = $('<input/>').attr( 'type', 'text' ).val( this.model.get('url') );
+                       this.input = this.$input[0];
 
-                       this.$input = $( this.input );
+                       this.spinner = $('<span class="spinner" />')[0];
                        this.$el.append([ this.input, this.spinner ]);
 
                        this.model.on( 'change:url', this.render, this );
                        this.$('img').attr( 'src', this.model.get('url') );
                }
        });
-}(jQuery));
+}(jQuery));
\ No newline at end of file
index a4dec31ad31244a41c789adb257b1e46ff7a2ed1..89cc6fcba48eb1ee29d0a1d5cd489e6519f4df09 100644 (file)
@@ -1 +1 @@
-(function(e){var f=wp.media,d=f.model.Attachment,c=f.model.Attachments,a=f.model.Query,b;b=f.view.l10n=typeof _wpMediaViewsL10n==="undefined"?{}:_wpMediaViewsL10n;f.view.settings=b.settings||{};delete b.settings;f.model.settings.post=f.view.settings.post;e.support.transition=(function(){var g=document.documentElement.style,h={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},i;i=_.find(_.keys(h),function(j){return !_.isUndefined(g[j])});return i&&{end:h[i]}}());f.transition=function(g,h){var i=e.Deferred();h=h||2000;if(e.support.transition){if(!(g instanceof e)){g=e(g)}g.first().one(e.support.transition.end,i.resolve);_.delay(i.resolve,h)}else{i.resolve()}return i.promise()};f.controller.Region=function(g){_.extend(this,_.pick(g||{},"id","view","selector"))};f.controller.Region.extend=Backbone.Model.extend;_.extend(f.controller.Region.prototype,{mode:function(g){if(!g){return this._mode}if(g===this._mode){return this}this.trigger("deactivate");this._mode=g;this.render(g);this.trigger("activate");return this},render:function(h){if(h&&h!==this._mode){return this.mode(h)}var i={view:null},g;this.trigger("create",i);g=i.view;this.trigger("render",g);if(g){this.set(g)}return this},get:function(){return this.view.views.first(this.selector)},set:function(g,h){if(h){h.add=false}return this.view.views.set(this.selector,g,h)},trigger:function(h){var i;if(!this._mode){return}var g=_.toArray(arguments);i=this.id+":"+h;g[0]=i+":"+this._mode;this.view.trigger.apply(this.view,g);g[0]=i;this.view.trigger.apply(this.view,g);return this}});f.controller.StateMachine=function(g){this.states=new Backbone.Collection(g)};f.controller.StateMachine.extend=Backbone.Model.extend;_.extend(f.controller.StateMachine.prototype,Backbone.Events,{state:function(g){this.states=this.states||new Backbone.Collection();g=g||this._state;if(g&&!this.states.get(g)){this.states.add({id:g})}return this.states.get(g)},setState:function(h){var g=this.state();if((g&&h===g.id)||!this.states||!this.states.get(h)){return this}if(g){g.trigger("deactivate");this._lastState=g.id}this._state=h;this.state().trigger("activate");return this},lastState:function(){if(this._lastState){return this.state(this._lastState)}}});_.each(["on","off","trigger"],function(g){f.controller.StateMachine.prototype[g]=function(){this.states=this.states||new Backbone.Collection();this.states[g].apply(this.states,arguments);return this}});f.controller.State=Backbone.Model.extend({constructor:function(){this.on("activate",this._preActivate,this);this.on("activate",this.activate,this);this.on("activate",this._postActivate,this);this.on("deactivate",this._deactivate,this);this.on("deactivate",this.deactivate,this);this.on("reset",this.reset,this);this.on("ready",this._ready,this);this.on("ready",this.ready,this);this.on("change:menu",this._updateMenu,this);Backbone.Model.apply(this,arguments)},ready:function(){},activate:function(){},deactivate:function(){},reset:function(){},_ready:function(){this._updateMenu()},_preActivate:function(){this.active=true},_postActivate:function(){this.on("change:menu",this._menu,this);this.on("change:titleMode",this._title,this);this.on("change:content",this._content,this);this.on("change:toolbar",this._toolbar,this);this.frame.on("title:render:default",this._renderTitle,this);this._title();this._menu();this._toolbar();this._content();this._router()},_deactivate:function(){this.active=false;this.frame.off("title:render:default",this._renderTitle,this);this.off("change:menu",this._menu,this);this.off("change:titleMode",this._title,this);this.off("change:content",this._content,this);this.off("change:toolbar",this._toolbar,this)},_title:function(){this.frame.title.render(this.get("titleMode")||"default")},_renderTitle:function(g){g.$el.text(this.get("title")||"")},_router:function(){var h=this.frame.router,i=this.get("router"),g;this.frame.$el.toggleClass("hide-router",!i);if(!i){return}this.frame.router.render(i);g=h.get();if(g&&g.select){g.select(this.frame.content.mode())}},_menu:function(){var i=this.frame.menu,h=this.get("menu"),g;if(!h){return}i.mode(h);g=i.get();if(g&&g.select){g.select(this.id)}},_updateMenu:function(){var g=this.previous("menu"),h=this.get("menu");if(g){this.frame.off("menu:render:"+g,this._renderMenu,this)}if(h){this.frame.on("menu:render:"+h,this._renderMenu,this)}},_renderMenu:function(g){var i=this.get("menuItem"),j=this.get("title"),h=this.get("priority");if(!i&&j){i={text:j};if(h){i.priority=h}}if(!i){return}g.set(this.id,i)}});_.each(["toolbar","content"],function(g){f.controller.State.prototype["_"+g]=function(){var h=this.get(g);if(h){this.frame[g].render(h)}}});f.controller.Library=f.controller.State.extend({defaults:{id:"library",multiple:false,describe:false,toolbar:"select",sidebar:"settings",content:"upload",router:"browse",menu:"default",searchable:true,filterable:false,sortable:true,title:b.mediaLibraryTitle,contentUserSetting:true,syncSelection:true},initialize:function(){var h=this.get("selection"),g;if(!this.get("library")){this.set("library",f.query())}if(!(h instanceof f.model.Selection)){g=h;if(!g){g=this.get("library").props.toJSON();g=_.omit(g,"orderby","query")}this.set("selection",new f.model.Selection(null,{multiple:this.get("multiple"),props:g}))}if(!this.get("edge")){this.set("edge",120)}if(!this.get("gutter")){this.set("gutter",8)}this.resetDisplays()},activate:function(){this.syncSelection();wp.Uploader.queue.on("add",this.uploading,this);this.get("selection").on("add remove reset",this.refreshContent,this);if(this.get("contentUserSetting")){this.frame.on("content:activate",this.saveContentMode,this);this.set("content",getUserSetting("libraryContent",this.get("content")))}},deactivate:function(){this.recordSelection();this.frame.off("content:activate",this.saveContentMode,this);this.get("selection").off(null,null,this);wp.Uploader.queue.off(null,null,this)},reset:function(){this.get("selection").reset();this.resetDisplays();this.refreshContent()},resetDisplays:function(){var g=f.view.settings.defaultProps;this._displays=[];this._defaultDisplaySettings={align:g.align||getUserSetting("align","none"),size:g.size||getUserSetting("imgsize","medium"),link:g.link||getUserSetting("urlbutton","file")}},display:function(h){var g=this._displays;if(!g[h.cid]){g[h.cid]=new Backbone.Model(this._defaultDisplaySettings)}return g[h.cid]},syncSelection:function(){var h=this.get("selection"),g=this.frame._selection;if(!this.get("syncSelection")||!g||!h){return}if(h.multiple){h.reset([],{silent:true});h.validateAll(g.attachments);g.difference=_.difference(g.attachments.models,h.models)}h.single(g.single)},recordSelection:function(){var i=this.get("selection"),h=this.frame._selection,g;if(!this.get("syncSelection")||!h||!i){return}if(i.multiple){h.attachments.reset(i.toArray().concat(h.difference));h.difference=[]}else{h.attachments.add(i.toArray())}h.single=i._single},refreshContent:function(){var h=this.get("selection"),j=this.frame,g=j.router.get(),i=j.content.mode();if(this.active&&!h.length&&g&&!g.get(i)){this.frame.content.render(this.get("content"))}},uploading:function(h){var g=this.frame.content;if("upload"===g.mode()){this.frame.content.mode("browse")}this.get("selection").add(h)},saveContentMode:function(){if("browse"!==this.get("router")){return}var h=this.frame.content.mode(),g=this.frame.router.get();if(g&&g.get(h)){setUserSetting("libraryContent",h)}}});f.controller.GalleryEdit=f.controller.Library.extend({defaults:{id:"gallery-edit",multiple:false,describe:true,edge:199,editing:false,sortable:true,searchable:false,toolbar:"gallery-edit",content:"browse",title:b.editGalleryTitle,priority:60,dragInfo:true,syncSelection:false},initialize:function(){if(!this.get("library")){this.set("library",new f.model.Selection())}if(!this.get("AttachmentView")){this.set("AttachmentView",f.view.Attachment.EditLibrary)}f.controller.Library.prototype.initialize.apply(this,arguments)},activate:function(){var g=this.get("library");g.props.set("type","image");this.get("library").observe(wp.Uploader.queue);this.frame.on("content:render:browse",this.gallerySettings,this);f.controller.Library.prototype.activate.apply(this,arguments)},deactivate:function(){this.get("library").unobserve(wp.Uploader.queue);this.frame.off("content:render:browse",this.gallerySettings,this);f.controller.Library.prototype.deactivate.apply(this,arguments)},gallerySettings:function(h){var g=this.get("library");if(!g||!h){return}g.gallery=g.gallery||new Backbone.Model();h.sidebar.set({gallery:new f.view.Settings.Gallery({controller:this,model:g.gallery,priority:40})});h.toolbar.set("reverse",{text:b.reverseOrder,priority:80,click:function(){g.reset(g.toArray().reverse())}})}});f.controller.GalleryAdd=f.controller.Library.extend({defaults:_.defaults({id:"gallery-library",filterable:"uploaded",multiple:"add",menu:"gallery",toolbar:"gallery-add",title:b.addToGalleryTitle,priority:100,syncSelection:false},f.controller.Library.prototype.defaults),initialize:function(){if(!this.get("library")){this.set("library",f.query({type:"image"}))}f.controller.Library.prototype.initialize.apply(this,arguments)},activate:function(){var g=this.get("library"),h=this.frame.state("gallery-edit").get("library");if(this.editLibrary&&this.editLibrary!==h){g.unobserve(this.editLibrary)}g.validator=function(i){return !!this.mirroring.getByCid(i.cid)&&!h.getByCid(i.cid)&&f.model.Selection.prototype.validator.apply(this,arguments)};g.reset(g.mirroring.models,{silent:true});g.observe(h);this.editLibrary=h;f.controller.Library.prototype.activate.apply(this,arguments)}});f.controller.FeaturedImage=f.controller.Library.extend({defaults:_.defaults({id:"featured-image",filterable:"uploaded",multiple:false,toolbar:"featured-image",title:b.setFeaturedImageTitle,priority:60,syncSelection:false},f.controller.Library.prototype.defaults),initialize:function(){var h,g;if(!this.get("library")){this.set("library",f.query({type:"image"}))}f.controller.Library.prototype.initialize.apply(this,arguments);h=this.get("library");g=h.comparator;h.comparator=function(j,i){var l=!!this.mirroring.getByCid(j.cid),k=!!this.mirroring.getByCid(i.cid);if(!l&&k){return -1}else{if(l&&!k){return 1}else{return g.apply(this,arguments)}}};h.observe(this.get("selection"))},activate:function(){this.updateSelection();this.frame.on("open",this.updateSelection,this);f.controller.Library.prototype.activate.apply(this,arguments)},deactivate:function(){this.frame.off("open",this.updateSelection,this);f.controller.Library.prototype.deactivate.apply(this,arguments)},updateSelection:function(){var g=this.get("selection"),i=f.view.settings.post.featuredImageId,h;if(""!==i&&-1!==i){h=d.get(i);h.fetch()}g.reset(h?[h]:[])}});f.controller.Embed=f.controller.State.extend({defaults:{id:"embed",url:"",menu:"default",content:"embed",toolbar:"main-embed",type:"link",title:b.insertFromUrlTitle,priority:120},sensitivity:200,initialize:function(){this.debouncedScan=_.debounce(_.bind(this.scan,this),this.sensitivity);this.props=new Backbone.Model({url:""});this.props.on("change:url",this.debouncedScan,this);this.props.on("change:url",this.refresh,this);this.on("scan",this.scanImage,this)},scan:function(){var h,i=this,g={type:"link",scanners:[]};if(this.props.get("url")){this.trigger("scan",g)}if(g.scanners.length){h=g.scanners=e.when.apply(e,g.scanners);h.always(function(){if(i.get("scanners")===h){i.set("loading",false)}})}else{g.scanners=null}g.loading=!!g.scanners;this.set(g)},scanImage:function(h){var l=this.frame,j=this,i=this.props.get("url"),k=new Image(),g=e.Deferred();h.scanners.push(g.promise());k.onload=function(){g.resolve();if(j!==l.state()||i!==j.props.get("url")){return}j.set({type:"image"});j.props.set({width:k.width,height:k.height})};k.onerror=g.reject;k.src=i},refresh:function(){this.frame.toolbar.get().refresh()},reset:function(){this.props.clear().set({url:""});if(this.active){this.refresh()}}});f.Views=function(h,g){this.view=h;this._views=_.isArray(g)?{"":g}:g||{}};f.Views.extend=Backbone.Model.extend;_.extend(f.Views.prototype,{all:function(){return _.flatten(this._views)},get:function(g){g=g||"";return this._views[g]},first:function(g){var h=this.get(g);return h&&h.length?h[0]:null},set:function(g,h,i){var k,j;if(!_.isString(g)){i=h;h=g;g=""}i=i||{};h=_.isArray(h)?h:[h];k=this.get(g);j=h;if(k){if(i.add){if(_.isUndefined(i.at)){j=k.concat(h)}else{j=k;j.splice.apply(j,[i.at,0].concat(h))}}else{_.each(j,function(l){l.__detach=true});_.each(k,function(l){if(l.__detach){l.$el.detach()}else{l.dispose()}});_.each(j,function(l){delete l.__detach})}}this._views[g]=j;_.each(h,function(n){var l=n.Views||f.Views,m=n.views=n.views||new l(n);m.parent=this.view;m.selector=g},this);if(!i.silent){this._attach(g,h,_.extend({ready:this._isReady()},i))}return this},add:function(g,h,i){if(!_.isString(g)){i=h;h=g;g=""}return this.set(g,h,_.extend({add:true},i))},unset:function(g,h,i){var j;if(!_.isString(g)){i=h;h=g;g=""}h=h||[];if(j=this.get(g)){h=_.isArray(h)?h:[h];this._views[g]=h.length?_.difference(j,h):[]}if(!i||!i.silent){_.invoke(h,"dispose")}return this},detach:function(){e(_.pluck(this.all(),"el")).detach();return this},render:function(){var g={ready:this._isReady()};_.each(this._views,function(i,h){this._attach(h,i,g)},this);this.rendered=true;return this},dispose:function(g){if(!g||!g.silent){if(this.parent&&this.parent.views){this.parent.views.unset(this.selector,this.view,{silent:true})}delete this.parent;delete this.selector}_.invoke(this.all(),"dispose");this._views=[];return this},replace:function(g,h){g.html(h);return this},insert:function(h,k,j){var g=j&&j.at,i;if(_.isNumber(g)&&(i=h.children()).length>g){i.eq(g).before(k)}else{h.append(k)}return this},ready:function(){this.view.trigger("ready");_.chain(this.all()).map(function(g){return g.views}).flatten().where({attached:true}).invoke("ready")},_attach:function(g,h,i){var k=g?this.view.$(g):this.view.$el,j;if(!k.length){return this}j=_.chain(h).pluck("views").flatten().value();_.each(j,function(l){if(l.rendered){return}l.view.render();l.rendered=true},this);this[i.add?"insert":"replace"](k,_.pluck(h,"el"),i);_.each(j,function(l){l.attached=true;if(i.ready){l.ready()}},this);return this},_isReady:function(){var g=this.view.el;while(g){if(g===document.body){return true}g=g.parentNode}return false}});f.View=Backbone.View.extend({Views:f.Views,constructor:function(g){this.views=new this.Views(this,this.views);this.on("ready",this.ready,this);if(g&&g.controller){this.controller=g.controller}Backbone.View.apply(this,arguments)},dispose:function(){this.undelegateEvents();if(this.model&&this.model.off){this.model.off(null,null,this)}if(this.collection&&this.collection.off){this.collection.off(null,null,this)}if(this.controller&&this.controller.off){this.controller.off(null,null,this)}if(this.views){this.views.dispose()}return this},remove:function(){this.dispose();return Backbone.View.prototype.remove.apply(this,arguments)},render:function(){var g;if(this.prepare){g=this.prepare()}this.views.detach();if(this.template){g=g||{};this.trigger("prepare",g);this.$el.html(this.template(g))}this.views.render();return this},prepare:function(){return this.options},ready:function(){}});f.view.Frame=f.View.extend({initialize:function(){this._createRegions();this._createStates()},_createRegions:function(){this.regions=this.regions?this.regions.slice():[];_.each(this.regions,function(g){this[g]=new f.controller.Region({view:this,id:g,selector:".media-frame-"+g})},this)},_createStates:function(){this.states=new Backbone.Collection(null,{model:f.controller.State});this.states.on("add",function(g){g.frame=this;g.trigger("ready")},this);if(this.options.states){this.states.add(this.options.states)}},reset:function(){this.states.invoke("trigger","reset");return this}});_.extend(f.view.Frame.prototype,f.controller.StateMachine.prototype);f.view.MediaFrame=f.view.Frame.extend({className:"media-frame",template:f.template("media-frame"),regions:["menu","title","content","toolbar","router"],initialize:function(){f.view.Frame.prototype.initialize.apply(this,arguments);_.defaults(this.options,{title:"",modal:true,uploader:true});this.$el.addClass("wp-core-ui");if(this.options.modal){this.modal=new f.view.Modal({controller:this,title:this.options.title});this.modal.content(this)}if(wp.Uploader.limitExceeded||!wp.Uploader.browser.supported){this.options.uploader=false}if(this.options.uploader){this.uploader=new f.view.UploaderWindow({controller:this,uploader:{dropzone:this.modal?this.modal.$el:this.$el,container:this.$el}});this.views.set(".media-frame-uploader",this.uploader)}this.on("attach",_.bind(this.views.ready,this.views),this);this.on("title:create:default",this.createTitle,this);this.title.mode("default");this.on("menu:create:default",this.createMenu,this)},render:function(){if(!this.state()&&this.options.state){this.setState(this.options.state)}return f.view.Frame.prototype.render.apply(this,arguments)},createTitle:function(g){g.view=new f.View({controller:this,tagName:"h1"})},createMenu:function(g){g.view=new f.view.Menu({controller:this})},createToolbar:function(g){g.view=new f.view.Toolbar({controller:this})},createRouter:function(g){g.view=new f.view.Router({controller:this})},createIframeStates:function(g){var j=f.view.settings,i=j.tabs,k=j.tabUrl,h;if(!i||!k){return}h=e("#post_ID");if(h.length){k+="&post_id="+h.val()}_.each(i,function(m,n){var l=this.state("iframe:"+n).set(_.defaults({tab:n,src:k+"&tab="+n,title:m,content:"iframe",menu:"default"},g))},this);this.on("content:create:iframe",this.iframeContent,this);this.on("menu:render:default",this.iframeMenu,this);this.on("open",this.hijackThickbox,this);this.on("close",this.restoreThickbox,this)},iframeContent:function(g){this.$el.addClass("hide-toolbar");g.view=new f.view.Iframe({controller:this})},iframeMenu:function(h){var g={};if(!h){return}_.each(f.view.settings.tabs,function(i,j){g["iframe:"+j]={text:this.state("iframe:"+j).get("title"),priority:200}},this);h.set(g)},hijackThickbox:function(){var g=this;if(!window.tb_remove||this._tb_remove){return}this._tb_remove=window.tb_remove;window.tb_remove=function(){g.close();g.reset();g.setState(g.options.state);g._tb_remove.call(window)}},restoreThickbox:function(){if(!this._tb_remove){return}window.tb_remove=this._tb_remove;delete this._tb_remove}});_.each(["open","close","attach","detach","escape"],function(g){f.view.MediaFrame.prototype[g]=function(h){if(this.modal){this.modal[g].apply(this.modal,arguments)}return this}});f.view.MediaFrame.Select=f.view.MediaFrame.extend({initialize:function(){f.view.MediaFrame.prototype.initialize.apply(this,arguments);_.defaults(this.options,{selection:[],library:{},multiple:false,state:"library"});this.createSelection();this.createStates();this.bindHandlers()},createSelection:function(){var g=this,h=this.options.selection;if(!(h instanceof f.model.Selection)){this.options.selection=new f.model.Selection(h,{multiple:this.options.multiple})}this._selection={attachments:new c(),difference:[]}},createStates:function(){var g=this.options;if(this.options.states){return}this.states.add([new f.controller.Library({library:f.query(g.library),multiple:g.multiple,title:g.title,priority:20})])},bindHandlers:function(){this.on("router:create:browse",this.createRouter,this);this.on("router:render:browse",this.browseRouter,this);this.on("content:create:browse",this.browseContent,this);this.on("content:render:upload",this.uploadContent,this);this.on("toolbar:create:select",this.createSelectToolbar,this)},browseRouter:function(g){g.set({upload:{text:b.uploadFilesTitle,priority:20},browse:{text:b.mediaLibraryTitle,priority:40}})},browseContent:function(g){var h=this.state();this.$el.removeClass("hide-toolbar");g.view=new f.view.AttachmentsBrowser({controller:this,collection:h.get("library"),selection:h.get("selection"),model:h,sortable:h.get("sortable"),search:h.get("searchable"),filters:h.get("filterable"),display:h.get("displaySettings"),dragInfo:h.get("dragInfo"),AttachmentView:h.get("AttachmentView")})},uploadContent:function(){this.$el.removeClass("hide-toolbar");this.content.set(new f.view.UploaderInline({controller:this}))},createSelectToolbar:function(h,g){g=g||this.options.button||{};g.controller=this;h.view=new f.view.Toolbar.Select(g)}});f.view.MediaFrame.Post=f.view.MediaFrame.Select.extend({initialize:function(){_.defaults(this.options,{multiple:true,editing:false,state:"insert"});f.view.MediaFrame.Select.prototype.initialize.apply(this,arguments);this.createIframeStates()},createStates:function(){var g=this.options;this.states.add([new f.controller.Library({id:"insert",title:b.insertMediaTitle,priority:20,toolbar:"main-insert",filterable:"all",library:f.query(g.library),multiple:g.multiple?"reset":false,editable:true,allowLocalEdits:true,displaySettings:true,displayUserSettings:true}),new f.controller.Library({id:"gallery",title:b.createGalleryTitle,priority:40,toolbar:"main-gallery",filterable:"uploaded",multiple:"add",editable:false,library:f.query(_.defaults({type:"image"},g.library))}),new f.controller.Embed(),new f.controller.GalleryEdit({library:g.selection,editing:g.editing,menu:"gallery"}),new f.controller.GalleryAdd()]);if(f.view.settings.post.featuredImageId){this.states.add(new f.controller.FeaturedImage())}},bindHandlers:function(){f.view.MediaFrame.Select.prototype.bindHandlers.apply(this,arguments);this.on("menu:create:gallery",this.createMenu,this);this.on("toolbar:create:main-insert",this.createToolbar,this);this.on("toolbar:create:main-gallery",this.createToolbar,this);this.on("toolbar:create:featured-image",this.featuredImageToolbar,this);this.on("toolbar:create:main-embed",this.mainEmbedToolbar,this);var g={menu:{"default":"mainMenu",gallery:"galleryMenu"},content:{embed:"embedContent","edit-selection":"editSelectionContent"},toolbar:{"main-insert":"mainInsertToolbar","main-gallery":"mainGalleryToolbar","gallery-edit":"galleryEditToolbar","gallery-add":"galleryAddToolbar"}};_.each(g,function(i,h){_.each(i,function(k,j){this.on(h+":render:"+j,this[k],this)},this)},this)},mainMenu:function(g){g.set({"library-separator":new f.View({className:"separator",priority:100})})},galleryMenu:function(g){var h=this.lastState(),i=h&&h.id,j=this;g.set({cancel:{text:b.cancelGalleryTitle,priority:20,click:function(){if(i){j.setState(i)}else{j.close()}}},separateCancel:new f.View({className:"separator",priority:40})})},embedContent:function(){var g=new f.view.Embed({controller:this,model:this.state()}).render();this.content.set(g);g.url.focus()},editSelectionContent:function(){var i=this.state(),h=i.get("selection"),g;g=new f.view.AttachmentsBrowser({controller:this,collection:h,selection:h,model:i,sortable:true,search:false,dragInfo:true,AttachmentView:f.view.Attachment.EditSelection}).render();g.toolbar.set("backToLibrary",{text:b.returnToLibrary,priority:-100,click:function(){this.controller.content.mode("browse")}});this.content.set(g)},selectionStatusToolbar:function(g){var h=this.state().get("editable");g.set("selection",new f.view.Selection({controller:this,collection:this.state().get("selection"),priority:-40,editable:h&&function(){this.controller.content.mode("edit-selection")}}).render())},mainInsertToolbar:function(h){var g=this;this.selectionStatusToolbar(h);h.set("insert",{style:"primary",priority:80,text:b.insertIntoPost,requires:{selection:true},click:function(){var j=g.state(),i=j.get("selection");g.close();j.trigger("insert",i).reset()}})},mainGalleryToolbar:function(h){var g=this;this.selectionStatusToolbar(h);h.set("gallery",{style:"primary",text:b.createNewGallery,priority:60,requires:{selection:true},click:function(){var i=g.state().get("selection"),j=g.state("gallery-edit"),k=i.where({type:"image"});j.set("library",new f.model.Selection(k,{props:i.props.toJSON(),multiple:true}));this.controller.setState("gallery-edit")}})},featuredImageToolbar:function(g){this.createSelectToolbar(g,{text:b.setFeaturedImage,state:this.options.state||"upload"})},mainEmbedToolbar:function(g){g.view=new f.view.Toolbar.Embed({controller:this})},galleryEditToolbar:function(){var g=this.state().get("editing");this.toolbar.set(new f.view.Toolbar({controller:this,items:{insert:{style:"primary",text:g?b.updateGallery:b.insertGallery,priority:80,requires:{library:true},click:function(){var h=this.controller,i=h.state();h.close();i.trigger("update",i.get("library"));h.reset();h.setState("upload")}}}}))},galleryAddToolbar:function(){this.toolbar.set(new f.view.Toolbar({controller:this,items:{insert:{style:"primary",text:b.addToGallery,priority:80,requires:{selection:true},click:function(){var g=this.controller,i=g.state(),h=g.state("gallery-edit");h.get("library").add(i.get("selection").models);i.trigger("reset");g.setState("gallery-edit")}}}}))}});f.view.Modal=f.View.extend({tagName:"div",template:f.template("media-modal"),attributes:{tabindex:0},events:{"click .media-modal-backdrop, .media-modal-close":"escapeHandler",keydown:"keydown"},initialize:function(){_.defaults(this.options,{container:document.body,title:"",propagate:true,freeze:true})},prepare:function(){return{title:this.options.title}},attach:function(){if(this.views.attached){return this}if(!this.views.rendered){this.render()}this.$el.appendTo(this.options.container);this.views.attached=true;this.views.ready();return this.propagate("attach")},detach:function(){if(this.$el.is(":visible")){this.close()}this.$el.detach();this.views.attached=false;return this.propagate("detach")},open:function(){var h=this.$el,g=this.options;if(h.is(":visible")){return this}if(!this.views.attached){this.attach()}if(g.freeze){this._freeze={scrollTop:e(window).scrollTop()}}h.show().focus();return this.propagate("open")},close:function(g){var h=this._freeze;if(!this.views.attached||!this.$el.is(":visible")){return this}this.$el.hide();this.propagate("close");if(h){e(window).scrollTop(h.scrollTop)}if(g&&g.escape){this.propagate("escape")}return this},escape:function(){return this.close({escape:true})},escapeHandler:function(g){g.preventDefault();this.escape()},content:function(g){this.views.set(".media-modal-content",g);return this},propagate:function(g){this.trigger(g);if(this.options.propagate){this.controller.trigger(g)}return this},keydown:function(g){if(27===g.which){g.preventDefault();this.escape();return}}});f.view.FocusManager=f.View.extend({events:{keydown:"recordTab",focusin:"updateIndex"},focus:function(){if(_.isUndefined(this.index)){return}this.$tabbables=this.$(":tabbable");this.$tabbables.eq(this.index).focus()},recordTab:function(h){if(9!==h.keyCode){return}if(_.isUndefined(this.index)){this.updateIndex(h)}if(_.isUndefined(this.index)){return}var g=this.index+(h.shiftKey?-1:1);if(g>=0&&g<this.$tabbables.length){this.index=g}else{delete this.index}},updateIndex:function(h){this.$tabbables=this.$(":tabbable");var g=this.$tabbables.index(h.target);if(-1===g){delete this.index}else{this.index=g}}});f.view.UploaderWindow=f.View.extend({tagName:"div",className:"uploader-window",template:f.template("uploader-window"),initialize:function(){var g;this.$browser=e('<a href="#" class="browser" />').hide().appendTo("body");g=this.options.uploader=_.defaults(this.options.uploader||{},{dropzone:this.$el,browser:this.$browser,params:{}});if(g.dropzone&&!(g.dropzone instanceof e)){g.dropzone=e(g.dropzone)}this.controller.on("activate",this.refresh,this)},refresh:function(){if(this.uploader){this.uploader.refresh()}},ready:function(){var h=f.view.settings.post.id,g;if(this.uploader){return}if(h){this.options.uploader.params.post_id=h}this.uploader=new wp.Uploader(this.options.uploader);g=this.uploader.dropzone;g.on("dropzone:enter",_.bind(this.show,this));g.on("dropzone:leave",_.bind(this.hide,this))},show:function(){var g=this.$el.show();_.defer(function(){g.css({opacity:1})})},hide:function(){var g=this.$el.css({opacity:0});f.transition(g).done(function(){if("0"===g.css("opacity")){g.hide()}})}});f.view.UploaderInline=f.View.extend({tagName:"div",className:"uploader-inline",template:f.template("uploader-inline"),initialize:function(){_.defaults(this.options,{message:"",status:true});if(!this.options.$browser&&this.controller.uploader){this.options.$browser=this.controller.uploader.$browser}if(_.isUndefined(this.options.postId)){this.options.postId=f.view.settings.post.id}if(this.options.status){this.views.set(".upload-inline-status",new f.view.UploaderStatus({controller:this.controller}))}},dispose:function(){if(this.disposing){return f.View.prototype.dispose.apply(this,arguments)}this.disposing=true;return this.remove()},remove:function(){var g=f.View.prototype.remove.apply(this,arguments);_.defer(_.bind(this.refresh,this));return g},refresh:function(){var g=this.controller.uploader;if(g){g.refresh()}},ready:function(){var g=this.options.$browser,h;if(this.controller.uploader){h=this.$(".browser");if(h[0]===g[0]){return}g.detach().text(h.text());g[0].className=h[0].className;h.replaceWith(g.show())}this.refresh();return this}});f.view.UploaderStatus=f.View.extend({className:"media-uploader-status",template:f.template("uploader-status"),events:{"click .upload-dismiss-errors":"dismiss"},initialize:function(){this.queue=wp.Uploader.queue;this.queue.on("add remove reset",this.visibility,this);this.queue.on("add remove reset change:percent",this.progress,this);this.queue.on("add remove reset change:uploading",this.info,this);this.errors=wp.Uploader.errors;this.errors.reset();this.errors.on("add remove reset",this.visibility,this);this.errors.on("add",this.error,this)},dispose:function(){wp.Uploader.queue.off(null,null,this);f.View.prototype.dispose.apply(this,arguments);return this},visibility:function(){this.$el.toggleClass("uploading",!!this.queue.length);this.$el.toggleClass("errors",!!this.errors.length);this.$el.toggle(!!this.queue.length||!!this.errors.length)},ready:function(){_.each({"$bar":".media-progress-bar div","$index":".upload-index","$total":".upload-total","$filename":".upload-filename"},function(g,h){this[h]=this.$(g)},this);this.visibility();this.progress();this.info()},progress:function(){var g=this.queue,i=this.$bar,h=0;if(!i||!g.length){return}i.width((g.reduce(function(j,l){if(!l.get("uploading")){return j+100}var k=l.get("percent");return j+(_.isNumber(k)?k:100)},0)/g.length)+"%")},info:function(){var g=this.queue,h=0,i;if(!g.length){return}i=this.queue.find(function(k,j){h=j;return k.get("uploading")});this.$index.text(h+1);this.$total.text(g.length);this.$filename.html(i?this.filename(i.get("filename")):"")},filename:function(g){return f.truncate(_.escape(g),24)},error:function(g){this.views.add(".upload-errors",new f.view.UploaderStatusError({filename:this.filename(g.get("file").name),message:g.get("message")}),{at:0})},dismiss:function(g){var h=this.views.get(".upload-errors");g.preventDefault();if(h){_.invoke(h,"remove")}wp.Uploader.errors.reset()}});f.view.UploaderStatusError=f.View.extend({className:"upload-error",template:f.template("uploader-status-error")});f.view.Toolbar=f.View.extend({tagName:"div",className:"media-toolbar",initialize:function(){var i=this.controller.state(),h=this.selection=i.get("selection"),g=this.library=i.get("library");this._views={};this.primary=new f.view.PriorityList();this.secondary=new f.view.PriorityList();this.primary.$el.addClass("media-toolbar-primary");this.secondary.$el.addClass("media-toolbar-secondary");this.views.set([this.secondary,this.primary]);if(this.options.items){this.set(this.options.items,{silent:true})}if(!this.options.silent){this.render()}if(h){h.on("add remove reset",this.refresh,this)}if(g){g.on("add remove reset",this.refresh,this)}},dispose:function(){if(this.selection){this.selection.off(null,null,this)}if(this.library){this.library.off(null,null,this)}return f.View.prototype.dispose.apply(this,arguments)},ready:function(){this.refresh()},set:function(j,g,h){var i;h=h||{};if(_.isObject(j)){_.each(j,function(k,l){this.set(l,k,{silent:true})},this)}else{if(!(g instanceof Backbone.View)){g.classes=["media-button-"+j].concat(g.classes||[]);g=new f.view.Button(g).render()}g.controller=g.controller||this.controller;this._views[j]=g;i=g.options.priority<0?"secondary":"primary";this[i].set(j,g,h)}if(!h.silent){this.refresh()}return this},get:function(g){return this._views[g]},unset:function(h,g){delete this._views[h];this.primary.unset(h,g);this.secondary.unset(h,g);if(!g||!g.silent){this.refresh()}return this},refresh:function(){var i=this.controller.state(),g=i.get("library"),h=i.get("selection");_.each(this._views,function(j){if(!j.model||!j.options||!j.options.requires){return}var l=j.options.requires,k=false;if(l.selection&&h&&!h.length){k=true}else{if(l.library&&g&&!g.length){k=true}}j.model.set("disabled",k)})}});f.view.Toolbar.Select=f.view.Toolbar.extend({initialize:function(){var h=this.options,g=h.controller,i=g.state().get("selection");_.bindAll(this,"clickSelect");_.defaults(h,{event:"select",state:false,reset:true,close:true,text:b.select,requires:{selection:true}});h.items=_.defaults(h.items||{},{select:{style:"primary",text:h.text,priority:80,click:this.clickSelect,requires:h.requires}});f.view.Toolbar.prototype.initialize.apply(this,arguments)},clickSelect:function(){var h=this.options,g=this.controller;if(h.close){g.close()}if(h.event){g.state().trigger(h.event)}if(h.reset){g.reset()}if(h.state){g.setState(h.state)}}});f.view.Toolbar.Embed=f.view.Toolbar.Select.extend({initialize:function(){_.defaults(this.options,{text:b.insertIntoPost,requires:false});f.view.Toolbar.Select.prototype.initialize.apply(this,arguments)},refresh:function(){var g=this.controller.state().props.get("url");this.get("select").model.set("disabled",!g||g==="http://");f.view.Toolbar.Select.prototype.refresh.apply(this,arguments)}});f.view.Button=f.View.extend({tagName:"a",className:"media-button",attributes:{href:"#"},events:{click:"click"},defaults:{text:"",style:"",size:"large",disabled:false},initialize:function(){this.model=new Backbone.Model(this.defaults);_.each(this.defaults,function(i,g){var h=this.options[g];if(_.isUndefined(h)){return}this.model.set(g,h);delete this.options[g]},this);this.model.on("change",this.render,this)},render:function(){var h=["button",this.className],g=this.model.toJSON();if(g.style){h.push("button-"+g.style)}if(g.size){h.push("button-"+g.size)}h=_.uniq(h.concat(this.options.classes));this.el.className=h.join(" ");this.$el.attr("disabled",g.disabled);this.$el.text(this.model.get("text"));return this},click:function(g){if("#"===this.attributes.href){g.preventDefault()}if(this.options.click&&!this.model.get("disabled")){this.options.click.apply(this,arguments)}}});f.view.ButtonGroup=f.View.extend({tagName:"div",className:"button-group button-large media-button-group",initialize:function(){this.buttons=_.map(this.options.buttons||[],function(g){if(g instanceof Backbone.View){return g}else{return new f.view.Button(g).render()}});delete this.options.buttons;if(this.options.classes){this.$el.addClass(this.options.classes)}},render:function(){this.$el.html(e(_.pluck(this.buttons,"el")).detach());return this}});f.view.PriorityList=f.View.extend({tagName:"div",initialize:function(){this._views={};this.set(_.extend({},this._views,this.options.views),{silent:true});delete this.options.views;if(!this.options.silent){this.render()}},set:function(l,h,j){var k,g,i;j=j||{};if(_.isObject(l)){_.each(l,function(m,n){this.set(n,m)},this);return this}if(!(h instanceof Backbone.View)){h=this.toView(h,l,j)}h.controller=h.controller||this.controller;this.unset(l);k=h.options.priority||10;g=this.views.get()||[];_.find(g,function(n,m){if(n.options.priority>k){i=m;return true}});this._views[l]=h;this.views.add(h,{at:_.isNumber(i)?i:g.length||0});return this},get:function(g){return this._views[g]},unset:function(h){var g=this.get(h);if(g){g.remove()}delete this._views[h];return this},toView:function(g){return new f.View(g)}});f.view.MenuItem=f.View.extend({tagName:"a",className:"media-menu-item",attributes:{href:"#"},events:{click:"_click"},_click:function(g){var h=this.options.click;if(g){g.preventDefault()}if(h){h.call(this)}else{this.click()}},click:function(){var g=this.options.state;if(g){this.controller.setState(g)}},render:function(){var g=this.options;if(g.text){this.$el.text(g.text)}else{if(g.html){this.$el.html(g.html)}}return this}});f.view.Menu=f.view.PriorityList.extend({tagName:"div",className:"media-menu",property:"state",ItemView:f.view.MenuItem,region:"menu",toView:function(g,h){g=g||{};g[this.property]=g[this.property]||h;return new this.ItemView(g).render()},ready:function(){f.view.PriorityList.prototype.ready.apply(this,arguments);this.visibility()},set:function(){f.view.PriorityList.prototype.set.apply(this,arguments);this.visibility()},unset:function(){f.view.PriorityList.prototype.unset.apply(this,arguments);this.visibility()},visibility:function(){var j=this.region,h=this.controller[j].get(),g=this.views.get(),i=!g||g.length<2;if(this===h){this.controller.$el.toggleClass("hide-"+j,i)}},select:function(h){var g=this.get(h);if(!g){return}this.deselect();g.$el.addClass("active")},deselect:function(){this.$el.children().removeClass("active")}});f.view.RouterItem=f.view.MenuItem.extend({click:function(){var g=this.options.contentMode;if(g){this.controller.content.mode(g)}}});f.view.Router=f.view.Menu.extend({tagName:"div",className:"media-router",property:"contentMode",ItemView:f.view.RouterItem,region:"router",initialize:function(){this.controller.on("content:render",this.update,this);f.view.Menu.prototype.initialize.apply(this,arguments)},update:function(){var g=this.controller.content.mode();if(g){this.select(g)}}});f.view.Sidebar=f.view.PriorityList.extend({className:"media-sidebar"});f.view.Attachment=f.View.extend({tagName:"li",className:"attachment",template:f.template("attachment"),events:{"click .attachment-preview":"toggleSelectionHandler","change [data-setting]":"updateSetting","change [data-setting] input":"updateSetting","change [data-setting] select":"updateSetting","change [data-setting] textarea":"updateSetting","click .close":"removeFromLibrary","click .check":"removeFromSelection","click a":"preventDefault"},buttons:{},initialize:function(){var g=this.options.selection;this.model.on("change:sizes change:uploading",this.render,this);this.model.on("change:title",this._syncTitle,this);this.model.on("change:caption",this._syncCaption,this);this.model.on("change:percent",this.progress,this);this.model.on("add",this.select,this);this.model.on("remove",this.deselect,this);if(g){g.on("reset",this.updateSelect,this)}this.model.on("selection:single selection:unsingle",this.details,this);this.details(this.model,this.controller.state().get("selection"))},dispose:function(){var g=this.options.selection;this.updateAll();if(g){g.off(null,null,this)}f.View.prototype.dispose.apply(this,arguments);return this},render:function(){var g=_.defaults(this.model.toJSON(),{orientation:"landscape",uploading:false,type:"",subtype:"",icon:"",filename:"",caption:"",title:"",dateFormatted:"",width:"",height:"",compat:false,alt:"",description:""});g.buttons=this.buttons;g.describe=this.controller.state().get("describe");if("image"===g.type){g.size=this.imageSize()}g.can={};if(g.nonces){g.can.remove=!!g.nonces["delete"];g.can.save=!!g.nonces.update}if(this.controller.state().get("allowLocalEdits")){g.allowLocalEdits=true}this.views.detach();this.$el.html(this.template(g));this.$el.toggleClass("uploading",g.uploading);if(g.uploading){this.$bar=this.$(".media-progress-bar div")}else{delete this.$bar}this.updateSelect();this.updateSave();this.views.render();return this},progress:function(){if(this.$bar&&this.$bar.length){this.$bar.width(this.model.get("percent")+"%")}},toggleSelectionHandler:function(g){var h;if(g.shiftKey){h="between"}else{if(g.ctrlKey||g.metaKey){h="toggle"}}this.toggleSelection({method:h})},toggleSelection:function(p){var k=this.collection,l=this.options.selection,j=this.model,g=p&&p.method,m,n,h,i,o;if(!l){return}m=l.single();g=_.isUndefined(g)?l.multiple:g;if("between"===g&&m&&l.multiple){if(m===j){return}i=k.indexOf(m);o=k.indexOf(this.model);if(i<o){h=k.models.slice(i,o+1)}else{h=k.models.slice(o,i+1)}l.add(h).single(j);return}else{if("toggle"===g){l[this.selected()?"remove":"add"](j).single(j);return}}if(g!=="add"){g="reset"}if(this.selected()){l[m===j?"remove":"single"](j)}else{l[g](j).single(j)}},updateSelect:function(){this[this.selected()?"select":"deselect"]()},selected:function(){var g=this.options.selection;if(g){return !!g.getByCid(this.model.cid)}},select:function(g,i){var h=this.options.selection;if(!h||(i&&i!==h)){return}this.$el.addClass("selected")},deselect:function(g,i){var h=this.options.selection;if(!h||(i&&i!==h)){return}this.$el.removeClass("selected")},details:function(g,j){var i=this.options.selection,h;if(i!==j){return}h=i.single();this.$el.toggleClass("details",h===this.model)},preventDefault:function(g){g.preventDefault()},imageSize:function(g){var h=this.model.get("sizes");g=g||"medium";if(h&&h[g]){return _.clone(h[g])}else{return{url:this.model.get("url"),width:this.model.get("width"),height:this.model.get("height"),orientation:this.model.get("orientation")}}},updateSetting:function(i){var g=e(i.target).closest("[data-setting]"),h,j;if(!g.length){return}h=g.data("setting");j=i.target.value;if(this.model.get(h)!==j){this.save(h,j)}},save:function(){var g=this,i=this._save=this._save||{status:"ready"},h=this.model.save.apply(this.model,arguments),j=i.requests?e.when(h,i.requests):h;if(i.savedTimer){clearTimeout(i.savedTimer)}this.updateSave("waiting");i.requests=j;j.always(function(){if(i.requests!==j){return}g.updateSave(j.state()==="resolved"?"complete":"error");i.savedTimer=setTimeout(function(){g.updateSave("ready");delete i.savedTimer},2000)})},updateSave:function(g){var h=this._save=this._save||{status:"ready"};if(g&&g!==h.status){this.$el.removeClass("save-"+h.status);h.status=g}this.$el.addClass("save-"+h.status);return this},updateAll:function(){var h=this.$("[data-setting]"),g=this.model,i;i=_.chain(h).map(function(k){var m=e("input, textarea, select, [value]",k),j,l;if(!m.length){return}j=e(k).data("setting");l=m.val();if(g.get(j)!==l){return[j,l]}}).compact().object().value();if(!_.isEmpty(i)){g.save(i)}},removeFromLibrary:function(g){g.stopPropagation();this.collection.remove(this.model)},removeFromSelection:function(h){var g=this.options.selection;if(!g){return}h.stopPropagation();g.remove(this.model)}});_.each({caption:"_syncCaption",title:"_syncTitle"},function(h,g){f.view.Attachment.prototype[h]=function(i,k){var j=this.$('[data-setting="'+g+'"]');if(!j.length){return this}if(k===j.find("input, textarea, select, [value]").val()){return this}return this.render()}});f.view.Attachment.Library=f.view.Attachment.extend({buttons:{check:true}});f.view.Attachment.EditLibrary=f.view.Attachment.extend({buttons:{close:true}});f.view.Attachments=f.View.extend({tagName:"ul",className:"attachments",cssTemplate:f.template("attachments-css"),events:{scroll:"scroll"},initialize:function(){this.el.id=_.uniqueId("__attachments-view-");_.defaults(this.options,{refreshSensitivity:200,refreshThreshold:3,AttachmentView:f.view.Attachment,sortable:false,resize:true});this._viewsByCid={};this.collection.on("add",function(i,g,h){this.views.add(this.createAttachmentView(i),{at:h.index})},this);this.collection.on("remove",function(j,g,i){var h=this._viewsByCid[j.cid];delete this._viewsByCid[j.cid];if(h){h.remove()}},this);this.collection.on("reset",this.render,this);this.scroll=_.chain(this.scroll).bind(this).throttle(this.options.refreshSensitivity).value();this.initSortable();_.bindAll(this,"css");this.model.on("change:edge change:gutter",this.css,this);this._resizeCss=_.debounce(_.bind(this.css,this),this.refreshSensitivity);if(this.options.resize){e(window).on("resize.attachments",this._resizeCss)}this.css()},dispose:function(){this.collection.props.off(null,null,this);e(window).off("resize.attachments",this._resizeCss);f.View.prototype.dispose.apply(this,arguments)},css:function(){var g=e("#"+this.el.id+"-css");if(g.length){g.remove()}f.view.Attachments.$head().append(this.cssTemplate({id:this.el.id,edge:this.edge(),gutter:this.model.get("gutter")}))},edge:function(){var i=this.model.get("edge"),j,h,g;if(!this.$el.is(":visible")){return i}j=this.model.get("gutter")*2;h=this.$el.width()-j;g=Math.ceil(h/(i+j));i=Math.floor((h-(g*j))/g);return i},initSortable:function(){var g=this.collection;if(!this.options.sortable||!e.fn.sortable){return}this.$el.sortable(_.extend({disabled:!!g.comparator,containment:this.$el,tolerance:"pointer",start:function(h,i){i.item.data("sortableIndexStart",i.item.index())},update:function(j,k){var i=g.at(k.item.data("sortableIndexStart")),h=g.comparator;delete g.comparator;g.remove(i,{silent:true}).add(i,{silent:true,at:k.item.index()});g.comparator=h;g.trigger("reset",g);g.saveMenuOrder()}},this.options.sortable));g.props.on("change:orderby",function(){this.$el.sortable("option","disabled",!!g.comparator)},this);this.collection.props.on("change:orderby",this.refreshSortable,this);this.refreshSortable()},refreshSortable:function(){if(!this.options.sortable||!e.fn.sortable){return}var i=this.collection,h=i.props.get("orderby"),g="menuOrder"===h||!i.comparator;this.$el.sortable("option","disabled",!g)},createAttachmentView:function(h){var g=new this.options.AttachmentView({controller:this.controller,model:h,collection:this.collection,selection:this.options.selection});return this._viewsByCid[h.cid]=g},prepare:function(){if(this.collection.length){this.views.set(this.collection.map(this.createAttachmentView,this))}else{this.views.unset();this.collection.more().done(this.scroll)}},ready:function(){this.scroll()},scroll:function(g){if(!this.$el.is(":visible")){return}if(this.collection.hasMore()&&this.el.scrollHeight<this.el.scrollTop+(this.el.clientHeight*this.options.refreshThreshold)){this.collection.more().done(this.scroll)}}},{$head:(function(){var g;return function(){return g=g||e("head")}}())});f.view.Search=f.View.extend({tagName:"input",className:"search",attributes:{type:"search",placeholder:b.search},events:{input:"search",keyup:"search",change:"search",search:"search"},render:function(){this.el.value=this.model.escape("search");return this},search:function(g){if(g.target.value){this.model.set("search",g.target.value)}else{this.model.unset("search")}}});f.view.AttachmentFilters=f.View.extend({tagName:"select",className:"attachment-filters",events:{change:"change"},keys:[],initialize:function(){this.createFilters();_.extend(this.filters,this.options.filters);this.$el.html(_.chain(this.filters).map(function(g,h){return{el:this.make("option",{value:h},g.text),priority:g.priority||50}},this).sortBy("priority").pluck("el").value());this.model.on("change",this.select,this);this.select()},createFilters:function(){this.filters={}},change:function(h){var g=this.filters[this.el.value];if(g){this.model.set(g.props)}},select:function(){var g=this.model,i="all",h=g.toJSON();_.find(this.filters,function(k,l){var j=_.all(k.props,function(n,m){return n===(_.isUndefined(h[m])?null:h[m])});if(j){return i=l}});this.$el.val(i)}});f.view.AttachmentFilters.Uploaded=f.view.AttachmentFilters.extend({createFilters:function(){var h=this.model.get("type"),g=f.view.settings.mimeTypes,i;if(g&&h){i=g[h]}this.filters={all:{text:i||b.allMediaItems,props:{uploadedTo:null,orderby:"date",order:"DESC"},priority:10},uploaded:{text:b.uploadedToThisPost,props:{uploadedTo:f.view.settings.post.id,orderby:"menuOrder",order:"ASC"},priority:20}}}});f.view.AttachmentFilters.All=f.view.AttachmentFilters.extend({createFilters:function(){var g={};_.each(f.view.settings.mimeTypes||{},function(i,h){g[h]={text:i,props:{type:h,uploadedTo:null,orderby:"date",order:"DESC"}}});g.all={text:b.allMediaItems,props:{type:null,uploadedTo:null,orderby:"date",order:"DESC"},priority:10};g.uploaded={text:b.uploadedToThisPost,props:{type:null,uploadedTo:f.view.settings.post.id,orderby:"menuOrder",order:"ASC"},priority:20};this.filters=g}});f.view.AttachmentsBrowser=f.View.extend({tagName:"div",className:"attachments-browser",initialize:function(){_.defaults(this.options,{filters:false,search:true,display:false,AttachmentView:f.view.Attachment.Library});this.createToolbar();this.updateContent();this.createSidebar();this.collection.on("add remove reset",this.updateContent,this)},dispose:function(){this.options.selection.off(null,null,this);f.View.prototype.dispose.apply(this,arguments);return this},createToolbar:function(){var h,g;this.toolbar=new f.view.Toolbar({controller:this.controller});this.views.add(this.toolbar);h=this.options.filters;if("uploaded"===h){g=f.view.AttachmentFilters.Uploaded}else{if("all"===h){g=f.view.AttachmentFilters.All}}if(g){this.toolbar.set("filters",new g({controller:this.controller,model:this.collection.props,priority:-80}).render())}if(this.options.search){this.toolbar.set("search",new f.view.Search({controller:this.controller,model:this.collection.props,priority:60}).render())}if(this.options.dragInfo){this.toolbar.set("dragInfo",new f.View({el:e('<div class="instructions">'+b.dragInfo+"</div>")[0],priority:-40}))}},updateContent:function(){var g=this;if(!this.attachments){this.createAttachments()}if(!this.collection.length){this.collection.more().done(function(){if(!g.collection.length){g.createUploader()}})}},removeContent:function(){_.each(["attachments","uploader"],function(g){if(this[g]){this[g].remove();delete this[g]}},this)},createUploader:function(){this.removeContent();this.uploader=new f.view.UploaderInline({controller:this.controller,status:false,message:b.noItemsFound});this.views.add(this.uploader)},createAttachments:function(){this.removeContent();this.attachments=new f.view.Attachments({controller:this.controller,collection:this.collection,selection:this.options.selection,model:this.model,sortable:this.options.sortable,AttachmentView:this.options.AttachmentView});this.views.add(this.attachments)},createSidebar:function(){var g=this.options,h=g.selection,i=this.sidebar=new f.view.Sidebar({controller:this.controller});this.views.add(i);if(this.controller.uploader){i.set("uploads",new f.view.UploaderStatus({controller:this.controller,priority:40}))}h.on("selection:single",this.createSingle,this);h.on("selection:unsingle",this.disposeSingle,this);if(h.single()){this.createSingle()}},createSingle:function(){var h=this.sidebar,i=this.options.selection.single(),g={};h.set("details",new f.view.Attachment.Details({controller:this.controller,model:i,priority:80}));h.set("compat",new f.view.AttachmentCompat({controller:this.controller,model:i,priority:120}));if(this.options.display){h.set("display",new f.view.Settings.AttachmentDisplay({controller:this.controller,model:this.model.display(i),attachment:i,priority:160,userSettings:this.model.get("displayUserSettings")}))}},disposeSingle:function(){var g=this.sidebar;g.unset("details");g.unset("compat");g.unset("display")}});f.view.Selection=f.View.extend({tagName:"div",className:"media-selection",template:f.template("media-selection"),events:{"click .edit-selection":"edit","click .clear-selection":"clear"},initialize:function(){_.defaults(this.options,{editable:false,clearable:true});this.attachments=new f.view.Attachments.Selection({controller:this.controller,collection:this.collection,selection:this.collection,model:new Backbone.Model({edge:40,gutter:5})});this.views.set(".selection-view",this.attachments);this.collection.on("add remove reset",this.refresh,this);this.controller.on("content:activate",this.refresh,this)},ready:function(){this.refresh()},refresh:function(){if(!this.$el.children().length){return}var h=this.collection,g="edit-selection"===this.controller.content.mode();this.$el.toggleClass("empty",!h.length);this.$el.toggleClass("one",1===h.length);this.$el.toggleClass("editing",g);this.$(".count").text(b.selected.replace("%d",h.length))},edit:function(g){g.preventDefault();if(this.options.editable){this.options.editable.call(this,this.collection)}},clear:function(g){g.preventDefault();this.collection.reset()}});f.view.Attachment.Selection=f.view.Attachment.extend({className:"attachment selection",toggleSelection:function(){this.options.selection.single(this.model)}});f.view.Attachments.Selection=f.view.Attachments.extend({events:{},initialize:function(){_.defaults(this.options,{sortable:true,resize:false,AttachmentView:f.view.Attachment.Selection});return f.view.Attachments.prototype.initialize.apply(this,arguments)}});f.view.Attachment.EditSelection=f.view.Attachment.Selection.extend({buttons:{close:true}});f.view.Settings=f.View.extend({events:{"click button":"updateHandler","change input":"updateHandler","change select":"updateHandler","change textarea":"updateHandler"},initialize:function(){this.model=this.model||new Backbone.Model();this.model.on("change",this.updateChanges,this)},prepare:function(){return _.defaults({model:this.model.toJSON()},this.options)},render:function(){f.View.prototype.render.apply(this,arguments);_(this.model.attributes).chain().keys().each(this.update,this);return this},update:function(j){var k=this.model.get(j),i=this.$('[data-setting="'+j+'"]'),g,h;if(!i.length){return}if(i.is("select")){h=i.find('[value="'+k+'"]');if(h.length){i.find("option").prop("selected",false);h.prop("selected",true)}else{this.model.set(j,i.find(":selected").val())}}else{if(i.hasClass("button-group")){g=i.find("button").removeClass("active");g.filter('[value="'+k+'"]').addClass("active")}else{if(i.is('input[type="text"], textarea')){if(!i.is(":focus")){i.val(k)}}else{if(i.is('input[type="checkbox"]')){i.attr("checked",!!k)}}}}},updateHandler:function(i){var h=e(i.target).closest("[data-setting]"),j=i.target.value,g;i.preventDefault();if(!h.length){return}if(h.is('input[type="checkbox"]')){j=h[0].checked}this.model.set(h.data("setting"),j);if(g=h.data("userSetting")){setUserSetting(g,j)}},updateChanges:function(h,g){if(g.changes){_(g.changes).chain().keys().each(this.update,this)}}});f.view.Settings.AttachmentDisplay=f.view.Settings.extend({className:"attachment-display-settings",template:f.template("attachment-display-settings"),initialize:function(){var g=this.options.attachment;_.defaults(this.options,{userSettings:false});f.view.Settings.prototype.initialize.apply(this,arguments);this.model.on("change:link",this.updateLinkTo,this);if(g){g.on("change:uploading",this.render,this)}},dispose:function(){var g=this.options.attachment;if(g){g.off(null,null,this)}f.view.Settings.prototype.dispose.apply(this,arguments)},render:function(){var g=this.options.attachment;if(g){_.extend(this.options,{sizes:g.get("sizes"),type:g.get("type")})}f.view.Settings.prototype.render.call(this);this.updateLinkTo();return this},updateLinkTo:function(){var h=this.model.get("link"),i=this.$(".link-to-custom"),g=this.options.attachment;if("none"===h||(!g&&"custom"!==h)){i.hide();return}if(g){if("post"===h){i.val(g.get("link"))}else{if("file"===h){i.val(g.get("url"))}else{if(!this.model.get("linkUrl")){i.val("http://")}}}i.prop("readonly","custom"!==h)}i.show();if(i.is(":visible")){i.focus()[0].select()}}});f.view.Settings.Gallery=f.view.Settings.extend({className:"gallery-settings",template:f.template("gallery-settings")});f.view.Attachment.Details=f.view.Attachment.extend({tagName:"div",className:"attachment-details",template:f.template("attachment-details"),events:{"change [data-setting]":"updateSetting","change [data-setting] input":"updateSetting","change [data-setting] select":"updateSetting","change [data-setting] textarea":"updateSetting","click .delete-attachment":"deleteAttachment","click .edit-attachment":"editAttachment","click .refresh-attachment":"refreshAttachment"},initialize:function(){this.focusManager=new f.view.FocusManager({el:this.el});f.view.Attachment.prototype.initialize.apply(this,arguments)},render:function(){f.view.Attachment.prototype.render.apply(this,arguments);this.focusManager.focus();return this},deleteAttachment:function(g){g.preventDefault();if(confirm(b.warnDelete)){this.model.destroy()}},editAttachment:function(g){this.$el.addClass("needs-refresh")},refreshAttachment:function(g){this.$el.removeClass("needs-refresh");g.preventDefault();this.model.fetch()}});f.view.AttachmentCompat=f.View.extend({tagName:"form",className:"compat-item",events:{submit:"preventDefault","change input":"save","change select":"save","change textarea":"save"},initialize:function(){this.focusManager=new f.view.FocusManager({el:this.el});this.model.on("change:compat",this.render,this)},dispose:function(){if(this.$(":focus").length){this.save()}return f.View.prototype.dispose.apply(this,arguments)},render:function(){var g=this.model.get("compat");if(!g||!g.item){return}this.views.detach();this.$el.html(g.item);this.views.render();this.focusManager.focus();return this},preventDefault:function(g){g.preventDefault()},save:function(g){var h={};if(g){g.preventDefault()}_.each(this.$el.serializeArray(),function(i){h[i.name]=i.value});this.model.saveCompat(h)}});f.view.Iframe=f.View.extend({className:"media-iframe",render:function(){this.views.detach();this.$el.html('<iframe src="'+this.controller.state().get("src")+'" />');this.views.render();return this}});f.view.Embed=f.View.extend({className:"media-embed",initialize:function(){this.url=new f.view.EmbedUrl({controller:this.controller,model:this.model.props}).render();this.views.set([this.url]);this.refresh();this.model.on("change:type",this.refresh,this);this.model.on("change:loading",this.loading,this)},settings:function(g){if(this._settings){this._settings.remove()}this._settings=g;this.views.add(g)},refresh:function(){var h=this.model.get("type"),g;if("image"===h){g=f.view.EmbedImage}else{if("link"===h){g=f.view.EmbedLink}else{return}}this.settings(new g({controller:this.controller,model:this.model.props,priority:40}))},loading:function(){this.$el.toggleClass("embed-loading",this.model.get("loading"))}});f.view.EmbedUrl=f.View.extend({tagName:"label",className:"embed-url",events:{input:"url",keyup:"url",change:"url"},initialize:function(){this.input=this.make("input",{type:"text",value:this.model.get("url")||""});this.spinner=this.make("span",{"class":"spinner"});this.$input=e(this.input);this.$el.append([this.input,this.spinner]);this.model.on("change:url",this.render,this)},render:function(){var g=this.$input;if(g.is(":focus")){return}this.input.value=this.model.get("url")||"http://";f.View.prototype.render.apply(this,arguments);return this},ready:function(){this.focus()},url:function(g){this.model.set("url",g.target.value)},focus:function(){var g=this.$input;if(g.is(":visible")){g.focus()[0].select()}}});f.view.EmbedLink=f.view.Settings.extend({className:"embed-link-settings",template:f.template("embed-link-settings")});f.view.EmbedImage=f.view.Settings.AttachmentDisplay.extend({className:"embed-image-settings",template:f.template("embed-image-settings"),initialize:function(){f.view.Settings.AttachmentDisplay.prototype.initialize.apply(this,arguments);this.model.on("change:url",this.updateImage,this)},updateImage:function(){this.$("img").attr("src",this.model.get("url"))}})}(jQuery));
\ No newline at end of file
+(function(e){var f=wp.media,d=f.model.Attachment,c=f.model.Attachments,a=f.model.Query,b;b=f.view.l10n=typeof _wpMediaViewsL10n==="undefined"?{}:_wpMediaViewsL10n;f.view.settings=b.settings||{};delete b.settings;f.model.settings.post=f.view.settings.post;e.support.transition=(function(){var g=document.documentElement.style,h={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},i;i=_.find(_.keys(h),function(j){return !_.isUndefined(g[j])});return i&&{end:h[i]}}());f.transition=function(g,h){var i=e.Deferred();h=h||2000;if(e.support.transition){if(!(g instanceof e)){g=e(g)}g.first().one(e.support.transition.end,i.resolve);_.delay(i.resolve,h)}else{i.resolve()}return i.promise()};f.controller.Region=function(g){_.extend(this,_.pick(g||{},"id","view","selector"))};f.controller.Region.extend=Backbone.Model.extend;_.extend(f.controller.Region.prototype,{mode:function(g){if(!g){return this._mode}if(g===this._mode){return this}this.trigger("deactivate");this._mode=g;this.render(g);this.trigger("activate");return this},render:function(h){if(h&&h!==this._mode){return this.mode(h)}var i={view:null},g;this.trigger("create",i);g=i.view;this.trigger("render",g);if(g){this.set(g)}return this},get:function(){return this.view.views.first(this.selector)},set:function(g,h){if(h){h.add=false}return this.view.views.set(this.selector,g,h)},trigger:function(h){var i;if(!this._mode){return}var g=_.toArray(arguments);i=this.id+":"+h;g[0]=i+":"+this._mode;this.view.trigger.apply(this.view,g);g[0]=i;this.view.trigger.apply(this.view,g);return this}});f.controller.StateMachine=function(g){this.states=new Backbone.Collection(g)};f.controller.StateMachine.extend=Backbone.Model.extend;_.extend(f.controller.StateMachine.prototype,Backbone.Events,{state:function(g){this.states=this.states||new Backbone.Collection();g=g||this._state;if(g&&!this.states.get(g)){this.states.add({id:g})}return this.states.get(g)},setState:function(h){var g=this.state();if((g&&h===g.id)||!this.states||!this.states.get(h)){return this}if(g){g.trigger("deactivate");this._lastState=g.id}this._state=h;this.state().trigger("activate");return this},lastState:function(){if(this._lastState){return this.state(this._lastState)}}});_.each(["on","off","trigger"],function(g){f.controller.StateMachine.prototype[g]=function(){this.states=this.states||new Backbone.Collection();this.states[g].apply(this.states,arguments);return this}});f.controller.State=Backbone.Model.extend({constructor:function(){this.on("activate",this._preActivate,this);this.on("activate",this.activate,this);this.on("activate",this._postActivate,this);this.on("deactivate",this._deactivate,this);this.on("deactivate",this.deactivate,this);this.on("reset",this.reset,this);this.on("ready",this._ready,this);this.on("ready",this.ready,this);Backbone.Model.apply(this,arguments);this.on("change:menu",this._updateMenu,this)},ready:function(){},activate:function(){},deactivate:function(){},reset:function(){},_ready:function(){this._updateMenu()},_preActivate:function(){this.active=true},_postActivate:function(){this.on("change:menu",this._menu,this);this.on("change:titleMode",this._title,this);this.on("change:content",this._content,this);this.on("change:toolbar",this._toolbar,this);this.frame.on("title:render:default",this._renderTitle,this);this._title();this._menu();this._toolbar();this._content();this._router()},_deactivate:function(){this.active=false;this.frame.off("title:render:default",this._renderTitle,this);this.off("change:menu",this._menu,this);this.off("change:titleMode",this._title,this);this.off("change:content",this._content,this);this.off("change:toolbar",this._toolbar,this)},_title:function(){this.frame.title.render(this.get("titleMode")||"default")},_renderTitle:function(g){g.$el.text(this.get("title")||"")},_router:function(){var h=this.frame.router,i=this.get("router"),g;this.frame.$el.toggleClass("hide-router",!i);if(!i){return}this.frame.router.render(i);g=h.get();if(g&&g.select){g.select(this.frame.content.mode())}},_menu:function(){var i=this.frame.menu,h=this.get("menu"),g;if(!h){return}i.mode(h);g=i.get();if(g&&g.select){g.select(this.id)}},_updateMenu:function(){var g=this.previous("menu"),h=this.get("menu");if(g){this.frame.off("menu:render:"+g,this._renderMenu,this)}if(h){this.frame.on("menu:render:"+h,this._renderMenu,this)}},_renderMenu:function(g){var i=this.get("menuItem"),j=this.get("title"),h=this.get("priority");if(!i&&j){i={text:j};if(h){i.priority=h}}if(!i){return}g.set(this.id,i)}});_.each(["toolbar","content"],function(g){f.controller.State.prototype["_"+g]=function(){var h=this.get(g);if(h){this.frame[g].render(h)}}});f.controller.Library=f.controller.State.extend({defaults:{id:"library",multiple:false,describe:false,toolbar:"select",sidebar:"settings",content:"upload",router:"browse",menu:"default",searchable:true,filterable:false,sortable:true,title:b.mediaLibraryTitle,contentUserSetting:true,syncSelection:true},initialize:function(){var h=this.get("selection"),g;if(!this.get("library")){this.set("library",f.query())}if(!(h instanceof f.model.Selection)){g=h;if(!g){g=this.get("library").props.toJSON();g=_.omit(g,"orderby","query")}this.set("selection",new f.model.Selection(null,{multiple:this.get("multiple"),props:g}))}if(!this.get("edge")){this.set("edge",120)}if(!this.get("gutter")){this.set("gutter",8)}this.resetDisplays()},activate:function(){this.syncSelection();wp.Uploader.queue.on("add",this.uploading,this);this.get("selection").on("add remove reset",this.refreshContent,this);if(this.get("contentUserSetting")){this.frame.on("content:activate",this.saveContentMode,this);this.set("content",getUserSetting("libraryContent",this.get("content")))}},deactivate:function(){this.recordSelection();this.frame.off("content:activate",this.saveContentMode,this);this.get("selection").off(null,null,this);wp.Uploader.queue.off(null,null,this)},reset:function(){this.get("selection").reset();this.resetDisplays();this.refreshContent()},resetDisplays:function(){var g=f.view.settings.defaultProps;this._displays=[];this._defaultDisplaySettings={align:g.align||getUserSetting("align","none"),size:g.size||getUserSetting("imgsize","medium"),link:g.link||getUserSetting("urlbutton","file")}},display:function(h){var g=this._displays;if(!g[h.cid]){g[h.cid]=new Backbone.Model(this.defaultDisplaySettings(h))}return g[h.cid]},defaultDisplaySettings:function(g){settings=this._defaultDisplaySettings;if(settings.canEmbed=this.canEmbed(g)){settings.link="embed"}return settings},canEmbed:function(h){if(!h.get("uploading")){var g=h.get("type");if(g!=="audio"&&g!=="video"){return false}}return _.contains(f.view.settings.embedExts,h.get("filename").split(".").pop())},syncSelection:function(){var h=this.get("selection"),g=this.frame._selection;if(!this.get("syncSelection")||!g||!h){return}if(h.multiple){h.reset([],{silent:true});h.validateAll(g.attachments);g.difference=_.difference(g.attachments.models,h.models)}h.single(g.single)},recordSelection:function(){var i=this.get("selection"),h=this.frame._selection,g;if(!this.get("syncSelection")||!h||!i){return}if(i.multiple){h.attachments.reset(i.toArray().concat(h.difference));h.difference=[]}else{h.attachments.add(i.toArray())}h.single=i._single},refreshContent:function(){var h=this.get("selection"),j=this.frame,g=j.router.get(),i=j.content.mode();if(this.active&&!h.length&&g&&!g.get(i)){this.frame.content.render(this.get("content"))}},uploading:function(h){var g=this.frame.content;if("upload"===g.mode()){this.frame.content.mode("browse")}this.get("selection").add(h)},saveContentMode:function(){if("browse"!==this.get("router")){return}var h=this.frame.content.mode(),g=this.frame.router.get();if(g&&g.get(h)){setUserSetting("libraryContent",h)}}});f.controller.GalleryEdit=f.controller.Library.extend({defaults:{id:"gallery-edit",multiple:false,describe:true,edge:199,editing:false,sortable:true,searchable:false,toolbar:"gallery-edit",content:"browse",title:b.editGalleryTitle,priority:60,dragInfo:true,syncSelection:false},initialize:function(){if(!this.get("library")){this.set("library",new f.model.Selection())}if(!this.get("AttachmentView")){this.set("AttachmentView",f.view.Attachment.EditLibrary)}f.controller.Library.prototype.initialize.apply(this,arguments)},activate:function(){var g=this.get("library");g.props.set("type","image");this.get("library").observe(wp.Uploader.queue);this.frame.on("content:render:browse",this.gallerySettings,this);f.controller.Library.prototype.activate.apply(this,arguments)},deactivate:function(){this.get("library").unobserve(wp.Uploader.queue);this.frame.off("content:render:browse",this.gallerySettings,this);f.controller.Library.prototype.deactivate.apply(this,arguments)},gallerySettings:function(h){var g=this.get("library");if(!g||!h){return}g.gallery=g.gallery||new Backbone.Model();h.sidebar.set({gallery:new f.view.Settings.Gallery({controller:this,model:g.gallery,priority:40})});h.toolbar.set("reverse",{text:b.reverseOrder,priority:80,click:function(){g.reset(g.toArray().reverse())}})}});f.controller.GalleryAdd=f.controller.Library.extend({defaults:_.defaults({id:"gallery-library",filterable:"uploaded",multiple:"add",menu:"gallery",toolbar:"gallery-add",title:b.addToGalleryTitle,priority:100,syncSelection:false},f.controller.Library.prototype.defaults),initialize:function(){if(!this.get("library")){this.set("library",f.query({type:"image"}))}f.controller.Library.prototype.initialize.apply(this,arguments)},activate:function(){var g=this.get("library"),h=this.frame.state("gallery-edit").get("library");if(this.editLibrary&&this.editLibrary!==h){g.unobserve(this.editLibrary)}g.validator=function(i){return !!this.mirroring.get(i.cid)&&!h.get(i.cid)&&f.model.Selection.prototype.validator.apply(this,arguments)};g.reset(g.mirroring.models,{silent:true});g.observe(h);this.editLibrary=h;f.controller.Library.prototype.activate.apply(this,arguments)}});f.controller.FeaturedImage=f.controller.Library.extend({defaults:_.defaults({id:"featured-image",filterable:"uploaded",multiple:false,toolbar:"featured-image",title:b.setFeaturedImageTitle,priority:60,syncSelection:false},f.controller.Library.prototype.defaults),initialize:function(){var h,g;if(!this.get("library")){this.set("library",f.query({type:"image"}))}f.controller.Library.prototype.initialize.apply(this,arguments);h=this.get("library");g=h.comparator;h.comparator=function(j,i){var l=!!this.mirroring.get(j.cid),k=!!this.mirroring.get(i.cid);if(!l&&k){return -1}else{if(l&&!k){return 1}else{return g.apply(this,arguments)}}};h.observe(this.get("selection"))},activate:function(){this.updateSelection();this.frame.on("open",this.updateSelection,this);f.controller.Library.prototype.activate.apply(this,arguments)},deactivate:function(){this.frame.off("open",this.updateSelection,this);f.controller.Library.prototype.deactivate.apply(this,arguments)},updateSelection:function(){var g=this.get("selection"),i=f.view.settings.post.featuredImageId,h;if(""!==i&&-1!==i){h=d.get(i);h.fetch()}g.reset(h?[h]:[])}});f.controller.Embed=f.controller.State.extend({defaults:{id:"embed",url:"",menu:"default",content:"embed",toolbar:"main-embed",type:"link",title:b.insertFromUrlTitle,priority:120},sensitivity:200,initialize:function(){this.debouncedScan=_.debounce(_.bind(this.scan,this),this.sensitivity);this.props=new Backbone.Model({url:""});this.props.on("change:url",this.debouncedScan,this);this.props.on("change:url",this.refresh,this);this.on("scan",this.scanImage,this)},scan:function(){var h,i=this,g={type:"link",scanners:[]};if(this.props.get("url")){this.trigger("scan",g)}if(g.scanners.length){h=g.scanners=e.when.apply(e,g.scanners);h.always(function(){if(i.get("scanners")===h){i.set("loading",false)}})}else{g.scanners=null}g.loading=!!g.scanners;this.set(g)},scanImage:function(h){var l=this.frame,j=this,i=this.props.get("url"),k=new Image(),g=e.Deferred();h.scanners.push(g.promise());k.onload=function(){g.resolve();if(j!==l.state()||i!==j.props.get("url")){return}j.set({type:"image"});j.props.set({width:k.width,height:k.height})};k.onerror=g.reject;k.src=i},refresh:function(){this.frame.toolbar.get().refresh()},reset:function(){this.props.clear().set({url:""});if(this.active){this.refresh()}}});f.View=wp.Backbone.View.extend({constructor:function(g){if(g&&g.controller){this.controller=g.controller}wp.Backbone.View.apply(this,arguments)},dispose:function(){this.undelegateEvents();if(this.model&&this.model.off){this.model.off(null,null,this)}if(this.collection&&this.collection.off){this.collection.off(null,null,this)}if(this.controller&&this.controller.off){this.controller.off(null,null,this)}return this},remove:function(){this.dispose();return wp.Backbone.View.prototype.remove.apply(this,arguments)}});f.view.Frame=f.View.extend({initialize:function(){this._createRegions();this._createStates()},_createRegions:function(){this.regions=this.regions?this.regions.slice():[];_.each(this.regions,function(g){this[g]=new f.controller.Region({view:this,id:g,selector:".media-frame-"+g})},this)},_createStates:function(){this.states=new Backbone.Collection(null,{model:f.controller.State});this.states.on("add",function(g){g.frame=this;g.trigger("ready")},this);if(this.options.states){this.states.add(this.options.states)}},reset:function(){this.states.invoke("trigger","reset");return this}});_.extend(f.view.Frame.prototype,f.controller.StateMachine.prototype);f.view.MediaFrame=f.view.Frame.extend({className:"media-frame",template:f.template("media-frame"),regions:["menu","title","content","toolbar","router"],initialize:function(){f.view.Frame.prototype.initialize.apply(this,arguments);_.defaults(this.options,{title:"",modal:true,uploader:true});this.$el.addClass("wp-core-ui");if(this.options.modal){this.modal=new f.view.Modal({controller:this,title:this.options.title});this.modal.content(this)}if(wp.Uploader.limitExceeded||!wp.Uploader.browser.supported){this.options.uploader=false}if(this.options.uploader){this.uploader=new f.view.UploaderWindow({controller:this,uploader:{dropzone:this.modal?this.modal.$el:this.$el,container:this.$el}});this.views.set(".media-frame-uploader",this.uploader)}this.on("attach",_.bind(this.views.ready,this.views),this);this.on("title:create:default",this.createTitle,this);this.title.mode("default");this.on("menu:create:default",this.createMenu,this)},render:function(){if(!this.state()&&this.options.state){this.setState(this.options.state)}return f.view.Frame.prototype.render.apply(this,arguments)},createTitle:function(g){g.view=new f.View({controller:this,tagName:"h1"})},createMenu:function(g){g.view=new f.view.Menu({controller:this})},createToolbar:function(g){g.view=new f.view.Toolbar({controller:this})},createRouter:function(g){g.view=new f.view.Router({controller:this})},createIframeStates:function(g){var j=f.view.settings,i=j.tabs,k=j.tabUrl,h;if(!i||!k){return}h=e("#post_ID");if(h.length){k+="&post_id="+h.val()}_.each(i,function(m,n){var l=this.state("iframe:"+n).set(_.defaults({tab:n,src:k+"&tab="+n,title:m,content:"iframe",menu:"default"},g))},this);this.on("content:create:iframe",this.iframeContent,this);this.on("menu:render:default",this.iframeMenu,this);this.on("open",this.hijackThickbox,this);this.on("close",this.restoreThickbox,this)},iframeContent:function(g){this.$el.addClass("hide-toolbar");g.view=new f.view.Iframe({controller:this})},iframeMenu:function(h){var g={};if(!h){return}_.each(f.view.settings.tabs,function(i,j){g["iframe:"+j]={text:this.state("iframe:"+j).get("title"),priority:200}},this);h.set(g)},hijackThickbox:function(){var g=this;if(!window.tb_remove||this._tb_remove){return}this._tb_remove=window.tb_remove;window.tb_remove=function(){g.close();g.reset();g.setState(g.options.state);g._tb_remove.call(window)}},restoreThickbox:function(){if(!this._tb_remove){return}window.tb_remove=this._tb_remove;delete this._tb_remove}});_.each(["open","close","attach","detach","escape"],function(g){f.view.MediaFrame.prototype[g]=function(h){if(this.modal){this.modal[g].apply(this.modal,arguments)}return this}});f.view.MediaFrame.Select=f.view.MediaFrame.extend({initialize:function(){f.view.MediaFrame.prototype.initialize.apply(this,arguments);_.defaults(this.options,{selection:[],library:{},multiple:false,state:"library"});this.createSelection();this.createStates();this.bindHandlers()},createSelection:function(){var g=this,h=this.options.selection;if(!(h instanceof f.model.Selection)){this.options.selection=new f.model.Selection(h,{multiple:this.options.multiple})}this._selection={attachments:new c(),difference:[]}},createStates:function(){var g=this.options;if(this.options.states){return}this.states.add([new f.controller.Library({library:f.query(g.library),multiple:g.multiple,title:g.title,priority:20})])},bindHandlers:function(){this.on("router:create:browse",this.createRouter,this);this.on("router:render:browse",this.browseRouter,this);this.on("content:create:browse",this.browseContent,this);this.on("content:render:upload",this.uploadContent,this);this.on("toolbar:create:select",this.createSelectToolbar,this)},browseRouter:function(g){g.set({upload:{text:b.uploadFilesTitle,priority:20},browse:{text:b.mediaLibraryTitle,priority:40}})},browseContent:function(g){var h=this.state();this.$el.removeClass("hide-toolbar");g.view=new f.view.AttachmentsBrowser({controller:this,collection:h.get("library"),selection:h.get("selection"),model:h,sortable:h.get("sortable"),search:h.get("searchable"),filters:h.get("filterable"),display:h.get("displaySettings"),dragInfo:h.get("dragInfo"),AttachmentView:h.get("AttachmentView")})},uploadContent:function(){this.$el.removeClass("hide-toolbar");this.content.set(new f.view.UploaderInline({controller:this}))},createSelectToolbar:function(h,g){g=g||this.options.button||{};g.controller=this;h.view=new f.view.Toolbar.Select(g)}});f.view.MediaFrame.Post=f.view.MediaFrame.Select.extend({initialize:function(){_.defaults(this.options,{multiple:true,editing:false,state:"insert"});f.view.MediaFrame.Select.prototype.initialize.apply(this,arguments);this.createIframeStates()},createStates:function(){var g=this.options;this.states.add([new f.controller.Library({id:"insert",title:b.insertMediaTitle,priority:20,toolbar:"main-insert",filterable:"all",library:f.query(g.library),multiple:g.multiple?"reset":false,editable:true,allowLocalEdits:true,displaySettings:true,displayUserSettings:true}),new f.controller.Library({id:"gallery",title:b.createGalleryTitle,priority:40,toolbar:"main-gallery",filterable:"uploaded",multiple:"add",editable:false,library:f.query(_.defaults({type:"image"},g.library))}),new f.controller.Embed(),new f.controller.GalleryEdit({library:g.selection,editing:g.editing,menu:"gallery"}),new f.controller.GalleryAdd()]);if(f.view.settings.post.featuredImageId){this.states.add(new f.controller.FeaturedImage())}},bindHandlers:function(){f.view.MediaFrame.Select.prototype.bindHandlers.apply(this,arguments);this.on("menu:create:gallery",this.createMenu,this);this.on("toolbar:create:main-insert",this.createToolbar,this);this.on("toolbar:create:main-gallery",this.createToolbar,this);this.on("toolbar:create:featured-image",this.featuredImageToolbar,this);this.on("toolbar:create:main-embed",this.mainEmbedToolbar,this);var g={menu:{"default":"mainMenu",gallery:"galleryMenu"},content:{embed:"embedContent","edit-selection":"editSelectionContent"},toolbar:{"main-insert":"mainInsertToolbar","main-gallery":"mainGalleryToolbar","gallery-edit":"galleryEditToolbar","gallery-add":"galleryAddToolbar"}};_.each(g,function(i,h){_.each(i,function(k,j){this.on(h+":render:"+j,this[k],this)},this)},this)},mainMenu:function(g){g.set({"library-separator":new f.View({className:"separator",priority:100})})},galleryMenu:function(g){var h=this.lastState(),i=h&&h.id,j=this;g.set({cancel:{text:b.cancelGalleryTitle,priority:20,click:function(){if(i){j.setState(i)}else{j.close()}}},separateCancel:new f.View({className:"separator",priority:40})})},embedContent:function(){var g=new f.view.Embed({controller:this,model:this.state()}).render();this.content.set(g);g.url.focus()},editSelectionContent:function(){var i=this.state(),h=i.get("selection"),g;g=new f.view.AttachmentsBrowser({controller:this,collection:h,selection:h,model:i,sortable:true,search:false,dragInfo:true,AttachmentView:f.view.Attachment.EditSelection}).render();g.toolbar.set("backToLibrary",{text:b.returnToLibrary,priority:-100,click:function(){this.controller.content.mode("browse")}});this.content.set(g)},selectionStatusToolbar:function(g){var h=this.state().get("editable");g.set("selection",new f.view.Selection({controller:this,collection:this.state().get("selection"),priority:-40,editable:h&&function(){this.controller.content.mode("edit-selection")}}).render())},mainInsertToolbar:function(h){var g=this;this.selectionStatusToolbar(h);h.set("insert",{style:"primary",priority:80,text:b.insertIntoPost,requires:{selection:true},click:function(){var j=g.state(),i=j.get("selection");g.close();j.trigger("insert",i).reset()}})},mainGalleryToolbar:function(h){var g=this;this.selectionStatusToolbar(h);h.set("gallery",{style:"primary",text:b.createNewGallery,priority:60,requires:{selection:true},click:function(){var i=g.state().get("selection"),j=g.state("gallery-edit"),k=i.where({type:"image"});j.set("library",new f.model.Selection(k,{props:i.props.toJSON(),multiple:true}));this.controller.setState("gallery-edit")}})},featuredImageToolbar:function(g){this.createSelectToolbar(g,{text:b.setFeaturedImage,state:this.options.state})},mainEmbedToolbar:function(g){g.view=new f.view.Toolbar.Embed({controller:this})},galleryEditToolbar:function(){var g=this.state().get("editing");this.toolbar.set(new f.view.Toolbar({controller:this,items:{insert:{style:"primary",text:g?b.updateGallery:b.insertGallery,priority:80,requires:{library:true},click:function(){var h=this.controller,i=h.state();h.close();i.trigger("update",i.get("library"));h.setState(h.options.state);h.reset()}}}}))},galleryAddToolbar:function(){this.toolbar.set(new f.view.Toolbar({controller:this,items:{insert:{style:"primary",text:b.addToGallery,priority:80,requires:{selection:true},click:function(){var g=this.controller,i=g.state(),h=g.state("gallery-edit");h.get("library").add(i.get("selection").models);i.trigger("reset");g.setState("gallery-edit")}}}}))}});f.view.Modal=f.View.extend({tagName:"div",template:f.template("media-modal"),attributes:{tabindex:0},events:{"click .media-modal-backdrop, .media-modal-close":"escapeHandler",keydown:"keydown"},initialize:function(){_.defaults(this.options,{container:document.body,title:"",propagate:true,freeze:true})},prepare:function(){return{title:this.options.title}},attach:function(){if(this.views.attached){return this}if(!this.views.rendered){this.render()}this.$el.appendTo(this.options.container);this.views.attached=true;this.views.ready();return this.propagate("attach")},detach:function(){if(this.$el.is(":visible")){this.close()}this.$el.detach();this.views.attached=false;return this.propagate("detach")},open:function(){var h=this.$el,g=this.options;if(h.is(":visible")){return this}if(!this.views.attached){this.attach()}if(g.freeze){this._freeze={scrollTop:e(window).scrollTop()}}h.show().focus();return this.propagate("open")},close:function(g){var h=this._freeze;if(!this.views.attached||!this.$el.is(":visible")){return this}this.$el.hide();this.propagate("close");if(h){e(window).scrollTop(h.scrollTop)}if(g&&g.escape){this.propagate("escape")}return this},escape:function(){return this.close({escape:true})},escapeHandler:function(g){g.preventDefault();this.escape()},content:function(g){this.views.set(".media-modal-content",g);return this},propagate:function(g){this.trigger(g);if(this.options.propagate){this.controller.trigger(g)}return this},keydown:function(g){if(27===g.which){g.preventDefault();this.escape();return}}});f.view.FocusManager=f.View.extend({events:{keydown:"recordTab",focusin:"updateIndex"},focus:function(){if(_.isUndefined(this.index)){return}this.$tabbables=this.$(":tabbable");this.$tabbables.eq(this.index).focus()},recordTab:function(h){if(9!==h.keyCode){return}if(_.isUndefined(this.index)){this.updateIndex(h)}if(_.isUndefined(this.index)){return}var g=this.index+(h.shiftKey?-1:1);if(g>=0&&g<this.$tabbables.length){this.index=g}else{delete this.index}},updateIndex:function(h){this.$tabbables=this.$(":tabbable");var g=this.$tabbables.index(h.target);if(-1===g){delete this.index}else{this.index=g}}});f.view.UploaderWindow=f.View.extend({tagName:"div",className:"uploader-window",template:f.template("uploader-window"),initialize:function(){var g;this.$browser=e('<a href="#" class="browser" />').hide().appendTo("body");g=this.options.uploader=_.defaults(this.options.uploader||{},{dropzone:this.$el,browser:this.$browser,params:{}});if(g.dropzone&&!(g.dropzone instanceof e)){g.dropzone=e(g.dropzone)}this.controller.on("activate",this.refresh,this)},refresh:function(){if(this.uploader){this.uploader.refresh()}},ready:function(){var h=f.view.settings.post.id,g;if(this.uploader){return}if(h){this.options.uploader.params.post_id=h}this.uploader=new wp.Uploader(this.options.uploader);g=this.uploader.dropzone;g.on("dropzone:enter",_.bind(this.show,this));g.on("dropzone:leave",_.bind(this.hide,this))},show:function(){var g=this.$el.show();_.defer(function(){g.css({opacity:1})})},hide:function(){var g=this.$el.css({opacity:0});f.transition(g).done(function(){if("0"===g.css("opacity")){g.hide()}})}});f.view.UploaderInline=f.View.extend({tagName:"div",className:"uploader-inline",template:f.template("uploader-inline"),initialize:function(){_.defaults(this.options,{message:"",status:true});if(!this.options.$browser&&this.controller.uploader){this.options.$browser=this.controller.uploader.$browser}if(_.isUndefined(this.options.postId)){this.options.postId=f.view.settings.post.id}if(this.options.status){this.views.set(".upload-inline-status",new f.view.UploaderStatus({controller:this.controller}))}},dispose:function(){if(this.disposing){return f.View.prototype.dispose.apply(this,arguments)}this.disposing=true;return this.remove()},remove:function(){var g=f.View.prototype.remove.apply(this,arguments);_.defer(_.bind(this.refresh,this));return g},refresh:function(){var g=this.controller.uploader;if(g){g.refresh()}},ready:function(){var g=this.options.$browser,h;if(this.controller.uploader){h=this.$(".browser");if(h[0]===g[0]){return}g.detach().text(h.text());g[0].className=h[0].className;h.replaceWith(g.show())}this.refresh();return this}});f.view.UploaderStatus=f.View.extend({className:"media-uploader-status",template:f.template("uploader-status"),events:{"click .upload-dismiss-errors":"dismiss"},initialize:function(){this.queue=wp.Uploader.queue;this.queue.on("add remove reset",this.visibility,this);this.queue.on("add remove reset change:percent",this.progress,this);this.queue.on("add remove reset change:uploading",this.info,this);this.errors=wp.Uploader.errors;this.errors.reset();this.errors.on("add remove reset",this.visibility,this);this.errors.on("add",this.error,this)},dispose:function(){wp.Uploader.queue.off(null,null,this);f.View.prototype.dispose.apply(this,arguments);return this},visibility:function(){this.$el.toggleClass("uploading",!!this.queue.length);this.$el.toggleClass("errors",!!this.errors.length);this.$el.toggle(!!this.queue.length||!!this.errors.length)},ready:function(){_.each({"$bar":".media-progress-bar div","$index":".upload-index","$total":".upload-total","$filename":".upload-filename"},function(g,h){this[h]=this.$(g)},this);this.visibility();this.progress();this.info()},progress:function(){var g=this.queue,i=this.$bar,h=0;if(!i||!g.length){return}i.width((g.reduce(function(j,l){if(!l.get("uploading")){return j+100}var k=l.get("percent");return j+(_.isNumber(k)?k:100)},0)/g.length)+"%")},info:function(){var g=this.queue,h=0,i;if(!g.length){return}i=this.queue.find(function(k,j){h=j;return k.get("uploading")});this.$index.text(h+1);this.$total.text(g.length);this.$filename.html(i?this.filename(i.get("filename")):"")},filename:function(g){return f.truncate(_.escape(g),24)},error:function(g){this.views.add(".upload-errors",new f.view.UploaderStatusError({filename:this.filename(g.get("file").name),message:g.get("message")}),{at:0})},dismiss:function(g){var h=this.views.get(".upload-errors");g.preventDefault();if(h){_.invoke(h,"remove")}wp.Uploader.errors.reset()}});f.view.UploaderStatusError=f.View.extend({className:"upload-error",template:f.template("uploader-status-error")});f.view.Toolbar=f.View.extend({tagName:"div",className:"media-toolbar",initialize:function(){var i=this.controller.state(),h=this.selection=i.get("selection"),g=this.library=i.get("library");this._views={};this.primary=new f.view.PriorityList();this.secondary=new f.view.PriorityList();this.primary.$el.addClass("media-toolbar-primary");this.secondary.$el.addClass("media-toolbar-secondary");this.views.set([this.secondary,this.primary]);if(this.options.items){this.set(this.options.items,{silent:true})}if(!this.options.silent){this.render()}if(h){h.on("add remove reset",this.refresh,this)}if(g){g.on("add remove reset",this.refresh,this)}},dispose:function(){if(this.selection){this.selection.off(null,null,this)}if(this.library){this.library.off(null,null,this)}return f.View.prototype.dispose.apply(this,arguments)},ready:function(){this.refresh()},set:function(j,g,h){var i;h=h||{};if(_.isObject(j)){_.each(j,function(k,l){this.set(l,k,{silent:true})},this)}else{if(!(g instanceof Backbone.View)){g.classes=["media-button-"+j].concat(g.classes||[]);g=new f.view.Button(g).render()}g.controller=g.controller||this.controller;this._views[j]=g;i=g.options.priority<0?"secondary":"primary";this[i].set(j,g,h)}if(!h.silent){this.refresh()}return this},get:function(g){return this._views[g]},unset:function(h,g){delete this._views[h];this.primary.unset(h,g);this.secondary.unset(h,g);if(!g||!g.silent){this.refresh()}return this},refresh:function(){var i=this.controller.state(),g=i.get("library"),h=i.get("selection");_.each(this._views,function(j){if(!j.model||!j.options||!j.options.requires){return}var l=j.options.requires,k=false;k=_.some(h.models,function(m){return m.get("uploading")===true});if(l.selection&&h&&!h.length){k=true}else{if(l.library&&g&&!g.length){k=true}}j.model.set("disabled",k)})}});f.view.Toolbar.Select=f.view.Toolbar.extend({initialize:function(){var h=this.options,g=h.controller,i=g.state().get("selection");_.bindAll(this,"clickSelect");_.defaults(h,{event:"select",state:false,reset:true,close:true,text:b.select,requires:{selection:true}});h.items=_.defaults(h.items||{},{select:{style:"primary",text:h.text,priority:80,click:this.clickSelect,requires:h.requires}});f.view.Toolbar.prototype.initialize.apply(this,arguments)},clickSelect:function(){var h=this.options,g=this.controller;if(h.close){g.close()}if(h.event){g.state().trigger(h.event)}if(h.state){g.setState(h.state)}if(h.reset){g.reset()}}});f.view.Toolbar.Embed=f.view.Toolbar.Select.extend({initialize:function(){_.defaults(this.options,{text:b.insertIntoPost,requires:false});f.view.Toolbar.Select.prototype.initialize.apply(this,arguments)},refresh:function(){var g=this.controller.state().props.get("url");this.get("select").model.set("disabled",!g||g==="http://");f.view.Toolbar.Select.prototype.refresh.apply(this,arguments)}});f.view.Button=f.View.extend({tagName:"a",className:"media-button",attributes:{href:"#"},events:{click:"click"},defaults:{text:"",style:"",size:"large",disabled:false},initialize:function(){this.model=new Backbone.Model(this.defaults);_.each(this.defaults,function(i,g){var h=this.options[g];if(_.isUndefined(h)){return}this.model.set(g,h);delete this.options[g]},this);this.model.on("change",this.render,this)},render:function(){var h=["button",this.className],g=this.model.toJSON();if(g.style){h.push("button-"+g.style)}if(g.size){h.push("button-"+g.size)}h=_.uniq(h.concat(this.options.classes));this.el.className=h.join(" ");this.$el.attr("disabled",g.disabled);this.$el.text(this.model.get("text"));return this},click:function(g){if("#"===this.attributes.href){g.preventDefault()}if(this.options.click&&!this.model.get("disabled")){this.options.click.apply(this,arguments)}}});f.view.ButtonGroup=f.View.extend({tagName:"div",className:"button-group button-large media-button-group",initialize:function(){this.buttons=_.map(this.options.buttons||[],function(g){if(g instanceof Backbone.View){return g}else{return new f.view.Button(g).render()}});delete this.options.buttons;if(this.options.classes){this.$el.addClass(this.options.classes)}},render:function(){this.$el.html(e(_.pluck(this.buttons,"el")).detach());return this}});f.view.PriorityList=f.View.extend({tagName:"div",initialize:function(){this._views={};this.set(_.extend({},this._views,this.options.views),{silent:true});delete this.options.views;if(!this.options.silent){this.render()}},set:function(l,h,j){var k,g,i;j=j||{};if(_.isObject(l)){_.each(l,function(m,n){this.set(n,m)},this);return this}if(!(h instanceof Backbone.View)){h=this.toView(h,l,j)}h.controller=h.controller||this.controller;this.unset(l);k=h.options.priority||10;g=this.views.get()||[];_.find(g,function(n,m){if(n.options.priority>k){i=m;return true}});this._views[l]=h;this.views.add(h,{at:_.isNumber(i)?i:g.length||0});return this},get:function(g){return this._views[g]},unset:function(h){var g=this.get(h);if(g){g.remove()}delete this._views[h];return this},toView:function(g){return new f.View(g)}});f.view.MenuItem=f.View.extend({tagName:"a",className:"media-menu-item",attributes:{href:"#"},events:{click:"_click"},_click:function(g){var h=this.options.click;if(g){g.preventDefault()}if(h){h.call(this)}else{this.click()}},click:function(){var g=this.options.state;if(g){this.controller.setState(g)}},render:function(){var g=this.options;if(g.text){this.$el.text(g.text)}else{if(g.html){this.$el.html(g.html)}}return this}});f.view.Menu=f.view.PriorityList.extend({tagName:"div",className:"media-menu",property:"state",ItemView:f.view.MenuItem,region:"menu",toView:function(g,h){g=g||{};g[this.property]=g[this.property]||h;return new this.ItemView(g).render()},ready:function(){f.view.PriorityList.prototype.ready.apply(this,arguments);this.visibility()},set:function(){f.view.PriorityList.prototype.set.apply(this,arguments);this.visibility()},unset:function(){f.view.PriorityList.prototype.unset.apply(this,arguments);this.visibility()},visibility:function(){var j=this.region,h=this.controller[j].get(),g=this.views.get(),i=!g||g.length<2;if(this===h){this.controller.$el.toggleClass("hide-"+j,i)}},select:function(h){var g=this.get(h);if(!g){return}this.deselect();g.$el.addClass("active")},deselect:function(){this.$el.children().removeClass("active")}});f.view.RouterItem=f.view.MenuItem.extend({click:function(){var g=this.options.contentMode;if(g){this.controller.content.mode(g)}}});f.view.Router=f.view.Menu.extend({tagName:"div",className:"media-router",property:"contentMode",ItemView:f.view.RouterItem,region:"router",initialize:function(){this.controller.on("content:render",this.update,this);f.view.Menu.prototype.initialize.apply(this,arguments)},update:function(){var g=this.controller.content.mode();if(g){this.select(g)}}});f.view.Sidebar=f.view.PriorityList.extend({className:"media-sidebar"});f.view.Attachment=f.View.extend({tagName:"li",className:"attachment",template:f.template("attachment"),events:{"click .attachment-preview":"toggleSelectionHandler","change [data-setting]":"updateSetting","change [data-setting] input":"updateSetting","change [data-setting] select":"updateSetting","change [data-setting] textarea":"updateSetting","click .close":"removeFromLibrary","click .check":"removeFromSelection","click a":"preventDefault"},buttons:{},initialize:function(){var g=this.options.selection;this.model.on("change:sizes change:uploading",this.render,this);this.model.on("change:title",this._syncTitle,this);this.model.on("change:caption",this._syncCaption,this);this.model.on("change:percent",this.progress,this);this.model.on("add",this.select,this);this.model.on("remove",this.deselect,this);if(g){g.on("reset",this.updateSelect,this)}this.model.on("selection:single selection:unsingle",this.details,this);this.details(this.model,this.controller.state().get("selection"))},dispose:function(){var g=this.options.selection;this.updateAll();if(g){g.off(null,null,this)}f.View.prototype.dispose.apply(this,arguments);return this},render:function(){var g=_.defaults(this.model.toJSON(),{orientation:"landscape",uploading:false,type:"",subtype:"",icon:"",filename:"",caption:"",title:"",dateFormatted:"",width:"",height:"",compat:false,alt:"",description:""});g.buttons=this.buttons;g.describe=this.controller.state().get("describe");if("image"===g.type){g.size=this.imageSize()}g.can={};if(g.nonces){g.can.remove=!!g.nonces["delete"];g.can.save=!!g.nonces.update}if(this.controller.state().get("allowLocalEdits")){g.allowLocalEdits=true}this.views.detach();this.$el.html(this.template(g));this.$el.toggleClass("uploading",g.uploading);if(g.uploading){this.$bar=this.$(".media-progress-bar div")}else{delete this.$bar}this.updateSelect();this.updateSave();this.views.render();return this},progress:function(){if(this.$bar&&this.$bar.length){this.$bar.width(this.model.get("percent")+"%")}},toggleSelectionHandler:function(g){var h;if(g.shiftKey){h="between"}else{if(g.ctrlKey||g.metaKey){h="toggle"}}this.toggleSelection({method:h})},toggleSelection:function(p){var k=this.collection,l=this.options.selection,j=this.model,g=p&&p.method,m,n,h,i,o;if(!l){return}m=l.single();g=_.isUndefined(g)?l.multiple:g;if("between"===g&&m&&l.multiple){if(m===j){return}i=k.indexOf(m);o=k.indexOf(this.model);if(i<o){h=k.models.slice(i,o+1)}else{h=k.models.slice(o,i+1)}l.add(h).single(j);return}else{if("toggle"===g){l[this.selected()?"remove":"add"](j).single(j);return}}if(g!=="add"){g="reset"}if(this.selected()){l[m===j?"remove":"single"](j)}else{l[g](j).single(j)}},updateSelect:function(){this[this.selected()?"select":"deselect"]()},selected:function(){var g=this.options.selection;if(g){return !!g.get(this.model.cid)}},select:function(g,i){var h=this.options.selection;if(!h||(i&&i!==h)){return}this.$el.addClass("selected")},deselect:function(g,i){var h=this.options.selection;if(!h||(i&&i!==h)){return}this.$el.removeClass("selected")},details:function(g,j){var i=this.options.selection,h;if(i!==j){return}h=i.single();this.$el.toggleClass("details",h===this.model)},preventDefault:function(g){g.preventDefault()},imageSize:function(g){var h=this.model.get("sizes");g=g||"medium";if(h&&h[g]){return _.clone(h[g])}else{return{url:this.model.get("url"),width:this.model.get("width"),height:this.model.get("height"),orientation:this.model.get("orientation")}}},updateSetting:function(i){var g=e(i.target).closest("[data-setting]"),h,j;if(!g.length){return}h=g.data("setting");j=i.target.value;if(this.model.get(h)!==j){this.save(h,j)}},save:function(){var g=this,i=this._save=this._save||{status:"ready"},h=this.model.save.apply(this.model,arguments),j=i.requests?e.when(h,i.requests):h;if(i.savedTimer){clearTimeout(i.savedTimer)}this.updateSave("waiting");i.requests=j;j.always(function(){if(i.requests!==j){return}g.updateSave(j.state()==="resolved"?"complete":"error");i.savedTimer=setTimeout(function(){g.updateSave("ready");delete i.savedTimer},2000)})},updateSave:function(g){var h=this._save=this._save||{status:"ready"};if(g&&g!==h.status){this.$el.removeClass("save-"+h.status);h.status=g}this.$el.addClass("save-"+h.status);return this},updateAll:function(){var h=this.$("[data-setting]"),g=this.model,i;i=_.chain(h).map(function(k){var m=e("input, textarea, select, [value]",k),j,l;if(!m.length){return}j=e(k).data("setting");l=m.val();if(g.get(j)!==l){return[j,l]}}).compact().object().value();if(!_.isEmpty(i)){g.save(i)}},removeFromLibrary:function(g){g.stopPropagation();this.collection.remove(this.model)},removeFromSelection:function(h){var g=this.options.selection;if(!g){return}h.stopPropagation();g.remove(this.model)}});_.each({caption:"_syncCaption",title:"_syncTitle"},function(h,g){f.view.Attachment.prototype[h]=function(i,k){var j=this.$('[data-setting="'+g+'"]');if(!j.length){return this}if(k===j.find("input, textarea, select, [value]").val()){return this}return this.render()}});f.view.Attachment.Library=f.view.Attachment.extend({buttons:{check:true}});f.view.Attachment.EditLibrary=f.view.Attachment.extend({buttons:{close:true}});f.view.Attachments=f.View.extend({tagName:"ul",className:"attachments",cssTemplate:f.template("attachments-css"),events:{scroll:"scroll"},initialize:function(){this.el.id=_.uniqueId("__attachments-view-");_.defaults(this.options,{refreshSensitivity:200,refreshThreshold:3,AttachmentView:f.view.Attachment,sortable:false,resize:true});this._viewsByCid={};this.collection.on("add",function(i,g,h){this.views.add(this.createAttachmentView(i),{at:this.collection.indexOf(i)})},this);this.collection.on("remove",function(j,g,i){var h=this._viewsByCid[j.cid];delete this._viewsByCid[j.cid];if(h){h.remove()}},this);this.collection.on("reset",this.render,this);this.scroll=_.chain(this.scroll).bind(this).throttle(this.options.refreshSensitivity).value();this.initSortable();_.bindAll(this,"css");this.model.on("change:edge change:gutter",this.css,this);this._resizeCss=_.debounce(_.bind(this.css,this),this.refreshSensitivity);if(this.options.resize){e(window).on("resize.attachments",this._resizeCss)}this.css()},dispose:function(){this.collection.props.off(null,null,this);e(window).off("resize.attachments",this._resizeCss);f.View.prototype.dispose.apply(this,arguments)},css:function(){var g=e("#"+this.el.id+"-css");if(g.length){g.remove()}f.view.Attachments.$head().append(this.cssTemplate({id:this.el.id,edge:this.edge(),gutter:this.model.get("gutter")}))},edge:function(){var i=this.model.get("edge"),j,h,g;if(!this.$el.is(":visible")){return i}j=this.model.get("gutter")*2;h=this.$el.width()-j;g=Math.ceil(h/(i+j));i=Math.floor((h-(g*j))/g);return i},initSortable:function(){var g=this.collection;if(!this.options.sortable||!e.fn.sortable){return}this.$el.sortable(_.extend({disabled:!!g.comparator,containment:this.$el,tolerance:"pointer",start:function(h,i){i.item.data("sortableIndexStart",i.item.index())},update:function(j,k){var i=g.at(k.item.data("sortableIndexStart")),h=g.comparator;delete g.comparator;g.remove(i,{silent:true}).add(i,{silent:true,at:k.item.index()});g.comparator=h;g.trigger("reset",g);g.saveMenuOrder()}},this.options.sortable));g.props.on("change:orderby",function(){this.$el.sortable("option","disabled",!!g.comparator)},this);this.collection.props.on("change:orderby",this.refreshSortable,this);this.refreshSortable()},refreshSortable:function(){if(!this.options.sortable||!e.fn.sortable){return}var i=this.collection,h=i.props.get("orderby"),g="menuOrder"===h||!i.comparator;this.$el.sortable("option","disabled",!g)},createAttachmentView:function(h){var g=new this.options.AttachmentView({controller:this.controller,model:h,collection:this.collection,selection:this.options.selection});return this._viewsByCid[h.cid]=g},prepare:function(){if(this.collection.length){this.views.set(this.collection.map(this.createAttachmentView,this))}else{this.views.unset();this.collection.more().done(this.scroll)}},ready:function(){this.scroll()},scroll:function(g){if(!this.$el.is(":visible")){return}if(this.collection.hasMore()&&this.el.scrollHeight<this.el.scrollTop+(this.el.clientHeight*this.options.refreshThreshold)){this.collection.more().done(this.scroll)}}},{$head:(function(){var g;return function(){return g=g||e("head")}}())});f.view.Search=f.View.extend({tagName:"input",className:"search",attributes:{type:"search",placeholder:b.search},events:{input:"search",keyup:"search",change:"search",search:"search"},render:function(){this.el.value=this.model.escape("search");return this},search:function(g){if(g.target.value){this.model.set("search",g.target.value)}else{this.model.unset("search")}}});f.view.AttachmentFilters=f.View.extend({tagName:"select",className:"attachment-filters",events:{change:"change"},keys:[],initialize:function(){this.createFilters();_.extend(this.filters,this.options.filters);this.$el.html(_.chain(this.filters).map(function(g,h){return{el:e("<option></option>").val(h).text(g.text)[0],priority:g.priority||50}},this).sortBy("priority").pluck("el").value());this.model.on("change",this.select,this);this.select()},createFilters:function(){this.filters={}},change:function(h){var g=this.filters[this.el.value];if(g){this.model.set(g.props)}},select:function(){var g=this.model,i="all",h=g.toJSON();_.find(this.filters,function(k,l){var j=_.all(k.props,function(n,m){return n===(_.isUndefined(h[m])?null:h[m])});if(j){return i=l}});this.$el.val(i)}});f.view.AttachmentFilters.Uploaded=f.view.AttachmentFilters.extend({createFilters:function(){var h=this.model.get("type"),g=f.view.settings.mimeTypes,i;if(g&&h){i=g[h]}this.filters={all:{text:i||b.allMediaItems,props:{uploadedTo:null,orderby:"date",order:"DESC"},priority:10},uploaded:{text:b.uploadedToThisPost,props:{uploadedTo:f.view.settings.post.id,orderby:"menuOrder",order:"ASC"},priority:20}}}});f.view.AttachmentFilters.All=f.view.AttachmentFilters.extend({createFilters:function(){var g={};_.each(f.view.settings.mimeTypes||{},function(i,h){g[h]={text:i,props:{type:h,uploadedTo:null,orderby:"date",order:"DESC"}}});g.all={text:b.allMediaItems,props:{type:null,uploadedTo:null,orderby:"date",order:"DESC"},priority:10};g.uploaded={text:b.uploadedToThisPost,props:{type:null,uploadedTo:f.view.settings.post.id,orderby:"menuOrder",order:"ASC"},priority:20};this.filters=g}});f.view.AttachmentsBrowser=f.View.extend({tagName:"div",className:"attachments-browser",initialize:function(){_.defaults(this.options,{filters:false,search:true,display:false,AttachmentView:f.view.Attachment.Library});this.createToolbar();this.updateContent();this.createSidebar();this.collection.on("add remove reset",this.updateContent,this)},dispose:function(){this.options.selection.off(null,null,this);f.View.prototype.dispose.apply(this,arguments);return this},createToolbar:function(){var h,g;this.toolbar=new f.view.Toolbar({controller:this.controller});this.views.add(this.toolbar);h=this.options.filters;if("uploaded"===h){g=f.view.AttachmentFilters.Uploaded}else{if("all"===h){g=f.view.AttachmentFilters.All}}if(g){this.toolbar.set("filters",new g({controller:this.controller,model:this.collection.props,priority:-80}).render())}if(this.options.search){this.toolbar.set("search",new f.view.Search({controller:this.controller,model:this.collection.props,priority:60}).render())}if(this.options.dragInfo){this.toolbar.set("dragInfo",new f.View({el:e('<div class="instructions">'+b.dragInfo+"</div>")[0],priority:-40}))}},updateContent:function(){var g=this;if(!this.attachments){this.createAttachments()}if(!this.collection.length){this.collection.more().done(function(){if(!g.collection.length){g.createUploader()}})}},removeContent:function(){_.each(["attachments","uploader"],function(g){if(this[g]){this[g].remove();delete this[g]}},this)},createUploader:function(){this.removeContent();this.uploader=new f.view.UploaderInline({controller:this.controller,status:false,message:b.noItemsFound});this.views.add(this.uploader)},createAttachments:function(){this.removeContent();this.attachments=new f.view.Attachments({controller:this.controller,collection:this.collection,selection:this.options.selection,model:this.model,sortable:this.options.sortable,AttachmentView:this.options.AttachmentView});this.views.add(this.attachments)},createSidebar:function(){var g=this.options,h=g.selection,i=this.sidebar=new f.view.Sidebar({controller:this.controller});this.views.add(i);if(this.controller.uploader){i.set("uploads",new f.view.UploaderStatus({controller:this.controller,priority:40}))}h.on("selection:single",this.createSingle,this);h.on("selection:unsingle",this.disposeSingle,this);if(h.single()){this.createSingle()}},createSingle:function(){var h=this.sidebar,i=this.options.selection.single(),g={};h.set("details",new f.view.Attachment.Details({controller:this.controller,model:i,priority:80}));h.set("compat",new f.view.AttachmentCompat({controller:this.controller,model:i,priority:120}));if(this.options.display){h.set("display",new f.view.Settings.AttachmentDisplay({controller:this.controller,model:this.model.display(i),attachment:i,priority:160,userSettings:this.model.get("displayUserSettings")}))}},disposeSingle:function(){var g=this.sidebar;g.unset("details");g.unset("compat");g.unset("display")}});f.view.Selection=f.View.extend({tagName:"div",className:"media-selection",template:f.template("media-selection"),events:{"click .edit-selection":"edit","click .clear-selection":"clear"},initialize:function(){_.defaults(this.options,{editable:false,clearable:true});this.attachments=new f.view.Attachments.Selection({controller:this.controller,collection:this.collection,selection:this.collection,model:new Backbone.Model({edge:40,gutter:5})});this.views.set(".selection-view",this.attachments);this.collection.on("add remove reset",this.refresh,this);this.controller.on("content:activate",this.refresh,this)},ready:function(){this.refresh()},refresh:function(){if(!this.$el.children().length){return}var h=this.collection,g="edit-selection"===this.controller.content.mode();this.$el.toggleClass("empty",!h.length);this.$el.toggleClass("one",1===h.length);this.$el.toggleClass("editing",g);this.$(".count").text(b.selected.replace("%d",h.length))},edit:function(g){g.preventDefault();if(this.options.editable){this.options.editable.call(this,this.collection)}},clear:function(g){g.preventDefault();this.collection.reset()}});f.view.Attachment.Selection=f.view.Attachment.extend({className:"attachment selection",toggleSelection:function(){this.options.selection.single(this.model)}});f.view.Attachments.Selection=f.view.Attachments.extend({events:{},initialize:function(){_.defaults(this.options,{sortable:true,resize:false,AttachmentView:f.view.Attachment.Selection});return f.view.Attachments.prototype.initialize.apply(this,arguments)}});f.view.Attachment.EditSelection=f.view.Attachment.Selection.extend({buttons:{close:true}});f.view.Settings=f.View.extend({events:{"click button":"updateHandler","change input":"updateHandler","change select":"updateHandler","change textarea":"updateHandler"},initialize:function(){this.model=this.model||new Backbone.Model();this.model.on("change",this.updateChanges,this)},prepare:function(){return _.defaults({model:this.model.toJSON()},this.options)},render:function(){f.View.prototype.render.apply(this,arguments);_(this.model.attributes).chain().keys().each(this.update,this);return this},update:function(j){var k=this.model.get(j),i=this.$('[data-setting="'+j+'"]'),g,h;if(!i.length){return}if(i.is("select")){h=i.find('[value="'+k+'"]');if(h.length){i.find("option").prop("selected",false);h.prop("selected",true)}else{this.model.set(j,i.find(":selected").val())}}else{if(i.hasClass("button-group")){g=i.find("button").removeClass("active");g.filter('[value="'+k+'"]').addClass("active")}else{if(i.is('input[type="text"], textarea')){if(!i.is(":focus")){i.val(k)}}else{if(i.is('input[type="checkbox"]')){i.attr("checked",!!k)}}}}},updateHandler:function(i){var h=e(i.target).closest("[data-setting]"),j=i.target.value,g;i.preventDefault();if(!h.length){return}if(h.is('input[type="checkbox"]')){j=h[0].checked}this.model.set(h.data("setting"),j);if(g=h.data("userSetting")){setUserSetting(g,j)}},updateChanges:function(h,g){if(h.hasChanged()){_(h.changed).chain().keys().each(this.update,this)}}});f.view.Settings.AttachmentDisplay=f.view.Settings.extend({className:"attachment-display-settings",template:f.template("attachment-display-settings"),initialize:function(){var g=this.options.attachment;_.defaults(this.options,{userSettings:false});f.view.Settings.prototype.initialize.apply(this,arguments);this.model.on("change:link",this.updateLinkTo,this);if(g){g.on("change:uploading",this.render,this)}},dispose:function(){var g=this.options.attachment;if(g){g.off(null,null,this)}f.view.Settings.prototype.dispose.apply(this,arguments)},render:function(){var g=this.options.attachment;if(g){_.extend(this.options,{sizes:g.get("sizes"),type:g.get("type")})}f.view.Settings.prototype.render.call(this);this.updateLinkTo();return this},updateLinkTo:function(){var h=this.model.get("link"),i=this.$(".link-to-custom"),g=this.options.attachment;if("none"===h||"embed"===h||(!g&&"custom"!==h)){i.hide();return}if(g){if("post"===h){i.val(g.get("link"))}else{if("file"===h){i.val(g.get("url"))}else{if(!this.model.get("linkUrl")){i.val("http://")}}}i.prop("readonly","custom"!==h)}i.show();if(i.is(":visible")){i.focus()[0].select()}}});f.view.Settings.Gallery=f.view.Settings.extend({className:"gallery-settings",template:f.template("gallery-settings")});f.view.Attachment.Details=f.view.Attachment.extend({tagName:"div",className:"attachment-details",template:f.template("attachment-details"),events:{"change [data-setting]":"updateSetting","change [data-setting] input":"updateSetting","change [data-setting] select":"updateSetting","change [data-setting] textarea":"updateSetting","click .delete-attachment":"deleteAttachment","click .edit-attachment":"editAttachment","click .refresh-attachment":"refreshAttachment"},initialize:function(){this.focusManager=new f.view.FocusManager({el:this.el});f.view.Attachment.prototype.initialize.apply(this,arguments)},render:function(){f.view.Attachment.prototype.render.apply(this,arguments);this.focusManager.focus();return this},deleteAttachment:function(g){g.preventDefault();if(confirm(b.warnDelete)){this.model.destroy()}},editAttachment:function(g){this.$el.addClass("needs-refresh")},refreshAttachment:function(g){this.$el.removeClass("needs-refresh");g.preventDefault();this.model.fetch()}});f.view.AttachmentCompat=f.View.extend({tagName:"form",className:"compat-item",events:{submit:"preventDefault","change input":"save","change select":"save","change textarea":"save"},initialize:function(){this.focusManager=new f.view.FocusManager({el:this.el});this.model.on("change:compat",this.render,this)},dispose:function(){if(this.$(":focus").length){this.save()}return f.View.prototype.dispose.apply(this,arguments)},render:function(){var g=this.model.get("compat");if(!g||!g.item){return}this.views.detach();this.$el.html(g.item);this.views.render();this.focusManager.focus();return this},preventDefault:function(g){g.preventDefault()},save:function(g){var h={};if(g){g.preventDefault()}_.each(this.$el.serializeArray(),function(i){h[i.name]=i.value});this.model.saveCompat(h)}});f.view.Iframe=f.View.extend({className:"media-iframe",render:function(){this.views.detach();this.$el.html('<iframe src="'+this.controller.state().get("src")+'" />');this.views.render();return this}});f.view.Embed=f.View.extend({className:"media-embed",initialize:function(){this.url=new f.view.EmbedUrl({controller:this.controller,model:this.model.props}).render();this.views.set([this.url]);this.refresh();this.model.on("change:type",this.refresh,this);this.model.on("change:loading",this.loading,this)},settings:function(g){if(this._settings){this._settings.remove()}this._settings=g;this.views.add(g)},refresh:function(){var h=this.model.get("type"),g;if("image"===h){g=f.view.EmbedImage}else{if("link"===h){g=f.view.EmbedLink}else{return}}this.settings(new g({controller:this.controller,model:this.model.props,priority:40}))},loading:function(){this.$el.toggleClass("embed-loading",this.model.get("loading"))}});f.view.EmbedUrl=f.View.extend({tagName:"label",className:"embed-url",events:{input:"url",keyup:"url",change:"url"},initialize:function(){this.$input=e("<input/>").attr("type","text").val(this.model.get("url"));this.input=this.$input[0];this.spinner=e('<span class="spinner" />')[0];this.$el.append([this.input,this.spinner]);this.model.on("change:url",this.render,this)},render:function(){var g=this.$input;if(g.is(":focus")){return}this.input.value=this.model.get("url")||"http://";f.View.prototype.render.apply(this,arguments);return this},ready:function(){this.focus()},url:function(g){this.model.set("url",g.target.value)},focus:function(){var g=this.$input;if(g.is(":visible")){g.focus()[0].select()}}});f.view.EmbedLink=f.view.Settings.extend({className:"embed-link-settings",template:f.template("embed-link-settings")});f.view.EmbedImage=f.view.Settings.AttachmentDisplay.extend({className:"embed-image-settings",template:f.template("embed-image-settings"),initialize:function(){f.view.Settings.AttachmentDisplay.prototype.initialize.apply(this,arguments);this.model.on("change:url",this.updateImage,this)},updateImage:function(){this.$("img").attr("src",this.model.get("url"))}})}(jQuery));
\ No newline at end of file
diff --git a/wp-includes/js/mediaelement/background.png b/wp-includes/js/mediaelement/background.png
new file mode 100644 (file)
index 0000000..fd42841
Binary files /dev/null and b/wp-includes/js/mediaelement/background.png differ
diff --git a/wp-includes/js/mediaelement/bigplay.png b/wp-includes/js/mediaelement/bigplay.png
new file mode 100644 (file)
index 0000000..694553e
Binary files /dev/null and b/wp-includes/js/mediaelement/bigplay.png differ
diff --git a/wp-includes/js/mediaelement/bigplay.svg b/wp-includes/js/mediaelement/bigplay.svg
new file mode 100644 (file)
index 0000000..c2f62bb
--- /dev/null
@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?>\r<!-- Generator: Adobe Fireworks CS6, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1  -->\r<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\r<svg id="bigplay-gradient.fw-Page%201" viewBox="0 0 100 200" style="background-color:#ffffff00" version="1.1"\r   xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"\r     x="0px" y="0px" width="100px" height="200px"\r>\r <defs>\r         <radialGradient id="gradient1" cx="50%" cy="50%" r="50%">\r                      <stop stop-color="#222222" stop-opacity="0" offset="70%"/>\r                     <stop stop-color="#222222" stop-opacity="0.0118" offset="70.202%"/>\r                    <stop stop-color="#333333" stop-opacity="1" offset="85%"/>\r                     <stop stop-color="#333333" stop-opacity="0" offset="100%"/>\r            </radialGradient>\r              <radialGradient id="gradient2" cx="50%" cy="50%" r="50%">\r                      <stop stop-color="#bbbbbb" stop-opacity="0" offset="70%"/>\r                     <stop stop-color="#bbbbbb" stop-opacity="0.0118" offset="70.202%"/>\r                    <stop stop-color="#bbbbbb" stop-opacity="1" offset="85%"/>\r                     <stop stop-color="#bbbbbb" stop-opacity="0" offset="100%"/>\r            </radialGradient>\r              <filter id="filter1" x="-100%" y="-100%" width="300%" height="300%">\r                   <!-- Glow -->\r                  <feColorMatrix result="out" in="SourceGraphic" type="matrix" values="0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.251 0"/>\r                 <feMorphology result="out" in="out" operator="dilate" radius="3"/>\r                     <feGaussianBlur result="out" in="out" stdDeviation="1.5"/>\r                     <feBlend in="SourceGraphic" in2="out" mode="normal" result="Glow1"/>\r           </filter>\r              <filter id="filter2" x="-100%" y="-100%" width="300%" height="300%">\r                   <!-- Glow -->\r                  <feColorMatrix result="out" in="SourceGraphic" type="matrix" values="0 0 0 0.8667 0  0 0 0 0.8667 0  0 0 0 0.8667 0  0 0 0 0.251 0"/>\r                  <feMorphology result="out" in="out" operator="dilate" radius="3"/>\r                     <feGaussianBlur result="out" in="out" stdDeviation="1.5"/>\r                     <feBlend in="SourceGraphic" in2="out" mode="normal" result="Glow2"/>\r           </filter>\r      </defs>\r        <g id="Background">\r    </g>\r   <g id="dark%20shadow">\r         <path d="M 22 50 C 22 34.5358 34.5358 22 50 22 C 65.4642 22 78 34.5358 78 50 C 78 65.4642 65.4642 78 50 78 C 34.5358 78 22 65.4642 22 50 ZM 5 50 C 5 74.8531 25.1469 95 50 95 C 74.8531 95 95 74.8531 95 50 C 95 25.1469 74.8531 5 50 5 C 25.1469 5 5 25.1469 5 50 Z" fill="url(#gradient1)"/>\r         <path d="M 22 150 C 22 134.5358 34.5358 122 50 122 C 65.4642 122 78 134.5358 78 150 C 78 165.4642 65.4642 178 50 178 C 34.5358 178 22 165.4642 22 150 ZM 5 150 C 5 174.8531 25.1469 195 50 195 C 74.8531 195 95 174.8531 95 150 C 95 125.1469 74.8531 105 50 105 C 25.1469 105 5 125.1469 5 150 Z" fill="url(#gradient2)"/>\r    </g>\r   <g id="dark">\r          <path id="Polygon" filter="url(#filter1)" d="M 72.5 49.5 L 38.75 68.9856 L 38.75 30.0144 L 72.5 49.5 Z" fill="#ffffff"/>\r               <path id="Ellipse" d="M 13 50.5 C 13 29.7891 29.7891 13 50.5 13 C 71.2109 13 88 29.7891 88 50.5 C 88 71.2109 71.2109 88 50.5 88 C 29.7891 88 13 71.2109 13 50.5 Z" stroke="#ffffff" stroke-width="5" fill="none"/>\r     </g>\r   <g id="light">\r         <path id="Polygon2" filter="url(#filter2)" d="M 72.5 149.5 L 38.75 168.9856 L 38.75 130.0144 L 72.5 149.5 Z" fill="#ffffff"/>\r          <path id="Ellipse2" d="M 13 150.5 C 13 129.7891 29.7891 113 50.5 113 C 71.2109 113 88 129.7891 88 150.5 C 88 171.211 71.2109 188 50.5 188 C 29.7891 188 13 171.211 13 150.5 Z" stroke="#ffffff" stroke-width="5" fill="none"/>\r </g>\r</svg>
\ No newline at end of file
diff --git a/wp-includes/js/mediaelement/controls.png b/wp-includes/js/mediaelement/controls.png
new file mode 100644 (file)
index 0000000..f6a857d
Binary files /dev/null and b/wp-includes/js/mediaelement/controls.png differ
diff --git a/wp-includes/js/mediaelement/controls.svg b/wp-includes/js/mediaelement/controls.svg
new file mode 100644 (file)
index 0000000..af3bd41
--- /dev/null
@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?>\r<!-- Generator: Adobe Fireworks CS6, Export SVG Extension by Aaron Beall (http://fireworks.abeall.com) . Version: 0.6.1  -->\r<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\r<svg id="controls.fw-Page%201" viewBox="0 0 144 32" style="background-color:#ffffff00" version="1.1"\r    xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"\r     x="0px" y="0px" width="144px" height="32px"\r>\r  <defs>\r         <radialGradient id="gradient1" cx="50%" cy="50%" r="50%">\r                      <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#f2f2f2" stop-opacity="0.2" offset="100%"/>\r          </radialGradient>\r              <linearGradient id="gradient2" x1="50%" y1="-7.8652%" x2="50%" y2="249.6629%">\r                 <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#c8c8c8" stop-opacity="1" offset="100%"/>\r            </linearGradient>\r              <linearGradient id="gradient3" x1="50%" y1="0%" x2="50%" y2="238.75%">\r                 <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#c8c8c8" stop-opacity="1" offset="100%"/>\r            </linearGradient>\r              <linearGradient id="gradient4" x1="50%" y1="0%" x2="50%" y2="100%">\r                    <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#c8c8c8" stop-opacity="1" offset="100%"/>\r            </linearGradient>\r              <linearGradient id="gradient5" x1="50%" y1="-33.3333%" x2="50%" y2="152.0833%">\r                        <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#c8c8c8" stop-opacity="1" offset="100%"/>\r            </linearGradient>\r              <linearGradient id="gradient6" x1="50%" y1="0%" x2="50%" y2="100%">\r                    <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#c8c8c8" stop-opacity="1" offset="100%"/>\r            </linearGradient>\r              <linearGradient id="gradient7" x1="50%" y1="-33.3333%" x2="50%" y2="152.0833%">\r                        <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#c8c8c8" stop-opacity="1" offset="100%"/>\r            </linearGradient>\r              <linearGradient id="gradient8" x1="50%" y1="0%" x2="50%" y2="100%">\r                    <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#c8c8c8" stop-opacity="1" offset="100%"/>\r            </linearGradient>\r              <linearGradient id="gradient9" x1="50%" y1="0%" x2="50%" y2="100%">\r                    <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#c8c8c8" stop-opacity="1" offset="100%"/>\r            </linearGradient>\r              <linearGradient id="gradient10" x1="50%" y1="0%" x2="50%" y2="100%">\r                   <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#c8c8c8" stop-opacity="1" offset="100%"/>\r            </linearGradient>\r              <linearGradient id="gradient11" x1="50%" y1="0%" x2="50%" y2="100%">\r                   <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#c8c8c8" stop-opacity="1" offset="100%"/>\r            </linearGradient>\r              <linearGradient id="gradient12" x1="50%" y1="0%" x2="50%" y2="238.75%">\r                        <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#c8c8c8" stop-opacity="1" offset="100%"/>\r            </linearGradient>\r              <linearGradient id="gradient13" x1="40%" y1="-140%" x2="40%" y2="98.75%">\r                      <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#c8c8c8" stop-opacity="1" offset="100%"/>\r            </linearGradient>\r              <linearGradient id="gradient14" x1="50%" y1="0%" x2="50%" y2="238.75%">\r                        <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#c8c8c8" stop-opacity="1" offset="100%"/>\r            </linearGradient>\r              <linearGradient id="gradient15" x1="60%" y1="-140%" x2="60%" y2="98.75%">\r                      <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#c8c8c8" stop-opacity="1" offset="100%"/>\r            </linearGradient>\r              <linearGradient id="gradient16" x1="50%" y1="0%" x2="50%" y2="298.4375%">\r                      <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#c8c8c8" stop-opacity="1" offset="100%"/>\r            </linearGradient>\r              <linearGradient id="gradient17" x1="50%" y1="0%" x2="50%" y2="238.75%">\r                        <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#c8c8c8" stop-opacity="1" offset="100%"/>\r            </linearGradient>\r              <linearGradient id="gradient18" x1="50%" y1="-200%" x2="50%" y2="100%">\r                        <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#c8c8c8" stop-opacity="1" offset="100%"/>\r            </linearGradient>\r              <linearGradient id="gradient19" x1="50%" y1="-200%" x2="50%" y2="110.9375%">\r                   <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#c8c8c8" stop-opacity="1" offset="100%"/>\r            </linearGradient>\r              <linearGradient id="gradient20" x1="55%" y1="0%" x2="55%" y2="100%">\r                   <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#c8c8c8" stop-opacity="1" offset="100%"/>\r            </linearGradient>\r              <linearGradient id="gradient21" x1="50%" y1="0%" x2="50%" y2="100%">\r                   <stop stop-color="#ffffff" stop-opacity="1" offset="0%"/>\r                      <stop stop-color="#c8c8c8" stop-opacity="1" offset="99.4444%"/>\r                </linearGradient>\r      </defs>\r        <g id="BG">\r    </g>\r   <g id="controls">\r              <path id="Line" d="M 98.5 7.5 L 109.5 7.5 " stroke="#ffffff" stroke-width="1" fill="none"/>\r            <path id="Line2" d="M 98.5 3.5 L 109.5 3.5 " stroke="#ffffff" stroke-width="1" fill="none"/>\r           <path id="Line3" d="M 98.5 11.5 L 109.5 11.5 " stroke="#ffffff" stroke-width="1" fill="none"/>\r         <path id="Ellipse" d="M 108 11.5 C 108 10.6716 108.4477 10 109 10 C 109.5523 10 110 10.6716 110 11.5 C 110 12.3284 109.5523 13 109 13 C 108.4477 13 108 12.3284 108 11.5 Z" fill="#ffffff"/>\r           <path id="Ellipse2" d="M 104 7.5 C 104 6.6716 104.4477 6 105 6 C 105.5523 6 106 6.6716 106 7.5 C 106 8.3284 105.5523 9 105 9 C 104.4477 9 104 8.3284 104 7.5 Z" fill="#ffffff"/>\r               <path id="Ellipse3" d="M 108 3.5 C 108 2.6716 108.4477 2 109 2 C 109.5523 2 110 2.6716 110 3.5 C 110 4.3284 109.5523 5 109 5 C 108.4477 5 108 4.3284 108 3.5 Z" fill="#ffffff"/>\r       </g>\r   <g id="backlight">\r             <g id="off">\r                   <rect x="83" y="21" width="10" height="6" stroke="#ffffff" stroke-width="1" fill="#333333"/>\r           </g>\r           <g id="on">\r                    <path id="Ellipse4" d="M 81 8 C 81 5.2385 84.134 3 88 3 C 91.866 3 95 5.2385 95 8 C 95 10.7615 91.866 13 88 13 C 84.134 13 81 10.7615 81 8 Z" fill="url(#gradient1)"/>\r                 <rect x="83" y="5" width="10" height="6" stroke="#ffffff" stroke-width="1" fill="#333333"/>\r            </g>\r   </g>\r   <g id="loop">\r          <g id="on2">\r                   <path d="M 73.795 4.205 C 75.2155 4.8785 76.2 6.3234 76.2 8 C 76.2 10.3196 74.3196 12.2 72 12.2 C 69.6804 12.2 67.8 10.3196 67.8 8 C 67.8 6.3234 68.7845 4.8785 70.205 4.205 L 68.875 2.875 C 67.1501 3.9289 66 5.8306 66 8 C 66 11.3138 68.6862 14 72 14 C 75.3138 14 78 11.3138 78 8 C 78 5.8306 76.8499 3.9289 75.125 2.875 L 73.795 4.205 Z" fill="url(#gradient2)"/>\r                      <path d="M 71 2 L 66 2 L 71 7 L 71 2 Z" fill="url(#gradient3)"/>\r               </g>\r           <g id="off2">\r                  <path d="M 73.795 20.205 C 75.2155 20.8785 76.2 22.3234 76.2 24 C 76.2 26.3196 74.3196 28.2 72 28.2 C 69.6804 28.2 67.8 26.3196 67.8 24 C 67.8 22.3234 68.7845 20.8785 70.205 20.205 L 68.875 18.875 C 67.1501 19.9289 66 21.8306 66 24 C 66 27.3138 68.6862 30 72 30 C 75.3138 30 78 27.3138 78 24 C 78 21.8306 76.8499 19.9289 75.125 18.875 L 73.795 20.205 Z" fill="#a8a8b7"/>\r                     <path d="M 71 18 L 66 18 L 71 23 L 71 18 Z" fill="#a8a8b7"/>\r           </g>\r   </g>\r   <g id="cc">\r            <rect visibility="hidden" x="49" y="2" width="14" height="12" stroke="#b0b0b0" stroke-width="1" fill="none"/>\r          <text visibility="hidden" x="49" y="17" width="14" fill="#ffffff" style="font-size: 10px; color: #ffffff; font-family: Arial; text-align: center; "><tspan><![CDATA[cc]]></tspan></text>\r               <path d="M 55 7 C 50.2813 3.7813 50.063 12.9405 55 10 " stroke="#ffffff" stroke-width="1" fill="none"/>\r                <path d="M 60 7 C 55.2813 3.7813 55.063 12.9405 60 10 " stroke="#ffffff" stroke-width="1" fill="none"/>\r                <path d="M 50 3 L 62 3 L 62 13 L 50 13 L 50 3 ZM 49 2 L 49 14 L 63 14 L 63 2 L 49 2 Z" fill="url(#gradient4)"/>\r                <rect x="49" y="2" width="14" height="12" fill="none"/>\r        </g>\r   <g id="volume">\r                <g id="no%20sound">\r                    <rect x="17" y="5" width="5" height="6" fill="url(#gradient5)"/>\r                       <path d="M 21 5 L 25 2 L 25 14 L 21 11.0625 L 21 5 Z" fill="url(#gradient6)"/>\r         </g>\r           <g id="sound%20bars">\r                  <rect x="17" y="21" width="5" height="6" fill="url(#gradient7)"/>\r                      <path d="M 21 21 L 25 18 L 25 30 L 21 27.0625 L 21 21 Z" fill="url(#gradient8)"/>\r                      <path d="M 27 18 C 27 18 30.0625 17.375 30 24 C 29.9375 30.625 27 30 27 30 " stroke="#ffffff" stroke-width="1" fill="none"/>\r                   <path d="M 26 21.0079 C 26 21.0079 28.041 20.6962 27.9994 24 C 27.9577 27.3038 26 26.9921 26 26.9921 " stroke="#ffffff" stroke-width="1" fill="none"/>\r         </g>\r   </g>\r   <g id="play/pause">\r            <g id="play">\r                  <path id="Polygon" d="M 14 8.5 L 3 14 L 3 3 L 14 8.5 Z" fill="url(#gradient9)"/>\r               </g>\r           <g id="pause">\r                 <rect x="3" y="18" width="3" height="12" fill="url(#gradient10)"/>\r                     <rect x="10" y="18" width="3" height="12" fill="url(#gradient11)"/>\r            </g>\r   </g>\r   <g id="fullscreen">\r            <g id="enter%201">\r                     <path d="M 34 2 L 39 2 L 34 7 L 34 2 Z" fill="url(#gradient12)"/>\r                      <path d="M 34 14 L 39 14 L 34 9 L 34 14 Z" fill="url(#gradient13)"/>\r                   <path d="M 46 2 L 41 2 L 46 7 L 46 2 Z" fill="url(#gradient14)"/>\r                      <path d="M 46 14 L 41 14 L 46 9 L 46 14 Z" fill="url(#gradient15)"/>\r           </g>\r           <g id="exit">\r                  <path d="M 42 22 L 46 22 L 42 18 L 42 22 Z" fill="url(#gradient16)"/>\r                  <path d="M 38 22 L 38 18 L 34 22 L 38 22 Z" fill="url(#gradient17)"/>\r                  <path d="M 38 26 L 34 26 L 38 30 L 38 26 Z" fill="url(#gradient18)"/>\r                  <path d="M 42 26 L 42 30 L 46 26 L 42 26 Z" fill="url(#gradient19)"/>\r          </g>\r   </g>\r   <g id="stop">\r          <rect x="115" y="3" width="10" height="10" fill="url(#gradient20)"/>\r   </g>\r   <g id="chooser">\r               <path d="M 135.2346 6.1522 C 136.2551 5.7295 137.4251 6.2141 137.8478 7.2346 C 138.2704 8.2551 137.7859 9.425 136.7654 9.8478 C 135.7449 10.2705 134.5749 9.7859 134.1522 8.7654 C 133.7295 7.7449 134.2141 6.5749 135.2346 6.1522 ZM 133.2735 1.4176 L 136 4.0054 L 138.7265 1.4176 L 138.8246 5.1754 L 142.5824 5.2735 L 139.9946 8 L 142.5824 10.7265 L 138.8246 10.8246 L 138.7265 14.5824 L 136 11.9946 L 133.2735 14.5824 L 133.1754 10.8246 L 129.4176 10.7265 L 132.0054 8 L 129.4176 5.2735 L 133.1754 5.1754 L 133.2735 1.4176 Z" fill="url(#gradient21)"/>\r  </g>\r</svg>
\ No newline at end of file
diff --git a/wp-includes/js/mediaelement/flashmediaelement.swf b/wp-includes/js/mediaelement/flashmediaelement.swf
new file mode 100644 (file)
index 0000000..c5d205a
Binary files /dev/null and b/wp-includes/js/mediaelement/flashmediaelement.swf differ
diff --git a/wp-includes/js/mediaelement/loading.gif b/wp-includes/js/mediaelement/loading.gif
new file mode 100644 (file)
index 0000000..612222b
Binary files /dev/null and b/wp-includes/js/mediaelement/loading.gif differ
diff --git a/wp-includes/js/mediaelement/mediaelement-and-player.min.js b/wp-includes/js/mediaelement/mediaelement-and-player.min.js
new file mode 100644 (file)
index 0000000..f9d9a0b
--- /dev/null
@@ -0,0 +1,173 @@
+/*!
+* MediaElement.js
+* HTML5 <video> and <audio> shim and player
+* http://mediaelementjs.com/
+*
+* Creates a JavaScript object that mimics HTML5 MediaElement API
+* for browsers that don't understand HTML5 or can't play the provided codec
+* Can play MP4 (H.264), Ogg, WebM, FLV, WMV, WMA, ACC, and MP3
+*
+* Copyright 2010-2013, John Dyer (http://j.hn)
+* License: MIT
+*
+*/var mejs=mejs||{};mejs.version="2.13.0";mejs.meIndex=0;
+mejs.plugins={silverlight:[{version:[3,0],types:["video/mp4","video/m4v","video/mov","video/wmv","audio/wma","audio/m4a","audio/mp3","audio/wav","audio/mpeg"]}],flash:[{version:[9,0,124],types:["video/mp4","video/m4v","video/mov","video/flv","video/rtmp","video/x-flv","audio/flv","audio/x-flv","audio/mp3","audio/m4a","audio/mpeg","video/youtube","video/x-youtube"]}],youtube:[{version:null,types:["video/youtube","video/x-youtube","audio/youtube","audio/x-youtube"]}],vimeo:[{version:null,types:["video/vimeo",
+"video/x-vimeo"]}]};
+mejs.Utility={encodeUrl:function(a){return encodeURIComponent(a)},escapeHTML:function(a){return a.toString().split("&").join("&amp;").split("<").join("&lt;").split('"').join("&quot;")},absolutizeUrl:function(a){var b=document.createElement("div");b.innerHTML='<a href="'+this.escapeHTML(a)+'">x</a>';return b.firstChild.href},getScriptPath:function(a){for(var b=0,c,d="",e="",f,g,h=document.getElementsByTagName("script"),l=h.length,j=a.length;b<l;b++){f=h[b].src;c=f.lastIndexOf("/");if(c>-1){g=f.substring(c+
+1);f=f.substring(0,c+1)}else{g=f;f=""}for(c=0;c<j;c++){e=a[c];e=g.indexOf(e);if(e>-1){d=f;break}}if(d!=="")break}return d},secondsToTimeCode:function(a,b,c,d){if(typeof c=="undefined")c=false;else if(typeof d=="undefined")d=25;var e=Math.floor(a/3600)%24,f=Math.floor(a/60)%60,g=Math.floor(a%60);a=Math.floor((a%1*d).toFixed(3));return(b||e>0?(e<10?"0"+e:e)+":":"")+(f<10?"0"+f:f)+":"+(g<10?"0"+g:g)+(c?":"+(a<10?"0"+a:a):"")},timeCodeToSeconds:function(a,b,c,d){if(typeof c=="undefined")c=false;else if(typeof d==
+"undefined")d=25;a=a.split(":");b=parseInt(a[0],10);var e=parseInt(a[1],10),f=parseInt(a[2],10),g=0,h=0;if(c)g=parseInt(a[3])/d;return h=b*3600+e*60+f+g},convertSMPTEtoSeconds:function(a){if(typeof a!="string")return false;a=a.replace(",",".");var b=0,c=a.indexOf(".")!=-1?a.split(".")[1].length:0,d=1;a=a.split(":").reverse();for(var e=0;e<a.length;e++){d=1;if(e>0)d=Math.pow(60,e);b+=Number(a[e])*d}return Number(b.toFixed(c))},removeSwf:function(a){var b=document.getElementById(a);if(b&&/object|embed/i.test(b.nodeName))if(mejs.MediaFeatures.isIE){b.style.display=
+"none";(function(){b.readyState==4?mejs.Utility.removeObjectInIE(a):setTimeout(arguments.callee,10)})()}else b.parentNode.removeChild(b)},removeObjectInIE:function(a){if(a=document.getElementById(a)){for(var b in a)if(typeof a[b]=="function")a[b]=null;a.parentNode.removeChild(a)}}};
+mejs.PluginDetector={hasPluginVersion:function(a,b){var c=this.plugins[a];b[1]=b[1]||0;b[2]=b[2]||0;return c[0]>b[0]||c[0]==b[0]&&c[1]>b[1]||c[0]==b[0]&&c[1]==b[1]&&c[2]>=b[2]?true:false},nav:window.navigator,ua:window.navigator.userAgent.toLowerCase(),plugins:[],addPlugin:function(a,b,c,d,e){this.plugins[a]=this.detectPlugin(b,c,d,e)},detectPlugin:function(a,b,c,d){var e=[0,0,0],f;if(typeof this.nav.plugins!="undefined"&&typeof this.nav.plugins[a]=="object"){if((c=this.nav.plugins[a].description)&&
+!(typeof this.nav.mimeTypes!="undefined"&&this.nav.mimeTypes[b]&&!this.nav.mimeTypes[b].enabledPlugin)){e=c.replace(a,"").replace(/^\s+/,"").replace(/\sr/gi,".").split(".");for(a=0;a<e.length;a++)e[a]=parseInt(e[a].match(/\d+/),10)}}else if(typeof window.ActiveXObject!="undefined")try{if(f=new ActiveXObject(c))e=d(f)}catch(g){}return e}};
+mejs.PluginDetector.addPlugin("flash","Shockwave Flash","application/x-shockwave-flash","ShockwaveFlash.ShockwaveFlash",function(a){var b=[];if(a=a.GetVariable("$version")){a=a.split(" ")[1].split(",");b=[parseInt(a[0],10),parseInt(a[1],10),parseInt(a[2],10)]}return b});
+mejs.PluginDetector.addPlugin("silverlight","Silverlight Plug-In","application/x-silverlight-2","AgControl.AgControl",function(a){var b=[0,0,0,0],c=function(d,e,f,g){for(;d.isVersionSupported(e[0]+"."+e[1]+"."+e[2]+"."+e[3]);)e[f]+=g;e[f]-=g};c(a,b,0,1);c(a,b,1,1);c(a,b,2,1E4);c(a,b,2,1E3);c(a,b,2,100);c(a,b,2,10);c(a,b,2,1);c(a,b,3,1);return b});
+mejs.MediaFeatures={init:function(){var a=this,b=document,c=mejs.PluginDetector.nav,d=mejs.PluginDetector.ua.toLowerCase(),e,f=["source","track","audio","video"];a.isiPad=d.match(/ipad/i)!==null;a.isiPhone=d.match(/iphone/i)!==null;a.isiOS=a.isiPhone||a.isiPad;a.isAndroid=d.match(/android/i)!==null;a.isBustedAndroid=d.match(/android 2\.[12]/)!==null;a.isBustedNativeHTTPS=location.protocol==="https:"&&(d.match(/android [12]\./)!==null||d.match(/macintosh.* version.* safari/)!==null);a.isIE=c.appName.toLowerCase().indexOf("microsoft")!=
+-1;a.isChrome=d.match(/chrome/gi)!==null;a.isFirefox=d.match(/firefox/gi)!==null;a.isWebkit=d.match(/webkit/gi)!==null;a.isGecko=d.match(/gecko/gi)!==null&&!a.isWebkit;a.isOpera=d.match(/opera/gi)!==null;a.hasTouch="ontouchstart"in window&&window.ontouchstart!=null;a.svg=!!document.createElementNS&&!!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect;for(c=0;c<f.length;c++)e=document.createElement(f[c]);a.supportsMediaTag=typeof e.canPlayType!=="undefined"||a.isBustedAndroid;
+try{e.canPlayType("video/mp4")}catch(g){a.supportsMediaTag=false}a.hasSemiNativeFullScreen=typeof e.webkitEnterFullscreen!=="undefined";a.hasWebkitNativeFullScreen=typeof e.webkitRequestFullScreen!=="undefined";a.hasMozNativeFullScreen=typeof e.mozRequestFullScreen!=="undefined";a.hasTrueNativeFullScreen=a.hasWebkitNativeFullScreen||a.hasMozNativeFullScreen;a.nativeFullScreenEnabled=a.hasTrueNativeFullScreen;if(a.hasMozNativeFullScreen)a.nativeFullScreenEnabled=e.mozFullScreenEnabled;if(this.isChrome)a.hasSemiNativeFullScreen=
+false;if(a.hasTrueNativeFullScreen){a.fullScreenEventName=a.hasWebkitNativeFullScreen?"webkitfullscreenchange":"mozfullscreenchange";a.isFullScreen=function(){if(e.mozRequestFullScreen)return b.mozFullScreen;else if(e.webkitRequestFullScreen)return b.webkitIsFullScreen};a.requestFullScreen=function(h){if(a.hasWebkitNativeFullScreen)h.webkitRequestFullScreen();else a.hasMozNativeFullScreen&&h.mozRequestFullScreen()};a.cancelFullScreen=function(){if(a.hasWebkitNativeFullScreen)document.webkitCancelFullScreen();
+else a.hasMozNativeFullScreen&&document.mozCancelFullScreen()}}if(a.hasSemiNativeFullScreen&&d.match(/mac os x 10_5/i)){a.hasNativeFullScreen=false;a.hasSemiNativeFullScreen=false}}};mejs.MediaFeatures.init();
+mejs.HtmlMediaElement={pluginType:"native",isFullScreen:false,setCurrentTime:function(a){this.currentTime=a},setMuted:function(a){this.muted=a},setVolume:function(a){this.volume=a},stop:function(){this.pause()},setSrc:function(a){for(var b=this.getElementsByTagName("source");b.length>0;)this.removeChild(b[0]);if(typeof a=="string")this.src=a;else{var c;for(b=0;b<a.length;b++){c=a[b];if(this.canPlayType(c.type)){this.src=c.src;break}}}},setVideoSize:function(a,b){this.width=a;this.height=b}};
+mejs.PluginMediaElement=function(a,b,c){this.id=a;this.pluginType=b;this.src=c;this.events={};this.attributes={}};
+mejs.PluginMediaElement.prototype={pluginElement:null,pluginType:"",isFullScreen:false,playbackRate:-1,defaultPlaybackRate:-1,seekable:[],played:[],paused:true,ended:false,seeking:false,duration:0,error:null,tagName:"",muted:false,volume:1,currentTime:0,play:function(){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.playVideo():this.pluginApi.playMedia();this.paused=false}},load:function(){if(this.pluginApi!=null){this.pluginType!="youtube"&&this.pluginApi.loadMedia();this.paused=
+false}},pause:function(){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.pauseVideo():this.pluginApi.pauseMedia();this.paused=true}},stop:function(){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.stopVideo():this.pluginApi.stopMedia();this.paused=true}},canPlayType:function(a){var b,c,d,e=mejs.plugins[this.pluginType];for(b=0;b<e.length;b++){d=e[b];if(mejs.PluginDetector.hasPluginVersion(this.pluginType,d.version))for(c=0;c<d.types.length;c++)if(a==d.types[c])return"probably"}return""},
+positionFullscreenButton:function(a,b,c){this.pluginApi!=null&&this.pluginApi.positionFullscreenButton&&this.pluginApi.positionFullscreenButton(Math.floor(a),Math.floor(b),c)},hideFullscreenButton:function(){this.pluginApi!=null&&this.pluginApi.hideFullscreenButton&&this.pluginApi.hideFullscreenButton()},setSrc:function(a){if(typeof a=="string"){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(a));this.src=mejs.Utility.absolutizeUrl(a)}else{var b,c;for(b=0;b<a.length;b++){c=a[b];if(this.canPlayType(c.type)){this.pluginApi.setSrc(mejs.Utility.absolutizeUrl(c.src));
+this.src=mejs.Utility.absolutizeUrl(a);break}}}},setCurrentTime:function(a){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.seekTo(a):this.pluginApi.setCurrentTime(a);this.currentTime=a}},setVolume:function(a){if(this.pluginApi!=null){this.pluginType=="youtube"?this.pluginApi.setVolume(a*100):this.pluginApi.setVolume(a);this.volume=a}},setMuted:function(a){if(this.pluginApi!=null){if(this.pluginType=="youtube"){a?this.pluginApi.mute():this.pluginApi.unMute();this.muted=a;this.dispatchEvent("volumechange")}else this.pluginApi.setMuted(a);
+this.muted=a}},setVideoSize:function(a,b){if(this.pluginElement.style){this.pluginElement.style.width=a+"px";this.pluginElement.style.height=b+"px"}this.pluginApi!=null&&this.pluginApi.setVideoSize&&this.pluginApi.setVideoSize(a,b)},setFullscreen:function(a){this.pluginApi!=null&&this.pluginApi.setFullscreen&&this.pluginApi.setFullscreen(a)},enterFullScreen:function(){this.pluginApi!=null&&this.pluginApi.setFullscreen&&this.setFullscreen(true)},exitFullScreen:function(){this.pluginApi!=null&&this.pluginApi.setFullscreen&&
+this.setFullscreen(false)},addEventListener:function(a,b){this.events[a]=this.events[a]||[];this.events[a].push(b)},removeEventListener:function(a,b){if(!a){this.events={};return true}var c=this.events[a];if(!c)return true;if(!b){this.events[a]=[];return true}for(i=0;i<c.length;i++)if(c[i]===b){this.events[a].splice(i,1);return true}return false},dispatchEvent:function(a){var b,c,d=this.events[a];if(d){c=Array.prototype.slice.call(arguments,1);for(b=0;b<d.length;b++)d[b].apply(null,c)}},hasAttribute:function(a){return a in
+this.attributes},removeAttribute:function(a){delete this.attributes[a]},getAttribute:function(a){if(this.hasAttribute(a))return this.attributes[a];return""},setAttribute:function(a,b){this.attributes[a]=b},remove:function(){mejs.Utility.removeSwf(this.pluginElement.id);mejs.MediaPluginBridge.unregisterPluginElement(this.pluginElement.id)}};
+mejs.MediaPluginBridge={pluginMediaElements:{},htmlMediaElements:{},registerPluginElement:function(a,b,c){this.pluginMediaElements[a]=b;this.htmlMediaElements[a]=c},unregisterPluginElement:function(a){delete this.pluginMediaElements[a];delete this.htmlMediaElements[a]},initPlugin:function(a){var b=this.pluginMediaElements[a],c=this.htmlMediaElements[a];if(b){switch(b.pluginType){case "flash":b.pluginElement=b.pluginApi=document.getElementById(a);break;case "silverlight":b.pluginElement=document.getElementById(b.id);
+b.pluginApi=b.pluginElement.Content.MediaElementJS}b.pluginApi!=null&&b.success&&b.success(b,c)}},fireEvent:function(a,b,c){var d,e;if(a=this.pluginMediaElements[a]){b={type:b,target:a};for(d in c){a[d]=c[d];b[d]=c[d]}e=c.bufferedTime||0;b.target.buffered=b.buffered={start:function(){return 0},end:function(){return e},length:1};a.dispatchEvent(b.type,b)}}};
+mejs.MediaElementDefaults={mode:"auto",plugins:["flash","silverlight","youtube","vimeo"],enablePluginDebug:false,httpsBasicAuthSite:false,type:"",pluginPath:mejs.Utility.getScriptPath(["mediaelement.js","mediaelement.min.js","mediaelement-and-player.js","mediaelement-and-player.min.js"]),flashName:"flashmediaelement.swf",flashStreamer:"",enablePluginSmoothing:false,enablePseudoStreaming:false,pseudoStreamingStartQueryParam:"start",silverlightName:"silverlightmediaelement.xap",defaultVideoWidth:480,
+defaultVideoHeight:270,pluginWidth:-1,pluginHeight:-1,pluginVars:[],timerRate:250,startVolume:0.8,success:function(){},error:function(){}};mejs.MediaElement=function(a,b){return mejs.HtmlMediaElementShim.create(a,b)};
+mejs.HtmlMediaElementShim={create:function(a,b){var c=mejs.MediaElementDefaults,d=typeof a=="string"?document.getElementById(a):a,e=d.tagName.toLowerCase(),f=e==="audio"||e==="video",g=f?d.getAttribute("src"):d.getAttribute("href");e=d.getAttribute("poster");var h=d.getAttribute("autoplay"),l=d.getAttribute("preload"),j=d.getAttribute("controls"),k;for(k in b)c[k]=b[k];g=typeof g=="undefined"||g===null||g==""?null:g;e=typeof e=="undefined"||e===null?"":e;l=typeof l=="undefined"||l===null||l==="false"?
+"none":l;h=!(typeof h=="undefined"||h===null||h==="false");j=!(typeof j=="undefined"||j===null||j==="false");k=this.determinePlayback(d,c,mejs.MediaFeatures.supportsMediaTag,f,g);k.url=k.url!==null?mejs.Utility.absolutizeUrl(k.url):"";if(k.method=="native"){if(mejs.MediaFeatures.isBustedAndroid){d.src=k.url;d.addEventListener("click",function(){d.play()},false)}return this.updateNative(k,c,h,l)}else if(k.method!=="")return this.createPlugin(k,c,e,h,l,j);else{this.createErrorMessage(k,c,e);return this}},
+determinePlayback:function(a,b,c,d,e){var f=[],g,h,l,j={method:"",url:"",htmlMediaElement:a,isVideo:a.tagName.toLowerCase()!="audio"},k;if(typeof b.type!="undefined"&&b.type!=="")if(typeof b.type=="string")f.push({type:b.type,url:e});else for(g=0;g<b.type.length;g++)f.push({type:b.type[g],url:e});else if(e!==null){l=this.formatType(e,a.getAttribute("type"));f.push({type:l,url:e})}else for(g=0;g<a.childNodes.length;g++){h=a.childNodes[g];if(h.nodeType==1&&h.tagName.toLowerCase()=="source"){e=h.getAttribute("src");
+l=this.formatType(e,h.getAttribute("type"));h=h.getAttribute("media");if(!h||!window.matchMedia||window.matchMedia&&window.matchMedia(h).matches)f.push({type:l,url:e})}}if(!d&&f.length>0&&f[0].url!==null&&this.getTypeFromFile(f[0].url).indexOf("audio")>-1)j.isVideo=false;if(mejs.MediaFeatures.isBustedAndroid)a.canPlayType=function(m){return m.match(/video\/(mp4|m4v)/gi)!==null?"maybe":""};if(c&&(b.mode==="auto"||b.mode==="auto_plugin"||b.mode==="native")&&!(mejs.MediaFeatures.isBustedNativeHTTPS&&
+b.httpsBasicAuthSite===true)){if(!d){g=document.createElement(j.isVideo?"video":"audio");a.parentNode.insertBefore(g,a);a.style.display="none";j.htmlMediaElement=a=g}for(g=0;g<f.length;g++)if(a.canPlayType(f[g].type).replace(/no/,"")!==""||a.canPlayType(f[g].type.replace(/mp3/,"mpeg")).replace(/no/,"")!==""){j.method="native";j.url=f[g].url;break}if(j.method==="native"){if(j.url!==null)a.src=j.url;if(b.mode!=="auto_plugin")return j}}if(b.mode==="auto"||b.mode==="auto_plugin"||b.mode==="shim")for(g=
+0;g<f.length;g++){l=f[g].type;for(a=0;a<b.plugins.length;a++){e=b.plugins[a];h=mejs.plugins[e];for(c=0;c<h.length;c++){k=h[c];if(k.version==null||mejs.PluginDetector.hasPluginVersion(e,k.version))for(d=0;d<k.types.length;d++)if(l==k.types[d]){j.method=e;j.url=f[g].url;return j}}}}if(b.mode==="auto_plugin"&&j.method==="native")return j;if(j.method===""&&f.length>0)j.url=f[0].url;return j},formatType:function(a,b){return a&&!b?this.getTypeFromFile(a):b&&~b.indexOf(";")?b.substr(0,b.indexOf(";")):b},
+getTypeFromFile:function(a){a=a.split("?")[0];a=a.substring(a.lastIndexOf(".")+1).toLowerCase();return(/(mp4|m4v|ogg|ogv|webm|webmv|flv|wmv|mpeg|mov)/gi.test(a)?"video":"audio")+"/"+this.getTypeFromExtension(a)},getTypeFromExtension:function(a){switch(a){case "mp4":case "m4v":return"mp4";case "webm":case "webma":case "webmv":return"webm";case "ogg":case "oga":case "ogv":return"ogg";default:return a}},createErrorMessage:function(a,b,c){var d=a.htmlMediaElement,e=document.createElement("div");e.className=
+"me-cannotplay";try{e.style.width=d.width+"px";e.style.height=d.height+"px"}catch(f){}e.innerHTML=b.customError?b.customError:c!==""?'<a href="'+a.url+'"><img src="'+c+'" width="100%" height="100%" /></a>':'<a href="'+a.url+'"><span>'+mejs.i18n.t("Download File")+"</span></a>";d.parentNode.insertBefore(e,d);d.style.display="none";b.error(d)},createPlugin:function(a,b,c,d,e,f){c=a.htmlMediaElement;var g=1,h=1,l="me_"+a.method+"_"+mejs.meIndex++,j=new mejs.PluginMediaElement(l,a.method,a.url),k=document.createElement("div"),
+m;j.tagName=c.tagName;for(m=0;m<c.attributes.length;m++){var n=c.attributes[m];n.specified==true&&j.setAttribute(n.name,n.value)}for(m=c.parentNode;m!==null&&m.tagName.toLowerCase()!="body";){if(m.parentNode.tagName.toLowerCase()=="p"){m.parentNode.parentNode.insertBefore(m,m.parentNode);break}m=m.parentNode}if(a.isVideo){g=b.pluginWidth>0?b.pluginWidth:b.videoWidth>0?b.videoWidth:c.getAttribute("width")!==null?c.getAttribute("width"):b.defaultVideoWidth;h=b.pluginHeight>0?b.pluginHeight:b.videoHeight>
+0?b.videoHeight:c.getAttribute("height")!==null?c.getAttribute("height"):b.defaultVideoHeight;g=mejs.Utility.encodeUrl(g);h=mejs.Utility.encodeUrl(h)}else if(b.enablePluginDebug){g=320;h=240}j.success=b.success;mejs.MediaPluginBridge.registerPluginElement(l,j,c);k.className="me-plugin";k.id=l+"_container";a.isVideo?c.parentNode.insertBefore(k,c):document.body.insertBefore(k,document.body.childNodes[0]);d=["id="+l,"isvideo="+(a.isVideo?"true":"false"),"autoplay="+(d?"true":"false"),"preload="+e,"width="+
+g,"startvolume="+b.startVolume,"timerrate="+b.timerRate,"flashstreamer="+b.flashStreamer,"height="+h,"pseudostreamstart="+b.pseudoStreamingStartQueryParam];if(a.url!==null)a.method=="flash"?d.push("file="+mejs.Utility.encodeUrl(a.url)):d.push("file="+a.url);b.enablePluginDebug&&d.push("debug=true");b.enablePluginSmoothing&&d.push("smoothing=true");b.enablePseudoStreaming&&d.push("pseudostreaming=true");f&&d.push("controls=true");if(b.pluginVars)d=d.concat(b.pluginVars);switch(a.method){case "silverlight":k.innerHTML=
+'<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="'+l+'" name="'+l+'" width="'+g+'" height="'+h+'" class="mejs-shim"><param name="initParams" value="'+d.join(",")+'" /><param name="windowless" value="true" /><param name="background" value="black" /><param name="minRuntimeVersion" value="3.0.0.0" /><param name="autoUpgrade" value="true" /><param name="source" value="'+b.pluginPath+b.silverlightName+'" /></object>';break;case "flash":if(mejs.MediaFeatures.isIE){a=
+document.createElement("div");k.appendChild(a);a.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+l+'" width="'+g+'" height="'+h+'" class="mejs-shim"><param name="movie" value="'+b.pluginPath+b.flashName+"?x="+new Date+'" /><param name="flashvars" value="'+d.join("&amp;")+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>'}else k.innerHTML=
+'<embed id="'+l+'" name="'+l+'" play="true" loop="false" quality="high" bgcolor="#000000" wmode="transparent" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="//www.macromedia.com/go/getflashplayer" src="'+b.pluginPath+b.flashName+'" flashvars="'+d.join("&")+'" width="'+g+'" height="'+h+'" class="mejs-shim"></embed>';break;case "youtube":b=a.url.substr(a.url.lastIndexOf("=")+1);youtubeSettings={container:k,containerId:k.id,pluginMediaElement:j,pluginId:l,
+videoId:b,height:h,width:g};mejs.PluginDetector.hasPluginVersion("flash",[10,0,0])?mejs.YouTubeApi.createFlash(youtubeSettings):mejs.YouTubeApi.enqueueIframe(youtubeSettings);break;case "vimeo":j.vimeoid=a.url.substr(a.url.lastIndexOf("/")+1);k.innerHTML='<iframe src="http://player.vimeo.com/video/'+j.vimeoid+'?portrait=0&byline=0&title=0" width="'+g+'" height="'+h+'" frameborder="0" class="mejs-shim"></iframe>'}c.style.display="none";c.removeAttribute("autoplay");return j},updateNative:function(a,
+b){var c=a.htmlMediaElement,d;for(d in mejs.HtmlMediaElement)c[d]=mejs.HtmlMediaElement[d];b.success(c,c);return c}};
+mejs.YouTubeApi={isIframeStarted:false,isIframeLoaded:false,loadIframeApi:function(){if(!this.isIframeStarted){var a=document.createElement("script");a.src="//www.youtube.com/player_api";var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b);this.isIframeStarted=true}},iframeQueue:[],enqueueIframe:function(a){if(this.isLoaded)this.createIframe(a);else{this.loadIframeApi();this.iframeQueue.push(a)}},createIframe:function(a){var b=a.pluginMediaElement,c=new YT.Player(a.containerId,
+{height:a.height,width:a.width,videoId:a.videoId,playerVars:{controls:0},events:{onReady:function(){a.pluginMediaElement.pluginApi=c;mejs.MediaPluginBridge.initPlugin(a.pluginId);setInterval(function(){mejs.YouTubeApi.createEvent(c,b,"timeupdate")},250)},onStateChange:function(d){mejs.YouTubeApi.handleStateChange(d.data,c,b)}}})},createEvent:function(a,b,c){c={type:c,target:b};if(a&&a.getDuration){b.currentTime=c.currentTime=a.getCurrentTime();b.duration=c.duration=a.getDuration();c.paused=b.paused;
+c.ended=b.ended;c.muted=a.isMuted();c.volume=a.getVolume()/100;c.bytesTotal=a.getVideoBytesTotal();c.bufferedBytes=a.getVideoBytesLoaded();var d=c.bufferedBytes/c.bytesTotal*c.duration;c.target.buffered=c.buffered={start:function(){return 0},end:function(){return d},length:1}}b.dispatchEvent(c.type,c)},iFrameReady:function(){for(this.isIframeLoaded=this.isLoaded=true;this.iframeQueue.length>0;)this.createIframe(this.iframeQueue.pop())},flashPlayers:{},createFlash:function(a){this.flashPlayers[a.pluginId]=
+a;var b,c="//www.youtube.com/apiplayer?enablejsapi=1&amp;playerapiid="+a.pluginId+"&amp;version=3&amp;autoplay=0&amp;controls=0&amp;modestbranding=1&loop=0";if(mejs.MediaFeatures.isIE){b=document.createElement("div");a.container.appendChild(b);b.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab" id="'+a.pluginId+'" width="'+a.width+'" height="'+a.height+'" class="mejs-shim"><param name="movie" value="'+
+c+'" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /></object>'}else a.container.innerHTML='<object type="application/x-shockwave-flash" id="'+a.pluginId+'" data="'+c+'" width="'+a.width+'" height="'+a.height+'" style="visibility: visible; " class="mejs-shim"><param name="allowScriptAccess" value="always"><param name="wmode" value="transparent"></object>'},flashReady:function(a){var b=this.flashPlayers[a],c=
+document.getElementById(a),d=b.pluginMediaElement;d.pluginApi=d.pluginElement=c;mejs.MediaPluginBridge.initPlugin(a);c.cueVideoById(b.videoId);a=b.containerId+"_callback";window[a]=function(e){mejs.YouTubeApi.handleStateChange(e,c,d)};c.addEventListener("onStateChange",a);setInterval(function(){mejs.YouTubeApi.createEvent(c,d,"timeupdate")},250)},handleStateChange:function(a,b,c){switch(a){case -1:c.paused=true;c.ended=true;mejs.YouTubeApi.createEvent(b,c,"loadedmetadata");break;case 0:c.paused=false;
+c.ended=true;mejs.YouTubeApi.createEvent(b,c,"ended");break;case 1:c.paused=false;c.ended=false;mejs.YouTubeApi.createEvent(b,c,"play");mejs.YouTubeApi.createEvent(b,c,"playing");break;case 2:c.paused=true;c.ended=false;mejs.YouTubeApi.createEvent(b,c,"pause");break;case 3:mejs.YouTubeApi.createEvent(b,c,"progress")}}};function onYouTubePlayerAPIReady(){mejs.YouTubeApi.iFrameReady()}function onYouTubePlayerReady(a){mejs.YouTubeApi.flashReady(a)}window.mejs=mejs;window.MediaElement=mejs.MediaElement;
+(function(a,b){var c={locale:{language:"",strings:{}},methods:{}};c.locale.getLanguage=function(){return c.locale.language||navigator.language};if(typeof mejsL10n!="undefined")c.locale.language=mejsL10n.language;c.locale.INIT_LANGUAGE=c.locale.getLanguage();c.methods.checkPlain=function(d){var e,f,g={"&":"&amp;",'"':"&quot;","<":"&lt;",">":"&gt;"};d=String(d);for(e in g)if(g.hasOwnProperty(e)){f=RegExp(e,"g");d=d.replace(f,g[e])}return d};c.methods.formatString=function(d,e){for(var f in e){switch(f.charAt(0)){case "@":e[f]=
+c.methods.checkPlain(e[f]);break;case "!":break;default:e[f]='<em class="placeholder">'+c.methods.checkPlain(e[f])+"</em>"}d=d.replace(f,e[f])}return d};c.methods.t=function(d,e,f){if(c.locale.strings&&c.locale.strings[f.context]&&c.locale.strings[f.context][d])d=c.locale.strings[f.context][d];if(e)d=c.methods.formatString(d,e);return d};c.t=function(d,e,f){if(typeof d==="string"&&d.length>0){var g=c.locale.getLanguage();f=f||{context:g};return c.methods.t(d,e,f)}else throw{name:"InvalidArgumentException",
+message:"First argument is either not a string or empty."};};b.i18n=c})(document,mejs);(function(a){if(typeof mejsL10n!="undefined")a[mejsL10n.language]=mejsL10n.strings})(mejs.i18n.locale.strings);(function(a){a.de={Fullscreen:"Vollbild","Go Fullscreen":"Vollbild an","Turn off Fullscreen":"Vollbild aus",Close:"Schlie\u00dfen"}})(mejs.i18n.locale.strings);
+(function(a){a.zh={Fullscreen:"\u5168\u87a2\u5e55","Go Fullscreen":"\u5168\u5c4f\u6a21\u5f0f","Turn off Fullscreen":"\u9000\u51fa\u5168\u5c4f\u6a21\u5f0f",Close:"\u95dc\u9589"}})(mejs.i18n.locale.strings);
+
+/*!
+ * MediaElementPlayer
+ * http://mediaelementjs.com/
+ *
+ * Creates a controller bar for HTML5 <video> add <audio> tags
+ * using jQuery and MediaElement.js (HTML5 Flash/Silverlight wrapper)
+ *
+ * Copyright 2010-2013, John Dyer (http://j.hn/)
+ * License: MIT
+ *
+ */if(typeof jQuery!="undefined")mejs.$=jQuery;else if(typeof ender!="undefined")mejs.$=ender;
+(function(f){mejs.MepDefaults={poster:"",showPosterWhenEnded:false,defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,defaultAudioWidth:400,defaultAudioHeight:30,defaultSeekBackwardInterval:function(a){return a.duration*0.05},defaultSeekForwardInterval:function(a){return a.duration*0.05},audioWidth:-1,audioHeight:-1,startVolume:0.8,loop:false,autoRewind:true,enableAutosize:true,alwaysShowHours:false,showTimecodeFrameCount:false,framesPerSecond:25,autosizeProgress:true,alwaysShowControls:false,
+hideVideoControlsOnLoad:false,clickToPlayPause:true,iPadUseNativeControls:false,iPhoneUseNativeControls:false,AndroidUseNativeControls:false,features:["playpause","current","progress","duration","tracks","volume","fullscreen"],isVideo:true,enableKeyboard:true,pauseOtherPlayers:true,keyActions:[{keys:[32,179],action:function(a,b){b.paused||b.ended?b.play():b.pause()}},{keys:[38],action:function(a,b){b.setVolume(Math.min(b.volume+0.1,1))}},{keys:[40],action:function(a,b){b.setVolume(Math.max(b.volume-
+0.1,0))}},{keys:[37,227],action:function(a,b){if(!isNaN(b.duration)&&b.duration>0){if(a.isVideo){a.showControls();a.startControlsTimer()}var c=Math.max(b.currentTime-a.options.defaultSeekBackwardInterval(b),0);b.setCurrentTime(c)}}},{keys:[39,228],action:function(a,b){if(!isNaN(b.duration)&&b.duration>0){if(a.isVideo){a.showControls();a.startControlsTimer()}var c=Math.min(b.currentTime+a.options.defaultSeekForwardInterval(b),b.duration);b.setCurrentTime(c)}}},{keys:[70],action:function(a){if(typeof a.enterFullScreen!=
+"undefined")a.isFullScreen?a.exitFullScreen():a.enterFullScreen()}}]};mejs.mepIndex=0;mejs.players={};mejs.MediaElementPlayer=function(a,b){if(!(this instanceof mejs.MediaElementPlayer))return new mejs.MediaElementPlayer(a,b);this.$media=this.$node=f(a);this.node=this.media=this.$media[0];if(typeof this.node.player!="undefined")return this.node.player;else this.node.player=this;if(typeof b=="undefined")b=this.$node.data("mejsoptions");this.options=f.extend({},mejs.MepDefaults,b);this.id="mep_"+mejs.mepIndex++;
+mejs.players[this.id]=this;this.init();return this};mejs.MediaElementPlayer.prototype={hasFocus:false,controlsAreVisible:true,init:function(){var a=this,b=mejs.MediaFeatures,c=f.extend(true,{},a.options,{success:function(d,g){a.meReady(d,g)},error:function(d){a.handleError(d)}}),e=a.media.tagName.toLowerCase();a.isDynamic=e!=="audio"&&e!=="video";a.isVideo=a.isDynamic?a.options.isVideo:e!=="audio"&&a.options.isVideo;if(b.isiPad&&a.options.iPadUseNativeControls||b.isiPhone&&a.options.iPhoneUseNativeControls){a.$media.attr("controls",
+"controls");if(b.isiPad&&a.media.getAttribute("autoplay")!==null){a.media.load();a.media.play()}}else if(!(b.isAndroid&&a.options.AndroidUseNativeControls)){a.$media.removeAttr("controls");a.container=f('<div id="'+a.id+'" class="mejs-container '+(mejs.MediaFeatures.svg?"svg":"no-svg")+'"><div class="mejs-inner"><div class="mejs-mediaelement"></div><div class="mejs-layers"></div><div class="mejs-controls"></div><div class="mejs-clear"></div></div></div>').addClass(a.$media[0].className).insertBefore(a.$media);
+a.container.addClass((b.isAndroid?"mejs-android ":"")+(b.isiOS?"mejs-ios ":"")+(b.isiPad?"mejs-ipad ":"")+(b.isiPhone?"mejs-iphone ":"")+(a.isVideo?"mejs-video ":"mejs-audio "));if(b.isiOS){b=a.$media.clone();a.container.find(".mejs-mediaelement").append(b);a.$media.remove();a.$node=a.$media=b;a.node=a.media=b[0]}else a.container.find(".mejs-mediaelement").append(a.$media);a.controls=a.container.find(".mejs-controls");a.layers=a.container.find(".mejs-layers");b=a.isVideo?"video":"audio";e=b.substring(0,
+1).toUpperCase()+b.substring(1);a.width=a.options[b+"Width"]>0||a.options[b+"Width"].toString().indexOf("%")>-1?a.options[b+"Width"]:a.media.style.width!==""&&a.media.style.width!==null?a.media.style.width:a.media.getAttribute("width")!==null?a.$media.attr("width"):a.options["default"+e+"Width"];a.height=a.options[b+"Height"]>0||a.options[b+"Height"].toString().indexOf("%")>-1?a.options[b+"Height"]:a.media.style.height!==""&&a.media.style.height!==null?a.media.style.height:a.$media[0].getAttribute("height")!==
+null?a.$media.attr("height"):a.options["default"+e+"Height"];a.setPlayerSize(a.width,a.height);c.pluginWidth=a.width;c.pluginHeight=a.height}mejs.MediaElement(a.$media[0],c);typeof a.container!="undefined"&&a.controlsAreVisible&&a.container.trigger("controlsshown")},showControls:function(a){var b=this;a=typeof a=="undefined"||a;if(!b.controlsAreVisible){if(a){b.controls.css("visibility","visible").stop(true,true).fadeIn(200,function(){b.controlsAreVisible=true;b.container.trigger("controlsshown")});
+b.container.find(".mejs-control").css("visibility","visible").stop(true,true).fadeIn(200,function(){b.controlsAreVisible=true})}else{b.controls.css("visibility","visible").css("display","block");b.container.find(".mejs-control").css("visibility","visible").css("display","block");b.controlsAreVisible=true;b.container.trigger("controlsshown")}b.setControlsSize()}},hideControls:function(a){var b=this;a=typeof a=="undefined"||a;if(!(!b.controlsAreVisible||b.options.alwaysShowControls))if(a){b.controls.stop(true,
+true).fadeOut(200,function(){f(this).css("visibility","hidden").css("display","block");b.controlsAreVisible=false;b.container.trigger("controlshidden")});b.container.find(".mejs-control").stop(true,true).fadeOut(200,function(){f(this).css("visibility","hidden").css("display","block")})}else{b.controls.css("visibility","hidden").css("display","block");b.container.find(".mejs-control").css("visibility","hidden").css("display","block");b.controlsAreVisible=false;b.container.trigger("controlshidden")}},
+controlsTimer:null,startControlsTimer:function(a){var b=this;a=typeof a!="undefined"?a:1500;b.killControlsTimer("start");b.controlsTimer=setTimeout(function(){b.hideControls();b.killControlsTimer("hide")},a)},killControlsTimer:function(){if(this.controlsTimer!==null){clearTimeout(this.controlsTimer);delete this.controlsTimer;this.controlsTimer=null}},controlsEnabled:true,disableControls:function(){this.killControlsTimer();this.hideControls(false);this.controlsEnabled=false},enableControls:function(){this.showControls(false);
+this.controlsEnabled=true},meReady:function(a,b){var c=this,e=mejs.MediaFeatures,d=b.getAttribute("autoplay");d=!(typeof d=="undefined"||d===null||d==="false");var g;if(!c.created){c.created=true;c.media=a;c.domNode=b;if(!(e.isAndroid&&c.options.AndroidUseNativeControls)&&!(e.isiPad&&c.options.iPadUseNativeControls)&&!(e.isiPhone&&c.options.iPhoneUseNativeControls)){c.buildposter(c,c.controls,c.layers,c.media);c.buildkeyboard(c,c.controls,c.layers,c.media);c.buildoverlays(c,c.controls,c.layers,c.media);
+c.findTracks();for(g in c.options.features){e=c.options.features[g];if(c["build"+e])try{c["build"+e](c,c.controls,c.layers,c.media)}catch(k){}}c.container.trigger("controlsready");c.setPlayerSize(c.width,c.height);c.setControlsSize();if(c.isVideo){if(mejs.MediaFeatures.hasTouch)c.$media.bind("touchstart",function(){if(c.controlsAreVisible)c.hideControls(false);else c.controlsEnabled&&c.showControls(false)});else{mejs.MediaElementPlayer.prototype.clickToPlayPauseCallback=function(){if(c.options.clickToPlayPause)c.media.paused?
+c.media.play():c.media.pause()};c.media.addEventListener("click",c.clickToPlayPauseCallback,false);c.container.bind("mouseenter mouseover",function(){if(c.controlsEnabled)if(!c.options.alwaysShowControls){c.killControlsTimer("enter");c.showControls();c.startControlsTimer(2500)}}).bind("mousemove",function(){if(c.controlsEnabled){c.controlsAreVisible||c.showControls();c.options.alwaysShowControls||c.startControlsTimer(2500)}}).bind("mouseleave",function(){c.controlsEnabled&&!c.media.paused&&!c.options.alwaysShowControls&&
+c.startControlsTimer(1E3)})}c.options.hideVideoControlsOnLoad&&c.hideControls(false);d&&!c.options.alwaysShowControls&&c.hideControls();c.options.enableAutosize&&c.media.addEventListener("loadedmetadata",function(j){if(c.options.videoHeight<=0&&c.domNode.getAttribute("height")===null&&!isNaN(j.target.videoHeight)){c.setPlayerSize(j.target.videoWidth,j.target.videoHeight);c.setControlsSize();c.media.setVideoSize(j.target.videoWidth,j.target.videoHeight)}},false)}a.addEventListener("play",function(){for(var j in mejs.players){var m=
+mejs.players[j];m.id!=c.id&&c.options.pauseOtherPlayers&&!m.paused&&!m.ended&&m.pause();m.hasFocus=false}c.hasFocus=true},false);c.media.addEventListener("ended",function(){if(c.options.autoRewind)try{c.media.setCurrentTime(0)}catch(j){}c.media.pause();c.setProgressRail&&c.setProgressRail();c.setCurrentRail&&c.setCurrentRail();if(c.options.loop)c.media.play();else!c.options.alwaysShowControls&&c.controlsEnabled&&c.showControls()},false);c.media.addEventListener("loadedmetadata",function(){c.updateDuration&&
+c.updateDuration();c.updateCurrent&&c.updateCurrent();if(!c.isFullScreen){c.setPlayerSize(c.width,c.height);c.setControlsSize()}},false);setTimeout(function(){c.setPlayerSize(c.width,c.height);c.setControlsSize()},50);c.globalBind("resize",function(){c.isFullScreen||mejs.MediaFeatures.hasTrueNativeFullScreen&&document.webkitIsFullScreen||c.setPlayerSize(c.width,c.height);c.setControlsSize()});c.media.pluginType=="youtube"&&c.container.find(".mejs-overlay-play").hide()}if(d&&a.pluginType=="native"){a.load();
+a.play()}if(c.options.success)typeof c.options.success=="string"?window[c.options.success](c.media,c.domNode,c):c.options.success(c.media,c.domNode,c)}},handleError:function(a){this.controls.hide();this.options.error&&this.options.error(a)},setPlayerSize:function(a,b){if(typeof a!="undefined")this.width=a;if(typeof b!="undefined")this.height=b;if(this.height.toString().indexOf("%")>0||this.$node.css("max-width")==="100%"||parseInt(this.$node.css("max-width").replace(/px/,""),10)/this.$node.offsetParent().width()===
+1||this.$node[0].currentStyle&&this.$node[0].currentStyle.maxWidth==="100%"){var c=this.isVideo?this.media.videoWidth&&this.media.videoWidth>0?this.media.videoWidth:this.options.defaultVideoWidth:this.options.defaultAudioWidth,e=this.isVideo?this.media.videoHeight&&this.media.videoHeight>0?this.media.videoHeight:this.options.defaultVideoHeight:this.options.defaultAudioHeight,d=this.container.parent().closest(":visible").width();c=this.isVideo||!this.options.autosizeProgress?parseInt(d*e/c,10):e;if(this.container.parent()[0].tagName.toLowerCase()===
+"body"){d=f(window).width();c=f(window).height()}if(c!=0&&d!=0){this.container.width(d).height(c);this.$media.add(this.container.find(".mejs-shim")).width("100%").height("100%");this.isVideo&&this.media.setVideoSize&&this.media.setVideoSize(d,c);this.layers.children(".mejs-layer").width("100%").height("100%")}}else{this.container.width(this.width).height(this.height);this.layers.children(".mejs-layer").width(this.width).height(this.height)}d=this.layers.find(".mejs-overlay-play");c=d.find(".mejs-overlay-button");
+d.height(this.container.height()-this.controls.height());c.css("margin-top","-"+(c.height()/2-this.controls.height()/2).toString()+"px")},setControlsSize:function(){var a=0,b=0,c=this.controls.find(".mejs-time-rail"),e=this.controls.find(".mejs-time-total");this.controls.find(".mejs-time-current");this.controls.find(".mejs-time-loaded");var d=c.siblings();if(this.options&&!this.options.autosizeProgress)b=parseInt(c.css("width"));if(b===0||!b){d.each(function(){var g=f(this);if(g.css("position")!=
+"absolute"&&g.is(":visible"))a+=f(this).outerWidth(true)});b=this.controls.width()-a-(c.outerWidth(true)-c.width())}c.width(b);e.width(b-(e.outerWidth(true)-e.width()));this.setProgressRail&&this.setProgressRail();this.setCurrentRail&&this.setCurrentRail()},buildposter:function(a,b,c,e){var d=f('<div class="mejs-poster mejs-layer"></div>').appendTo(c);b=a.$media.attr("poster");if(a.options.poster!=="")b=a.options.poster;b!==""&&b!=null?this.setPoster(b):d.hide();e.addEventListener("play",function(){d.hide()},
+false);a.options.showPosterWhenEnded&&a.options.autoRewind&&e.addEventListener("ended",function(){d.show()},false)},setPoster:function(a){var b=this.container.find(".mejs-poster"),c=b.find("img");if(c.length==0)c=f('<img width="100%" height="100%" />').appendTo(b);c.attr("src",a);b.css({"background-image":"url("+a+")"})},buildoverlays:function(a,b,c,e){var d=this;if(a.isVideo){var g=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-loading"><span></span></div></div>').hide().appendTo(c),
+k=f('<div class="mejs-overlay mejs-layer"><div class="mejs-overlay-error"></div></div>').hide().appendTo(c),j=f('<div class="mejs-overlay mejs-layer mejs-overlay-play"><div class="mejs-overlay-button"></div></div>').appendTo(c).click(function(){if(d.options.clickToPlayPause)e.paused?e.play():e.pause()});e.addEventListener("play",function(){j.hide();g.hide();b.find(".mejs-time-buffering").hide();k.hide()},false);e.addEventListener("playing",function(){j.hide();g.hide();b.find(".mejs-time-buffering").hide();
+k.hide()},false);e.addEventListener("seeking",function(){g.show();b.find(".mejs-time-buffering").show()},false);e.addEventListener("seeked",function(){g.hide();b.find(".mejs-time-buffering").hide()},false);e.addEventListener("pause",function(){mejs.MediaFeatures.isiPhone||j.show()},false);e.addEventListener("waiting",function(){g.show();b.find(".mejs-time-buffering").show()},false);e.addEventListener("loadeddata",function(){g.show();b.find(".mejs-time-buffering").show()},false);e.addEventListener("canplay",
+function(){g.hide();b.find(".mejs-time-buffering").hide()},false);e.addEventListener("error",function(){g.hide();b.find(".mejs-time-buffering").hide();k.show();k.find("mejs-overlay-error").html("Error loading this resource")},false)}},buildkeyboard:function(a,b,c,e){this.globalBind("keydown",function(d){if(a.hasFocus&&a.options.enableKeyboard)for(var g=0,k=a.options.keyActions.length;g<k;g++)for(var j=a.options.keyActions[g],m=0,q=j.keys.length;m<q;m++)if(d.keyCode==j.keys[m]){d.preventDefault();
+j.action(a,e,d.keyCode);return false}return true});this.globalBind("click",function(d){if(f(d.target).closest(".mejs-container").length==0)a.hasFocus=false})},findTracks:function(){var a=this,b=a.$media.find("track");a.tracks=[];b.each(function(c,e){e=f(e);a.tracks.push({srclang:e.attr("srclang")?e.attr("srclang").toLowerCase():"",src:e.attr("src"),kind:e.attr("kind"),label:e.attr("label")||"",entries:[],isLoaded:false})})},changeSkin:function(a){this.container[0].className="mejs-container "+a;this.setPlayerSize(this.width,
+this.height);this.setControlsSize()},play:function(){this.media.play()},pause:function(){try{this.media.pause()}catch(a){}},load:function(){this.media.load()},setMuted:function(a){this.media.setMuted(a)},setCurrentTime:function(a){this.media.setCurrentTime(a)},getCurrentTime:function(){return this.media.currentTime},setVolume:function(a){this.media.setVolume(a)},getVolume:function(){return this.media.volume},setSrc:function(a){this.media.setSrc(a)},remove:function(){var a,b;for(a in this.options.features){b=
+this.options.features[a];if(this["clean"+b])try{this["clean"+b](this)}catch(c){}}if(this.isDynamic)this.$node.insertBefore(this.container);else{this.$media.prop("controls",true);this.$node.clone().show().insertBefore(this.container);this.$node.remove()}this.media.pluginType!=="native"&&this.media.remove();delete mejs.players[this.id];this.container.remove();this.globalUnbind();delete this.node.player}};(function(){function a(c,e){var d={d:[],w:[]};f.each((c||"").split(" "),function(g,k){var j=k+"."+
+e;if(j.indexOf(".")===0){d.d.push(j);d.w.push(j)}else d[b.test(k)?"w":"d"].push(j)});d.d=d.d.join(" ");d.w=d.w.join(" ");return d}var b=/^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/;mejs.MediaElementPlayer.prototype.globalBind=function(c,e,d){c=a(c,this.id);c.d&&f(document).bind(c.d,e,d);c.w&&f(window).bind(c.w,e,d)};mejs.MediaElementPlayer.prototype.globalUnbind=function(c,e){c=a(c,this.id);c.d&&f(document).unbind(c.d,e);c.w&&f(window).unbind(c.w,
+e)}})();if(typeof jQuery!="undefined")jQuery.fn.mediaelementplayer=function(a){a===false?this.each(function(){var b=jQuery(this).data("mediaelementplayer");b&&b.remove();jQuery(this).removeData("mediaelementplayer")}):this.each(function(){jQuery(this).data("mediaelementplayer",new mejs.MediaElementPlayer(this,a))});return this};f(document).ready(function(){f(".mejs-player").mediaelementplayer()});window.MediaElementPlayer=mejs.MediaElementPlayer})(mejs.$);
+(function(f){f.extend(mejs.MepDefaults,{playpauseText:mejs.i18n.t("Play/Pause")});f.extend(MediaElementPlayer.prototype,{buildplaypause:function(a,b,c,e){var d=f('<div class="mejs-button mejs-playpause-button mejs-play" ><button type="button" aria-controls="'+this.id+'" title="'+this.options.playpauseText+'" aria-label="'+this.options.playpauseText+'"></button></div>').appendTo(b).click(function(g){g.preventDefault();e.paused?e.play():e.pause();return false});e.addEventListener("play",function(){d.removeClass("mejs-play").addClass("mejs-pause")},
+false);e.addEventListener("playing",function(){d.removeClass("mejs-play").addClass("mejs-pause")},false);e.addEventListener("pause",function(){d.removeClass("mejs-pause").addClass("mejs-play")},false);e.addEventListener("paused",function(){d.removeClass("mejs-pause").addClass("mejs-play")},false)}})})(mejs.$);
+(function(f){f.extend(mejs.MepDefaults,{stopText:"Stop"});f.extend(MediaElementPlayer.prototype,{buildstop:function(a,b,c,e){f('<div class="mejs-button mejs-stop-button mejs-stop"><button type="button" aria-controls="'+this.id+'" title="'+this.options.stopText+'" aria-label="'+this.options.stopText+'"></button></div>').appendTo(b).click(function(){e.paused||e.pause();if(e.currentTime>0){e.setCurrentTime(0);e.pause();b.find(".mejs-time-current").width("0px");b.find(".mejs-time-handle").css("left",
+"0px");b.find(".mejs-time-float-current").html(mejs.Utility.secondsToTimeCode(0));b.find(".mejs-currenttime").html(mejs.Utility.secondsToTimeCode(0));c.find(".mejs-poster").show()}})}})})(mejs.$);
+(function(f){f.extend(MediaElementPlayer.prototype,{buildprogress:function(a,b,c,e){f('<div class="mejs-time-rail"><span class="mejs-time-total"><span class="mejs-time-buffering"></span><span class="mejs-time-loaded"></span><span class="mejs-time-current"></span><span class="mejs-time-handle"></span><span class="mejs-time-float"><span class="mejs-time-float-current">00:00</span><span class="mejs-time-float-corner"></span></span></span></div>').appendTo(b);b.find(".mejs-time-buffering").hide();var d=
+this,g=b.find(".mejs-time-total");c=b.find(".mejs-time-loaded");var k=b.find(".mejs-time-current"),j=b.find(".mejs-time-handle"),m=b.find(".mejs-time-float"),q=b.find(".mejs-time-float-current"),p=function(h){h=h.pageX;var l=g.offset(),r=g.outerWidth(true),n=0,o=n=0;if(e.duration){if(h<l.left)h=l.left;else if(h>r+l.left)h=r+l.left;o=h-l.left;n=o/r;n=n<=0.02?0:n*e.duration;t&&n!==e.currentTime&&e.setCurrentTime(n);if(!mejs.MediaFeatures.hasTouch){m.css("left",o);q.html(mejs.Utility.secondsToTimeCode(n));
+m.show()}}},t=false;g.bind("mousedown",function(h){if(h.which===1){t=true;p(h);d.globalBind("mousemove.dur",function(l){p(l)});d.globalBind("mouseup.dur",function(){t=false;m.hide();d.globalUnbind(".dur")});return false}}).bind("mouseenter",function(){d.globalBind("mousemove.dur",function(h){p(h)});mejs.MediaFeatures.hasTouch||m.show()}).bind("mouseleave",function(){if(!t){d.globalUnbind(".dur");m.hide()}});e.addEventListener("progress",function(h){a.setProgressRail(h);a.setCurrentRail(h)},false);
+e.addEventListener("timeupdate",function(h){a.setProgressRail(h);a.setCurrentRail(h)},false);d.loaded=c;d.total=g;d.current=k;d.handle=j},setProgressRail:function(a){var b=a!=undefined?a.target:this.media,c=null;if(b&&b.buffered&&b.buffered.length>0&&b.buffered.end&&b.duration)c=b.buffered.end(0)/b.duration;else if(b&&b.bytesTotal!=undefined&&b.bytesTotal>0&&b.bufferedBytes!=undefined)c=b.bufferedBytes/b.bytesTotal;else if(a&&a.lengthComputable&&a.total!=0)c=a.loaded/a.total;if(c!==null){c=Math.min(1,
+Math.max(0,c));this.loaded&&this.total&&this.loaded.width(this.total.width()*c)}},setCurrentRail:function(){if(this.media.currentTime!=undefined&&this.media.duration)if(this.total&&this.handle){var a=Math.round(this.total.width()*this.media.currentTime/this.media.duration),b=a-Math.round(this.handle.outerWidth(true)/2);this.current.width(a);this.handle.css("left",b)}}})})(mejs.$);
+(function(f){f.extend(mejs.MepDefaults,{duration:-1,timeAndDurationSeparator:"<span> | </span>"});f.extend(MediaElementPlayer.prototype,{buildcurrent:function(a,b,c,e){f('<div class="mejs-time"><span class="mejs-currenttime">'+(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00")+"</span></div>").appendTo(b);this.currenttime=this.controls.find(".mejs-currenttime");e.addEventListener("timeupdate",function(){a.updateCurrent()},false)},buildduration:function(a,b,
+c,e){if(b.children().last().find(".mejs-currenttime").length>0)f(this.options.timeAndDurationSeparator+'<span class="mejs-duration">'+(this.options.duration>0?mejs.Utility.secondsToTimeCode(this.options.duration,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"</span>").appendTo(b.find(".mejs-time"));else{b.find(".mejs-currenttime").parent().addClass("mejs-currenttime-container");
+f('<div class="mejs-time mejs-duration-container"><span class="mejs-duration">'+(this.options.duration>0?mejs.Utility.secondsToTimeCode(this.options.duration,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25):(a.options.alwaysShowHours?"00:":"")+(a.options.showTimecodeFrameCount?"00:00:00":"00:00"))+"</span></div>").appendTo(b)}this.durationD=this.controls.find(".mejs-duration");e.addEventListener("timeupdate",function(){a.updateDuration()},
+false)},updateCurrent:function(){if(this.currenttime)this.currenttime.html(mejs.Utility.secondsToTimeCode(this.media.currentTime,this.options.alwaysShowHours||this.media.duration>3600,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))},updateDuration:function(){this.container.toggleClass("mejs-long-video",this.media.duration>3600);if(this.durationD&&(this.options.duration>0||this.media.duration))this.durationD.html(mejs.Utility.secondsToTimeCode(this.options.duration>0?this.options.duration:
+this.media.duration,this.options.alwaysShowHours,this.options.showTimecodeFrameCount,this.options.framesPerSecond||25))}})})(mejs.$);
+(function(f){f.extend(mejs.MepDefaults,{muteText:mejs.i18n.t("Mute Toggle"),hideVolumeOnTouchDevices:true,audioVolume:"horizontal",videoVolume:"vertical"});f.extend(MediaElementPlayer.prototype,{buildvolume:function(a,b,c,e){if(!(mejs.MediaFeatures.hasTouch&&this.options.hideVolumeOnTouchDevices)){var d=this,g=d.isVideo?d.options.videoVolume:d.options.audioVolume,k=g=="horizontal"?f('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+d.id+'" title="'+d.options.muteText+
+'" aria-label="'+d.options.muteText+'"></button></div><div class="mejs-horizontal-volume-slider"><div class="mejs-horizontal-volume-total"></div><div class="mejs-horizontal-volume-current"></div><div class="mejs-horizontal-volume-handle"></div></div>').appendTo(b):f('<div class="mejs-button mejs-volume-button mejs-mute"><button type="button" aria-controls="'+d.id+'" title="'+d.options.muteText+'" aria-label="'+d.options.muteText+'"></button><div class="mejs-volume-slider"><div class="mejs-volume-total"></div><div class="mejs-volume-current"></div><div class="mejs-volume-handle"></div></div></div>').appendTo(b),
+j=d.container.find(".mejs-volume-slider, .mejs-horizontal-volume-slider"),m=d.container.find(".mejs-volume-total, .mejs-horizontal-volume-total"),q=d.container.find(".mejs-volume-current, .mejs-horizontal-volume-current"),p=d.container.find(".mejs-volume-handle, .mejs-horizontal-volume-handle"),t=function(n,o){if(!j.is(":visible")&&typeof o=="undefined"){j.show();t(n,true);j.hide()}else{n=Math.max(0,n);n=Math.min(n,1);n==0?k.removeClass("mejs-mute").addClass("mejs-unmute"):k.removeClass("mejs-unmute").addClass("mejs-mute");
+if(g=="vertical"){var s=m.height(),u=m.position(),v=s-s*n;p.css("top",Math.round(u.top+v-p.height()/2));q.height(s-v);q.css("top",u.top+v)}else{s=m.width();u=m.position();s=s*n;p.css("left",Math.round(u.left+s-p.width()/2));q.width(Math.round(s))}}},h=function(n){var o=null,s=m.offset();if(g=="vertical"){o=m.height();parseInt(m.css("top").replace(/px/,""),10);o=(o-(n.pageY-s.top))/o;if(s.top==0||s.left==0)return}else{o=m.width();o=(n.pageX-s.left)/o}o=Math.max(0,o);o=Math.min(o,1);t(o);o==0?e.setMuted(true):
+e.setMuted(false);e.setVolume(o)},l=false,r=false;k.hover(function(){j.show();r=true},function(){r=false;!l&&g=="vertical"&&j.hide()});j.bind("mouseover",function(){r=true}).bind("mousedown",function(n){h(n);d.globalBind("mousemove.vol",function(o){h(o)});d.globalBind("mouseup.vol",function(){l=false;d.globalUnbind(".vol");!r&&g=="vertical"&&j.hide()});l=true;return false});k.find("button").click(function(){e.setMuted(!e.muted)});e.addEventListener("volumechange",function(){if(!l)if(e.muted){t(0);
+k.removeClass("mejs-mute").addClass("mejs-unmute")}else{t(e.volume);k.removeClass("mejs-unmute").addClass("mejs-mute")}},false);if(d.container.is(":visible")){t(a.options.startVolume);a.options.startVolume===0&&e.setMuted(true);e.pluginType==="native"&&e.setVolume(a.options.startVolume)}}}})})(mejs.$);
+(function(f){f.extend(mejs.MepDefaults,{usePluginFullScreen:true,newWindowCallback:function(){return""},fullscreenText:mejs.i18n.t("Fullscreen")});f.extend(MediaElementPlayer.prototype,{isFullScreen:false,isNativeFullScreen:false,isInIframe:false,buildfullscreen:function(a,b,c,e){if(a.isVideo){a.isInIframe=window.location!=window.parent.location;if(mejs.MediaFeatures.hasTrueNativeFullScreen){c=function(){if(a.isFullScreen)if(mejs.MediaFeatures.isFullScreen()){a.isNativeFullScreen=true;a.setControlsSize()}else{a.isNativeFullScreen=
+false;a.exitFullScreen()}};mejs.MediaFeatures.hasMozNativeFullScreen?a.globalBind(mejs.MediaFeatures.fullScreenEventName,c):a.container.bind(mejs.MediaFeatures.fullScreenEventName,c)}var d=this,g=f('<div class="mejs-button mejs-fullscreen-button"><button type="button" aria-controls="'+d.id+'" title="'+d.options.fullscreenText+'" aria-label="'+d.options.fullscreenText+'"></button></div>').appendTo(b);if(d.media.pluginType==="native"||!d.options.usePluginFullScreen&&!mejs.MediaFeatures.isFirefox)g.click(function(){mejs.MediaFeatures.hasTrueNativeFullScreen&&
+mejs.MediaFeatures.isFullScreen()||a.isFullScreen?a.exitFullScreen():a.enterFullScreen()});else{var k=null;if(function(){var h=document.createElement("x"),l=document.documentElement,r=window.getComputedStyle;if(!("pointerEvents"in h.style))return false;h.style.pointerEvents="auto";h.style.pointerEvents="x";l.appendChild(h);r=r&&r(h,"").pointerEvents==="auto";l.removeChild(h);return!!r}()&&!mejs.MediaFeatures.isOpera){var j=false,m=function(){if(j){for(var h in q)q[h].hide();g.css("pointer-events",
+"");d.controls.css("pointer-events","");d.media.removeEventListener("click",d.clickToPlayPauseCallback);j=false}},q={};b=["top","left","right","bottom"];var p,t=function(){var h=g.offset().left-d.container.offset().left,l=g.offset().top-d.container.offset().top,r=g.outerWidth(true),n=g.outerHeight(true),o=d.container.width(),s=d.container.height();for(p in q)q[p].css({position:"absolute",top:0,left:0});q.top.width(o).height(l);q.left.width(h).height(n).css({top:l});q.right.width(o-h-r).height(n).css({top:l,
+left:h+r});q.bottom.width(o).height(s-n-l).css({top:l+n})};d.globalBind("resize",function(){t()});p=0;for(c=b.length;p<c;p++)q[b[p]]=f('<div class="mejs-fullscreen-hover" />').appendTo(d.container).mouseover(m).hide();g.on("mouseover",function(){if(!d.isFullScreen){var h=g.offset(),l=a.container.offset();e.positionFullscreenButton(h.left-l.left,h.top-l.top,false);g.css("pointer-events","none");d.controls.css("pointer-events","none");d.media.addEventListener("click",d.clickToPlayPauseCallback);for(p in q)q[p].show();
+t();j=true}});e.addEventListener("fullscreenchange",function(){d.isFullScreen=!d.isFullScreen;d.isFullScreen?d.media.removeEventListener("click",d.clickToPlayPauseCallback):d.media.addEventListener("click",d.clickToPlayPauseCallback);m()});d.globalBind("mousemove",function(h){if(j){var l=g.offset();if(h.pageY<l.top||h.pageY>l.top+g.outerHeight(true)||h.pageX<l.left||h.pageX>l.left+g.outerWidth(true)){g.css("pointer-events","");d.controls.css("pointer-events","");j=false}}})}else g.on("mouseover",
+function(){if(k!==null){clearTimeout(k);delete k}var h=g.offset(),l=a.container.offset();e.positionFullscreenButton(h.left-l.left,h.top-l.top,true)}).on("mouseout",function(){if(k!==null){clearTimeout(k);delete k}k=setTimeout(function(){e.hideFullscreenButton()},1500)})}a.fullscreenBtn=g;d.globalBind("keydown",function(h){if((mejs.MediaFeatures.hasTrueNativeFullScreen&&mejs.MediaFeatures.isFullScreen()||d.isFullScreen)&&h.keyCode==27)a.exitFullScreen()})}},cleanfullscreen:function(a){a.exitFullScreen()},
+containerSizeTimeout:null,enterFullScreen:function(){var a=this;if(!(a.media.pluginType!=="native"&&(mejs.MediaFeatures.isFirefox||a.options.usePluginFullScreen))){f(document.documentElement).addClass("mejs-fullscreen");normalHeight=a.container.height();normalWidth=a.container.width();if(a.media.pluginType==="native")if(mejs.MediaFeatures.hasTrueNativeFullScreen){mejs.MediaFeatures.requestFullScreen(a.container[0]);a.isInIframe&&setTimeout(function c(){if(a.isNativeFullScreen)f(window).width()!==
+screen.width?a.exitFullScreen():setTimeout(c,500)},500)}else if(mejs.MediaFeatures.hasSemiNativeFullScreen){a.media.webkitEnterFullscreen();return}if(a.isInIframe){var b=a.options.newWindowCallback(this);if(b!=="")if(mejs.MediaFeatures.hasTrueNativeFullScreen)setTimeout(function(){if(!a.isNativeFullScreen){a.pause();window.open(b,a.id,"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no")}},250);else{a.pause();window.open(b,a.id,
+"top=0,left=0,width="+screen.availWidth+",height="+screen.availHeight+",resizable=yes,scrollbars=no,status=no,toolbar=no");return}}a.container.addClass("mejs-container-fullscreen").width("100%").height("100%");a.containerSizeTimeout=setTimeout(function(){a.container.css({width:"100%",height:"100%"});a.setControlsSize()},500);if(a.media.pluginType==="native")a.$media.width("100%").height("100%");else{a.container.find(".mejs-shim").width("100%").height("100%");a.media.setVideoSize(f(window).width(),
+f(window).height())}a.layers.children("div").width("100%").height("100%");a.fullscreenBtn&&a.fullscreenBtn.removeClass("mejs-fullscreen").addClass("mejs-unfullscreen");a.setControlsSize();a.isFullScreen=true}},exitFullScreen:function(){clearTimeout(this.containerSizeTimeout);if(this.media.pluginType!=="native"&&mejs.MediaFeatures.isFirefox)this.media.setFullscreen(false);else{if(mejs.MediaFeatures.hasTrueNativeFullScreen&&(mejs.MediaFeatures.isFullScreen()||this.isFullScreen))mejs.MediaFeatures.cancelFullScreen();
+f(document.documentElement).removeClass("mejs-fullscreen");this.container.removeClass("mejs-container-fullscreen").width(normalWidth).height(normalHeight);if(this.media.pluginType==="native")this.$media.width(normalWidth).height(normalHeight);else{this.container.find(".mejs-shim").width(normalWidth).height(normalHeight);this.media.setVideoSize(normalWidth,normalHeight)}this.layers.children("div").width(normalWidth).height(normalHeight);this.fullscreenBtn.removeClass("mejs-unfullscreen").addClass("mejs-fullscreen");
+this.setControlsSize();this.isFullScreen=false}}})})(mejs.$);
+(function(f){f.extend(mejs.MepDefaults,{startLanguage:"",tracksText:mejs.i18n.t("Captions/Subtitles"),hideCaptionsButtonWhenEmpty:true,toggleCaptionsButtonWhenOnlyOne:false,slidesSelector:""});f.extend(MediaElementPlayer.prototype,{hasChapters:false,buildtracks:function(a,b,c,e){if(a.tracks.length!=0){var d;if(this.domNode.textTracks)for(d=this.domNode.textTracks.length-1;d>=0;d--)this.domNode.textTracks[d].mode="hidden";a.chapters=f('<div class="mejs-chapters mejs-layer"></div>').prependTo(c).hide();a.captions=
+f('<div class="mejs-captions-layer mejs-layer"><div class="mejs-captions-position mejs-captions-position-hover"><span class="mejs-captions-text"></span></div></div>').prependTo(c).hide();a.captionsText=a.captions.find(".mejs-captions-text");a.captionsButton=f('<div class="mejs-button mejs-captions-button"><button type="button" aria-controls="'+this.id+'" title="'+this.options.tracksText+'" aria-label="'+this.options.tracksText+'"></button><div class="mejs-captions-selector"><ul><li><input type="radio" name="'+
+a.id+'_captions" id="'+a.id+'_captions_none" value="none" checked="checked" /><label for="'+a.id+'_captions_none">'+mejs.i18n.t("None")+"</label></li></ul></div></div>").appendTo(b);for(d=b=0;d<a.tracks.length;d++)a.tracks[d].kind=="subtitles"&&b++;this.options.toggleCaptionsButtonWhenOnlyOne&&b==1?a.captionsButton.on("click",function(){a.setTrack(a.selectedTrack==null?a.tracks[0].srclang:"none")}):a.captionsButton.hover(function(){f(this).find(".mejs-captions-selector").css("visibility","visible")},
+function(){f(this).find(".mejs-captions-selector").css("visibility","hidden")}).on("click","input[type=radio]",function(){lang=this.value;a.setTrack(lang)});a.options.alwaysShowControls?a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover"):a.container.bind("controlsshown",function(){a.container.find(".mejs-captions-position").addClass("mejs-captions-position-hover")}).bind("controlshidden",function(){e.paused||a.container.find(".mejs-captions-position").removeClass("mejs-captions-position-hover")});
+a.trackToLoad=-1;a.selectedTrack=null;a.isLoadingTrack=false;for(d=0;d<a.tracks.length;d++)a.tracks[d].kind=="subtitles"&&a.addTrackButton(a.tracks[d].srclang,a.tracks[d].label);a.loadNextTrack();e.addEventListener("timeupdate",function(){a.displayCaptions()},false);if(a.options.slidesSelector!=""){a.slidesContainer=f(a.options.slidesSelector);e.addEventListener("timeupdate",function(){a.displaySlides()},false)}e.addEventListener("loadedmetadata",function(){a.displayChapters()},false);a.container.hover(function(){if(a.hasChapters){a.chapters.css("visibility",
+"visible");a.chapters.fadeIn(200).height(a.chapters.find(".mejs-chapter").outerHeight())}},function(){a.hasChapters&&!e.paused&&a.chapters.fadeOut(200,function(){f(this).css("visibility","hidden");f(this).css("display","block")})});a.node.getAttribute("autoplay")!==null&&a.chapters.css("visibility","hidden")}},setTrack:function(a){var b;if(a=="none"){this.selectedTrack=null;this.captionsButton.removeClass("mejs-captions-enabled")}else for(b=0;b<this.tracks.length;b++)if(this.tracks[b].srclang==a){this.selectedTrack==
+null&&this.captionsButton.addClass("mejs-captions-enabled");this.selectedTrack=this.tracks[b];this.captions.attr("lang",this.selectedTrack.srclang);this.displayCaptions();break}},loadNextTrack:function(){this.trackToLoad++;if(this.trackToLoad<this.tracks.length){this.isLoadingTrack=true;this.loadTrack(this.trackToLoad)}else{this.isLoadingTrack=false;this.checkForTracks()}},loadTrack:function(a){var b=this,c=b.tracks[a];f.ajax({url:c.src,dataType:"text",success:function(e){c.entries=typeof e=="string"&&
+/<tt\s+xml/ig.exec(e)?mejs.TrackFormatParser.dfxp.parse(e):mejs.TrackFormatParser.webvvt.parse(e);c.isLoaded=true;b.enableTrackButton(c.srclang,c.label);b.loadNextTrack();c.kind=="chapters"&&b.media.addEventListener("play",function(){b.media.duration>0&&b.displayChapters(c)},false);c.kind=="slides"&&b.setupSlides(c)},error:function(){b.loadNextTrack()}})},enableTrackButton:function(a,b){if(b==="")b=mejs.language.codes[a]||a;this.captionsButton.find("input[value="+a+"]").prop("disabled",false).siblings("label").html(b);
+this.options.startLanguage==a&&f("#"+this.id+"_captions_"+a).click();this.adjustLanguageBox()},addTrackButton:function(a,b){if(b==="")b=mejs.language.codes[a]||a;this.captionsButton.find("ul").append(f('<li><input type="radio" name="'+this.id+'_captions" id="'+this.id+"_captions_"+a+'" value="'+a+'" disabled="disabled" /><label for="'+this.id+"_captions_"+a+'">'+b+" (loading)</label></li>"));this.adjustLanguageBox();this.container.find(".mejs-captions-translations option[value="+a+"]").remove()},
+adjustLanguageBox:function(){this.captionsButton.find(".mejs-captions-selector").height(this.captionsButton.find(".mejs-captions-selector ul").outerHeight(true)+this.captionsButton.find(".mejs-captions-translations").outerHeight(true))},checkForTracks:function(){var a=false;if(this.options.hideCaptionsButtonWhenEmpty){for(i=0;i<this.tracks.length;i++)if(this.tracks[i].kind=="subtitles"){a=true;break}if(!a){this.captionsButton.hide();this.setControlsSize()}}},displayCaptions:function(){if(typeof this.tracks!=
+"undefined"){var a,b=this.selectedTrack;if(b!=null&&b.isLoaded)for(a=0;a<b.entries.times.length;a++)if(this.media.currentTime>=b.entries.times[a].start&&this.media.currentTime<=b.entries.times[a].stop){this.captionsText.html(b.entries.text[a]);this.captions.show().height(0);return}this.captions.hide()}},setupSlides:function(a){this.slides=a;this.slides.entries.imgs=[this.slides.entries.text.length];this.showSlide(0)},showSlide:function(a){if(!(typeof this.tracks=="undefined"||typeof this.slidesContainer==
+"undefined")){var b=this,c=b.slides.entries.text[a],e=b.slides.entries.imgs[a];if(typeof e=="undefined"||typeof e.fadeIn=="undefined")b.slides.entries.imgs[a]=e=f('<img src="'+c+'">').on("load",function(){e.appendTo(b.slidesContainer).hide().fadeIn().siblings(":visible").fadeOut()});else!e.is(":visible")&&!e.is(":animated")&&e.fadeIn().siblings(":visible").fadeOut()}},displaySlides:function(){if(typeof this.slides!="undefined"){var a=this.slides,b;for(b=0;b<a.entries.times.length;b++)if(this.media.currentTime>=
+a.entries.times[b].start&&this.media.currentTime<=a.entries.times[b].stop){this.showSlide(b);break}}},displayChapters:function(){var a;for(a=0;a<this.tracks.length;a++)if(this.tracks[a].kind=="chapters"&&this.tracks[a].isLoaded){this.drawChapters(this.tracks[a]);this.hasChapters=true;break}},drawChapters:function(a){var b=this,c,e,d=e=0;b.chapters.empty();for(c=0;c<a.entries.times.length;c++){e=a.entries.times[c].stop-a.entries.times[c].start;e=Math.floor(e/b.media.duration*100);if(e+d>100||c==a.entries.times.length-
+1&&e+d<100)e=100-d;b.chapters.append(f('<div class="mejs-chapter" rel="'+a.entries.times[c].start+'" style="left: '+d.toString()+"%;width: "+e.toString()+'%;"><div class="mejs-chapter-block'+(c==a.entries.times.length-1?" mejs-chapter-block-last":"")+'"><span class="ch-title">'+a.entries.text[c]+'</span><span class="ch-time">'+mejs.Utility.secondsToTimeCode(a.entries.times[c].start)+"&ndash;"+mejs.Utility.secondsToTimeCode(a.entries.times[c].stop)+"</span></div></div>"));d+=e}b.chapters.find("div.mejs-chapter").click(function(){b.media.setCurrentTime(parseFloat(f(this).attr("rel")));
+b.media.paused&&b.media.play()});b.chapters.show()}});mejs.language={codes:{af:"Afrikaans",sq:"Albanian",ar:"Arabic",be:"Belarusian",bg:"Bulgarian",ca:"Catalan",zh:"Chinese","zh-cn":"Chinese Simplified","zh-tw":"Chinese Traditional",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch",en:"English",et:"Estonian",tl:"Filipino",fi:"Finnish",fr:"French",gl:"Galician",de:"German",el:"Greek",ht:"Haitian Creole",iw:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",ga:"Irish",it:"Italian",ja:"Japanese",
+ko:"Korean",lv:"Latvian",lt:"Lithuanian",mk:"Macedonian",ms:"Malay",mt:"Maltese",no:"Norwegian",fa:"Persian",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sr:"Serbian",sk:"Slovak",sl:"Slovenian",es:"Spanish",sw:"Swahili",sv:"Swedish",tl:"Tagalog",th:"Thai",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese",cy:"Welsh",yi:"Yiddish"}};mejs.TrackFormatParser={webvvt:{pattern_identifier:/^([a-zA-z]+-)?[0-9]+$/,pattern_timecode:/^([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ([0-9]{2}:[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,
+parse:function(a){var b=0;a=mejs.TrackFormatParser.split2(a,/\r?\n/);for(var c={text:[],times:[]},e,d;b<a.length;b++)if(this.pattern_identifier.exec(a[b])){b++;if((e=this.pattern_timecode.exec(a[b]))&&b<a.length){b++;d=a[b];for(b++;a[b]!==""&&b<a.length;){d=d+"\n"+a[b];b++}d=f.trim(d).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig,"<a href='$1' target='_blank'>$1</a>");c.text.push(d);c.times.push({start:mejs.Utility.convertSMPTEtoSeconds(e[1])==0?0.2:mejs.Utility.convertSMPTEtoSeconds(e[1]),
+stop:mejs.Utility.convertSMPTEtoSeconds(e[3]),settings:e[5]})}}return c}},dfxp:{parse:function(a){a=f(a).filter("tt");var b=0;b=a.children("div").eq(0);var c=b.find("p");b=a.find("#"+b.attr("style"));var e,d;a={text:[],times:[]};if(b.length){d=b.removeAttr("id").get(0).attributes;if(d.length){e={};for(b=0;b<d.length;b++)e[d[b].name.split(":")[1]]=d[b].value}}for(b=0;b<c.length;b++){var g;d={start:null,stop:null,style:null};if(c.eq(b).attr("begin"))d.start=mejs.Utility.convertSMPTEtoSeconds(c.eq(b).attr("begin"));
+if(!d.start&&c.eq(b-1).attr("end"))d.start=mejs.Utility.convertSMPTEtoSeconds(c.eq(b-1).attr("end"));if(c.eq(b).attr("end"))d.stop=mejs.Utility.convertSMPTEtoSeconds(c.eq(b).attr("end"));if(!d.stop&&c.eq(b+1).attr("begin"))d.stop=mejs.Utility.convertSMPTEtoSeconds(c.eq(b+1).attr("begin"));if(e){g="";for(var k in e)g+=k+":"+e[k]+";"}if(g)d.style=g;if(d.start==0)d.start=0.2;a.times.push(d);d=f.trim(c.eq(b).html()).replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig,
+"<a href='$1' target='_blank'>$1</a>");a.text.push(d);if(a.times.start==0)a.times.start=2}return a}},split2:function(a,b){return a.split(b)}};if("x\n\ny".split(/\n/gi).length!=3)mejs.TrackFormatParser.split2=function(a,b){var c=[],e="",d;for(d=0;d<a.length;d++){e+=a.substring(d,d+1);if(b.test(e)){c.push(e.replace(b,""));e=""}}c.push(e);return c}})(mejs.$);
+(function(f){f.extend(mejs.MepDefaults,{contextMenuItems:[{render:function(a){if(typeof a.enterFullScreen=="undefined")return null;return a.isFullScreen?mejs.i18n.t("Turn off Fullscreen"):mejs.i18n.t("Go Fullscreen")},click:function(a){a.isFullScreen?a.exitFullScreen():a.enterFullScreen()}},{render:function(a){return a.media.muted?mejs.i18n.t("Unmute"):mejs.i18n.t("Mute")},click:function(a){a.media.muted?a.setMuted(false):a.setMuted(true)}},{isSeparator:true},{render:function(){return mejs.i18n.t("Download Video")},
+click:function(a){window.location.href=a.media.currentSrc}}]});f.extend(MediaElementPlayer.prototype,{buildcontextmenu:function(a){a.contextMenu=f('<div class="mejs-contextmenu"></div>').appendTo(f("body")).hide();a.container.bind("contextmenu",function(b){if(a.isContextMenuEnabled){b.preventDefault();a.renderContextMenu(b.clientX-1,b.clientY-1);return false}});a.container.bind("click",function(){a.contextMenu.hide()});a.contextMenu.bind("mouseleave",function(){a.startContextMenuTimer()})},cleancontextmenu:function(a){a.contextMenu.remove()},
+isContextMenuEnabled:true,enableContextMenu:function(){this.isContextMenuEnabled=true},disableContextMenu:function(){this.isContextMenuEnabled=false},contextMenuTimeout:null,startContextMenuTimer:function(){var a=this;a.killContextMenuTimer();a.contextMenuTimer=setTimeout(function(){a.hideContextMenu();a.killContextMenuTimer()},750)},killContextMenuTimer:function(){var a=this.contextMenuTimer;if(a!=null){clearTimeout(a);delete a}},hideContextMenu:function(){this.contextMenu.hide()},renderContextMenu:function(a,
+b){for(var c=this,e="",d=c.options.contextMenuItems,g=0,k=d.length;g<k;g++)if(d[g].isSeparator)e+='<div class="mejs-contextmenu-separator"></div>';else{var j=d[g].render(c);if(j!=null)e+='<div class="mejs-contextmenu-item" data-itemindex="'+g+'" id="element-'+Math.random()*1E6+'">'+j+"</div>"}c.contextMenu.empty().append(f(e)).css({top:b,left:a}).show();c.contextMenu.find(".mejs-contextmenu-item").each(function(){var m=f(this),q=parseInt(m.data("itemindex"),10),p=c.options.contextMenuItems[q];typeof p.show!=
+"undefined"&&p.show(m,c);m.click(function(){typeof p.click!="undefined"&&p.click(c);c.contextMenu.hide()})});setTimeout(function(){c.killControlsTimer("rev3")},100)}})})(mejs.$);
+(function(f){f.extend(mejs.MepDefaults,{postrollCloseText:mejs.i18n.t("Close")});f.extend(MediaElementPlayer.prototype,{buildpostroll:function(a,b,c){var e=this.container.find('link[rel="postroll"]').attr("href");if(typeof e!=="undefined"){a.postroll=f('<div class="mejs-postroll-layer mejs-layer"><a class="mejs-postroll-close" onclick="$(this).parent().hide();return false;">'+this.options.postrollCloseText+'</a><div class="mejs-postroll-layer-content"></div></div>').prependTo(c).hide();this.media.addEventListener("ended",
+function(){f.ajax({dataType:"html",url:e,success:function(d){c.find(".mejs-postroll-layer-content").html(d)}});a.postroll.show()},false)}}})})(mejs.$);
+
diff --git a/wp-includes/js/mediaelement/mediaelementplayer.min.css b/wp-includes/js/mediaelement/mediaelementplayer.min.css
new file mode 100644 (file)
index 0000000..5d88e84
--- /dev/null
@@ -0,0 +1 @@
+.mejs-container{position:relative;background:#000;font-family:Helvetica,Arial;text-align:left;vertical-align:top;text-indent:0;}.me-plugin{position:absolute;}.mejs-embed,.mejs-embed body{width:100%;height:100%;margin:0;padding:0;background:#000;overflow:hidden;}.mejs-fullscreen{overflow:hidden!important;}.mejs-container-fullscreen{position:fixed;left:0;top:0;right:0;bottom:0;overflow:hidden;z-index:1000;}.mejs-container-fullscreen .mejs-mediaelement,.mejs-container-fullscreen video{width:100%;height:100%;}.mejs-clear{clear:both;}.mejs-background{position:absolute;top:0;left:0;}.mejs-mediaelement{position:absolute;top:0;left:0;width:100%;height:100%;}.mejs-poster{position:absolute;top:0;left:0;background-size:contain;background-position:50% 50%;background-repeat:no-repeat;}:root .mejs-poster img{display:none;}.mejs-poster img{border:0;padding:0;border:0;}.mejs-overlay{position:absolute;top:0;left:0;}.mejs-overlay-play{cursor:pointer;}.mejs-overlay-button{position:absolute;top:50%;left:50%;width:100px;height:100px;margin:-50px 0 0 -50px;background:url(bigplay.svg) no-repeat;}.no-svg .mejs-overlay-button{background-image:url(bigplay.png);}.mejs-overlay:hover .mejs-overlay-button{background-position:0 -100px;}.mejs-overlay-loading{position:absolute;top:50%;left:50%;width:80px;height:80px;margin:-40px 0 0 -40px;background:#333;background:url(background.png);background:rgba(0,0,0,0.9);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(50,50,50,0.9)),to(rgba(0,0,0,0.9)));background:-webkit-linear-gradient(top,rgba(50,50,50,0.9),rgba(0,0,0,0.9));background:-moz-linear-gradient(top,rgba(50,50,50,0.9),rgba(0,0,0,0.9));background:-o-linear-gradient(top,rgba(50,50,50,0.9),rgba(0,0,0,0.9));background:-ms-linear-gradient(top,rgba(50,50,50,0.9),rgba(0,0,0,0.9));background:linear-gradient(rgba(50,50,50,0.9),rgba(0,0,0,0.9));}.mejs-overlay-loading span{display:block;width:80px;height:80px;background:transparent url(loading.gif) 50% 50% no-repeat;}.mejs-container .mejs-controls{position:absolute;list-style-type:none;margin:0;padding:0;bottom:0;left:0;background:url(background.png);background:rgba(0,0,0,0.7);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(50,50,50,0.7)),to(rgba(0,0,0,0.7)));background:-webkit-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-moz-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-o-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-ms-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:linear-gradient(rgba(50,50,50,0.7),rgba(0,0,0,0.7));height:30px;width:100%;}.mejs-container .mejs-controls div{list-style-type:none;background-image:none;display:block;float:left;margin:0;padding:0;width:26px;height:26px;font-size:11px;line-height:11px;font-family:Helvetica,Arial;border:0;}.mejs-controls .mejs-button button{cursor:pointer;display:block;font-size:0;line-height:0;text-decoration:none;margin:7px 5px;padding:0;position:absolute;height:16px;width:16px;border:0;background:transparent url(controls.svg) no-repeat;}.no-svg .mejs-controls .mejs-button button{background-image:url(controls.png);}.mejs-controls .mejs-button button:focus{outline:solid 1px yellow;}.mejs-container .mejs-controls .mejs-time{color:#fff;display:block;height:17px;width:auto;padding:8px 3px 0 3px;overflow:hidden;text-align:center;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}.mejs-container .mejs-controls .mejs-time span{color:#fff;font-size:11px;line-height:12px;display:block;float:left;margin:1px 2px 0 0;width:auto;}.mejs-controls .mejs-play button{background-position:0 0;}.mejs-controls .mejs-pause button{background-position:0 -16px;}.mejs-controls .mejs-stop button{background-position:-112px 0;}.mejs-controls div.mejs-time-rail{direction:ltr;width:200px;padding-top:5px;}.mejs-controls .mejs-time-rail span{display:block;position:absolute;width:180px;height:10px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;cursor:pointer;}.mejs-controls .mejs-time-rail .mejs-time-total{margin:5px;background:#333;background:rgba(50,50,50,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(30,30,30,0.8)),to(rgba(60,60,60,0.8)));background:-webkit-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-moz-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-o-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-ms-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:linear-gradient(rgba(30,30,30,0.8),rgba(60,60,60,0.8));}.mejs-controls .mejs-time-rail .mejs-time-buffering{width:100%;background-image:-o-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-ms-linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(-45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:15px 15px;-moz-background-size:15px 15px;-o-background-size:15px 15px;background-size:15px 15px;-webkit-animation:buffering-stripes 2s linear infinite;-moz-animation:buffering-stripes 2s linear infinite;-ms-animation:buffering-stripes 2s linear infinite;-o-animation:buffering-stripes 2s linear infinite;animation:buffering-stripes 2s linear infinite;}@-webkit-keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}@-moz-keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}@-ms-keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}@-o-keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}@keyframes buffering-stripes{from{background-position:0 0;}to{background-position:30px 0;}}.mejs-controls .mejs-time-rail .mejs-time-loaded{background:#3caac8;background:rgba(60,170,200,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(44,124,145,0.8)),to(rgba(78,183,212,0.8)));background:-webkit-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:-moz-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:-o-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:-ms-linear-gradient(top,rgba(44,124,145,0.8),rgba(78,183,212,0.8));background:linear-gradient(rgba(44,124,145,0.8),rgba(78,183,212,0.8));width:0;}.mejs-controls .mejs-time-rail .mejs-time-current{background:#fff;background:rgba(255,255,255,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(255,255,255,0.9)),to(rgba(200,200,200,0.8)));background:-webkit-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-moz-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-o-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-ms-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:linear-gradient(rgba(255,255,255,0.9),rgba(200,200,200,0.8));width:0;}.mejs-controls .mejs-time-rail .mejs-time-handle{display:none;position:absolute;margin:0;width:10px;background:#fff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;cursor:pointer;border:solid 2px #333;top:-2px;text-align:center;}.mejs-controls .mejs-time-rail .mejs-time-float{position:absolute;display:none;background:#eee;width:36px;height:17px;border:solid 1px #333;top:-26px;margin-left:-18px;text-align:center;color:#111;}.mejs-controls .mejs-time-rail .mejs-time-float-current{margin:2px;width:30px;display:block;text-align:center;left:0;}.mejs-controls .mejs-time-rail .mejs-time-float-corner{position:absolute;display:block;width:0;height:0;line-height:0;border:solid 5px #eee;border-color:#eee transparent transparent transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:15px;left:13px;}.mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float{width:48px;}.mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float-current{width:44px;}.mejs-long-video .mejs-controls .mejs-time-rail .mejs-time-float-corner{left:18px;}.mejs-controls .mejs-fullscreen-button button{background-position:-32px 0;}.mejs-controls .mejs-unfullscreen button{background-position:-32px -16px;}.mejs-controls .mejs-mute button{background-position:-16px -16px;}.mejs-controls .mejs-unmute button{background-position:-16px 0;}.mejs-controls .mejs-volume-button{position:relative;}.mejs-controls .mejs-volume-button .mejs-volume-slider{display:none;height:115px;width:25px;background:url(background.png);background:rgba(50,50,50,0.7);-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;top:-115px;left:0;z-index:1;position:absolute;margin:0;}.mejs-controls .mejs-volume-button:hover{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-total{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,0.5);margin:0;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-current{position:absolute;left:11px;top:8px;width:2px;height:100px;background:#ddd;background:rgba(255,255,255,0.9);margin:0;}.mejs-controls .mejs-volume-button .mejs-volume-slider .mejs-volume-handle{position:absolute;left:4px;top:-3px;width:16px;height:6px;background:#ddd;background:rgba(255,255,255,0.9);cursor:N-resize;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;margin:0;}.mejs-controls div.mejs-horizontal-volume-slider{height:26px;width:60px;position:relative;}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total{position:absolute;left:0;top:11px;width:50px;height:8px;margin:0;padding:0;font-size:1px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#333;background:rgba(50,50,50,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(30,30,30,0.8)),to(rgba(60,60,60,0.8)));background:-webkit-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-moz-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-o-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:-ms-linear-gradient(top,rgba(30,30,30,0.8),rgba(60,60,60,0.8));background:linear-gradient(rgba(30,30,30,0.8),rgba(60,60,60,0.8));}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current{position:absolute;left:0;top:11px;width:50px;height:8px;margin:0;padding:0;font-size:1px;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px;background:#fff;background:rgba(255,255,255,0.8);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(255,255,255,0.9)),to(rgba(200,200,200,0.8)));background:-webkit-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-moz-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-o-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:-ms-linear-gradient(top,rgba(255,255,255,0.9),rgba(200,200,200,0.8));background:linear-gradient(rgba(255,255,255,0.9),rgba(200,200,200,0.8));}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-handle{display:none;}.mejs-controls .mejs-captions-button{position:relative;}.mejs-controls .mejs-captions-button button{background-position:-48px 0;}.mejs-controls .mejs-captions-button .mejs-captions-selector{visibility:hidden;position:absolute;bottom:26px;right:-10px;width:130px;height:100px;background:url(background.png);background:rgba(50,50,50,0.7);border:solid 1px transparent;padding:10px;overflow:hidden;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul{margin:0;padding:0;display:block;list-style-type:none!important;overflow:hidden;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li{margin:0 0 6px 0;padding:0;list-style-type:none!important;display:block;color:#fff;overflow:hidden;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px;}.mejs-controls .mejs-captions-button .mejs-captions-selector ul li label{width:100px;float:left;padding:4px 0 0 0;line-height:15px;font-family:helvetica,arial;font-size:10px;}.mejs-controls .mejs-captions-button .mejs-captions-translations{font-size:10px;margin:0 0 5px 0;}.mejs-chapters{position:absolute;top:0;left:0;-xborder-right:solid 1px #fff;width:10000px;z-index:1;}.mejs-chapters .mejs-chapter{position:absolute;float:left;background:#222;background:rgba(0,0,0,0.7);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(50,50,50,0.7)),to(rgba(0,0,0,0.7)));background:-webkit-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-moz-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-o-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:-ms-linear-gradient(top,rgba(50,50,50,0.7),rgba(0,0,0,0.7));background:linear-gradient(rgba(50,50,50,0.7),rgba(0,0,0,0.7));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#323232,endColorstr=#000000);overflow:hidden;border:0;}.mejs-chapters .mejs-chapter .mejs-chapter-block{font-size:11px;color:#fff;padding:5px;display:block;border-right:solid 1px #333;border-bottom:solid 1px #333;cursor:pointer;}.mejs-chapters .mejs-chapter .mejs-chapter-block-last{border-right:none;}.mejs-chapters .mejs-chapter .mejs-chapter-block:hover{background:#666;background:rgba(102,102,102,0.7);background:-webkit-gradient(linear,0% 0,0% 100%,from(rgba(102,102,102,0.7)),to(rgba(50,50,50,0.6)));background:-webkit-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:-moz-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:-o-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:-ms-linear-gradient(top,rgba(102,102,102,0.7),rgba(50,50,50,0.6));background:linear-gradient(rgba(102,102,102,0.7),rgba(50,50,50,0.6));filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,startColorstr=#666666,endColorstr=#323232);}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-title{font-size:12px;font-weight:bold;display:block;white-space:nowrap;text-overflow:ellipsis;margin:0 0 3px 0;line-height:12px;}.mejs-chapters .mejs-chapter .mejs-chapter-block .ch-timespan{font-size:12px;line-height:12px;margin:3px 0 4px 0;display:block;white-space:nowrap;text-overflow:ellipsis;}.mejs-captions-layer{position:absolute;bottom:0;left:0;text-align:center;line-height:22px;font-size:12px;color:#fff;}.mejs-captions-layer a{color:#fff;text-decoration:underline;}.mejs-captions-layer[lang=ar]{font-size:20px;font-weight:normal;}.mejs-captions-position{position:absolute;width:100%;bottom:15px;left:0;}.mejs-captions-position-hover{bottom:45px;}.mejs-captions-text{padding:3px 5px;background:url(background.png);background:rgba(20,20,20,0.8);}.me-cannotplay a{color:#fff;font-weight:bold;}.me-cannotplay span{padding:15px;display:block;}.mejs-controls .mejs-loop-off button{background-position:-64px -16px;}.mejs-controls .mejs-loop-on button{background-position:-64px 0;}.mejs-controls .mejs-backlight-off button{background-position:-80px -16px;}.mejs-controls .mejs-backlight-on button{background-position:-80px 0;}.mejs-controls .mejs-picturecontrols-button{background-position:-96px 0;}.mejs-contextmenu{position:absolute;width:150px;padding:10px;border-radius:4px;top:0;left:0;background:#fff;border:solid 1px #999;z-index:1001;}.mejs-contextmenu .mejs-contextmenu-separator{height:1px;font-size:0;margin:5px 6px;background:#333;}.mejs-contextmenu .mejs-contextmenu-item{font-family:Helvetica,Arial;font-size:12px;padding:4px 6px;cursor:pointer;color:#333;}.mejs-contextmenu .mejs-contextmenu-item:hover{background:#2C7C91;color:#fff;}.mejs-controls .mejs-sourcechooser-button{position:relative;}.mejs-controls .mejs-sourcechooser-button button{background-position:-128px 0;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector{visibility:hidden;position:absolute;bottom:26px;right:-10px;width:130px;height:100px;background:url(background.png);background:rgba(50,50,50,0.7);border:solid 1px transparent;padding:10px;overflow:hidden;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul{margin:0;padding:0;display:block;list-style-type:none!important;overflow:hidden;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li{margin:0 0 6px 0;padding:0;list-style-type:none!important;display:block;color:#fff;overflow:hidden;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li input{clear:both;float:left;margin:3px 3px 0 5px;}.mejs-controls .mejs-sourcechooser-button .mejs-sourcechooser-selector ul li label{width:100px;float:left;padding:4px 0 0 0;line-height:15px;font-family:helvetica,arial;font-size:10px;}.mejs-postroll-layer{position:absolute;bottom:0;left:0;width:100%;height:100%;background:url(background.png);background:rgba(50,50,50,0.7);z-index:1000;overflow:hidden;}.mejs-postroll-layer-content{width:100%;height:100%;}.mejs-postroll-close{position:absolute;right:0;top:0;background:url(background.png);background:rgba(50,50,50,0.7);color:#fff;padding:4px;z-index:100;cursor:pointer;}
\ No newline at end of file
diff --git a/wp-includes/js/mediaelement/silverlightmediaelement.xap b/wp-includes/js/mediaelement/silverlightmediaelement.xap
new file mode 100644 (file)
index 0000000..9d55c2e
Binary files /dev/null and b/wp-includes/js/mediaelement/silverlightmediaelement.xap differ
diff --git a/wp-includes/js/mediaelement/wp-mediaelement.css b/wp-includes/js/mediaelement/wp-mediaelement.css
new file mode 100644 (file)
index 0000000..18ad948
--- /dev/null
@@ -0,0 +1,15 @@
+.mejs-container, .mejs-embed, .mejs-embed body {
+       background: #464646;
+}
+
+.mejs-controls .mejs-time-rail .mejs-time-loaded {
+       background: #21759b;
+}
+
+.mejs-controls .mejs-time-rail .mejs-time-current {
+       background: #d54e21;
+}
+
+.me-cannotplay {
+       width: auto !important;
+}
diff --git a/wp-includes/js/mediaelement/wp-mediaelement.js b/wp-includes/js/mediaelement/wp-mediaelement.js
new file mode 100644 (file)
index 0000000..fb09e3c
--- /dev/null
@@ -0,0 +1,15 @@
+(function ($) {
+       // add mime-type aliases to MediaElement plugin support
+       mejs.plugins.silverlight[0].types.push('video/x-ms-wmv');
+       mejs.plugins.silverlight[0].types.push('audio/x-ms-wma');
+
+       $(function () {
+               var settings = {};
+
+               if ( typeof _wpmejsSettings !== 'undefined' )
+                       settings.pluginPath = _wpmejsSettings.pluginPath;
+
+               $('.wp-audio-shortcode, .wp-video-shortcode').mediaelementplayer( settings );
+       });
+
+}(jQuery));
index 9a38d4ab15f982ad4264bd6e03688a6156b8fd4f..7aaff4c8bf9b0e3263914a6d3a603be47513932e 100644 (file)
@@ -1,3 +1,17 @@
+Version 1.5.7 (2013-04-10)
+       HTML5: Workaround for squish problem in iOS6, when uploading resized images.
+       HTML5: Fix failing workaround for FormData+Blob bug on Android...
+       HTML5: Allow multiple uploads on iOS.
+       Include VB build script that doesn't depend on Ant and is said to be native to Windows.
+Version 1.5.6 (2013-02-28)
+       Fix regression: getPos() wrong on ie6/7.
+       HTML5: Send file as binary string if it was mangled, even if multipart is set to false.
+       HTML5: Add workaround Android browsers, that are unable to properly send blobs in FormData.
+       HTML4/Flash/Silverlight: Destroy fails to cleanup everything when container not defined.
+       UI, Queue: Use html() instead of text(), otherwise special characters fail to display properly.
+       UI, Queue: Use on() instead of delegate() or live(). Update examples to use jQuery 1.9.0 by default.
+       Queue: Blur rename input field when ESC is pressed.
+       Additional language packs: Slovak.
 Version 1.5.5 (2013-01-23)
        UI Widget: Fix sortable feature, broken in jQuery UI 1.9.
        Queue: Replace live() with delegate(), as live() was removed from jQuery 1.9.
index aa87c6b840bfdbc87406642602c99b65d01892b8..7d3f0087c88801f7d2daa34136e5cd6c1facb765 100644 (file)
@@ -1 +1 @@
-(function(f,b,d,e){var a={},g={};function c(){var h;try{h=navigator.plugins["Shockwave Flash"];h=h.description}catch(j){try{h=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(i){h="0.0"}}h=h.match(/\d+/g);return parseFloat(h[0]+"."+h[1])}d.flash={trigger:function(j,h,i){setTimeout(function(){var m=a[j],l,k;if(m){m.trigger("Flash:"+h,i)}},0)}};d.runtimes.Flash=d.addRuntime("flash",{getFeatures:function(){return{jpgresize:true,pngresize:true,maxWidth:8091,maxHeight:8091,chunks:true,progress:true,multipart:true,multi_selection:true}},init:function(m,o){var k,l,h=0,i=b.body;if(c()<10){o({success:false});return}g[m.id]=false;a[m.id]=m;k=b.getElementById(m.settings.browse_button);l=b.createElement("div");l.id=m.id+"_flash_container";d.extend(l.style,{position:"absolute",top:"0px",background:m.settings.shim_bgcolor||"transparent",zIndex:99999,width:"100%",height:"100%"});l.className="plupload flash";if(m.settings.container){i=b.getElementById(m.settings.container);if(d.getStyle(i,"position")==="static"){i.style.position="relative"}}i.appendChild(l);(function(){var p,q;p='<object id="'+m.id+'_flash" type="application/x-shockwave-flash" data="'+m.settings.flash_swf_url+'" ';if(d.ua.ie){p+='classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '}p+='width="100%" height="100%" style="outline:0"><param name="movie" value="'+m.settings.flash_swf_url+'" /><param name="flashvars" value="id='+escape(m.id)+'" /><param name="wmode" value="transparent" /><param name="allowscriptaccess" value="always" /></object>';if(d.ua.ie){q=b.createElement("div");l.appendChild(q);q.outerHTML=p;q=null}else{l.innerHTML=p}}());function n(){return b.getElementById(m.id+"_flash")}function j(){if(h++>5000){o({success:false});return}if(g[m.id]===false){setTimeout(j,1)}}j();k=l=null;m.bind("Destroy",function(p){var q;d.removeAllEvents(b.body,p.id);delete g[p.id];delete a[p.id];q=b.getElementById(p.id+"_flash_container");if(q){i.removeChild(q)}});m.bind("Flash:Init",function(){var r={},q;try{n().setFileFilters(m.settings.filters,m.settings.multi_selection)}catch(p){o({success:false});return}if(g[m.id]){return}g[m.id]=true;m.bind("UploadFile",function(s,u){var v=s.settings,t=m.settings.resize||{};n().uploadFile(r[u.id],v.url,{name:u.target_name||u.name,mime:d.mimeTypes[u.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream",chunk_size:v.chunk_size,width:t.width,height:t.height,quality:t.quality,multipart:v.multipart,multipart_params:v.multipart_params||{},file_data_name:v.file_data_name,format:/\.(jpg|jpeg)$/i.test(u.name)?"jpg":"png",headers:v.headers,urlstream_upload:v.urlstream_upload})});m.bind("CancelUpload",function(){n().cancelUpload()});m.bind("Flash:UploadProcess",function(t,s){var u=t.getFile(r[s.id]);if(u.status!=d.FAILED){u.loaded=s.loaded;u.size=s.size;t.trigger("UploadProgress",u)}});m.bind("Flash:UploadChunkComplete",function(s,u){var v,t=s.getFile(r[u.id]);v={chunk:u.chunk,chunks:u.chunks,response:u.text};s.trigger("ChunkUploaded",t,v);if(t.status!==d.FAILED&&s.state!==d.STOPPED){n().uploadNextChunk()}if(u.chunk==u.chunks-1){t.status=d.DONE;s.trigger("FileUploaded",t,{response:u.text})}});m.bind("Flash:SelectFiles",function(s,v){var u,t,w=[],x;for(t=0;t<v.length;t++){u=v[t];x=d.guid();r[x]=u.id;r[u.id]=x;w.push(new d.File(x,u.name,u.size))}if(w.length){m.trigger("FilesAdded",w)}});m.bind("Flash:SecurityError",function(s,t){m.trigger("Error",{code:d.SECURITY_ERROR,message:d.translate("Security error."),details:t.message,file:m.getFile(r[t.id])})});m.bind("Flash:GenericError",function(s,t){m.trigger("Error",{code:d.GENERIC_ERROR,message:d.translate("Generic error."),details:t.message,file:m.getFile(r[t.id])})});m.bind("Flash:IOError",function(s,t){m.trigger("Error",{code:d.IO_ERROR,message:d.translate("IO error."),details:t.message,file:m.getFile(r[t.id])})});m.bind("Flash:ImageError",function(s,t){m.trigger("Error",{code:parseInt(t.code,10),message:d.translate("Image error."),file:m.getFile(r[t.id])})});m.bind("Flash:StageEvent:rollOver",function(s){var t,u;t=b.getElementById(m.settings.browse_button);u=s.settings.browse_button_hover;if(t&&u){d.addClass(t,u)}});m.bind("Flash:StageEvent:rollOut",function(s){var t,u;t=b.getElementById(m.settings.browse_button);u=s.settings.browse_button_hover;if(t&&u){d.removeClass(t,u)}});m.bind("Flash:StageEvent:mouseDown",function(s){var t,u;t=b.getElementById(m.settings.browse_button);u=s.settings.browse_button_active;if(t&&u){d.addClass(t,u);d.addEvent(b.body,"mouseup",function(){d.removeClass(t,u)},s.id)}});m.bind("Flash:StageEvent:mouseUp",function(s){var t,u;t=b.getElementById(m.settings.browse_button);u=s.settings.browse_button_active;if(t&&u){d.removeClass(t,u)}});m.bind("Flash:ExifData",function(s,t){m.trigger("ExifData",m.getFile(r[t.id]),t.data)});m.bind("Flash:GpsData",function(s,t){m.trigger("GpsData",m.getFile(r[t.id]),t.data)});m.bind("QueueChanged",function(s){m.refresh()});m.bind("FilesRemoved",function(s,u){var t;for(t=0;t<u.length;t++){n().removeFile(r[u[t].id])}});m.bind("StateChanged",function(s){m.refresh()});m.bind("Refresh",function(s){var t,u,v;n().setFileFilters(m.settings.filters,m.settings.multi_selection);t=b.getElementById(s.settings.browse_button);if(t){u=d.getPos(t,b.getElementById(s.settings.container));v=d.getSize(t);d.extend(b.getElementById(s.id+"_flash_container").style,{top:u.y+"px",left:u.x+"px",width:v.w+"px",height:v.h+"px"})}});m.bind("DisableBrowse",function(s,t){n().disableBrowse(t)});o({success:true})})}})})(window,document,plupload);
\ No newline at end of file
+(function(f,b,d,e){var a={},g={};function c(){var h;try{h=navigator.plugins["Shockwave Flash"];h=h.description}catch(j){try{h=new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")}catch(i){h="0.0"}}h=h.match(/\d+/g);return parseFloat(h[0]+"."+h[1])}d.flash={trigger:function(j,h,i){setTimeout(function(){var m=a[j],l,k;if(m){m.trigger("Flash:"+h,i)}},0)}};d.runtimes.Flash=d.addRuntime("flash",{getFeatures:function(){return{jpgresize:true,pngresize:true,maxWidth:8091,maxHeight:8091,chunks:true,progress:true,multipart:true,multi_selection:true}},init:function(m,o){var k,l,h=0,i=b.body;if(c()<10){o({success:false});return}g[m.id]=false;a[m.id]=m;k=b.getElementById(m.settings.browse_button);l=b.createElement("div");l.id=m.id+"_flash_container";d.extend(l.style,{position:"absolute",top:"0px",background:m.settings.shim_bgcolor||"transparent",zIndex:99999,width:"100%",height:"100%"});l.className="plupload flash";if(m.settings.container){i=b.getElementById(m.settings.container);if(d.getStyle(i,"position")==="static"){i.style.position="relative"}}i.appendChild(l);(function(){var p,q;p='<object id="'+m.id+'_flash" type="application/x-shockwave-flash" data="'+m.settings.flash_swf_url+'" ';if(d.ua.ie){p+='classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '}p+='width="100%" height="100%" style="outline:0"><param name="movie" value="'+m.settings.flash_swf_url+'" /><param name="flashvars" value="id='+escape(m.id)+'" /><param name="wmode" value="transparent" /><param name="allowscriptaccess" value="always" /></object>';if(d.ua.ie){q=b.createElement("div");l.appendChild(q);q.outerHTML=p;q=null}else{l.innerHTML=p}}());function n(){return b.getElementById(m.id+"_flash")}function j(){if(h++>5000){o({success:false});return}if(g[m.id]===false){setTimeout(j,1)}}j();k=l=null;m.bind("Destroy",function(p){var q;d.removeAllEvents(b.body,p.id);delete g[p.id];delete a[p.id];q=b.getElementById(p.id+"_flash_container");if(q){q.parentNode.removeChild(q)}});m.bind("Flash:Init",function(){var r={},q;try{n().setFileFilters(m.settings.filters,m.settings.multi_selection)}catch(p){o({success:false});return}if(g[m.id]){return}g[m.id]=true;m.bind("UploadFile",function(s,u){var v=s.settings,t=m.settings.resize||{};n().uploadFile(r[u.id],v.url,{name:u.target_name||u.name,mime:d.mimeTypes[u.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream",chunk_size:v.chunk_size,width:t.width,height:t.height,quality:t.quality,multipart:v.multipart,multipart_params:v.multipart_params||{},file_data_name:v.file_data_name,format:/\.(jpg|jpeg)$/i.test(u.name)?"jpg":"png",headers:v.headers,urlstream_upload:v.urlstream_upload})});m.bind("CancelUpload",function(){n().cancelUpload()});m.bind("Flash:UploadProcess",function(t,s){var u=t.getFile(r[s.id]);if(u.status!=d.FAILED){u.loaded=s.loaded;u.size=s.size;t.trigger("UploadProgress",u)}});m.bind("Flash:UploadChunkComplete",function(s,u){var v,t=s.getFile(r[u.id]);v={chunk:u.chunk,chunks:u.chunks,response:u.text};s.trigger("ChunkUploaded",t,v);if(t.status!==d.FAILED&&s.state!==d.STOPPED){n().uploadNextChunk()}if(u.chunk==u.chunks-1){t.status=d.DONE;s.trigger("FileUploaded",t,{response:u.text})}});m.bind("Flash:SelectFiles",function(s,v){var u,t,w=[],x;for(t=0;t<v.length;t++){u=v[t];x=d.guid();r[x]=u.id;r[u.id]=x;w.push(new d.File(x,u.name,u.size))}if(w.length){m.trigger("FilesAdded",w)}});m.bind("Flash:SecurityError",function(s,t){m.trigger("Error",{code:d.SECURITY_ERROR,message:d.translate("Security error."),details:t.message,file:m.getFile(r[t.id])})});m.bind("Flash:GenericError",function(s,t){m.trigger("Error",{code:d.GENERIC_ERROR,message:d.translate("Generic error."),details:t.message,file:m.getFile(r[t.id])})});m.bind("Flash:IOError",function(s,t){m.trigger("Error",{code:d.IO_ERROR,message:d.translate("IO error."),details:t.message,file:m.getFile(r[t.id])})});m.bind("Flash:ImageError",function(s,t){m.trigger("Error",{code:parseInt(t.code,10),message:d.translate("Image error."),file:m.getFile(r[t.id])})});m.bind("Flash:StageEvent:rollOver",function(s){var t,u;t=b.getElementById(m.settings.browse_button);u=s.settings.browse_button_hover;if(t&&u){d.addClass(t,u)}});m.bind("Flash:StageEvent:rollOut",function(s){var t,u;t=b.getElementById(m.settings.browse_button);u=s.settings.browse_button_hover;if(t&&u){d.removeClass(t,u)}});m.bind("Flash:StageEvent:mouseDown",function(s){var t,u;t=b.getElementById(m.settings.browse_button);u=s.settings.browse_button_active;if(t&&u){d.addClass(t,u);d.addEvent(b.body,"mouseup",function(){d.removeClass(t,u)},s.id)}});m.bind("Flash:StageEvent:mouseUp",function(s){var t,u;t=b.getElementById(m.settings.browse_button);u=s.settings.browse_button_active;if(t&&u){d.removeClass(t,u)}});m.bind("Flash:ExifData",function(s,t){m.trigger("ExifData",m.getFile(r[t.id]),t.data)});m.bind("Flash:GpsData",function(s,t){m.trigger("GpsData",m.getFile(r[t.id]),t.data)});m.bind("QueueChanged",function(s){m.refresh()});m.bind("FilesRemoved",function(s,u){var t;for(t=0;t<u.length;t++){n().removeFile(r[u[t].id])}});m.bind("StateChanged",function(s){m.refresh()});m.bind("Refresh",function(s){var t,u,v;n().setFileFilters(m.settings.filters,m.settings.multi_selection);t=b.getElementById(s.settings.browse_button);if(t){u=d.getPos(t,b.getElementById(s.settings.container));v=d.getSize(t);d.extend(b.getElementById(s.id+"_flash_container").style,{top:u.y+"px",left:u.x+"px",width:v.w+"px",height:v.h+"px"})}});m.bind("DisableBrowse",function(s,t){n().disableBrowse(t)});o({success:true})})}})})(window,document,plupload);
\ No newline at end of file
index b20c88f7d6a3d1ccbfab3015af0d6515592bf4d5..0a8f4033e3b327cbe22ff7059fc951ae7eda6b9b 100644 (file)
@@ -1 +1 @@
-(function(d,a,b,c){function e(f){return a.getElementById(f)}b.runtimes.Html4=b.addRuntime("html4",{getFeatures:function(){return{multipart:true,triggerDialog:(b.ua.gecko&&d.FormData||b.ua.webkit)}},init:function(f,g){f.bind("Init",function(p){var j=a.body,n,h="javascript",k,x,q,z=[],r=/MSIE/.test(navigator.userAgent),t=[],m=p.settings.filters,o,l,s,w;no_type_restriction:for(o=0;o<m.length;o++){l=m[o].extensions.split(/,/);for(w=0;w<l.length;w++){if(l[w]==="*"){t=[];break no_type_restriction}s=b.mimeTypes[l[w]];if(s&&b.inArray(s,t)===-1){t.push(s)}}}t=t.join(",");function v(){var B,y,i,A;q=b.guid();z.push(q);B=a.createElement("form");B.setAttribute("id","form_"+q);B.setAttribute("method","post");B.setAttribute("enctype","multipart/form-data");B.setAttribute("encoding","multipart/form-data");B.setAttribute("target",p.id+"_iframe");B.style.position="absolute";y=a.createElement("input");y.setAttribute("id","input_"+q);y.setAttribute("type","file");y.setAttribute("accept",t);y.setAttribute("size",1);A=e(p.settings.browse_button);if(p.features.triggerDialog&&A){b.addEvent(e(p.settings.browse_button),"click",function(C){if(!y.disabled){y.click()}C.preventDefault()},p.id)}b.extend(y.style,{width:"100%",height:"100%",opacity:0,fontSize:"99px",cursor:"pointer"});b.extend(B.style,{overflow:"hidden"});i=p.settings.shim_bgcolor;if(i){B.style.background=i}if(r){b.extend(y.style,{filter:"alpha(opacity=0)"})}b.addEvent(y,"change",function(F){var D=F.target,C,E=[],G;if(D.value){e("form_"+q).style.top=-1048575+"px";C=D.value.replace(/\\/g,"/");C=C.substring(C.length,C.lastIndexOf("/")+1);E.push(new b.File(q,C));if(!p.features.triggerDialog){b.removeAllEvents(B,p.id)}else{b.removeEvent(A,"click",p.id)}b.removeEvent(y,"change",p.id);v();if(E.length){f.trigger("FilesAdded",E)}}},p.id);B.appendChild(y);j.appendChild(B);p.refresh()}function u(){var i=a.createElement("div");i.innerHTML='<iframe id="'+p.id+'_iframe" name="'+p.id+'_iframe" src="'+h+':&quot;&quot;" style="display:none"></iframe>';n=i.firstChild;j.appendChild(n);b.addEvent(n,"load",function(C){var D=C.target,B,y;if(!k){return}try{B=D.contentWindow.document||D.contentDocument||d.frames[D.id].document}catch(A){p.trigger("Error",{code:b.SECURITY_ERROR,message:b.translate("Security error."),file:k});return}y=B.body.innerHTML;if(y){k.status=b.DONE;k.loaded=1025;k.percent=100;p.trigger("UploadProgress",k);p.trigger("FileUploaded",k,{response:y})}},p.id)}if(p.settings.container){j=e(p.settings.container);if(b.getStyle(j,"position")==="static"){j.style.position="relative"}}p.bind("UploadFile",function(i,A){var B,y;if(A.status==b.DONE||A.status==b.FAILED||i.state==b.STOPPED){return}B=e("form_"+A.id);y=e("input_"+A.id);y.setAttribute("name",i.settings.file_data_name);B.setAttribute("action",i.settings.url);b.each(b.extend({name:A.target_name||A.name},i.settings.multipart_params),function(E,C){var D=a.createElement("input");b.extend(D,{type:"hidden",name:C,value:E});B.insertBefore(D,B.firstChild)});k=A;e("form_"+q).style.top=-1048575+"px";B.submit()});p.bind("FileUploaded",function(i){i.refresh()});p.bind("StateChanged",function(i){if(i.state==b.STARTED){u()}else{if(i.state==b.STOPPED){d.setTimeout(function(){b.removeEvent(n,"load",i.id);if(n.parentNode){n.parentNode.removeChild(n)}},0)}}b.each(i.files,function(A,y){if(A.status===b.DONE||A.status===b.FAILED){var B=e("form_"+A.id);if(B){B.parentNode.removeChild(B)}}})});p.bind("Refresh",function(y){var F,A,B,C,i,G,H,E,D;F=e(y.settings.browse_button);if(F){i=b.getPos(F,e(y.settings.container));G=b.getSize(F);H=e("form_"+q);E=e("input_"+q);b.extend(H.style,{top:i.y+"px",left:i.x+"px",width:G.w+"px",height:G.h+"px"});if(y.features.triggerDialog){if(b.getStyle(F,"position")==="static"){b.extend(F.style,{position:"relative"})}D=parseInt(F.style.zIndex,10);if(isNaN(D)){D=0}b.extend(F.style,{zIndex:D});b.extend(H.style,{zIndex:D-1})}B=y.settings.browse_button_hover;C=y.settings.browse_button_active;A=y.features.triggerDialog?F:H;if(B){b.addEvent(A,"mouseover",function(){b.addClass(F,B)},y.id);b.addEvent(A,"mouseout",function(){b.removeClass(F,B)},y.id)}if(C){b.addEvent(A,"mousedown",function(){b.addClass(F,C)},y.id);b.addEvent(a.body,"mouseup",function(){b.removeClass(F,C)},y.id)}}});f.bind("FilesRemoved",function(y,B){var A,C;for(A=0;A<B.length;A++){C=e("form_"+B[A].id);if(C){C.parentNode.removeChild(C)}}});f.bind("DisableBrowse",function(i,A){var y=a.getElementById("input_"+q);if(y){y.disabled=A}});f.bind("Destroy",function(i){var y,A,B,C={inputContainer:"form_"+q,inputFile:"input_"+q,browseButton:i.settings.browse_button};for(y in C){A=e(C[y]);if(A){b.removeAllEvents(A,i.id)}}b.removeAllEvents(a.body,i.id);b.each(z,function(E,D){B=e("form_"+E);if(B){j.removeChild(B)}})});v()});g({success:true})}})})(window,document,plupload);
\ No newline at end of file
+(function(d,a,b,c){function e(f){return a.getElementById(f)}b.runtimes.Html4=b.addRuntime("html4",{getFeatures:function(){return{multipart:true,triggerDialog:(b.ua.gecko&&d.FormData||b.ua.webkit)}},init:function(f,g){f.bind("Init",function(p){var j=a.body,n,h="javascript",k,x,q,z=[],r=/MSIE/.test(navigator.userAgent),t=[],m=p.settings.filters,o,l,s,w;no_type_restriction:for(o=0;o<m.length;o++){l=m[o].extensions.split(/,/);for(w=0;w<l.length;w++){if(l[w]==="*"){t=[];break no_type_restriction}s=b.mimeTypes[l[w]];if(s&&b.inArray(s,t)===-1){t.push(s)}}}t=t.join(",");function v(){var B,y,i,A;q=b.guid();z.push(q);B=a.createElement("form");B.setAttribute("id","form_"+q);B.setAttribute("method","post");B.setAttribute("enctype","multipart/form-data");B.setAttribute("encoding","multipart/form-data");B.setAttribute("target",p.id+"_iframe");B.style.position="absolute";y=a.createElement("input");y.setAttribute("id","input_"+q);y.setAttribute("type","file");y.setAttribute("accept",t);y.setAttribute("size",1);A=e(p.settings.browse_button);if(p.features.triggerDialog&&A){b.addEvent(e(p.settings.browse_button),"click",function(C){if(!y.disabled){y.click()}C.preventDefault()},p.id)}b.extend(y.style,{width:"100%",height:"100%",opacity:0,fontSize:"99px",cursor:"pointer"});b.extend(B.style,{overflow:"hidden"});i=p.settings.shim_bgcolor;if(i){B.style.background=i}if(r){b.extend(y.style,{filter:"alpha(opacity=0)"})}b.addEvent(y,"change",function(F){var D=F.target,C,E=[],G;if(D.value){e("form_"+q).style.top=-1048575+"px";C=D.value.replace(/\\/g,"/");C=C.substring(C.length,C.lastIndexOf("/")+1);E.push(new b.File(q,C));if(!p.features.triggerDialog){b.removeAllEvents(B,p.id)}else{b.removeEvent(A,"click",p.id)}b.removeEvent(y,"change",p.id);v();if(E.length){f.trigger("FilesAdded",E)}}},p.id);B.appendChild(y);j.appendChild(B);p.refresh()}function u(){var i=a.createElement("div");i.innerHTML='<iframe id="'+p.id+'_iframe" name="'+p.id+'_iframe" src="'+h+':&quot;&quot;" style="display:none"></iframe>';n=i.firstChild;j.appendChild(n);b.addEvent(n,"load",function(C){var D=C.target,B,y;if(!k){return}try{B=D.contentWindow.document||D.contentDocument||d.frames[D.id].document}catch(A){p.trigger("Error",{code:b.SECURITY_ERROR,message:b.translate("Security error."),file:k});return}y=B.documentElement.innerText||B.documentElement.textContent;if(y){k.status=b.DONE;k.loaded=1025;k.percent=100;p.trigger("UploadProgress",k);p.trigger("FileUploaded",k,{response:y})}},p.id)}if(p.settings.container){j=e(p.settings.container);if(b.getStyle(j,"position")==="static"){j.style.position="relative"}}p.bind("UploadFile",function(i,A){var B,y;if(A.status==b.DONE||A.status==b.FAILED||i.state==b.STOPPED){return}B=e("form_"+A.id);y=e("input_"+A.id);y.setAttribute("name",i.settings.file_data_name);B.setAttribute("action",i.settings.url);b.each(b.extend({name:A.target_name||A.name},i.settings.multipart_params),function(E,C){var D=a.createElement("input");b.extend(D,{type:"hidden",name:C,value:E});B.insertBefore(D,B.firstChild)});k=A;e("form_"+q).style.top=-1048575+"px";B.submit()});p.bind("FileUploaded",function(i){i.refresh()});p.bind("StateChanged",function(i){if(i.state==b.STARTED){u()}else{if(i.state==b.STOPPED){d.setTimeout(function(){b.removeEvent(n,"load",i.id);if(n.parentNode){n.parentNode.removeChild(n)}},0)}}b.each(i.files,function(A,y){if(A.status===b.DONE||A.status===b.FAILED){var B=e("form_"+A.id);if(B){B.parentNode.removeChild(B)}}})});p.bind("Refresh",function(y){var F,A,B,C,i,G,H,E,D;F=e(y.settings.browse_button);if(F){i=b.getPos(F,e(y.settings.container));G=b.getSize(F);H=e("form_"+q);E=e("input_"+q);b.extend(H.style,{top:i.y+"px",left:i.x+"px",width:G.w+"px",height:G.h+"px"});if(y.features.triggerDialog){if(b.getStyle(F,"position")==="static"){b.extend(F.style,{position:"relative"})}D=parseInt(F.style.zIndex,10);if(isNaN(D)){D=0}b.extend(F.style,{zIndex:D});b.extend(H.style,{zIndex:D-1})}B=y.settings.browse_button_hover;C=y.settings.browse_button_active;A=y.features.triggerDialog?F:H;if(B){b.addEvent(A,"mouseover",function(){b.addClass(F,B)},y.id);b.addEvent(A,"mouseout",function(){b.removeClass(F,B)},y.id)}if(C){b.addEvent(A,"mousedown",function(){b.addClass(F,C)},y.id);b.addEvent(a.body,"mouseup",function(){b.removeClass(F,C)},y.id)}}});f.bind("FilesRemoved",function(y,B){var A,C;for(A=0;A<B.length;A++){C=e("form_"+B[A].id);if(C){C.parentNode.removeChild(C)}}});f.bind("DisableBrowse",function(i,A){var y=a.getElementById("input_"+q);if(y){y.disabled=A}});f.bind("Destroy",function(i){var y,A,B,C={inputContainer:"form_"+q,inputFile:"input_"+q,browseButton:i.settings.browse_button};for(y in C){A=e(C[y]);if(A){b.removeAllEvents(A,i.id)}}b.removeAllEvents(a.body,i.id);b.each(z,function(E,D){B=e("form_"+E);if(B){B.parentNode.removeChild(B)}})});v()});g({success:true})}})})(window,document,plupload);
\ No newline at end of file
index 2e00bc5195d3520faf1a08470b5fd3dea95fc2ae..a4b2a1fc0a7853b2d6fe27080a8dd3557485f606 100644 (file)
@@ -1 +1 @@
-(function(h,k,j,e){var c={},g;function m(o,p){var n;if("FileReader" in h){n=new FileReader();n.readAsDataURL(o);n.onload=function(){p(n.result)}}else{return p(o.getAsDataURL())}}function l(o,p){var n;if("FileReader" in h){n=new FileReader();n.readAsBinaryString(o);n.onload=function(){p(n.result)}}else{return p(o.getAsBinary())}}function d(r,p,n,v){var q,o,u,s,t=this;m(c[r.id],function(w){q=k.createElement("canvas");q.style.display="none";k.body.appendChild(q);o=q.getContext("2d");u=new Image();u.onerror=u.onabort=function(){v({success:false})};u.onload=function(){var C,x,z,y,B;if(!p.width){p.width=u.width}if(!p.height){p.height=u.height}s=Math.min(p.width/u.width,p.height/u.height);if(s<1){C=Math.round(u.width*s);x=Math.round(u.height*s)}else{if(p.quality&&n==="image/jpeg"){C=u.width;x=u.height}else{v({success:false});return}}q.width=C;q.height=x;o.drawImage(u,0,0,C,x);if(n==="image/jpeg"){y=new f(atob(w.substring(w.indexOf("base64,")+7)));if(y.headers&&y.headers.length){B=new a();if(B.init(y.get("exif")[0])){B.setExif("PixelXDimension",C);B.setExif("PixelYDimension",x);y.set("exif",B.getBinary());if(t.hasEventListener("ExifData")){t.trigger("ExifData",r,B.EXIF())}if(t.hasEventListener("GpsData")){t.trigger("GpsData",r,B.GPS())}}}if(p.quality){try{w=q.toDataURL(n,p.quality/100)}catch(A){w=q.toDataURL(n)}}}else{w=q.toDataURL(n)}w=w.substring(w.indexOf("base64,")+7);w=atob(w);if(y&&y.headers&&y.headers.length){w=y.restore(w);y.purge()}q.parentNode.removeChild(q);v({success:true,data:w})};u.src=w})}j.runtimes.Html5=j.addRuntime("html5",{getFeatures:function(){var s,o,r,q,p,n;o=r=p=n=false;if(h.XMLHttpRequest){s=new XMLHttpRequest();r=!!s.upload;o=!!(s.sendAsBinary||s.upload)}if(o){q=!!(s.sendAsBinary||(h.Uint8Array&&h.ArrayBuffer));p=!!(File&&(File.prototype.getAsDataURL||h.FileReader)&&q);n=!!(File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice))}g=j.ua.safari&&j.ua.windows;return{html5:o,dragdrop:(function(){var t=k.createElement("div");return("draggable" in t)||("ondragstart" in t&&"ondrop" in t)}()),jpgresize:p,pngresize:p,multipart:p||!!h.FileReader||!!h.FormData,canSendBinary:q,cantSendBlobInFormData:!!(j.ua.gecko&&h.FormData&&h.FileReader&&!FileReader.prototype.readAsArrayBuffer),progress:r,chunks:n,multi_selection:!(j.ua.safari&&j.ua.windows),triggerDialog:(j.ua.gecko&&h.FormData||j.ua.webkit)}},init:function(p,r){var n,q;function o(w){var u,t,v=[],x,s={};for(t=0;t<w.length;t++){u=w[t];if(s[u.name]){continue}s[u.name]=true;x=j.guid();c[x]=u;v.push(new j.File(x,u.fileName||u.name,u.fileSize||u.size))}if(v.length){p.trigger("FilesAdded",v)}}n=this.getFeatures();if(!n.html5){r({success:false});return}p.bind("Init",function(w){var G,F,C=[],v,D,t=w.settings.filters,u,B,s=k.body,E;G=k.createElement("div");G.id=w.id+"_html5_container";j.extend(G.style,{position:"absolute",background:p.settings.shim_bgcolor||"transparent",width:"100px",height:"100px",overflow:"hidden",zIndex:99999,opacity:p.settings.shim_bgcolor?"":0});G.className="plupload html5";if(p.settings.container){s=k.getElementById(p.settings.container);if(j.getStyle(s,"position")==="static"){s.style.position="relative"}}s.appendChild(G);no_type_restriction:for(v=0;v<t.length;v++){u=t[v].extensions.split(/,/);for(D=0;D<u.length;D++){if(u[D]==="*"){C=[];break no_type_restriction}B=j.mimeTypes[u[D]];if(B&&j.inArray(B,C)===-1){C.push(B)}}}G.innerHTML='<input id="'+p.id+'_html5"  style="font-size:999px" type="file" accept="'+C.join(",")+'" '+(p.settings.multi_selection&&p.features.multi_selection?'multiple="multiple"':"")+" />";G.scrollTop=100;E=k.getElementById(p.id+"_html5");if(w.features.triggerDialog){j.extend(E.style,{position:"absolute",width:"100%",height:"100%"})}else{j.extend(E.style,{cssFloat:"right",styleFloat:"right"})}E.onchange=function(){o(this.files);this.value=""};F=k.getElementById(w.settings.browse_button);if(F){var z=w.settings.browse_button_hover,A=w.settings.browse_button_active,x=w.features.triggerDialog?F:G;if(z){j.addEvent(x,"mouseover",function(){j.addClass(F,z)},w.id);j.addEvent(x,"mouseout",function(){j.removeClass(F,z)},w.id)}if(A){j.addEvent(x,"mousedown",function(){j.addClass(F,A)},w.id);j.addEvent(k.body,"mouseup",function(){j.removeClass(F,A)},w.id)}if(w.features.triggerDialog){j.addEvent(F,"click",function(H){var y=k.getElementById(w.id+"_html5");if(y&&!y.disabled){y.click()}H.preventDefault()},w.id)}}});p.bind("PostInit",function(){var s=k.getElementById(p.settings.drop_element);if(s){if(g){j.addEvent(s,"dragenter",function(w){var v,t,u;v=k.getElementById(p.id+"_drop");if(!v){v=k.createElement("input");v.setAttribute("type","file");v.setAttribute("id",p.id+"_drop");v.setAttribute("multiple","multiple");j.addEvent(v,"change",function(){o(this.files);j.removeEvent(v,"change",p.id);v.parentNode.removeChild(v)},p.id);s.appendChild(v)}t=j.getPos(s,k.getElementById(p.settings.container));u=j.getSize(s);if(j.getStyle(s,"position")==="static"){j.extend(s.style,{position:"relative"})}j.extend(v.style,{position:"absolute",display:"block",top:0,left:0,width:u.w+"px",height:u.h+"px",opacity:0})},p.id);return}j.addEvent(s,"dragover",function(t){t.preventDefault()},p.id);j.addEvent(s,"drop",function(u){var t=u.dataTransfer;if(t&&t.files){o(t.files)}u.preventDefault()},p.id)}});p.bind("Refresh",function(s){var t,u,v,x,w;t=k.getElementById(p.settings.browse_button);if(t){u=j.getPos(t,k.getElementById(s.settings.container));v=j.getSize(t);x=k.getElementById(p.id+"_html5_container");j.extend(x.style,{top:u.y+"px",left:u.x+"px",width:v.w+"px",height:v.h+"px"});if(p.features.triggerDialog){if(j.getStyle(t,"position")==="static"){j.extend(t.style,{position:"relative"})}w=parseInt(j.getStyle(t,"zIndex"),10);if(isNaN(w)){w=0}j.extend(t.style,{zIndex:w});j.extend(x.style,{zIndex:w-1})}}});p.bind("DisableBrowse",function(s,u){var t=k.getElementById(s.id+"_html5");if(t){t.disabled=u}});p.bind("CancelUpload",function(){if(q&&q.abort){q.abort()}});p.bind("UploadFile",function(s,u){var v=s.settings,y,t;function x(A,D,z){var B;if(File.prototype.slice){try{A.slice();return A.slice(D,z)}catch(C){return A.slice(D,z-D)}}else{if(B=File.prototype.webkitSlice||File.prototype.mozSlice){return B.call(A,D,z)}else{return null}}}function w(A){var D=0,C=0,z=("FileReader" in h)?new FileReader:null;function B(){var I,M,K,L,H,J,F,E=s.settings.url;function G(V){var T=0,N="----pluploadboundary"+j.guid(),O,P="--",U="\r\n",R="";q=new XMLHttpRequest;if(q.upload){q.upload.onprogress=function(W){u.loaded=Math.min(u.size,C+W.loaded-T);s.trigger("UploadProgress",u)}}q.onreadystatechange=function(){var W,Y;if(q.readyState==4&&s.state!==j.STOPPED){try{W=q.status}catch(X){W=0}if(W>=400){s.trigger("Error",{code:j.HTTP_ERROR,message:j.translate("HTTP Error."),file:u,status:W})}else{if(K){Y={chunk:D,chunks:K,response:q.responseText,status:W};s.trigger("ChunkUploaded",u,Y);C+=J;if(Y.cancelled){u.status=j.FAILED;return}u.loaded=Math.min(u.size,(D+1)*H)}else{u.loaded=u.size}s.trigger("UploadProgress",u);V=I=O=R=null;if(!K||++D>=K){u.status=j.DONE;s.trigger("FileUploaded",u,{response:q.responseText,status:W})}else{B()}}}};if(s.settings.multipart&&n.multipart){L.name=u.target_name||u.name;q.open("post",E,true);j.each(s.settings.headers,function(X,W){q.setRequestHeader(W,X)});if(typeof(V)!=="string"&&!!h.FormData){O=new FormData();j.each(j.extend(L,s.settings.multipart_params),function(X,W){O.append(W,X)});O.append(s.settings.file_data_name,V);q.send(O);return}if(typeof(V)==="string"){q.setRequestHeader("Content-Type","multipart/form-data; boundary="+N);j.each(j.extend(L,s.settings.multipart_params),function(X,W){R+=P+N+U+'Content-Disposition: form-data; name="'+W+'"'+U+U;R+=unescape(encodeURIComponent(X))+U});F=j.mimeTypes[u.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream";R+=P+N+U+'Content-Disposition: form-data; name="'+s.settings.file_data_name+'"; filename="'+unescape(encodeURIComponent(u.name))+'"'+U+"Content-Type: "+F+U+U+V+U+P+N+P+U;T=R.length-V.length;V=R;if(q.sendAsBinary){q.sendAsBinary(V)}else{if(n.canSendBinary){var S=new Uint8Array(V.length);for(var Q=0;Q<V.length;Q++){S[Q]=(V.charCodeAt(Q)&255)}q.send(S.buffer)}}return}}E=j.buildUrl(s.settings.url,j.extend(L,s.settings.multipart_params));q.open("post",E,true);q.setRequestHeader("Content-Type","application/octet-stream");j.each(s.settings.headers,function(X,W){q.setRequestHeader(W,X)});q.send(V)}if(u.status==j.DONE||u.status==j.FAILED||s.state==j.STOPPED){return}L={name:u.target_name||u.name};if(v.chunk_size&&u.size>v.chunk_size&&(n.chunks||typeof(A)=="string")){H=v.chunk_size;K=Math.ceil(u.size/H);J=Math.min(H,u.size-(D*H));if(typeof(A)=="string"){I=A.substring(D*H,D*H+J)}else{I=x(A,D*H,D*H+J)}L.chunk=D;L.chunks=K}else{J=u.size;I=A}if(s.settings.multipart&&n.multipart&&typeof(I)!=="string"&&z&&n.cantSendBlobInFormData&&n.chunks&&s.settings.chunk_size){z.onload=function(){G(z.result)};z.readAsBinaryString(I)}else{G(I)}}B()}y=c[u.id];if(n.jpgresize&&s.settings.resize&&/\.(png|jpg|jpeg)$/i.test(u.name)){d.call(s,u,s.settings.resize,/\.png$/i.test(u.name)?"image/png":"image/jpeg",function(z){if(z.success){u.size=z.data.length;w(z.data)}else{if(n.chunks){w(y)}else{l(y,w)}}})}else{if(!n.chunks&&n.jpgresize){l(y,w)}else{w(y)}}});p.bind("Destroy",function(s){var u,v,t=k.body,w={inputContainer:s.id+"_html5_container",inputFile:s.id+"_html5",browseButton:s.settings.browse_button,dropElm:s.settings.drop_element};for(u in w){v=k.getElementById(w[u]);if(v){j.removeAllEvents(v,s.id)}}j.removeAllEvents(k.body,s.id);if(s.settings.container){t=k.getElementById(s.settings.container)}t.removeChild(k.getElementById(w.inputContainer))});r({success:true})}});function b(){var q=false,o;function r(t,v){var s=q?0:-8*(v-1),w=0,u;for(u=0;u<v;u++){w|=(o.charCodeAt(t+u)<<Math.abs(s+u*8))}return w}function n(u,s,t){var t=arguments.length===3?t:o.length-s-1;o=o.substr(0,s)+u+o.substr(t+s)}function p(t,u,w){var x="",s=q?0:-8*(w-1),v;for(v=0;v<w;v++){x+=String.fromCharCode((u>>Math.abs(s+v*8))&255)}n(x,t,w)}return{II:function(s){if(s===e){return q}else{q=s}},init:function(s){q=false;o=s},SEGMENT:function(s,u,t){switch(arguments.length){case 1:return o.substr(s,o.length-s-1);case 2:return o.substr(s,u);case 3:n(t,s,u);break;default:return o}},BYTE:function(s){return r(s,1)},SHORT:function(s){return r(s,2)},LONG:function(s,t){if(t===e){return r(s,4)}else{p(s,t,4)}},SLONG:function(s){var t=r(s,4);return(t>2147483647?t-4294967296:t)},STRING:function(s,t){var u="";for(t+=s;s<t;s++){u+=String.fromCharCode(r(s,1))}return u}}}function f(s){var u={65505:{app:"EXIF",name:"APP1",signature:"Exif\0"},65506:{app:"ICC",name:"APP2",signature:"ICC_PROFILE\0"},65517:{app:"IPTC",name:"APP13",signature:"Photoshop 3.0\0"}},t=[],r,n,p=e,q=0,o;r=new b();r.init(s);if(r.SHORT(0)!==65496){return}n=2;o=Math.min(1048576,s.length);while(n<=o){p=r.SHORT(n);if(p>=65488&&p<=65495){n+=2;continue}if(p===65498||p===65497){break}q=r.SHORT(n+2)+2;if(u[p]&&r.STRING(n+4,u[p].signature.length)===u[p].signature){t.push({hex:p,app:u[p].app.toUpperCase(),name:u[p].name.toUpperCase(),start:n,length:q,segment:r.SEGMENT(n,q)})}n+=q}r.init(null);return{headers:t,restore:function(y){r.init(y);var w=new f(y);if(!w.headers){return false}for(var x=w.headers.length;x>0;x--){var z=w.headers[x-1];r.SEGMENT(z.start,z.length,"")}w.purge();n=r.SHORT(2)==65504?4+r.SHORT(4):2;for(var x=0,v=t.length;x<v;x++){r.SEGMENT(n,0,t[x].segment);n+=t[x].length}return r.SEGMENT()},get:function(x){var y=[];for(var w=0,v=t.length;w<v;w++){if(t[w].app===x.toUpperCase()){y.push(t[w].segment)}}return y},set:function(y,x){var z=[];if(typeof(x)==="string"){z.push(x)}else{z=x}for(var w=ii=0,v=t.length;w<v;w++){if(t[w].app===y.toUpperCase()){t[w].segment=z[ii];t[w].length=z[ii].length;ii++}if(ii>=z.length){break}}},purge:function(){t=[];r.init(null)}}}function a(){var q,n,o={},t;q=new b();n={tiff:{274:"Orientation",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"}};t={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire.",1:"Flash fired.",5:"Strobe return light not detected.",7:"Strobe return light detected.",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}};function p(u,C){var w=q.SHORT(u),z,F,G,B,A,v,x,D,E=[],y={};for(z=0;z<w;z++){x=v=u+12*z+2;G=C[q.SHORT(x)];if(G===e){continue}B=q.SHORT(x+=2);A=q.LONG(x+=2);x+=4;E=[];switch(B){case 1:case 7:if(A>4){x=q.LONG(x)+o.tiffHeader}for(F=0;F<A;F++){E[F]=q.BYTE(x+F)}break;case 2:if(A>4){x=q.LONG(x)+o.tiffHeader}y[G]=q.STRING(x,A-1);continue;case 3:if(A>2){x=q.LONG(x)+o.tiffHeader}for(F=0;F<A;F++){E[F]=q.SHORT(x+F*2)}break;case 4:if(A>1){x=q.LONG(x)+o.tiffHeader}for(F=0;F<A;F++){E[F]=q.LONG(x+F*4)}break;case 5:x=q.LONG(x)+o.tiffHeader;for(F=0;F<A;F++){E[F]=q.LONG(x+F*4)/q.LONG(x+F*4+4)}break;case 9:x=q.LONG(x)+o.tiffHeader;for(F=0;F<A;F++){E[F]=q.SLONG(x+F*4)}break;case 10:x=q.LONG(x)+o.tiffHeader;for(F=0;F<A;F++){E[F]=q.SLONG(x+F*4)/q.SLONG(x+F*4+4)}break;default:continue}D=(A==1?E[0]:E);if(t.hasOwnProperty(G)&&typeof D!="object"){y[G]=t[G][D]}else{y[G]=D}}return y}function s(){var v=e,u=o.tiffHeader;q.II(q.SHORT(u)==18761);if(q.SHORT(u+=2)!==42){return false}o.IFD0=o.tiffHeader+q.LONG(u+=2);v=p(o.IFD0,n.tiff);o.exifIFD=("ExifIFDPointer" in v?o.tiffHeader+v.ExifIFDPointer:e);o.gpsIFD=("GPSInfoIFDPointer" in v?o.tiffHeader+v.GPSInfoIFDPointer:e);return true}function r(w,u,z){var B,y,x,A=0;if(typeof(u)==="string"){var v=n[w.toLowerCase()];for(hex in v){if(v[hex]===u){u=hex;break}}}B=o[w.toLowerCase()+"IFD"];y=q.SHORT(B);for(i=0;i<y;i++){x=B+12*i+2;if(q.SHORT(x)==u){A=x+8;break}}if(!A){return false}q.LONG(A,z);return true}return{init:function(u){o={tiffHeader:10};if(u===e||!u.length){return false}q.init(u);if(q.SHORT(0)===65505&&q.STRING(4,5).toUpperCase()==="EXIF\0"){return s()}return false},EXIF:function(){var v;v=p(o.exifIFD,n.exif);if(v.ExifVersion&&j.typeOf(v.ExifVersion)==="array"){for(var w=0,u="";w<v.ExifVersion.length;w++){u+=String.fromCharCode(v.ExifVersion[w])}v.ExifVersion=u}return v},GPS:function(){var u;u=p(o.gpsIFD,n.gps);if(u.GPSVersionID){u.GPSVersionID=u.GPSVersionID.join(".")}return u},setExif:function(u,v){if(u!=="PixelXDimension"&&u!=="PixelYDimension"){return false}return r("exif",u,v)},getBinary:function(){return q.SEGMENT()}}}})(window,document,plupload);
\ No newline at end of file
+(function(k,m,l,g){var d={},j;function c(s){var r=s.naturalWidth,u=s.naturalHeight;if(r*u>1024*1024){var t=m.createElement("canvas");t.width=t.height=1;var q=t.getContext("2d");q.drawImage(s,-r+1,0);return q.getImageData(0,0,1,1).data[3]===0}else{return false}}function f(u,r,z){var q=m.createElement("canvas");q.width=1;q.height=z;var A=q.getContext("2d");A.drawImage(u,0,0);var t=A.getImageData(0,0,1,z).data;var x=0;var v=z;var y=z;while(y>x){var s=t[(y-1)*4+3];if(s===0){v=y}else{x=y}y=(v+x)>>1}var w=(y/z);return(w===0)?1:w}function o(K,s,t){var v=K.naturalWidth,z=K.naturalHeight;var E=t.width,B=t.height;var F=s.getContext("2d");F.save();var r=c(K);if(r){v/=2;z/=2}var I=1024;var q=m.createElement("canvas");q.width=q.height=I;var u=q.getContext("2d");var G=f(K,v,z);var A=0;while(A<z){var J=A+I>z?z-A:I;var C=0;while(C<v){var D=C+I>v?v-C:I;u.clearRect(0,0,I,I);u.drawImage(K,-C,-A);var x=(C*E/v)<<0;var y=Math.ceil(D*E/v);var w=(A*B/z/G)<<0;var H=Math.ceil(J*B/z/G);F.drawImage(q,0,0,D,J,x,w,y,H);C+=I}A+=I}F.restore();q=u=null}function p(r,s){var q;if("FileReader" in k){q=new FileReader();q.readAsDataURL(r);q.onload=function(){s(q.result)}}else{return s(r.getAsDataURL())}}function n(r,s){var q;if("FileReader" in k){q=new FileReader();q.readAsBinaryString(r);q.onload=function(){s(q.result)}}else{return s(r.getAsBinary())}}function e(u,s,q,y){var t,r,x,v,w=this;p(d[u.id],function(z){t=m.createElement("canvas");t.style.display="none";m.body.appendChild(t);x=new Image();x.onerror=x.onabort=function(){y({success:false})};x.onload=function(){var F,A,C,B,E;if(!s.width){s.width=x.width}if(!s.height){s.height=x.height}v=Math.min(s.width/x.width,s.height/x.height);if(v<1){F=Math.round(x.width*v);A=Math.round(x.height*v)}else{if(s.quality&&q==="image/jpeg"){F=x.width;A=x.height}else{y({success:false});return}}t.width=F;t.height=A;o(x,t,{width:F,height:A});if(q==="image/jpeg"){B=new h(atob(z.substring(z.indexOf("base64,")+7)));if(B.headers&&B.headers.length){E=new a();if(E.init(B.get("exif")[0])){E.setExif("PixelXDimension",F);E.setExif("PixelYDimension",A);B.set("exif",E.getBinary());if(w.hasEventListener("ExifData")){w.trigger("ExifData",u,E.EXIF())}if(w.hasEventListener("GpsData")){w.trigger("GpsData",u,E.GPS())}}}}if(s.quality&&q==="image/jpeg"){try{z=t.toDataURL(q,s.quality/100)}catch(D){z=t.toDataURL(q)}}else{z=t.toDataURL(q)}z=z.substring(z.indexOf("base64,")+7);z=atob(z);if(B&&B.headers&&B.headers.length){z=B.restore(z);B.purge()}t.parentNode.removeChild(t);y({success:true,data:z})};x.src=z})}l.runtimes.Html5=l.addRuntime("html5",{getFeatures:function(){var v,r,u,t,s,q;r=u=s=q=false;if(k.XMLHttpRequest){v=new XMLHttpRequest();u=!!v.upload;r=!!(v.sendAsBinary||v.upload)}if(r){t=!!(v.sendAsBinary||(k.Uint8Array&&k.ArrayBuffer));s=!!(File&&(File.prototype.getAsDataURL||k.FileReader)&&t);q=!!(File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice))}j=l.ua.safari&&l.ua.windows;return{html5:r,dragdrop:(function(){var w=m.createElement("div");return("draggable" in w)||("ondragstart" in w&&"ondrop" in w)}()),jpgresize:s,pngresize:s,multipart:s||!!k.FileReader||!!k.FormData,canSendBinary:t,cantSendBlobInFormData:!!(l.ua.gecko&&k.FormData&&k.FileReader&&!FileReader.prototype.readAsArrayBuffer)||l.ua.android,progress:u,chunks:q,multi_selection:!(l.ua.safari&&l.ua.windows),triggerDialog:(l.ua.gecko&&k.FormData||l.ua.webkit)}},init:function(s,u){var q,t;function r(z){var x,w,y=[],A,v={};for(w=0;w<z.length;w++){x=z[w];if(v[x.name]&&l.ua.safari&&l.ua.windows){continue}v[x.name]=true;A=l.guid();d[A]=x;y.push(new l.File(A,x.fileName||x.name,x.fileSize||x.size))}if(y.length){s.trigger("FilesAdded",y)}}q=this.getFeatures();if(!q.html5){u({success:false});return}s.bind("Init",function(A){var J,I,F=[],z,G,w=A.settings.filters,x,E,v=m.body,H;J=m.createElement("div");J.id=A.id+"_html5_container";l.extend(J.style,{position:"absolute",background:s.settings.shim_bgcolor||"transparent",width:"100px",height:"100px",overflow:"hidden",zIndex:99999,opacity:s.settings.shim_bgcolor?"":0});J.className="plupload html5";if(s.settings.container){v=m.getElementById(s.settings.container);if(l.getStyle(v,"position")==="static"){v.style.position="relative"}}v.appendChild(J);no_type_restriction:for(z=0;z<w.length;z++){x=w[z].extensions.split(/,/);for(G=0;G<x.length;G++){if(x[G]==="*"){F=[];break no_type_restriction}E=l.mimeTypes[x[G]];if(E&&l.inArray(E,F)===-1){F.push(E)}}}J.innerHTML='<input id="'+s.id+'_html5"  style="font-size:999px" type="file" accept="'+F.join(",")+'" '+(s.settings.multi_selection&&s.features.multi_selection?'multiple="multiple"':"")+" />";J.scrollTop=100;H=m.getElementById(s.id+"_html5");if(A.features.triggerDialog){l.extend(H.style,{position:"absolute",width:"100%",height:"100%"})}else{l.extend(H.style,{cssFloat:"right",styleFloat:"right"})}H.onchange=function(){r(this.files);this.value=""};I=m.getElementById(A.settings.browse_button);if(I){var C=A.settings.browse_button_hover,D=A.settings.browse_button_active,B=A.features.triggerDialog?I:J;if(C){l.addEvent(B,"mouseover",function(){l.addClass(I,C)},A.id);l.addEvent(B,"mouseout",function(){l.removeClass(I,C)},A.id)}if(D){l.addEvent(B,"mousedown",function(){l.addClass(I,D)},A.id);l.addEvent(m.body,"mouseup",function(){l.removeClass(I,D)},A.id)}if(A.features.triggerDialog){l.addEvent(I,"click",function(K){var y=m.getElementById(A.id+"_html5");if(y&&!y.disabled){y.click()}K.preventDefault()},A.id)}}});s.bind("PostInit",function(){var v=m.getElementById(s.settings.drop_element);if(v){if(j){l.addEvent(v,"dragenter",function(z){var y,w,x;y=m.getElementById(s.id+"_drop");if(!y){y=m.createElement("input");y.setAttribute("type","file");y.setAttribute("id",s.id+"_drop");y.setAttribute("multiple","multiple");l.addEvent(y,"change",function(){r(this.files);l.removeEvent(y,"change",s.id);y.parentNode.removeChild(y)},s.id);l.addEvent(y,"dragover",function(A){A.stopPropagation()},s.id);v.appendChild(y)}w=l.getPos(v,m.getElementById(s.settings.container));x=l.getSize(v);if(l.getStyle(v,"position")==="static"){l.extend(v.style,{position:"relative"})}l.extend(y.style,{position:"absolute",display:"block",top:0,left:0,width:x.w+"px",height:x.h+"px",opacity:0})},s.id);return}l.addEvent(v,"dragover",function(w){w.preventDefault()},s.id);l.addEvent(v,"drop",function(x){var w=x.dataTransfer;if(w&&w.files){r(w.files)}x.preventDefault()},s.id)}});s.bind("Refresh",function(v){var w,x,y,A,z;w=m.getElementById(s.settings.browse_button);if(w){x=l.getPos(w,m.getElementById(v.settings.container));y=l.getSize(w);A=m.getElementById(s.id+"_html5_container");l.extend(A.style,{top:x.y+"px",left:x.x+"px",width:y.w+"px",height:y.h+"px"});if(s.features.triggerDialog){if(l.getStyle(w,"position")==="static"){l.extend(w.style,{position:"relative"})}z=parseInt(l.getStyle(w,"zIndex"),10);if(isNaN(z)){z=0}l.extend(w.style,{zIndex:z});l.extend(A.style,{zIndex:z-1})}}});s.bind("DisableBrowse",function(v,x){var w=m.getElementById(v.id+"_html5");if(w){w.disabled=x}});s.bind("CancelUpload",function(){if(t&&t.abort){t.abort()}});s.bind("UploadFile",function(v,x){var y=v.settings,B,w;function A(D,G,C){var E;if(File.prototype.slice){try{D.slice();return D.slice(G,C)}catch(F){return D.slice(G,C-G)}}else{if(E=File.prototype.webkitSlice||File.prototype.mozSlice){return E.call(D,G,C)}else{return null}}}function z(C){var F=0,E=0;function D(){var L,P,N,O,K,M,H,G=v.settings.url;function J(S){if(t.sendAsBinary){t.sendAsBinary(S)}else{if(v.features.canSendBinary){var Q=new Uint8Array(S.length);for(var R=0;R<S.length;R++){Q[R]=(S.charCodeAt(R)&255)}t.send(Q.buffer)}}}function I(R){var V=0,W="----pluploadboundary"+l.guid(),T,S="--",U="\r\n",Q="";t=new XMLHttpRequest;if(t.upload){t.upload.onprogress=function(X){x.loaded=Math.min(x.size,E+X.loaded-V);v.trigger("UploadProgress",x)}}t.onreadystatechange=function(){var X,Z;if(t.readyState==4&&v.state!==l.STOPPED){try{X=t.status}catch(Y){X=0}if(X>=400){v.trigger("Error",{code:l.HTTP_ERROR,message:l.translate("HTTP Error."),file:x,status:X})}else{if(N){Z={chunk:F,chunks:N,response:t.responseText,status:X};v.trigger("ChunkUploaded",x,Z);E+=M;if(Z.cancelled){x.status=l.FAILED;return}x.loaded=Math.min(x.size,(F+1)*K)}else{x.loaded=x.size}v.trigger("UploadProgress",x);R=L=T=Q=null;if(!N||++F>=N){x.status=l.DONE;v.trigger("FileUploaded",x,{response:t.responseText,status:X})}else{D()}}}};if(v.settings.multipart&&q.multipart){O.name=x.target_name||x.name;t.open("post",G,true);l.each(v.settings.headers,function(Y,X){t.setRequestHeader(X,Y)});if(typeof(R)!=="string"&&!!k.FormData){T=new FormData();l.each(l.extend(O,v.settings.multipart_params),function(Y,X){T.append(X,Y)});T.append(v.settings.file_data_name,R);t.send(T);return}if(typeof(R)==="string"){t.setRequestHeader("Content-Type","multipart/form-data; boundary="+W);l.each(l.extend(O,v.settings.multipart_params),function(Y,X){Q+=S+W+U+'Content-Disposition: form-data; name="'+X+'"'+U+U;Q+=unescape(encodeURIComponent(Y))+U});H=l.mimeTypes[x.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream";Q+=S+W+U+'Content-Disposition: form-data; name="'+v.settings.file_data_name+'"; filename="'+unescape(encodeURIComponent(x.name))+'"'+U+"Content-Type: "+H+U+U+R+U+S+W+S+U;V=Q.length-R.length;R=Q;J(R);return}}G=l.buildUrl(v.settings.url,l.extend(O,v.settings.multipart_params));t.open("post",G,true);t.setRequestHeader("Content-Type","application/octet-stream");l.each(v.settings.headers,function(Y,X){t.setRequestHeader(X,Y)});if(typeof(R)==="string"){J(R)}else{t.send(R)}}if(x.status==l.DONE||x.status==l.FAILED||v.state==l.STOPPED){return}O={name:x.target_name||x.name};if(y.chunk_size&&x.size>y.chunk_size&&(q.chunks||typeof(C)=="string")){K=y.chunk_size;N=Math.ceil(x.size/K);M=Math.min(K,x.size-(F*K));if(typeof(C)=="string"){L=C.substring(F*K,F*K+M)}else{L=A(C,F*K,F*K+M)}O.chunk=F;O.chunks=N}else{M=x.size;L=C}if(v.settings.multipart&&q.multipart&&typeof(L)!=="string"&&k.FileReader&&q.cantSendBlobInFormData&&q.chunks&&v.settings.chunk_size){(function(){var Q=new FileReader();Q.onload=function(){I(Q.result);Q=null};Q.readAsBinaryString(L)}())}else{I(L)}}D()}B=d[x.id];if(q.jpgresize&&v.settings.resize&&/\.(png|jpg|jpeg)$/i.test(x.name)){e.call(v,x,v.settings.resize,/\.png$/i.test(x.name)?"image/png":"image/jpeg",function(C){if(C.success){x.size=C.data.length;z(C.data)}else{if(q.chunks){z(B)}else{n(B,z)}}})}else{if(!q.chunks&&q.jpgresize){n(B,z)}else{z(B)}}});s.bind("Destroy",function(v){var x,y,w=m.body,z={inputContainer:v.id+"_html5_container",inputFile:v.id+"_html5",browseButton:v.settings.browse_button,dropElm:v.settings.drop_element};for(x in z){y=m.getElementById(z[x]);if(y){l.removeAllEvents(y,v.id)}}l.removeAllEvents(m.body,v.id);if(v.settings.container){w=m.getElementById(v.settings.container)}w.removeChild(m.getElementById(z.inputContainer))});u({success:true})}});function b(){var t=false,r;function u(w,y){var v=t?0:-8*(y-1),z=0,x;for(x=0;x<y;x++){z|=(r.charCodeAt(w+x)<<Math.abs(v+x*8))}return z}function q(x,v,w){var w=arguments.length===3?w:r.length-v-1;r=r.substr(0,v)+x+r.substr(w+v)}function s(w,x,z){var A="",v=t?0:-8*(z-1),y;for(y=0;y<z;y++){A+=String.fromCharCode((x>>Math.abs(v+y*8))&255)}q(A,w,z)}return{II:function(v){if(v===g){return t}else{t=v}},init:function(v){t=false;r=v},SEGMENT:function(v,x,w){switch(arguments.length){case 1:return r.substr(v,r.length-v-1);case 2:return r.substr(v,x);case 3:q(w,v,x);break;default:return r}},BYTE:function(v){return u(v,1)},SHORT:function(v){return u(v,2)},LONG:function(v,w){if(w===g){return u(v,4)}else{s(v,w,4)}},SLONG:function(v){var w=u(v,4);return(w>2147483647?w-4294967296:w)},STRING:function(v,w){var x="";for(w+=v;v<w;v++){x+=String.fromCharCode(u(v,1))}return x}}}function h(v){var x={65505:{app:"EXIF",name:"APP1",signature:"Exif\0"},65506:{app:"ICC",name:"APP2",signature:"ICC_PROFILE\0"},65517:{app:"IPTC",name:"APP13",signature:"Photoshop 3.0\0"}},w=[],u,q,s=g,t=0,r;u=new b();u.init(v);if(u.SHORT(0)!==65496){return}q=2;r=Math.min(1048576,v.length);while(q<=r){s=u.SHORT(q);if(s>=65488&&s<=65495){q+=2;continue}if(s===65498||s===65497){break}t=u.SHORT(q+2)+2;if(x[s]&&u.STRING(q+4,x[s].signature.length)===x[s].signature){w.push({hex:s,app:x[s].app.toUpperCase(),name:x[s].name.toUpperCase(),start:q,length:t,segment:u.SEGMENT(q,t)})}q+=t}u.init(null);return{headers:w,restore:function(B){u.init(B);var z=new h(B);if(!z.headers){return false}for(var A=z.headers.length;A>0;A--){var C=z.headers[A-1];u.SEGMENT(C.start,C.length,"")}z.purge();q=u.SHORT(2)==65504?4+u.SHORT(4):2;for(var A=0,y=w.length;A<y;A++){u.SEGMENT(q,0,w[A].segment);q+=w[A].length}return u.SEGMENT()},get:function(A){var B=[];for(var z=0,y=w.length;z<y;z++){if(w[z].app===A.toUpperCase()){B.push(w[z].segment)}}return B},set:function(B,A){var C=[];if(typeof(A)==="string"){C.push(A)}else{C=A}for(var z=ii=0,y=w.length;z<y;z++){if(w[z].app===B.toUpperCase()){w[z].segment=C[ii];w[z].length=C[ii].length;ii++}if(ii>=C.length){break}}},purge:function(){w=[];u.init(null)}}}function a(){var t,q,r={},w;t=new b();q={tiff:{274:"Orientation",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"}};w={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire.",1:"Flash fired.",5:"Strobe return light not detected.",7:"Strobe return light detected.",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}};function s(x,F){var z=t.SHORT(x),C,I,J,E,D,y,A,G,H=[],B={};for(C=0;C<z;C++){A=y=x+12*C+2;J=F[t.SHORT(A)];if(J===g){continue}E=t.SHORT(A+=2);D=t.LONG(A+=2);A+=4;H=[];switch(E){case 1:case 7:if(D>4){A=t.LONG(A)+r.tiffHeader}for(I=0;I<D;I++){H[I]=t.BYTE(A+I)}break;case 2:if(D>4){A=t.LONG(A)+r.tiffHeader}B[J]=t.STRING(A,D-1);continue;case 3:if(D>2){A=t.LONG(A)+r.tiffHeader}for(I=0;I<D;I++){H[I]=t.SHORT(A+I*2)}break;case 4:if(D>1){A=t.LONG(A)+r.tiffHeader}for(I=0;I<D;I++){H[I]=t.LONG(A+I*4)}break;case 5:A=t.LONG(A)+r.tiffHeader;for(I=0;I<D;I++){H[I]=t.LONG(A+I*4)/t.LONG(A+I*4+4)}break;case 9:A=t.LONG(A)+r.tiffHeader;for(I=0;I<D;I++){H[I]=t.SLONG(A+I*4)}break;case 10:A=t.LONG(A)+r.tiffHeader;for(I=0;I<D;I++){H[I]=t.SLONG(A+I*4)/t.SLONG(A+I*4+4)}break;default:continue}G=(D==1?H[0]:H);if(w.hasOwnProperty(J)&&typeof G!="object"){B[J]=w[J][G]}else{B[J]=G}}return B}function v(){var y=g,x=r.tiffHeader;t.II(t.SHORT(x)==18761);if(t.SHORT(x+=2)!==42){return false}r.IFD0=r.tiffHeader+t.LONG(x+=2);y=s(r.IFD0,q.tiff);r.exifIFD=("ExifIFDPointer" in y?r.tiffHeader+y.ExifIFDPointer:g);r.gpsIFD=("GPSInfoIFDPointer" in y?r.tiffHeader+y.GPSInfoIFDPointer:g);return true}function u(z,x,C){var E,B,A,D=0;if(typeof(x)==="string"){var y=q[z.toLowerCase()];for(hex in y){if(y[hex]===x){x=hex;break}}}E=r[z.toLowerCase()+"IFD"];B=t.SHORT(E);for(i=0;i<B;i++){A=E+12*i+2;if(t.SHORT(A)==x){D=A+8;break}}if(!D){return false}t.LONG(D,C);return true}return{init:function(x){r={tiffHeader:10};if(x===g||!x.length){return false}t.init(x);if(t.SHORT(0)===65505&&t.STRING(4,5).toUpperCase()==="EXIF\0"){return v()}return false},EXIF:function(){var y;y=s(r.exifIFD,q.exif);if(y.ExifVersion&&l.typeOf(y.ExifVersion)==="array"){for(var z=0,x="";z<y.ExifVersion.length;z++){x+=String.fromCharCode(y.ExifVersion[z])}y.ExifVersion=x}return y},GPS:function(){var x;x=s(r.gpsIFD,q.gps);if(x.GPSVersionID){x.GPSVersionID=x.GPSVersionID.join(".")}return x},setExif:function(x,y){if(x!=="PixelXDimension"&&x!=="PixelYDimension"){return false}return u("exif",x,y)},getBinary:function(){return t.SEGMENT()}}}})(window,document,plupload);
\ No newline at end of file
index 1555f94a65c37364307c9014f3d5c252d9bf80f4..5b3ffb7161f7a7385738ed224acd63daac405833 100644 (file)
@@ -1,2 +1,2 @@
-/*1.5.5*/
-(function(){var f=0,k=[],m={},i={},a={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},l=/[<>&\"\']/g,b,c=window.setTimeout,d={},e;function h(){this.returnValue=false}function j(){this.cancelBubble=true}(function(n){var o=n.split(/,/),p,r,q;for(p=0;p<o.length;p+=2){q=o[p+1].split(/ /);for(r=0;r<q.length;r++){i[q[r]]=o[p]}}})("application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mpga mpega mp2 mp3,audio/x-wav,wav,audio/mp4,m4a,image/bmp,bmp,image/gif,gif,image/jpeg,jpeg jpg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe");var g={VERSION:"1.5.5",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,IMAGE_FORMAT_ERROR:-700,IMAGE_MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,mimeTypes:i,ua:(function(){var r=navigator,q=r.userAgent,s=r.vendor,o,n,p;o=/WebKit/.test(q);p=o&&s.indexOf("Apple")!==-1;n=window.opera&&window.opera.buildNumber;return{windows:navigator.platform.indexOf("Win")!==-1,ie:!o&&!n&&(/MSIE/gi).test(q)&&(/Explorer/gi).test(r.appName),webkit:o,gecko:!o&&/Gecko/.test(q),safari:p,opera:!!n}}()),typeOf:function(n){return({}).toString.call(n).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()},extend:function(n){g.each(arguments,function(o,p){if(p>0){g.each(o,function(r,q){n[q]=r})}});return n},cleanName:function(n){var o,p;p=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"];for(o=0;o<p.length;o+=2){n=n.replace(p[o],p[o+1])}n=n.replace(/\s+/g,"_");n=n.replace(/[^a-z0-9_\-\.]+/gi,"");return n},addRuntime:function(n,o){o.name=n;k[n]=o;k.push(o);return o},guid:function(){var n=new Date().getTime().toString(32),o;for(o=0;o<5;o++){n+=Math.floor(Math.random()*65535).toString(32)}return(g.guidPrefix||"p")+n+(f++).toString(32)},buildUrl:function(o,n){var p="";g.each(n,function(r,q){p+=(p?"&":"")+encodeURIComponent(q)+"="+encodeURIComponent(r)});if(p){o+=(o.indexOf("?")>0?"&":"?")+p}return o},each:function(q,r){var p,o,n;if(q){p=q.length;if(p===b){for(o in q){if(q.hasOwnProperty(o)){if(r(q[o],o)===false){return}}}}else{for(n=0;n<p;n++){if(r(q[n],n)===false){return}}}}},formatSize:function(n){if(n===b||/\D/.test(n)){return g.translate("N/A")}if(n>1073741824){return Math.round(n/1073741824,1)+" GB"}if(n>1048576){return Math.round(n/1048576,1)+" MB"}if(n>1024){return Math.round(n/1024,1)+" KB"}return n+" b"},getPos:function(o,s){var t=0,r=0,v,u=document,p,q;o=o;s=s||u.body;function n(B){var z,A,w=0,C=0;if(B){A=B.getBoundingClientRect();z=u.compatMode==="CSS1Compat"?u.documentElement:u.body;w=A.left+z.scrollLeft;C=A.top+z.scrollTop}return{x:w,y:C}}if(o&&o.getBoundingClientRect&&((navigator.userAgent.indexOf("MSIE")>0)&&(u.documentMode<8))){p=n(o);q=n(s);return{x:p.x-q.x,y:p.y-q.y}}v=o;while(v&&v!=s&&v.nodeType){t+=v.offsetLeft||0;r+=v.offsetTop||0;v=v.offsetParent}v=o.parentNode;while(v&&v!=s&&v.nodeType){t-=v.scrollLeft||0;r-=v.scrollTop||0;v=v.parentNode}return{x:t,y:r}},getSize:function(n){return{w:n.offsetWidth||n.clientWidth,h:n.offsetHeight||n.clientHeight}},parseSize:function(n){var o;if(typeof(n)=="string"){n=/^([0-9]+)([mgk]?)$/.exec(n.toLowerCase().replace(/[^0-9mkg]/g,""));o=n[2];n=+n[1];if(o=="g"){n*=1073741824}if(o=="m"){n*=1048576}if(o=="k"){n*=1024}}return n},xmlEncode:function(n){return n?(""+n).replace(l,function(o){return a[o]?"&"+a[o]+";":o}):n},toArray:function(p){var o,n=[];for(o=0;o<p.length;o++){n[o]=p[o]}return n},inArray:function(p,q){if(q){if(Array.prototype.indexOf){return Array.prototype.indexOf.call(q,p)}for(var n=0,o=q.length;n<o;n++){if(q[n]===p){return n}}}return -1},addI18n:function(n){return g.extend(m,n)},translate:function(n){return m[n]||n},isEmptyObj:function(n){if(n===b){return true}for(var o in n){return false}return true},hasClass:function(p,o){var n;if(p.className==""){return false}n=new RegExp("(^|\\s+)"+o+"(\\s+|$)");return n.test(p.className)},addClass:function(o,n){if(!g.hasClass(o,n)){o.className=o.className==""?n:o.className.replace(/\s+$/,"")+" "+n}},removeClass:function(p,o){var n=new RegExp("(^|\\s+)"+o+"(\\s+|$)");p.className=p.className.replace(n,function(r,q,s){return q===" "&&s===" "?" ":""})},getStyle:function(o,n){if(o.currentStyle){return o.currentStyle[n]}else{if(window.getComputedStyle){return window.getComputedStyle(o,null)[n]}}},addEvent:function(s,n,t){var r,q,p,o;o=arguments[3];n=n.toLowerCase();if(e===b){e="Plupload_"+g.guid()}if(s.addEventListener){r=t;s.addEventListener(n,r,false)}else{if(s.attachEvent){r=function(){var u=window.event;if(!u.target){u.target=u.srcElement}u.preventDefault=h;u.stopPropagation=j;t(u)};s.attachEvent("on"+n,r)}}if(s[e]===b){s[e]=g.guid()}if(!d.hasOwnProperty(s[e])){d[s[e]]={}}q=d[s[e]];if(!q.hasOwnProperty(n)){q[n]=[]}q[n].push({func:r,orig:t,key:o})},removeEvent:function(s,n){var q,t,p;if(typeof(arguments[2])=="function"){t=arguments[2]}else{p=arguments[2]}n=n.toLowerCase();if(s[e]&&d[s[e]]&&d[s[e]][n]){q=d[s[e]][n]}else{return}for(var o=q.length-1;o>=0;o--){if(q[o].key===p||q[o].orig===t){if(s.removeEventListener){s.removeEventListener(n,q[o].func,false)}else{if(s.detachEvent){s.detachEvent("on"+n,q[o].func)}}q[o].orig=null;q[o].func=null;q.splice(o,1);if(t!==b){break}}}if(!q.length){delete d[s[e]][n]}if(g.isEmptyObj(d[s[e]])){delete d[s[e]];try{delete s[e]}catch(r){s[e]=b}}},removeAllEvents:function(o){var n=arguments[1];if(o[e]===b||!o[e]){return}g.each(d[o[e]],function(q,p){g.removeEvent(o,p,n)})}};g.Uploader=function(r){var o={},u,t=[],q,p=false;u=new g.QueueProgress();r=g.extend({chunk_size:0,multipart:true,multi_selection:true,file_data_name:"file",filters:[]},r);function s(){var w,x=0,v;if(this.state==g.STARTED){for(v=0;v<t.length;v++){if(!w&&t[v].status==g.QUEUED){w=t[v];w.status=g.UPLOADING;if(this.trigger("BeforeUpload",w)){this.trigger("UploadFile",w)}}else{x++}}if(x==t.length){this.stop();this.trigger("UploadComplete",t)}}}function n(){var w,v;u.reset();for(w=0;w<t.length;w++){v=t[w];if(v.size!==b){u.size+=v.size;u.loaded+=v.loaded}else{u.size=b}if(v.status==g.DONE){u.uploaded++}else{if(v.status==g.FAILED){u.failed++}else{u.queued++}}}if(u.size===b){u.percent=t.length>0?Math.ceil(u.uploaded/t.length*100):0}else{u.bytesPerSec=Math.ceil(u.loaded/((+new Date()-q||1)/1000));u.percent=u.size>0?Math.ceil(u.loaded/u.size*100):0}}g.extend(this,{state:g.STOPPED,runtime:"",features:{},files:t,settings:r,total:u,id:g.guid(),init:function(){var A=this,B,x,w,z=0,y;if(typeof(r.preinit)=="function"){r.preinit(A)}else{g.each(r.preinit,function(D,C){A.bind(C,D)})}r.page_url=r.page_url||document.location.pathname.replace(/\/[^\/]+$/g,"/");if(!/^(\w+:\/\/|\/)/.test(r.url)){r.url=r.page_url+r.url}r.chunk_size=g.parseSize(r.chunk_size);r.max_file_size=g.parseSize(r.max_file_size);A.bind("FilesAdded",function(C,F){var E,D,H=0,I,G=r.filters;if(G&&G.length){I=[];g.each(G,function(J){g.each(J.extensions.split(/,/),function(K){if(/^\s*\*\s*$/.test(K)){I.push("\\.*")}else{I.push("\\."+K.replace(new RegExp("["+("/^$.*+?|()[]{}\\".replace(/./g,"\\$&"))+"]","g"),"\\$&"))}})});I=new RegExp(I.join("|")+"$","i")}for(E=0;E<F.length;E++){D=F[E];D.loaded=0;D.percent=0;D.status=g.QUEUED;if(I&&!I.test(D.name)){C.trigger("Error",{code:g.FILE_EXTENSION_ERROR,message:g.translate("File extension error."),file:D});continue}if(D.size!==b&&D.size>r.max_file_size){C.trigger("Error",{code:g.FILE_SIZE_ERROR,message:g.translate("File size error."),file:D});continue}t.push(D);H++}if(H){c(function(){A.trigger("QueueChanged");A.refresh()},1)}else{return false}});if(r.unique_names){A.bind("UploadFile",function(C,D){var F=D.name.match(/\.([^.]+)$/),E="tmp";if(F){E=F[1]}D.target_name=D.id+"."+E})}A.bind("UploadProgress",function(C,D){D.percent=D.size>0?Math.ceil(D.loaded/D.size*100):100;n()});A.bind("StateChanged",function(C){if(C.state==g.STARTED){q=(+new Date())}else{if(C.state==g.STOPPED){for(B=C.files.length-1;B>=0;B--){if(C.files[B].status==g.UPLOADING){C.files[B].status=g.QUEUED;n()}}}}});A.bind("QueueChanged",n);A.bind("Error",function(C,D){if(D.file){D.file.status=g.FAILED;n();if(C.state==g.STARTED){c(function(){s.call(A)},1)}}});A.bind("FileUploaded",function(C,D){D.status=g.DONE;D.loaded=D.size;C.trigger("UploadProgress",D);c(function(){s.call(A)},1)});if(r.runtimes){x=[];y=r.runtimes.split(/\s?,\s?/);for(B=0;B<y.length;B++){if(k[y[B]]){x.push(k[y[B]])}}}else{x=k}function v(){var F=x[z++],E,C,D;if(F){E=F.getFeatures();C=A.settings.required_features;if(C){C=C.split(",");for(D=0;D<C.length;D++){if(!E[C[D]]){v();return}}}F.init(A,function(G){if(G&&G.success){A.features=E;A.runtime=F.name;A.trigger("Init",{runtime:F.name});A.trigger("PostInit");A.refresh()}else{v()}})}else{A.trigger("Error",{code:g.INIT_ERROR,message:g.translate("Init error.")})}}v();if(typeof(r.init)=="function"){r.init(A)}else{g.each(r.init,function(D,C){A.bind(C,D)})}},refresh:function(){this.trigger("Refresh")},start:function(){if(t.length&&this.state!=g.STARTED){this.state=g.STARTED;this.trigger("StateChanged");s.call(this)}},stop:function(){if(this.state!=g.STOPPED){this.state=g.STOPPED;this.trigger("CancelUpload");this.trigger("StateChanged")}},disableBrowse:function(){p=arguments[0]!==b?arguments[0]:true;this.trigger("DisableBrowse",p)},getFile:function(w){var v;for(v=t.length-1;v>=0;v--){if(t[v].id===w){return t[v]}}},removeFile:function(w){var v;for(v=t.length-1;v>=0;v--){if(t[v].id===w.id){return this.splice(v,1)[0]}}},splice:function(x,v){var w;w=t.splice(x===b?0:x,v===b?t.length:v);this.trigger("FilesRemoved",w);this.trigger("QueueChanged");return w},trigger:function(w){var y=o[w.toLowerCase()],x,v;if(y){v=Array.prototype.slice.call(arguments);v[0]=this;for(x=0;x<y.length;x++){if(y[x].func.apply(y[x].scope,v)===false){return false}}}return true},hasEventListener:function(v){return !!o[v.toLowerCase()]},bind:function(v,x,w){var y;v=v.toLowerCase();y=o[v]||[];y.push({func:x,scope:w||this});o[v]=y},unbind:function(v){v=v.toLowerCase();var y=o[v],w,x=arguments[1];if(y){if(x!==b){for(w=y.length-1;w>=0;w--){if(y[w].func===x){y.splice(w,1);break}}}else{y=[]}if(!y.length){delete o[v]}}},unbindAll:function(){var v=this;g.each(o,function(x,w){v.unbind(w)})},destroy:function(){this.stop();this.trigger("Destroy");this.unbindAll()}})};g.File=function(q,o,p){var n=this;n.id=q;n.name=o;n.size=p;n.loaded=0;n.percent=0;n.status=0};g.Runtime=function(){this.getFeatures=function(){};this.init=function(n,o){}};g.QueueProgress=function(){var n=this;n.size=0;n.loaded=0;n.uploaded=0;n.failed=0;n.queued=0;n.percent=0;n.bytesPerSec=0;n.reset=function(){n.size=n.loaded=n.uploaded=n.failed=n.queued=n.percent=n.bytesPerSec=0}};g.runtimes={};window.plupload=g})();
\ No newline at end of file
+/*1.5.7*/
+(function(){var f=0,k=[],m={},i={},a={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"},l=/[<>&\"\']/g,b,c=window.setTimeout,d={},e;function h(){this.returnValue=false}function j(){this.cancelBubble=true}(function(n){var o=n.split(/,/),p,r,q;for(p=0;p<o.length;p+=2){q=o[p+1].split(/ /);for(r=0;r<q.length;r++){i[q[r]]=o[p]}}})("application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mpga mpega mp2 mp3,audio/x-wav,wav,audio/mp4,m4a,image/bmp,bmp,image/gif,gif,image/jpeg,jpeg jpg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe");var g={VERSION:"1.5.7",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,IMAGE_FORMAT_ERROR:-700,IMAGE_MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,mimeTypes:i,ua:(function(){var r=navigator,q=r.userAgent,s=r.vendor,o,n,p;o=/WebKit/.test(q);p=o&&s.indexOf("Apple")!==-1;n=window.opera&&window.opera.buildNumber;return{windows:navigator.platform.indexOf("Win")!==-1,android:/Android/.test(q),ie:!o&&!n&&(/MSIE/gi).test(q)&&(/Explorer/gi).test(r.appName),webkit:o,gecko:!o&&/Gecko/.test(q),safari:p,opera:!!n}}()),typeOf:function(n){return({}).toString.call(n).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()},extend:function(n){g.each(arguments,function(o,p){if(p>0){g.each(o,function(r,q){n[q]=r})}});return n},cleanName:function(n){var o,p;p=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"];for(o=0;o<p.length;o+=2){n=n.replace(p[o],p[o+1])}n=n.replace(/\s+/g,"_");n=n.replace(/[^a-z0-9_\-\.]+/gi,"");return n},addRuntime:function(n,o){o.name=n;k[n]=o;k.push(o);return o},guid:function(){var n=new Date().getTime().toString(32),o;for(o=0;o<5;o++){n+=Math.floor(Math.random()*65535).toString(32)}return(g.guidPrefix||"p")+n+(f++).toString(32)},buildUrl:function(o,n){var p="";g.each(n,function(r,q){p+=(p?"&":"")+encodeURIComponent(q)+"="+encodeURIComponent(r)});if(p){o+=(o.indexOf("?")>0?"&":"?")+p}return o},each:function(q,r){var p,o,n;if(q){p=q.length;if(p===b){for(o in q){if(q.hasOwnProperty(o)){if(r(q[o],o)===false){return}}}}else{for(n=0;n<p;n++){if(r(q[n],n)===false){return}}}}},formatSize:function(n){if(n===b||/\D/.test(n)){return g.translate("N/A")}if(n>1073741824){return Math.round(n/1073741824,1)+" GB"}if(n>1048576){return Math.round(n/1048576,1)+" MB"}if(n>1024){return Math.round(n/1024,1)+" KB"}return n+" b"},getPos:function(o,s){var t=0,r=0,v,u=document,p,q;o=o;s=s||u.body;function n(B){var z,A,w=0,C=0;if(B){A=B.getBoundingClientRect();z=u.compatMode==="CSS1Compat"?u.documentElement:u.body;w=A.left+z.scrollLeft;C=A.top+z.scrollTop}return{x:w,y:C}}if(o&&o.getBoundingClientRect&&g.ua.ie&&(!u.documentMode||u.documentMode<8)){p=n(o);q=n(s);return{x:p.x-q.x,y:p.y-q.y}}v=o;while(v&&v!=s&&v.nodeType){t+=v.offsetLeft||0;r+=v.offsetTop||0;v=v.offsetParent}v=o.parentNode;while(v&&v!=s&&v.nodeType){t-=v.scrollLeft||0;r-=v.scrollTop||0;v=v.parentNode}return{x:t,y:r}},getSize:function(n){return{w:n.offsetWidth||n.clientWidth,h:n.offsetHeight||n.clientHeight}},parseSize:function(n){var o;if(typeof(n)=="string"){n=/^([0-9]+)([mgk]?)$/.exec(n.toLowerCase().replace(/[^0-9mkg]/g,""));o=n[2];n=+n[1];if(o=="g"){n*=1073741824}if(o=="m"){n*=1048576}if(o=="k"){n*=1024}}return n},xmlEncode:function(n){return n?(""+n).replace(l,function(o){return a[o]?"&"+a[o]+";":o}):n},toArray:function(p){var o,n=[];for(o=0;o<p.length;o++){n[o]=p[o]}return n},inArray:function(p,q){if(q){if(Array.prototype.indexOf){return Array.prototype.indexOf.call(q,p)}for(var n=0,o=q.length;n<o;n++){if(q[n]===p){return n}}}return -1},addI18n:function(n){return g.extend(m,n)},translate:function(n){return m[n]||n},isEmptyObj:function(n){if(n===b){return true}for(var o in n){return false}return true},hasClass:function(p,o){var n;if(p.className==""){return false}n=new RegExp("(^|\\s+)"+o+"(\\s+|$)");return n.test(p.className)},addClass:function(o,n){if(!g.hasClass(o,n)){o.className=o.className==""?n:o.className.replace(/\s+$/,"")+" "+n}},removeClass:function(p,o){var n=new RegExp("(^|\\s+)"+o+"(\\s+|$)");p.className=p.className.replace(n,function(r,q,s){return q===" "&&s===" "?" ":""})},getStyle:function(o,n){if(o.currentStyle){return o.currentStyle[n]}else{if(window.getComputedStyle){return window.getComputedStyle(o,null)[n]}}},addEvent:function(s,n,t){var r,q,p,o;o=arguments[3];n=n.toLowerCase();if(e===b){e="Plupload_"+g.guid()}if(s.addEventListener){r=t;s.addEventListener(n,r,false)}else{if(s.attachEvent){r=function(){var u=window.event;if(!u.target){u.target=u.srcElement}u.preventDefault=h;u.stopPropagation=j;t(u)};s.attachEvent("on"+n,r)}}if(s[e]===b){s[e]=g.guid()}if(!d.hasOwnProperty(s[e])){d[s[e]]={}}q=d[s[e]];if(!q.hasOwnProperty(n)){q[n]=[]}q[n].push({func:r,orig:t,key:o})},removeEvent:function(s,n){var q,t,p;if(typeof(arguments[2])=="function"){t=arguments[2]}else{p=arguments[2]}n=n.toLowerCase();if(s[e]&&d[s[e]]&&d[s[e]][n]){q=d[s[e]][n]}else{return}for(var o=q.length-1;o>=0;o--){if(q[o].key===p||q[o].orig===t){if(s.removeEventListener){s.removeEventListener(n,q[o].func,false)}else{if(s.detachEvent){s.detachEvent("on"+n,q[o].func)}}q[o].orig=null;q[o].func=null;q.splice(o,1);if(t!==b){break}}}if(!q.length){delete d[s[e]][n]}if(g.isEmptyObj(d[s[e]])){delete d[s[e]];try{delete s[e]}catch(r){s[e]=b}}},removeAllEvents:function(o){var n=arguments[1];if(o[e]===b||!o[e]){return}g.each(d[o[e]],function(q,p){g.removeEvent(o,p,n)})}};g.Uploader=function(r){var o={},u,t=[],q,p=false;u=new g.QueueProgress();r=g.extend({chunk_size:0,multipart:true,multi_selection:true,file_data_name:"file",filters:[]},r);function s(){var w,x=0,v;if(this.state==g.STARTED){for(v=0;v<t.length;v++){if(!w&&t[v].status==g.QUEUED){w=t[v];w.status=g.UPLOADING;if(this.trigger("BeforeUpload",w)){this.trigger("UploadFile",w)}}else{x++}}if(x==t.length){this.stop();this.trigger("UploadComplete",t)}}}function n(){var w,v;u.reset();for(w=0;w<t.length;w++){v=t[w];if(v.size!==b){u.size+=v.size;u.loaded+=v.loaded}else{u.size=b}if(v.status==g.DONE){u.uploaded++}else{if(v.status==g.FAILED){u.failed++}else{u.queued++}}}if(u.size===b){u.percent=t.length>0?Math.ceil(u.uploaded/t.length*100):0}else{u.bytesPerSec=Math.ceil(u.loaded/((+new Date()-q||1)/1000));u.percent=u.size>0?Math.ceil(u.loaded/u.size*100):0}}g.extend(this,{state:g.STOPPED,runtime:"",features:{},files:t,settings:r,total:u,id:g.guid(),init:function(){var A=this,B,x,w,z=0,y;if(typeof(r.preinit)=="function"){r.preinit(A)}else{g.each(r.preinit,function(D,C){A.bind(C,D)})}r.page_url=r.page_url||document.location.pathname.replace(/\/[^\/]+$/g,"/");if(!/^(\w+:\/\/|\/)/.test(r.url)){r.url=r.page_url+r.url}r.chunk_size=g.parseSize(r.chunk_size);r.max_file_size=g.parseSize(r.max_file_size);A.bind("FilesAdded",function(C,F){var E,D,H=0,I,G=r.filters;if(G&&G.length){I=[];g.each(G,function(J){g.each(J.extensions.split(/,/),function(K){if(/^\s*\*\s*$/.test(K)){I.push("\\.*")}else{I.push("\\."+K.replace(new RegExp("["+("/^$.*+?|()[]{}\\".replace(/./g,"\\$&"))+"]","g"),"\\$&"))}})});I=new RegExp(I.join("|")+"$","i")}for(E=0;E<F.length;E++){D=F[E];D.loaded=0;D.percent=0;D.status=g.QUEUED;if(I&&!I.test(D.name)){C.trigger("Error",{code:g.FILE_EXTENSION_ERROR,message:g.translate("File extension error."),file:D});continue}if(D.size!==b&&D.size>r.max_file_size){C.trigger("Error",{code:g.FILE_SIZE_ERROR,message:g.translate("File size error."),file:D});continue}t.push(D);H++}if(H){c(function(){A.trigger("QueueChanged");A.refresh()},1)}else{return false}});if(r.unique_names){A.bind("UploadFile",function(C,D){var F=D.name.match(/\.([^.]+)$/),E="tmp";if(F){E=F[1]}D.target_name=D.id+"."+E})}A.bind("UploadProgress",function(C,D){D.percent=D.size>0?Math.ceil(D.loaded/D.size*100):100;n()});A.bind("StateChanged",function(C){if(C.state==g.STARTED){q=(+new Date())}else{if(C.state==g.STOPPED){for(B=C.files.length-1;B>=0;B--){if(C.files[B].status==g.UPLOADING){C.files[B].status=g.QUEUED;n()}}}}});A.bind("QueueChanged",n);A.bind("Error",function(C,D){if(D.file){D.file.status=g.FAILED;n();if(C.state==g.STARTED){c(function(){s.call(A)},1)}}});A.bind("FileUploaded",function(C,D){D.status=g.DONE;D.loaded=D.size;C.trigger("UploadProgress",D);c(function(){s.call(A)},1)});if(r.runtimes){x=[];y=r.runtimes.split(/\s?,\s?/);for(B=0;B<y.length;B++){if(k[y[B]]){x.push(k[y[B]])}}}else{x=k}function v(){var F=x[z++],E,C,D;if(F){E=F.getFeatures();C=A.settings.required_features;if(C){C=C.split(",");for(D=0;D<C.length;D++){if(!E[C[D]]){v();return}}}F.init(A,function(G){if(G&&G.success){A.features=E;A.runtime=F.name;A.trigger("Init",{runtime:F.name});A.trigger("PostInit");A.refresh()}else{v()}})}else{A.trigger("Error",{code:g.INIT_ERROR,message:g.translate("Init error.")})}}v();if(typeof(r.init)=="function"){r.init(A)}else{g.each(r.init,function(D,C){A.bind(C,D)})}},refresh:function(){this.trigger("Refresh")},start:function(){if(t.length&&this.state!=g.STARTED){this.state=g.STARTED;this.trigger("StateChanged");s.call(this)}},stop:function(){if(this.state!=g.STOPPED){this.state=g.STOPPED;this.trigger("CancelUpload");this.trigger("StateChanged")}},disableBrowse:function(){p=arguments[0]!==b?arguments[0]:true;this.trigger("DisableBrowse",p)},getFile:function(w){var v;for(v=t.length-1;v>=0;v--){if(t[v].id===w){return t[v]}}},removeFile:function(w){var v;for(v=t.length-1;v>=0;v--){if(t[v].id===w.id){return this.splice(v,1)[0]}}},splice:function(x,v){var w;w=t.splice(x===b?0:x,v===b?t.length:v);this.trigger("FilesRemoved",w);this.trigger("QueueChanged");return w},trigger:function(w){var y=o[w.toLowerCase()],x,v;if(y){v=Array.prototype.slice.call(arguments);v[0]=this;for(x=0;x<y.length;x++){if(y[x].func.apply(y[x].scope,v)===false){return false}}}return true},hasEventListener:function(v){return !!o[v.toLowerCase()]},bind:function(v,x,w){var y;v=v.toLowerCase();y=o[v]||[];y.push({func:x,scope:w||this});o[v]=y},unbind:function(v){v=v.toLowerCase();var y=o[v],w,x=arguments[1];if(y){if(x!==b){for(w=y.length-1;w>=0;w--){if(y[w].func===x){y.splice(w,1);break}}}else{y=[]}if(!y.length){delete o[v]}}},unbindAll:function(){var v=this;g.each(o,function(x,w){v.unbind(w)})},destroy:function(){this.stop();this.trigger("Destroy");this.unbindAll()}})};g.File=function(q,o,p){var n=this;n.id=q;n.name=o;n.size=p;n.loaded=0;n.percent=0;n.status=0};g.Runtime=function(){this.getFeatures=function(){};this.init=function(n,o){}};g.QueueProgress=function(){var n=this;n.size=0;n.loaded=0;n.uploaded=0;n.failed=0;n.queued=0;n.percent=0;n.bytesPerSec=0;n.reset=function(){n.size=n.loaded=n.uploaded=n.failed=n.queued=n.percent=n.bytesPerSec=0}};g.runtimes={};window.plupload=g})();
\ No newline at end of file
index 0a300461699e2cecba4e7c7622d0245256f0227f..ccaa95a000fdfc4f63e911203a7e230d6c7c2cab 100644 (file)
@@ -1 +1 @@
-(function(g,b,d,e){var a={},h={};function c(o){var n,m=typeof o,j,l,k;if(o===e||o===null){return"null"}if(m==="string"){n="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(q,p){var i=n.indexOf(p);if(i+1){return"\\"+n.charAt(i+1)}q=p.charCodeAt().toString(16);return"\\u"+"0000".substring(q.length)+q})+'"'}if(m=="object"){j=o.length!==e;n="";if(j){for(l=0;l<o.length;l++){if(n){n+=","}n+=c(o[l])}n="["+n+"]"}else{for(k in o){if(o.hasOwnProperty(k)){if(n){n+=","}n+=c(k)+":"+c(o[k])}}n="{"+n+"}"}return n}return""+o}function f(r){var u=false,i=null,n=null,j,k,l,t,m,p=0;try{try{n=new ActiveXObject("AgControl.AgControl");if(n.IsVersionSupported(r)){u=true}n=null}catch(q){var o=navigator.plugins["Silverlight Plug-In"];if(o){j=o.description;if(j==="1.0.30226.2"){j="2.0.30226.2"}k=j.split(".");while(k.length>3){k.pop()}while(k.length<4){k.push(0)}l=r.split(".");while(l.length>4){l.pop()}do{t=parseInt(l[p],10);m=parseInt(k[p],10);p++}while(p<l.length&&t===m);if(t<=m&&!isNaN(t)){u=true}}}}catch(s){u=false}return u}d.silverlight={trigger:function(n,k){var m=a[n],l,j;if(m){j=d.toArray(arguments).slice(1);j[0]="Silverlight:"+k;setTimeout(function(){m.trigger.apply(m,j)},0)}}};d.runtimes.Silverlight=d.addRuntime("silverlight",{getFeatures:function(){return{jpgresize:true,pngresize:true,chunks:true,progress:true,multipart:true,multi_selection:true}},init:function(p,q){var o,m="",n=p.settings.filters,l,k=b.body;if(!f("2.0.31005.0")||(g.opera&&g.opera.buildNumber)){q({success:false});return}h[p.id]=false;a[p.id]=p;o=b.createElement("div");o.id=p.id+"_silverlight_container";d.extend(o.style,{position:"absolute",top:"0px",background:p.settings.shim_bgcolor||"transparent",zIndex:99999,width:"100px",height:"100px",overflow:"hidden",opacity:p.settings.shim_bgcolor||b.documentMode>8?"":0.01});o.className="plupload silverlight";if(p.settings.container){k=b.getElementById(p.settings.container);if(d.getStyle(k,"position")==="static"){k.style.position="relative"}}k.appendChild(o);for(l=0;l<n.length;l++){m+=(m!=""?"|":"")+n[l].title+" | *."+n[l].extensions.replace(/,/g,";*.")}o.innerHTML='<object id="'+p.id+'_silverlight" data="data:application/x-silverlight," type="application/x-silverlight-2" style="outline:none;" width="1024" height="1024"><param name="source" value="'+p.settings.silverlight_xap_url+'"/><param name="background" value="Transparent"/><param name="windowless" value="true"/><param name="enablehtmlaccess" value="true"/><param name="initParams" value="id='+p.id+",filter="+m+",multiselect="+p.settings.multi_selection+'"/></object>';function j(){return b.getElementById(p.id+"_silverlight").content.Upload}p.bind("Silverlight:Init",function(){var i,r={};if(h[p.id]){return}h[p.id]=true;p.bind("Silverlight:StartSelectFiles",function(s){i=[]});p.bind("Silverlight:SelectFile",function(s,v,t,u){var w;w=d.guid();r[w]=v;r[v]=w;i.push(new d.File(w,t,u))});p.bind("Silverlight:SelectSuccessful",function(){if(i.length){p.trigger("FilesAdded",i)}});p.bind("Silverlight:UploadChunkError",function(s,v,t,w,u){p.trigger("Error",{code:d.IO_ERROR,message:"IO Error.",details:u,file:s.getFile(r[v])})});p.bind("Silverlight:UploadFileProgress",function(s,w,t,v){var u=s.getFile(r[w]);if(u.status!=d.FAILED){u.size=v;u.loaded=t;s.trigger("UploadProgress",u)}});p.bind("Refresh",function(s){var t,u,v;t=b.getElementById(s.settings.browse_button);if(t){u=d.getPos(t,b.getElementById(s.settings.container));v=d.getSize(t);d.extend(b.getElementById(s.id+"_silverlight_container").style,{top:u.y+"px",left:u.x+"px",width:v.w+"px",height:v.h+"px"})}});p.bind("Silverlight:UploadChunkSuccessful",function(s,v,t,y,x){var w,u=s.getFile(r[v]);w={chunk:t,chunks:y,response:x};s.trigger("ChunkUploaded",u,w);if(u.status!=d.FAILED&&s.state!==d.STOPPED){j().UploadNextChunk()}if(t==y-1){u.status=d.DONE;s.trigger("FileUploaded",u,{response:x})}});p.bind("Silverlight:UploadSuccessful",function(s,v,t){var u=s.getFile(r[v]);u.status=d.DONE;s.trigger("FileUploaded",u,{response:t})});p.bind("FilesRemoved",function(s,u){var t;for(t=0;t<u.length;t++){j().RemoveFile(r[u[t].id])}});p.bind("UploadFile",function(s,u){var v=s.settings,t=v.resize||{};j().UploadFile(r[u.id],s.settings.url,c({name:u.target_name||u.name,mime:d.mimeTypes[u.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream",chunk_size:v.chunk_size,image_width:t.width,image_height:t.height,image_quality:t.quality,multipart:!!v.multipart,multipart_params:v.multipart_params||{},file_data_name:v.file_data_name,headers:v.headers}))});p.bind("CancelUpload",function(){j().CancelUpload()});p.bind("Silverlight:MouseEnter",function(s){var t,u;t=b.getElementById(p.settings.browse_button);u=s.settings.browse_button_hover;if(t&&u){d.addClass(t,u)}});p.bind("Silverlight:MouseLeave",function(s){var t,u;t=b.getElementById(p.settings.browse_button);u=s.settings.browse_button_hover;if(t&&u){d.removeClass(t,u)}});p.bind("Silverlight:MouseLeftButtonDown",function(s){var t,u;t=b.getElementById(p.settings.browse_button);u=s.settings.browse_button_active;if(t&&u){d.addClass(t,u);d.addEvent(b.body,"mouseup",function(){d.removeClass(t,u)})}});p.bind("Sliverlight:StartSelectFiles",function(s){var t,u;t=b.getElementById(p.settings.browse_button);u=s.settings.browse_button_active;if(t&&u){d.removeClass(t,u)}});p.bind("DisableBrowse",function(s,t){j().DisableBrowse(t)});p.bind("Destroy",function(s){var t;d.removeAllEvents(b.body,s.id);delete h[s.id];delete a[s.id];t=b.getElementById(s.id+"_silverlight_container");if(t){k.removeChild(t)}});q({success:true})})}})})(window,document,plupload);
\ No newline at end of file
+(function(g,b,d,e){var a={},h={};function c(o){var n,m=typeof o,j,l,k;if(o===e||o===null){return"null"}if(m==="string"){n="\bb\tt\nn\ff\rr\"\"''\\\\";return'"'+o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(q,p){var i=n.indexOf(p);if(i+1){return"\\"+n.charAt(i+1)}q=p.charCodeAt().toString(16);return"\\u"+"0000".substring(q.length)+q})+'"'}if(m=="object"){j=o.length!==e;n="";if(j){for(l=0;l<o.length;l++){if(n){n+=","}n+=c(o[l])}n="["+n+"]"}else{for(k in o){if(o.hasOwnProperty(k)){if(n){n+=","}n+=c(k)+":"+c(o[k])}}n="{"+n+"}"}return n}return""+o}function f(r){var u=false,i=null,n=null,j,k,l,t,m,p=0;try{try{n=new ActiveXObject("AgControl.AgControl");if(n.IsVersionSupported(r)){u=true}n=null}catch(q){var o=navigator.plugins["Silverlight Plug-In"];if(o){j=o.description;if(j==="1.0.30226.2"){j="2.0.30226.2"}k=j.split(".");while(k.length>3){k.pop()}while(k.length<4){k.push(0)}l=r.split(".");while(l.length>4){l.pop()}do{t=parseInt(l[p],10);m=parseInt(k[p],10);p++}while(p<l.length&&t===m);if(t<=m&&!isNaN(t)){u=true}}}}catch(s){u=false}return u}d.silverlight={trigger:function(n,k){var m=a[n],l,j;if(m){j=d.toArray(arguments).slice(1);j[0]="Silverlight:"+k;setTimeout(function(){m.trigger.apply(m,j)},0)}}};d.runtimes.Silverlight=d.addRuntime("silverlight",{getFeatures:function(){return{jpgresize:true,pngresize:true,chunks:true,progress:true,multipart:true,multi_selection:true}},init:function(p,q){var o,m="",n=p.settings.filters,l,k=b.body;if(!f("2.0.31005.0")||(g.opera&&g.opera.buildNumber)){q({success:false});return}h[p.id]=false;a[p.id]=p;o=b.createElement("div");o.id=p.id+"_silverlight_container";d.extend(o.style,{position:"absolute",top:"0px",background:p.settings.shim_bgcolor||"transparent",zIndex:99999,width:"100px",height:"100px",overflow:"hidden",opacity:p.settings.shim_bgcolor||b.documentMode>8?"":0.01});o.className="plupload silverlight";if(p.settings.container){k=b.getElementById(p.settings.container);if(d.getStyle(k,"position")==="static"){k.style.position="relative"}}k.appendChild(o);for(l=0;l<n.length;l++){m+=(m!=""?"|":"")+n[l].title+" | *."+n[l].extensions.replace(/,/g,";*.")}o.innerHTML='<object id="'+p.id+'_silverlight" data="data:application/x-silverlight," type="application/x-silverlight-2" style="outline:none;" width="1024" height="1024"><param name="source" value="'+p.settings.silverlight_xap_url+'"/><param name="background" value="Transparent"/><param name="windowless" value="true"/><param name="enablehtmlaccess" value="true"/><param name="initParams" value="id='+p.id+",filter="+m+",multiselect="+p.settings.multi_selection+'"/></object>';function j(){return b.getElementById(p.id+"_silverlight").content.Upload}p.bind("Silverlight:Init",function(){var i,r={};if(h[p.id]){return}h[p.id]=true;p.bind("Silverlight:StartSelectFiles",function(s){i=[]});p.bind("Silverlight:SelectFile",function(s,v,t,u){var w;w=d.guid();r[w]=v;r[v]=w;i.push(new d.File(w,t,u))});p.bind("Silverlight:SelectSuccessful",function(){if(i.length){p.trigger("FilesAdded",i)}});p.bind("Silverlight:UploadChunkError",function(s,v,t,w,u){p.trigger("Error",{code:d.IO_ERROR,message:"IO Error.",details:u,file:s.getFile(r[v])})});p.bind("Silverlight:UploadFileProgress",function(s,w,t,v){var u=s.getFile(r[w]);if(u.status!=d.FAILED){u.size=v;u.loaded=t;s.trigger("UploadProgress",u)}});p.bind("Refresh",function(s){var t,u,v;t=b.getElementById(s.settings.browse_button);if(t){u=d.getPos(t,b.getElementById(s.settings.container));v=d.getSize(t);d.extend(b.getElementById(s.id+"_silverlight_container").style,{top:u.y+"px",left:u.x+"px",width:v.w+"px",height:v.h+"px"})}});p.bind("Silverlight:UploadChunkSuccessful",function(s,v,t,y,x){var w,u=s.getFile(r[v]);w={chunk:t,chunks:y,response:x};s.trigger("ChunkUploaded",u,w);if(u.status!=d.FAILED&&s.state!==d.STOPPED){j().UploadNextChunk()}if(t==y-1){u.status=d.DONE;s.trigger("FileUploaded",u,{response:x})}});p.bind("Silverlight:UploadSuccessful",function(s,v,t){var u=s.getFile(r[v]);u.status=d.DONE;s.trigger("FileUploaded",u,{response:t})});p.bind("FilesRemoved",function(s,u){var t;for(t=0;t<u.length;t++){j().RemoveFile(r[u[t].id])}});p.bind("UploadFile",function(s,u){var v=s.settings,t=v.resize||{};j().UploadFile(r[u.id],s.settings.url,c({name:u.target_name||u.name,mime:d.mimeTypes[u.name.replace(/^.+\.([^.]+)/,"$1").toLowerCase()]||"application/octet-stream",chunk_size:v.chunk_size,image_width:t.width,image_height:t.height,image_quality:t.quality,multipart:!!v.multipart,multipart_params:v.multipart_params||{},file_data_name:v.file_data_name,headers:v.headers}))});p.bind("CancelUpload",function(){j().CancelUpload()});p.bind("Silverlight:MouseEnter",function(s){var t,u;t=b.getElementById(p.settings.browse_button);u=s.settings.browse_button_hover;if(t&&u){d.addClass(t,u)}});p.bind("Silverlight:MouseLeave",function(s){var t,u;t=b.getElementById(p.settings.browse_button);u=s.settings.browse_button_hover;if(t&&u){d.removeClass(t,u)}});p.bind("Silverlight:MouseLeftButtonDown",function(s){var t,u;t=b.getElementById(p.settings.browse_button);u=s.settings.browse_button_active;if(t&&u){d.addClass(t,u);d.addEvent(b.body,"mouseup",function(){d.removeClass(t,u)})}});p.bind("Sliverlight:StartSelectFiles",function(s){var t,u;t=b.getElementById(p.settings.browse_button);u=s.settings.browse_button_active;if(t&&u){d.removeClass(t,u)}});p.bind("DisableBrowse",function(s,t){j().DisableBrowse(t)});p.bind("Destroy",function(s){var t;d.removeAllEvents(b.body,s.id);delete h[s.id];delete a[s.id];t=b.getElementById(s.id+"_silverlight_container");if(t){t.parentNode.removeChild(t)}});q({success:true})})}})})(window,document,plupload);
\ No newline at end of file
index 1503a95e3a57005a6a17fddb599b3f6cd2c87be2..e1584d3b1a9960ed66af1d9b9980126bceb5cc70 100644 (file)
Binary files a/wp-includes/js/plupload/plupload.silverlight.xap and b/wp-includes/js/plupload/plupload.silverlight.xap differ
index cb4d2bee0737a8079010a0f04a82a002da4bc9bb..202c1cbacf709026ec9c0f585d57bfc6ba272b9f 100644 (file)
@@ -8,7 +8,7 @@
  * settings = {
  *   id : 'my_id',          the HTML ID of the textarea, required
  *   buttons: ''            Comma separated list of the names of the default buttons to show. Optional.
- *                          Current list of default button names: 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,spell,close';
+ *                          Current list of default button names: 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close';
  * }
  *
  * The settings can also be a string quicktags_id.
@@ -229,7 +229,7 @@ function edButton(id, display, tagStart, tagEnd, access, open) {
 
        qt._buttonsInit = function() {
                var t = this, canvas, name, settings, theButtons, html, inst, ed, id, i, use,
-                       defaults = ',strong,em,link,block,del,ins,img,ul,ol,li,code,more,spell,close,';
+                       defaults = ',strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,';
 
                for ( inst in t.instances ) {
                        if ( inst == 0 )
@@ -296,14 +296,14 @@ function edButton(id, display, tagStart, tagEnd, access, open) {
         *     QTags.addButton( 'my_id', 'my button', '<span>', '</span>' );
         *     QTags.addButton( 'my_id2', 'my button', '<br />' );
         *
-        * @param id string required Button HTML ID
-        * @param display string required Button's value="..."
-        * @param arg1 string || function required Either a starting tag to be inserted like "<span>" or a callback that is executed when the button is clicked.
-        * @param arg2 string optional Ending tag like "</span>"
-        * @param access_key string optional Access key for the button.
-        * @param title string optional Button's title="..."
-        * @param priority int optional Number representing the desired position of the button in the toolbar. 1 - 9 = first, 11 - 19 = second, 21 - 29 = third, etc.
-        * @param instance string optional Limit the button to a specifric instance of Quicktags, add to all instances if not present.
+        * @param string id Required. Button HTML ID
+        * @param string display Required. Button's value="..."
+        * @param string|function arg1 Required. Either a starting tag to be inserted like "<span>" or a callback that is executed when the button is clicked.
+        * @param string arg2 Optional. Ending tag like "</span>"
+        * @param string access_key Optional. Access key for the button.
+        * @param string title Optional. Button's title="..."
+        * @param int priority Optional. Number representing the desired position of the button in the toolbar. 1 - 9 = first, 11 - 19 = second, 21 - 29 = third, etc.
+        * @param string instance Optional. Limit the button to a specifric instance of Quicktags, add to all instances if not present.
         * @return mixed null or the button object that is needed for back-compat.
         */
        qt.addButton = function( id, display, arg1, arg2, access_key, title, priority, instance ) {
@@ -499,36 +499,8 @@ function edButton(id, display, tagStart, tagEnd, access, open) {
                }
        };
 
-       // the spell button
-       qt.SpellButton = function() {
-               qt.Button.call(this, 'spell', quicktagsL10n.lookup, '', quicktagsL10n.dictionaryLookup);
-       };
-       qt.SpellButton.prototype = new qt.Button();
-       qt.SpellButton.prototype.callback = function(element, canvas, ed) {
-               var word = '', sel, startPos, endPos;
-
-               if ( document.selection ) {
-                       canvas.focus();
-                       sel = document.selection.createRange();
-                       if ( sel.text.length > 0 ) {
-                               word = sel.text;
-                       }
-               } else if ( canvas.selectionStart || canvas.selectionStart == '0' ) {
-                       startPos = canvas.selectionStart;
-                       endPos = canvas.selectionEnd;
-                       if ( startPos != endPos ) {
-                               word = canvas.value.substring(startPos, endPos);
-                       }
-               }
-
-               if ( word === '' ) {
-                       word = prompt(quicktagsL10n.wordLookup, '');
-               }
-
-               if ( word !== null && /^\w[\w ]*$/.test(word)) {
-                       window.open('http://www.answers.com/' + encodeURIComponent(word));
-               }
-       };
+       // removed
+       qt.SpellButton = function() {};
 
        // the close tags button
        qt.CloseButton = function() {
@@ -643,7 +615,6 @@ function edButton(id, display, tagStart, tagEnd, access, open) {
        edButtons[100] = new qt.TagButton('li','li','\t<li>','</li>\n','l'),
        edButtons[110] = new qt.TagButton('code','code','<code>','</code>','c'),
        edButtons[120] = new qt.TagButton('more','more','<!--more-->','','t'),
-       edButtons[130] = new qt.SpellButton(),
        edButtons[140] = new qt.CloseButton()
 
 })();
index 64bf5323e6a1469b24e1fb388adaa60a34ce44a9..56b1dbc06fe8d08e8425bedae5d2c125b81a56be 100644 (file)
@@ -1 +1 @@
-var QTags,edButtons=[],edCanvas,edAddTag=function(){},edCheckOpenTags=function(){},edCloseAllTags=function(){},edInsertImage=function(){},edInsertLink=function(){},edInsertTag=function(){},edLink=function(){},edQuickLink=function(){},edRemoveTag=function(){},edShowButton=function(){},edShowLinks=function(){},edSpell=function(){},edToolbar=function(){};function quicktags(a){return new QTags(a)}function edInsertContent(b,a){return QTags.insertContent(a)}function edButton(f,e,c,b,a,d){return QTags.addButton(f,e,c,b,a,"",-1)}(function(){var b=function(g){var f,e,d;if(typeof jQuery!="undefined"){jQuery(document).ready(g)}else{f=b;f.funcs=[];f.ready=function(){if(!f.isReady){f.isReady=true;for(e=0;e<f.funcs.length;e++){f.funcs[e]()}}};if(f.isReady){g()}else{f.funcs.push(g)}if(!f.eventAttached){if(document.addEventListener){d=function(){document.removeEventListener("DOMContentLoaded",d,false);f.ready()};document.addEventListener("DOMContentLoaded",d,false);window.addEventListener("load",f.ready,false)}else{if(document.attachEvent){d=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",d);f.ready()}};document.attachEvent("onreadystatechange",d);window.attachEvent("onload",f.ready);(function(){try{document.documentElement.doScroll("left")}catch(h){setTimeout(arguments.callee,50);return}f.ready()})()}}f.eventAttached=true}}},a=(function(){var d=new Date(),e;e=function(f){var g=f.toString();if(g.length<2){g="0"+g}return g};return d.getUTCFullYear()+"-"+e(d.getUTCMonth()+1)+"-"+e(d.getUTCDate())+"T"+e(d.getUTCHours())+":"+e(d.getUTCMinutes())+":"+e(d.getUTCSeconds())+"+00:00"})(),c;c=QTags=function(j){if(typeof(j)=="string"){j={id:j}}else{if(typeof(j)!="object"){return false}}var i=this,k=j.id,h=document.getElementById(k),g="qt_"+k,d,f,e;if(!k||!h){return false}i.name=g;i.id=k;i.canvas=h;i.settings=j;if(k=="content"&&typeof(adminpage)=="string"&&(adminpage=="post-new-php"||adminpage=="post-php")){edCanvas=h;e="ed_toolbar"}else{e=g+"_toolbar"}d=document.createElement("div");d.id=e;d.className="quicktags-toolbar";h.parentNode.insertBefore(d,h);i.toolbar=d;f=function(n){n=n||window.event;var m=n.target||n.srcElement,o=m.clientWidth||m.offsetWidth,l;if(!o){return}if(/ ed_button /.test(" "+m.className+" ")){i.canvas=h=document.getElementById(k);l=m.id.replace(g+"_","");if(i.theButtons[l]){i.theButtons[l].callback.call(i.theButtons[l],m,h,i)}}};if(d.addEventListener){d.addEventListener("click",f,false)}else{if(d.attachEvent){d.attachEvent("onclick",f)}}i.getButton=function(l){return i.theButtons[l]};i.getButtonElement=function(l){return document.getElementById(g+"_"+l)};c.instances[k]=i;if(!c.instances[0]){c.instances[0]=c.instances[k];b(function(){c._buttonsInit()})}};c.instances={};c.getInstance=function(d){return c.instances[d]};c._buttonsInit=function(){var p=this,g,e,h,o,m,l,n,f,k,d,j=",strong,em,link,block,del,ins,img,ul,ol,li,code,more,spell,close,";for(l in p.instances){if(l==0){continue}n=p.instances[l];g=n.canvas;e=n.name;h=n.settings;m="";o={};d="";if(h.buttons){d=","+h.buttons+","}for(k in edButtons){if(!edButtons[k]){continue}f=edButtons[k].id;if(d&&j.indexOf(","+f+",")!=-1&&d.indexOf(","+f+",")==-1){continue}if(!edButtons[k].instance||edButtons[k].instance==l){o[f]=edButtons[k];if(edButtons[k].html){m+=edButtons[k].html(e+"_")}}}if(d&&d.indexOf(",fullscreen,")!=-1){o.fullscreen=new c.FullscreenButton();m+=o.fullscreen.html(e+"_")}if("rtl"==document.getElementsByTagName("html")[0].dir){o.textdirection=new c.TextDirectionButton();m+=o.textdirection.html(e+"_")}n.toolbar.innerHTML=m;n.theButtons=o}p.buttonsInitDone=true};c.addButton=function(e,i,h,g,d,j,k,l){var f;if(!e||!i){return}k=k||0;g=g||"";if(typeof(h)==="function"){f=new c.Button(e,i,d,j,l);f.callback=h}else{if(typeof(h)==="string"){f=new c.TagButton(e,i,h,g,d,j,l)}else{return}}if(k==-1){return f}if(k>0){while(typeof(edButtons[k])!="undefined"){k++}edButtons[k]=f}else{edButtons[edButtons.length]=f}if(this.buttonsInitDone){this._buttonsInit()}};c.insertContent=function(g){var h,f,e,i,j,d=document.getElementById(wpActiveEditor);if(!d){return false}if(document.selection){d.focus();h=document.selection.createRange();h.text=g;d.focus()}else{if(d.selectionStart||d.selectionStart=="0"){j=d.value;f=d.selectionStart;e=d.selectionEnd;i=d.scrollTop;d.value=j.substring(0,f)+g+j.substring(e,j.length);d.focus();d.selectionStart=f+g.length;d.selectionEnd=f+g.length;d.scrollTop=i}else{d.value+=g;d.focus()}}return true};c.Button=function(i,g,e,h,d){var f=this;f.id=i;f.display=g;f.access=e;f.title=h||"";f.instance=d||""};c.Button.prototype.html=function(e){var d=this.access?' accesskey="'+this.access+'"':"";return'<input type="button" id="'+e+this.id+'"'+d+' class="ed_button" title="'+this.title+'" value="'+this.display+'" />'};c.Button.prototype.callback=function(){};c.TagButton=function(k,i,g,f,e,j,d){var h=this;c.Button.call(h,k,i,e,j,d);h.tagStart=g;h.tagEnd=f};c.TagButton.prototype=new c.Button();c.TagButton.prototype.openTag=function(g,d){var f=this;if(!d.openTags){d.openTags=[]}if(f.tagEnd){d.openTags.push(f.id);g.value="/"+g.value}};c.TagButton.prototype.closeTag=function(h,d){var g=this,f=g.isOpen(d);if(f!==false){d.openTags.splice(f,1)}h.value=g.display};c.TagButton.prototype.isOpen=function(d){var g=this,f=0,e=false;if(d.openTags){while(e===false&&f<d.openTags.length){e=d.openTags[f]==g.id?f:false;f++}}else{e=false}return e};c.TagButton.prototype.callback=function(o,h,p){var u=this,q,e,m,g,s=h.value,j,d,n,f,k=s?u.tagEnd:"";if(document.selection){h.focus();f=document.selection.createRange();if(f.text.length>0){if(!u.tagEnd){f.text=f.text+u.tagStart}else{f.text=u.tagStart+f.text+k}}else{if(!u.tagEnd){f.text=u.tagStart}else{if(u.isOpen(p)===false){f.text=u.tagStart;u.openTag(o,p)}else{f.text=k;u.closeTag(o,p)}}}h.focus()}else{if(h.selectionStart||h.selectionStart=="0"){q=h.selectionStart;e=h.selectionEnd;m=e;g=h.scrollTop;j=s.substring(0,q);d=s.substring(e,s.length);n=s.substring(q,e);if(q!=e){if(!u.tagEnd){h.value=j+n+u.tagStart+d;m+=u.tagStart.length}else{h.value=j+u.tagStart+n+k+d;m+=u.tagStart.length+k.length}}else{if(!u.tagEnd){h.value=j+u.tagStart+d;m=q+u.tagStart.length}else{if(u.isOpen(p)===false){h.value=j+u.tagStart+d;u.openTag(o,p);m=q+u.tagStart.length}else{h.value=j+k+d;m=q+k.length;u.closeTag(o,p)}}}h.focus();h.selectionStart=m;h.selectionEnd=m;h.scrollTop=g}else{if(!k){h.value+=u.tagStart}else{if(u.isOpen(p)!==false){h.value+=u.tagStart;u.openTag(o,p)}else{h.value+=k;u.closeTag(o,p)}}h.focus()}}};c.SpellButton=function(){c.Button.call(this,"spell",quicktagsL10n.lookup,"",quicktagsL10n.dictionaryLookup)};c.SpellButton.prototype=new c.Button();c.SpellButton.prototype.callback=function(h,g,d){var j="",i,f,e;if(document.selection){g.focus();i=document.selection.createRange();if(i.text.length>0){j=i.text}}else{if(g.selectionStart||g.selectionStart=="0"){f=g.selectionStart;e=g.selectionEnd;if(f!=e){j=g.value.substring(f,e)}}}if(j===""){j=prompt(quicktagsL10n.wordLookup,"")}if(j!==null&&/^\w[\w ]*$/.test(j)){window.open("http://www.answers.com/"+encodeURIComponent(j))}};c.CloseButton=function(){c.Button.call(this,"close",quicktagsL10n.closeTags,"",quicktagsL10n.closeAllOpenTags)};c.CloseButton.prototype=new c.Button();c._close=function(i,j,d){var g,f,h=d.openTags;if(h){while(h.length>0){g=d.getButton(h[h.length-1]);f=document.getElementById(d.name+"_"+g.id);if(i){g.callback.call(g,f,j,d)}else{g.closeTag(f,d)}}}};c.CloseButton.prototype.callback=c._close;c.closeAllTags=function(e){var d=this.getInstance(e);c._close("",d.canvas,d)};c.LinkButton=function(){c.TagButton.call(this,"link","link","","</a>","a")};c.LinkButton.prototype=new c.TagButton();c.LinkButton.prototype.callback=function(i,j,g,f){var d,h=this;if(typeof(wpLink)!="undefined"){wpLink.open();return}if(!f){f="http://"}if(h.isOpen(g)===false){d=prompt(quicktagsL10n.enterURL,f);if(d){h.tagStart='<a href="'+d+'">';c.TagButton.prototype.callback.call(h,i,j,g)}}else{c.TagButton.prototype.callback.call(h,i,j,g)}};c.ImgButton=function(){c.TagButton.call(this,"img","img","","","m")};c.ImgButton.prototype=new c.TagButton();c.ImgButton.prototype.callback=function(h,j,f,d){if(!d){d="http://"}var i=prompt(quicktagsL10n.enterImageURL,d),g;if(i){g=prompt(quicktagsL10n.enterImageDescription,"");this.tagStart='<img src="'+i+'" alt="'+g+'" />';c.TagButton.prototype.callback.call(this,h,j,f)}};c.FullscreenButton=function(){c.Button.call(this,"fullscreen",quicktagsL10n.fullscreen,"f",quicktagsL10n.toggleFullscreen)};c.FullscreenButton.prototype=new c.Button();c.FullscreenButton.prototype.callback=function(d,f){if(!f.id||typeof(fullscreen)=="undefined"){return}fullscreen.on()};c.TextDirectionButton=function(){c.Button.call(this,"textdirection",quicktagsL10n.textdirection,"",quicktagsL10n.toggleTextdirection)};c.TextDirectionButton.prototype=new c.Button();c.TextDirectionButton.prototype.callback=function(f,h){var d=("rtl"==document.getElementsByTagName("html")[0].dir),g=h.style.direction;if(!g){g=(d)?"rtl":"ltr"}h.style.direction=("rtl"==g)?"ltr":"rtl";h.focus()};edButtons[10]=new c.TagButton("strong","b","<strong>","</strong>","b");edButtons[20]=new c.TagButton("em","i","<em>","</em>","i"),edButtons[30]=new c.LinkButton(),edButtons[40]=new c.TagButton("block","b-quote","\n\n<blockquote>","</blockquote>\n\n","q"),edButtons[50]=new c.TagButton("del","del",'<del datetime="'+a+'">',"</del>","d"),edButtons[60]=new c.TagButton("ins","ins",'<ins datetime="'+a+'">',"</ins>","s"),edButtons[70]=new c.ImgButton(),edButtons[80]=new c.TagButton("ul","ul","<ul>\n","</ul>\n\n","u"),edButtons[90]=new c.TagButton("ol","ol","<ol>\n","</ol>\n\n","o"),edButtons[100]=new c.TagButton("li","li","\t<li>","</li>\n","l"),edButtons[110]=new c.TagButton("code","code","<code>","</code>","c"),edButtons[120]=new c.TagButton("more","more","<!--more-->","","t"),edButtons[130]=new c.SpellButton(),edButtons[140]=new c.CloseButton()})();
\ No newline at end of file
+var QTags,edButtons=[],edCanvas,edAddTag=function(){},edCheckOpenTags=function(){},edCloseAllTags=function(){},edInsertImage=function(){},edInsertLink=function(){},edInsertTag=function(){},edLink=function(){},edQuickLink=function(){},edRemoveTag=function(){},edShowButton=function(){},edShowLinks=function(){},edSpell=function(){},edToolbar=function(){};function quicktags(a){return new QTags(a)}function edInsertContent(b,a){return QTags.insertContent(a)}function edButton(f,e,c,b,a,d){return QTags.addButton(f,e,c,b,a,"",-1)}(function(){var b=function(g){var f,e,d;if(typeof jQuery!="undefined"){jQuery(document).ready(g)}else{f=b;f.funcs=[];f.ready=function(){if(!f.isReady){f.isReady=true;for(e=0;e<f.funcs.length;e++){f.funcs[e]()}}};if(f.isReady){g()}else{f.funcs.push(g)}if(!f.eventAttached){if(document.addEventListener){d=function(){document.removeEventListener("DOMContentLoaded",d,false);f.ready()};document.addEventListener("DOMContentLoaded",d,false);window.addEventListener("load",f.ready,false)}else{if(document.attachEvent){d=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",d);f.ready()}};document.attachEvent("onreadystatechange",d);window.attachEvent("onload",f.ready);(function(){try{document.documentElement.doScroll("left")}catch(h){setTimeout(arguments.callee,50);return}f.ready()})()}}f.eventAttached=true}}},a=(function(){var d=new Date(),e;e=function(f){var g=f.toString();if(g.length<2){g="0"+g}return g};return d.getUTCFullYear()+"-"+e(d.getUTCMonth()+1)+"-"+e(d.getUTCDate())+"T"+e(d.getUTCHours())+":"+e(d.getUTCMinutes())+":"+e(d.getUTCSeconds())+"+00:00"})(),c;c=QTags=function(j){if(typeof(j)=="string"){j={id:j}}else{if(typeof(j)!="object"){return false}}var i=this,k=j.id,h=document.getElementById(k),g="qt_"+k,d,f,e;if(!k||!h){return false}i.name=g;i.id=k;i.canvas=h;i.settings=j;if(k=="content"&&typeof(adminpage)=="string"&&(adminpage=="post-new-php"||adminpage=="post-php")){edCanvas=h;e="ed_toolbar"}else{e=g+"_toolbar"}d=document.createElement("div");d.id=e;d.className="quicktags-toolbar";h.parentNode.insertBefore(d,h);i.toolbar=d;f=function(n){n=n||window.event;var m=n.target||n.srcElement,o=m.clientWidth||m.offsetWidth,l;if(!o){return}if(/ ed_button /.test(" "+m.className+" ")){i.canvas=h=document.getElementById(k);l=m.id.replace(g+"_","");if(i.theButtons[l]){i.theButtons[l].callback.call(i.theButtons[l],m,h,i)}}};if(d.addEventListener){d.addEventListener("click",f,false)}else{if(d.attachEvent){d.attachEvent("onclick",f)}}i.getButton=function(l){return i.theButtons[l]};i.getButtonElement=function(l){return document.getElementById(g+"_"+l)};c.instances[k]=i;if(!c.instances[0]){c.instances[0]=c.instances[k];b(function(){c._buttonsInit()})}};c.instances={};c.getInstance=function(d){return c.instances[d]};c._buttonsInit=function(){var p=this,g,e,h,o,m,l,n,f,k,d,j=",strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,";for(l in p.instances){if(l==0){continue}n=p.instances[l];g=n.canvas;e=n.name;h=n.settings;m="";o={};d="";if(h.buttons){d=","+h.buttons+","}for(k in edButtons){if(!edButtons[k]){continue}f=edButtons[k].id;if(d&&j.indexOf(","+f+",")!=-1&&d.indexOf(","+f+",")==-1){continue}if(!edButtons[k].instance||edButtons[k].instance==l){o[f]=edButtons[k];if(edButtons[k].html){m+=edButtons[k].html(e+"_")}}}if(d&&d.indexOf(",fullscreen,")!=-1){o.fullscreen=new c.FullscreenButton();m+=o.fullscreen.html(e+"_")}if("rtl"==document.getElementsByTagName("html")[0].dir){o.textdirection=new c.TextDirectionButton();m+=o.textdirection.html(e+"_")}n.toolbar.innerHTML=m;n.theButtons=o}p.buttonsInitDone=true};c.addButton=function(e,i,h,g,d,j,k,l){var f;if(!e||!i){return}k=k||0;g=g||"";if(typeof(h)==="function"){f=new c.Button(e,i,d,j,l);f.callback=h}else{if(typeof(h)==="string"){f=new c.TagButton(e,i,h,g,d,j,l)}else{return}}if(k==-1){return f}if(k>0){while(typeof(edButtons[k])!="undefined"){k++}edButtons[k]=f}else{edButtons[edButtons.length]=f}if(this.buttonsInitDone){this._buttonsInit()}};c.insertContent=function(g){var h,f,e,i,j,d=document.getElementById(wpActiveEditor);if(!d){return false}if(document.selection){d.focus();h=document.selection.createRange();h.text=g;d.focus()}else{if(d.selectionStart||d.selectionStart=="0"){j=d.value;f=d.selectionStart;e=d.selectionEnd;i=d.scrollTop;d.value=j.substring(0,f)+g+j.substring(e,j.length);d.focus();d.selectionStart=f+g.length;d.selectionEnd=f+g.length;d.scrollTop=i}else{d.value+=g;d.focus()}}return true};c.Button=function(i,g,e,h,d){var f=this;f.id=i;f.display=g;f.access=e;f.title=h||"";f.instance=d||""};c.Button.prototype.html=function(e){var d=this.access?' accesskey="'+this.access+'"':"";return'<input type="button" id="'+e+this.id+'"'+d+' class="ed_button" title="'+this.title+'" value="'+this.display+'" />'};c.Button.prototype.callback=function(){};c.TagButton=function(k,i,g,f,e,j,d){var h=this;c.Button.call(h,k,i,e,j,d);h.tagStart=g;h.tagEnd=f};c.TagButton.prototype=new c.Button();c.TagButton.prototype.openTag=function(g,d){var f=this;if(!d.openTags){d.openTags=[]}if(f.tagEnd){d.openTags.push(f.id);g.value="/"+g.value}};c.TagButton.prototype.closeTag=function(h,d){var g=this,f=g.isOpen(d);if(f!==false){d.openTags.splice(f,1)}h.value=g.display};c.TagButton.prototype.isOpen=function(d){var g=this,f=0,e=false;if(d.openTags){while(e===false&&f<d.openTags.length){e=d.openTags[f]==g.id?f:false;f++}}else{e=false}return e};c.TagButton.prototype.callback=function(o,h,p){var u=this,q,e,m,g,s=h.value,j,d,n,f,k=s?u.tagEnd:"";if(document.selection){h.focus();f=document.selection.createRange();if(f.text.length>0){if(!u.tagEnd){f.text=f.text+u.tagStart}else{f.text=u.tagStart+f.text+k}}else{if(!u.tagEnd){f.text=u.tagStart}else{if(u.isOpen(p)===false){f.text=u.tagStart;u.openTag(o,p)}else{f.text=k;u.closeTag(o,p)}}}h.focus()}else{if(h.selectionStart||h.selectionStart=="0"){q=h.selectionStart;e=h.selectionEnd;m=e;g=h.scrollTop;j=s.substring(0,q);d=s.substring(e,s.length);n=s.substring(q,e);if(q!=e){if(!u.tagEnd){h.value=j+n+u.tagStart+d;m+=u.tagStart.length}else{h.value=j+u.tagStart+n+k+d;m+=u.tagStart.length+k.length}}else{if(!u.tagEnd){h.value=j+u.tagStart+d;m=q+u.tagStart.length}else{if(u.isOpen(p)===false){h.value=j+u.tagStart+d;u.openTag(o,p);m=q+u.tagStart.length}else{h.value=j+k+d;m=q+k.length;u.closeTag(o,p)}}}h.focus();h.selectionStart=m;h.selectionEnd=m;h.scrollTop=g}else{if(!k){h.value+=u.tagStart}else{if(u.isOpen(p)!==false){h.value+=u.tagStart;u.openTag(o,p)}else{h.value+=k;u.closeTag(o,p)}}h.focus()}}};c.SpellButton=function(){};c.CloseButton=function(){c.Button.call(this,"close",quicktagsL10n.closeTags,"",quicktagsL10n.closeAllOpenTags)};c.CloseButton.prototype=new c.Button();c._close=function(i,j,d){var g,f,h=d.openTags;if(h){while(h.length>0){g=d.getButton(h[h.length-1]);f=document.getElementById(d.name+"_"+g.id);if(i){g.callback.call(g,f,j,d)}else{g.closeTag(f,d)}}}};c.CloseButton.prototype.callback=c._close;c.closeAllTags=function(e){var d=this.getInstance(e);c._close("",d.canvas,d)};c.LinkButton=function(){c.TagButton.call(this,"link","link","","</a>","a")};c.LinkButton.prototype=new c.TagButton();c.LinkButton.prototype.callback=function(i,j,g,f){var d,h=this;if(typeof(wpLink)!="undefined"){wpLink.open();return}if(!f){f="http://"}if(h.isOpen(g)===false){d=prompt(quicktagsL10n.enterURL,f);if(d){h.tagStart='<a href="'+d+'">';c.TagButton.prototype.callback.call(h,i,j,g)}}else{c.TagButton.prototype.callback.call(h,i,j,g)}};c.ImgButton=function(){c.TagButton.call(this,"img","img","","","m")};c.ImgButton.prototype=new c.TagButton();c.ImgButton.prototype.callback=function(h,j,f,d){if(!d){d="http://"}var i=prompt(quicktagsL10n.enterImageURL,d),g;if(i){g=prompt(quicktagsL10n.enterImageDescription,"");this.tagStart='<img src="'+i+'" alt="'+g+'" />';c.TagButton.prototype.callback.call(this,h,j,f)}};c.FullscreenButton=function(){c.Button.call(this,"fullscreen",quicktagsL10n.fullscreen,"f",quicktagsL10n.toggleFullscreen)};c.FullscreenButton.prototype=new c.Button();c.FullscreenButton.prototype.callback=function(d,f){if(!f.id||typeof(fullscreen)=="undefined"){return}fullscreen.on()};c.TextDirectionButton=function(){c.Button.call(this,"textdirection",quicktagsL10n.textdirection,"",quicktagsL10n.toggleTextdirection)};c.TextDirectionButton.prototype=new c.Button();c.TextDirectionButton.prototype.callback=function(f,h){var d=("rtl"==document.getElementsByTagName("html")[0].dir),g=h.style.direction;if(!g){g=(d)?"rtl":"ltr"}h.style.direction=("rtl"==g)?"ltr":"rtl";h.focus()};edButtons[10]=new c.TagButton("strong","b","<strong>","</strong>","b");edButtons[20]=new c.TagButton("em","i","<em>","</em>","i"),edButtons[30]=new c.LinkButton(),edButtons[40]=new c.TagButton("block","b-quote","\n\n<blockquote>","</blockquote>\n\n","q"),edButtons[50]=new c.TagButton("del","del",'<del datetime="'+a+'">',"</del>","d"),edButtons[60]=new c.TagButton("ins","ins",'<ins datetime="'+a+'">',"</ins>","s"),edButtons[70]=new c.ImgButton(),edButtons[80]=new c.TagButton("ul","ul","<ul>\n","</ul>\n\n","u"),edButtons[90]=new c.TagButton("ol","ol","<ol>\n","</ol>\n\n","o"),edButtons[100]=new c.TagButton("li","li","\t<li>","</li>\n","l"),edButtons[110]=new c.TagButton("code","code","<code>","</code>","c"),edButtons[120]=new c.TagButton("more","more","<!--more-->","","t"),edButtons[140]=new c.CloseButton()})();
\ No newline at end of file
index 1090a0e019009956fedad060b2e87f65af710da8..7d94bbab5d3d0770bf0f3a7d7d6f438f82465df1 100644 (file)
Binary files a/wp-includes/js/swfupload/swfupload.swf and b/wp-includes/js/swfupload/swfupload.swf differ
index 995c60fee2691eb52133333a9a4e920f7cd23102..e874446b80dcce06f8f2b3a29cb9d101978ced5a 100644 (file)
@@ -20,7 +20,7 @@ jQuery(document).ready(function(){
 
 //add thickbox to href & area elements that have a class of .thickbox
 function tb_init(domChunk){
-       jQuery(domChunk).live('click', tb_click);
+       jQuery('body').on('click', domChunk, tb_click);
 }
 
 function tb_click(){
@@ -230,10 +230,8 @@ function tb_show(caption, url, imageGroup) {//function called when the user clic
                                        jQuery("#TB_window").css({'visibility':'visible'});
                                }else if(url.indexOf('TB_iframe') != -1){
                                        tb_position();
-                                       if(jQuery.browser.safari){//safari needs help because it will not fire iframe onload
-                                               jQuery("#TB_load").remove();
-                                               jQuery("#TB_window").css({'visibility':'visible'});
-                                       }
+                                       jQuery("#TB_load").remove();
+                                       jQuery("#TB_window").css({'visibility':'visible'});
                                }else{
                                        jQuery("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()),function(){//to do a post change this load method
                                                tb_position();
index 2ca33ac0ed28ba340db084097c1f0bba173f64c5..517ef48604aed9b3f8bf32c826c014c6e63160b3 100644 (file)
                        }
 
                        // Add HTML5 video element
-                       if (typeItem.name === 'Video' && data.video.sources[0]) {
+                       if (typeItem.name === 'Video' && data.video.sources && data.video.sources[0]) {
                                // Create new object element
                                video = new Node('video', 1).attr(tinymce.extend({
                                        id : node.attr('id'),
                        }
 
                        // Add HTML5 audio element
-                       if (typeItem.name === 'Audio' && data.video.sources[0]) {
+                       if (typeItem.name === 'Audio' && data.video.sources && data.video.sources[0]) {
                                // Create new object element
                                audio = new Node('audio', 1).attr(tinymce.extend({
                                        id : node.attr('id'),
                                                type: typeItem.mimes[0]
                                        });
                                } else {
-                                       object.attr({
-                                               classid: "clsid:" + typeItem.clsids[0],
-                                               codebase: typeItem.codebase
-                                       });
+                                       if ( typeItem.clsids )
+                                               object.attr('clsid', typeItem.clsids[0]);
+                                       object.attr('codebase', typeItem.codebase);
 
                                        embed = new Node('embed', 1);
                                        embed.shortEnded = true;
index e71099a0e10b04b88d189fc2fe119e865931913b..3a87f1e0edfa0013cb883427ae9427454d9a3450 100644 (file)
@@ -1 +1 @@
-(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.WordPress",{init:function(f,c){var j=this,e=f.getParam("wordpress_adv_toolbar","toolbar2"),i=0,d,b,h,g;d='<img src="'+c+'/img/trans.gif" class="mceWPmore mceItemNoResize" title="'+f.getLang("wordpress.wp_more_alt")+'" />';b='<img src="'+c+'/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+f.getLang("wordpress.wp_page_alt")+'" />';if(getUserSetting("hidetb","0")=="1"){f.settings.wordpress_adv_hidden=0}f.onPostRender.add(function(){var k=f.controlManager.get(e);if(f.getParam("wordpress_adv_hidden",1)&&k){a.hide(k.id);j._resizeIframe(f,e,28)}});f.addCommand("WP_More",function(){f.execCommand("mceInsertContent",0,d)});f.addCommand("WP_Page",function(){f.execCommand("mceInsertContent",0,b)});f.addCommand("WP_Help",function(){f.windowManager.open({url:tinymce.baseURL+"/wp-mce-help.php",width:450,height:420,inline:1})});f.addCommand("WP_Adv",function(){var k=f.controlManager,l=k.get(e).id;if("undefined"==l){return}if(a.isHidden(l)){k.setActive("wp_adv",1);a.show(l);j._resizeIframe(f,e,-28);f.settings.wordpress_adv_hidden=0;setUserSetting("hidetb","1")}else{k.setActive("wp_adv",0);a.hide(l);j._resizeIframe(f,e,28);f.settings.wordpress_adv_hidden=1;setUserSetting("hidetb","0")}});f.addCommand("WP_Medialib",function(){if(typeof wp!=="undefined"&&wp.media&&wp.media.editor){wp.media.editor.open(f.id)}});f.addButton("wp_more",{title:"wordpress.wp_more_desc",cmd:"WP_More"});f.addButton("wp_page",{title:"wordpress.wp_page_desc",image:c+"/img/page.gif",cmd:"WP_Page"});f.addButton("wp_help",{title:"wordpress.wp_help_desc",cmd:"WP_Help"});f.addButton("wp_adv",{title:"wordpress.wp_adv_desc",cmd:"WP_Adv"});f.addButton("add_media",{title:"wordpress.add_media",image:c+"/img/image.gif",cmd:"WP_Medialib"});f.onBeforeExecCommand.add(function(r,q,u,p,l){var x=tinymce.DOM,m,k,t,w,v,s;if("mceFullScreen"==q){if("mce_fullscreen"!=r.id&&x.select("a.thickbox").length){r.settings.theme_advanced_buttons1+=",|,add_media"}}if("JustifyLeft"==q||"JustifyRight"==q||"JustifyCenter"==q){m=r.selection.getNode();if(m.nodeName=="IMG"){s=q.substr(7).toLowerCase();v="align"+s;k=r.dom.getParent(m,"dl.wp-caption");t=r.dom.getParent(m,"div.mceTemp");if(k&&t){w=r.dom.hasClass(k,v)?"alignnone":v;k.className=k.className.replace(/align[^ '"]+\s?/g,"");r.dom.addClass(k,w);if(w=="aligncenter"){r.dom.addClass(t,"mceIEcenter")}else{r.dom.removeClass(t,"mceIEcenter")}l.terminate=true;r.execCommand("mceRepaint")}else{if(r.dom.hasClass(m,v)){r.dom.addClass(m,"alignnone")}else{r.dom.removeClass(m,"alignnone")}}}}});f.onInit.add(function(m){var l=m.getParam("body_class",""),k=m.getBody();if(l){l=l.split(" ")}else{l=[]}if(m.getParam("directionality","")=="rtl"){l.push("rtl")}if(tinymce.isIE9){l.push("ie9")}else{if(tinymce.isIE8){l.push("ie8")}else{if(tinymce.isIE7){l.push("ie7")}}}if(m.id!="wp_mce_fullscreen"&&m.id!="mce_fullscreen"){l.push("wp-editor")}else{if(m.id=="mce_fullscreen"){l.push("mce-fullscreen")}}tinymce.each(l,function(n){if(n){m.dom.addClass(k,n)}});m.onNodeChange.add(function(o,n,q){var p;if(q.nodeName=="IMG"){p=o.dom.getParent(q,"dl.wp-caption")}else{if(q.nodeName=="DIV"&&o.dom.hasClass(q,"mceTemp")){p=q.firstChild;if(!o.dom.hasClass(p,"wp-caption")){p=false}}}if(p){if(o.dom.hasClass(p,"alignleft")){n.setActive("justifyleft",1)}else{if(o.dom.hasClass(p,"alignright")){n.setActive("justifyright",1)}else{if(o.dom.hasClass(p,"aligncenter")){n.setActive("justifycenter",1)}}}}});m.onBeforeSetContent.add(function(n,p){if(p.content){p.content=p.content.replace(/<p>\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)( [^>]*)?>/gi,"<$1$2>");p.content=p.content.replace(/<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)>\s*<\/p>/gi,"</$1>")}})});if("undefined"!=typeof(jQuery)){f.onKeyUp.add(function(m,n){var l=n.keyCode||n.charCode;if(l==i){return}if(13==l||8==i||46==i){jQuery(document).triggerHandler("wpcountwords",[m.getContent({format:"raw"})])}i=l})}f.onSaveContent.addToTop(function(k,l){l.content=l.content.replace(/<p>(<br ?\/?>|\u00a0|\uFEFF)?<\/p>/g,"<p>&nbsp;</p>")});f.onSaveContent.add(function(k,l){if(k.getParam("wpautop",true)&&typeof(switchEditors)=="object"){if(k.isHidden()){l.content=l.element.value}else{l.content=switchEditors.pre_wpautop(l.content)}}});j._handleMoreBreak(f,c);g="alt+shift";f.addShortcut(g+"+c","justifycenter_desc","JustifyCenter");f.addShortcut(g+"+r","justifyright_desc","JustifyRight");f.addShortcut(g+"+l","justifyleft_desc","JustifyLeft");f.addShortcut(g+"+j","justifyfull_desc","JustifyFull");f.addShortcut(g+"+q","blockquote_desc","mceBlockQuote");f.addShortcut(g+"+u","bullist_desc","InsertUnorderedList");f.addShortcut(g+"+o","numlist_desc","InsertOrderedList");f.addShortcut(g+"+n","spellchecker.desc","mceSpellCheck");f.addShortcut(g+"+a","link_desc","WP_Link");f.addShortcut(g+"+s","unlink_desc","unlink");f.addShortcut(g+"+m","image_desc","WP_Medialib");f.addShortcut(g+"+z","wordpress.wp_adv_desc","WP_Adv");f.addShortcut(g+"+t","wordpress.wp_more_desc","WP_More");f.addShortcut(g+"+d","striketrough_desc","Strikethrough");f.addShortcut(g+"+h","help_desc","WP_Help");f.addShortcut(g+"+p","wordpress.wp_page_desc","WP_Page");f.addShortcut("ctrl+s","save_desc",function(){if("function"==typeof autosave){autosave()}});if(/\bwpfullscreen\b/.test(f.settings.plugins)){f.addShortcut(g+"+w","wordpress.wp_fullscreen_desc","wpFullScreen")}else{if(/\bfullscreen\b/.test(f.settings.plugins)){f.addShortcut(g+"+g","fullscreen.desc","mceFullScreen")}}f.onInit.add(function(k){tinymce.dom.Event.add(k.getWin(),"scroll",function(l){k.plugins.wordpress._hideButtons()});tinymce.dom.Event.add(k.getBody(),"dragstart",function(l){k.plugins.wordpress._hideButtons()})});f.onBeforeExecCommand.add(function(k,m,l,n){k.plugins.wordpress._hideButtons()});f.onSaveContent.add(function(k,l){k.plugins.wordpress._hideButtons()});f.onMouseDown.add(function(k,l){if(l.target.nodeName!="IMG"){k.plugins.wordpress._hideButtons()}});f.onKeyDown.add(function(k,l){if(l.which==tinymce.VK.DELETE||l.which==tinymce.VK.BACKSPACE){k.plugins.wordpress._hideButtons()}});h=function(k){var l;if(k.target.id=="mceModalBlocker"||k.target.className=="ui-widget-overlay"){for(l in f.windowManager.windows){f.windowManager.close(null,l)}}};tinymce.dom.Event.remove(document.body,"click",h);tinymce.dom.Event.add(document.body,"click",h)},getInfo:function(){return{longname:"WordPress Plugin",author:"WordPress",authorurl:"http://wordpress.org",infourl:"http://wordpress.org",version:"3.0"}},_setEmbed:function(b){return b.replace(/\[embed\]([\s\S]+?)\[\/embed\][\s\u00a0]*/g,function(d,c){return'<img width="300" height="200" src="'+tinymce.baseURL+'/plugins/wordpress/img/trans.gif" class="wp-oembed mceItemNoResize" alt="'+c+'" title="'+c+'" />'})},_getEmbed:function(b){return b.replace(/<img[^>]+>/g,function(c){if(c.indexOf('class="wp-oembed')!=-1){var d=c.match(/alt="([^\"]+)"/);if(d[1]){c="[embed]"+d[1]+"[/embed]"}}return c})},_showButtons:function(f,d){var g=tinyMCE.activeEditor,i,h,b,j=tinymce.DOM,e,c;b=g.dom.getViewPort(g.getWin());i=j.getPos(g.getContentAreaContainer());h=g.dom.getPos(f);e=Math.max(h.x-b.x,0)+i.x;c=Math.max(h.y-b.y,0)+i.y;j.setStyles(d,{top:c+5+"px",left:e+5+"px",display:"block"})},_hideButtons:function(){var b=tinymce.DOM;b.hide(b.select("#wp_editbtns, #wp_gallerybtns"))},_resizeIframe:function(c,e,b){var d=c.getContentAreaContainer().firstChild;a.setStyle(d,"height",d.clientHeight+b);c.theme.deltaHeight+=b},_handleMoreBreak:function(c,d){var e,b;e='<img src="'+d+'/img/trans.gif" alt="$1" class="mceWPmore mceItemNoResize" title="'+c.getLang("wordpress.wp_more_alt")+'" />';b='<img src="'+d+'/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+c.getLang("wordpress.wp_page_alt")+'" />';c.onPostRender.add(function(){if(c.theme.onResolveName){c.theme.onResolveName.add(function(f,g){if(g.node.nodeName=="IMG"){if(c.dom.hasClass(g.node,"mceWPmore")){g.name="wpmore"}if(c.dom.hasClass(g.node,"mceWPnextpage")){g.name="wppage"}}})}});c.onBeforeSetContent.add(function(f,g){if(g.content){g.content=g.content.replace(/<!--more(.*?)-->/g,e);g.content=g.content.replace(/<!--nextpage-->/g,b)}});c.onPostProcess.add(function(f,g){if(g.get){g.content=g.content.replace(/<img[^>]+>/g,function(i){if(i.indexOf('class="mceWPmore')!==-1){var h,j=(h=i.match(/alt="(.*?)"/))?h[1]:"";i="<!--more"+j+"-->"}if(i.indexOf('class="mceWPnextpage')!==-1){i="<!--nextpage-->"}return i})}});c.onNodeChange.add(function(g,f,h){f.setActive("wp_page",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPnextpage"));f.setActive("wp_more",h.nodeName==="IMG"&&g.dom.hasClass(h,"mceWPmore"))})}});tinymce.PluginManager.add("wordpress",tinymce.plugins.WordPress)})();
\ No newline at end of file
+(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.WordPress",{init:function(g,d){var k=this,f=g.getParam("wordpress_adv_toolbar","toolbar2"),j=0,e,b,i,h,c;e='<img src="'+d+'/img/trans.gif" class="mce-wp-more mceItemNoResize" title="'+g.getLang("wordpress.wp_more_alt")+'" />';b='<img src="'+d+'/img/trans.gif" class="mce-wp-nextpage mceItemNoResize" title="'+g.getLang("wordpress.wp_page_alt")+'" />';if(getUserSetting("hidetb","0")=="1"){g.settings.wordpress_adv_hidden=0}g.onPostRender.add(function(){var l=g.controlManager.get(f);if(g.getParam("wordpress_adv_hidden",1)&&l){a.hide(l.id);k._resizeIframe(g,f,28)}});g.addCommand("WP_More",function(){g.execCommand("mceInsertContent",0,e)});g.addCommand("WP_Page",function(){g.execCommand("mceInsertContent",0,b)});g.addCommand("WP_Help",function(){g.windowManager.open({url:tinymce.baseURL+"/wp-mce-help.php",width:450,height:420,inline:1})});g.addCommand("WP_Adv",function(){var l=g.controlManager,m=l.get(f).id;if("undefined"==m){return}if(a.isHidden(m)){l.setActive("wp_adv",1);a.show(m);k._resizeIframe(g,f,-28);g.settings.wordpress_adv_hidden=0;setUserSetting("hidetb","1")}else{l.setActive("wp_adv",0);a.hide(m);k._resizeIframe(g,f,28);g.settings.wordpress_adv_hidden=1;setUserSetting("hidetb","0")}});g.addCommand("WP_Medialib",function(){if(typeof wp!=="undefined"&&wp.media&&wp.media.editor){wp.media.editor.open(g.id)}});g.addButton("wp_more",{title:"wordpress.wp_more_desc",cmd:"WP_More"});g.addButton("wp_page",{title:"wordpress.wp_page_desc",image:d+"/img/page.gif",cmd:"WP_Page"});g.addButton("wp_help",{title:"wordpress.wp_help_desc",cmd:"WP_Help"});g.addButton("wp_adv",{title:"wordpress.wp_adv_desc",cmd:"WP_Adv"});g.addButton("add_media",{title:"wordpress.add_media",image:d+"/img/image.gif",cmd:"WP_Medialib"});g.onBeforeExecCommand.add(function(s,r,v,q,m){var y=tinymce.DOM,p,l,u,x,w,t;if("mceFullScreen"==r){if("mce_fullscreen"!=s.id&&y.select("a.thickbox").length){s.settings.theme_advanced_buttons1+=",|,add_media"}}if("JustifyLeft"==r||"JustifyRight"==r||"JustifyCenter"==r){p=s.selection.getNode();if(p.nodeName=="IMG"){t=r.substr(7).toLowerCase();w="align"+t;l=s.dom.getParent(p,"dl.wp-caption");u=s.dom.getParent(p,"div.mceTemp");if(l&&u){x=s.dom.hasClass(l,w)?"alignnone":w;l.className=l.className.replace(/align[^ '"]+\s?/g,"");s.dom.addClass(l,x);if(x=="aligncenter"){s.dom.addClass(u,"mceIEcenter")}else{s.dom.removeClass(u,"mceIEcenter")}m.terminate=true;s.execCommand("mceRepaint")}else{if(s.dom.hasClass(p,w)){s.dom.addClass(p,"alignnone")}else{s.dom.removeClass(p,"alignnone")}}}}if(tinymce.isWebKit&&("InsertUnorderedList"==r||"InsertOrderedList"==r)){if(!c){c=s.dom.create("style",{type:"text/css"},"#tinymce,#tinymce span,#tinymce li,#tinymce li>span,#tinymce p,#tinymce p>span{font:medium sans-serif;color:#000;line-height:normal;}")}s.getDoc().head.appendChild(c)}});g.onExecCommand.add(function(l,n,m,o){if(tinymce.isWebKit&&c&&("InsertUnorderedList"==n||"InsertOrderedList"==n)){l.dom.remove(c)}});g.onInit.add(function(n){var m=n.getParam("body_class",""),l=n.getBody();if(m){m=m.split(" ")}else{m=[]}if(n.getParam("directionality","")=="rtl"){m.push("rtl")}if(tinymce.isIE9){m.push("ie9")}else{if(tinymce.isIE8){m.push("ie8")}else{if(tinymce.isIE7){m.push("ie7")}}}if(n.id!="wp_mce_fullscreen"&&n.id!="mce_fullscreen"){m.push("wp-editor")}else{if(n.id=="mce_fullscreen"){m.push("mce-fullscreen")}}tinymce.each(m,function(o){if(o){n.dom.addClass(l,o)}});n.onNodeChange.add(function(p,o,r){var q;if(r.nodeName=="IMG"){q=p.dom.getParent(r,"dl.wp-caption")}else{if(r.nodeName=="DIV"&&p.dom.hasClass(r,"mceTemp")){q=r.firstChild;if(!p.dom.hasClass(q,"wp-caption")){q=false}}}if(q){if(p.dom.hasClass(q,"alignleft")){o.setActive("justifyleft",1)}else{if(p.dom.hasClass(q,"alignright")){o.setActive("justifyright",1)}else{if(p.dom.hasClass(q,"aligncenter")){o.setActive("justifycenter",1)}}}}});n.onBeforeSetContent.add(function(p,q){if(q.content){q.content=q.content.replace(/<p>\s*<(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)( [^>]*)?>/gi,"<$1$2>");q.content=q.content.replace(/<\/(p|div|ul|ol|dl|table|blockquote|h[1-6]|fieldset|pre|address)>\s*<\/p>/gi,"</$1>")}})});if("undefined"!=typeof(jQuery)){g.onKeyUp.add(function(m,n){var l=n.keyCode||n.charCode;if(l==j){return}if(13==l||8==j||46==j){jQuery(document).triggerHandler("wpcountwords",[m.getContent({format:"raw"})])}j=l})}g.onSaveContent.addToTop(function(l,m){m.content=m.content.replace(/<p>(<br ?\/?>|\u00a0|\uFEFF)?<\/p>/g,"<p>&nbsp;</p>")});g.onSaveContent.add(function(l,m){if(l.isHidden()){m.content=m.element.value}else{if(l.getParam("wpautop",true)&&typeof(switchEditors)=="object"){m.content=switchEditors.pre_wpautop(m.content)}}});k._handleMoreBreak(g,d);h="alt+shift";g.addShortcut(h+"+c","justifycenter_desc","JustifyCenter");g.addShortcut(h+"+r","justifyright_desc","JustifyRight");g.addShortcut(h+"+l","justifyleft_desc","JustifyLeft");g.addShortcut(h+"+j","justifyfull_desc","JustifyFull");g.addShortcut(h+"+q","blockquote_desc","mceBlockQuote");g.addShortcut(h+"+u","bullist_desc","InsertUnorderedList");g.addShortcut(h+"+o","numlist_desc","InsertOrderedList");g.addShortcut(h+"+n","spellchecker.desc","mceSpellCheck");g.addShortcut(h+"+a","link_desc","WP_Link");g.addShortcut(h+"+s","unlink_desc","unlink");g.addShortcut(h+"+m","image_desc","WP_Medialib");g.addShortcut(h+"+z","wordpress.wp_adv_desc","WP_Adv");g.addShortcut(h+"+t","wordpress.wp_more_desc","WP_More");g.addShortcut(h+"+d","striketrough_desc","Strikethrough");g.addShortcut(h+"+h","help_desc","WP_Help");g.addShortcut(h+"+p","wordpress.wp_page_desc","WP_Page");g.addShortcut("ctrl+s","save_desc",function(){if("function"==typeof autosave){autosave()}});if(/\bwpfullscreen\b/.test(g.settings.plugins)){g.addShortcut(h+"+w","wordpress.wp_fullscreen_desc","wpFullScreen")}else{if(/\bfullscreen\b/.test(g.settings.plugins)){g.addShortcut(h+"+g","fullscreen.desc","mceFullScreen")}}g.onInit.add(function(l){tinymce.dom.Event.add(l.getWin(),"scroll",function(m){l.plugins.wordpress._hideButtons()});tinymce.dom.Event.add(l.getBody(),"dragstart",function(m){l.plugins.wordpress._hideButtons()})});g.onBeforeExecCommand.add(function(l,n,m,o){l.plugins.wordpress._hideButtons()});g.onSaveContent.add(function(l,m){l.plugins.wordpress._hideButtons()});g.onMouseDown.add(function(l,m){if(m.target.nodeName!="IMG"){l.plugins.wordpress._hideButtons()}});g.onKeyDown.add(function(l,m){if(m.which==tinymce.VK.DELETE||m.which==tinymce.VK.BACKSPACE){l.plugins.wordpress._hideButtons()}});i=function(l){var m;if(l.target.id=="mceModalBlocker"||l.target.className=="ui-widget-overlay"){for(m in g.windowManager.windows){g.windowManager.close(null,m)}}};tinymce.dom.Event.remove(document.body,"click",i);tinymce.dom.Event.add(document.body,"click",i)},getInfo:function(){return{longname:"WordPress Plugin",author:"WordPress",authorurl:"http://wordpress.org",infourl:"http://wordpress.org",version:"3.0"}},_setEmbed:function(b){return b.replace(/\[embed\]([\s\S]+?)\[\/embed\][\s\u00a0]*/g,function(d,c){return'<img width="300" height="200" src="'+tinymce.baseURL+'/plugins/wordpress/img/trans.gif" class="wp-oembed mceItemNoResize" alt="'+c+'" title="'+c+'" />'})},_getEmbed:function(b){return b.replace(/<img[^>]+>/g,function(c){if(c.indexOf('class="wp-oembed')!=-1){var d=c.match(/alt="([^\"]+)"/);if(d[1]){c="[embed]"+d[1]+"[/embed]"}}return c})},_showButtons:function(f,d){var g=tinyMCE.activeEditor,i,h,b,j=tinymce.DOM,e,c;b=g.dom.getViewPort(g.getWin());i=j.getPos(g.getContentAreaContainer());h=g.dom.getPos(f);e=Math.max(h.x-b.x,0)+i.x;c=Math.max(h.y-b.y,0)+i.y;j.setStyles(d,{top:c+5+"px",left:e+5+"px",display:"block"})},_hideButtons:function(){var b=tinymce.DOM;b.hide(b.select("#wp_editbtns, #wp_gallerybtns"))},_resizeIframe:function(c,e,b){var d=c.getContentAreaContainer().firstChild;a.setStyle(d,"height",d.clientHeight+b);c.theme.deltaHeight+=b},_handleMoreBreak:function(c,d){var e,b;e='<img src="'+d+'/img/trans.gif" alt="$1" class="mce-wp-more mceItemNoResize" title="'+c.getLang("wordpress.wp_more_alt")+'" />';b='<img src="'+d+'/img/trans.gif" class="mce-wp-nextpage mceItemNoResize" title="'+c.getLang("wordpress.wp_page_alt")+'" />';c.onPostRender.add(function(){if(c.theme.onResolveName){c.theme.onResolveName.add(function(f,g){if(g.node.nodeName=="IMG"){if(c.dom.hasClass(g.node,"mce-wp-more")){g.name="wpmore"}if(c.dom.hasClass(g.node,"mce-wp-nextpage")){g.name="wppage"}}})}});c.onBeforeSetContent.add(function(f,g){if(g.content){g.content=g.content.replace(/<!--more(.*?)-->/g,e);g.content=g.content.replace(/<!--nextpage-->/g,b)}});c.onPostProcess.add(function(f,g){if(g.get){g.content=g.content.replace(/<img[^>]+>/g,function(i){if(i.indexOf('class="mce-wp-more')!==-1){var h,j=(h=i.match(/alt="(.*?)"/))?h[1]:"";i="<!--more"+j+"-->"}if(i.indexOf('class="mce-wp-nextpage')!==-1){i="<!--nextpage-->"}return i})}});c.onNodeChange.add(function(g,f,h){f.setActive("wp_page",h.nodeName==="IMG"&&g.dom.hasClass(h,"mce-wp-nextpage"));f.setActive("wp_more",h.nodeName==="IMG"&&g.dom.hasClass(h,"mce-wp-more"))})}});tinymce.PluginManager.add("wordpress",tinymce.plugins.WordPress)})();
\ No newline at end of file
index 9fecbc4c3f58eaa47ef713b12f095cd3a0d72d5f..653eb7c8b2e08bbfb0b236ae8f33be52224acee4 100644 (file)
@@ -7,9 +7,9 @@
 
        tinymce.create('tinymce.plugins.WordPress', {
                init : function(ed, url) {
-                       var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML, closeOnClick, mod_key;
-                       moreHTML = '<img src="' + url + '/img/trans.gif" class="mceWPmore mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
-                       nextpageHTML = '<img src="' + url + '/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+ed.getLang('wordpress.wp_page_alt')+'" />';
+                       var t = this, tbId = ed.getParam('wordpress_adv_toolbar', 'toolbar2'), last = 0, moreHTML, nextpageHTML, closeOnClick, mod_key, style;
+                       moreHTML = '<img src="' + url + '/img/trans.gif" class="mce-wp-more mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
+                       nextpageHTML = '<img src="' + url + '/img/trans.gif" class="mce-wp-nextpage mceItemNoResize" title="'+ed.getLang('wordpress.wp_page_alt')+'" />';
 
                        if ( getUserSetting('hidetb', '0') == '1' )
                                ed.settings.wordpress_adv_hidden = 0;
                                                }
                                        }
                                }
+
+                               if ( tinymce.isWebKit && ( 'InsertUnorderedList' == cmd || 'InsertOrderedList' == cmd ) ) {
+                                       if ( !style )
+                                               style = ed.dom.create('style', {'type': 'text/css'}, '#tinymce,#tinymce span,#tinymce li,#tinymce li>span,#tinymce p,#tinymce p>span{font:medium sans-serif;color:#000;line-height:normal;}');
+
+                                       ed.getDoc().head.appendChild( style );
+                               }
+                       });
+
+                       ed.onExecCommand.add( function( ed, cmd, ui, val ) {
+                               if ( tinymce.isWebKit && style && ( 'InsertUnorderedList' == cmd || 'InsertOrderedList' == cmd ) )
+                                       ed.dom.remove( style );
                        });
 
                        ed.onInit.add(function(ed) {
                        });
 
                        ed.onSaveContent.add(function(ed, o) {
-                               if ( ed.getParam('wpautop', true) && typeof(switchEditors) == 'object' ) {
-                                       if ( ed.isHidden() )
-                                               o.content = o.element.value;
-                                       else
-                                               o.content = switchEditors.pre_wpautop(o.content);
-                               }
+                               // If editor is hidden, we just want the textarea's value to be saved
+                               if ( ed.isHidden() )
+                                       o.content = o.element.value;
+                               else if ( ed.getParam('wpautop', true) && typeof(switchEditors) == 'object' )
+                                       o.content = switchEditors.pre_wpautop(o.content);
                        });
 
                        /* disable for now
                _handleMoreBreak : function(ed, url) {
                        var moreHTML, nextpageHTML;
 
-                       moreHTML = '<img src="' + url + '/img/trans.gif" alt="$1" class="mceWPmore mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
-                       nextpageHTML = '<img src="' + url + '/img/trans.gif" class="mceWPnextpage mceItemNoResize" title="'+ed.getLang('wordpress.wp_page_alt')+'" />';
+                       moreHTML = '<img src="' + url + '/img/trans.gif" alt="$1" class="mce-wp-more mceItemNoResize" title="'+ed.getLang('wordpress.wp_more_alt')+'" />';
+                       nextpageHTML = '<img src="' + url + '/img/trans.gif" class="mce-wp-nextpage mceItemNoResize" title="'+ed.getLang('wordpress.wp_page_alt')+'" />';
 
                        // Display morebreak instead if img in element path
                        ed.onPostRender.add(function() {
                                if (ed.theme.onResolveName) {
                                        ed.theme.onResolveName.add(function(th, o) {
                                                if (o.node.nodeName == 'IMG') {
-                                                       if ( ed.dom.hasClass(o.node, 'mceWPmore') )
+                                                       if ( ed.dom.hasClass(o.node, 'mce-wp-more') )
                                                                o.name = 'wpmore';
-                                                       if ( ed.dom.hasClass(o.node, 'mceWPnextpage') )
+                                                       if ( ed.dom.hasClass(o.node, 'mce-wp-nextpage') )
                                                                o.name = 'wppage';
                                                }
 
                        ed.onPostProcess.add(function(ed, o) {
                                if (o.get)
                                        o.content = o.content.replace(/<img[^>]+>/g, function(im) {
-                                               if (im.indexOf('class="mceWPmore') !== -1) {
+                                               if (im.indexOf('class="mce-wp-more') !== -1) {
                                                        var m, moretext = (m = im.match(/alt="(.*?)"/)) ? m[1] : '';
                                                        im = '<!--more'+moretext+'-->';
                                                }
-                                               if (im.indexOf('class="mceWPnextpage') !== -1)
+                                               if (im.indexOf('class="mce-wp-nextpage') !== -1)
                                                        im = '<!--nextpage-->';
 
                                                return im;
 
                        // Set active buttons if user selected pagebreak or more break
                        ed.onNodeChange.add(function(ed, cm, n) {
-                               cm.setActive('wp_page', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mceWPnextpage'));
-                               cm.setActive('wp_more', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mceWPmore'));
+                               cm.setActive('wp_page', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mce-wp-nextpage'));
+                               cm.setActive('wp_more', n.nodeName === 'IMG' && ed.dom.hasClass(n, 'mce-wp-more'));
                        });
                }
        });
index 4be9c3faf40c1d50fd91bd409f059560a7515c04..b301413b2d32d41c39acc8073b72839f40a84b88 100644 (file)
@@ -2,7 +2,7 @@
  * editor_plugin_src.js
  *
  * Copyright 2009, Moxiecode Systems AB
- * Released under LGPL License.
+ * Released under LGPL
  *
  * License: http://tinymce.moxiecode.com/license
  * Contributing: http://tinymce.moxiecode.com/contributing
index b45a1fd2e595defe6f7341991b7c63f66a0e5a82..e8c7d1d0ab8e43106f80ebadacac50aa6584cdd3 100644 (file)
@@ -6,7 +6,7 @@
  * ------------------------------------------------------------------
  *
  * Copyright 2009, Moxiecode Systems AB
- * Released under LGPL License.
+ * Released under LGPL
  *
  * License: http://tinymce.moxiecode.com/license
  * Contributing: http://tinymce.moxiecode.com/contributing
@@ -155,7 +155,7 @@ var tinyMCEPopup = {
 
        /**
         * Stores the current editor selection for later restoration. This can be useful since some browsers
-        * looses it's selection if a control element is selected/focused inside the dialogs.
+        * loses its selection if a control element is selected/focused inside the dialogs.
         *
         * @method storeSelection
         */
@@ -165,7 +165,7 @@ var tinyMCEPopup = {
 
        /**
         * Restores any stored selection. This can be useful since some browsers
-        * looses it's selection if a control element is selected/focused inside the dialogs.
+        * loses its selection if a control element is selected/focused inside the dialogs.
         *
         * @method restoreSelection
         */
@@ -246,7 +246,7 @@ var tinyMCEPopup = {
        },
 
        /**
-        * Creates a alert dialog. Please don't use the blocking behavior of this
+        * Creates an alert dialog. Please don't use the blocking behavior of this
         * native version use the callback method instead then it can be extended.
         *
         * @method alert
index c1a30759b5567b59a565f60c51039704339b5d13..4618fcfe6729e4583a15e602578b12c337ad8ff9 100644 (file)
@@ -1,7 +1,7 @@
 /**
  * WP Fullscreen TinyMCE plugin
  *
- * Contains code from Moxiecode Systems AB released under LGPL License http://tinymce.moxiecode.com/license
+ * Contains code from Moxiecode Systems AB released under LGPL http://tinymce.moxiecode.com/license
  */
 
 (function() {
index 6d18b2a0bba06ad5c4bbd90d28f8f3b72b803d13..8fb2a4e87f5c87234a2992f74a1a3b574d290934 100644 (file)
@@ -1 +1 @@
-(function(){tinymce.create("tinymce.plugins.wpGallery",{init:function(a,b){var c=this;c.url=b;c.editor=a;c._createButtons();a.addCommand("WP_Gallery",function(){if(tinymce.isIE){a.selection.moveToBookmark(a.wpGalleryBookmark)}var e=a.selection.getNode(),d=wp.media.gallery,f;if(typeof wp==="undefined"||!wp.media||!wp.media.gallery){return}if(e.nodeName!="IMG"||a.dom.getAttrib(e,"class").indexOf("wpGallery")==-1){return}f=d.edit("["+a.dom.getAttrib(e,"title")+"]");f.state("gallery-edit").on("update",function(g){var h=d.shortcode(g).string().slice(1,-1);a.dom.setAttrib(e,"title",h)})});a.onInit.add(function(d){if("ontouchstart" in window){d.dom.events.add(d.getBody(),"touchstart",function(g){var f=g.target;if(f.nodeName=="IMG"&&d.dom.hasClass(f,"wpGallery")){d.selection.select(f);d.dom.events.cancel(g);d.plugins.wordpress._hideButtons();d.plugins.wordpress._showButtons(f,"wp_gallerybtns")}})}});a.onMouseDown.add(function(d,f){if(f.target.nodeName=="IMG"&&d.dom.hasClass(f.target,"wpGallery")){d.plugins.wordpress._hideButtons();d.plugins.wordpress._showButtons(f.target,"wp_gallerybtns")}});a.onBeforeSetContent.add(function(d,e){e.content=c._do_gallery(e.content)});a.onPostProcess.add(function(d,e){if(e.get){e.content=c._get_gallery(e.content)}})},_do_gallery:function(a){return a.replace(/\[gallery([^\]]*)\]/g,function(d,c){return'<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="wpGallery mceItem" title="gallery'+tinymce.DOM.encode(c)+'" />'})},_get_gallery:function(b){function a(c,d){d=new RegExp(d+'="([^"]+)"',"g").exec(c);return d?tinymce.DOM.decode(d[1]):""}return b.replace(/(?:<p[^>]*>)*(<img[^>]+>)(?:<\/p>)*/g,function(e,d){var c=a(d,"class");if(c.indexOf("wpGallery")!=-1){return"<p>["+tinymce.trim(a(d,"title"))+"]</p>"}return e})},_createButtons:function(){var b=this,a=tinymce.activeEditor,d=tinymce.DOM,e,c,f;if(d.get("wp_gallerybtns")){return}f=(window.devicePixelRatio&&window.devicePixelRatio>1)||(window.matchMedia&&window.matchMedia("(min-resolution:130dpi)").matches);d.add(document.body,"div",{id:"wp_gallerybtns",style:"display:none;"});e=d.add("wp_gallerybtns","img",{src:f?b.url+"/img/edit-2x.png":b.url+"/img/edit.png",id:"wp_editgallery",width:"24",height:"24",title:a.getLang("wordpress.editgallery")});tinymce.dom.Event.add(e,"mousedown",function(h){var g=tinymce.activeEditor;g.wpGalleryBookmark=g.selection.getBookmark("simple");g.execCommand("WP_Gallery");g.plugins.wordpress._hideButtons()});c=d.add("wp_gallerybtns","img",{src:f?b.url+"/img/delete-2x.png":b.url+"/img/delete.png",id:"wp_delgallery",width:"24",height:"24",title:a.getLang("wordpress.delgallery")});tinymce.dom.Event.add(c,"mousedown",function(i){var g=tinymce.activeEditor,h=g.selection.getNode();if(h.nodeName=="IMG"&&g.dom.hasClass(h,"wpGallery")){g.dom.remove(h);g.execCommand("mceRepaint");g.dom.events.cancel(i)}g.plugins.wordpress._hideButtons()})},getInfo:function(){return{longname:"Gallery Settings",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wpgallery",tinymce.plugins.wpGallery)})();
\ No newline at end of file
+(function(){tinymce.create("tinymce.plugins.wpGallery",{init:function(a,b){var c=this;c.url=b;c.editor=a;c._createButtons();a.addCommand("WP_Gallery",function(){if(tinymce.isIE){a.selection.moveToBookmark(a.wpGalleryBookmark)}var e=a.selection.getNode(),d=wp.media.gallery,f;if(typeof wp==="undefined"||!wp.media||!wp.media.gallery){return}if(e.nodeName!="IMG"||a.dom.getAttrib(e,"class").indexOf("wp-gallery")==-1){return}f=d.edit("["+a.dom.getAttrib(e,"title")+"]");f.state("gallery-edit").on("update",function(g){var h=d.shortcode(g).string().slice(1,-1);a.dom.setAttrib(e,"title",h)})});a.onInit.add(function(d){if("ontouchstart" in window){d.dom.events.add(d.getBody(),"touchstart",function(g){var f=g.target;if(f.nodeName=="IMG"&&d.dom.hasClass(f,"wp-gallery")){d.selection.select(f);d.dom.events.cancel(g);d.plugins.wordpress._hideButtons();d.plugins.wordpress._showButtons(f,"wp_gallerybtns")}})}});a.onMouseDown.add(function(d,f){if(f.target.nodeName=="IMG"&&d.dom.hasClass(f.target,"wp-gallery")){d.plugins.wordpress._hideButtons();d.plugins.wordpress._showButtons(f.target,"wp_gallerybtns")}});a.onBeforeSetContent.add(function(d,e){e.content=c._do_gallery(e.content)});a.onPostProcess.add(function(d,e){if(e.get){e.content=c._get_gallery(e.content)}})},_do_gallery:function(a){return a.replace(/\[gallery([^\]]*)\]/g,function(d,c){return'<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="wp-gallery mceItem" title="gallery'+tinymce.DOM.encode(c)+'" />'})},_get_gallery:function(b){function a(c,d){d=new RegExp(d+'="([^"]+)"',"g").exec(c);return d?tinymce.DOM.decode(d[1]):""}return b.replace(/(?:<p[^>]*>)*(<img[^>]+>)(?:<\/p>)*/g,function(e,d){var c=a(d,"class");if(c.indexOf("wp-gallery")!=-1){return"<p>["+tinymce.trim(a(d,"title"))+"]</p>"}return e})},_createButtons:function(){var b=this,a=tinymce.activeEditor,d=tinymce.DOM,e,c,f;if(d.get("wp_gallerybtns")){return}f=(window.devicePixelRatio&&window.devicePixelRatio>1)||(window.matchMedia&&window.matchMedia("(min-resolution:130dpi)").matches);d.add(document.body,"div",{id:"wp_gallerybtns",style:"display:none;"});e=d.add("wp_gallerybtns","img",{src:f?b.url+"/img/edit-2x.png":b.url+"/img/edit.png",id:"wp_editgallery",width:"24",height:"24",title:a.getLang("wordpress.editgallery")});tinymce.dom.Event.add(e,"mousedown",function(h){var g=tinymce.activeEditor;g.wpGalleryBookmark=g.selection.getBookmark("simple");g.execCommand("WP_Gallery");g.plugins.wordpress._hideButtons()});c=d.add("wp_gallerybtns","img",{src:f?b.url+"/img/delete-2x.png":b.url+"/img/delete.png",id:"wp_delgallery",width:"24",height:"24",title:a.getLang("wordpress.delgallery")});tinymce.dom.Event.add(c,"mousedown",function(i){var g=tinymce.activeEditor,h=g.selection.getNode();if(h.nodeName=="IMG"&&g.dom.hasClass(h,"wp-gallery")){g.dom.remove(h);g.execCommand("mceRepaint");g.dom.events.cancel(i)}g.plugins.wordpress._hideButtons()})},getInfo:function(){return{longname:"Gallery Settings",author:"WordPress",authorurl:"http://wordpress.org",infourl:"",version:"1.0"}}});tinymce.PluginManager.add("wpgallery",tinymce.plugins.wpGallery)})();
\ No newline at end of file
index 99434628e56921cd363238fa5d4fc58764c81db4..986304dc62bf44071109e707708297f5df254afa 100644 (file)
@@ -23,7 +23,7 @@
                                        return;
 
                                // Make sure we've selected a gallery node.
-                               if ( el.nodeName != 'IMG' || ed.dom.getAttrib(el, 'class').indexOf('wpGallery') == -1 )
+                               if ( el.nodeName != 'IMG' || ed.dom.getAttrib(el, 'class').indexOf('wp-gallery') == -1 )
                                        return;
 
                                frame = gallery.edit( '[' + ed.dom.getAttrib( el, 'title' ) + ']' );
@@ -40,7 +40,7 @@
                                        ed.dom.events.add(ed.getBody(), 'touchstart', function(e){
                                                var target = e.target;
 
-                                               if ( target.nodeName == 'IMG' && ed.dom.hasClass(target, 'wpGallery') ) {
+                                               if ( target.nodeName == 'IMG' && ed.dom.hasClass(target, 'wp-gallery') ) {
                                                        ed.selection.select(target);
                                                        ed.dom.events.cancel(e);
                                                        ed.plugins.wordpress._hideButtons();
@@ -51,7 +51,7 @@
                        });
 
                        ed.onMouseDown.add(function(ed, e) {
-                               if ( e.target.nodeName == 'IMG' && ed.dom.hasClass(e.target, 'wpGallery') ) {
+                               if ( e.target.nodeName == 'IMG' && ed.dom.hasClass(e.target, 'wp-gallery') ) {
                                        ed.plugins.wordpress._hideButtons();
                                        ed.plugins.wordpress._showButtons(e.target, 'wp_gallerybtns');
                                }
@@ -69,7 +69,7 @@
 
                _do_gallery : function(co) {
                        return co.replace(/\[gallery([^\]]*)\]/g, function(a,b){
-                               return '<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="wpGallery mceItem" title="gallery'+tinymce.DOM.encode(b)+'" />';
+                               return '<img src="'+tinymce.baseURL+'/plugins/wpgallery/img/t.gif" class="wp-gallery mceItem" title="gallery'+tinymce.DOM.encode(b)+'" />';
                        });
                },
 
@@ -83,7 +83,7 @@
                        return co.replace(/(?:<p[^>]*>)*(<img[^>]+>)(?:<\/p>)*/g, function(a,im) {
                                var cls = getAttr(im, 'class');
 
-                               if ( cls.indexOf('wpGallery') != -1 )
+                               if ( cls.indexOf('wp-gallery') != -1 )
                                        return '<p>['+tinymce.trim(getAttr(im, 'title'))+']</p>';
 
                                return a;
                        tinymce.dom.Event.add(dellButton, 'mousedown', function(e) {
                                var ed = tinymce.activeEditor, el = ed.selection.getNode();
 
-                               if ( el.nodeName == 'IMG' && ed.dom.hasClass(el, 'wpGallery') ) {
+                               if ( el.nodeName == 'IMG' && ed.dom.hasClass(el, 'wp-gallery') ) {
                                        ed.dom.remove(el);
 
                                        ed.execCommand('mceRepaint');
index 6057f5c90f47e1ead51c4b1a8ebbb32de059fc28..f36e86369b1c86d89bda9337bf87884a48653704 100644 (file)
@@ -2,7 +2,7 @@
        tinymce.create('tinymce.plugins.wpLink', {
                /**
                 * Initializes the plugin, this will be executed after the plugin has been created.
-                * This call is done before the editor instance has finished it's initialization so use the onInit event
+                * This call is done before the editor instance has finished its initialization so use the onInit event
                 * of the editor instance to intercept that event.
                 *
                 * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
index 598eadf2448d04fec78a0e5f849dbdb36879bf6d..c979af99b5adccc42cecb5070fd5bcb52302ffd9 100644 (file)
@@ -45,16 +45,6 @@ body {
        margin: 10px;
 }
 
-br[data-mce-bogus] {
-       line-height: 1em;
-       margin-top: -1em;
-}
-
-br[data-mce-bogus]:only-child {
-       line-height: inherit;
-       margin-top: inherit;
-}
-
 .aligncenter,
 dl.aligncenter {
        display: block;
@@ -109,8 +99,8 @@ td {
 }
 
 /* Styles for the WordPress plugins */
-img.mceWPnextpage,
-img.mceWPmore {
+img.mce-wp-nextpage,
+img.mce-wp-more {
        border: 0;
        border-top: 1px dotted #cccccc;
        display: block;
@@ -119,15 +109,15 @@ img.mceWPmore {
        margin: 15px auto 0;
 }
 
-img.mceWPmore {
+img.mce-wp-more {
        background: transparent url("img/more_bug.gif") no-repeat right top;
 }
 
-img.mceWPnextpage {
+img.mce-wp-nextpage {
     background: transparent url("img/page_bug.gif") no-repeat right top;
 }
 
-img.wpGallery {
+img.wp-gallery {
        border: 1px dashed #888;
        background: #f2f8ff url("img/gallery.png") no-repeat scroll center center;
        width: 99%;
index e2a05d87918534f0b15d362251e0953cca060a1b..503a56399b266672ccb4315d5ace145dc921f63f 100644 (file)
@@ -4,7 +4,7 @@
  * Duck-punched by WordPress core to support a sane schema superset.
  *
  * Copyright, Moxiecode Systems AB
- * Released under LGPL License.
+ * Released under LGPL
  *
  * License: http://www.tinymce.com/license
  * Contributing: http://www.tinymce.com/contributing
                textBlockElementsMap = createLookupTable('text_block_elements', 'h1 h2 h3 h4 h5 h6 p div address pre form ' +
                                                'blockquote center dir fieldset header footer article section hgroup aside nav figure');
                blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' +
-                                               'th tr td li ol ul caption dl dt dd noscript menu isindex samp option datalist select optgroup', textBlockElementsMap);
+                                               'th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup', textBlockElementsMap);
 
                // Converts a wildcard expression string to a regexp for example *a will become /.*a/.
                function patternToRegExp(str) {
index 1c28903880b50e37eb36fff75823aac44278fbd6..600163f068e29155446db11224fd6b375146e234 100644 (file)
Binary files a/wp-includes/js/tinymce/wp-tinymce.js.gz and b/wp-includes/js/tinymce/wp-tinymce.js.gz differ
index e617fe87196e789b75788656f594931def4c4629..88d63a5b467bed8770908ba28980a608dc9afbca 100644 (file)
@@ -1,5 +1,5 @@
-//     Underscore.js 1.4.1
+//     Underscore.js 1.4.4
 //     http://underscorejs.org
-//     (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
+//     (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc.
 //     Underscore may be freely distributed under the MIT license.
-(function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=r.unshift,l=i.toString,c=i.hasOwnProperty,h=r.forEach,p=r.map,d=r.reduce,v=r.reduceRight,m=r.filter,g=r.every,y=r.some,b=r.indexOf,w=r.lastIndexOf,E=Array.isArray,S=Object.keys,x=s.bind,T=function(e){if(e instanceof T)return e;if(!(this instanceof T))return new T(e);this._wrapped=e};typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=T),exports._=T):e._=T,T.VERSION="1.4.1";var N=T.each=T.forEach=function(e,t,r){if(h&&e.forEach===h)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(t.call(r,e[i],i,e)===n)return}else for(var o in e)if(T.has(e,o)&&t.call(r,e[o],o,e)===n)return};T.map=T.collect=function(e,t,n){var r=[];return p&&e.map===p?e.map(t,n):(N(e,function(e,i,s){r[r.length]=t.call(n,e,i,s)}),r)},T.reduce=T.foldl=T.inject=function(e,t,n,r){var i=arguments.length>2;if(d&&e.reduce===d)return r&&(t=T.bind(t,r)),i?e.reduce(t,n):e.reduce(t);N(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError("Reduce of empty array with no initial value");return n},T.reduceRight=T.foldr=function(e,t,n,r){var i=arguments.length>2;if(v&&e.reduceRight===v)return r&&(t=T.bind(t,r)),arguments.length>2?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=T.keys(e);s=o.length}N(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError("Reduce of empty array with no initial value");return n},T.find=T.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},T.filter=T.select=function(e,t,n){var r=[];return m&&e.filter===m?e.filter(t,n):(N(e,function(e,i,s){t.call(n,e,i,s)&&(r[r.length]=e)}),r)},T.reject=function(e,t,n){var r=[];return N(e,function(e,i,s){t.call(n,e,i,s)||(r[r.length]=e)}),r},T.every=T.all=function(e,t,r){t||(t=T.identity);var i=!0;return g&&e.every===g?e.every(t,r):(N(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=T.some=T.any=function(e,t,r){t||(t=T.identity);var i=!1;return y&&e.some===y?e.some(t,r):(N(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};T.contains=T.include=function(e,t){var n=!1;return b&&e.indexOf===b?e.indexOf(t)!=-1:(n=C(e,function(e){return e===t}),n)},T.invoke=function(e,t){var n=u.call(arguments,2);return T.map(e,function(e){return(T.isFunction(t)?t:e[t]).apply(e,n)})},T.pluck=function(e,t){return T.map(e,function(e){return e[t]})},T.where=function(e,t){return T.isEmpty(t)?[]:T.filter(e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},T.max=function(e,t,n){if(!t&&T.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&T.isEmpty(e))return-Infinity;var r={computed:-Infinity};return N(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>=r.computed&&(r={value:e,computed:o})}),r.value},T.min=function(e,t,n){if(!t&&T.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&T.isEmpty(e))return Infinity;var r={computed:Infinity};return N(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o<r.computed&&(r={value:e,computed:o})}),r.value},T.shuffle=function(e){var t,n=0,r=[];return N(e,function(e){t=T.random(n++),r[n-1]=r[t],r[t]=e}),r};var k=function(e){return T.isFunction(e)?e:function(t){return t[e]}};T.sortBy=function(e,t,n){var r=k(t);return T.pluck(T.map(e,function(e,t,i){return{value:e,index:t,criteria:r.call(n,e,t,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||n===void 0)return 1;if(n<r||r===void 0)return-1}return e.index<t.index?-1:1}),"value")};var L=function(e,t,n,r){var i={},s=k(t);return N(e,function(t,o){var u=s.call(n,t,o,e);r(i,u,t)}),i};T.groupBy=function(e,t,n){return L(e,t,n,function(e,t,n){(T.has(e,t)?e[t]:e[t]=[]).push(n)})},T.countBy=function(e,t,n){return L(e,t,n,function(e,t,n){T.has(e,t)||(e[t]=0),e[t]++})},T.sortedIndex=function(e,t,n,r){n=n==null?T.identity:k(n);var i=n.call(r,t),s=0,o=e.length;while(s<o){var u=s+o>>>1;n.call(r,e[u])<i?s=u+1:o=u}return s},T.toArray=function(e){return e?e.length===+e.length?u.call(e):T.values(e):[]},T.size=function(e){return e.length===+e.length?e.length:T.keys(e).length},T.first=T.head=T.take=function(e,t,n){return t!=null&&!n?u.call(e,0,t):e[0]},T.initial=function(e,t,n){return u.call(e,0,e.length-(t==null||n?1:t))},T.last=function(e,t,n){return t!=null&&!n?u.call(e,Math.max(e.length-t,0)):e[e.length-1]},T.rest=T.tail=T.drop=function(e,t,n){return u.call(e,t==null||n?1:t)},T.compact=function(e){return T.filter(e,function(e){return!!e})};var A=function(e,t,n){return N(e,function(e){T.isArray(e)?t?o.apply(n,e):A(e,t,n):n.push(e)}),n};T.flatten=function(e,t){return A(e,t,[])},T.without=function(e){return T.difference(e,u.call(arguments,1))},T.uniq=T.unique=function(e,t,n,r){var i=n?T.map(e,n,r):e,s=[],o=[];return N(i,function(n,r){if(t?!r||o[o.length-1]!==n:!T.contains(o,n))o.push(n),s.push(e[r])}),s},T.union=function(){return T.uniq(a.apply(r,arguments))},T.intersection=function(e){var t=u.call(arguments,1);return T.filter(T.uniq(e),function(e){return T.every(t,function(t){return T.indexOf(t,e)>=0})})},T.difference=function(e){var t=a.apply(r,u.call(arguments,1));return T.filter(e,function(e){return!T.contains(t,e)})},T.zip=function(){var e=u.call(arguments),t=T.max(T.pluck(e,"length")),n=new Array(t);for(var r=0;r<t;r++)n[r]=T.pluck(e,""+r);return n},T.object=function(e,t){var n={};for(var r=0,i=e.length;r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n},T.indexOf=function(e,t,n){var r=0,i=e.length;if(n){if(typeof n!="number")return r=T.sortedIndex(e,t),e[r]===t?r:-1;r=n<0?Math.max(0,i+n):n}if(b&&e.indexOf===b)return e.indexOf(t,n);for(;r<i;r++)if(e[r]===t)return r;return-1},T.lastIndexOf=function(e,t,n){var r=n!=null;if(w&&e.lastIndexOf===w)return r?e.lastIndexOf(t,n):e.lastIndexOf(t);var i=r?n:e.length;while(i--)if(e[i]===t)return i;return-1},T.range=function(e,t,n){arguments.length<=1&&(t=e||0,e=0),n=arguments[2]||1;var r=Math.max(Math.ceil((t-e)/n),0),i=0,s=new Array(r);while(i<r)s[i++]=e,e+=n;return s};var O=function(){};T.bind=function(t,n){var r,i;if(t.bind===x&&x)return x.apply(t,u.call(arguments,1));if(!T.isFunction(t))throw new TypeError;return i=u.call(arguments,2),r=function(){if(this instanceof r){O.prototype=t.prototype;var e=new O,s=t.apply(e,i.concat(u.call(arguments)));return Object(s)===s?s:e}return t.apply(n,i.concat(u.call(arguments)))}},T.bindAll=function(e){var t=u.call(arguments,1);return t.length==0&&(t=T.functions(e)),N(t,function(t){e[t]=T.bind(e[t],e)}),e},T.memoize=function(e,t){var n={};return t||(t=T.identity),function(){var r=t.apply(this,arguments);return T.has(n,r)?n[r]:n[r]=e.apply(this,arguments)}},T.delay=function(e,t){var n=u.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},T.defer=function(e){return T.delay.apply(T,[e,1].concat(u.call(arguments,1)))},T.throttle=function(e,t){var n,r,i,s,o,u,a=T.debounce(function(){o=s=!1},t);return function(){n=this,r=arguments;var f=function(){i=null,o&&(u=e.apply(n,r)),a()};return i||(i=setTimeout(f,t)),s?o=!0:(s=!0,u=e.apply(n,r)),a(),u}},T.debounce=function(e,t,n){var r,i;return function(){var s=this,o=arguments,u=function(){r=null,n||(i=e.apply(s,o))},a=n&&!r;return clearTimeout(r),r=setTimeout(u,t),a&&(i=e.apply(s,o)),i}},T.once=function(e){var t=!1,n;return function(){return t?n:(t=!0,n=e.apply(this,arguments),e=null,n)}},T.wrap=function(e,t){return function(){var n=[e];return o.apply(n,arguments),t.apply(this,n)}},T.compose=function(){var e=arguments;return function(){var t=arguments;for(var n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},T.after=function(e,t){return e<=0?t():function(){if(--e<1)return t.apply(this,arguments)}},T.keys=S||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)T.has(e,n)&&(t[t.length]=n);return t},T.values=function(e){var t=[];for(var n in e)T.has(e,n)&&t.push(e[n]);return t},T.pairs=function(e){var t=[];for(var n in e)T.has(e,n)&&t.push([n,e[n]]);return t},T.invert=function(e){var t={};for(var n in e)T.has(e,n)&&(t[e[n]]=n);return t},T.functions=T.methods=function(e){var t=[];for(var n in e)T.isFunction(e[n])&&t.push(n);return t.sort()},T.extend=function(e){return N(u.call(arguments,1),function(t){for(var n in t)e[n]=t[n]}),e},T.pick=function(e){var t={},n=a.apply(r,u.call(arguments,1));return N(n,function(n){n in e&&(t[n]=e[n])}),t},T.omit=function(e){var t={},n=a.apply(r,u.call(arguments,1));for(var i in e)T.contains(n,i)||(t[i]=e[i]);return t},T.defaults=function(e){return N(u.call(arguments,1),function(t){for(var n in t)e[n]==null&&(e[n]=t[n])}),e},T.clone=function(e){return T.isObject(e)?T.isArray(e)?e.slice():T.extend({},e):e},T.tap=function(e,t){return t(e),e};var M=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof T&&(e=e._wrapped),t instanceof T&&(t=t._wrapped);var i=l.call(e);if(i!=l.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;n.push(e),r.push(t);var o=0,u=!0;if(i=="[object Array]"){o=e.length,u=o==t.length;if(u)while(o--)if(!(u=M(e[o],t[o],n,r)))break}else{var a=e.constructor,f=t.constructor;if(a!==f&&!(T.isFunction(a)&&a instanceof a&&T.isFunction(f)&&f instanceof f))return!1;for(var c in e)if(T.has(e,c)){o++;if(!(u=T.has(t,c)&&M(e[c],t[c],n,r)))break}if(u){for(c in t)if(T.has(t,c)&&!(o--))break;u=!o}}return n.pop(),r.pop(),u};T.isEqual=function(e,t){return M(e,t,[],[])},T.isEmpty=function(e){if(e==null)return!0;if(T.isArray(e)||T.isString(e))return e.length===0;for(var t in e)if(T.has(e,t))return!1;return!0},T.isElement=function(e){return!!e&&e.nodeType===1},T.isArray=E||function(e){return l.call(e)=="[object Array]"},T.isObject=function(e){return e===Object(e)},N(["Arguments","Function","String","Number","Date","RegExp"],function(e){T["is"+e]=function(t){return l.call(t)=="[object "+e+"]"}}),T.isArguments(arguments)||(T.isArguments=function(e){return!!e&&!!T.has(e,"callee")}),typeof /./!="function"&&(T.isFunction=function(e){return typeof e=="function"}),T.isFinite=function(e){return T.isNumber(e)&&isFinite(e)},T.isNaN=function(e){return T.isNumber(e)&&e!=+e},T.isBoolean=function(e){return e===!0||e===!1||l.call(e)=="[object Boolean]"},T.isNull=function(e){return e===null},T.isUndefined=function(e){return e===void 0},T.has=function(e,t){return c.call(e,t)},T.noConflict=function(){return e._=t,this},T.identity=function(e){return e},T.times=function(e,t,n){for(var r=0;r<e;r++)t.call(n,r)},T.random=function(e,t){return t==null&&(t=e,e=0),e+(0|Math.random()*(t-e+1))};var _={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"}};_.unescape=T.invert(_.escape);var D={escape:new RegExp("["+T.keys(_.escape).join("")+"]","g"),unescape:new RegExp("("+T.keys(_.unescape).join("|")+")","g")};T.each(["escape","unescape"],function(e){T[e]=function(t){return t==null?"":(""+t).replace(D[e],function(t){return _[e][t]})}}),T.result=function(e,t){if(e==null)return null;var n=e[t];return T.isFunction(n)?n.call(e):n},T.mixin=function(e){N(T.functions(e),function(t){var n=T[t]=e[t];T.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),F.call(this,n.apply(T,e))}})};var P=0;T.uniqueId=function(e){var t=P++;return e?e+t:t},T.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var H=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},j=/\\|'|\r|\n|\t|\u2028|\u2029/g;T.template=function(e,t,n){n=T.defaults({},n,T.templateSettings);var r=new RegExp([(n.escape||H).source,(n.interpolate||H).source,(n.evaluate||H).source].join("|")+"|$","g"),i=0,s="__p+='";e.replace(r,function(t,n,r,o,u){s+=e.slice(i,u).replace(j,function(e){return"\\"+B[e]}),s+=n?"'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?"'+\n((__t=("+r+"))==null?'':__t)+\n'":o?"';\n"+o+"\n__p+='":"",i=u+t.length}),s+="';\n",n.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{var o=new Function(n.variable||"obj","_",s)}catch(u){throw u.source=s,u}if(t)return o(t,T);var a=function(e){return o.call(this,e,T)};return a.source="function("+(n.variable||"obj")+"){\n"+s+"}",a},T.chain=function(e){return T(e).chain()};var F=function(e){return this._chain?T(e).chain():e};T.mixin(T),N(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];T.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],F.call(this,n)}}),N(["concat","join","slice"],function(e){var t=r[e];T.prototype[e]=function(){return F.call(this,t.apply(this._wrapped,arguments))}}),T.extend(T.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this);
\ No newline at end of file
+(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,d=e.filter,g=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,_=Object.keys,j=i.bind,w=function(n){return n instanceof w?n:this instanceof w?(this._wrapped=n,void 0):new w(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=w),exports._=w):n._=w,w.VERSION="1.4.4";var A=w.each=w.forEach=function(n,t,e){if(null!=n)if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a in n)if(w.has(n,a)&&t.call(e,n[a],a,n)===r)return};w.map=w.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e[e.length]=t.call(r,n,u,i)}),e)};var O="Reduce of empty array with no initial value";w.reduce=w.foldl=w.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=w.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},w.reduceRight=w.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=w.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=w.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},w.find=w.detect=function(n,t,r){var e;return E(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},w.filter=w.select=function(n,t,r){var e=[];return null==n?e:d&&n.filter===d?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&(e[e.length]=n)}),e)},w.reject=function(n,t,r){return w.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},w.every=w.all=function(n,t,e){t||(t=w.identity);var u=!0;return null==n?u:g&&n.every===g?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var E=w.some=w.any=function(n,t,e){t||(t=w.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};w.contains=w.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:E(n,function(n){return n===t})},w.invoke=function(n,t){var r=o.call(arguments,2),e=w.isFunction(t);return w.map(n,function(n){return(e?t:n[t]).apply(n,r)})},w.pluck=function(n,t){return w.map(n,function(n){return n[t]})},w.where=function(n,t,r){return w.isEmpty(t)?r?null:[]:w[r?"find":"filter"](n,function(n){for(var r in t)if(t[r]!==n[r])return!1;return!0})},w.findWhere=function(n,t){return w.where(n,t,!0)},w.max=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.max.apply(Math,n);if(!t&&w.isEmpty(n))return-1/0;var e={computed:-1/0,value:-1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;a>=e.computed&&(e={value:n,computed:a})}),e.value},w.min=function(n,t,r){if(!t&&w.isArray(n)&&n[0]===+n[0]&&65535>n.length)return Math.min.apply(Math,n);if(!t&&w.isEmpty(n))return 1/0;var e={computed:1/0,value:1/0};return A(n,function(n,u,i){var a=t?t.call(r,n,u,i):n;e.computed>a&&(e={value:n,computed:a})}),e.value},w.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=w.random(r++),e[r-1]=e[t],e[t]=n}),e};var k=function(n){return w.isFunction(n)?n:function(t){return t[n]}};w.sortBy=function(n,t,r){var e=k(t);return w.pluck(w.map(n,function(n,t,u){return{value:n,index:t,criteria:e.call(r,n,t,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index<t.index?-1:1}),"value")};var F=function(n,t,r,e){var u={},i=k(t||w.identity);return A(n,function(t,a){var o=i.call(r,t,a,n);e(u,o,t)}),u};w.groupBy=function(n,t,r){return F(n,t,r,function(n,t,r){(w.has(n,t)?n[t]:n[t]=[]).push(r)})},w.countBy=function(n,t,r){return F(n,t,r,function(n,t){w.has(n,t)||(n[t]=0),n[t]++})},w.sortedIndex=function(n,t,r,e){r=null==r?w.identity:k(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;u>r.call(e,n[o])?i=o+1:a=o}return i},w.toArray=function(n){return n?w.isArray(n)?o.call(n):n.length===+n.length?w.map(n,w.identity):w.values(n):[]},w.size=function(n){return null==n?0:n.length===+n.length?n.length:w.keys(n).length},w.first=w.head=w.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:o.call(n,0,t)},w.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},w.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},w.rest=w.tail=w.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},w.compact=function(n){return w.filter(n,w.identity)};var R=function(n,t,r){return A(n,function(n){w.isArray(n)?t?a.apply(r,n):R(n,t,r):r.push(n)}),r};w.flatten=function(n,t){return R(n,t,[])},w.without=function(n){return w.difference(n,o.call(arguments,1))},w.uniq=w.unique=function(n,t,r,e){w.isFunction(t)&&(e=r,r=t,t=!1);var u=r?w.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:w.contains(a,r))||(a.push(r),i.push(n[e]))}),i},w.union=function(){return w.uniq(c.apply(e,arguments))},w.intersection=function(n){var t=o.call(arguments,1);return w.filter(w.uniq(n),function(n){return w.every(t,function(t){return w.indexOf(t,n)>=0})})},w.difference=function(n){var t=c.apply(e,o.call(arguments,1));return w.filter(n,function(n){return!w.contains(t,n)})},w.zip=function(){for(var n=o.call(arguments),t=w.max(w.pluck(n,"length")),r=Array(t),e=0;t>e;e++)r[e]=w.pluck(n,""+e);return r},w.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},w.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=w.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},w.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},w.range=function(n,t,r){1>=arguments.length&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=Array(e);e>u;)i[u++]=n,n+=r;return i},w.bind=function(n,t){if(n.bind===j&&j)return j.apply(n,o.call(arguments,1));var r=o.call(arguments,2);return function(){return n.apply(t,r.concat(o.call(arguments)))}},w.partial=function(n){var t=o.call(arguments,1);return function(){return n.apply(this,t.concat(o.call(arguments)))}},w.bindAll=function(n){var t=o.call(arguments,1);return 0===t.length&&(t=w.functions(n)),A(t,function(t){n[t]=w.bind(n[t],n)}),n},w.memoize=function(n,t){var r={};return t||(t=w.identity),function(){var e=t.apply(this,arguments);return w.has(r,e)?r[e]:r[e]=n.apply(this,arguments)}},w.delay=function(n,t){var r=o.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},w.defer=function(n){return w.delay.apply(w,[n,1].concat(o.call(arguments,1)))},w.throttle=function(n,t){var r,e,u,i,a=0,o=function(){a=new Date,u=null,i=n.apply(r,e)};return function(){var c=new Date,l=t-(c-a);return r=this,e=arguments,0>=l?(clearTimeout(u),u=null,a=c,i=n.apply(r,e)):u||(u=setTimeout(o,l)),i}},w.debounce=function(n,t,r){var e,u;return function(){var i=this,a=arguments,o=function(){e=null,r||(u=n.apply(i,a))},c=r&&!e;return clearTimeout(e),e=setTimeout(o,t),c&&(u=n.apply(i,a)),u}},w.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},w.wrap=function(n,t){return function(){var r=[n];return a.apply(r,arguments),t.apply(this,r)}},w.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},w.after=function(n,t){return 0>=n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},w.keys=_||function(n){if(n!==Object(n))throw new TypeError("Invalid object");var t=[];for(var r in n)w.has(n,r)&&(t[t.length]=r);return t},w.values=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push(n[r]);return t},w.pairs=function(n){var t=[];for(var r in n)w.has(n,r)&&t.push([r,n[r]]);return t},w.invert=function(n){var t={};for(var r in n)w.has(n,r)&&(t[n[r]]=r);return t},w.functions=w.methods=function(n){var t=[];for(var r in n)w.isFunction(n[r])&&t.push(r);return t.sort()},w.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},w.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},w.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)w.contains(r,u)||(t[u]=n[u]);return t},w.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)null==n[r]&&(n[r]=t[r])}),n},w.clone=function(n){return w.isObject(n)?w.isArray(n)?n.slice():w.extend({},n):n},w.tap=function(n,t){return t(n),n};var I=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof w&&(n=n._wrapped),t instanceof w&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==t+"";case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;r.push(n),e.push(t);var a=0,o=!0;if("[object Array]"==u){if(a=n.length,o=a==t.length)for(;a--&&(o=I(n[a],t[a],r,e)););}else{var c=n.constructor,f=t.constructor;if(c!==f&&!(w.isFunction(c)&&c instanceof c&&w.isFunction(f)&&f instanceof f))return!1;for(var s in n)if(w.has(n,s)&&(a++,!(o=w.has(t,s)&&I(n[s],t[s],r,e))))break;if(o){for(s in t)if(w.has(t,s)&&!a--)break;o=!a}}return r.pop(),e.pop(),o};w.isEqual=function(n,t){return I(n,t,[],[])},w.isEmpty=function(n){if(null==n)return!0;if(w.isArray(n)||w.isString(n))return 0===n.length;for(var t in n)if(w.has(n,t))return!1;return!0},w.isElement=function(n){return!(!n||1!==n.nodeType)},w.isArray=x||function(n){return"[object Array]"==l.call(n)},w.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){w["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),w.isArguments(arguments)||(w.isArguments=function(n){return!(!n||!w.has(n,"callee"))}),"function"!=typeof/./&&(w.isFunction=function(n){return"function"==typeof n}),w.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},w.isNaN=function(n){return w.isNumber(n)&&n!=+n},w.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},w.isNull=function(n){return null===n},w.isUndefined=function(n){return n===void 0},w.has=function(n,t){return f.call(n,t)},w.noConflict=function(){return n._=t,this},w.identity=function(n){return n},w.times=function(n,t,r){for(var e=Array(n),u=0;n>u;u++)e[u]=t.call(r,u);return e},w.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))};var M={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"}};M.unescape=w.invert(M.escape);var S={escape:RegExp("["+w.keys(M.escape).join("")+"]","g"),unescape:RegExp("("+w.keys(M.unescape).join("|")+")","g")};w.each(["escape","unescape"],function(n){w[n]=function(t){return null==t?"":(""+t).replace(S[n],function(t){return M[n][t]})}}),w.result=function(n,t){if(null==n)return null;var r=n[t];return w.isFunction(r)?r.call(n):r},w.mixin=function(n){A(w.functions(n),function(t){var r=w[t]=n[t];w.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),D.call(this,r.apply(w,n))}})};var N=0;w.uniqueId=function(n){var t=++N+"";return n?n+t:t},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var T=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n","       ":"t","\u2028":"u2028","\u2029":"u2029"},B=/\\|'|\r|\n|\t|\u2028|\u2029/g;w.template=function(n,t,r){var e;r=w.defaults({},r,w.templateSettings);var u=RegExp([(r.escape||T).source,(r.interpolate||T).source,(r.evaluate||T).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(B,function(n){return"\\"+q[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,w);var c=function(n){return e.call(this,n,w)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},w.chain=function(n){return w(n).chain()};var D=function(n){return this._chain?w(n).chain():n};w.mixin(w),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];w.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],D.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];w.prototype[n]=function(){return D.call(this,t.apply(this._wrapped,arguments))}}),w.extend(w.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this);
\ No newline at end of file
diff --git a/wp-includes/js/wp-auth-check.js b/wp-includes/js/wp-auth-check.js
new file mode 100644 (file)
index 0000000..667143d
--- /dev/null
@@ -0,0 +1,106 @@
+// Interim login dialog
+(function($){
+       var wrap, check, next;
+
+       function show() {
+               var parent = $('#wp-auth-check'), form = $('#wp-auth-check-form'), noframe = wrap.find('.wp-auth-fallback-expired'), frame, loaded = false;
+
+               if ( form.length ) {
+                       // Add unload confirmation to counter (frame-busting) JS redirects
+                       $(window).on( 'beforeunload.wp-auth-check', function(e) {
+                               e.originalEvent.returnValue = window.authcheckL10n.beforeunload;
+                       });
+
+                       frame = $('<iframe id="wp-auth-check-frame" frameborder="0">').attr( 'title', noframe.text() );
+                       frame.load( function(e) {
+                               var height, body;
+
+                               loaded = true;
+
+                               try {
+                                       body = $(this).contents().find('body');
+                                       height = body.height();
+                               } catch(e) {
+                                       wrap.addClass('fallback');
+                                       parent.css( 'max-height', '' );
+                                       form.remove();
+                                       noframe.focus();
+                                       return;
+                               }
+
+                               if ( height ) {
+                                       if ( body && body.hasClass('interim-login-success') )
+                                               hide();
+                                       else
+                                               parent.css( 'max-height', height + 40 + 'px' );
+                               } else if ( ! body || ! body.length ) {
+                                       // Catch "silent" iframe origin exceptions in WebKit after another page is loaded in the iframe
+                                       wrap.addClass('fallback');
+                                       parent.css( 'max-height', '' );
+                                       form.remove();
+                                       noframe.focus();
+                               }
+                       }).attr( 'src', form.data('src') );
+
+                       $('#wp-auth-check-form').append( frame );
+               }
+
+               wrap.removeClass('hidden');
+
+               if ( frame ) {
+                       frame.focus();
+                       // WebKit doesn't throw an error if the iframe fails to load because of "X-Frame-Options: DENY" header.
+                       // Wait for 10 sec. and switch to the fallback text.
+                       setTimeout( function() {
+                               if ( ! loaded ) {
+                                       wrap.addClass('fallback');
+                                       form.remove();
+                                       noframe.focus();
+                               }
+                       }, 10000 );
+               } else {
+                       noframe.focus();
+               }
+       }
+
+       function hide() {
+               $(window).off( 'beforeunload.wp-auth-check' );
+
+               // When on the Edit Post screen, speed up heartbeat after the user logs in to quickly refresh nonces
+               if ( typeof adminpage != 'undefined' && ( adminpage == 'post-php' || adminpage == 'post-new-php' )
+                        && typeof wp != 'undefined' && wp.heartbeat ) {
+
+                       wp.heartbeat.interval( 'fast', 1 );
+               }
+
+               wrap.fadeOut( 200, function() {
+                       wrap.addClass('hidden').css('display', '');
+                       $('#wp-auth-check-frame').remove();
+               });
+       }
+
+       function schedule() {
+               var interval = parseInt( window.authcheckL10n.interval, 10 ) || 180; // in seconds, default 3 min.
+               next = ( new Date() ).getTime() + ( interval * 1000 );
+       }
+
+       $( document ).on( 'heartbeat-tick.wp-auth-check', function( e, data ) {
+               if ( 'wp-auth-check' in data ) {
+                       schedule();
+                       if ( ! data['wp-auth-check'] && wrap.hasClass('hidden') )
+                               show();
+                       else if ( data['wp-auth-check'] && ! wrap.hasClass('hidden') )
+                               hide();
+               }
+       }).on( 'heartbeat-send.wp-auth-check', function( e, data ) {
+               if ( ( new Date() ).getTime() > next )
+                       data['wp-auth-check'] = true;
+       }).ready( function() {
+               schedule();
+               wrap = $('#wp-auth-check-wrap');
+               wrap.find('.wp-auth-check-close').on( 'click', function(e) {
+                       hide();
+               });
+       });
+
+}(jQuery));
diff --git a/wp-includes/js/wp-auth-check.min.js b/wp-includes/js/wp-auth-check.min.js
new file mode 100644 (file)
index 0000000..0bdbb3f
--- /dev/null
@@ -0,0 +1 @@
+(function(f){var e,b,d;function a(){var j=f("#wp-auth-check"),k=f("#wp-auth-check-form"),h=e.find(".wp-auth-fallback-expired"),l,i=false;if(k.length){f(window).on("beforeunload.wp-auth-check",function(m){m.originalEvent.returnValue=window.authcheckL10n.beforeunload});l=f('<iframe id="wp-auth-check-frame" frameborder="0">').attr("title",h.text());l.load(function(o){var n,m;i=true;try{m=f(this).contents().find("body");n=m.height()}catch(o){e.addClass("fallback");j.css("max-height","");k.remove();h.focus();return}if(n){if(m&&m.hasClass("interim-login-success")){c()}else{j.css("max-height",n+40+"px")}}else{if(!m||!m.length){e.addClass("fallback");j.css("max-height","");k.remove();h.focus()}}}).attr("src",k.data("src"));f("#wp-auth-check-form").append(l)}e.removeClass("hidden");if(l){l.focus();setTimeout(function(){if(!i){e.addClass("fallback");k.remove();h.focus()}},10000)}else{h.focus()}}function c(){f(window).off("beforeunload.wp-auth-check");if(typeof adminpage!="undefined"&&(adminpage=="post-php"||adminpage=="post-new-php")&&typeof wp!="undefined"&&wp.heartbeat){wp.heartbeat.interval("fast",1)}e.fadeOut(200,function(){e.addClass("hidden").css("display","");f("#wp-auth-check-frame").remove()})}function g(){var h=parseInt(window.authcheckL10n.interval,10)||180;d=(new Date()).getTime()+(h*1000)}f(document).on("heartbeat-tick.wp-auth-check",function(i,h){if("wp-auth-check" in h){g();if(!h["wp-auth-check"]&&e.hasClass("hidden")){a()}else{if(h["wp-auth-check"]&&!e.hasClass("hidden")){c()}}}}).on("heartbeat-send.wp-auth-check",function(i,h){if((new Date()).getTime()>d){h["wp-auth-check"]=true}}).ready(function(){g();e=f("#wp-auth-check-wrap");e.find(".wp-auth-check-close").on("click",function(h){c()})})}(jQuery));
\ No newline at end of file
diff --git a/wp-includes/js/wp-backbone.js b/wp-includes/js/wp-backbone.js
new file mode 100644 (file)
index 0000000..9e0041d
--- /dev/null
@@ -0,0 +1,384 @@
+window.wp = window.wp || {};
+
+(function ($) {
+       // Create the WordPress Backbone namespace.
+       wp.Backbone = {};
+
+
+       // wp.Backbone.Subviews
+       // --------------------
+       //
+       // A subview manager.
+       wp.Backbone.Subviews = function( view, views ) {
+               this.view = view;
+               this._views = _.isArray( views ) ? { '': views } : views || {};
+       };
+
+       wp.Backbone.Subviews.extend = Backbone.Model.extend;
+
+       _.extend( wp.Backbone.Subviews.prototype, {
+               // ### Fetch all of the subviews
+               //
+               // Returns an array of all subviews.
+               all: function() {
+                       return _.flatten( this._views );
+               },
+
+               // ### Get a selector's subviews
+               //
+               // Fetches all subviews that match a given `selector`.
+               //
+               // If no `selector` is provided, it will grab all subviews attached
+               // to the view's root.
+               get: function( selector ) {
+                       selector = selector || '';
+                       return this._views[ selector ];
+               },
+
+               // ### Get a selector's first subview
+               //
+               // Fetches the first subview that matches a given `selector`.
+               //
+               // If no `selector` is provided, it will grab the first subview
+               // attached to the view's root.
+               //
+               // Useful when a selector only has one subview at a time.
+               first: function( selector ) {
+                       var views = this.get( selector );
+                       return views && views.length ? views[0] : null;
+               },
+
+               // ### Register subview(s)
+               //
+               // Registers any number of `views` to a `selector`.
+               //
+               // When no `selector` is provided, the root selector (the empty string)
+               // is used. `views` accepts a `Backbone.View` instance or an array of
+               // `Backbone.View` instances.
+               //
+               // ---
+               //
+               // Accepts an `options` object, which has a significant effect on the
+               // resulting behavior.
+               //
+               // `options.silent` &ndash; *boolean, `false`*
+               // > If `options.silent` is true, no DOM modifications will be made.
+               //
+               // `options.add` &ndash; *boolean, `false`*
+               // > Use `Views.add()` as a shortcut for setting `options.add` to true.
+               //
+               // > By default, the provided `views` will replace
+               // any existing views associated with the selector. If `options.add`
+               // is true, the provided `views` will be added to the existing views.
+               //
+               // `options.at` &ndash; *integer, `undefined`*
+               // > When adding, to insert `views` at a specific index, use
+               // `options.at`. By default, `views` are added to the end of the array.
+               set: function( selector, views, options ) {
+                       var existing, next;
+
+                       if ( ! _.isString( selector ) ) {
+                               options  = views;
+                               views    = selector;
+                               selector = '';
+                       }
+
+                       options  = options || {};
+                       views    = _.isArray( views ) ? views : [ views ];
+                       existing = this.get( selector );
+                       next     = views;
+
+                       if ( existing ) {
+                               if ( options.add ) {
+                                       if ( _.isUndefined( options.at ) ) {
+                                               next = existing.concat( views );
+                                       } else {
+                                               next = existing;
+                                               next.splice.apply( next, [ options.at, 0 ].concat( views ) );
+                                       }
+                               } else {
+                                       _.each( next, function( view ) {
+                                               view.__detach = true;
+                                       });
+
+                                       _.each( existing, function( view ) {
+                                               if ( view.__detach )
+                                                       view.$el.detach();
+                                               else
+                                                       view.remove();
+                                       });
+
+                                       _.each( next, function( view ) {
+                                               delete view.__detach;
+                                       });
+                               }
+                       }
+
+                       this._views[ selector ] = next;
+
+                       _.each( views, function( subview ) {
+                               var constructor = subview.Views || wp.Backbone.Subviews,
+                                       subviews = subview.views = subview.views || new constructor( subview );
+                               subviews.parent   = this.view;
+                               subviews.selector = selector;
+                       }, this );
+
+                       if ( ! options.silent )
+                               this._attach( selector, views, _.extend({ ready: this._isReady() }, options ) );
+
+                       return this;
+               },
+
+               // ### Add subview(s) to existing subviews
+               //
+               // An alias to `Views.set()`, which defaults `options.add` to true.
+               //
+               // Adds any number of `views` to a `selector`.
+               //
+               // When no `selector` is provided, the root selector (the empty string)
+               // is used. `views` accepts a `Backbone.View` instance or an array of
+               // `Backbone.View` instances.
+               //
+               // Use `Views.set()` when setting `options.add` to `false`.
+               //
+               // Accepts an `options` object. By default, provided `views` will be
+               // inserted at the end of the array of existing views. To insert
+               // `views` at a specific index, use `options.at`. If `options.silent`
+               // is true, no DOM modifications will be made.
+               //
+               // For more information on the `options` object, see `Views.set()`.
+               add: function( selector, views, options ) {
+                       if ( ! _.isString( selector ) ) {
+                               options  = views;
+                               views    = selector;
+                               selector = '';
+                       }
+
+                       return this.set( selector, views, _.extend({ add: true }, options ) );
+               },
+
+               // ### Stop tracking subviews
+               //
+               // Stops tracking `views` registered to a `selector`. If no `views` are
+               // set, then all of the `selector`'s subviews will be unregistered and
+               // removed.
+               //
+               // Accepts an `options` object. If `options.silent` is set, `remove`
+               // will *not* be triggered on the unregistered views.
+               unset: function( selector, views, options ) {
+                       var existing;
+
+                       if ( ! _.isString( selector ) ) {
+                               options = views;
+                               views = selector;
+                               selector = '';
+                       }
+
+                       views = views || [];
+
+                       if ( existing = this.get( selector ) ) {
+                               views = _.isArray( views ) ? views : [ views ];
+                               this._views[ selector ] = views.length ? _.difference( existing, views ) : [];
+                       }
+
+                       if ( ! options || ! options.silent )
+                               _.invoke( views, 'remove' );
+
+                       return this;
+               },
+
+               // ### Detach all subviews
+               //
+               // Detaches all subviews from the DOM.
+               //
+               // Helps to preserve all subview events when re-rendering the master
+               // view. Used in conjunction with `Views.render()`.
+               detach: function() {
+                       $( _.pluck( this.all(), 'el' ) ).detach();
+                       return this;
+               },
+
+               // ### Render all subviews
+               //
+               // Renders all subviews. Used in conjunction with `Views.detach()`.
+               render: function() {
+                       var options = {
+                                       ready: this._isReady()
+                               };
+
+                       _.each( this._views, function( views, selector ) {
+                               this._attach( selector, views, options );
+                       }, this );
+
+                       this.rendered = true;
+                       return this;
+               },
+
+               // ### Remove all subviews
+               //
+               // Triggers the `remove()` method on all subviews. Detaches the master
+               // view from its parent. Resets the internals of the views manager.
+               //
+               // Accepts an `options` object. If `options.silent` is set, `unset`
+               // will *not* be triggered on the master view's parent.
+               remove: function( options ) {
+                       if ( ! options || ! options.silent ) {
+                               if ( this.parent && this.parent.views )
+                                       this.parent.views.unset( this.selector, this.view, { silent: true });
+                               delete this.parent;
+                               delete this.selector;
+                       }
+
+                       _.invoke( this.all(), 'remove' );
+                       this._views = [];
+                       return this;
+               },
+
+               // ### Replace a selector's subviews
+               //
+               // By default, sets the `$target` selector's html to the subview `els`.
+               //
+               // Can be overridden in subclasses.
+               replace: function( $target, els ) {
+                       $target.html( els );
+                       return this;
+               },
+
+               // ### Insert subviews into a selector
+               //
+               // By default, appends the subview `els` to the end of the `$target`
+               // selector. If `options.at` is set, inserts the subview `els` at the
+               // provided index.
+               //
+               // Can be overridden in subclasses.
+               insert: function( $target, els, options ) {
+                       var at = options && options.at,
+                               $children;
+
+                       if ( _.isNumber( at ) && ($children = $target.children()).length > at )
+                               $children.eq( at ).before( els );
+                       else
+                               $target.append( els );
+
+                       return this;
+               },
+
+               // ### Trigger the ready event
+               //
+               // **Only use this method if you know what you're doing.**
+               // For performance reasons, this method does not check if the view is
+               // actually attached to the DOM. It's taking your word for it.
+               //
+               // Fires the ready event on the current view and all attached subviews.
+               ready: function() {
+                       this.view.trigger('ready');
+
+                       // Find all attached subviews, and call ready on them.
+                       _.chain( this.all() ).map( function( view ) {
+                               return view.views;
+                       }).flatten().where({ attached: true }).invoke('ready');
+               },
+
+               // #### Internal. Attaches a series of views to a selector.
+               //
+               // Checks to see if a matching selector exists, renders the views,
+               // performs the proper DOM operation, and then checks if the view is
+               // attached to the document.
+               _attach: function( selector, views, options ) {
+                       var $selector = selector ? this.view.$( selector ) : this.view.$el,
+                               managers;
+
+                       // Check if we found a location to attach the views.
+                       if ( ! $selector.length )
+                               return this;
+
+                       managers = _.chain( views ).pluck('views').flatten().value();
+
+                       // Render the views if necessary.
+                       _.each( managers, function( manager ) {
+                               if ( manager.rendered )
+                                       return;
+
+                               manager.view.render();
+                               manager.rendered = true;
+                       }, this );
+
+                       // Insert or replace the views.
+                       this[ options.add ? 'insert' : 'replace' ]( $selector, _.pluck( views, 'el' ), options );
+
+                       // Set attached and trigger ready if the current view is already
+                       // attached to the DOM.
+                       _.each( managers, function( manager ) {
+                               manager.attached = true;
+
+                               if ( options.ready )
+                                       manager.ready();
+                       }, this );
+
+                       return this;
+               },
+
+               // #### Internal. Checks if the current view is in the DOM.
+               _isReady: function() {
+                       var node = this.view.el;
+                       while ( node ) {
+                               if ( node === document.body )
+                                       return true;
+                               node = node.parentNode;
+                       }
+
+                       return false;
+               }
+       });
+
+
+       // wp.Backbone.View
+       // ----------------
+       //
+       // The base view class.
+       wp.Backbone.View = Backbone.View.extend({
+               // The constructor for the `Views` manager.
+               Subviews: wp.Backbone.Subviews,
+
+               constructor: function() {
+                       this.views = new this.Subviews( this, this.views );
+                       this.on( 'ready', this.ready, this );
+
+                       Backbone.View.apply( this, arguments );
+               },
+
+               remove: function() {
+                       var result = Backbone.View.prototype.remove.apply( this, arguments );
+
+                       // Recursively remove child views.
+                       if ( this.views )
+                               this.views.remove();
+
+                       return result;
+               },
+
+               render: function() {
+                       var options;
+
+                       if ( this.prepare )
+                               options = this.prepare();
+
+                       this.views.detach();
+
+                       if ( this.template ) {
+                               options = options || {};
+                               this.trigger( 'prepare', options );
+                               this.$el.html( this.template( options ) );
+                       }
+
+                       this.views.render();
+                       return this;
+               },
+
+               prepare: function() {
+                       return this.options;
+               },
+
+               ready: function() {}
+       });
+}(jQuery));
diff --git a/wp-includes/js/wp-backbone.min.js b/wp-includes/js/wp-backbone.min.js
new file mode 100644 (file)
index 0000000..a96dac9
--- /dev/null
@@ -0,0 +1 @@
+window.wp=window.wp||{};(function(a){wp.Backbone={};wp.Backbone.Subviews=function(c,b){this.view=c;this._views=_.isArray(b)?{"":b}:b||{}};wp.Backbone.Subviews.extend=Backbone.Model.extend;_.extend(wp.Backbone.Subviews.prototype,{all:function(){return _.flatten(this._views)},get:function(b){b=b||"";return this._views[b]},first:function(b){var c=this.get(b);return c&&c.length?c[0]:null},set:function(b,c,d){var f,e;if(!_.isString(b)){d=c;c=b;b=""}d=d||{};c=_.isArray(c)?c:[c];f=this.get(b);e=c;if(f){if(d.add){if(_.isUndefined(d.at)){e=f.concat(c)}else{e=f;e.splice.apply(e,[d.at,0].concat(c))}}else{_.each(e,function(g){g.__detach=true});_.each(f,function(g){if(g.__detach){g.$el.detach()}else{g.remove()}});_.each(e,function(g){delete g.__detach})}}this._views[b]=e;_.each(c,function(i){var g=i.Views||wp.Backbone.Subviews,h=i.views=i.views||new g(i);h.parent=this.view;h.selector=b},this);if(!d.silent){this._attach(b,c,_.extend({ready:this._isReady()},d))}return this},add:function(b,c,d){if(!_.isString(b)){d=c;c=b;b=""}return this.set(b,c,_.extend({add:true},d))},unset:function(b,c,d){var e;if(!_.isString(b)){d=c;c=b;b=""}c=c||[];if(e=this.get(b)){c=_.isArray(c)?c:[c];this._views[b]=c.length?_.difference(e,c):[]}if(!d||!d.silent){_.invoke(c,"remove")}return this},detach:function(){a(_.pluck(this.all(),"el")).detach();return this},render:function(){var b={ready:this._isReady()};_.each(this._views,function(d,c){this._attach(c,d,b)},this);this.rendered=true;return this},remove:function(b){if(!b||!b.silent){if(this.parent&&this.parent.views){this.parent.views.unset(this.selector,this.view,{silent:true})}delete this.parent;delete this.selector}_.invoke(this.all(),"remove");this._views=[];return this},replace:function(b,c){b.html(c);return this},insert:function(c,f,e){var b=e&&e.at,d;if(_.isNumber(b)&&(d=c.children()).length>b){d.eq(b).before(f)}else{c.append(f)}return this},ready:function(){this.view.trigger("ready");_.chain(this.all()).map(function(b){return b.views}).flatten().where({attached:true}).invoke("ready")},_attach:function(b,c,d){var f=b?this.view.$(b):this.view.$el,e;if(!f.length){return this}e=_.chain(c).pluck("views").flatten().value();_.each(e,function(g){if(g.rendered){return}g.view.render();g.rendered=true},this);this[d.add?"insert":"replace"](f,_.pluck(c,"el"),d);_.each(e,function(g){g.attached=true;if(d.ready){g.ready()}},this);return this},_isReady:function(){var b=this.view.el;while(b){if(b===document.body){return true}b=b.parentNode}return false}});wp.Backbone.View=Backbone.View.extend({Subviews:wp.Backbone.Subviews,constructor:function(){this.views=new this.Subviews(this,this.views);this.on("ready",this.ready,this);Backbone.View.apply(this,arguments)},remove:function(){var b=Backbone.View.prototype.remove.apply(this,arguments);if(this.views){this.views.remove()}return b},render:function(){var b;if(this.prepare){b=this.prepare()}this.views.detach();if(this.template){b=b||{};this.trigger("prepare",b);this.$el.html(this.template(b))}this.views.render();return this},prepare:function(){return this.options},ready:function(){}})}(jQuery));
\ No newline at end of file
diff --git a/wp-includes/js/wp-util.js b/wp-includes/js/wp-util.js
new file mode 100644 (file)
index 0000000..701ec3e
--- /dev/null
@@ -0,0 +1,105 @@
+window.wp = window.wp || {};
+
+(function ($) {
+       // Check for the utility settings.
+       var settings = typeof _wpUtilSettings === 'undefined' ? {} : _wpUtilSettings;
+
+       /**
+        * wp.template( id )
+        *
+        * Fetches a template by id.
+        *
+        * @param  {string} id   A string that corresponds to a DOM element with an id prefixed with "tmpl-".
+        *                       For example, "attachment" maps to "tmpl-attachment".
+        * @return {function}    A function that lazily-compiles the template requested.
+        */
+       wp.template = _.memoize(function ( id ) {
+               var compiled,
+                       options = {
+                               evaluate:    /<#([\s\S]+?)#>/g,
+                               interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
+                               escape:      /\{\{([^\}]+?)\}\}(?!\})/g,
+                               variable:    'data'
+                       };
+
+               return function ( data ) {
+                       compiled = compiled || _.template( $( '#tmpl-' + id ).html(), null, options );
+                       return compiled( data );
+               };
+       });
+
+       // wp.ajax
+       // ------
+       //
+       // Tools for sending ajax requests with JSON responses and built in error handling.
+       // Mirrors and wraps jQuery's ajax APIs.
+       wp.ajax = {
+               settings: settings.ajax || {},
+
+               /**
+                * wp.ajax.post( [action], [data] )
+                *
+                * Sends a POST request to WordPress.
+                *
+                * @param  {string} action The slug of the action to fire in WordPress.
+                * @param  {object} data   The data to populate $_POST with.
+                * @return {$.promise}     A jQuery promise that represents the request.
+                */
+               post: function( action, data ) {
+                       return wp.ajax.send({
+                               data: _.isObject( action ) ? action : _.extend( data || {}, { action: action })
+                       });
+               },
+
+               /**
+                * wp.ajax.send( [action], [options] )
+                *
+                * Sends a POST request to WordPress.
+                *
+                * @param  {string} action  The slug of the action to fire in WordPress.
+                * @param  {object} options The options passed to jQuery.ajax.
+                * @return {$.promise}      A jQuery promise that represents the request.
+                */
+               send: function( action, options ) {
+                       if ( _.isObject( action ) ) {
+                               options = action;
+                       } else {
+                               options = options || {};
+                               options.data = _.extend( options.data || {}, { action: action });
+                       }
+
+                       options = _.defaults( options || {}, {
+                               type:    'POST',
+                               url:     wp.ajax.settings.url,
+                               context: this
+                       });
+
+                       return $.Deferred( function( deferred ) {
+                               // Transfer success/error callbacks.
+                               if ( options.success )
+                                       deferred.done( options.success );
+                               if ( options.error )
+                                       deferred.fail( options.error );
+
+                               delete options.success;
+                               delete options.error;
+
+                               // Use with PHP's wp_send_json_success() and wp_send_json_error()
+                               $.ajax( options ).done( function( response ) {
+                                       // Treat a response of `1` as successful for backwards
+                                       // compatibility with existing handlers.
+                                       if ( response === '1' || response === 1 )
+                                               response = { success: true };
+
+                                       if ( _.isObject( response ) && ! _.isUndefined( response.success ) )
+                                               deferred[ response.success ? 'resolveWith' : 'rejectWith' ]( this, [response.data] );
+                                       else
+                                               deferred.rejectWith( this, [response] );
+                               }).fail( function() {
+                                       deferred.rejectWith( this, arguments );
+                               });
+                       }).promise();
+               }
+       };
+
+}(jQuery));
diff --git a/wp-includes/js/wp-util.min.js b/wp-includes/js/wp-util.min.js
new file mode 100644 (file)
index 0000000..d5dbd2e
--- /dev/null
@@ -0,0 +1 @@
+window.wp=window.wp||{};(function(b){var a=typeof _wpUtilSettings==="undefined"?{}:_wpUtilSettings;wp.template=_.memoize(function(e){var d,c={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(f){d=d||_.template(b("#tmpl-"+e).html(),null,c);return d(f)}});wp.ajax={settings:a.ajax||{},post:function(d,c){return wp.ajax.send({data:_.isObject(d)?d:_.extend(c||{},{action:d})})},send:function(d,c){if(_.isObject(d)){c=d}else{c=c||{};c.data=_.extend(c.data||{},{action:d})}c=_.defaults(c||{},{type:"POST",url:wp.ajax.settings.url,context:this});return b.Deferred(function(e){if(c.success){e.done(c.success)}if(c.error){e.fail(c.error)}delete c.success;delete c.error;b.ajax(c).done(function(f){if(f==="1"||f===1){f={success:true}}if(_.isObject(f)&&!_.isUndefined(f.success)){e[f.success?"resolveWith":"rejectWith"](this,[f.data])}else{e.rejectWith(this,[f])}}).fail(function(){e.rejectWith(this,arguments)})}).promise()}}}(jQuery));
\ No newline at end of file
index c52d2a197675b4ae270bdb58e652c22c59c48ba9..232fd4e2f93f2d4bab79868ab5994c77c8edaa67 100644 (file)
@@ -71,8 +71,7 @@ var wpLink;
                                        width: 480,
                                        height: 'auto',
                                        modal: true,
-                                       dialogClass: 'wp-dialog',
-                                       zIndex: 300000
+                                       dialogClass: 'wp-dialog'
                                });
                        }
 
@@ -114,8 +113,7 @@ var wpLink;
                                inputs.url.val( ed.dom.getAttrib(e, 'href') );
                                inputs.title.val( ed.dom.getAttrib(e, 'title') );
                                // Set open in new tab.
-                               if ( "_blank" == ed.dom.getAttrib(e, 'target') )
-                                       inputs.openInNewTab.prop('checked', true);
+                               inputs.openInNewTab.prop('checked', ( "_blank" == ed.dom.getAttrib( e, 'target' ) ) );
                                // Update save prompt.
                                inputs.submit.val( wpLinkL10n.update );
 
index 9d6a5606ab4b43b35ec573523172100721ec78ec..9c9cf839ab79a2fa27cd97eb6d55f66cc32e7bac 100644 (file)
@@ -1 +1 @@
-var wpLink;(function(f){var b={},e={},d,a,c;wpLink={timeToTriggerRiver:150,minRiverAJAXDuration:200,riverBottomThreshold:5,keySensitivity:100,lastSearch:"",textarea:"",init:function(){b.dialog=f("#wp-link");b.submit=f("#wp-link-submit");b.url=f("#url-field");b.nonce=f("#_ajax_linking_nonce");b.title=f("#link-title-field");b.openInNewTab=f("#link-target-checkbox");b.search=f("#search-field");e.search=new a(f("#search-results"));e.recent=new a(f("#most-recent-results"));e.elements=f(".query-results",b.dialog);b.dialog.keydown(wpLink.keydown);b.dialog.keyup(wpLink.keyup);b.submit.click(function(g){g.preventDefault();wpLink.update()});f("#wp-link-cancel").click(function(g){g.preventDefault();wpLink.close()});f("#internal-toggle").click(wpLink.toggleInternalLinking);e.elements.bind("river-select",wpLink.updateFields);b.search.keyup(wpLink.searchInternalLinks);b.dialog.bind("wpdialogrefresh",wpLink.refresh);b.dialog.bind("wpdialogbeforeopen",wpLink.beforeOpen);b.dialog.bind("wpdialogclose",wpLink.onClose)},beforeOpen:function(){wpLink.range=null;if(!wpLink.isMCE()&&document.selection){wpLink.textarea.focus();wpLink.range=document.selection.createRange()}},open:function(){if(!wpActiveEditor){return}this.textarea=f("#"+wpActiveEditor).get(0);if(!b.dialog.data("wpdialog")){b.dialog.wpdialog({title:wpLinkL10n.title,width:480,height:"auto",modal:true,dialogClass:"wp-dialog",zIndex:300000})}b.dialog.wpdialog("open")},isMCE:function(){return tinyMCEPopup&&(d=tinyMCEPopup.editor)&&!d.isHidden()},refresh:function(){e.search.refresh();e.recent.refresh();if(wpLink.isMCE()){wpLink.mceRefresh()}else{wpLink.setDefaultValues()}b.url.focus()[0].select();if(!e.recent.ul.children().length){e.recent.ajax()}},mceRefresh:function(){var g;d=tinyMCEPopup.editor;tinyMCEPopup.restoreSelection();if(g=d.dom.getParent(d.selection.getNode(),"A")){b.url.val(d.dom.getAttrib(g,"href"));b.title.val(d.dom.getAttrib(g,"title"));if("_blank"==d.dom.getAttrib(g,"target")){b.openInNewTab.prop("checked",true)}b.submit.val(wpLinkL10n.update)}else{wpLink.setDefaultValues()}tinyMCEPopup.storeSelection()},close:function(){if(wpLink.isMCE()){tinyMCEPopup.close()}else{b.dialog.wpdialog("close")}},onClose:function(){if(!wpLink.isMCE()){wpLink.textarea.focus();if(wpLink.range){wpLink.range.moveToBookmark(wpLink.range.getBookmark());wpLink.range.select()}}},getAttrs:function(){return{href:b.url.val(),title:b.title.val(),target:b.openInNewTab.prop("checked")?"_blank":""}},update:function(){if(wpLink.isMCE()){wpLink.mceUpdate()}else{wpLink.htmlUpdate()}},htmlUpdate:function(){var i,j,k,h,l,g=wpLink.textarea;if(!g){return}i=wpLink.getAttrs();if(!i.href||i.href=="http://"){return}j='<a href="'+i.href+'"';if(i.title){j+=' title="'+i.title+'"'}if(i.target){j+=' target="'+i.target+'"'}j+=">";if(document.selection&&wpLink.range){g.focus();wpLink.range.text=j+wpLink.range.text+"</a>";wpLink.range.moveToBookmark(wpLink.range.getBookmark());wpLink.range.select();wpLink.range=null}else{if(typeof g.selectionStart!=="undefined"){k=g.selectionStart;h=g.selectionEnd;selection=g.value.substring(k,h);j=j+selection+"</a>";l=k+j.length;if(k==h){l-="</a>".length}g.value=g.value.substring(0,k)+j+g.value.substring(h,g.value.length);g.selectionStart=g.selectionEnd=l}}wpLink.close();g.focus()},mceUpdate:function(){var h=tinyMCEPopup.editor,i=wpLink.getAttrs(),j,g;tinyMCEPopup.restoreSelection();j=h.dom.getParent(h.selection.getNode(),"A");if(!i.href||i.href=="http://"){if(j){tinyMCEPopup.execCommand("mceBeginUndoLevel");g=h.selection.getBookmark();h.dom.remove(j,1);h.selection.moveToBookmark(g);tinyMCEPopup.execCommand("mceEndUndoLevel");wpLink.close()}return}tinyMCEPopup.execCommand("mceBeginUndoLevel");if(j==null){h.getDoc().execCommand("unlink",false,null);tinyMCEPopup.execCommand("mceInsertLink",false,"#mce_temp_url#",{skip_undo:1});tinymce.each(h.dom.select("a"),function(k){if(h.dom.getAttrib(k,"href")=="#mce_temp_url#"){j=k;h.dom.setAttribs(j,i)}});if(f(j).text()=="#mce_temp_url#"){h.dom.remove(j);j=null}}else{h.dom.setAttribs(j,i)}if(j&&(j.childNodes.length!=1||j.firstChild.nodeName!="IMG")){h.focus();h.selection.select(j);h.selection.collapse(0);tinyMCEPopup.storeSelection()}tinyMCEPopup.execCommand("mceEndUndoLevel");wpLink.close()},updateFields:function(i,h,g){b.url.val(h.children(".item-permalink").val());b.title.val(h.hasClass("no-title")?"":h.children(".item-title").text());if(g&&g.type=="click"){b.url.focus()}},setDefaultValues:function(){b.url.val("http://");b.title.val("");b.submit.val(wpLinkL10n.save)},searchInternalLinks:function(){var h=f(this),i,g=h.val();if(g.length>2){e.recent.hide();e.search.show();if(wpLink.lastSearch==g){return}wpLink.lastSearch=g;i=h.parent().find(".spinner").show();e.search.change(g);e.search.ajax(function(){i.hide()})}else{e.search.hide();e.recent.show()}},next:function(){e.search.next();e.recent.next()},prev:function(){e.search.prev();e.recent.prev()},keydown:function(i){var h,g=f.ui.keyCode;switch(i.which){case g.UP:h="prev";case g.DOWN:h=h||"next";clearInterval(wpLink.keyInterval);wpLink[h]();wpLink.keyInterval=setInterval(wpLink[h],wpLink.keySensitivity);break;default:return}i.preventDefault()},keyup:function(h){var g=f.ui.keyCode;switch(h.which){case g.ESCAPE:h.stopImmediatePropagation();if(!f(document).triggerHandler("wp_CloseOnEscape",[{event:h,what:"wplink",cb:wpLink.close}])){wpLink.close()}return false;break;case g.UP:case g.DOWN:clearInterval(wpLink.keyInterval);break;default:return}h.preventDefault()},delayedCallback:function(i,g){var l,k,j,h;if(!g){return i}setTimeout(function(){if(k){return i.apply(h,j)}l=true},g);return function(){if(l){return i.apply(this,arguments)}j=arguments;h=this;k=true}},toggleInternalLinking:function(h){var g=f("#search-panel"),i=b.dialog.wpdialog("widget"),k=!g.is(":visible"),j=f(window);f(this).toggleClass("toggle-arrow-active",k);b.dialog.height("auto");g.slideToggle(300,function(){setUserSetting("wplink",k?"1":"0");b[k?"search":"url"].focus();var l=j.scrollTop(),o=i.offset().top,m=o+i.outerHeight(),n=m-j.height();if(n>l){i.animate({top:n<o?o-n:l},200)}});h.preventDefault()}};a=function(i,h){var g=this;this.element=i;this.ul=i.children("ul");this.waiting=i.find(".river-waiting");this.change(h);this.refresh();i.scroll(function(){g.maybeLoad()});i.delegate("li","click",function(j){g.select(f(this),j)})};f.extend(a.prototype,{refresh:function(){this.deselect();this.visible=this.element.is(":visible")},show:function(){if(!this.visible){this.deselect();this.element.show();this.visible=true}},hide:function(){this.element.hide();this.visible=false},select:function(h,k){var j,i,l,g;if(h.hasClass("unselectable")||h==this.selected){return}this.deselect();this.selected=h.addClass("selected");j=h.outerHeight();i=this.element.height();l=h.position().top;g=this.element.scrollTop();if(l<0){this.element.scrollTop(g+l)}else{if(l+j>i){this.element.scrollTop(g+l-i+j)}}this.element.trigger("river-select",[h,k,this])},deselect:function(){if(this.selected){this.selected.removeClass("selected")}this.selected=false},prev:function(){if(!this.visible){return}var g;if(this.selected){g=this.selected.prev("li");if(g.length){this.select(g)}}},next:function(){if(!this.visible){return}var g=this.selected?this.selected.next("li"):f("li:not(.unselectable):first",this.element);if(g.length){this.select(g)}},ajax:function(j){var h=this,i=this.query.page==1?0:wpLink.minRiverAJAXDuration,g=wpLink.delayedCallback(function(k,l){h.process(k,l);if(j){j(k,l)}},i);this.query.ajax(g)},change:function(g){if(this.query&&this._search==g){return}this._search=g;this.query=new c(g);this.element.scrollTop(0)},process:function(h,l){var i="",j=true,g="",k=l.page==1;if(!h){if(k){i+='<li class="unselectable"><span class="item-title"><em>'+wpLinkL10n.noMatchesFound+"</em></span></li>"}}else{f.each(h,function(){g=j?"alternate":"";g+=this["title"]?"":" no-title";i+=g?'<li class="'+g+'">':"<li>";i+='<input type="hidden" class="item-permalink" value="'+this["permalink"]+'" />';i+='<span class="item-title">';i+=this["title"]?this["title"]:wpLinkL10n.noTitle;i+='</span><span class="item-info">'+this["info"]+"</span></li>";j=!j})}this.ul[k?"html":"append"](i)},maybeLoad:function(){var h=this,i=this.element,g=i.scrollTop()+i.height();if(!this.query.ready()||g<this.ul.height()-wpLink.riverBottomThreshold){return}setTimeout(function(){var j=i.scrollTop(),k=j+i.height();if(!h.query.ready()||k<h.ul.height()-wpLink.riverBottomThreshold){return}h.waiting.show();i.scrollTop(j+h.waiting.outerHeight());h.ajax(function(){h.waiting.hide()})},wpLink.timeToTriggerRiver)}});c=function(g){this.page=1;this.allLoaded=false;this.querying=false;this.search=g};f.extend(c.prototype,{ready:function(){return !(this.querying||this.allLoaded)},ajax:function(i){var g=this,h={action:"wp-link-ajax",page:this.page,_ajax_linking_nonce:b.nonce.val()};if(this.search){h.search=this.search}this.querying=true;f.post(ajaxurl,h,function(j){g.page++;g.querying=false;g.allLoaded=!j;i(j,h)},"json")}});f(document).ready(wpLink.init)})(jQuery);
\ No newline at end of file
+var wpLink;(function(f){var b={},e={},d,a,c;wpLink={timeToTriggerRiver:150,minRiverAJAXDuration:200,riverBottomThreshold:5,keySensitivity:100,lastSearch:"",textarea:"",init:function(){b.dialog=f("#wp-link");b.submit=f("#wp-link-submit");b.url=f("#url-field");b.nonce=f("#_ajax_linking_nonce");b.title=f("#link-title-field");b.openInNewTab=f("#link-target-checkbox");b.search=f("#search-field");e.search=new a(f("#search-results"));e.recent=new a(f("#most-recent-results"));e.elements=f(".query-results",b.dialog);b.dialog.keydown(wpLink.keydown);b.dialog.keyup(wpLink.keyup);b.submit.click(function(g){g.preventDefault();wpLink.update()});f("#wp-link-cancel").click(function(g){g.preventDefault();wpLink.close()});f("#internal-toggle").click(wpLink.toggleInternalLinking);e.elements.bind("river-select",wpLink.updateFields);b.search.keyup(wpLink.searchInternalLinks);b.dialog.bind("wpdialogrefresh",wpLink.refresh);b.dialog.bind("wpdialogbeforeopen",wpLink.beforeOpen);b.dialog.bind("wpdialogclose",wpLink.onClose)},beforeOpen:function(){wpLink.range=null;if(!wpLink.isMCE()&&document.selection){wpLink.textarea.focus();wpLink.range=document.selection.createRange()}},open:function(){if(!wpActiveEditor){return}this.textarea=f("#"+wpActiveEditor).get(0);if(!b.dialog.data("wpdialog")){b.dialog.wpdialog({title:wpLinkL10n.title,width:480,height:"auto",modal:true,dialogClass:"wp-dialog"})}b.dialog.wpdialog("open")},isMCE:function(){return tinyMCEPopup&&(d=tinyMCEPopup.editor)&&!d.isHidden()},refresh:function(){e.search.refresh();e.recent.refresh();if(wpLink.isMCE()){wpLink.mceRefresh()}else{wpLink.setDefaultValues()}b.url.focus()[0].select();if(!e.recent.ul.children().length){e.recent.ajax()}},mceRefresh:function(){var g;d=tinyMCEPopup.editor;tinyMCEPopup.restoreSelection();if(g=d.dom.getParent(d.selection.getNode(),"A")){b.url.val(d.dom.getAttrib(g,"href"));b.title.val(d.dom.getAttrib(g,"title"));b.openInNewTab.prop("checked",("_blank"==d.dom.getAttrib(g,"target")));b.submit.val(wpLinkL10n.update)}else{wpLink.setDefaultValues()}tinyMCEPopup.storeSelection()},close:function(){if(wpLink.isMCE()){tinyMCEPopup.close()}else{b.dialog.wpdialog("close")}},onClose:function(){if(!wpLink.isMCE()){wpLink.textarea.focus();if(wpLink.range){wpLink.range.moveToBookmark(wpLink.range.getBookmark());wpLink.range.select()}}},getAttrs:function(){return{href:b.url.val(),title:b.title.val(),target:b.openInNewTab.prop("checked")?"_blank":""}},update:function(){if(wpLink.isMCE()){wpLink.mceUpdate()}else{wpLink.htmlUpdate()}},htmlUpdate:function(){var i,j,k,h,l,g=wpLink.textarea;if(!g){return}i=wpLink.getAttrs();if(!i.href||i.href=="http://"){return}j='<a href="'+i.href+'"';if(i.title){j+=' title="'+i.title+'"'}if(i.target){j+=' target="'+i.target+'"'}j+=">";if(document.selection&&wpLink.range){g.focus();wpLink.range.text=j+wpLink.range.text+"</a>";wpLink.range.moveToBookmark(wpLink.range.getBookmark());wpLink.range.select();wpLink.range=null}else{if(typeof g.selectionStart!=="undefined"){k=g.selectionStart;h=g.selectionEnd;selection=g.value.substring(k,h);j=j+selection+"</a>";l=k+j.length;if(k==h){l-="</a>".length}g.value=g.value.substring(0,k)+j+g.value.substring(h,g.value.length);g.selectionStart=g.selectionEnd=l}}wpLink.close();g.focus()},mceUpdate:function(){var h=tinyMCEPopup.editor,i=wpLink.getAttrs(),j,g;tinyMCEPopup.restoreSelection();j=h.dom.getParent(h.selection.getNode(),"A");if(!i.href||i.href=="http://"){if(j){tinyMCEPopup.execCommand("mceBeginUndoLevel");g=h.selection.getBookmark();h.dom.remove(j,1);h.selection.moveToBookmark(g);tinyMCEPopup.execCommand("mceEndUndoLevel");wpLink.close()}return}tinyMCEPopup.execCommand("mceBeginUndoLevel");if(j==null){h.getDoc().execCommand("unlink",false,null);tinyMCEPopup.execCommand("mceInsertLink",false,"#mce_temp_url#",{skip_undo:1});tinymce.each(h.dom.select("a"),function(k){if(h.dom.getAttrib(k,"href")=="#mce_temp_url#"){j=k;h.dom.setAttribs(j,i)}});if(f(j).text()=="#mce_temp_url#"){h.dom.remove(j);j=null}}else{h.dom.setAttribs(j,i)}if(j&&(j.childNodes.length!=1||j.firstChild.nodeName!="IMG")){h.focus();h.selection.select(j);h.selection.collapse(0);tinyMCEPopup.storeSelection()}tinyMCEPopup.execCommand("mceEndUndoLevel");wpLink.close()},updateFields:function(i,h,g){b.url.val(h.children(".item-permalink").val());b.title.val(h.hasClass("no-title")?"":h.children(".item-title").text());if(g&&g.type=="click"){b.url.focus()}},setDefaultValues:function(){b.url.val("http://");b.title.val("");b.submit.val(wpLinkL10n.save)},searchInternalLinks:function(){var h=f(this),i,g=h.val();if(g.length>2){e.recent.hide();e.search.show();if(wpLink.lastSearch==g){return}wpLink.lastSearch=g;i=h.parent().find(".spinner").show();e.search.change(g);e.search.ajax(function(){i.hide()})}else{e.search.hide();e.recent.show()}},next:function(){e.search.next();e.recent.next()},prev:function(){e.search.prev();e.recent.prev()},keydown:function(i){var h,g=f.ui.keyCode;switch(i.which){case g.UP:h="prev";case g.DOWN:h=h||"next";clearInterval(wpLink.keyInterval);wpLink[h]();wpLink.keyInterval=setInterval(wpLink[h],wpLink.keySensitivity);break;default:return}i.preventDefault()},keyup:function(h){var g=f.ui.keyCode;switch(h.which){case g.ESCAPE:h.stopImmediatePropagation();if(!f(document).triggerHandler("wp_CloseOnEscape",[{event:h,what:"wplink",cb:wpLink.close}])){wpLink.close()}return false;break;case g.UP:case g.DOWN:clearInterval(wpLink.keyInterval);break;default:return}h.preventDefault()},delayedCallback:function(i,g){var l,k,j,h;if(!g){return i}setTimeout(function(){if(k){return i.apply(h,j)}l=true},g);return function(){if(l){return i.apply(this,arguments)}j=arguments;h=this;k=true}},toggleInternalLinking:function(h){var g=f("#search-panel"),i=b.dialog.wpdialog("widget"),k=!g.is(":visible"),j=f(window);f(this).toggleClass("toggle-arrow-active",k);b.dialog.height("auto");g.slideToggle(300,function(){setUserSetting("wplink",k?"1":"0");b[k?"search":"url"].focus();var l=j.scrollTop(),o=i.offset().top,m=o+i.outerHeight(),n=m-j.height();if(n>l){i.animate({top:n<o?o-n:l},200)}});h.preventDefault()}};a=function(i,h){var g=this;this.element=i;this.ul=i.children("ul");this.waiting=i.find(".river-waiting");this.change(h);this.refresh();i.scroll(function(){g.maybeLoad()});i.delegate("li","click",function(j){g.select(f(this),j)})};f.extend(a.prototype,{refresh:function(){this.deselect();this.visible=this.element.is(":visible")},show:function(){if(!this.visible){this.deselect();this.element.show();this.visible=true}},hide:function(){this.element.hide();this.visible=false},select:function(h,k){var j,i,l,g;if(h.hasClass("unselectable")||h==this.selected){return}this.deselect();this.selected=h.addClass("selected");j=h.outerHeight();i=this.element.height();l=h.position().top;g=this.element.scrollTop();if(l<0){this.element.scrollTop(g+l)}else{if(l+j>i){this.element.scrollTop(g+l-i+j)}}this.element.trigger("river-select",[h,k,this])},deselect:function(){if(this.selected){this.selected.removeClass("selected")}this.selected=false},prev:function(){if(!this.visible){return}var g;if(this.selected){g=this.selected.prev("li");if(g.length){this.select(g)}}},next:function(){if(!this.visible){return}var g=this.selected?this.selected.next("li"):f("li:not(.unselectable):first",this.element);if(g.length){this.select(g)}},ajax:function(j){var h=this,i=this.query.page==1?0:wpLink.minRiverAJAXDuration,g=wpLink.delayedCallback(function(k,l){h.process(k,l);if(j){j(k,l)}},i);this.query.ajax(g)},change:function(g){if(this.query&&this._search==g){return}this._search=g;this.query=new c(g);this.element.scrollTop(0)},process:function(h,l){var i="",j=true,g="",k=l.page==1;if(!h){if(k){i+='<li class="unselectable"><span class="item-title"><em>'+wpLinkL10n.noMatchesFound+"</em></span></li>"}}else{f.each(h,function(){g=j?"alternate":"";g+=this["title"]?"":" no-title";i+=g?'<li class="'+g+'">':"<li>";i+='<input type="hidden" class="item-permalink" value="'+this["permalink"]+'" />';i+='<span class="item-title">';i+=this["title"]?this["title"]:wpLinkL10n.noTitle;i+='</span><span class="item-info">'+this["info"]+"</span></li>";j=!j})}this.ul[k?"html":"append"](i)},maybeLoad:function(){var h=this,i=this.element,g=i.scrollTop()+i.height();if(!this.query.ready()||g<this.ul.height()-wpLink.riverBottomThreshold){return}setTimeout(function(){var j=i.scrollTop(),k=j+i.height();if(!h.query.ready()||k<h.ul.height()-wpLink.riverBottomThreshold){return}h.waiting.show();i.scrollTop(j+h.waiting.outerHeight());h.ajax(function(){h.waiting.hide()})},wpLink.timeToTriggerRiver)}});c=function(g){this.page=1;this.allLoaded=false;this.querying=false;this.search=g};f.extend(c.prototype,{ready:function(){return !(this.querying||this.allLoaded)},ajax:function(i){var g=this,h={action:"wp-link-ajax",page:this.page,_ajax_linking_nonce:b.nonce.val()};if(this.search){h.search=this.search}this.querying=true;f.post(ajaxurl,h,function(j){g.page++;g.querying=false;g.allLoaded=!j;i(j,h)},"json")}});f(document).ready(wpLink.init)})(jQuery);
\ No newline at end of file
index de76f45aae3b5d8d0f05f2eb573f52266d809190..f52f8ea2e4a659ebfd34bce15a004ce3c8f36446 100644 (file)
@@ -13,7 +13,7 @@
  * @uses apply_filters() Calls 'the_permalink' filter on the permalink string.
  */
 function the_permalink() {
-       echo apply_filters('the_permalink', get_permalink());
+       echo esc_url( apply_filters( 'the_permalink', get_permalink() ) );
 }
 
 /**
@@ -232,7 +232,7 @@ function post_permalink( $post_id = 0, $deprecated = '' ) {
  *
  * @since 1.5.0
  *
- * @param mixed $post Optional. Post ID or object.
+ * @param int|object $post Optional. Post ID or object.
  * @param bool $leavename Optional, defaults to false. Whether to keep page name.
  * @param bool $sample Optional, defaults to false. Is it a sample permalink.
  * @return string
@@ -256,7 +256,7 @@ function get_page_link( $post = false, $leavename = false, $sample = false ) {
  * @since 2.1.0
  * @access private
  *
- * @param mixed $post Optional. Post ID or object.
+ * @param int|object $post Optional. Post ID or object.
  * @param bool $leavename Optional. Leave name.
  * @param bool $sample Optional. Sample permalink.
  * @return string
@@ -291,7 +291,7 @@ function _get_page_link( $post = false, $leavename = false, $sample = false ) {
  *
  * @since 2.0.0
  *
- * @param mixed $post Optional. Post ID or object.
+ * @param int|object $post Optional. Post ID or object.
  * @param bool $leavename Optional. Leave name.
  * @return string
  */
@@ -301,9 +301,9 @@ function get_attachment_link( $post = null, $leavename = false ) {
        $link = false;
 
        $post = get_post( $post );
+       $parent = ( $post->post_parent > 0 && $post->post_parent != $post->ID ) ? get_post( $post->post_parent ) : false;
 
-       if ( $wp_rewrite->using_permalinks() && ( $post->post_parent > 0 ) && ( $post->post_parent != $post->ID ) ) {
-               $parent = get_post($post->post_parent);
+       if ( $wp_rewrite->using_permalinks() && $parent ) {
                if ( 'page' == $parent->post_type )
                        $parentlink = _get_page_link( $post->post_parent ); // Ignores page_on_front
                else
@@ -867,9 +867,10 @@ function get_post_type_archive_feed_link( $post_type, $feed = '' ) {
 
        if ( ! $link = get_post_type_archive_link( $post_type ) )
                return false;
+
        $post_type_obj = get_post_type_object( $post_type );
-       if ( $post_type_obj->rewrite['feeds'] && get_option( 'permalink_structure' ) ) {
-               $link = trailingslashit($link);
+       if ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) && $post_type_obj->rewrite['feeds'] ) {
+               $link = trailingslashit( $link );
                $link .= 'feed/';
                if ( $feed != $default_feed )
                        $link .= "$feed/";
@@ -896,7 +897,9 @@ function get_edit_post_link( $id = 0, $context = 'display' ) {
        if ( ! $post = get_post( $id ) )
                return;
 
-       if ( 'display' == $context )
+       if ( 'revision' === $post->post_type )
+               $action = '';
+       elseif ( 'display' == $context )
                $action = '&amp;action=edit';
        else
                $action = '&action=edit';
@@ -905,7 +908,7 @@ function get_edit_post_link( $id = 0, $context = 'display' ) {
        if ( !$post_type_object )
                return;
 
-       if ( !current_user_can( $post_type_object->cap->edit_post, $post->ID ) )
+       if ( !current_user_can( 'edit_post', $post->ID ) )
                return;
 
        return apply_filters( 'get_edit_post_link', admin_url( sprintf($post_type_object->_edit_link . $action, $post->ID) ), $post->ID, $context );
@@ -959,7 +962,7 @@ function get_delete_post_link( $id = 0, $deprecated = '', $force_delete = false
        if ( !$post_type_object )
                return;
 
-       if ( !current_user_can( $post_type_object->cap->delete_post, $post->ID ) )
+       if ( !current_user_can( 'delete_post', $post->ID ) )
                return;
 
        $action = ( $force_delete || !EMPTY_TRASH_DAYS ) ? 'delete' : 'trash';
@@ -1174,7 +1177,7 @@ function get_adjacent_post( $in_same_cat = false, $excluded_categories = '', $pr
        $where = apply_filters( "get_{$adjacent}_post_where", $wpdb->prepare("WHERE p.post_date $op %s AND p.post_type = %s AND p.post_status = 'publish' $posts_in_ex_cats_sql", $current_post_date, $post->post_type), $in_same_cat, $excluded_categories );
        $sort  = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1" );
 
-       $query = "SELECT p.id FROM $wpdb->posts AS p $join $where $sort";
+       $query = "SELECT p.ID FROM $wpdb->posts AS p $join $where $sort";
        $query_key = 'adjacent_post_' . md5($query);
        $result = wp_cache_get($query_key, 'counts');
        if ( false !== $result ) {
@@ -1217,16 +1220,15 @@ function get_adjacent_post_rel_link($title = '%title', $in_same_cat = false, $ex
        if ( empty($post) )
                return;
 
-       if ( empty($post->post_title) )
+       $post_title = the_title_attribute( array( 'echo' => false, 'post' => $post ) );
+
+       if ( empty( $post_title ) )
                $post_title = $previous ? __('Previous Post') : __('Next Post');
-       else
-               $post_title = $post->post_title;
 
        $date = mysql2date(get_option('date_format'), $post->post_date);
 
        $title = str_replace('%title', $post_title, $title);
        $title = str_replace('%date', $date, $title);
-       $title = apply_filters('the_title', $title, $post->ID);
 
        $link = $previous ? "<link rel='prev' title='" : "<link rel='next' title='";
        $link .= esc_attr( $title );
@@ -1449,13 +1451,13 @@ function get_pagenum_link($pagenum = 1, $escape = true ) {
                }
 
                $request = preg_replace( "|$wp_rewrite->pagination_base/\d+/?$|", '', $request);
-               $request = preg_replace( '|^index\.php|i', '', $request);
+               $request = preg_replace( '|^' . preg_quote( $wp_rewrite->index, '|' ) . '|i', '', $request);
                $request = ltrim($request, '/');
 
                $base = trailingslashit( get_bloginfo( 'url' ) );
 
                if ( $wp_rewrite->using_index_permalinks() && ( $pagenum > 1 || '' != $request ) )
-                       $base .= 'index.php/';
+                       $base .= $wp_rewrite->index . '/';
 
                if ( $pagenum > 1 ) {
                        $request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( $wp_rewrite->pagination_base . "/" . $pagenum, 'paged' );
@@ -1919,7 +1921,7 @@ function get_home_url( $blog_id = null, $path = '', $scheme = null ) {
 
        $url = set_url_scheme( $url, $scheme );
 
-       if ( ! empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false )
+       if ( $path && is_string( $path ) )
                $url .= '/' . ltrim( $path, '/' );
 
        return apply_filters( 'home_url', $url, $path, $orig_scheme, $blog_id );
@@ -1971,7 +1973,7 @@ function get_site_url( $blog_id = null, $path = '', $scheme = null ) {
 
        $url = set_url_scheme( $url, $scheme );
 
-       if ( ! empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false )
+       if ( $path && is_string( $path ) )
                $url .= '/' . ltrim( $path, '/' );
 
        return apply_filters( 'site_url', $url, $path, $scheme, $blog_id );
@@ -2005,7 +2007,7 @@ function admin_url( $path = '', $scheme = 'admin' ) {
 function get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' ) {
        $url = get_site_url($blog_id, 'wp-admin/', $scheme);
 
-       if ( !empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false )
+       if ( $path && is_string( $path ) )
                $url .= ltrim( $path, '/' );
 
        return apply_filters( 'admin_url', $url, $path, $blog_id );
@@ -2018,12 +2020,13 @@ function get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' ) {
  * @since 2.6.0
  *
  * @param string $path Optional. Path relative to the includes url.
+ * @param string $scheme Optional. Scheme to give the includes url context.
  * @return string Includes url link with optional path appended.
 */
-function includes_url($path = '') {
-       $url = site_url() . '/' . WPINC . '/';
+function includes_url( $path = '', $scheme = null ) {
+       $url = site_url( '/' . WPINC . '/', $scheme );
 
-       if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
+       if ( $path && is_string( $path ) )
                $url .= ltrim($path, '/');
 
        return apply_filters('includes_url', $url, $path);
@@ -2041,7 +2044,7 @@ function includes_url($path = '') {
 function content_url($path = '') {
        $url = set_url_scheme( WP_CONTENT_URL );
 
-       if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
+       if ( $path && is_string( $path ) )
                $url .= '/' . ltrim($path, '/');
 
        return apply_filters('content_url', $url, $path);
@@ -2080,7 +2083,7 @@ function plugins_url($path = '', $plugin = '') {
                        $url .= '/' . ltrim($folder, '/');
        }
 
-       if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
+       if ( $path && is_string( $path ) )
                $url .= '/' . ltrim($path, '/');
 
        return apply_filters('plugins_url', $url, $path, $plugin);
@@ -2111,7 +2114,7 @@ function network_site_url( $path = '', $scheme = null ) {
        else
                $url = set_url_scheme( 'http://' . $current_site->domain . $current_site->path, $scheme );
 
-       if ( ! empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false )
+       if ( $path && is_string( $path ) )
                $url .= ltrim( $path, '/' );
 
        return apply_filters( 'network_site_url', $url, $path, $scheme );
@@ -2147,7 +2150,7 @@ function network_home_url( $path = '', $scheme = null ) {
        else
                $url = set_url_scheme( 'http://' . $current_site->domain . $current_site->path, $scheme );
 
-       if ( ! empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false )
+       if ( $path && is_string( $path ) )
                $url .= ltrim( $path, '/' );
 
        return apply_filters( 'network_home_url', $url, $path, $orig_scheme);
@@ -2169,7 +2172,7 @@ function network_admin_url( $path = '', $scheme = 'admin' ) {
 
        $url = network_site_url('wp-admin/network/', $scheme);
 
-       if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
+       if ( $path && is_string( $path ) )
                $url .= ltrim($path, '/');
 
        return apply_filters('network_admin_url', $url, $path);
@@ -2188,7 +2191,7 @@ function network_admin_url( $path = '', $scheme = 'admin' ) {
 function user_admin_url( $path = '', $scheme = 'admin' ) {
        $url = network_site_url('wp-admin/user/', $scheme);
 
-       if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
+       if ( $path && is_string( $path ) )
                $url .= ltrim($path, '/');
 
        return apply_filters('user_admin_url', $url, $path);
index 1742af40d0e00ab95b5ab2ddaba8d64294a9515c..e1eb15e4bb4f6434c49b9553747dce4b62be03db 100644 (file)
@@ -27,7 +27,6 @@ function wp_unregister_GLOBALS() {
        $input = array_merge( $_GET, $_POST, $_COOKIE, $_SERVER, $_ENV, $_FILES, isset( $_SESSION ) && is_array( $_SESSION ) ? $_SESSION : array() );
        foreach ( $input as $k => $v )
                if ( !in_array( $k, $no_unset ) && isset( $GLOBALS[$k] ) ) {
-                       $GLOBALS[$k] = null;
                        unset( $GLOBALS[$k] );
                }
 }
@@ -254,17 +253,14 @@ function timer_stop( $display = 0, $precision = 3 ) { // if called like timer_st
  * When WP_DEBUG_LOG is true, errors will be logged to wp-content/debug.log.
  * WP_DEBUG_LOG defaults to false.
  *
+ * Errors are never displayed for XML-RPC requests.
+ *
  * @access private
  * @since 3.0.0
  */
 function wp_debug_mode() {
        if ( WP_DEBUG ) {
-               // E_DEPRECATED is a core PHP constant in PHP 5.3. Don't define this yourself.
-               // The two statements are equivalent, just one is for 5.3+ and for less than 5.3.
-               if ( defined( 'E_DEPRECATED' ) )
-                       error_reporting( E_ALL & ~E_DEPRECATED & ~E_STRICT );
-               else
-                       error_reporting( E_ALL );
+               error_reporting( E_ALL );
 
                if ( WP_DEBUG_DISPLAY )
                        ini_set( 'display_errors', 1 );
@@ -278,6 +274,8 @@ function wp_debug_mode() {
        } else {
                error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
        }
+       if ( defined( 'XMLRPC_REQUEST' ) )
+               ini_set( 'display_errors', 0 );
 }
 
 /**
@@ -514,7 +512,8 @@ function wp_get_active_and_valid_plugins() {
  */
 function wp_set_internal_encoding() {
        if ( function_exists( 'mb_internal_encoding' ) ) {
-               if ( !@mb_internal_encoding( get_option( 'blog_charset' ) ) )
+               $charset = get_option( 'blog_charset' );
+               if ( ! $charset || ! @mb_internal_encoding( $charset ) )
                        mb_internal_encoding( 'UTF-8' );
        }
 }
index bc5037c723df936a570be9b0929bcf1e9f328e46..244d08a6576456d516a9781dc4676c5a9e18ddc8 100644 (file)
@@ -327,6 +327,21 @@ class WP_Locale {
        function is_rtl() {
                return 'rtl' == $this->text_direction;
        }
+
+       /**
+        * Private, unused function to add some date/time formats translated
+        * on wp-admin/options-general.php to the general POT.
+        *
+        * @since 3.6.0
+        */
+       function _strings_for_pot() {
+               /* translators: localized date format, see http://php.net/date */
+               __( 'F j, Y' );
+               /* translators: localized time format, see http://php.net/date */
+               __( 'g:i a' );
+               /* translators: localized date and time format, see http://php.net/date */
+               __( 'F j, Y g:i a' );
+       }
 }
 
 /**
index d4840903de9fcc8b8c1bea00b7227a2c51c57202..6af7dc5f324448414456a2ef63854efda378fb7c 100644 (file)
@@ -48,7 +48,7 @@ function wp_print_media_templates() {
                        <h3 class="upload-message">{{ data.message }}</h3>
                <# } #>
                <?php if ( ! _device_can_upload() ) : ?>
-                       <h3 class="upload-instructions"><?php _e('The web browser on your device cannot be used to upload files. You may be able to use the <a href="http://wordpress.org/extend/mobile/">native app for your device</a> instead.'); ?></h3>
+                       <h3 class="upload-instructions"><?php printf( __('The web browser on your device cannot be used to upload files. You may be able to use the <a href="%s">native app for your device</a> instead.'), 'http://wordpress.org/mobile/' ); ?></h3>
                <?php elseif ( is_multisite() && ! is_upload_space_available() ) : ?>
                        <h3 class="upload-instructions"><?php _e( 'Upload Limit Exceeded' ); ?></h3>
                        <?php do_action( 'upload_ui_over_quota' ); ?>
@@ -205,6 +205,10 @@ function wp_print_media_templates() {
                                        <# } #>
                                <# } #>
 
+                               <# if ( data.fileLength ) { #>
+                                       <div class="file-length"><?php _e( 'Length:' ); ?> {{ data.fileLength }}</div>
+                               <# } #>
+
                                <# if ( ! data.uploading && data.can.remove ) { #>
                                        <a class="delete-attachment" href="#"><?php _e( 'Delete Permanently' ); ?></a>
                                <# } #>
@@ -281,25 +285,47 @@ function wp_print_media_templates() {
 
                <div class="setting">
                        <label>
-                               <span><?php _e('Link To'); ?></span>
+                               <# if ( data.model.canEmbed ) { #>
+                                       <span><?php _e('Embed or Link'); ?></span>
+                               <# } else { #>
+                                       <span><?php _e('Link To'); ?></span>
+                               <# } #>
+
                                <select class="link-to"
                                        data-setting="link"
-                                       <# if ( data.userSettings ) { #>
+                                       <# if ( data.userSettings && ! data.model.canEmbed ) { #>
                                                data-user-setting="urlbutton"
                                        <# } #>>
 
-                                       <option value="custom">
-                                               <?php esc_attr_e('Custom URL'); ?>
+                               <# if ( data.model.canEmbed ) { #>
+                                       <option value="embed" selected>
+                                               <?php esc_attr_e('Embed Media Player'); ?>
                                        </option>
+                                       <option value="file">
+                               <# } else { #>
                                        <option value="file" selected>
+                               <# } #>
+                                       <# if ( data.model.canEmbed ) { #>
+                                               <?php esc_attr_e('Link to Media File'); ?>
+                                       <# } else { #>
                                                <?php esc_attr_e('Media File'); ?>
+                                       <# } #>
                                        </option>
                                        <option value="post">
+                                       <# if ( data.model.canEmbed ) { #>
+                                               <?php esc_attr_e('Link to Attachment Page'); ?>
+                                       <# } else { #>
                                                <?php esc_attr_e('Attachment Page'); ?>
+                                       <# } #>
+                                       </option>
+                               <# if ( 'image' === data.type ) { #>
+                                       <option value="custom">
+                                               <?php esc_attr_e('Custom URL'); ?>
                                        </option>
                                        <option value="none">
                                                <?php esc_attr_e('None'); ?>
                                        </option>
+                               <# } #>
                                </select>
                        </label>
                        <input type="text" class="link-to-custom" data-setting="linkUrl" />
@@ -353,6 +379,9 @@ function wp_print_media_templates() {
                                <option value="file">
                                        <?php esc_attr_e('Media File'); ?>
                                </option>
+                               <option value="none">
+                                       <?php esc_attr_e('None'); ?>
+                               </option>
                        </select>
                </label>
 
index d664e0735cdc38f8a62d62367e333ef850cb3d27..6111f363707af0ebe44a2af21ea1269af806e492 100644 (file)
@@ -138,16 +138,16 @@ function image_downsize($id, $size = 'medium') {
        if ( !wp_attachment_is_image($id) )
                return false;
 
+       // plugins can use this to provide resize services
+       if ( $out = apply_filters( 'image_downsize', false, $id, $size ) )
+               return $out;
+
        $img_url = wp_get_attachment_url($id);
        $meta = wp_get_attachment_metadata($id);
        $width = $height = 0;
        $is_intermediate = false;
        $img_url_basename = wp_basename($img_url);
 
-       // plugins can use this to provide resize services
-       if ( $out = apply_filters('image_downsize', false, $id, $size) )
-               return $out;
-
        // try for a new style intermediate size
        if ( $intermediate = image_get_intermediate_size($id, $size) ) {
                $img_url = str_replace($img_url_basename, $intermediate['file'], $img_url);
@@ -164,7 +164,7 @@ function image_downsize($id, $size = 'medium') {
                        $is_intermediate = true;
                }
        }
-       if ( !$width && !$height && isset($meta['width'], $meta['height']) ) {
+       if ( !$width && !$height && isset( $meta['width'], $meta['height'] ) ) {
                // any other type: use the real image
                $width = $meta['width'];
                $height = $meta['height'];
@@ -539,6 +539,7 @@ function wp_get_attachment_image_src($attachment_id, $size='thumbnail', $icon =
  * @param int $attachment_id Image attachment ID.
  * @param string $size Optional, default is 'thumbnail'.
  * @param bool $icon Optional, default is false. Whether it is an icon.
+ * @param mixed $attr Optional, attributes for the image markup.
  * @return string HTML img element or empty string on failure.
  */
 function wp_get_attachment_image($attachment_id, $size = 'thumbnail', $icon = false, $attr = '') {
@@ -644,7 +645,7 @@ function img_caption_shortcode($attr, $content = null) {
                'align' => 'alignnone',
                'width' => '',
                'caption' => ''
-       ), $attr));
+       ), $attr, 'caption'));
 
        if ( 1 > (int) $width || empty($caption) )
                return $content;
@@ -696,7 +697,7 @@ function gallery_shortcode($attr) {
        extract(shortcode_atts(array(
                'order'      => 'ASC',
                'orderby'    => 'menu_order ID',
-               'id'         => $post->ID,
+               'id'         => $post ? $post->ID : 0,
                'itemtag'    => 'dl',
                'icontag'    => 'dt',
                'captiontag' => 'dd',
@@ -704,7 +705,7 @@ function gallery_shortcode($attr) {
                'size'       => 'thumbnail',
                'include'    => '',
                'exclude'    => ''
-       ), $attr));
+       ), $attr, 'gallery'));
 
        $id = intval($id);
        if ( 'RAND' == $order )
@@ -769,20 +770,31 @@ function gallery_shortcode($attr) {
                        #{$selector} .gallery-caption {
                                margin-left: 0;
                        }
-               </style>
-               <!-- see gallery_shortcode() in wp-includes/media.php -->";
+                       /* see gallery_shortcode() in wp-includes/media.php */
+               </style>";
        $size_class = sanitize_html_class( $size );
        $gallery_div = "<div id='$selector' class='gallery galleryid-{$id} gallery-columns-{$columns} gallery-size-{$size_class}'>";
        $output = apply_filters( 'gallery_style', $gallery_style . "\n\t\t" . $gallery_div );
 
        $i = 0;
        foreach ( $attachments as $id => $attachment ) {
-               $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false);
+               if ( ! empty( $attr['link'] ) && 'file' === $attr['link'] )
+                       $image_output = wp_get_attachment_link( $id, $size, false, false );
+               elseif ( ! empty( $attr['link'] ) && 'none' === $attr['link'] )
+                       $image_output = wp_get_attachment_image( $id, $size, false );
+               else
+                       $image_output = wp_get_attachment_link( $id, $size, true, false );
+
+               $image_meta  = wp_get_attachment_metadata( $id );
+
+               $orientation = '';
+               if ( isset( $image_meta['height'], $image_meta['width'] ) )
+                       $orientation = ( $image_meta['height'] > $image_meta['width'] ) ? 'portrait' : 'landscape';
 
                $output .= "<{$itemtag} class='gallery-item'>";
                $output .= "
-                       <{$icontag} class='gallery-icon'>
-                               $link
+                       <{$icontag} class='gallery-icon {$orientation}'>
+                               $image_output
                        </{$icontag}>";
                if ( $captiontag && trim($attachment->post_excerpt) ) {
                        $output .= "
@@ -802,6 +814,284 @@ function gallery_shortcode($attr) {
        return $output;
 }
 
+/**
+ * Provide a No-JS Flash fallback as a last resort for audio / video
+ *
+ * @since 3.6.0
+ *
+ * @param string $url
+ * @return string Fallback HTML
+ */
+function wp_mediaelement_fallback( $url ) {
+       return apply_filters( 'wp_mediaelement_fallback', sprintf( '<a href="%1$s">%1$s</a>', esc_url( $url ) ), $url );
+}
+
+/**
+ * Return a filtered list of WP-supported audio formats
+ *
+ * @since 3.6.0
+ * @return array
+ */
+function wp_get_audio_extensions() {
+       return apply_filters( 'wp_audio_extensions', array( 'mp3', 'ogg', 'wma', 'm4a', 'wav' ) );
+}
+
+/**
+ * The Audio shortcode.
+ *
+ * This implements the functionality of the Audio Shortcode for displaying
+ * WordPress mp3s in a post.
+ *
+ * @since 3.6.0
+ *
+ * @param array $attr Attributes of the shortcode.
+ * @return string HTML content to display audio.
+ */
+function wp_audio_shortcode( $attr ) {
+       $post_id = get_post() ? get_the_ID() : 0;
+
+       static $instances = 0;
+       $instances++;
+
+       $audio = null;
+
+       $default_types = wp_get_audio_extensions();
+       $defaults_atts = array(
+               'src'      => '',
+               'loop'     => '',
+               'autoplay' => '',
+               'preload'  => 'none'
+       );
+       foreach ( $default_types as $type )
+               $defaults_atts[$type] = '';
+
+       $atts = shortcode_atts( $defaults_atts, $attr, 'audio' );
+       extract( $atts );
+
+       $primary = false;
+       if ( ! empty( $src ) ) {
+               $type = wp_check_filetype( $src, wp_get_mime_types() );
+               if ( ! in_array( $type['ext'], $default_types ) )
+                       return sprintf( '<a class="wp-embedded-audio" href="%s">%s</a>', esc_url( $src ), esc_html( $src ) );
+               $primary = true;
+               array_unshift( $default_types, 'src' );
+       } else {
+               foreach ( $default_types as $ext ) {
+                       if ( ! empty( $$ext ) ) {
+                               $type = wp_check_filetype( $$ext, wp_get_mime_types() );
+                               if ( $type['ext'] === $ext )
+                                       $primary = true;
+                       }
+               }
+       }
+
+       if ( ! $primary ) {
+               $audios = get_attached_media( 'audio', $post_id );
+               if ( empty( $audios ) )
+                       return;
+
+               $audio = reset( $audios );
+               $src = wp_get_attachment_url( $audio->ID );
+               if ( empty( $src ) )
+                       return;
+
+               array_unshift( $default_types, 'src' );
+       }
+
+       $library = apply_filters( 'wp_audio_shortcode_library', 'mediaelement' );
+       if ( 'mediaelement' === $library && did_action( 'init' ) ) {
+               wp_enqueue_style( 'wp-mediaelement' );
+               wp_enqueue_script( 'wp-mediaelement' );
+       }
+
+       $atts = array(
+               'class'    => apply_filters( 'wp_audio_shortcode_class', 'wp-audio-shortcode' ),
+               'id'       => sprintf( 'audio-%d-%d', $post_id, $instances ),
+               'loop'     => $loop,
+               'autoplay' => $autoplay,
+               'preload'  => $preload,
+               'style'    => 'width: 100%',
+       );
+
+       // These ones should just be omitted altogether if they are blank
+       foreach ( array( 'loop', 'autoplay', 'preload' ) as $a ) {
+               if ( empty( $atts[$a] ) )
+                       unset( $atts[$a] );
+       }
+
+       $attr_strings = array();
+       foreach ( $atts as $k => $v ) {
+               $attr_strings[] = $k . '="' . esc_attr( $v ) . '"';
+       }
+
+       $html = '';
+       if ( 'mediaelement' === $library && 1 === $instances )
+               $html .= "<!--[if lt IE 9]><script>document.createElement('audio');</script><![endif]-->\n";
+       $html .= sprintf( '<audio %s controls="controls">', join( ' ', $attr_strings ) );
+
+       $fileurl = '';
+       $source = '<source type="%s" src="%s" />';
+       foreach ( $default_types as $fallback ) {
+               if ( ! empty( $$fallback ) ) {
+                       if ( empty( $fileurl ) )
+                               $fileurl = $$fallback;
+                       $type = wp_check_filetype( $$fallback, wp_get_mime_types() );
+                       $html .= sprintf( $source, $type['type'], esc_url( $$fallback ) );
+               }
+       }
+
+       if ( 'mediaelement' === $library )
+               $html .= wp_mediaelement_fallback( $fileurl );
+       $html .= '</audio>';
+
+       return apply_filters( 'wp_audio_shortcode', $html, $atts, $audio, $post_id, $library );
+}
+add_shortcode( 'audio', apply_filters( 'wp_audio_shortcode_handler', 'wp_audio_shortcode' ) );
+
+/**
+ * Return a filtered list of WP-supported video formats
+ *
+ * @since 3.6.0
+ * @return array
+ */
+function wp_get_video_extensions() {
+       return apply_filters( 'wp_video_extensions', array( 'mp4', 'm4v', 'webm', 'ogv', 'wmv', 'flv' ) );
+}
+
+/**
+ * The Video shortcode.
+ *
+ * This implements the functionality of the Video Shortcode for displaying
+ * WordPress mp4s in a post.
+ *
+ * @since 3.6.0
+ *
+ * @param array $attr Attributes of the shortcode.
+ * @return string HTML content to display video.
+ */
+function wp_video_shortcode( $attr ) {
+       global $content_width;
+       $post_id = get_post() ? get_the_ID() : 0;
+
+       static $instances = 0;
+       $instances++;
+
+       $video = null;
+
+       $default_types = wp_get_video_extensions();
+       $defaults_atts = array(
+               'src'      => '',
+               'poster'   => '',
+               'loop'     => '',
+               'autoplay' => '',
+               'preload'  => 'metadata',
+               'height'   => 360,
+               'width'    => empty( $content_width ) ? 640 : $content_width,
+       );
+
+       foreach ( $default_types as $type )
+               $defaults_atts[$type] = '';
+
+       $atts = shortcode_atts( $defaults_atts, $attr, 'video' );
+       extract( $atts );
+
+       $w = $width;
+       $h = $height;
+       if ( is_admin() && $width > 600 )
+               $w = 600;
+       elseif ( ! is_admin() && $w > $defaults_atts['width'] )
+               $w = $defaults_atts['width'];
+
+       if ( $w < $width )
+               $height = round( ( $h * $w ) / $width );
+
+       $width = $w;
+
+       $primary = false;
+       if ( ! empty( $src ) ) {
+               $type = wp_check_filetype( $src, wp_get_mime_types() );
+               if ( ! in_array( $type['ext'], $default_types ) )
+                       return sprintf( '<a class="wp-embedded-video" href="%s">%s</a>', esc_url( $src ), esc_html( $src ) );
+               $primary = true;
+               array_unshift( $default_types, 'src' );
+       } else {
+               foreach ( $default_types as $ext ) {
+                       if ( ! empty( $$ext ) ) {
+                               $type = wp_check_filetype( $$ext, wp_get_mime_types() );
+                               if ( $type['ext'] === $ext )
+                                       $primary = true;
+                       }
+               }
+       }
+
+       if ( ! $primary ) {
+               $videos = get_attached_media( 'video', $post_id );
+               if ( empty( $videos ) )
+                       return;
+
+               $video = reset( $videos );
+               $src = wp_get_attachment_url( $video->ID );
+               if ( empty( $src ) )
+                       return;
+
+               array_unshift( $default_types, 'src' );
+       }
+
+       $library = apply_filters( 'wp_video_shortcode_library', 'mediaelement' );
+       if ( 'mediaelement' === $library && did_action( 'init' ) ) {
+               wp_enqueue_style( 'wp-mediaelement' );
+               wp_enqueue_script( 'wp-mediaelement' );
+       }
+
+       $atts = array(
+               'class'    => apply_filters( 'wp_video_shortcode_class', 'wp-video-shortcode' ),
+               'id'       => sprintf( 'video-%d-%d', $post_id, $instances ),
+               'width'    => absint( $width ),
+               'height'   => absint( $height ),
+               'poster'   => esc_url( $poster ),
+               'loop'     => $loop,
+               'autoplay' => $autoplay,
+               'preload'  => $preload,
+       );
+
+       // These ones should just be omitted altogether if they are blank
+       foreach ( array( 'poster', 'loop', 'autoplay', 'preload' ) as $a ) {
+               if ( empty( $atts[$a] ) )
+                       unset( $atts[$a] );
+       }
+
+       $attr_strings = array();
+       foreach ( $atts as $k => $v ) {
+               $attr_strings[] = $k . '="' . esc_attr( $v ) . '"';
+       }
+
+       $html = '';
+       if ( 'mediaelement' === $library && 1 === $instances )
+               $html .= "<!--[if lt IE 9]><script>document.createElement('video');</script><![endif]-->\n";
+       $html .= sprintf( '<video %s controls="controls">', join( ' ', $attr_strings ) );
+
+       $fileurl = '';
+       $source = '<source type="%s" src="%s" />';
+       foreach ( $default_types as $fallback ) {
+               if ( ! empty( $$fallback ) ) {
+                       if ( empty( $fileurl ) )
+                               $fileurl = $$fallback;
+                       $type = wp_check_filetype( $$fallback, wp_get_mime_types() );
+                       // m4v sometimes shows up as video/mpeg which collides with mp4
+                       if ( 'm4v' === $type['ext'] )
+                               $type['type'] = 'video/m4v';
+                       $html .= sprintf( $source, $type['type'], esc_url( $$fallback ) );
+               }
+       }
+       if ( 'mediaelement' === $library )
+               $html .= wp_mediaelement_fallback( $fileurl );
+       $html .= '</video>';
+
+       $html = sprintf( '<div style="width: %dpx; max-width: 100%%;">%s</div>', $width, $html );
+       return apply_filters( 'wp_video_shortcode', $html, $atts, $video, $post_id, $library );
+}
+add_shortcode( 'video', apply_filters( 'wp_video_shortcode_handler', 'wp_video_shortcode' ) );
+
 /**
  * Display previous image link that has the same post parent.
  *
@@ -1051,7 +1341,7 @@ function wp_oembed_add_provider( $format, $provider, $regex = false ) {
 /**
  * Removes an oEmbed provider.
  *
- * @since 3.5
+ * @since 3.5.0
  * @see WP_oEmbed
  *
  * @uses _wp_oembed_get_object()
@@ -1083,6 +1373,8 @@ function wp_maybe_load_embeds() {
        if ( ! apply_filters( 'load_default_embeds', true ) )
                return;
        wp_embed_register_handler( 'googlevideo', '#http://video\.google\.([A-Za-z.]{2,5})/videoplay\?docid=([\d-]+)(.*?)#i', 'wp_embed_handler_googlevideo' );
+       wp_embed_register_handler( 'audio', '#^https?://.+?\.(' . join( '|', wp_get_audio_extensions() ) . ')$#i', apply_filters( 'wp_audio_embed_handler', 'wp_embed_handler_audio' ), 9999 );
+       wp_embed_register_handler( 'video', '#^https?://.+?\.(' . join( '|', wp_get_video_extensions() ) . ')$#i', apply_filters( 'wp_video_embed_handler', 'wp_embed_handler_video' ), 9999 );
 }
 
 /**
@@ -1110,12 +1402,49 @@ function wp_embed_handler_googlevideo( $matches, $attr, $url, $rawattr ) {
 }
 
 /**
- * {@internal Missing Short Description}}
+ * Audio embed handler callback.
+ *
+ * @since 3.6.0
+ *
+ * @param array $matches The regex matches from the provided regex when calling {@link wp_embed_register_handler()}.
+ * @param array $attr Embed attributes.
+ * @param string $url The original URL that was matched by the regex.
+ * @param array $rawattr The original unmodified attributes.
+ * @return string The embed HTML.
+ */
+function wp_embed_handler_audio( $matches, $attr, $url, $rawattr ) {
+       $audio = sprintf( '[audio src="%s" /]', esc_url( $url ) );
+       return apply_filters( 'wp_embed_handler_audio', $audio, $attr, $url, $rawattr );
+}
+
+/**
+ * Video embed handler callback.
+ *
+ * @since 3.6.0
+ *
+ * @param array $matches The regex matches from the provided regex when calling {@link wp_embed_register_handler()}.
+ * @param array $attr Embed attributes.
+ * @param string $url The original URL that was matched by the regex.
+ * @param array $rawattr The original unmodified attributes.
+ * @return string The embed HTML.
+ */
+function wp_embed_handler_video( $matches, $attr, $url, $rawattr ) {
+       $dimensions = '';
+       if ( ! empty( $rawattr['width'] ) && ! empty( $rawattr['height'] ) ) {
+               $dimensions .= sprintf( 'width="%d" ', (int) $rawattr['width'] );
+               $dimensions .= sprintf( 'height="%d" ', (int) $rawattr['height'] );
+       }
+       $video = sprintf( '[video %s src="%s" /]', $dimensions, esc_url( $url ) );
+       return apply_filters( 'wp_embed_handler_video', $video, $attr, $url, $rawattr );
+}
+
+/**
+ * Converts a shorthand byte value to an integer byte value.
  *
  * @since 2.3.0
  *
- * @param unknown_type $size
- * @return unknown
+ * @param string $size A shorthand byte value.
+ * @return int An integer byte value.
  */
 function wp_convert_hr_to_bytes( $size ) {
        $size  = strtolower( $size );
@@ -1130,27 +1459,11 @@ function wp_convert_hr_to_bytes( $size ) {
 }
 
 /**
- * {@internal Missing Short Description}}
- *
- * @since 2.3.0
- *
- * @param unknown_type $bytes
- * @return unknown
- */
-function wp_convert_bytes_to_hr( $bytes ) {
-       $units = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB' );
-       $log   = log( $bytes, 1024 );
-       $power = (int) $log;
-       $size  = pow( 1024, $log - $power );
-       return $size . $units[$power];
-}
-
-/**
- * {@internal Missing Short Description}}
+ * Determine the maximum upload size allowed in php.ini.
  *
  * @since 2.5.0
  *
- * @return unknown
+ * @return int Allowed upload size.
  */
 function wp_max_upload_size() {
        $u_bytes = wp_convert_hr_to_bytes( ini_get( 'upload_max_filesize' ) );
@@ -1173,7 +1486,7 @@ function wp_get_image_editor( $path, $args = array() ) {
        $args['path'] = $path;
 
        if ( ! isset( $args['mime_type'] ) ) {
-               $file_info  = wp_check_filetype( $args['path'] );
+               $file_info = wp_check_filetype( $args['path'] );
 
                // If $file_info['type'] is false, then we let the editor attempt to
                // figure out the file type, rather than forcing a failure based on extension.
@@ -1202,7 +1515,7 @@ function wp_get_image_editor( $path, $args = array() ) {
  * @since 3.5.0
  * @access public
  *
- * @param string|array $args Array of requirements.  Accepts { 'mime_type'=>string, 'methods'=>{string, string, ...} }
+ * @param string|array $args Array of requirements. Accepts { 'mime_type'=>string, 'methods'=>{string, string, ...} }
  * @return boolean true if an eligible editor is found; false otherwise
  */
 function wp_image_editor_supports( $args = array() ) {
@@ -1335,7 +1648,7 @@ function wp_prepare_attachment_for_js( $attachment ) {
        $response = array(
                'id'          => $attachment->ID,
                'title'       => $attachment->post_title,
-               'filename'    => basename( $attachment->guid ),
+               'filename'    => wp_basename( $attachment->guid ),
                'url'         => $attachment_url,
                'link'        => get_attachment_link( $attachment->ID ),
                'alt'         => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ),
@@ -1412,14 +1725,25 @@ function wp_prepare_attachment_for_js( $attachment ) {
                        }
                }
 
-               $sizes['full'] = array(
-                       'height'      => $meta['height'],
-                       'width'       => $meta['width'],
-                       'url'         => $attachment_url,
-                       'orientation' => $meta['height'] > $meta['width'] ? 'portrait' : 'landscape',
-               );
+               $sizes['full'] = array( 'url' => $attachment_url );
+
+               if ( isset( $meta['height'], $meta['width'] ) ) {
+                       $sizes['full']['height'] = $meta['height'];
+                       $sizes['full']['width'] = $meta['width'];
+                       $sizes['full']['orientation'] = $meta['height'] > $meta['width'] ? 'portrait' : 'landscape';
+               }
 
                $response = array_merge( $response, array( 'sizes' => $sizes ), $sizes['full'] );
+       } elseif ( $meta && 'video' === $type ) {
+               if ( isset( $meta['width'] ) )
+                       $response['width'] = (int) $meta['width'];
+               if ( isset( $meta['height'] ) )
+                       $response['height'] = (int) $meta['height'];
+       }
+
+       if ( $meta && ( 'audio' === $type || 'video' === $type ) ) {
+               if ( isset( $meta['length_formatted'] ) )
+                       $response['fileLength'] = $meta['length_formatted'];
        }
 
        if ( function_exists('get_compat_media_markup') )
@@ -1476,6 +1800,7 @@ function wp_enqueue_media( $args = array() ) {
                        'id' => 0,
                ),
                'defaultProps' => $props,
+               'embedExts'    => array_merge( wp_get_audio_extensions(), wp_get_video_extensions() ),
        );
 
        $post = null;
@@ -1558,3 +1883,147 @@ function wp_enqueue_media( $args = array() ) {
 
        do_action( 'wp_enqueue_media' );
 }
+
+/**
+ * Retrieve media attached to the passed post
+ *
+ * @since 3.6.0
+ *
+ * @param string $type (Mime) type of media desired
+ * @param mixed $post Post ID or object
+ * @return array Found attachments
+ */
+function get_attached_media( $type, $post = 0 ) {
+       if ( ! $post = get_post( $post ) )
+               return array();
+
+       $args = array(
+               'post_parent' => $post->ID,
+               'post_type' => 'attachment',
+               'post_mime_type' => $type,
+               'posts_per_page' => -1,
+               'orderby' => 'menu_order',
+               'order' => 'ASC',
+       );
+
+       $args = apply_filters( 'get_attached_media_args', $args, $type, $post );
+
+       $children = get_children( $args );
+
+       return (array) apply_filters( 'get_attached_media', $children, $type, $post );
+}
+
+/**
+ * Check the content blob for an <audio>, <video> <object>, <embed>, or <iframe>
+ *
+ * @since 3.6.0
+ *
+ * @param string $content A string which might contain media data.
+ * @param array $types array of media types: 'audio', 'video', 'object', 'embed', or 'iframe'
+ * @return array A list of found HTML media embeds
+ */
+function get_media_embedded_in_content( $content, $types = null ) {
+       $html = array();
+       $allowed_media_types = array( 'audio', 'video', 'object', 'embed', 'iframe' );
+       if ( ! empty( $types ) ) {
+               if ( ! is_array( $types ) )
+                       $types = array( $types );
+               $allowed_media_types = array_intersect( $allowed_media_types, $types );
+       }
+
+       foreach ( $allowed_media_types as $tag ) {
+               if ( preg_match( '#' . get_tag_regex( $tag ) . '#', $content, $matches ) ) {
+                       $html[] = $matches[0];
+               }
+       }
+
+       return $html;
+}
+
+/**
+ * Retrieve galleries from the passed post's content
+ *
+ * @since 3.6.0
+ *
+ * @param mixed $post Optional. Post ID or object.
+ * @param boolean $html Whether to return HTML or data in the array
+ * @return array A list of arrays, each containing gallery data and srcs parsed
+ *             from the expanded shortcode
+ */
+function get_post_galleries( $post, $html = true ) {
+       if ( ! $post = get_post( $post ) )
+               return array();
+
+       if ( ! has_shortcode( $post->post_content, 'gallery' ) )
+               return array();
+
+       $galleries = array();
+       if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $post->post_content, $matches, PREG_SET_ORDER ) ) {
+               foreach ( $matches as $shortcode ) {
+                       if ( 'gallery' === $shortcode[2] ) {
+                               $srcs = array();
+                               $count = 1;
+
+                               $gallery = do_shortcode_tag( $shortcode );
+                               if ( $html ) {
+                                       $galleries[] = $gallery;
+                               } else {
+                                       preg_match_all( '#src=([\'"])(.+?)\1#is', $gallery, $src, PREG_SET_ORDER );
+                                       if ( ! empty( $src ) ) {
+                                               foreach ( $src as $s )
+                                                       $srcs[] = $s[2];
+                                       }
+
+                                       $data = shortcode_parse_atts( $shortcode[3] );
+                                       $data['src'] = array_values( array_unique( $srcs ) );
+                                       $galleries[] = $data;
+                               }
+                       }
+               }
+       }
+
+       return apply_filters( 'get_post_galleries', $galleries, $post );
+}
+
+/**
+ * Check a specified post's content for gallery and, if present, return the first
+ *
+ * @since 3.6.0
+ *
+ * @param mixed $post Optional. Post ID or object.
+ * @param boolean $html Whether to return HTML or data
+ * @return string|array Gallery data and srcs parsed from the expanded shortcode
+ */
+function get_post_gallery( $post = 0, $html = true ) {
+       $galleries = get_post_galleries( $post, $html );
+       $gallery = reset( $galleries );
+
+       return apply_filters( 'get_post_gallery', $gallery, $post, $galleries );
+}
+
+/**
+ * Retrieve the image srcs from galleries from a post's content, if present
+ *
+ * @since 3.6.0
+ *
+ * @param mixed $post Optional. Post ID or object.
+ * @return array A list of lists, each containing image srcs parsed
+ *             from an expanded shortcode
+ */
+function get_post_galleries_images( $post = 0 ) {
+       $galleries = get_post_galleries( $post, false );
+       return wp_list_pluck( $galleries, 'src' );
+}
+
+/**
+ * Check a post's content for galleries and return the image srcs for the first found gallery
+ *
+ * @since 3.6.0
+ *
+ * @param mixed $post Optional. Post ID or object.
+ * @return array A list of a gallery's image srcs in order
+ */
+function get_post_gallery_images( $post = 0 ) {
+       $gallery = get_post_gallery( $post, false );
+       return empty( $gallery['src'] ) ? array() : $gallery['src'];
+}
index 9db1de30cc036ad81917d2f5cbdf18a96a012f27..22b03157ae6a03c370be0cbaced75496728a7da1 100644 (file)
@@ -26,7 +26,7 @@
  * @param bool $unique Optional, default is false. Whether the specified metadata key should be
  *             unique for the object. If true, and the object already has a value for the specified
  *             metadata key, no change will be made
- * @return bool The meta ID on successful update, false on failure.
+ * @return int|bool The meta ID on successful update, false on failure.
  */
 function add_metadata($meta_type, $object_id, $meta_key, $meta_value, $unique = false) {
        if ( !$meta_type || !$meta_key )
@@ -40,11 +40,11 @@ function add_metadata($meta_type, $object_id, $meta_key, $meta_value, $unique =
 
        global $wpdb;
 
-       $column = esc_sql($meta_type . '_id');
+       $column = sanitize_key($meta_type . '_id');
 
        // expected_slashed ($meta_key)
-       $meta_key = stripslashes($meta_key);
-       $meta_value = stripslashes_deep($meta_value);
+       $meta_key = wp_unslash($meta_key);
+       $meta_value = wp_unslash($meta_value);
        $meta_value = sanitize_meta( $meta_key, $meta_value, $meta_type );
 
        $check = apply_filters( "add_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $unique );
@@ -110,13 +110,13 @@ function update_metadata($meta_type, $object_id, $meta_key, $meta_value, $prev_v
 
        global $wpdb;
 
-       $column = esc_sql($meta_type . '_id');
+       $column = sanitize_key($meta_type . '_id');
        $id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id';
 
        // expected_slashed ($meta_key)
-       $meta_key = stripslashes($meta_key);
+       $meta_key = wp_unslash($meta_key);
        $passed_value = $meta_value;
-       $meta_value = stripslashes_deep($meta_value);
+       $meta_value = wp_unslash($meta_value);
        $meta_value = sanitize_meta( $meta_key, $meta_value, $meta_type );
 
        $check = apply_filters( "update_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $prev_value );
@@ -193,11 +193,11 @@ function delete_metadata($meta_type, $object_id, $meta_key, $meta_value = '', $d
 
        global $wpdb;
 
-       $type_column = esc_sql($meta_type . '_id');
+       $type_column = sanitize_key($meta_type . '_id');
        $id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id';
        // expected_slashed ($meta_key)
-       $meta_key = stripslashes($meta_key);
-       $meta_value = stripslashes_deep($meta_value);
+       $meta_key = wp_unslash($meta_key);
+       $meta_value = wp_unslash($meta_value);
 
        $check = apply_filters( "delete_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $delete_all );
        if ( null !== $check )
@@ -397,7 +397,7 @@ function update_metadata_by_mid( $meta_type, $meta_id, $meta_value, $meta_key =
        if ( ! $table = _get_meta_table( $meta_type ) )
                return false;
 
-       $column = esc_sql($meta_type . '_id');
+       $column = sanitize_key($meta_type . '_id');
        $id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id';
 
        // Fetch the meta and go on if it's found.
@@ -478,7 +478,7 @@ function delete_metadata_by_mid( $meta_type, $meta_id ) {
                return false;
 
        // object and id columns
-       $column = esc_sql($meta_type . '_id');
+       $column = sanitize_key($meta_type . '_id');
        $id_column = 'user' == $meta_type ? 'umeta_id' : 'meta_id';
 
        // Fetch the meta and go on if it's found.
@@ -528,7 +528,7 @@ function update_meta_cache($meta_type, $object_ids) {
        if ( ! $table = _get_meta_table($meta_type) )
                return false;
 
-       $column = esc_sql($meta_type . '_id');
+       $column = sanitize_key($meta_type . '_id');
 
        global $wpdb;
 
@@ -678,7 +678,7 @@ class WP_Meta_Query {
                }
 
                // WP_Query sets 'meta_value' = '' by default
-               if ( isset( $qv[ 'meta_value' ] ) && '' !== $qv[ 'meta_value' ] )
+               if ( isset( $qv[ 'meta_value' ] ) && '' !== $qv[ 'meta_value' ] && ( ! is_array( $qv[ 'meta_value' ] ) || $qv[ 'meta_value' ] ) )
                        $meta_query[0]['value'] = $qv[ 'meta_value' ];
 
                if ( !empty( $qv['meta_query'] ) && is_array( $qv['meta_query'] ) ) {
@@ -706,7 +706,7 @@ class WP_Meta_Query {
                if ( ! $meta_table = _get_meta_table( $type ) )
                        return false;
 
-               $meta_id_column = esc_sql( $type . '_id' );
+               $meta_id_column = sanitize_key( $type . '_id' );
 
                $join = array();
                $where = array();
@@ -714,6 +714,14 @@ class WP_Meta_Query {
                $key_only_queries = array();
                $queries = array();
 
+               // Split out the queries with empty arrays as value
+               foreach ( $this->queries as $k => $q ) {
+                       if ( isset( $q['value'] ) && is_array( $q['value'] ) && empty( $q['value'] ) ) {
+                               $key_only_queries[$k] = $q;
+                               unset( $this->queries[$k] );
+                       }
+               }               
+               
                // Split out the meta_key only queries (we can only do this for OR)
                if ( 'OR' == $this->relation ) {
                        foreach ( $this->queries as $k => $q ) {
index a1f70a40bdbadedfdedf92529acec382d609fa4a..95ddedb7f11a5050eaa1acf9e5f08269e1ae3f57 100644 (file)
@@ -43,14 +43,12 @@ function get_blogaddress_by_id( $blog_id ) {
  * @return string
  */
 function get_blogaddress_by_name( $blogname ) {
-       global $current_site;
-
        if ( is_subdomain_install() ) {
                if ( $blogname == 'main' )
                        $blogname = 'www';
                $url = rtrim( network_home_url(), '/' );
                if ( !empty( $blogname ) )
-                       $url = preg_replace( '|^([^\.]+://)|', '$1' . $blogname . '.', $url );
+                       $url = preg_replace( '|^([^\.]+://)|', "\${1}" . $blogname . '.', $url );
        } else {
                $url = network_home_url( $blogname );
        }
@@ -84,7 +82,7 @@ function get_blogaddress_by_domain( $domain, $path ) {
 }
 
 /**
- * Given a blog's (subdomain or directory) slug, retrieve it's id.
+ * Given a blog's (subdomain or directory) slug, retrieve its id.
  *
  * @since MU
  *
@@ -254,6 +252,16 @@ function get_blog_details( $fields = null, $get_all = true ) {
 function refresh_blog_details( $blog_id ) {
        $blog_id = (int) $blog_id;
        $details = get_blog_details( $blog_id, false );
+       if ( ! $details ) {
+               // Make sure clean_blog_cache() gets the blog ID
+               // when the blog has been previously cached as
+               // non-existent.
+               $details = (object) array(
+                       'blog_id' => $blog_id,
+                       'domain' => null,
+                       'path' => null
+               );
+       }
 
        clean_blog_cache( $details );
 
@@ -461,7 +469,7 @@ function delete_blog_option( $id, $option ) {
  * @param int $id The blog id
  * @param string $option The option key
  * @param mixed $value The option value
- * @return bool True on success, false on failrue.
+ * @return bool True on success, false on failure.
  */
 function update_blog_option( $id, $option, $value, $deprecated = null ) {
        $id = (int) $id;
@@ -687,6 +695,8 @@ function update_blog_status( $blog_id, $pref, $value, $deprecated = null ) {
                ( $value == 1 ) ? do_action( 'archive_blog', $blog_id ) : do_action( 'unarchive_blog', $blog_id );
        elseif ( 'deleted' == $pref )
                ( $value == 1 ) ? do_action( 'make_delete_blog', $blog_id ) : do_action( 'make_undelete_blog', $blog_id );
+       elseif ( 'public' == $pref )
+               do_action( 'update_blog_public', $blog_id, $value ); // Moved here from update_blog_public().
 
        return $value;
 }
index 34dc151c4461cfe685c519a2b41c51555b8964f9..c4c223a4f781275a02b7e2cb9f9bdd486225b864 100644 (file)
@@ -63,4 +63,7 @@ remove_filter( 'option_siteurl', '_config_wp_siteurl' );
 remove_filter( 'option_home',    '_config_wp_home'    );
 
 // If the network upgrade hasn't run yet, assume ms-files.php rewriting is used.
-add_filter( 'default_site_option_ms_files_rewriting', '__return_true' );
\ No newline at end of file
+add_filter( 'default_site_option_ms_files_rewriting', '__return_true' );
+
+// Whitelist multisite domains for HTTP requests
+add_filter( 'http_request_host_is_external', 'ms_allowed_http_request_hosts', 20, 2 );
index 9b9c43f9d6cf0e35c2ff8c1d4a8ce0da4d7f3f46..9c6cad456e08391577603de78edf4183857eb6d1 100644 (file)
@@ -270,3 +270,32 @@ function wpmu_admin_redirect_add_updated_param( $url = '' ) {
        }
        return $url;
 }
+
+/**
+ * Get a numeric user ID from either an email address or a login.
+ *
+ * A numeric string is considered to be an existing user ID
+ * and is simply returned as such.
+ *
+ * @since MU
+ * @deprecated 3.6.0
+ * @deprecated Use get_user_by()
+ * @uses get_user_by()
+ *
+ * @param string $string Either an email address or a login.
+ * @return int
+ */
+function get_user_id_from_string( $string ) {
+       _deprecated_function( __FUNCTION__, '3.6', 'get_user_by()' );
+
+       if ( is_email( $string ) )
+               $user = get_user_by( 'email', $string );
+       elseif ( is_numeric( $string ) )
+               return $string;
+       else
+               $user = get_user_by( 'login', $string );
+
+       if ( $user )
+               return $user->ID;
+       return 0;
+}
index 100ba2c6d19b14cf3eaae92aa4a667942c59034f..de6d15dbdd1205881758440f8a1bcab13dcd7230 100644 (file)
@@ -57,7 +57,7 @@ header( "Last-Modified: $last_modified GMT" );
 header( 'ETag: ' . $etag );
 header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + 100000000 ) . ' GMT' );
 
-// Support for Conditional GET
+// Support for Conditional GET - use stripslashes to avoid formatting.php dependency
 $client_etag = isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) ? stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) : false;
 
 if( ! isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) )
index 0f6794b55c527d070c42e2b06b9e9a8957fdeb96..1037a9f3877fd0c305ac9dbad632297601f79684 100644 (file)
@@ -279,9 +279,6 @@ function remove_user_from_blog($user_id, $blog_id = '', $reassign = '') {
  * @return int The ID of the newly created blog
  */
 function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) {
-       $domain                 = addslashes( $domain );
-       $weblog_title   = addslashes( $weblog_title );
-
        if ( empty($path) )
                $path = '/';
 
@@ -463,9 +460,7 @@ function wpmu_validate_user_signup($user_name, $user_email) {
                $errors->add( 'user_name', __( 'Sorry, usernames may not contain the character &#8220;_&#8221;!' ) );
 
        // all numeric?
-       $match = array();
-       preg_match( '/[0-9]*/', $user_name, $match );
-       if ( $match[0] == $user_name )
+       if ( preg_match( '/^[0-9]*$/', $user_name ) )
                $errors->add('user_name', __('Sorry, usernames must have letters too!'));
 
        if ( !is_email( $user_email ) )
@@ -497,9 +492,6 @@ function wpmu_validate_user_signup($user_name, $user_email) {
                        $wpdb->delete( $wpdb->signups, array( 'user_login' => $user_name ) );
                else
                        $errors->add('user_name', __('That username is currently reserved but may be available in a couple of days.'));
-
-               if ( $signup->active == 0 && $signup->user_email == $user_email )
-                       $errors->add('user_email_used', __('username and email used'));
        }
 
        $signup = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->signups WHERE user_email = %s", $user_email) );
@@ -570,7 +562,7 @@ function wpmu_validate_blog_signup($blogname, $blog_title, $user = '') {
        if ( strlen( $blogname ) < 4 && !is_super_admin() )
                $errors->add('blogname',  __( 'Site name must be at least 4 characters.' ) );
 
-       if ( strpos( ' ' . $blogname, '_' ) != false )
+       if ( strpos( $blogname, '_' ) !== false )
                $errors->add( 'blogname', __( 'Sorry, site names may not contain the character &#8220;_&#8221;!' ) );
 
        // do not allow users to create a blog that conflicts with a page on the main blog.
@@ -578,14 +570,12 @@ function wpmu_validate_blog_signup($blogname, $blog_title, $user = '') {
                $errors->add( 'blogname', __( 'Sorry, you may not use that site name.' ) );
 
        // all numeric?
-       $match = array();
-       preg_match( '/[0-9]*/', $blogname, $match );
-       if ( $match[0] == $blogname )
+       if ( preg_match( '/^[0-9]*$/', $blogname ) )
                $errors->add('blogname', __('Sorry, site names must have letters too!'));
 
        $blogname = apply_filters( 'newblogname', $blogname );
 
-       $blog_title = stripslashes(  $blog_title );
+       $blog_title = wp_unslash(  $blog_title );
 
        if ( empty( $blog_title ) )
                $errors->add('blog_title', __( 'Please enter a site title.' ) );
@@ -639,9 +629,6 @@ function wpmu_signup_blog($domain, $path, $title, $user, $user_email, $meta = ''
 
        $key = substr( md5( time() . rand() . $domain ), 0, 16 );
        $meta = serialize($meta);
-       $domain = $wpdb->escape($domain);
-       $path = $wpdb->escape($path);
-       $title = $wpdb->escape($title);
 
        $wpdb->insert( $wpdb->signups, array(
                'domain' => $domain,
@@ -820,7 +807,6 @@ function wpmu_signup_user_notification($user, $user_email, $key, $meta = '') {
  * @uses wp_generate_password()
  * @uses wpmu_welcome_user_notification()
  * @uses add_user_to_blog()
- * @uses add_new_user_to_blog()
  * @uses wpmu_create_user()
  * @uses wpmu_create_blog()
  * @uses wpmu_welcome_notification()
@@ -844,14 +830,12 @@ function wpmu_activate_signup($key) {
        }
 
        $meta = maybe_unserialize($signup->meta);
-       $user_login = $wpdb->escape($signup->user_login);
-       $user_email = $wpdb->escape($signup->user_email);
        $password = wp_generate_password( 12, false );
 
-       $user_id = username_exists($user_login);
+       $user_id = username_exists($signup->user_login);
 
        if ( ! $user_id )
-               $user_id = wpmu_create_user($user_login, $password, $user_email);
+               $user_id = wpmu_create_user($signup->user_login, $password, $signup->user_email);
        else
                $user_already_exists = true;
 
@@ -866,11 +850,9 @@ function wpmu_activate_signup($key) {
                if ( isset( $user_already_exists ) )
                        return new WP_Error( 'user_already_exists', __( 'That username is already activated.' ), $signup);
 
-               wpmu_welcome_user_notification($user_id, $password, $meta);
-
-               add_new_user_to_blog( $user_id, $user_email, $meta );
-               do_action('wpmu_activate_user', $user_id, $password, $meta);
-               return array('user_id' => $user_id, 'password' => $password, 'meta' => $meta);
+               wpmu_welcome_user_notification( $user_id, $password, $meta );
+               do_action( 'wpmu_activate_user', $user_id, $password, $meta );
+               return array( 'user_id' => $user_id, 'password' => $password, 'meta' => $meta );
        }
 
        $blog_id = wpmu_create_blog( $signup->domain, $signup->path, $signup->title, $user_id, $meta, $wpdb->siteid );
@@ -909,15 +891,17 @@ function wpmu_activate_signup($key) {
  * @param string $email The new user's email address.
  * @return mixed Returns false on failure, or int $user_id on success
  */
-function wpmu_create_user( $user_name, $password, $email) {
+function wpmu_create_user( $user_name, $password, $email ) {
        $user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) );
 
        $user_id = wp_create_user( $user_name, $password, $email );
-       if ( is_wp_error($user_id) )
+       if ( is_wp_error( $user_id ) )
                return false;
 
+       $user = new WP_User( $user_id );
+
        // Newly created users have no roles or caps until they are added to a blog.
-       delete_user_option( $user_id, 'capabilities' );
+       delete_user_option( $user_id, $user->cap_key );
        delete_user_option( $user_id, 'user_level' );
 
        do_action( 'wpmu_new_user', $user_id );
@@ -1028,7 +1012,7 @@ function newblog_notify_siteadmin( $blog_id, $deprecated = '' ) {
 URL: %2$s
 Remote IP: %3$s
 
-Disable these notifications: %4$s' ), $blogname, $siteurl, $_SERVER['REMOTE_ADDR'], $options_site_url);
+Disable these notifications: %4$s' ), $blogname, $siteurl, wp_unslash( $_SERVER['REMOTE_ADDR'] ), $options_site_url);
        $msg = apply_filters( 'newblog_notify_siteadmin', $msg );
 
        wp_mail( $email, sprintf( __( 'New Site Registration: %s' ), $siteurl ), $msg );
@@ -1062,7 +1046,7 @@ function newuser_notify_siteadmin( $user_id ) {
        $msg = sprintf(__('New User: %1$s
 Remote IP: %2$s
 
-Disable these notifications: %3$s'), $user->user_login, $_SERVER['REMOTE_ADDR'], $options_site_url);
+Disable these notifications: %3$s'), $user->user_login, wp_unslash( $_SERVER['REMOTE_ADDR'] ), $options_site_url);
 
        $msg = apply_filters( 'newuser_notify_siteadmin', $msg, $user );
        wp_mail( $email, sprintf(__('New User Registration: %s'), $user->user_login), $msg );
@@ -1111,8 +1095,9 @@ function insert_blog($domain, $path, $site_id) {
        if ( ! $result )
                return false;
 
-       refresh_blog_details($wpdb->insert_id);
-       return $wpdb->insert_id;
+       $blog_id = $wpdb->insert_id;
+       refresh_blog_details( $blog_id );
+       return $blog_id;
 }
 
 /**
@@ -1160,7 +1145,7 @@ function install_blog($blog_id, $blog_title = '') {
        else
                update_option( 'upload_path', get_blog_option( $current_site->blog_id, 'upload_path' ) );
 
-       update_option( 'blogname', stripslashes( $blog_title ) );
+       update_option( 'blogname', wp_unslash( $blog_title ) );
        update_option( 'admin_email', '' );
 
        // remove all perms
@@ -1217,9 +1202,9 @@ function wpmu_welcome_notification($blog_id, $user_id, $password, $title, $meta
        if ( !apply_filters('wpmu_welcome_notification', $blog_id, $user_id, $password, $title, $meta) )
                return false;
 
-       $welcome_email = stripslashes( get_site_option( 'welcome_email' ) );
+       $welcome_email = get_site_option( 'welcome_email' );
        if ( $welcome_email == false )
-               $welcome_email = stripslashes( __( 'Dear User,
+               $welcome_email = __( 'Dear User,
 
 Your new SITE_NAME site has been successfully set up at:
 BLOG_URL
@@ -1231,7 +1216,7 @@ Log in here: BLOG_URLwp-login.php
 
 We hope you enjoy your new site. Thanks!
 
---The Team @ SITE_NAME' ) );
+--The Team @ SITE_NAME' );
 
        $url = get_blogaddress_by_id($blog_id);
        $user = get_userdata( $user_id );
@@ -1255,7 +1240,7 @@ We hope you enjoy your new site. Thanks!
        if ( empty( $current_site->site_name ) )
                $current_site->site_name = 'WordPress';
 
-       $subject = apply_filters( 'update_welcome_subject', sprintf(__('New %1$s Site: %2$s'), $current_site->site_name, stripslashes( $title ) ) );
+       $subject = apply_filters( 'update_welcome_subject', sprintf(__('New %1$s Site: %2$s'), $current_site->site_name, wp_unslash( $title ) ) );
        wp_mail($user->user_email, $subject, $message, $message_headers);
        return true;
 }
@@ -1323,32 +1308,6 @@ function get_current_site() {
        return $current_site;
 }
 
-/**
- * Get a numeric user ID from either an email address or a login.
- *
- * @since MU
- * @uses is_email()
- *
- * @param string $string
- * @return int
- */
-function get_user_id_from_string( $string ) {
-       $user_id = 0;
-       if ( is_email( $string ) ) {
-               $user = get_user_by('email', $string);
-               if ( $user )
-                       $user_id = $user->ID;
-       } elseif ( is_numeric( $string ) ) {
-               $user_id = $string;
-       } else {
-               $user = get_user_by('login', $string);
-               if ( $user )
-                       $user_id = $user->ID;
-       }
-
-       return $user_id;
-}
-
 /**
  * Get a user's most recent post.
  *
@@ -1510,7 +1469,7 @@ function update_posts_count( $deprecated = '' ) {
 function wpmu_log_new_registrations( $blog_id, $user_id ) {
        global $wpdb;
        $user = get_userdata( (int) $user_id );
-       $wpdb->insert( $wpdb->registration_log, array('email' => $user->user_email, 'IP' => preg_replace( '/[^0-9., ]/', '',$_SERVER['REMOTE_ADDR'] ), 'blog_id' => $blog_id, 'date_registered' => current_time('mysql')) );
+       $wpdb->insert( $wpdb->registration_log, array('email' => $user->user_email, 'IP' => preg_replace( '/[^0-9., ]/', '', wp_unslash( $_SERVER['REMOTE_ADDR'] ) ), 'blog_id' => $blog_id, 'date_registered' => current_time('mysql')) );
 }
 
 /**
@@ -1709,13 +1668,17 @@ function add_existing_user_to_blog( $details = false ) {
 /**
  * Add a newly created user to the appropriate blog
  *
+ * To add a user in general, use add_user_to_blog(). This function
+ * is specifically hooked into the wpmu_activate_user action.
+ *
  * @since MU
+ * @see add_user_to_blog()
  *
  * @param int $user_id
- * @param string $email
+ * @param mixed $password Ignored.
  * @param array $meta
  */
-function add_new_user_to_blog( $user_id, $email, $meta ) {
+function add_new_user_to_blog( $user_id, $password, $meta ) {
        global $current_site;
        if ( !empty( $meta[ 'add_to_blog' ] ) ) {
                $blog_id = $meta[ 'add_to_blog' ];
@@ -1737,24 +1700,21 @@ function fix_phpmailer_messageid( $phpmailer ) {
 }
 
 /**
- * Check to see whether a user is marked as a spammer, based on username
+ * Check to see whether a user is marked as a spammer, based on user login.
  *
  * @since MU
- * @uses get_current_user_id()
- * @uses get_user_id_from_string()
+ * @uses get_user_by()
  *
- * @param string $username
+ * @param string $user_login Optional. Defaults to current user.
  * @return bool
  */
-function is_user_spammy( $username = 0 ) {
-       if ( $username == 0 ) {
-               $user_id = get_current_user_id();
-       } else {
-               $user_id = get_user_id_from_string( $username );
-       }
-       $u = get_userdata( $user_id );
+function is_user_spammy( $user_login = null ) {
+       if ( $user_login )
+               $user = get_user_by( 'login', $user_login );
+       else
+               $user = wp_get_current_user();
 
-       return ( isset( $u->spam ) && $u->spam == 1 );
+       return $user && isset( $user->spam ) && 1 == $user->spam;
 }
 
 /**
@@ -1770,9 +1730,7 @@ function is_user_spammy( $username = 0 ) {
  * @return bool
  */
 function update_blog_public( $old_value, $value ) {
-       global $wpdb;
-       do_action('update_blog_public');
-       update_blog_status( $wpdb->blogid, 'public', (int) $value );
+       update_blog_status( get_current_blog_id(), 'public', (int) $value );
 }
 add_action('update_option_blog_public', 'update_blog_public', 10, 2);
 
@@ -2013,4 +1971,24 @@ function upload_size_limit_filter( $size ) {
                return min( $size, $fileupload_maxk );
 
        return min( $size, $fileupload_maxk, get_upload_space_available() );
-}
\ No newline at end of file
+}
+
+/**
+ * Whether or not we have a large network.
+ *
+ * The default criteria for a large network is either more than 10,000 users or more than 10,000 sites.
+ * Plugins can alter this criteria using the 'wp_is_large_network' filter.
+ *
+ * @since 3.3.0
+ * @param string $using 'sites or 'users'. Default is 'sites'.
+ * @return bool True if the network meets the criteria for large. False otherwise.
+ */
+function wp_is_large_network( $using = 'sites' ) {
+       if ( 'users' == $using ) {
+               $count = get_user_count();
+               return apply_filters( 'wp_is_large_network', $count > 10000, 'users', $count );
+       }
+
+       $count = get_blog_count();
+       return apply_filters( 'wp_is_large_network', $count > 10000, 'sites', $count );
+}
index 6a26b9cf06a2772428c4f04c3d0a007dddacb877..55659a2822c2dbc8a51a8363aa61e08f351d0b47 100644 (file)
@@ -69,7 +69,7 @@ function wp_get_active_network_plugins() {
  * @return bool|string Returns true on success, or drop-in file to include.
  */
 function ms_site_check() {
-       global $wpdb;
+       global $wpdb, $current_site;
 
        $blog = get_blog_details();
 
@@ -240,7 +240,7 @@ function ms_not_installed() {
                die( $msg );
        $msg .= '<p>' . __( 'If your site does not display, please contact the owner of this network.' ) . '';
        $msg .= ' ' . __( 'If you are the owner of this network please check that MySQL is running properly and all tables are error free.' ) . '</p>';
-       if ( false && !$wpdb->get_var( "SHOW TABLES LIKE '$wpdb->site'" ) )
+       if ( $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->site'" ) )
                $msg .= '<p>' . sprintf( __( '<strong>Database tables are missing.</strong> This means that MySQL is not running, WordPress was not installed properly, or someone deleted <code>%s</code>. You really should look at your database now.' ), $wpdb->site ) . '</p>';
        else
                $msg .= '<p>' . sprintf( __( '<strong>Could not find site <code>%1$s</code>.</strong> Searched for table <code>%2$s</code> in database <code>%3$s</code>. Is that right?' ), rtrim( $domain . $path, '/' ), $wpdb->blogs, DB_NAME ) . '</p>';
index df5612d225153218a67ea374f2c2328cf01c394d..0ac14c328f659d008c67bddaac797933c036708f 100644 (file)
@@ -80,10 +80,21 @@ class Walker_Nav_Menu extends Walker {
 
                $output .= $indent . '<li' . $id . $value . $class_names .'>';
 
-               $attributes  = ! empty( $item->attr_title ) ? ' title="'  . esc_attr( $item->attr_title ) .'"' : '';
-               $attributes .= ! empty( $item->target )     ? ' target="' . esc_attr( $item->target     ) .'"' : '';
-               $attributes .= ! empty( $item->xfn )        ? ' rel="'    . esc_attr( $item->xfn        ) .'"' : '';
-               $attributes .= ! empty( $item->url )        ? ' href="'   . esc_attr( $item->url        ) .'"' : '';
+               $atts = array();
+               $atts['title']  = ! empty( $item->attr_title ) ? $item->attr_title : '';
+               $atts['target'] = ! empty( $item->target )     ? $item->target     : '';
+               $atts['rel']    = ! empty( $item->xfn )        ? $item->xfn        : '';
+               $atts['href']   = ! empty( $item->url )        ? $item->url        : '';
+
+               $atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args );
+
+               $attributes = '';
+               foreach ( $atts as $attr => $value ) {
+                       if ( ! empty( $value ) ) {
+                               $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );
+                               $attributes .= ' ' . $attr . '="' . $value . '"';
+                       }
+               }
 
                $item_output = $args->before;
                $item_output .= '<a'. $attributes .'>';
@@ -168,17 +179,17 @@ function wp_nav_menu( $args = array() ) {
 
        /*
         * If no menu was found:
-        *  - Fallback (if one was specified), or bail.
+        *  - Fall back (if one was specified), or bail.
         *
         * If no menu items were found:
-        *  - Fallback, but only if no theme location was specified.
+        *  - Fall back, but only if no theme location was specified.
         *  - Otherwise, bail.
         */
        if ( ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) && !$args->theme_location ) )
                && $args->fallback_cb && is_callable( $args->fallback_cb ) )
                        return call_user_func( $args->fallback_cb, (array) $args );
 
-       if ( !$menu || is_wp_error( $menu ) || empty( $menu_items ) )
+       if ( ! $menu || is_wp_error( $menu ) )
                return false;
 
        $nav_menu = $items = '';
@@ -228,6 +239,10 @@ function wp_nav_menu( $args = array() ) {
        $items = apply_filters( 'wp_nav_menu_items', $items, $args );
        $items = apply_filters( "wp_nav_menu_{$menu->slug}_items", $items, $args );
 
+       // Don't print any markup if there are no items at this point.
+       if ( empty( $items ) )
+               return false;
+
        $nav_menu .= sprintf( $args->items_wrap, esc_attr( $wrap_id ), esc_attr( $wrap_class ), $items );
        unset( $items );
 
@@ -251,7 +266,7 @@ function wp_nav_menu( $args = array() ) {
  * @param array $menu_items The current menu item objects to which to add the class property information.
  */
 function _wp_menu_item_classes_by_context( &$menu_items ) {
-       global $wp_query;
+       global $wp_query, $wp_rewrite;
 
        $queried_object = $wp_query->get_queried_object();
        $queried_object_id = (int) $wp_query->queried_object_id;
@@ -367,7 +382,7 @@ function _wp_menu_item_classes_by_context( &$menu_items ) {
                        $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_root_relative_current );
                        $raw_item_url = strpos( $menu_item->url, '#' ) ? substr( $menu_item->url, 0, strpos( $menu_item->url, '#' ) ) : $menu_item->url;
                        $item_url = untrailingslashit( $raw_item_url );
-                       $_indexless_current = untrailingslashit( preg_replace( '/index.php$/', '', $current_url ) );
+                       $_indexless_current = untrailingslashit( preg_replace( '/' . preg_quote( $wp_rewrite->index, '/' ) . '$/', '', $current_url ) );
 
                        if ( $raw_item_url && in_array( $item_url, array( $current_url, $_indexless_current, $_root_relative_current ) ) ) {
                                $classes[] = 'current-menu-item';
index 7a5da9e20269a49e9c6e2198f5cafd9aaadc6286..794f4b2d1177f4d5658fc66bc0304d0ff008d9e8 100644 (file)
@@ -127,7 +127,8 @@ function get_registered_nav_menus() {
  */
 
 function get_nav_menu_locations() {
-       return get_theme_mod( 'nav_menu_locations' );
+       $locations = get_theme_mod( 'nav_menu_locations' );
+       return ( is_array( $locations ) ) ? $locations : array();
 }
 
 /**
@@ -188,6 +189,14 @@ function wp_delete_nav_menu( $menu ) {
 
        $result = wp_delete_term( $menu->term_id, 'nav_menu' );
 
+       // Remove this menu from any locations.
+       $locations = get_theme_mod( 'nav_menu_locations' );
+       foreach ( (array) $locations as $location => $menu_id ) {
+               if ( $menu_id == $menu->term_id )
+                       $locations[ $location ] = 0;
+       }
+       set_theme_mod( 'nav_menu_locations', $locations );
+
        if ( $result && !is_wp_error($result) )
                do_action( 'wp_delete_nav_menu', $menu->term_id );
 
@@ -327,13 +336,12 @@ function wp_update_nav_menu_item( $menu_id = 0, $menu_item_db_id = 0, $menu_item
                        $original_title = $original_object->post_title;
                }
 
-               if ( empty( $args['menu-item-title'] ) || $args['menu-item-title'] == $original_title ) {
+               if ( $args['menu-item-title'] == $original_title )
                        $args['menu-item-title'] = '';
 
-                       // hack to get wp to create a post object when too many properties are empty
-                       if ( empty( $args['menu-item-description'] ) )
-                               $args['menu-item-description'] = ' ';
-               }
+               // hack to get wp to create a post object when too many properties are empty
+               if ( '' ==  $args['menu-item-title'] && '' == $args['menu-item-description'] )
+                       $args['menu-item-description'] = ' ';
        }
 
        // Populate the menu item object
@@ -633,6 +641,9 @@ function wp_setup_nav_menu_item( $menu_item ) {
                        $menu_item->object = $object->name;
                        $menu_item->type_label = $object->labels->singular_name;
 
+                       if ( '' === $menu_item->post_title )
+                               $menu_item->post_title = sprintf( __( '#%d (no title)' ), $menu_item->ID );
+
                        $menu_item->title = $menu_item->post_title;
                        $menu_item->url = get_permalink( $menu_item->ID );
                        $menu_item->target = '';
index 722d1f30d4992c0dc128eeb13eeb6ddef1bcd8a7..3df89c2c25cba932af7a3df7dc1e400203f79c23 100644 (file)
@@ -104,8 +104,7 @@ function get_option( $option, $default = false ) {
  * @param string $option Option name.
  */
 function wp_protect_special_option( $option ) {
-       $protected = array( 'alloptions', 'notoptions' );
-       if ( in_array( $option, $protected ) )
+       if ( 'alloptions' === $option || 'notoptions' === $option )
                wp_die( sprintf( __( '%s is a protected WP option and may not be modified' ), esc_html( $option ) ) );
 }
 
@@ -248,10 +247,10 @@ function update_option( $option, $newvalue ) {
        if ( ! defined( 'WP_INSTALLING' ) ) {
                $alloptions = wp_load_alloptions();
                if ( isset( $alloptions[$option] ) ) {
-                       $alloptions[$option] = $_newvalue;
+                       $alloptions[$option] = $newvalue;
                        wp_cache_set( 'alloptions', $alloptions, 'options' );
                } else {
-                       wp_cache_set( $option, $_newvalue, 'options' );
+                       wp_cache_set( $option, $newvalue, 'options' );
                }
        }
 
@@ -360,6 +359,10 @@ function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' )
 function delete_option( $option ) {
        global $wpdb;
 
+       $option = trim( $option );
+       if ( empty( $option ) )
+               return false;
+
        wp_protect_special_option( $option );
 
        // Get the ID, if no ID then return
@@ -512,8 +515,8 @@ function set_transient( $transient, $value, $expiration = 0 ) {
                }
        }
        if ( $result ) {
-               do_action( 'set_transient_' . $transient );
-               do_action( 'setted_transient', $transient );
+               do_action( 'set_transient_' . $transient, $value, $expiration );
+               do_action( 'setted_transient', $transient, $value, $expiration );
        }
        return $result;
 }
@@ -1049,8 +1052,8 @@ function set_site_transient( $transient, $value, $expiration = 0 ) {
                }
        }
        if ( $result ) {
-               do_action( 'set_site_transient_' . $transient );
-               do_action( 'setted_site_transient', $transient );
+               do_action( 'set_site_transient_' . $transient, $value, $expiration );
+               do_action( 'setted_site_transient', $transient, $value, $expiration );
        }
        return $result;
 }
index 69e78f5f9542c4467ffcec0ad57a0c65c504e6a1..02733b2b0f4851dd8641467868990ac4ceaaf08c 100644 (file)
@@ -177,16 +177,16 @@ endif;
  *
  * @since 2.2.0
  * @deprecated 3.5.0
- * @link http://wordpress.org/extend/plugins/atom-publishing-protocol/
+ * @link http://wordpress.org/plugins/atom-publishing-protocol/
  */
 if ( ! class_exists( 'wp_atom_server' ) ) {
        class wp_atom_server {
                public function __call( $name, $arguments ) {
-                       _deprecated_function( __CLASS__ . '::' . $name, '3.5', 'the Atom Publishing Platform plugin' );
+                       _deprecated_function( __CLASS__ . '::' . $name, '3.5', 'the Atom Publishing Protocol plugin' );
                }
 
                public static function __callStatic( $name, $arguments ) {
-                       _deprecated_function( __CLASS__ . '::' . $name, '3.5', 'the Atom Publishing Platform plugin' );
+                       _deprecated_function( __CLASS__ . '::' . $name, '3.5', 'the Atom Publishing Protocol plugin' );
                }
        }
 }
\ No newline at end of file
index 83afefab805df6f7dc921aeb48b630169025be27..acfa2ddd77ac61cfd67ba2fbe2761e9d4b9a6984 100644 (file)
@@ -448,12 +448,10 @@ function wp_mail( $to, $subject, $message, $headers = '', $attachments = array()
 
        // Send!
        try {
-               $phpmailer->Send();
+               return $phpmailer->Send();
        } catch ( phpmailerException $e ) {
                return false;
        }
-
-       return true;
 }
 endif;
 
@@ -651,9 +649,9 @@ if ( !function_exists('wp_set_auth_cookie') ) :
  */
 function wp_set_auth_cookie($user_id, $remember = false, $secure = '') {
        if ( $remember ) {
-               $expiration = $expire = time() + apply_filters('auth_cookie_expiration', 1209600, $user_id, $remember);
+               $expiration = $expire = time() + apply_filters('auth_cookie_expiration', 14 * DAY_IN_SECONDS, $user_id, $remember);
        } else {
-               $expiration = time() + apply_filters('auth_cookie_expiration', 172800, $user_id, $remember);
+               $expiration = time() + apply_filters('auth_cookie_expiration', 2 * DAY_IN_SECONDS, $user_id, $remember);
                $expire = 0;
        }
 
@@ -816,7 +814,8 @@ function check_admin_referer($action = -1, $query_arg = '_wpnonce') {
        }
        do_action('check_admin_referer', $action, $result);
        return $result;
-}endif;
+}
+endif;
 
 if ( !function_exists('check_ajax_referer') ) :
 /**
@@ -998,6 +997,10 @@ function wp_notify_postauthor( $comment_id, $comment_type = '' ) {
        if ( $post->post_author == get_current_user_id() )
                return false;
 
+       // The post author is no longer a member of the blog
+       if ( ! user_can( $post->post_author, 'read_post', $post->ID ) )
+               return false;
+
        // If there's no email to send the comment to
        if ( '' == $author->user_email )
                return false;
@@ -1042,11 +1045,14 @@ function wp_notify_postauthor( $comment_id, $comment_type = '' ) {
        }
        $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n";
        $notify_message .= sprintf( __('Permalink: %s'), get_permalink( $comment->comment_post_ID ) . '#comment-' . $comment_id ) . "\r\n";
-       if ( EMPTY_TRASH_DAYS )
-               $notify_message .= sprintf( __('Trash it: %s'), admin_url("comment.php?action=trash&c=$comment_id") ) . "\r\n";
-       else
-               $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=delete&c=$comment_id") ) . "\r\n";
-       $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=spam&c=$comment_id") ) . "\r\n";
+
+       if ( user_can( $post->post_author, 'edit_comment', $comment_id ) ) {
+               if ( EMPTY_TRASH_DAYS )
+                       $notify_message .= sprintf( __('Trash it: %s'), admin_url("comment.php?action=trash&c=$comment_id") ) . "\r\n";
+               else
+                       $notify_message .= sprintf( __('Delete it: %s'), admin_url("comment.php?action=delete&c=$comment_id") ) . "\r\n";
+               $notify_message .= sprintf( __('Spam it: %s'), admin_url("comment.php?action=spam&c=$comment_id") ) . "\r\n";
+       }
 
        $wp_email = 'wordpress@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME']));
 
@@ -1192,27 +1198,24 @@ if ( !function_exists('wp_new_user_notification') ) :
 function wp_new_user_notification($user_id, $plaintext_pass = '') {
        $user = get_userdata( $user_id );
 
-       $user_login = stripslashes($user->user_login);
-       $user_email = stripslashes($user->user_email);
-
        // The blogname option is escaped with esc_html on the way into the database in sanitize_option
        // we want to reverse this for the plain text arena of emails.
        $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
 
        $message  = sprintf(__('New user registration on your site %s:'), $blogname) . "\r\n\r\n";
-       $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
-       $message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n";
+       $message .= sprintf(__('Username: %s'), $user->user_login) . "\r\n\r\n";
+       $message .= sprintf(__('E-mail: %s'), $user->user_email) . "\r\n";
 
        @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);
 
        if ( empty($plaintext_pass) )
                return;
 
-       $message  = sprintf(__('Username: %s'), $user_login) . "\r\n";
+       $message  = sprintf(__('Username: %s'), $user->user_login) . "\r\n";
        $message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n";
        $message .= wp_login_url() . "\r\n";
 
-       wp_mail($user_email, sprintf(__('[%s] Your username and password'), $blogname), $message);
+       wp_mail($user->user_email, sprintf(__('[%s] Your username and password'), $blogname), $message);
 
 }
 endif;
@@ -1563,7 +1566,7 @@ if ( !function_exists('wp_set_password') ) :
 function wp_set_password( $password, $user_id ) {
        global $wpdb;
 
-       $hash = wp_hash_password($password);
+       $hash = wp_hash_password( trim( $password ) );
        $wpdb->update($wpdb->users, array('user_pass' => $hash, 'user_activation_key' => ''), array('ID' => $user_id) );
 
        wp_cache_delete($user_id, 'users');
@@ -1708,16 +1711,20 @@ function wp_text_diff( $left_string, $right_string, $args = null ) {
 
        $left_lines  = explode("\n", $left_string);
        $right_lines = explode("\n", $right_string);
-
        $text_diff = new Text_Diff($left_lines, $right_lines);
-       $renderer  = new WP_Text_Diff_Renderer_Table();
+       $renderer  = new WP_Text_Diff_Renderer_Table( $args );
        $diff = $renderer->render($text_diff);
 
        if ( !$diff )
                return '';
 
        $r  = "<table class='diff'>\n";
-       $r .= "<col class='ltype' /><col class='content' /><col class='ltype' /><col class='content' />";
+
+       if ( ! empty( $args[ 'show_split_view' ] ) ) {
+               $r .= "<col class='content diffsplit left' /><col class='content diffsplit middle' /><col class='content diffsplit right' />";
+       } else {
+               $r .= "<col class='content' />";
+       }
 
        if ( $args['title'] || $args['title_left'] || $args['title_right'] )
                $r .= "<thead>";
@@ -1738,3 +1745,4 @@ function wp_text_diff( $left_string, $right_string, $args = null ) {
        return $r;
 }
 endif;
+
index 7e38708034815743b5a993a61d95c9dd3823e960..c2aebf28a9b5594ca99eeaf2e0c604b024312957 100644 (file)
@@ -45,7 +45,7 @@
  *
  * <strong>Note:</strong> the function will return true no matter if the
  * function was hooked fails or not. There are no checks for whether the
- * function exists beforehand and no checks to whether the <tt>$function_to_add
+ * function exists beforehand and no checks to whether the <tt>$function_to_add</tt>
  * is even a string. It is up to you to take care and this is done for
  * optimization purposes, so everything is as quick as possible.
  *
@@ -604,12 +604,13 @@ function plugin_dir_url( $file ) {
  * Set the activation hook for a plugin.
  *
  * When a plugin is activated, the action 'activate_PLUGINNAME' hook is
- * activated. In the name of this hook, PLUGINNAME is replaced with the name of
- * the plugin, including the optional subdirectory. For example, when the plugin
- * is located in wp-content/plugin/sampleplugin/sample.php, then the name of
- * this hook will become 'activate_sampleplugin/sample.php'. When the plugin
- * consists of only one file and is (as by default) located at
- * wp-content/plugin/sample.php the name of this hook will be
+ * called. In the name of this hook, PLUGINNAME is replaced with the name
+ * of the plugin, including the optional subdirectory. For example, when the
+ * plugin is located in wp-content/plugins/sampleplugin/sample.php, then
+ * the name of this hook will become 'activate_sampleplugin/sample.php'.
+ *
+ * When the plugin consists of only one file and is (as by default) located at
+ * wp-content/plugins/sample.php the name of this hook will be
  * 'activate_sample.php'.
  *
  * @package WordPress
@@ -628,21 +629,21 @@ function register_activation_hook($file, $function) {
  * Set the deactivation hook for a plugin.
  *
  * When a plugin is deactivated, the action 'deactivate_PLUGINNAME' hook is
- * deactivated. In the name of this hook, PLUGINNAME is replaced with the name
+ * called. In the name of this hook, PLUGINNAME is replaced with the name
  * of the plugin, including the optional subdirectory. For example, when the
- * plugin is located in wp-content/plugin/sampleplugin/sample.php, then
- * the name of this hook will become 'activate_sampleplugin/sample.php'.
+ * plugin is located in wp-content/plugins/sampleplugin/sample.php, then
+ * the name of this hook will become 'deactivate_sampleplugin/sample.php'.
  *
  * When the plugin consists of only one file and is (as by default) located at
- * wp-content/plugin/sample.php the name of this hook will be
- * 'activate_sample.php'.
+ * wp-content/plugins/sample.php the name of this hook will be
+ * 'deactivate_sample.php'.
  *
  * @package WordPress
  * @subpackage Plugin
  * @since 2.0
  *
  * @param string $file The filename of the plugin including the path.
- * @param callback $function the function hooked to the 'activate_PLUGIN' action.
+ * @param callback $function the function hooked to the 'deactivate_PLUGIN' action.
  */
 function register_deactivation_hook($file, $function) {
        $file = plugin_basename($file);
@@ -784,6 +785,6 @@ function _wp_filter_build_unique_id($tag, $function, $priority) {
                }
        } else if ( is_string($function[0]) ) {
                // Static Calling
-               return $function[0].$function[1];
+               return $function[0] . '::' . $function[1];
        }
 }
index 856e38aa10f72f78bc94555ad07b22c61b40b67d..106b6da1640dc7129b92a415cab8d8257000b489 100644 (file)
@@ -57,7 +57,7 @@ class Translations {
                $this->headers[$header] = $value;
        }
 
-       function set_headers(&$headers) {
+       function set_headers($headers) {
                foreach($headers as $header => $value) {
                        $this->set_header($header, $value);
                }
@@ -242,7 +242,7 @@ class NOOP_Translations {
        function set_header($header, $value) {
        }
 
-       function set_headers(&$headers) {
+       function set_headers($headers) {
        }
 
        function get_header($header) {
diff --git a/wp-includes/post-formats.php b/wp-includes/post-formats.php
new file mode 100644 (file)
index 0000000..a13de3e
--- /dev/null
@@ -0,0 +1,243 @@
+<?php
+/**
+ * Post format functions.
+ *
+ * @package WordPress
+ * @subpackage Post
+ */
+
+/**
+ * Retrieve the format slug for a post
+ *
+ * @since 3.1.0
+ *
+ * @param int|object $post Post ID or post object. Optional, default is the current post from the loop.
+ * @return mixed The format if successful. False otherwise.
+ */
+function get_post_format( $post = null ) {
+       if ( ! $post = get_post( $post ) )
+               return false;
+
+       if ( ! post_type_supports( $post->post_type, 'post-formats' ) )
+               return false;
+
+       $_format = get_the_terms( $post->ID, 'post_format' );
+
+       if ( empty( $_format ) )
+               return false;
+
+       $format = array_shift( $_format );
+
+       return str_replace('post-format-', '', $format->slug );
+}
+
+/**
+ * Check if a post has a particular format
+ *
+ * @since 3.1.0
+ *
+ * @uses has_term()
+ *
+ * @param string|array $format The format or formats to check.
+ * @param object|int   $post   The post to check. If not supplied, defaults to the current post if used in the loop.
+ * @return bool True if the post has the format, false otherwise.
+ */
+function has_post_format( $format, $post = null ) {
+       if ( ! is_array( $format ) )
+               $format = array( $format );
+
+       $prefixed = array();
+       foreach( $format as $single ) {
+               $prefixed[] = 'post-format-' . sanitize_key( $single );
+       }
+
+       return has_term( $prefixed, 'post_format', $post );
+}
+
+/**
+ * Assign a format to a post
+ *
+ * @since 3.1.0
+ *
+ * @param int|object $post The post for which to assign a format.
+ * @param string $format A format to assign. Use an empty string or array to remove all formats from the post.
+ * @return mixed WP_Error on error. Array of affected term IDs on success.
+ */
+function set_post_format( $post, $format ) {
+       $post = get_post( $post );
+
+       if ( empty( $post ) )
+               return new WP_Error( 'invalid_post', __( 'Invalid post' ) );
+
+       if ( ! empty( $format ) ) {
+               $format = sanitize_key( $format );
+               if ( 'standard' === $format || ! in_array( $format, get_post_format_slugs() ) )
+                       $format = '';
+               else
+                       $format = 'post-format-' . $format;
+       }
+
+       return wp_set_post_terms( $post->ID, $format, 'post_format' );
+}
+
+/**
+ * Returns an array of post format slugs to their translated and pretty display versions
+ *
+ * @since 3.1.0
+ *
+ * @return array The array of translated post format names.
+ */
+function get_post_format_strings() {
+       $strings = array(
+               'standard' => _x( 'Standard', 'Post format' ), // Special case. any value that evals to false will be considered standard
+               'aside'    => _x( 'Aside',    'Post format' ),
+               'chat'     => _x( 'Chat',     'Post format' ),
+               'gallery'  => _x( 'Gallery',  'Post format' ),
+               'link'     => _x( 'Link',     'Post format' ),
+               'image'    => _x( 'Image',    'Post format' ),
+               'quote'    => _x( 'Quote',    'Post format' ),
+               'status'   => _x( 'Status',   'Post format' ),
+               'video'    => _x( 'Video',    'Post format' ),
+               'audio'    => _x( 'Audio',    'Post format' ),
+       );
+       return $strings;
+}
+
+/**
+ * Retrieves an array of post format slugs.
+ *
+ * @since 3.1.0
+ *
+ * @uses get_post_format_strings()
+ *
+ * @return array The array of post format slugs.
+ */
+function get_post_format_slugs() {
+       $slugs = array_keys( get_post_format_strings() );
+       return array_combine( $slugs, $slugs );
+}
+
+/**
+ * Returns a pretty, translated version of a post format slug
+ *
+ * @since 3.1.0
+ *
+ * @uses get_post_format_strings()
+ *
+ * @param string $slug A post format slug.
+ * @return string The translated post format name.
+ */
+function get_post_format_string( $slug ) {
+       $strings = get_post_format_strings();
+       if ( !$slug )
+               return $strings['standard'];
+       else
+               return ( isset( $strings[$slug] ) ) ? $strings[$slug] : '';
+}
+
+/**
+ * Returns a link to a post format index.
+ *
+ * @since 3.1.0
+ *
+ * @param string $format The post format slug.
+ * @return string The post format term link.
+ */
+function get_post_format_link( $format ) {
+       $term = get_term_by('slug', 'post-format-' . $format, 'post_format' );
+       if ( ! $term || is_wp_error( $term ) )
+               return false;
+       return get_term_link( $term );
+}
+
+/**
+ * Filters the request to allow for the format prefix.
+ *
+ * @access private
+ * @since 3.1.0
+ */
+function _post_format_request( $qvs ) {
+       if ( ! isset( $qvs['post_format'] ) )
+               return $qvs;
+       $slugs = get_post_format_slugs();
+       if ( isset( $slugs[ $qvs['post_format'] ] ) )
+               $qvs['post_format'] = 'post-format-' . $slugs[ $qvs['post_format'] ];
+       $tax = get_taxonomy( 'post_format' );
+       if ( ! is_admin() )
+               $qvs['post_type'] = $tax->object_type;
+       return $qvs;
+}
+add_filter( 'request', '_post_format_request' );
+
+/**
+ * Filters the post format term link to remove the format prefix.
+ *
+ * @access private
+ * @since 3.1.0
+ */
+function _post_format_link( $link, $term, $taxonomy ) {
+       global $wp_rewrite;
+       if ( 'post_format' != $taxonomy )
+               return $link;
+       if ( $wp_rewrite->get_extra_permastruct( $taxonomy ) ) {
+               return str_replace( "/{$term->slug}", '/' . str_replace( 'post-format-', '', $term->slug ), $link );
+       } else {
+               $link = remove_query_arg( 'post_format', $link );
+               return add_query_arg( 'post_format', str_replace( 'post-format-', '', $term->slug ), $link );
+       }
+}
+add_filter( 'term_link', '_post_format_link', 10, 3 );
+
+/**
+ * Remove the post format prefix from the name property of the term object created by get_term().
+ *
+ * @access private
+ * @since 3.1.0
+ */
+function _post_format_get_term( $term ) {
+       if ( isset( $term->slug ) ) {
+               $term->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
+       }
+       return $term;
+}
+add_filter( 'get_post_format', '_post_format_get_term' );
+
+/**
+ * Remove the post format prefix from the name property of the term objects created by get_terms().
+ *
+ * @access private
+ * @since 3.1.0
+ */
+function _post_format_get_terms( $terms, $taxonomies, $args ) {
+       if ( in_array( 'post_format', (array) $taxonomies ) ) {
+               if ( isset( $args['fields'] ) && 'names' == $args['fields'] ) {
+                       foreach( $terms as $order => $name ) {
+                               $terms[$order] = get_post_format_string( str_replace( 'post-format-', '', $name ) );
+                       }
+               } else {
+                       foreach ( (array) $terms as $order => $term ) {
+                               if ( isset( $term->taxonomy ) && 'post_format' == $term->taxonomy ) {
+                                       $terms[$order]->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
+                               }
+                       }
+               }
+       }
+       return $terms;
+}
+add_filter( 'get_terms', '_post_format_get_terms', 10, 3 );
+
+/**
+ * Remove the post format prefix from the name property of the term objects created by wp_get_object_terms().
+ *
+ * @access private
+ * @since 3.1.0
+ */
+function _post_format_wp_get_object_terms( $terms ) {
+       foreach ( (array) $terms as $order => $term ) {
+               if ( isset( $term->taxonomy ) && 'post_format' == $term->taxonomy ) {
+                       $terms[$order]->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
+               }
+       }
+       return $terms;
+}
+add_filter( 'wp_get_object_terms', '_post_format_wp_get_object_terms' );
index d51d00953ee3494eefcff76216067e833ec83938..03302eab648aab8ba3062bf51b78e4ba843ee01d 100644 (file)
@@ -69,15 +69,15 @@ function the_title($before = '', $after = '', $echo = true) {
  * @return string|null Null on failure or display. String when echo is false.
  */
 function the_title_attribute( $args = '' ) {
-       $title = get_the_title();
+       $defaults = array('before' => '', 'after' =>  '', 'echo' => true, 'post' => get_post() );
+       $r = wp_parse_args($args, $defaults);
+       extract( $r, EXTR_SKIP );
+
+       $title = get_the_title( $post );
 
        if ( strlen($title) == 0 )
                return;
 
-       $defaults = array('before' => '', 'after' =>  '', 'echo' => true);
-       $r = wp_parse_args($args, $defaults);
-       extract( $r, EXTR_SKIP );
-
        $title = $before . $title . $after;
        $title = esc_attr(strip_tags($title));
 
@@ -96,7 +96,7 @@ function the_title_attribute( $args = '' ) {
  *
  * @since 0.71
  *
- * @param mixed $post Optional. Post ID or object.
+ * @param int|object $post Optional. Post ID or object.
  * @return string
  */
 function get_the_title( $post = 0 ) {
@@ -159,12 +159,12 @@ function get_the_guid( $id = 0 ) {
  * @since 0.71
  *
  * @param string $more_link_text Optional. Content for when there is more text.
- * @param bool $stripteaser Optional. Strip teaser content before the more text. Default is false.
+ * @param bool $strip_teaser Optional. Strip teaser content before the more text. Default is false.
  */
-function the_content($more_link_text = null, $stripteaser = false) {
-       $content = get_the_content($more_link_text, $stripteaser);
-       $content = apply_filters('the_content', $content);
-       $content = str_replace(']]>', ']]&gt;', $content);
+function the_content( $more_link_text = null, $strip_teaser = false) {
+       $content = get_the_content( $more_link_text, $strip_teaser );
+       $content = apply_filters( 'the_content', $content );
+       $content = str_replace( ']]>', ']]&gt;', $content );
        echo $content;
 }
 
@@ -177,52 +177,57 @@ function the_content($more_link_text = null, $stripteaser = false) {
  * @param bool $stripteaser Optional. Strip teaser content before the more text. Default is false.
  * @return string
  */
-function get_the_content( $more_link_text = null, $stripteaser = false ) {
-       global $more, $page, $pages, $multipage, $preview;
+function get_the_content( $more_link_text = null, $strip_teaser = false ) {
+       global $page, $more, $preview, $pages, $multipage;
 
        $post = get_post();
 
        if ( null === $more_link_text )
-               $more_link_text = __( '(more...)' );
+               $more_link_text = __( '(more&hellip;)' );
 
        $output = '';
-       $hasTeaser = false;
+       $has_teaser = false;
 
        // If post password required and it doesn't match the cookie.
-       if ( post_password_required() )
-               return get_the_password_form();
+       if ( post_password_required( $post ) )
+               return get_the_password_form( $post );
 
-       if ( $page > count($pages) ) // if the requested page doesn't exist
-               $page = count($pages); // give them the highest numbered page that DOES exist
+       if ( $page > count( $pages ) ) // if the requested page doesn't exist
+               $page = count( $pages ); // give them the highest numbered page that DOES exist
 
-       $content = $pages[$page-1];
-       if ( preg_match('/<!--more(.*?)?-->/', $content, $matches) ) {
-               $content = explode($matches[0], $content, 2);
-               if ( !empty($matches[1]) && !empty($more_link_text) )
-                       $more_link_text = strip_tags(wp_kses_no_null(trim($matches[1])));
+       $content = $pages[$page - 1];
+       if ( preg_match( '/<!--more(.*?)?-->/', $content, $matches ) ) {
+               $content = explode( $matches[0], $content, 2 );
+               if ( ! empty( $matches[1] ) && ! empty( $more_link_text ) )
+                       $more_link_text = strip_tags( wp_kses_no_null( trim( $matches[1] ) ) );
 
-               $hasTeaser = true;
+               $has_teaser = true;
        } else {
-               $content = array($content);
+               $content = array( $content );
        }
-       if ( (false !== strpos($post->post_content, '<!--noteaser-->') && ((!$multipage) || ($page==1))) )
-               $stripteaser = true;
+
+       if ( false !== strpos( $post->post_content, '<!--noteaser-->' ) && ( ! $multipage || $page == 1 ) )
+               $strip_teaser = true;
+
        $teaser = $content[0];
-       if ( $more && $stripteaser && $hasTeaser )
+
+       if ( $more && $strip_teaser && $has_teaser )
                $teaser = '';
+
        $output .= $teaser;
-       if ( count($content) > 1 ) {
+
+       if ( count( $content ) > 1 ) {
                if ( $more ) {
                        $output .= '<span id="more-' . $post->ID . '"></span>' . $content[1];
                } else {
-                       if ( ! empty($more_link_text) )
+                       if ( ! empty( $more_link_text ) )
                                $output .= apply_filters( 'the_content_more_link', ' <a href="' . get_permalink() . "#more-{$post->ID}\" class=\"more-link\">$more_link_text</a>", $more_link_text );
-                       $output = force_balance_tags($output);
+                       $output = force_balance_tags( $output );
                }
-
        }
+
        if ( $preview ) // preview fix for javascript bug with foreign languages
-               $output =       preg_replace_callback('/\%u([0-9A-F]{4})/', '_convert_urlencoded_to_entities', $output);
+               $output =       preg_replace_callback( '/\%u([0-9A-F]{4})/', '_convert_urlencoded_to_entities', $output );
 
        return $output;
 }
@@ -563,7 +568,7 @@ function get_body_class( $class = '' ) {
  *
  * @since 2.7.0
  *
- * @param int|object $post An optional post. Global $post used if not provided.
+ * @param int|WP_Post $post An optional post. Global $post used if not provided.
  * @return bool false if a password is not required or the correct password cookie is present, true otherwise.
  */
 function post_password_required( $post = null ) {
@@ -578,7 +583,7 @@ function post_password_required( $post = null ) {
        require_once ABSPATH . 'wp-includes/class-phpass.php';
        $hasher = new PasswordHash( 8, true );
 
-       $hash = stripslashes( $_COOKIE[ 'wp-postpass_' . COOKIEHASH ] );
+       $hash = wp_unslash( $_COOKIE[ 'wp-postpass_' . COOKIEHASH ] );
        if ( 0 !== strpos( $hash, '$P$B' ) )
                return true;
 
@@ -599,15 +604,6 @@ function post_password_required( $post = null ) {
  * Quicktag one or more times). This tag must be within The Loop.
  *
  * The defaults for overwriting are:
- * 'next_or_number' - Default is 'number' (string). Indicates whether page
- *      numbers should be used. Valid values are number and next.
- * 'nextpagelink' - Default is 'Next Page' (string). Text for link to next page.
- *      of the bookmark.
- * 'previouspagelink' - Default is 'Previous Page' (string). Text for link to
- *      previous page, if available.
- * 'pagelink' - Default is '%' (String).Format string for page numbers. The % in
- *      the parameter string will be replaced with the page number, so Page %
- *      generates "Page 1", "Page 2", etc. Defaults to %, just the page number.
  * 'before' - Default is '<p> Pages:' (string). The html or text to prepend to
  *      each bookmarks.
  * 'after' - Default is '</p>' (string). The html or text to append to each
@@ -618,20 +614,36 @@ function post_password_required( $post = null ) {
  * 'link_after' - Default is '' (string). The html or text to append to each
  *      Pages link inside the <a> tag. Also appended to the current item, which
  *      is not linked.
+ * 'next_or_number' - Default is 'number' (string). Indicates whether page
+ *      numbers should be used. Valid values are number and next.
+ * 'separator' - Default is ' ' (string). Text used between pagination links.
+ * 'nextpagelink' - Default is 'Next Page' (string). Text for link to next page.
+ *      of the bookmark.
+ * 'previouspagelink' - Default is 'Previous Page' (string). Text for link to
+ *      previous page, if available.
+ * 'pagelink' - Default is '%' (String).Format string for page numbers. The % in
+ *      the parameter string will be replaced with the page number, so Page %
+ *      generates "Page 1", "Page 2", etc. Defaults to %, just the page number.
+ * 'echo' - Default is 1 (integer). When not 0, this triggers the HTML to be
+ *      echoed and then returned.
  *
  * @since 1.2.0
- * @access private
  *
  * @param string|array $args Optional. Overwrite the defaults.
  * @return string Formatted output in HTML.
  */
-function wp_link_pages($args = '') {
+function wp_link_pages( $args = '' ) {
        $defaults = array(
-               'before' => '<p>' . __('Pages:'), 'after' => '</p>',
-               'link_before' => '', 'link_after' => '',
-               'next_or_number' => 'number', 'nextpagelink' => __('Next page'),
-               'previouspagelink' => __('Previous page'), 'pagelink' => '%',
-               'echo' => 1
+               'before'           => '<p>' . __( 'Pages:' ),
+               'after'            => '</p>',
+               'link_before'      => '',
+               'link_after'       => '',
+               'next_or_number'   => 'number',
+               'separator'        => ' ',
+               'nextpagelink'     => __( 'Next page' ),
+               'previouspagelink' => __( 'Previous page' ),
+               'pagelink'         => '%',
+               'echo'             => 1
        );
 
        $r = wp_parse_args( $args, $defaults );
@@ -644,35 +656,34 @@ function wp_link_pages($args = '') {
        if ( $multipage ) {
                if ( 'number' == $next_or_number ) {
                        $output .= $before;
-                       for ( $i = 1; $i < ($numpages+1); $i = $i + 1 ) {
-                               $j = str_replace('%',$i,$pagelink);
-                               $output .= ' ';
-                               if ( ($i != $page) || ((!$more) && ($page==1)) ) {
-                                       $output .= _wp_link_page($i);
-                               }
-                               $output .= $link_before . $j . $link_after;
-                               if ( ($i != $page) || ((!$more) && ($page==1)) )
-                                       $output .= '</a>';
+                       for ( $i = 1; $i <= $numpages; $i++ ) {
+                               $link = $link_before . str_replace( '%', $i, $pagelink ) . $link_after;
+                               if ( $i != $page || ! $more && 1 == $page )
+                                       $link = _wp_link_page( $i ) . $link . '</a>';
+                               $link = apply_filters( 'wp_link_pages_link', $link, $i );
+                               $output .= $separator . $link;
                        }
                        $output .= $after;
-               } else {
-                       if ( $more ) {
-                               $output .= $before;
-                               $i = $page - 1;
-                               if ( $i && $more ) {
-                                       $output .= _wp_link_page($i);
-                                       $output .= $link_before. $previouspagelink . $link_after . '</a>';
-                               }
-                               $i = $page + 1;
-                               if ( $i <= $numpages && $more ) {
-                                       $output .= _wp_link_page($i);
-                                       $output .= $link_before. $nextpagelink . $link_after . '</a>';
-                               }
-                               $output .= $after;
+               } elseif ( $more ) {
+                       $output .= $before;
+                       $i = $page - 1;
+                       if ( $i ) {
+                               $link = _wp_link_page( $i ) . $link_before . $previouspagelink . $link_after . '</a>';
+                               $link = apply_filters( 'wp_link_pages_link', $link, $i );
+                               $output .= $separator . $link;
                        }
+                       $i = $page + 1;
+                       if ( $i <= $numpages ) {
+                               $link = _wp_link_page( $i ) . $link_before . $nextpagelink . $link_after . '</a>';
+                               $link = apply_filters( 'wp_link_pages_link', $link, $i );
+                               $output .= $separator . $link;
+                       }
+                       $output .= $after;
                }
        }
 
+       $output = apply_filters( 'wp_link_pages', $output, $args );
+
        if ( $echo )
                echo $output;
 
@@ -1023,7 +1034,7 @@ class Walker_Page extends Walker {
         * @param int $current_page Page ID.
         * @param array $args
         */
-       function start_el( &$output, $page, $depth, $args, $current_page = 0 ) {
+       function start_el( &$output, $page, $depth = 0, $args = array(), $current_page = 0 ) {
                if ( $depth )
                        $indent = str_repeat("\t", $depth);
                else
@@ -1045,6 +1056,9 @@ class Walker_Page extends Walker {
 
                $css_class = implode( ' ', apply_filters( 'page_css_class', $css_class, $page, $depth, $args, $current_page ) );
 
+               if ( '' === $page->post_title )
+                       $page->post_title = sprintf( __( '#%d (no title)' ), $page->ID );
+
                $output .= $indent . '<li class="' . $css_class . '"><a href="' . get_permalink($page->ID) . '">' . $link_before . apply_filters( 'the_title', $page->post_title, $page->ID ) . $link_after . '</a>';
 
                if ( !empty($show_date) ) {
@@ -1105,7 +1119,7 @@ class Walker_PageDropdown extends Walker {
         * @param array $args Uses 'selected' argument for selected page to set selected HTML attribute for option element.
         * @param int $id
         */
-       function start_el(&$output, $page, $depth, $args, $id = 0) {
+       function start_el( &$output, $page, $depth = 0, $args = array(), $id = 0 ) {
                $pad = str_repeat('&nbsp;', $depth * 3);
 
                $output .= "\t<option class=\"level-$depth\" value=\"$page->ID\"";
@@ -1213,11 +1227,11 @@ function prepend_attachment($content) {
  *
  * @since 1.0.0
  * @uses apply_filters() Calls 'the_password_form' filter on output.
- *
+ * @param int|WP_Post $post Optional. A post id or post object. Defaults to the current post when in The Loop, undefined otherwise.
  * @return string HTML content for password form for password protected post.
  */
-function get_the_password_form() {
-       $post = get_post();
+function get_the_password_form( $post = 0 ) {
+       $post = get_post( $post );
        $label = 'pwbox-' . ( empty($post->ID) ? rand() : $post->ID );
        $output = '<form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" method="post">
        <p>' . __("This post is password protected. To view it please enter your password below:") . '</p>
@@ -1238,7 +1252,7 @@ function get_the_password_form() {
  * @uses $wp_query
  *
  * @param string $template The specific template name if specific matching is required.
- * @return bool False on failure, true if success.
+ * @return bool True on success, false on failure.
  */
 function is_page_template( $template = '' ) {
        if ( ! is_page() )
@@ -1263,13 +1277,13 @@ function is_page_template( $template = '' ) {
  *
  * @since 3.4.0
  *
- * @param int $post_id The page ID to check. Defaults to the current post, when used in the loop.
+ * @param int $post_id Optional. The page ID to check. Defaults to the current post, when used in the loop.
  * @return string|bool Page template filename. Returns an empty string when the default page template
  *     is in use. Returns false if the post is not a page.
  */
 function get_page_template_slug( $post_id = null ) {
        $post = get_post( $post_id );
-       if ( 'page' != $post->post_type )
+       if ( ! $post || 'page' != $post->post_type )
                return false;
        $template = get_post_meta( $post->ID, '_wp_page_template', true );
        if ( ! $template || 'default' == $template )
@@ -1300,9 +1314,9 @@ function wp_post_revision_title( $revision, $link = true ) {
        /* translators: revision date format, see http://php.net/date */
        $datef = _x( 'j F, Y @ G:i', 'revision date format');
        /* translators: 1: date */
-       $autosavef = __( '%1$s [Autosave]' );
+       $autosavef = _x( '%1$s [Autosave]', 'post revision title extra' );
        /* translators: 1: date */
-       $currentf  = __( '%1$s [Current Revision]' );
+       $currentf  = _x( '%1$s [Current Revision]', 'post revision title extra' );
 
        $date = date_i18n( $datef, strtotime( $revision->post_modified ) );
        if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) )
@@ -1316,145 +1330,129 @@ function wp_post_revision_title( $revision, $link = true ) {
        return $date;
 }
 
+/**
+ * Retrieve formatted date timestamp of a revision (linked to that revisions's page).
+ *
+ * @package WordPress
+ * @subpackage Post_Revisions
+ * @since 3.6.0
+ *
+ * @uses date_i18n()
+ *
+ * @param int|object $revision Revision ID or revision object.
+ * @param bool $link Optional, default is true. Link to revisions's page?
+ * @return string gravatar, user, i18n formatted datetimestamp or localized 'Current Revision'.
+ */
+function wp_post_revision_title_expanded( $revision, $link = true ) {
+       if ( !$revision = get_post( $revision ) )
+               return $revision;
+
+       if ( !in_array( $revision->post_type, array( 'post', 'page', 'revision' ) ) )
+               return false;
+
+       $author = get_the_author_meta( 'display_name', $revision->post_author );
+       /* translators: revision date format, see http://php.net/date */
+       $datef = _x( 'j F, Y @ G:i:s', 'revision date format');
+
+       $gravatar = get_avatar( $revision->post_author, 24 );
+
+       $date = date_i18n( $datef, strtotime( $revision->post_modified ) );
+       if ( $link && current_user_can( 'edit_post', $revision->ID ) && $link = get_edit_post_link( $revision->ID ) )
+               $date = "<a href='$link'>$date</a>";
+
+       $revision_date_author = sprintf(
+               /* translators: post revision title: 1: author avatar, 2: author name, 3: time ago, 4: date */
+               _x( '%1$s %2$s, %3$s ago (%4$s)', 'post revision title' ),
+               $gravatar,
+               $author,
+               human_time_diff( strtotime( $revision->post_modified ), current_time( 'timestamp' ) ),
+               $date
+       );
+
+       $autosavef = __( '%1$s [Autosave]' );
+       $currentf  = __( '%1$s [Current Revision]' );
+
+       if ( !wp_is_post_revision( $revision ) )
+               $revision_date_author = sprintf( $currentf, $revision_date_author );
+       elseif ( wp_is_post_autosave( $revision ) )
+               $revision_date_author = sprintf( $autosavef, $revision_date_author );
+
+       return $revision_date_author;
+}
+
 /**
  * Display list of a post's revisions.
  *
  * Can output either a UL with edit links or a TABLE with diff interface, and
  * restore action links.
  *
- * Second argument controls parameters:
- *   (bool)   parent : include the parent (the "Current Revision") in the list.
- *   (string) format : 'list' or 'form-table'. 'list' outputs UL, 'form-table'
- *                     outputs TABLE with UI.
- *   (int)    right  : what revision is currently being viewed - used in
- *                     form-table format.
- *   (int)    left   : what revision is currently being diffed against right -
- *                     used in form-table format.
- *
  * @package WordPress
  * @subpackage Post_Revisions
  * @since 2.6.0
  *
  * @uses wp_get_post_revisions()
- * @uses wp_post_revision_title()
+ * @uses wp_post_revision_title_expanded()
  * @uses get_edit_post_link()
  * @uses get_the_author_meta()
  *
- * @todo split into two functions (list, form-table) ?
- *
  * @param int|object $post_id Post ID or post object.
- * @param string|array $args See description {@link wp_parse_args()}.
+ * @param string $type 'all' (default), 'revision' or 'autosave'
  * @return null
  */
-function wp_list_post_revisions( $post_id = 0, $args = null ) {
-       if ( !$post = get_post( $post_id ) )
+function wp_list_post_revisions( $post_id = 0, $type = 'all' ) {
+       if ( ! $post = get_post( $post_id ) )
                return;
 
-       $defaults = array( 'parent' => false, 'right' => false, 'left' => false, 'format' => 'list', 'type' => 'all' );
-       extract( wp_parse_args( $args, $defaults ), EXTR_SKIP );
-
-       switch ( $type ) {
-               case 'autosave' :
-                       if ( !$autosave = wp_get_post_autosave( $post->ID ) )
-                               return;
-                       $revisions = array( $autosave );
-                       break;
-               case 'revision' : // just revisions - remove autosave later
-               case 'all' :
-               default :
-                       if ( !$revisions = wp_get_post_revisions( $post->ID ) )
-                               return;
-                       break;
+       // $args array with (parent, format, right, left, type) deprecated since 3.6
+       if ( is_array( $type ) ) {
+               $type = ! empty( $type['type'] ) ? $type['type']  : $type;
+               _deprecated_argument( __FUNCTION__, '3.6' );
        }
 
-       /* translators: post revision: 1: when, 2: author name */
-       $titlef = _x( '%1$s by %2$s', 'post revision' );
-
-       if ( $parent )
-               array_unshift( $revisions, $post );
+       if ( ! $revisions = wp_get_post_revisions( $post->ID ) )
+               return;
 
-       $rows = $right_checked = '';
-       $class = false;
-       $can_edit_post = current_user_can( 'edit_post', $post->ID );
+       $rows = '';
        foreach ( $revisions as $revision ) {
-               if ( !current_user_can( 'read_post', $revision->ID ) )
-                       continue;
-               if ( 'revision' === $type && wp_is_post_autosave( $revision ) )
+               if ( ! current_user_can( 'read_post', $revision->ID ) )
                        continue;
 
-               $date = wp_post_revision_title( $revision );
-               $name = get_the_author_meta( 'display_name', $revision->post_author );
-
-               if ( 'form-table' == $format ) {
-                       if ( $left )
-                               $left_checked = $left == $revision->ID ? ' checked="checked"' : '';
-                       else
-                               $left_checked = $right_checked ? ' checked="checked"' : ''; // [sic] (the next one)
-                       $right_checked = $right == $revision->ID ? ' checked="checked"' : '';
-
-                       $class = $class ? '' : " class='alternate'";
+               $is_autosave = wp_is_post_autosave( $revision );
+               if ( ( 'revision' === $type && $is_autosave ) || ( 'autosave' === $type && ! $is_autosave ) )
+                       continue;
 
-                       if ( $post->ID != $revision->ID && $can_edit_post )
-                               $actions = '<a href="' . wp_nonce_url( add_query_arg( array( 'revision' => $revision->ID, 'action' => 'restore' ) ), "restore-post_$post->ID|$revision->ID" ) . '">' . __( 'Restore' ) . '</a>';
-                       else
-                               $actions = '';
-
-                       $rows .= "<tr$class>\n";
-                       $rows .= "\t<th style='white-space: nowrap' scope='row'><input type='radio' name='left' value='$revision->ID'$left_checked /></th>\n";
-                       $rows .= "\t<th style='white-space: nowrap' scope='row'><input type='radio' name='right' value='$revision->ID'$right_checked /></th>\n";
-                       $rows .= "\t<td>$date</td>\n";
-                       $rows .= "\t<td>$name</td>\n";
-                       $rows .= "\t<td class='action-links'>$actions</td>\n";
-                       $rows .= "</tr>\n";
-               } else {
-                       $title = sprintf( $titlef, $date, $name );
-                       $rows .= "\t<li>$title</li>\n";
-               }
+               $rows .= "\t<li>" . wp_post_revision_title_expanded( $revision ) . "</li>\n";
        }
 
-       if ( 'form-table' == $format ) : ?>
-
-<form action="revision.php" method="get">
-
-<div class="tablenav">
-       <div class="alignleft">
-               <input type="submit" class="button-secondary" value="<?php esc_attr_e( 'Compare Revisions' ); ?>" />
-               <input type="hidden" name="action" value="diff" />
-               <input type="hidden" name="post_type" value="<?php echo esc_attr($post->post_type); ?>" />
-       </div>
-</div>
-
-<br class="clear" />
-
-<table class="widefat post-revisions" cellspacing="0" id="post-revisions">
-       <col />
-       <col />
-       <col style="width: 33%" />
-       <col style="width: 33%" />
-       <col style="width: 33%" />
-<thead>
-<tr>
-       <th scope="col"><?php /* translators: column name in revisions */ _ex( 'Old', 'revisions column name' ); ?></th>
-       <th scope="col"><?php /* translators: column name in revisions */ _ex( 'New', 'revisions column name' ); ?></th>
-       <th scope="col"><?php /* translators: column name in revisions */ _ex( 'Date Created', 'revisions column name' ); ?></th>
-       <th scope="col"><?php _e( 'Author' ); ?></th>
-       <th scope="col" class="action-links"><?php _e( 'Actions' ); ?></th>
-</tr>
-</thead>
-<tbody>
-
-<?php echo $rows; ?>
-
-</tbody>
-</table>
-
-</form>
-
-<?php
-       else :
-               echo "<ul class='post-revisions'>\n";
-               echo $rows;
+       echo "<div class='hide-if-js'><p>" . __( 'JavaScript must be enabled to use this feature.' ) . "</p></div>\n";
+
+       echo "<ul class='post-revisions hide-if-no-js'>\n";
+       echo $rows;
+
+       // if the post was previously restored from a revision
+       // show the restore event details
+       if ( $restored_from_meta = get_post_meta( $post->ID, '_post_restored_from', true ) ) {
+               $author = get_user_by( 'id', $restored_from_meta[ 'restored_by_user' ] );
+               /* translators: revision date format, see http://php.net/date */
+               $datef = _x( 'j F, Y @ G:i:s', 'revision date format');
+               $date = date_i18n( $datef, strtotime( $restored_from_meta[ 'restored_time' ] ) );
+               $time_diff = human_time_diff( $restored_from_meta[ 'restored_time' ] ) ;
+               ?>
+               <hr />
+               <div id="revisions-meta-restored">
+                       <?php
+                       printf(
+                               /* translators: restored revision details: 1: gravatar image, 2: author name, 3: time ago, 4: date */
+                               __( 'Previously restored by %1$s %2$s, %3$s ago (%4$s)' ),
+                               get_avatar( $author->ID, 24 ),
+                               $author->display_name,
+                               $time_diff,
+                               $date
+                       );
+                       ?>
+               </div>
+               <?php
                echo "</ul>";
-       endif;
+       }
 
 }
index 16952d03c86125ab7e54bcd6a26bc41fa21f874b..dda0e34a1edb47fc1a6628a4b6f7aa4cfe3fca63 100644 (file)
@@ -39,7 +39,7 @@ function get_post_thumbnail_id( $post_id = null ) {
  *
  * @since 2.9.0
  *
- * @param int $size Optional. Image size. Defaults to 'post-thumbnail', which theme sets using set_post_thumbnail_size( $width, $height, $crop_flag );.
+ * @param string|array $size Optional. Image size. Defaults to 'post-thumbnail', which theme sets using set_post_thumbnail_size( $width, $height, $crop_flag );.
  * @param string|array $attr Optional. Query string or array of attributes.
  */
 function the_post_thumbnail( $size = 'post-thumbnail', $attr = '' ) {
index 870bec7a6e93c0b2463efc9fbba41b57f1f5fb8d..c8888c6ede96cd9d2aaadde6134ce0d7f1c90ee3 100644 (file)
@@ -203,7 +203,7 @@ function get_attached_file( $attachment_id, $unfiltered = false ) {
  *
  * @param int $attachment_id Attachment ID
  * @param string $file File path for the attachment
- * @return bool False on failure, true on success.
+ * @return bool True on success, false on failure.
  */
 function update_attached_file( $attachment_id, $file ) {
        if ( !get_post( $attachment_id ) )
@@ -360,7 +360,7 @@ function get_extended($post) {
                $more_text = '';
        }
 
-       // Strip leading and trailing whitespace
+       // ` leading and trailing whitespace
        $main = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $main);
        $extended = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $extended);
        $more_text = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $more_text);
@@ -567,6 +567,17 @@ final class WP_Post {
         */
        public $filter;
 
+       /**
+        * Private variable used by post formats to cache parsed content.
+        *
+        * @since 3.6.0
+        *
+        * @var array
+        * @access private
+        */
+       public $format_content;
+
+
        public static function get_instance( $post_id ) {
                global $wpdb;
 
@@ -713,10 +724,10 @@ function get_post_ancestors( $post ) {
  * @since 2.3.0
  * @uses sanitize_post_field() See for possible $context values.
  *
- * @param string $field Post field name
- * @param id $post Post ID
- * @param string $context Optional. How to filter the field. Default is display.
- * @return bool|string False on failure or returns the value in post field
+ * @param string $field Post field name.
+ * @param int|object $post Post ID or post object.
+ * @param string $context Optional. How to filter the field. Default is 'display'.
+ * @return string The value of the post field on success, empty string on failure.
  */
 function get_post_field( $field, $post, $context = 'display' ) {
        $post = get_post( $post );
@@ -738,8 +749,8 @@ function get_post_field( $field, $post, $context = 'display' ) {
  *
  * @since 2.0.0
  *
- * @param int $ID Optional. Post ID.
- * @return bool|string False on failure or returns the mime type
+ * @param int $ID Optional. Post ID. Default is the current post from the loop.
+ * @return string|bool The mime type on success, false on failure.
  */
 function get_post_mime_type($ID = '') {
        $post = get_post($ID);
@@ -750,71 +761,6 @@ function get_post_mime_type($ID = '') {
        return false;
 }
 
-/**
- * Retrieve the format slug for a post
- *
- * @since 3.1.0
- *
- * @param int|object $post A post
- *
- * @return mixed The format if successful. False if no format is set. WP_Error if errors.
- */
-function get_post_format( $post = null ) {
-       $post = get_post($post);
-
-       if ( ! post_type_supports( $post->post_type, 'post-formats' ) )
-               return false;
-
-       $_format = get_the_terms( $post->ID, 'post_format' );
-
-       if ( empty( $_format ) )
-               return false;
-
-       $format = array_shift( $_format );
-
-       return ( str_replace('post-format-', '', $format->slug ) );
-}
-
-/**
- * Check if a post has a particular format
- *
- * @since 3.1.0
- * @uses has_term()
- *
- * @param string $format The format to check for
- * @param object|id $post The post to check. If not supplied, defaults to the current post if used in the loop.
- * @return bool True if the post has the format, false otherwise.
- */
-function has_post_format( $format, $post = null ) {
-       return has_term('post-format-' . sanitize_key($format), 'post_format', $post);
-}
-
-/**
- * Assign a format to a post
- *
- * @since 3.1.0
- *
- * @param int|object $post The post for which to assign a format
- * @param string $format  A format to assign. Use an empty string or array to remove all formats from the post.
- * @return mixed WP_Error on error. Array of affected term IDs on success.
- */
-function set_post_format( $post, $format ) {
-       $post = get_post($post);
-
-       if ( empty($post) )
-               return new WP_Error('invalid_post', __('Invalid post'));
-
-       if ( !empty($format) ) {
-               $format = sanitize_key($format);
-               if ( 'standard' == $format || !in_array( $format, array_keys( get_post_format_slugs() ) ) )
-                       $format = '';
-               else
-                       $format = 'post-format-' . $format;
-       }
-
-       return wp_set_post_terms($post->ID, $format, 'post_format');
-}
-
 /**
  * Retrieve the post status based on the Post ID.
  *
@@ -823,8 +769,8 @@ function set_post_format( $post, $format ) {
  *
  * @since 2.0.0
  *
- * @param int $ID Post ID
- * @return string|bool Post status or false on failure.
+ * @param int $ID Optional. Post ID. Default is the current post from the loop.
+ * @return string|bool Post status on success, false on failure.
  */
 function get_post_status($ID = '') {
        $post = get_post($ID);
@@ -858,7 +804,7 @@ function get_post_status($ID = '') {
  *
  * @return array List of post statuses.
  */
-function get_post_statuses( ) {
+function get_post_statuses() {
        $status = array(
                'draft'                 => __('Draft'),
                'pending'               => __('Pending Review'),
@@ -879,7 +825,7 @@ function get_post_statuses( ) {
  *
  * @return array List of page statuses.
  */
-function get_page_statuses( ) {
+function get_page_statuses() {
        $status = array(
                'draft'                 => __('Draft'),
                'private'               => __('Private'),
@@ -1063,10 +1009,8 @@ function post_type_exists( $post_type ) {
  *
  * @since 2.1.0
  *
- * @uses $post The Loop current post global
- *
- * @param mixed $post Optional. Post object or post ID.
- * @return bool|string post type or false on failure.
+ * @param int|object $post Optional. Post ID or post object. Default is the current post from the loop.
+ * @return string|bool Post type on success, false on failure.
  */
 function get_post_type( $post = null ) {
        if ( $post = get_post( $post ) )
@@ -1139,7 +1083,7 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' )
  *     * While the default settings of exclude_from_search, publicly_queryable, show_ui, and show_in_nav_menus are
  *       inherited from public, each does not rely on this relationship and controls a very specific intention.
  * - exclude_from_search - Whether to exclude posts with this post type from front end search results.
- *     * If not set, the the opposite of public's current value is used.
+ *     * If not set, the opposite of public's current value is used.
  * - publicly_queryable - Whether queries can be performed on the front end for the post type as part of parse_request().
  *     * ?post_type={post_type_key}
  *     * ?{post_type_key}={single_post_slug}
@@ -1594,11 +1538,8 @@ function add_post_type_support( $post_type, $feature ) {
 function remove_post_type_support( $post_type, $feature ) {
        global $_wp_post_type_features;
 
-       if ( !isset($_wp_post_type_features[$post_type]) )
-               return;
-
-       if ( isset($_wp_post_type_features[$post_type][$feature]) )
-               unset($_wp_post_type_features[$post_type][$feature]);
+       if ( isset( $_wp_post_type_features[$post_type][$feature] ) )
+               unset( $_wp_post_type_features[$post_type][$feature] );
 }
 
 /**
@@ -1630,17 +1571,7 @@ function get_all_post_type_supports( $post_type ) {
 function post_type_supports( $post_type, $feature ) {
        global $_wp_post_type_features;
 
-       if ( !isset( $_wp_post_type_features[$post_type][$feature] ) )
-               return false;
-
-       // If no args passed then no extra checks need be performed
-       if ( func_num_args() <= 2 )
-               return true;
-
-       // @todo Allow pluggable arg checking
-       //$args = array_slice( func_get_args(), 2 );
-
-       return true;
+       return ( isset( $_wp_post_type_features[$post_type][$feature] ) );
 }
 
 /**
@@ -1742,7 +1673,7 @@ function get_posts($args = null) {
  * @param string $meta_key Metadata name.
  * @param mixed $meta_value Metadata value.
  * @param bool $unique Optional, default is false. Whether the same key should not be added.
- * @return bool False for failure. True for success.
+ * @return int|bool Meta ID on success, false on failure.
  */
 function add_post_meta($post_id, $meta_key, $meta_value, $unique = false) {
        // make sure meta is added to the post, not a revision
@@ -1766,7 +1697,7 @@ function add_post_meta($post_id, $meta_key, $meta_value, $unique = false) {
  * @param int $post_id post ID
  * @param string $meta_key Metadata name.
  * @param mixed $meta_value Optional. Metadata value.
- * @return bool False for failure. True for success.
+ * @return bool True on success, false on failure.
  */
 function delete_post_meta($post_id, $meta_key, $meta_value = '') {
        // make sure meta is added to the post, not a revision
@@ -1809,7 +1740,7 @@ function get_post_meta($post_id, $key = '', $single = false) {
  * @param string $meta_key Metadata key.
  * @param mixed $meta_value Metadata value.
  * @param mixed $prev_value Optional. Previous value to check before removing.
- * @return bool False on failure, true if success.
+ * @return bool True on success, false on failure.
  */
 function update_post_meta($post_id, $meta_key, $meta_value, $prev_value = '') {
        // make sure meta is added to the post, not a revision
@@ -2170,7 +2101,7 @@ function wp_count_attachments( $mime_type = '' ) {
        $and = wp_post_mime_type_where( $mime_type );
        $count = $wpdb->get_results( "SELECT post_mime_type, COUNT( * ) AS num_posts FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' $and GROUP BY post_mime_type", ARRAY_A );
 
-       $stats = array( );
+       $stats = array();
        foreach( (array) $count as $row ) {
                $stats[$row['post_mime_type']] = $row['num_posts'];
        }
@@ -2458,7 +2389,7 @@ function wp_untrash_post($post_id = 0) {
  * @uses do_action() on 'trash_post_comments' before trashing
  * @uses do_action() on 'trashed_post_comments' after trashing
  *
- * @param int $post Post ID or object.
+ * @param int|object $post Post ID or object.
  * @return mixed False on failure
  */
 function wp_trash_post_comments($post = null) {
@@ -2499,7 +2430,7 @@ function wp_trash_post_comments($post = null) {
  * @uses do_action() on 'untrash_post_comments' before trashing
  * @uses do_action() on 'untrashed_post_comments' after trashing
  *
- * @param int $post Post ID or object.
+ * @param int|object $post Post ID or object.
  * @return mixed False on failure
  */
 function wp_untrash_post_comments($post = null) {
@@ -2662,7 +2593,7 @@ function wp_get_recent_posts( $args = array(), $output = ARRAY_A ) {
  *
  * If the $postarr parameter has 'ID' set to a value, then post will be updated.
  *
- * You can set the post date manually, but setting the values for 'post_date'
+ * You can set the post date manually, by setting the values for 'post_date'
  * and 'post_date_gmt' keys. You can close the comments or open the comments by
  * setting the value for 'comment_status' key.
  *
@@ -2713,9 +2644,21 @@ function wp_insert_post($postarr, $wp_error = false) {
        extract($postarr, EXTR_SKIP);
 
        // Are we updating or creating?
+       $post_ID = 0;
        $update = false;
-       if ( !empty($ID) ) {
+       if ( ! empty( $ID ) ) {
                $update = true;
+
+               // Get the post ID and GUID
+               $post_ID = $ID;
+               $post_before = get_post( $post_ID );
+               if ( is_null( $post_before ) ) {
+                       if ( $wp_error )
+                               return new WP_Error( 'invalid_post', __( 'Invalid post ID.' ) );
+                       return 0;
+               }
+
+               $guid = get_post_field( 'guid', $post_ID );
                $previous_status = get_post_field('post_status', $ID);
        } else {
                $previous_status = 'new';
@@ -2723,6 +2666,7 @@ function wp_insert_post($postarr, $wp_error = false) {
 
        $maybe_empty = ! $post_content && ! $post_title && ! $post_excerpt && post_type_supports( $post_type, 'editor' )
                && post_type_supports( $post_type, 'title' ) && post_type_supports( $post_type, 'excerpt' );
+
        if ( apply_filters( 'wp_insert_post_empty_content', $maybe_empty, $postarr ) ) {
                if ( $wp_error )
                        return new WP_Error( 'empty_content', __( 'Content, title, and excerpt are empty.' ) );
@@ -2751,15 +2695,6 @@ function wp_insert_post($postarr, $wp_error = false) {
        if ( empty($post_author) )
                $post_author = $user_ID;
 
-       $post_ID = 0;
-
-       // Get the post ID and GUID
-       if ( $update ) {
-               $post_ID = (int) $ID;
-               $guid = get_post_field( 'guid', $post_ID );
-               $post_before = get_post($post_ID);
-       }
-
        // Don't allow contributors to set the post slug for pending review posts
        if ( 'pending' == $post_status && !current_user_can( 'publish_posts' ) )
                $post_name = '';
@@ -2859,11 +2794,11 @@ function wp_insert_post($postarr, $wp_error = false) {
        // expected_slashed (everything!)
        $data = compact( array( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_content_filtered', 'post_title', 'post_excerpt', 'post_status', 'post_type', 'comment_status', 'ping_status', 'post_password', 'post_name', 'to_ping', 'pinged', 'post_modified', 'post_modified_gmt', 'post_parent', 'menu_order', 'guid' ) );
        $data = apply_filters('wp_insert_post_data', $data, $postarr);
-       $data = stripslashes_deep( $data );
+       $data = wp_unslash( $data );
        $where = array( 'ID' => $post_ID );
 
        if ( $update ) {
-               do_action( 'pre_post_update', $post_ID );
+               do_action( 'pre_post_update', $post_ID, $data );
                if ( false === $wpdb->update( $wpdb->posts, $data, $where ) ) {
                        if ( $wp_error )
                                return new WP_Error('db_update_error', __('Could not update post in the database'), $wpdb->last_error);
@@ -2872,7 +2807,7 @@ function wp_insert_post($postarr, $wp_error = false) {
                }
        } else {
                if ( isset($post_mime_type) )
-                       $data['post_mime_type'] = stripslashes( $post_mime_type ); // This isn't in the update
+                       $data['post_mime_type'] = wp_unslash( $post_mime_type ); // This isn't in the update
                // If there is a suggested ID, use it if not already present
                if ( !empty($import_id) ) {
                        $import_id = (int) $import_id;
@@ -2966,14 +2901,20 @@ function wp_update_post( $postarr = array(), $wp_error = false ) {
        if ( is_object($postarr) ) {
                // non-escaped post was passed
                $postarr = get_object_vars($postarr);
-               $postarr = add_magic_quotes($postarr);
+               $postarr = wp_slash($postarr);
        }
 
        // First, get all of the original fields
        $post = get_post($postarr['ID'], ARRAY_A);
 
+       if ( is_null( $post ) ) {
+               if ( $wp_error )
+                       return new WP_Error( 'invalid_post', __( 'Invalid post ID.' ) );
+               return 0;
+       }
+
        // Escape data pulled from DB.
-       $post = add_magic_quotes($post);
+       $post = wp_slash($post);
 
        // Passed post category list overwrites existing category list if not empty.
        if ( isset($postarr['post_category']) && is_array($postarr['post_category'])
@@ -3010,7 +2951,7 @@ function wp_update_post( $postarr = array(), $wp_error = false ) {
  * @uses $wpdb
  * @uses do_action() Calls 'edit_post', 'save_post', and 'wp_insert_post' on post_id and post data.
  *
- * @param mixed $post Post ID or object.
+ * @param int|object $post Post ID or object.
  */
 function wp_publish_post( $post ) {
        global $wpdb;
@@ -3081,7 +3022,7 @@ function check_and_publish_future_post($post_id) {
  * @return string unique slug for the post, based on $post_name (with a -1, -2, etc. suffix)
  */
 function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_parent ) {
-       if ( in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) )
+       if ( in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) || ( 'inherit' == $post_status && 'revision' == $post_type ) )
                return $slug;
 
        global $wpdb, $wp_rewrite;
@@ -3101,8 +3042,8 @@ function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_p
                if ( $post_name_check || in_array( $slug, $feeds ) || apply_filters( 'wp_unique_post_slug_is_bad_attachment_slug', false, $slug ) ) {
                        $suffix = 2;
                        do {
-                               $alt_post_name = substr ($slug, 0, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
-                               $post_name_check = $wpdb->get_var( $wpdb->prepare($check_sql, $alt_post_name, $post_ID ) );
+                               $alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
+                               $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_ID ) );
                                $suffix++;
                        } while ( $post_name_check );
                        $slug = $alt_post_name;
@@ -3118,7 +3059,7 @@ function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_p
                if ( $post_name_check || in_array( $slug, $feeds ) || preg_match( "@^($wp_rewrite->pagination_base)?\d+$@", $slug )  || apply_filters( 'wp_unique_post_slug_is_bad_hierarchical_slug', false, $slug, $post_type, $post_parent ) ) {
                        $suffix = 2;
                        do {
-                               $alt_post_name = substr( $slug, 0, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
+                               $alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
                                $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_ID, $post_parent ) );
                                $suffix++;
                        } while ( $post_name_check );
@@ -3132,7 +3073,7 @@ function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_p
                if ( $post_name_check || in_array( $slug, $feeds ) || apply_filters( 'wp_unique_post_slug_is_bad_flat_slug', false, $slug, $post_type ) ) {
                        $suffix = 2;
                        do {
-                               $alt_post_name = substr( $slug, 0, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
+                               $alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix";
                                $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_type, $post_ID ) );
                                $suffix++;
                        } while ( $post_name_check );
@@ -3143,6 +3084,29 @@ function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_p
        return apply_filters( 'wp_unique_post_slug', $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug );
 }
 
+/**
+ * Truncates a post slug.
+ *
+ * @since 3.6.0
+ * @access private
+ * @uses utf8_uri_encode() Makes sure UTF-8 characters are properly cut and encoded.
+ *
+ * @param string $slug The slug to truncate.
+ * @param int $length Max length of the slug.
+ * @return string The truncated slug.
+ */
+function _truncate_post_slug( $slug, $length = 200 ) {
+       if ( strlen( $slug ) > $length ) {
+               $decoded_slug = urldecode( $slug );
+               if ( $decoded_slug === $slug )
+                       $slug = substr( $slug, 0, $length );
+               else
+                       $slug = utf8_uri_encode( $decoded_slug, $length );
+       }
+
+       return rtrim( $slug, '-' );
+}
+
 /**
  * Adds tags to a post.
  *
@@ -3296,7 +3260,7 @@ function add_ping($post_id, $uri) {
        $new = implode("\n", $pung);
        $new = apply_filters('add_ping', $new);
        // expected_slashed ($new)
-       $new = stripslashes($new);
+       $new = wp_unslash($new);
        return $wpdb->update( $wpdb->posts, array( 'pinged' => $new ), array( 'ID' => $post_id ) );
 }
 
@@ -3383,13 +3347,13 @@ function trackback_url_list($tb_list, $post_id) {
                $excerpt = strip_tags($post_excerpt ? $post_excerpt : $post_content);
 
                if (strlen($excerpt) > 255) {
-                       $excerpt = substr($excerpt,0,252) . '...';
+                       $excerpt = substr($excerpt,0,252) . '&hellip;';
                }
 
                $trackback_urls = explode(',', $tb_list);
                foreach( (array) $trackback_urls as $tb_url) {
                        $tb_url = trim($tb_url);
-                       trackback($tb_url, stripslashes($post_title), $excerpt, $post_id);
+                       trackback($tb_url, wp_unslash($post_title), $excerpt, $post_id);
                }
        }
 }
@@ -3453,12 +3417,11 @@ function get_page_by_path($page_path, $output = OBJECT, $post_type = 'page') {
        $page_path = str_replace('%2F', '/', $page_path);
        $page_path = str_replace('%20', ' ', $page_path);
        $parts = explode( '/', trim( $page_path, '/' ) );
-       $parts = array_map( 'esc_sql', $parts );
+       $parts = esc_sql( $parts );
        $parts = array_map( 'sanitize_title_for_query', $parts );
 
        $in_string = "'". implode( "','", $parts ) . "'";
-       $post_type_sql = $post_type;
-       $wpdb->escape_by_ref( $post_type_sql );
+       $post_type_sql = esc_sql( $post_type );
        $pages = $wpdb->get_results( "SELECT ID, post_name, post_parent, post_type FROM $wpdb->posts WHERE post_name IN ($in_string) AND (post_type = '$post_type_sql' OR post_type = 'attachment')", OBJECT_K );
 
        $revparts = array_reverse( $parts );
@@ -3646,15 +3609,20 @@ function get_pages($args = '') {
        if ( array_diff( $post_status, get_post_stati() ) )
                return $pages;
 
-       $cache = array();
+       // $args can be whatever, only use the args defined in defaults to compute the key
        $key = md5( serialize( compact(array_keys($defaults)) ) );
-       if ( $cache = wp_cache_get( 'get_pages', 'posts' ) ) {
-               if ( is_array($cache) && isset( $cache[ $key ] ) && is_array( $cache[ $key ] ) ) {
-                       // Convert to WP_Post instances
-                       $pages = array_map( 'get_post', $cache[ $key ] );
-                       $pages = apply_filters( 'get_pages', $pages, $r );
-                       return $pages;
-               }
+       $last_changed = wp_cache_get( 'last_changed', 'posts' );
+       if ( ! $last_changed ) {
+               $last_changed = microtime();
+               wp_cache_set( 'last_changed', $last_changed, 'posts' );
+       }
+
+       $cache_key = "get_pages:$key:$last_changed";
+       if ( $cache = wp_cache_get( $cache_key, 'posts' ) ) {
+               // Convert to WP_Post instances
+               $pages = array_map( 'get_post', $cache );
+               $pages = apply_filters('get_pages', $pages, $r);
+               return $pages;
        }
 
        if ( !is_array($cache) )
@@ -3724,15 +3692,15 @@ function get_pages($args = '') {
 
        $join = '';
        $where = "$exclusions $inclusions ";
-       if ( ! empty( $meta_key ) || ! empty( $meta_value ) ) {
+       if ( '' !== $meta_key || '' !== $meta_value ) {
                $join = " LEFT JOIN $wpdb->postmeta ON ( $wpdb->posts.ID = $wpdb->postmeta.post_id )";
 
                // meta_key and meta_value might be slashed
-               $meta_key = stripslashes($meta_key);
-               $meta_value = stripslashes($meta_value);
-               if ( ! empty( $meta_key ) )
+               $meta_key = wp_unslash($meta_key);
+               $meta_value = wp_unslash($meta_value);
+               if ( '' !== $meta_key )
                        $where .= $wpdb->prepare(" AND $wpdb->postmeta.meta_key = %s", $meta_key);
-               if ( ! empty( $meta_value ) )
+               if ( '' !== $meta_value )
                        $where .= $wpdb->prepare(" AND $wpdb->postmeta.meta_value = %s", $meta_value);
 
        }
@@ -3824,8 +3792,11 @@ function get_pages($args = '') {
                }
        }
 
-       $cache[ $key ] = $pages;
-       wp_cache_set( 'get_pages', $cache, 'posts' );
+       $page_structure = array();
+       foreach ( $pages as $page )
+               $page_structure[] = $page->ID;
+
+       wp_cache_set( $cache_key, $page_structure, 'posts' );
 
        // Convert to WP_Post instances
        $pages = array_map( 'get_post', $pages );
@@ -3905,7 +3876,7 @@ function wp_insert_attachment($object, $file = false, $parent = 0) {
        global $wpdb, $user_ID;
 
        $defaults = array('post_status' => 'inherit', 'post_type' => 'post', 'post_author' => $user_ID,
-               'ping_status' => get_option('default_ping_status'), 'post_parent' => 0,
+               'ping_status' => get_option('default_ping_status'), 'post_parent' => 0, 'post_title' => '',
                'menu_order' => 0, 'to_ping' =>  '', 'pinged' => '', 'post_password' => '',
                'guid' => '', 'post_content_filtered' => '', 'post_excerpt' => '', 'import_id' => 0, 'context' => '');
 
@@ -3996,7 +3967,7 @@ function wp_insert_attachment($object, $file = false, $parent = 0) {
 
        // expected_slashed (everything!)
        $data = compact( array( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_content_filtered', 'post_title', 'post_excerpt', 'post_status', 'post_type', 'comment_status', 'ping_status', 'post_password', 'post_name', 'to_ping', 'pinged', 'post_modified', 'post_modified_gmt', 'post_parent', 'menu_order', 'post_mime_type', 'guid' ) );
-       $data = stripslashes_deep( $data );
+       $data = wp_unslash( $data );
 
        if ( $update ) {
                $wpdb->update( $wpdb->posts, $data, array( 'ID' => $post_ID ) );
@@ -4632,7 +4603,7 @@ function update_post_cache( &$posts ) {
  *
  * @uses do_action() Calls 'clean_post_cache' on $id before adding children (if any).
  *
- * @param object|int $post The post object or ID to remove from the cache
+ * @param int|object $post Post ID or object to remove from the cache
  */
 function clean_post_cache( $post ) {
        global $_wp_suspend_cache_invalidation, $wpdb;
@@ -4660,6 +4631,8 @@ function clean_post_cache( $post ) {
                wp_cache_delete( 'all_page_ids', 'posts' );
                do_action( 'clean_page_cache', $post->ID );
        }
+
+       wp_cache_set( 'last_changed', microtime(), 'posts' );
 }
 
 /**
@@ -4820,7 +4793,7 @@ function _transition_post_status($new_status, $old_status, $post) {
  *   wp_transition_post_status() and the default filter for _future_post_hook().
  * @param object $post Object type containing the post information
  */
-function _future_post_hook( $deprecated = '', $post ) {
+function _future_post_hook( $deprecated, $post ) {
        wp_clear_scheduled_hook( 'publish_future_post', array( $post->ID ) );
        wp_schedule_single_event( strtotime( get_gmt_from_date( $post->post_date ) . ' GMT') , 'publish_future_post', array( $post->ID ) );
 }
@@ -4830,15 +4803,12 @@ function _future_post_hook( $deprecated = '', $post ) {
  *
  * @since 2.3.0
  * @access private
- * @uses $wpdb
- * @uses XMLRPC_REQUEST constant.
- * @uses do_action() Calls 'xmlprc_publish_post' on post ID if XMLRPC_REQUEST is defined.
+ * @uses XMLRPC_REQUEST and WP_IMPORTING constants.
+ * @uses do_action() Calls 'xmlrpc_publish_post' on post ID if XMLRPC_REQUEST is defined.
  *
  * @param int $post_id The ID in the database table of the post being published
  */
 function _publish_post_hook($post_id) {
-       global $wpdb;
-
        if ( defined('XMLRPC_REQUEST') )
                do_action('xmlrpc_publish_post', $post_id);
 
@@ -4852,405 +4822,6 @@ function _publish_post_hook($post_id) {
        wp_schedule_single_event(time(), 'do_pings');
 }
 
-/**
- * Determines which fields of posts are to be saved in revisions.
- *
- * Does two things. If passed a post *array*, it will return a post array ready
- * to be inserted into the posts table as a post revision. Otherwise, returns
- * an array whose keys are the post fields to be saved for post revisions.
- *
- * @package WordPress
- * @subpackage Post_Revisions
- * @since 2.6.0
- * @access private
- * @uses apply_filters() Calls '_wp_post_revision_fields' on 'title', 'content' and 'excerpt' fields.
- *
- * @param array $post Optional a post array to be processed for insertion as a post revision.
- * @param bool $autosave optional Is the revision an autosave?
- * @return array Post array ready to be inserted as a post revision or array of fields that can be versioned.
- */
-function _wp_post_revision_fields( $post = null, $autosave = false ) {
-       static $fields = false;
-
-       if ( !$fields ) {
-               // Allow these to be versioned
-               $fields = array(
-                       'post_title' => __( 'Title' ),
-                       'post_content' => __( 'Content' ),
-                       'post_excerpt' => __( 'Excerpt' ),
-               );
-
-               // Runs only once
-               $fields = apply_filters( '_wp_post_revision_fields', $fields );
-
-               // WP uses these internally either in versioning or elsewhere - they cannot be versioned
-               foreach ( array( 'ID', 'post_name', 'post_parent', 'post_date', 'post_date_gmt', 'post_status', 'post_type', 'comment_count', 'post_author' ) as $protect )
-                       unset( $fields[$protect] );
-       }
-
-       if ( !is_array($post) )
-               return $fields;
-
-       $return = array();
-       foreach ( array_intersect( array_keys( $post ), array_keys( $fields ) ) as $field )
-               $return[$field] = $post[$field];
-
-       $return['post_parent']   = $post['ID'];
-       $return['post_status']   = 'inherit';
-       $return['post_type']     = 'revision';
-       $return['post_name']     = $autosave ? "$post[ID]-autosave" : "$post[ID]-revision";
-       $return['post_date']     = isset($post['post_modified']) ? $post['post_modified'] : '';
-       $return['post_date_gmt'] = isset($post['post_modified_gmt']) ? $post['post_modified_gmt'] : '';
-
-       return $return;
-}
-
-/**
- * Saves an already existing post as a post revision.
- *
- * Typically used immediately prior to post updates.
- *
- * @package WordPress
- * @subpackage Post_Revisions
- * @since 2.6.0
- *
- * @uses _wp_put_post_revision()
- *
- * @param int $post_id The ID of the post to save as a revision.
- * @return mixed Null or 0 if error, new revision ID, if success.
- */
-function wp_save_post_revision( $post_id ) {
-       // We do autosaves manually with wp_create_post_autosave()
-       if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
-               return;
-
-       // WP_POST_REVISIONS = 0, false
-       if ( ! WP_POST_REVISIONS )
-               return;
-
-       if ( !$post = get_post( $post_id, ARRAY_A ) )
-               return;
-
-       if ( 'auto-draft' == $post['post_status'] )
-               return;
-
-       if ( !post_type_supports($post['post_type'], 'revisions') )
-               return;
-
-       $return = _wp_put_post_revision( $post );
-
-       // WP_POST_REVISIONS = true (default), -1
-       if ( !is_numeric( WP_POST_REVISIONS ) || WP_POST_REVISIONS < 0 )
-               return $return;
-
-       // all revisions and (possibly) one autosave
-       $revisions = wp_get_post_revisions( $post_id, array( 'order' => 'ASC' ) );
-
-       // WP_POST_REVISIONS = (int) (# of autosaves to save)
-       $delete = count($revisions) - WP_POST_REVISIONS;
-
-       if ( $delete < 1 )
-               return $return;
-
-       $revisions = array_slice( $revisions, 0, $delete );
-
-       for ( $i = 0; isset($revisions[$i]); $i++ ) {
-               if ( false !== strpos( $revisions[$i]->post_name, 'autosave' ) )
-                       continue;
-               wp_delete_post_revision( $revisions[$i]->ID );
-       }
-
-       return $return;
-}
-
-/**
- * Retrieve the autosaved data of the specified post.
- *
- * Returns a post object containing the information that was autosaved for the
- * specified post.
- *
- * @package WordPress
- * @subpackage Post_Revisions
- * @since 2.6.0
- *
- * @param int $post_id The post ID.
- * @return object|bool The autosaved data or false on failure or when no autosave exists.
- */
-function wp_get_post_autosave( $post_id ) {
-
-       if ( !$post = get_post( $post_id ) )
-               return false;
-
-       $q = array(
-               'name' => "{$post->ID}-autosave",
-               'post_parent' => $post->ID,
-               'post_type' => 'revision',
-               'post_status' => 'inherit'
-       );
-
-       // Use WP_Query so that the result gets cached
-       $autosave_query = new WP_Query;
-
-       add_action( 'parse_query', '_wp_get_post_autosave_hack' );
-       $autosave = $autosave_query->query( $q );
-       remove_action( 'parse_query', '_wp_get_post_autosave_hack' );
-
-       if ( $autosave && is_array($autosave) && is_object($autosave[0]) )
-               return $autosave[0];
-
-       return false;
-}
-
-/**
- * Internally used to hack WP_Query into submission.
- *
- * @package WordPress
- * @subpackage Post_Revisions
- * @since 2.6.0
- *
- * @param object $query WP_Query object
- */
-function _wp_get_post_autosave_hack( $query ) {
-       $query->is_single = false;
-}
-
-/**
- * Determines if the specified post is a revision.
- *
- * @package WordPress
- * @subpackage Post_Revisions
- * @since 2.6.0
- *
- * @param int|object $post Post ID or post object.
- * @return bool|int False if not a revision, ID of revision's parent otherwise.
- */
-function wp_is_post_revision( $post ) {
-       if ( !$post = wp_get_post_revision( $post ) )
-               return false;
-       return (int) $post->post_parent;
-}
-
-/**
- * Determines if the specified post is an autosave.
- *
- * @package WordPress
- * @subpackage Post_Revisions
- * @since 2.6.0
- *
- * @param int|object $post Post ID or post object.
- * @return bool|int False if not a revision, ID of autosave's parent otherwise
- */
-function wp_is_post_autosave( $post ) {
-       if ( !$post = wp_get_post_revision( $post ) )
-               return false;
-       if ( "{$post->post_parent}-autosave" !== $post->post_name )
-               return false;
-       return (int) $post->post_parent;
-}
-
-/**
- * Inserts post data into the posts table as a post revision.
- *
- * @package WordPress
- * @subpackage Post_Revisions
- * @since 2.6.0
- *
- * @uses wp_insert_post()
- *
- * @param int|object|array $post Post ID, post object OR post array.
- * @param bool $autosave Optional. Is the revision an autosave?
- * @return mixed Null or 0 if error, new revision ID if success.
- */
-function _wp_put_post_revision( $post = null, $autosave = false ) {
-       if ( is_object($post) )
-               $post = get_object_vars( $post );
-       elseif ( !is_array($post) )
-               $post = get_post($post, ARRAY_A);
-       if ( !$post || empty($post['ID']) )
-               return;
-
-       if ( isset($post['post_type']) && 'revision' == $post['post_type'] )
-               return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) );
-
-       $post = _wp_post_revision_fields( $post, $autosave );
-       $post = add_magic_quotes($post); //since data is from db
-
-       $revision_id = wp_insert_post( $post );
-       if ( is_wp_error($revision_id) )
-               return $revision_id;
-
-       if ( $revision_id )
-               do_action( '_wp_put_post_revision', $revision_id );
-       return $revision_id;
-}
-
-/**
- * Gets a post revision.
- *
- * @package WordPress
- * @subpackage Post_Revisions
- * @since 2.6.0
- *
- * @uses get_post()
- *
- * @param int|object $post Post ID or post object
- * @param string $output Optional. OBJECT, ARRAY_A, or ARRAY_N.
- * @param string $filter Optional sanitation filter. @see sanitize_post()
- * @return mixed Null if error or post object if success
- */
-function wp_get_post_revision(&$post, $output = OBJECT, $filter = 'raw') {
-       $null = null;
-       if ( !$revision = get_post( $post, OBJECT, $filter ) )
-               return $revision;
-       if ( 'revision' !== $revision->post_type )
-               return $null;
-
-       if ( $output == OBJECT ) {
-               return $revision;
-       } elseif ( $output == ARRAY_A ) {
-               $_revision = get_object_vars($revision);
-               return $_revision;
-       } elseif ( $output == ARRAY_N ) {
-               $_revision = array_values(get_object_vars($revision));
-               return $_revision;
-       }
-
-       return $revision;
-}
-
-/**
- * Restores a post to the specified revision.
- *
- * Can restore a past revision using all fields of the post revision, or only selected fields.
- *
- * @package WordPress
- * @subpackage Post_Revisions
- * @since 2.6.0
- *
- * @uses wp_get_post_revision()
- * @uses wp_update_post()
- * @uses do_action() Calls 'wp_restore_post_revision' on post ID and revision ID if wp_update_post()
- *  is successful.
- *
- * @param int|object $revision_id Revision ID or revision object.
- * @param array $fields Optional. What fields to restore from. Defaults to all.
- * @return mixed Null if error, false if no fields to restore, (int) post ID if success.
- */
-function wp_restore_post_revision( $revision_id, $fields = null ) {
-       if ( !$revision = wp_get_post_revision( $revision_id, ARRAY_A ) )
-               return $revision;
-
-       if ( !is_array( $fields ) )
-               $fields = array_keys( _wp_post_revision_fields() );
-
-       $update = array();
-       foreach( array_intersect( array_keys( $revision ), $fields ) as $field )
-               $update[$field] = $revision[$field];
-
-       if ( !$update )
-               return false;
-
-       $update['ID'] = $revision['post_parent'];
-
-       $update = add_magic_quotes( $update ); //since data is from db
-
-       $post_id = wp_update_post( $update );
-       if ( is_wp_error( $post_id ) )
-               return $post_id;
-
-       if ( $post_id )
-               do_action( 'wp_restore_post_revision', $post_id, $revision['ID'] );
-
-       return $post_id;
-}
-
-/**
- * Deletes a revision.
- *
- * Deletes the row from the posts table corresponding to the specified revision.
- *
- * @package WordPress
- * @subpackage Post_Revisions
- * @since 2.6.0
- *
- * @uses wp_get_post_revision()
- * @uses wp_delete_post()
- *
- * @param int|object $revision_id Revision ID or revision object.
- * @return mixed Null or WP_Error if error, deleted post if success.
- */
-function wp_delete_post_revision( $revision_id ) {
-       if ( !$revision = wp_get_post_revision( $revision_id ) )
-               return $revision;
-
-       $delete = wp_delete_post( $revision->ID );
-       if ( is_wp_error( $delete ) )
-               return $delete;
-
-       if ( $delete )
-               do_action( 'wp_delete_post_revision', $revision->ID, $revision );
-
-       return $delete;
-}
-
-/**
- * Returns all revisions of specified post.
- *
- * @package WordPress
- * @subpackage Post_Revisions
- * @since 2.6.0
- *
- * @uses get_children()
- *
- * @param int|object $post_id Post ID or post object
- * @return array empty if no revisions
- */
-function wp_get_post_revisions( $post_id = 0, $args = null ) {
-       if ( ! WP_POST_REVISIONS )
-               return array();
-       if ( ( !$post = get_post( $post_id ) ) || empty( $post->ID ) )
-               return array();
-
-       $defaults = array( 'order' => 'DESC', 'orderby' => 'date' );
-       $args = wp_parse_args( $args, $defaults );
-       $args = array_merge( $args, array( 'post_parent' => $post->ID, 'post_type' => 'revision', 'post_status' => 'inherit' ) );
-
-       if ( !$revisions = get_children( $args ) )
-               return array();
-       return $revisions;
-}
-
-function _set_preview($post) {
-
-       if ( ! is_object($post) )
-               return $post;
-
-       $preview = wp_get_post_autosave($post->ID);
-
-       if ( ! is_object($preview) )
-               return $post;
-
-       $preview = sanitize_post($preview);
-
-       $post->post_content = $preview->post_content;
-       $post->post_title = $preview->post_title;
-       $post->post_excerpt = $preview->post_excerpt;
-
-       return $post;
-}
-
-function _show_post_preview() {
-
-       if ( isset($_GET['preview_id']) && isset($_GET['preview_nonce']) ) {
-               $id = (int) $_GET['preview_id'];
-
-               if ( false == wp_verify_nonce( $_GET['preview_nonce'], 'post_preview_' . $id ) )
-                       wp_die( __('You do not have permission to preview drafts.') );
-
-               add_filter('the_preview', '_set_preview');
-       }
-}
-
 /**
  * Returns the post's parent's post_ID
  *
@@ -5310,57 +4881,6 @@ function wp_check_post_hierarchy_for_loops( $post_parent, $post_ID ) {
        return $post_parent;
 }
 
-/**
- * Returns an array of post format slugs to their translated and pretty display versions
- *
- * @since 3.1.0
- *
- * @return array The array of translations
- */
-function get_post_format_strings() {
-       $strings = array(
-               'standard' => _x( 'Standard', 'Post format' ), // Special case. any value that evals to false will be considered standard
-               'aside'    => _x( 'Aside',    'Post format' ),
-               'chat'     => _x( 'Chat',     'Post format' ),
-               'gallery'  => _x( 'Gallery',  'Post format' ),
-               'link'     => _x( 'Link',     'Post format' ),
-               'image'    => _x( 'Image',    'Post format' ),
-               'quote'    => _x( 'Quote',    'Post format' ),
-               'status'   => _x( 'Status',   'Post format' ),
-               'video'    => _x( 'Video',    'Post format' ),
-               'audio'    => _x( 'Audio',    'Post format' ),
-       );
-       return $strings;
-}
-
-/**
- * Retrieves an array of post format slugs.
- *
- * @since 3.1.0
- *
- * @return array The array of post format slugs.
- */
-function get_post_format_slugs() {
-       $slugs = array_keys( get_post_format_strings() );
-       return array_combine( $slugs, $slugs );
-}
-
-/**
- * Returns a pretty, translated version of a post format slug
- *
- * @since 3.1.0
- *
- * @param string $slug A post format slug
- * @return string The translated post format name
- */
-function get_post_format_string( $slug ) {
-       $strings = get_post_format_strings();
-       if ( !$slug )
-               return $strings['standard'];
-       else
-               return ( isset( $strings[$slug] ) ) ? $strings[$slug] : '';
-}
-
 /**
  * Sets a post thumbnail.
  *
@@ -5397,21 +4917,6 @@ function delete_post_thumbnail( $post ) {
        return false;
 }
 
-/**
- * Returns a link to a post format index.
- *
- * @since 3.1.0
- *
- * @param string $format Post format
- * @return string Link
- */
-function get_post_format_link( $format ) {
-       $term = get_term_by('slug', 'post-format-' . $format, 'post_format' );
-       if ( ! $term || is_wp_error( $term ) )
-               return false;
-       return get_term_link( $term );
-}
-
 /**
  * Deletes auto-drafts for new posts that are > 7 days old
  *
@@ -5426,98 +4931,6 @@ function wp_delete_auto_drafts() {
                wp_delete_post( $delete, true ); // Force delete
 }
 
-/**
- * Filters the request to allow for the format prefix.
- *
- * @access private
- * @since 3.1.0
- */
-function _post_format_request( $qvs ) {
-       if ( ! isset( $qvs['post_format'] ) )
-               return $qvs;
-       $slugs = get_post_format_slugs();
-       if ( isset( $slugs[ $qvs['post_format'] ] ) )
-               $qvs['post_format'] = 'post-format-' . $slugs[ $qvs['post_format'] ];
-       $tax = get_taxonomy( 'post_format' );
-       if ( ! is_admin() )
-               $qvs['post_type'] = $tax->object_type;
-       return $qvs;
-}
-add_filter( 'request', '_post_format_request' );
-
-/**
- * Filters the post format term link to remove the format prefix.
- *
- * @access private
- * @since 3.1.0
- */
-function _post_format_link( $link, $term, $taxonomy ) {
-       global $wp_rewrite;
-       if ( 'post_format' != $taxonomy )
-               return $link;
-       if ( $wp_rewrite->get_extra_permastruct( $taxonomy ) ) {
-               return str_replace( "/{$term->slug}", '/' . str_replace( 'post-format-', '', $term->slug ), $link );
-       } else {
-               $link = remove_query_arg( 'post_format', $link );
-               return add_query_arg( 'post_format', str_replace( 'post-format-', '', $term->slug ), $link );
-       }
-}
-add_filter( 'term_link', '_post_format_link', 10, 3 );
-
-/**
- * Remove the post format prefix from the name property of the term object created by get_term().
- *
- * @access private
- * @since 3.1.0
- */
-function _post_format_get_term( $term ) {
-       if ( isset( $term->slug ) ) {
-               $term->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
-       }
-       return $term;
-}
-add_filter( 'get_post_format', '_post_format_get_term' );
-
-/**
- * Remove the post format prefix from the name property of the term objects created by get_terms().
- *
- * @access private
- * @since 3.1.0
- */
-function _post_format_get_terms( $terms, $taxonomies, $args ) {
-       if ( in_array( 'post_format', (array) $taxonomies ) ) {
-               if ( isset( $args['fields'] ) && 'names' == $args['fields'] ) {
-                       foreach( $terms as $order => $name ) {
-                               $terms[$order] = get_post_format_string( str_replace( 'post-format-', '', $name ) );
-                       }
-               } else {
-                       foreach ( (array) $terms as $order => $term ) {
-                               if ( isset( $term->taxonomy ) && 'post_format' == $term->taxonomy ) {
-                                       $terms[$order]->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
-                               }
-                       }
-               }
-       }
-       return $terms;
-}
-add_filter( 'get_terms', '_post_format_get_terms', 10, 3 );
-
-/**
- * Remove the post format prefix from the name property of the term objects created by wp_get_object_terms().
- *
- * @access private
- * @since 3.1.0
- */
-function _post_format_wp_get_object_terms( $terms ) {
-       foreach ( (array) $terms as $order => $term ) {
-               if ( isset( $term->taxonomy ) && 'post_format' == $term->taxonomy ) {
-                       $terms[$order]->name = get_post_format_string( str_replace( 'post-format-', '', $term->slug ) );
-               }
-       }
-       return $terms;
-}
-add_filter( 'wp_get_object_terms', '_post_format_wp_get_object_terms' );
-
 /**
  * Update the custom taxonomies' term counts when a post's status is changed. For example, default posts term counts (for custom taxonomies) don't include private / draft posts.
  *
index 443d0bb742b7c0e2a614a5edfaa511a6d8df83a3..04286aa517cfc9fe5b180ae955811ed7503e202a 100644 (file)
@@ -2,8 +2,8 @@
 /**
  * WordPress Query API
  *
- * The query API attempts to get which part of WordPress to the user is on. It
- * also provides functionality to getting URL query information.
+ * The query API attempts to get which part of WordPress the user is on. It
+ * also provides functionality for getting URL query information.
  *
  * @link http://codex.wordpress.org/The_Loop More information on The Loop.
  *
@@ -1406,8 +1406,8 @@ class WP_Query {
                                $array[$key] = '';
                }
 
-               $array_keys = array('category__in', 'category__not_in', 'category__and', 'post__in', 'post__not_in',
-                       'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and');
+               $array_keys = array( 'category__in', 'category__not_in', 'category__and', 'post__in', 'post__not_in',
+                       'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'post_parent__in', 'post_parent__not_in' );
 
                foreach ( $array_keys as $key ) {
                        if ( !isset($array[$key]) )
@@ -2079,7 +2079,7 @@ class WP_Query {
                if ( $q['day'] )
                        $where .= " AND DAYOFMONTH($wpdb->posts.post_date)='" . $q['day'] . "'";
 
-               // If we've got a post_type AND its not "any" post_type.
+               // If we've got a post_type AND it's not "any" post_type.
                if ( !empty($q['post_type']) && 'any' != $q['post_type'] ) {
                        foreach ( (array)$q['post_type'] as $_post_type ) {
                                $ptype_obj = get_post_type_object($_post_type);
@@ -2168,8 +2168,15 @@ class WP_Query {
                        $where .= " AND {$wpdb->posts}.ID NOT IN ($post__not_in)";
                }
 
-               if ( is_numeric($q['post_parent']) )
+               if ( is_numeric( $q['post_parent'] ) ) {
                        $where .= $wpdb->prepare( " AND $wpdb->posts.post_parent = %d ", $q['post_parent'] );
+               } elseif ( $q['post_parent__in'] ) {
+                       $post_parent__in = implode( ',', array_map( 'absint', $q['post_parent__in'] ) );
+                       $where .= " AND {$wpdb->posts}.post_parent IN ($post_parent__in)";
+               } elseif ( $q['post_parent__not_in'] ) {
+                       $post_parent__not_in = implode( ',',  array_map( 'absint', $q['post_parent__not_in'] ) );
+                       $where .= " AND {$wpdb->posts}.post_parent NOT IN ($post_parent__not_in)";
+               }
 
                if ( $q['page_id'] ) {
                        if  ( ('page' != get_option('show_on_front') ) || ( $q['page_id'] != get_option('page_for_posts') ) ) {
@@ -2230,6 +2237,8 @@ class WP_Query {
                                }
                                if ( ! $post_type )
                                        $post_type = 'any';
+                               elseif ( count( $post_type ) == 1 )
+                                       $post_type = $post_type[0];
 
                                $post_status_join = true;
                        } elseif ( in_array('attachment', (array) $post_type) ) {
@@ -2256,25 +2265,30 @@ class WP_Query {
                                }
 
                                $cat_query = wp_list_filter( $tax_query_in_and, array( 'taxonomy' => 'category' ) );
-                               if ( !empty( $cat_query ) ) {
+                               if ( ! empty( $cat_query ) ) {
                                        $cat_query = reset( $cat_query );
-                                       $the_cat = get_term_by( $cat_query['field'], $cat_query['terms'][0], 'category' );
-                                       if ( $the_cat ) {
-                                               $this->set( 'cat', $the_cat->term_id );
-                                               $this->set( 'category_name', $the_cat->slug );
+
+                                       if ( ! empty( $cat_query['terms'][0] ) ) {
+                                               $the_cat = get_term_by( $cat_query['field'], $cat_query['terms'][0], 'category' );
+                                               if ( $the_cat ) {
+                                                       $this->set( 'cat', $the_cat->term_id );
+                                                       $this->set( 'category_name', $the_cat->slug );
+                                               }
+                                               unset( $the_cat );
                                        }
-                                       unset( $the_cat );
                                }
                                unset( $cat_query );
 
                                $tag_query = wp_list_filter( $tax_query_in_and, array( 'taxonomy' => 'post_tag' ) );
-                               if ( !empty( $tag_query ) ) {
+                               if ( ! empty( $tag_query ) ) {
                                        $tag_query = reset( $tag_query );
-                                       $the_tag = get_term_by( $tag_query['field'], $tag_query['terms'][0], 'post_tag' );
-                                       if ( $the_tag ) {
-                                               $this->set( 'tag_id', $the_tag->term_id );
+
+                                       if ( ! empty( $tag_query['terms'][0] ) ) {
+                                               $the_tag = get_term_by( $tag_query['field'], $tag_query['terms'][0], 'post_tag' );
+                                               if ( $the_tag )
+                                                       $this->set( 'tag_id', $the_tag->term_id );
+                                               unset( $the_tag );
                                        }
-                                       unset( $the_tag );
                                }
                                unset( $tag_query );
                        }
@@ -2343,6 +2357,8 @@ class WP_Query {
                        $orderby = '';
                } elseif ( $q['orderby'] == 'post__in' && ! empty( $post__in ) ) {
                        $orderby = "FIELD( {$wpdb->posts}.ID, $post__in )";
+               } elseif ( $q['orderby'] == 'post_parent__in' && ! empty( $post_parent__in ) ) {
+                       $orderby = "FIELD( {$wpdb->posts}.post_parent, $post_parent__in )";
                } else {
                        // Used to filter values
                        $allowed_keys = array('name', 'author', 'date', 'title', 'modified', 'menu_order', 'parent', 'ID', 'rand', 'comment_count');
@@ -2394,9 +2410,11 @@ class WP_Query {
                                $orderby .= " {$q['order']}";
                }
 
-               if ( is_array( $post_type ) ) {
+               if ( is_array( $post_type ) && count( $post_type ) > 1 ) {
                        $post_type_cap = 'multiple_post_type';
                } else {
+                       if ( is_array( $post_type ) )
+                               $post_type = reset( $post_type );
                        $post_type_object = get_post_type_object( $post_type );
                        if ( empty( $post_type_object ) )
                                $post_type_cap = $post_type;
@@ -2422,14 +2440,13 @@ class WP_Query {
                        $post_type_object = get_post_type_object ( 'post' );
                }
 
+               $edit_cap = 'edit_post';
+               $read_cap = 'read_post';
+
                if ( ! empty( $post_type_object ) ) {
-                       $edit_cap = $post_type_object->cap->edit_post;
-                       $read_cap = $post_type_object->cap->read_post;
                        $edit_others_cap = $post_type_object->cap->edit_others_posts;
                        $read_private_cap = $post_type_object->cap->read_private_posts;
                } else {
-                       $edit_cap = 'edit_' . $post_type_cap;
-                       $read_cap = 'read_' . $post_type_cap;
                        $edit_others_cap = 'edit_others_' . $post_type_cap . 's';
                        $read_private_cap = 'read_private_' . $post_type_cap . 's';
                }
@@ -2800,7 +2817,7 @@ class WP_Query {
        function set_found_posts( $q, $limits ) {
                global $wpdb;
 
-               // Bail if posts is an empty array. Continue if posts is an empty string
+               // Bail if posts is an empty array. Continue if posts is an empty string,
                // null, or false to accommodate caching plugins that fill posts later.
                if ( $q['no_found_rows'] || ( is_array( $this->posts ) && ! $this->posts ) )
                        return;
@@ -3622,7 +3639,7 @@ function wp_old_slug_redirect() {
  * @uses do_action_ref_array() Calls 'the_post'
  * @return bool True when finished.
  */
-function setup_postdata($post) {
+function setup_postdata( $post ) {
        global $id, $authordata, $currentday, $currentmonth, $page, $pages, $multipage, $more, $numpages;
 
        $id = (int) $post->ID;
@@ -3632,24 +3649,28 @@ function setup_postdata($post) {
        $currentday = mysql2date('d.m.y', $post->post_date, false);
        $currentmonth = mysql2date('m', $post->post_date, false);
        $numpages = 1;
+       $multipage = 0;
        $page = get_query_var('page');
-       if ( !$page )
+       if ( ! $page )
                $page = 1;
        if ( is_single() || is_page() || is_feed() )
                $more = 1;
        $content = $post->post_content;
-       if ( strpos( $content, '<!--nextpage-->' ) ) {
+       if ( false !== strpos( $content, '<!--nextpage-->' ) ) {
                if ( $page > 1 )
                        $more = 1;
-               $multipage = 1;
-               $content = str_replace("\n<!--nextpage-->\n", '<!--nextpage-->', $content);
-               $content = str_replace("\n<!--nextpage-->", '<!--nextpage-->', $content);
-               $content = str_replace("<!--nextpage-->\n", '<!--nextpage-->', $content);
+               $content = str_replace( "\n<!--nextpage-->\n", '<!--nextpage-->', $content );
+               $content = str_replace( "\n<!--nextpage-->", '<!--nextpage-->', $content );
+               $content = str_replace( "<!--nextpage-->\n", '<!--nextpage-->', $content );
+               // Ignore nextpage at the beginning of the content.
+               if ( 0 === strpos( $content, '<!--nextpage-->' ) )
+                       $content = substr( $content, 15 );
                $pages = explode('<!--nextpage-->', $content);
                $numpages = count($pages);
+               if ( $numpages > 1 )
+                       $multipage = 1;
        } else {
                $pages = array( $post->post_content );
-               $multipage = 0;
        }
 
        do_action_ref_array('the_post', array(&$post));
diff --git a/wp-includes/revision.php b/wp-includes/revision.php
new file mode 100644 (file)
index 0000000..5f441d3
--- /dev/null
@@ -0,0 +1,603 @@
+<?php
+/**
+ * Post revision functions.
+ *
+ * @package WordPress
+ * @subpackage Post_Revisions
+ */
+
+/**
+ * Determines which fields of posts are to be saved in revisions.
+ *
+ * Does two things. If passed a post *array*, it will return a post array ready
+ * to be inserted into the posts table as a post revision. Otherwise, returns
+ * an array whose keys are the post fields to be saved for post revisions.
+ *
+ * @since 2.6.0
+ * @access private
+ *
+ * @uses apply_filters() Calls '_wp_post_revision_fields' on 'title', 'content' and 'excerpt' fields.
+ *
+ * @param array $post Optional a post array to be processed for insertion as a post revision.
+ * @param bool $autosave optional Is the revision an autosave?
+ * @return array Post array ready to be inserted as a post revision or array of fields that can be versioned.
+ */
+function _wp_post_revision_fields( $post = null, $autosave = false ) {
+       static $fields = false;
+
+       if ( !$fields ) {
+               // Allow these to be versioned
+               $fields = array(
+                       'post_title' => __( 'Title' ),
+                       'post_content' => __( 'Content' ),
+                       'post_excerpt' => __( 'Excerpt' ),
+               );
+
+               // Runs only once
+               $fields = apply_filters( '_wp_post_revision_fields', $fields );
+
+               // WP uses these internally either in versioning or elsewhere - they cannot be versioned
+               foreach ( array( 'ID', 'post_name', 'post_parent', 'post_date', 'post_date_gmt', 'post_status', 'post_type', 'comment_count', 'post_author' ) as $protect )
+                       unset( $fields[$protect] );
+       }
+
+       if ( !is_array($post) )
+               return $fields;
+
+       $return = array();
+       foreach ( array_intersect( array_keys( $post ), array_keys( $fields ) ) as $field )
+               $return[$field] = $post[$field];
+
+       $return['post_parent']   = $post['ID'];
+       $return['post_status']   = 'inherit';
+       $return['post_type']     = 'revision';
+       $return['post_name']     = $autosave ? "$post[ID]-autosave-v1" : "$post[ID]-revision-v1"; // "1" is the revisioning system version
+       $return['post_date']     = isset($post['post_modified']) ? $post['post_modified'] : '';
+       $return['post_date_gmt'] = isset($post['post_modified_gmt']) ? $post['post_modified_gmt'] : '';
+
+       return $return;
+}
+
+/**
+ * Saves an already existing post as a post revision.
+ *
+ * Typically used immediately after post updates.
+ * Adds a copy of the current post as a revision, so latest revision always matches current post
+ *
+ * @since 2.6.0
+ *
+ * @uses _wp_put_post_revision()
+ *
+ * @param int $post_id The ID of the post to save as a revision.
+ * @return mixed Null or 0 if error, new revision ID, if success.
+ */
+function wp_save_post_revision( $post_id ) {
+       if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
+               return;
+
+       if ( ! $post = get_post( $post_id ) )
+               return;
+
+       if ( ! post_type_supports( $post->post_type, 'revisions' ) )
+               return;
+
+       if ( 'auto-draft' == $post->post_status )
+               return;
+
+       if ( ! wp_revisions_enabled( $post ) )
+               return;
+
+       // Compare the proposed update with the last stored revision verifying that
+       // they are different, unless a plugin tells us to always save regardless.
+       // If no previous revisions, save one
+       if ( $revisions = wp_get_post_revisions( $post_id ) ) {
+               // grab the last revision, but not an autosave
+               foreach ( $revisions as $revision ) {
+                       if ( false !== strpos( $revision->post_name, "{$revision->post_parent}-revision" ) ) {
+                               $last_revision = $revision;
+                               break;
+                       }
+               }
+
+               if ( isset( $last_revision ) && apply_filters( 'wp_save_post_revision_check_for_changes', true, $last_revision, $post ) ) {
+                       $post_has_changed = false;
+
+                       foreach ( array_keys( _wp_post_revision_fields() ) as $field ) {
+                               if ( normalize_whitespace( $post->$field ) != normalize_whitespace( $last_revision->$field ) ) {
+                                       $post_has_changed = true;
+                                       break;
+                               }
+                       }
+                       //don't save revision if post unchanged
+                       if( ! $post_has_changed )
+                               return;
+               }
+       }
+
+       $return = _wp_put_post_revision( $post );
+
+       $revisions_to_keep = wp_revisions_to_keep( $post );
+
+       if ( $revisions_to_keep < 0 )
+               return $return;
+
+       // all revisions and autosaves
+       $revisions = wp_get_post_revisions( $post_id, array( 'order' => 'ASC' ) );
+
+       $delete = count($revisions) - $revisions_to_keep;
+
+       if ( $delete < 1 )
+               return $return;
+
+       $revisions = array_slice( $revisions, 0, $delete );
+
+       for ( $i = 0; isset( $revisions[$i] ); $i++ ) {
+               if ( false !== strpos( $revisions[ $i ]->post_name, 'autosave' ) )
+                       continue;
+
+               wp_delete_post_revision( $revisions[ $i ]->ID );
+       }
+
+       return $return;
+}
+
+/**
+ * Retrieve the autosaved data of the specified post.
+ *
+ * Returns a post object containing the information that was autosaved for the
+ * specified post. If the optional $user_id is passed, returns the autosave for that user
+ * otherwise returns the latest autosave.
+ *
+ * @since 2.6.0
+ *
+ * @uses wp_get_post_revisions()
+ *
+ * @param int $post_id The post ID.
+ * @param int $user_id optional The post author ID.
+ * @return object|bool The autosaved data or false on failure or when no autosave exists.
+ */
+function wp_get_post_autosave( $post_id, $user_id = 0 ) {
+       $revisions = wp_get_post_revisions( $post_id, array( 'check_enabled' => false ) );
+
+       foreach ( $revisions as $revision ) {
+               if ( false !== strpos( $revision->post_name, "{$post_id}-autosave" ) ) {
+                       if ( $user_id && $user_id != $revision->post_author )
+                               continue;
+
+                       return $revision;
+                       break;
+               }
+       }
+
+       return false;
+}
+
+/**
+ * Determines if the specified post is a revision.
+ *
+ * @since 2.6.0
+ *
+ * @param int|object $post Post ID or post object.
+ * @return bool|int False if not a revision, ID of revision's parent otherwise.
+ */
+function wp_is_post_revision( $post ) {
+       if ( !$post = wp_get_post_revision( $post ) )
+               return false;
+
+       return (int) $post->post_parent;
+}
+
+/**
+ * Determines if the specified post is an autosave.
+ *
+ * @since 2.6.0
+ *
+ * @param int|object $post Post ID or post object.
+ * @return bool|int False if not a revision, ID of autosave's parent otherwise
+ */
+function wp_is_post_autosave( $post ) {
+       if ( !$post = wp_get_post_revision( $post ) )
+               return false;
+
+       if ( false !== strpos( $post->post_name, "{$post->post_parent}-autosave" ) )
+               return (int) $post->post_parent;
+
+       return false;
+}
+
+/**
+ * Inserts post data into the posts table as a post revision.
+ *
+ * @since 2.6.0
+ * @access private
+ *
+ * @uses wp_insert_post()
+ *
+ * @param int|object|array $post Post ID, post object OR post array.
+ * @param bool $autosave Optional. Is the revision an autosave?
+ * @return mixed Null or 0 if error, new revision ID if success.
+ */
+function _wp_put_post_revision( $post = null, $autosave = false ) {
+       if ( is_object($post) )
+               $post = get_object_vars( $post );
+       elseif ( !is_array($post) )
+               $post = get_post($post, ARRAY_A);
+
+       if ( !$post || empty($post['ID']) )
+               return;
+
+       if ( isset($post['post_type']) && 'revision' == $post['post_type'] )
+               return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) );
+
+       $post_id = $post['ID'];
+       $post = _wp_post_revision_fields( $post, $autosave );
+       $post = wp_slash($post); //since data is from db
+
+       $revision_id = wp_insert_post( $post );
+       if ( is_wp_error($revision_id) )
+               return $revision_id;
+
+       if ( $revision_id )
+               do_action( '_wp_put_post_revision', $revision_id );
+
+       return $revision_id;
+}
+
+/**
+ * Gets a post revision.
+ *
+ * @since 2.6.0
+ *
+ * @uses get_post()
+ *
+ * @param int|object $post The post ID or object.
+ * @param string $output Optional. OBJECT, ARRAY_A, or ARRAY_N.
+ * @param string $filter Optional sanitation filter. @see sanitize_post().
+ * @return mixed Null if error or post object if success.
+ */
+function wp_get_post_revision(&$post, $output = OBJECT, $filter = 'raw') {
+       $null = null;
+       if ( !$revision = get_post( $post, OBJECT, $filter ) )
+               return $revision;
+       if ( 'revision' !== $revision->post_type )
+               return $null;
+
+       if ( $output == OBJECT ) {
+               return $revision;
+       } elseif ( $output == ARRAY_A ) {
+               $_revision = get_object_vars($revision);
+               return $_revision;
+       } elseif ( $output == ARRAY_N ) {
+               $_revision = array_values(get_object_vars($revision));
+               return $_revision;
+       }
+
+       return $revision;
+}
+
+/**
+ * Restores a post to the specified revision.
+ *
+ * Can restore a past revision using all fields of the post revision, or only selected fields.
+ *
+ * @since 2.6.0
+ *
+ * @uses wp_get_post_revision()
+ * @uses wp_update_post()
+ * @uses do_action() Calls 'wp_restore_post_revision' on post ID and revision ID if wp_update_post()
+ *  is successful.
+ *
+ * @param int|object $revision_id Revision ID or revision object.
+ * @param array $fields Optional. What fields to restore from. Defaults to all.
+ * @return mixed Null if error, false if no fields to restore, (int) post ID if success.
+ */
+function wp_restore_post_revision( $revision_id, $fields = null ) {
+       if ( !$revision = wp_get_post_revision( $revision_id, ARRAY_A ) )
+               return $revision;
+
+       if ( !is_array( $fields ) )
+               $fields = array_keys( _wp_post_revision_fields() );
+
+       $update = array();
+       foreach( array_intersect( array_keys( $revision ), $fields ) as $field ) {
+               $update[$field] = $revision[$field];
+       }
+
+       if ( !$update )
+               return false;
+
+       $update['ID'] = $revision['post_parent'];
+
+       $update = wp_slash( $update ); //since data is from db
+
+       $post_id = wp_update_post( $update );
+       if ( ! $post_id || is_wp_error( $post_id ) )
+               return $post_id;
+
+       // Add restore from details
+       $restore_details = array(
+               'restored_revision_id' => $revision_id,
+               'restored_by_user'     => get_current_user_id(),
+               'restored_time'        => time()
+       );
+       update_post_meta( $post_id, '_post_restored_from', $restore_details );
+
+       // Update last edit user
+       update_post_meta( $post_id, '_edit_last', get_current_user_id() );
+
+       do_action( 'wp_restore_post_revision', $post_id, $revision['ID'] );
+
+       return $post_id;
+}
+
+/**
+ * Deletes a revision.
+ *
+ * Deletes the row from the posts table corresponding to the specified revision.
+ *
+ * @since 2.6.0
+ *
+ * @uses wp_get_post_revision()
+ * @uses wp_delete_post()
+ *
+ * @param int|object $revision_id Revision ID or revision object.
+ * @return mixed Null or WP_Error if error, deleted post if success.
+ */
+function wp_delete_post_revision( $revision_id ) {
+       if ( !$revision = wp_get_post_revision( $revision_id ) )
+               return $revision;
+
+       $delete = wp_delete_post( $revision->ID );
+       if ( is_wp_error( $delete ) )
+               return $delete;
+
+       if ( $delete )
+               do_action( 'wp_delete_post_revision', $revision->ID, $revision );
+
+       return $delete;
+}
+
+/**
+ * Returns all revisions of specified post.
+ *
+ * @since 2.6.0
+ *
+ * @uses get_children()
+ *
+ * @param int|object $post_id Post ID or post object
+ * @return array An array of revisions, or an empty array if none.
+ */
+function wp_get_post_revisions( $post_id = 0, $args = null ) {
+       $post = get_post( $post_id );
+       if ( ! $post || empty( $post->ID ) )
+               return array();
+
+       $defaults = array( 'order' => 'DESC', 'orderby' => 'date', 'check_enabled' => true );
+       $args = wp_parse_args( $args, $defaults );
+
+       if ( $args['check_enabled'] && ! wp_revisions_enabled( $post ) )
+               return array();
+
+       $args = array_merge( $args, array( 'post_parent' => $post->ID, 'post_type' => 'revision', 'post_status' => 'inherit' ) );
+
+       if ( ! $revisions = get_children( $args ) )
+               return array();
+
+       return $revisions;
+}
+
+/**
+ * Determine if revisions are enabled for a given post.
+ *
+ * @since 3.6.0
+ *
+ * @uses wp_revisions_to_keep()
+ *
+ * @param object $post The post object.
+ * @return bool True if number of revisions to keep isn't zero, false otherwise.
+ */
+function wp_revisions_enabled( $post ) {
+       return wp_revisions_to_keep( $post ) != 0;
+}
+
+/**
+ * Determine how many revisions to retain for a given post.
+ * By default, an infinite number of revisions are stored if a post type supports revisions.
+ *
+ * @since 3.6.0
+ *
+ * @uses post_type_supports()
+ * @uses apply_filters() Calls 'wp_revisions_to_keep' hook on the number of revisions.
+ *
+ * @param object $post The post object.
+ * @return int The number of revisions to keep.
+ */
+function wp_revisions_to_keep( $post ) {
+       $num = WP_POST_REVISIONS;
+
+       if ( true === $num )
+               $num = -1;
+       else
+               $num = intval( $num );
+
+       if ( ! post_type_supports( $post->post_type, 'revisions' ) )
+               $num = 0;
+
+       return (int) apply_filters( 'wp_revisions_to_keep', $num, $post );
+}
+
+/**
+ * Sets up the post object for preview based on the post autosave.
+ *
+ * @since 2.7.0
+ * @access private
+ */
+function _set_preview($post) {
+
+       if ( ! is_object($post) )
+               return $post;
+
+       $preview = wp_get_post_autosave($post->ID);
+
+       if ( ! is_object($preview) )
+               return $post;
+
+       $preview = sanitize_post($preview);
+
+       $post->post_content = $preview->post_content;
+       $post->post_title = $preview->post_title;
+       $post->post_excerpt = $preview->post_excerpt;
+
+       add_filter( 'get_the_terms', '_wp_preview_terms_filter', 10, 3 );
+
+       return $post;
+}
+
+/**
+ * Filters the latest content for preview from the post autosave.
+ *
+ * @since 2.7.0
+ * @access private
+ */
+function _show_post_preview() {
+
+       if ( isset($_GET['preview_id']) && isset($_GET['preview_nonce']) ) {
+               $id = (int) $_GET['preview_id'];
+
+               if ( false == wp_verify_nonce( $_GET['preview_nonce'], 'post_preview_' . $id ) )
+                       wp_die( __('You do not have permission to preview drafts.') );
+
+               add_filter('the_preview', '_set_preview');
+       }
+}
+
+/**
+ * Filters terms lookup to set the post format.
+ *
+ * @since 3.6.0
+ * @access private
+ */
+function _wp_preview_terms_filter( $terms, $post_id, $taxonomy ) {
+       if ( ! $post = get_post() )
+               return $terms;
+
+       if ( empty( $_REQUEST['post_format'] ) || $post->ID != $post_id || 'post_format' != $taxonomy || 'revision' == $post->post_type )
+               return $terms;
+
+       if ( 'standard' == $_REQUEST['post_format'] )
+               $terms = array();
+       elseif ( $term = get_term_by( 'slug', 'post-format-' . sanitize_key( $_REQUEST['post_format'] ), 'post_format' ) )
+               $terms = array( $term ); // Can only have one post format
+
+       return $terms;
+}
+
+/**
+ * Gets the post revision version.
+ *
+ * @since 3.6.0
+ * @access private
+*/
+function _wp_get_post_revision_version( $revision ) {
+       if ( is_object( $revision ) )
+               $revision = get_object_vars( $revision );
+       elseif ( !is_array( $revision ) )
+               return false;
+
+       if ( preg_match( '/^\d+-(?:autosave|revision)-v(\d+)$/', $revision['post_name'], $matches ) )
+               return (int) $matches[1];
+
+       return 0;
+}
+
+/**
+ * Upgrade the revisions author, add the current post as a revision and set the revisions version to 1
+ *
+ * @since 3.6.0
+ * @access private
+ *
+ * @uses wp_get_post_revisions()
+ *
+ * @param object $post Post object
+ * @param array $revisions Current revisions of the post
+ * @return bool true if the revisions were upgraded, false if problems
+ */
+function _wp_upgrade_revisions_of_post( $post, $revisions ) {
+       global $wpdb;
+
+       // Add post option exclusively
+       $lock = "revision-upgrade-{$post->ID}";
+       $now = time();
+       $result = $wpdb->query( $wpdb->prepare( "INSERT IGNORE INTO `$wpdb->options` (`option_name`, `option_value`, `autoload`) VALUES (%s, %s, 'no') /* LOCK */", $lock, $now ) );
+       if ( ! $result ) {
+               // If we couldn't get a lock, see how old the previous lock is
+               $locked = get_option( $lock );
+               if ( ! $locked ) {
+                       // Can't write to the lock, and can't read the lock.
+                       // Something broken has happened
+                       return false;
+               }
+
+               if ( $locked > $now - 3600 ) {
+                       // Lock is not too old: some other process may be upgrading this post.  Bail.
+                       return false;
+               }
+
+               // Lock is too old - update it (below) and continue
+       }
+
+       // If we could get a lock, re-"add" the option to fire all the correct filters.
+       update_option( $lock, $now );
+
+       reset( $revisions );
+       $add_last = true;
+
+       do {
+               $this_revision = current( $revisions );
+               $prev_revision = next( $revisions );
+
+               $this_revision_version = _wp_get_post_revision_version( $this_revision );
+
+               // Something terrible happened
+               if ( false === $this_revision_version )
+                       continue;
+
+               // 1 is the latest revision version, so we're already up to date.
+               // No need to add a copy of the post as latest revision.
+               if ( 0 < $this_revision_version ) {
+                       $add_last = false;
+                       continue;
+               }
+
+               // Always update the revision version
+               $update = array(
+                       'post_name' => preg_replace( '/^(\d+-(?:autosave|revision))[\d-]*$/', '$1-v1', $this_revision->post_name ),
+               );
+
+               // If this revision is the oldest revision of the post, i.e. no $prev_revision,
+               // the correct post_author is probably $post->post_author, but that's only a good guess.
+               // Update the revision version only and Leave the author as-is.
+               if ( $prev_revision ) {
+                       $prev_revision_version = _wp_get_post_revision_version( $prev_revision );
+
+                       // If the previous revision is already up to date, it no longer has the information we need :(
+                       if ( $prev_revision_version < 1 )
+                               $update['post_author'] = $prev_revision->post_author;
+               }
+
+               // Upgrade this revision
+               $result = $wpdb->update( $wpdb->posts, $update, array( 'ID' => $this_revision->ID ) );
+
+               if ( $result )
+                       wp_cache_delete( $this_revision->ID, 'posts' );
+
+       } while ( $prev_revision );
+
+       delete_option( $lock );
+
+       // Add a copy of the post as latest revision.
+       if ( $add_last )
+               wp_save_post_revision( $post->ID );
+
+       return true;
+}
index 486922a3d1039afe02c42487319aae3faf127d08..88237e06c16575f218cfa6ccc874f32f8963aa2d 100644 (file)
@@ -89,7 +89,7 @@ function add_feed($feedname, $function) {
                $wp_rewrite->feeds[] = $feedname;
        $hook = 'do_feed_' . $feedname;
        // Remove default function hook
-       remove_action($hook, $hook, 10, 1);
+       remove_action($hook, $hook);
        add_action($hook, $function, 10, 1);
        return $hook;
 }
@@ -315,7 +315,7 @@ function url_to_postid($url) {
 
        // Strip 'index.php/' if we're not using path info permalinks
        if ( !$wp_rewrite->using_index_permalinks() )
-               $url = str_replace('index.php/', '', $url);
+               $url = str_replace( $wp_rewrite->index . '/', '', $url );
 
        if ( false !== strpos($url, home_url()) ) {
                // Chop off http://domain.com
@@ -1552,7 +1552,7 @@ class WP_Rewrite {
                $root_rewrite = apply_filters('root_rewrite_rules', $root_rewrite);
 
                // Comments
-               $comments_rewrite = $this->generate_rewrite_rules($this->root . $this->comments_base, EP_COMMENTS, true, true, true, false);
+               $comments_rewrite = $this->generate_rewrite_rules($this->root . $this->comments_base, EP_COMMENTS, false, true, true, false);
                $comments_rewrite = apply_filters('comments_rewrite_rules', $comments_rewrite);
 
                // Search
index 3b8e4de945f9dece78dedd9bae476f1a34d2fba9..cd08ec99e6625df5548fec37b78d60c19162fe5b 100644 (file)
@@ -422,7 +422,7 @@ function fetch_rss ($url) {
        else {
                // Flow
                // 1. check cache
-               // 2. if there is a hit, make sure its fresh
+               // 2. if there is a hit, make sure it's fresh
                // 3. if cached obj fails freshness check, fetch remote
                // 4. if remote fails, return stale object, or error
 
@@ -536,7 +536,7 @@ endif;
  * @return Snoopy style response
  */
 function _fetch_remote_file($url, $headers = "" ) {
-       $resp = wp_remote_request($url, array('headers' => $headers, 'timeout' => MAGPIE_FETCH_TIME_OUT, 'reject_unsafe_urls' => true ));
+       $resp = wp_safe_remote_request( $url, array( 'headers' => $headers, 'timeout' => MAGPIE_FETCH_TIME_OUT ) );
        if ( is_wp_error($resp) ) {
                $error = array_shift($resp->errors);
 
index 027f9d62757d248f4cdfe1ccbb8eb570b7b97569..35d8b3555371c279a4b362ee43b273cd3800e8c4 100644 (file)
@@ -75,9 +75,6 @@ function wp_default_scripts( &$scripts ) {
 
        $scripts->add( 'quicktags', "/wp-includes/js/quicktags$suffix.js", array(), false, 1 );
        did_action( 'init' ) && $scripts->localize( 'quicktags', 'quicktagsL10n', array(
-               'wordLookup' => __('Enter a word to look up:'),
-               'dictionaryLookup' => esc_attr(__('Dictionary lookup')),
-               'lookup' => esc_attr(__('lookup')),
                'closeAllOpenTags' => esc_attr(__('Close all open tags')),
                'closeTags' => esc_attr(__('close tags')),
                'enterURL' => __('Enter the URL'),
@@ -108,6 +105,17 @@ function wp_default_scripts( &$scripts ) {
 
        $scripts->add( 'autosave', "/wp-includes/js/autosave$suffix.js", array('schedule', 'wp-ajax-response'), false, 1 );
 
+       $scripts->add( 'heartbeat', "/wp-includes/js/heartbeat$suffix.js", array('jquery'), false, 1 );
+       did_action( 'init' ) && $scripts->localize( 'heartbeat', 'heartbeatSettings',
+               apply_filters( 'heartbeat_settings', array() )
+       );
+
+       $scripts->add( 'wp-auth-check', "/wp-includes/js/wp-auth-check$suffix.js", array('heartbeat'), false, 1 );
+       did_action( 'init' ) && $scripts->localize( 'wp-auth-check', 'authcheckL10n', array(
+               'beforeunload' => __('Your session has expired. You can log in again from this page or go to the login page.'),
+               'interval' => apply_filters( 'wp_auth_check_interval', 3 * MINUTE_IN_SECONDS ),
+       ) );
+
        $scripts->add( 'wp-lists', "/wp-includes/js/wp-lists$suffix.js", array( 'wp-ajax-response', 'jquery-color' ), false, 1 );
 
        // WordPress no longer uses or bundles Prototype or script.aculo.us. These are now pulled from an external source.
@@ -124,51 +132,54 @@ function wp_default_scripts( &$scripts ) {
        // not used in core, replaced by Jcrop.js
        $scripts->add( 'cropper', '/wp-includes/js/crop/cropper.js', array('scriptaculous-dragdrop') );
 
-       $scripts->add( 'jquery', '/wp-includes/js/jquery/jquery.js', array(), '1.8.3' );
+       // jQuery
+       $scripts->add( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '1.10.2' );
+       $scripts->add( 'jquery-core', '/wp-includes/js/jquery/jquery.js', array(), '1.10.2' );
+       $scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '1.2.1' );
 
        // full jQuery UI
-       $scripts->add( 'jquery-ui-core', '/wp-includes/js/jquery/ui/jquery.ui.core.min.js', array('jquery'), '1.9.2', 1 );
-       $scripts->add( 'jquery-effects-core', '/wp-includes/js/jquery/ui/jquery.ui.effect.min.js', array('jquery'), '1.9.2', 1 );
-
-       $scripts->add( 'jquery-effects-blind', '/wp-includes/js/jquery/ui/jquery.ui.effect-blind.min.js', array('jquery-effects-core'), '1.9.2', 1 );
-       $scripts->add( 'jquery-effects-bounce', '/wp-includes/js/jquery/ui/jquery.ui.effect-bounce.min.js', array('jquery-effects-core'), '1.9.2', 1 );
-       $scripts->add( 'jquery-effects-clip', '/wp-includes/js/jquery/ui/jquery.ui.effect-clip.min.js', array('jquery-effects-core'), '1.9.2', 1 );
-       $scripts->add( 'jquery-effects-drop', '/wp-includes/js/jquery/ui/jquery.ui.effect-drop.min.js', array('jquery-effects-core'), '1.9.2', 1 );
-       $scripts->add( 'jquery-effects-explode', '/wp-includes/js/jquery/ui/jquery.ui.effect-explode.min.js', array('jquery-effects-core'), '1.9.2', 1 );
-       $scripts->add( 'jquery-effects-fade', '/wp-includes/js/jquery/ui/jquery.ui.effect-fade.min.js', array('jquery-effects-core'), '1.9.2', 1 );
-       $scripts->add( 'jquery-effects-fold', '/wp-includes/js/jquery/ui/jquery.ui.effect-fold.min.js', array('jquery-effects-core'), '1.9.2', 1 );
-       $scripts->add( 'jquery-effects-highlight', '/wp-includes/js/jquery/ui/jquery.ui.effect-highlight.min.js', array('jquery-effects-core'), '1.9.2', 1 );
-       $scripts->add( 'jquery-effects-pulsate', '/wp-includes/js/jquery/ui/jquery.ui.effect-pulsate.min.js', array('jquery-effects-core'), '1.9.2', 1 );
-       $scripts->add( 'jquery-effects-scale', '/wp-includes/js/jquery/ui/jquery.ui.effect-scale.min.js', array('jquery-effects-core'), '1.9.2', 1 );
-       $scripts->add( 'jquery-effects-shake', '/wp-includes/js/jquery/ui/jquery.ui.effect-shake.min.js', array('jquery-effects-core'), '1.9.2', 1 );
-       $scripts->add( 'jquery-effects-slide', '/wp-includes/js/jquery/ui/jquery.ui.effect-slide.min.js', array('jquery-effects-core'), '1.9.2', 1 );
-       $scripts->add( 'jquery-effects-transfer', '/wp-includes/js/jquery/ui/jquery.ui.effect-transfer.min.js', array('jquery-effects-core'), '1.9.2', 1 );
-
-       $scripts->add( 'jquery-ui-accordion', '/wp-includes/js/jquery/ui/jquery.ui.accordion.min.js', array('jquery-ui-core', 'jquery-ui-widget'), '1.9.2', 1 );
-       $scripts->add( 'jquery-ui-autocomplete', '/wp-includes/js/jquery/ui/jquery.ui.autocomplete.min.js', array('jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position', 'jquery-ui-menu'), '1.9.2', 1 );
-       $scripts->add( 'jquery-ui-button', '/wp-includes/js/jquery/ui/jquery.ui.button.min.js', array('jquery-ui-core', 'jquery-ui-widget'), '1.9.2', 1 );
-       $scripts->add( 'jquery-ui-datepicker', '/wp-includes/js/jquery/ui/jquery.ui.datepicker.min.js', array('jquery-ui-core'), '1.9.2', 1 );
-       $scripts->add( 'jquery-ui-dialog', '/wp-includes/js/jquery/ui/jquery.ui.dialog.min.js', array('jquery-ui-resizable', 'jquery-ui-draggable', 'jquery-ui-button', 'jquery-ui-position'), '1.9.2', 1 );
-       $scripts->add( 'jquery-ui-draggable', '/wp-includes/js/jquery/ui/jquery.ui.draggable.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.9.2', 1 );
-       $scripts->add( 'jquery-ui-droppable', '/wp-includes/js/jquery/ui/jquery.ui.droppable.min.js', array('jquery-ui-draggable'), '1.9.2', 1 );
-       $scripts->add( 'jquery-ui-menu', '/wp-includes/js/jquery/ui/jquery.ui.menu.min.js', array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position' ), '1.9.2', 1 );
-       $scripts->add( 'jquery-ui-mouse', '/wp-includes/js/jquery/ui/jquery.ui.mouse.min.js', array('jquery-ui-widget'), '1.9.2', 1 );
-       $scripts->add( 'jquery-ui-position', '/wp-includes/js/jquery/ui/jquery.ui.position.min.js', array('jquery'), '1.9.2', 1 );
-       $scripts->add( 'jquery-ui-progressbar', '/wp-includes/js/jquery/ui/jquery.ui.progressbar.min.js', array('jquery-ui-widget'), '1.9.2', 1 );
-       $scripts->add( 'jquery-ui-resizable', '/wp-includes/js/jquery/ui/jquery.ui.resizable.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.9.2', 1 );
-       $scripts->add( 'jquery-ui-selectable', '/wp-includes/js/jquery/ui/jquery.ui.selectable.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.9.2', 1 );
-       $scripts->add( 'jquery-ui-slider', '/wp-includes/js/jquery/ui/jquery.ui.slider.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.9.2', 1 );
-       $scripts->add( 'jquery-ui-sortable', '/wp-includes/js/jquery/ui/jquery.ui.sortable.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.9.2', 1 );
-       $scripts->add( 'jquery-ui-spinner', '/wp-includes/js/jquery/ui/jquery.ui.spinner.min.js', array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-button' ), '1.9.2', 1 );
-       $scripts->add( 'jquery-ui-tabs', '/wp-includes/js/jquery/ui/jquery.ui.tabs.min.js', array('jquery-ui-core', 'jquery-ui-widget'), '1.9.2', 1 );
-       $scripts->add( 'jquery-ui-tooltip', '/wp-includes/js/jquery/ui/jquery.ui.tooltip.min.js', array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position' ), '1.9.2', 1 );
-       $scripts->add( 'jquery-ui-widget', '/wp-includes/js/jquery/ui/jquery.ui.widget.min.js', array('jquery'), '1.9.2', 1 );
+       $scripts->add( 'jquery-ui-core', '/wp-includes/js/jquery/ui/jquery.ui.core.min.js', array('jquery'), '1.10.3', 1 );
+       $scripts->add( 'jquery-effects-core', '/wp-includes/js/jquery/ui/jquery.ui.effect.min.js', array('jquery'), '1.10.3', 1 );
+
+       $scripts->add( 'jquery-effects-blind', '/wp-includes/js/jquery/ui/jquery.ui.effect-blind.min.js', array('jquery-effects-core'), '1.10.3', 1 );
+       $scripts->add( 'jquery-effects-bounce', '/wp-includes/js/jquery/ui/jquery.ui.effect-bounce.min.js', array('jquery-effects-core'), '1.10.3', 1 );
+       $scripts->add( 'jquery-effects-clip', '/wp-includes/js/jquery/ui/jquery.ui.effect-clip.min.js', array('jquery-effects-core'), '1.10.3', 1 );
+       $scripts->add( 'jquery-effects-drop', '/wp-includes/js/jquery/ui/jquery.ui.effect-drop.min.js', array('jquery-effects-core'), '1.10.3', 1 );
+       $scripts->add( 'jquery-effects-explode', '/wp-includes/js/jquery/ui/jquery.ui.effect-explode.min.js', array('jquery-effects-core'), '1.10.3', 1 );
+       $scripts->add( 'jquery-effects-fade', '/wp-includes/js/jquery/ui/jquery.ui.effect-fade.min.js', array('jquery-effects-core'), '1.10.3', 1 );
+       $scripts->add( 'jquery-effects-fold', '/wp-includes/js/jquery/ui/jquery.ui.effect-fold.min.js', array('jquery-effects-core'), '1.10.3', 1 );
+       $scripts->add( 'jquery-effects-highlight', '/wp-includes/js/jquery/ui/jquery.ui.effect-highlight.min.js', array('jquery-effects-core'), '1.10.3', 1 );
+       $scripts->add( 'jquery-effects-pulsate', '/wp-includes/js/jquery/ui/jquery.ui.effect-pulsate.min.js', array('jquery-effects-core'), '1.10.3', 1 );
+       $scripts->add( 'jquery-effects-scale', '/wp-includes/js/jquery/ui/jquery.ui.effect-scale.min.js', array('jquery-effects-core'), '1.10.3', 1 );
+       $scripts->add( 'jquery-effects-shake', '/wp-includes/js/jquery/ui/jquery.ui.effect-shake.min.js', array('jquery-effects-core'), '1.10.3', 1 );
+       $scripts->add( 'jquery-effects-slide', '/wp-includes/js/jquery/ui/jquery.ui.effect-slide.min.js', array('jquery-effects-core'), '1.10.3', 1 );
+       $scripts->add( 'jquery-effects-transfer', '/wp-includes/js/jquery/ui/jquery.ui.effect-transfer.min.js', array('jquery-effects-core'), '1.10.3', 1 );
+
+       $scripts->add( 'jquery-ui-accordion', '/wp-includes/js/jquery/ui/jquery.ui.accordion.min.js', array('jquery-ui-core', 'jquery-ui-widget'), '1.10.3', 1 );
+       $scripts->add( 'jquery-ui-autocomplete', '/wp-includes/js/jquery/ui/jquery.ui.autocomplete.min.js', array('jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position', 'jquery-ui-menu'), '1.10.3', 1 );
+       $scripts->add( 'jquery-ui-button', '/wp-includes/js/jquery/ui/jquery.ui.button.min.js', array('jquery-ui-core', 'jquery-ui-widget'), '1.10.3', 1 );
+       $scripts->add( 'jquery-ui-datepicker', '/wp-includes/js/jquery/ui/jquery.ui.datepicker.min.js', array('jquery-ui-core'), '1.10.3', 1 );
+       $scripts->add( 'jquery-ui-dialog', '/wp-includes/js/jquery/ui/jquery.ui.dialog.min.js', array('jquery-ui-resizable', 'jquery-ui-draggable', 'jquery-ui-button', 'jquery-ui-position'), '1.10.3', 1 );
+       $scripts->add( 'jquery-ui-draggable', '/wp-includes/js/jquery/ui/jquery.ui.draggable.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.10.3', 1 );
+       $scripts->add( 'jquery-ui-droppable', '/wp-includes/js/jquery/ui/jquery.ui.droppable.min.js', array('jquery-ui-draggable'), '1.10.3', 1 );
+       $scripts->add( 'jquery-ui-menu', '/wp-includes/js/jquery/ui/jquery.ui.menu.min.js', array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position' ), '1.10.3', 1 );
+       $scripts->add( 'jquery-ui-mouse', '/wp-includes/js/jquery/ui/jquery.ui.mouse.min.js', array('jquery-ui-widget'), '1.10.3', 1 );
+       $scripts->add( 'jquery-ui-position', '/wp-includes/js/jquery/ui/jquery.ui.position.min.js', array('jquery'), '1.10.3', 1 );
+       $scripts->add( 'jquery-ui-progressbar', '/wp-includes/js/jquery/ui/jquery.ui.progressbar.min.js', array('jquery-ui-widget'), '1.10.3', 1 );
+       $scripts->add( 'jquery-ui-resizable', '/wp-includes/js/jquery/ui/jquery.ui.resizable.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.10.3', 1 );
+       $scripts->add( 'jquery-ui-selectable', '/wp-includes/js/jquery/ui/jquery.ui.selectable.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.10.3', 1 );
+       $scripts->add( 'jquery-ui-slider', '/wp-includes/js/jquery/ui/jquery.ui.slider.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.10.3', 1 );
+       $scripts->add( 'jquery-ui-sortable', '/wp-includes/js/jquery/ui/jquery.ui.sortable.min.js', array('jquery-ui-core', 'jquery-ui-mouse'), '1.10.3', 1 );
+       $scripts->add( 'jquery-ui-spinner', '/wp-includes/js/jquery/ui/jquery.ui.spinner.min.js', array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-button' ), '1.10.3', 1 );
+       $scripts->add( 'jquery-ui-tabs', '/wp-includes/js/jquery/ui/jquery.ui.tabs.min.js', array('jquery-ui-core', 'jquery-ui-widget'), '1.10.3', 1 );
+       $scripts->add( 'jquery-ui-tooltip', '/wp-includes/js/jquery/ui/jquery.ui.tooltip.min.js', array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position' ), '1.10.3', 1 );
+       $scripts->add( 'jquery-ui-widget', '/wp-includes/js/jquery/ui/jquery.ui.widget.min.js', array('jquery'), '1.10.3', 1 );
 
        // deprecated, not used in core, most functionality is included in jQuery 1.3
        $scripts->add( 'jquery-form', "/wp-includes/js/jquery/jquery.form$suffix.js", array('jquery'), '2.73', 1 );
 
        // jQuery plugins
-       $scripts->add( 'jquery-color', "/wp-includes/js/jquery/jquery.color.min.js", array('jquery'), '2.1.0', 1 );
+       $scripts->add( 'jquery-color', "/wp-includes/js/jquery/jquery.color.min.js", array('jquery'), '2.1.1', 1 );
        $scripts->add( 'suggest', "/wp-includes/js/jquery/suggest$suffix.js", array('jquery'), '1.1-20110113', 1 );
        $scripts->add( 'schedule', '/wp-includes/js/jquery/jquery.schedule.js', array('jquery'), '20m', 1 );
        $scripts->add( 'jquery-query', "/wp-includes/js/jquery/jquery.query.js", array('jquery'), '2.1.7', 1 );
@@ -226,14 +237,14 @@ function wp_default_scripts( &$scripts ) {
                'error_uploading' => __('&#8220;%s&#8221; has failed to upload.')
        );
 
-       $scripts->add( 'plupload', '/wp-includes/js/plupload/plupload.js', array(), '1.5.5' );
-       $scripts->add( 'plupload-html5', '/wp-includes/js/plupload/plupload.html5.js', array('plupload'), '1.5.5' );
-       $scripts->add( 'plupload-flash', '/wp-includes/js/plupload/plupload.flash.js', array('plupload'), '1.5.5' );
-       $scripts->add( 'plupload-silverlight', '/wp-includes/js/plupload/plupload.silverlight.js', array('plupload'), '1.5.5' );
-       $scripts->add( 'plupload-html4', '/wp-includes/js/plupload/plupload.html4.js', array('plupload'), '1.5.5' );
+       $scripts->add( 'plupload', '/wp-includes/js/plupload/plupload.js', array(), '1.5.7' );
+       $scripts->add( 'plupload-html5', '/wp-includes/js/plupload/plupload.html5.js', array('plupload'), '1.5.7' );
+       $scripts->add( 'plupload-flash', '/wp-includes/js/plupload/plupload.flash.js', array('plupload'), '1.5.7' );
+       $scripts->add( 'plupload-silverlight', '/wp-includes/js/plupload/plupload.silverlight.js', array('plupload'), '1.5.7' );
+       $scripts->add( 'plupload-html4', '/wp-includes/js/plupload/plupload.html4.js', array('plupload'), '1.5.7' );
 
        // cannot use the plupload.full.js, as it loads browserplus init JS from Yahoo
-       $scripts->add( 'plupload-all', false, array('plupload', 'plupload-html5', 'plupload-flash', 'plupload-silverlight', 'plupload-html4'), '1.5.5' );
+       $scripts->add( 'plupload-all', false, array('plupload', 'plupload-html5', 'plupload-flash', 'plupload-silverlight', 'plupload-html4'), '1.5.7' );
 
        $scripts->add( 'plupload-handlers', "/wp-includes/js/plupload/handlers$suffix.js", array('plupload-all', 'jquery') );
        did_action( 'init' ) && $scripts->localize( 'plupload-handlers', 'pluploadL10n', $uploader_l10n );
@@ -254,11 +265,47 @@ function wp_default_scripts( &$scripts ) {
 
        $scripts->add( 'json2', "/wp-includes/js/json2$suffix.js", array(), '2011-02-23');
 
-       $scripts->add( 'underscore', '/wp-includes/js/underscore.min.js', array(), '1.4.0', 1 );
-       $scripts->add( 'backbone', '/wp-includes/js/backbone.min.js', array('underscore','jquery'), '0.9.2', 1 );
+       $scripts->add( 'underscore', '/wp-includes/js/underscore.min.js', array(), '1.4.4', 1 );
+       $scripts->add( 'backbone', '/wp-includes/js/backbone.min.js', array('underscore','jquery'), '1.0.0', 1 );
+
+       $scripts->add( 'wp-util', "/wp-includes/js/wp-util$suffix.js", array('underscore', 'jquery'), false, 1 );
+       did_action( 'init' ) && $scripts->localize( 'wp-util', '_wpUtilSettings', array(
+               'ajax' => array(
+                       'url' => admin_url( 'admin-ajax.php', 'relative' ),
+               ),
+       ) );
+
+       $scripts->add( 'wp-backbone', "/wp-includes/js/wp-backbone$suffix.js", array('backbone', 'wp-util'), false, 1 );
+
+       $scripts->add( 'revisions', "/wp-admin/js/revisions$suffix.js", array( 'wp-backbone', 'jquery-ui-slider', 'hoverIntent' ), false, 1 );
 
        $scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), '0.9.8', 1 );
 
+       $scripts->add( 'mediaelement', "/wp-includes/js/mediaelement/mediaelement-and-player.min.js", array('jquery'), '2.13.0', 1 );
+       did_action( 'init' ) && $scripts->localize( 'mediaelement', 'mejsL10n', array(
+               'language' => get_bloginfo( 'language' ),
+               'strings'  => array(
+                       'Close'               => __( 'Close' ),
+                       'Fullscreen'          => __( 'Fullscreen' ),
+                       'Download File'       => __( 'Download File' ),
+                       'Download Video'      => __( 'Download Video' ),
+                       'Play/Pause'          => __( 'Play/Pause' ),
+                       'Mute Toggle'         => __( 'Mute Toggle' ),
+                       'None'                => __( 'None' ),
+                       'Turn off Fullscreen' => __( 'Turn off Fullscreen' ),
+                       'Go Fullscreen'       => __( 'Go Fullscreen' ),
+                       'Unmute'              => __( 'Unmute' ),
+                       'Mute'                => __( 'Mute' ),
+                       'Captions/Subtitles'  => __( 'Captions/Subtitles' )
+               ),
+       ) );
+
+
+       $scripts->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement.js", array('mediaelement'), false, 1 );
+       did_action( 'init' ) && $scripts->localize( 'wp-mediaelement', '_wpmejsSettings', array(
+               'pluginPath' => includes_url( 'js/mediaelement/', 'relative' ),
+       ) );
+
        $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array('jquery'), false, 1 );
        did_action( 'init' ) && $scripts->localize( 'password-strength-meter', 'pwsL10n', array(
                'empty' => __('Strength indicator'),
@@ -298,7 +345,7 @@ function wp_default_scripts( &$scripts ) {
 
        $scripts->add( 'media-upload', "/wp-admin/js/media-upload$suffix.js", array( 'thickbox', 'shortcode' ), false, 1 );
 
-       $scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), 'r6', 1 );
+       $scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), 'r7', 1 );
 
        $scripts->add( 'customize-base',     "/wp-includes/js/customize-base$suffix.js",     array( 'jquery', 'json2' ), false, 1 );
        $scripts->add( 'customize-loader',   "/wp-includes/js/customize-loader$suffix.js",   array( 'customize-base' ), false, 1 );
@@ -316,8 +363,10 @@ function wp_default_scripts( &$scripts ) {
                'allowedFiles' => __( 'Allowed Files' ),
        ) );
 
+       $scripts->add( 'accordion', "/wp-admin/js/accordion$suffix.js", array( 'jquery' ), false, 1 );
+
        $scripts->add( 'shortcode', "/wp-includes/js/shortcode$suffix.js", array( 'underscore' ), false, 1 );
-       $scripts->add( 'media-models', "/wp-includes/js/media-models$suffix.js", array( 'backbone', 'jquery' ), false, 1 );
+       $scripts->add( 'media-models', "/wp-includes/js/media-models$suffix.js", array( 'wp-backbone' ), false, 1 );
        did_action( 'init' ) && $scripts->localize( 'media-models', '_wpMediaModelsL10n', array(
                'settings' => array(
                        'ajaxurl' => admin_url( 'admin-ajax.php', 'relative' ),
@@ -339,16 +388,12 @@ function wp_default_scripts( &$scripts ) {
                        'how' => __('Separate multiple categories with commas.')
                ) );
 
-               $scripts->add( 'admin-categories', "/wp-admin/js/categories$suffix.js", array('wp-lists'), false, 1 );
-
                $scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array('jquery', 'wp-ajax-response'), false, 1 );
                did_action( 'init' ) && $scripts->localize( 'admin-tags', 'tagsl10n', array(
                        'noPerm' => __('You do not have permission to do that.'),
                        'broken' => __('An unidentified error has occurred.')
                ));
 
-               $scripts->add( 'admin-custom-fields', "/wp-admin/js/custom-fields$suffix.js", array('wp-lists'), false, 1 );
-
                $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'quicktags', 'jquery-query'), false, 1 );
                did_action( 'init' ) && $scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
                        'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),
@@ -361,13 +406,15 @@ function wp_default_scripts( &$scripts ) {
 
                $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), false, 1 );
 
-               $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox'), false, 1 );
+               $scripts->add( 'post', "/wp-admin/js/post$suffix.js", array('suggest', 'wp-lists', 'postbox', 'heartbeat'), false, 1 );
                did_action( 'init' ) && $scripts->localize( 'post', 'postL10n', array(
                        'ok' => __('OK'),
                        'cancel' => __('Cancel'),
                        'publishOn' => __('Publish on:'),
                        'publishOnFuture' =>  __('Schedule for:'),
                        'publishOnPast' => __('Published on:'),
+                       /* translators: 1: month, 2: day, 3: year, 4: hour, 5: minute */
+                       'dateFormat' => __('%1$s %2$s, %3$s @ %4$s : %5$s'),
                        'showcomm' => __('Show more comments'),
                        'endcomm' => __('No more comments found.'),
                        'publish' => __('Publish'),
@@ -401,7 +448,7 @@ function wp_default_scripts( &$scripts ) {
                // @todo: Core no longer uses theme-preview.js. Remove?
                $scripts->add( 'theme-preview', "/wp-admin/js/theme-preview$suffix.js", array( 'thickbox', 'jquery' ), false, 1 );
 
-               $scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'suggest' ), false, 1 );
+               $scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'suggest', 'heartbeat' ), false, 1 );
                did_action( 'init' ) && $scripts->localize( 'inline-edit-post', 'inlineEditL10n', array(
                        'error' => __('Error while saving the changes.'),
                        'ntdeltitle' => __('Remove From Bulk Edit'),
@@ -522,6 +569,10 @@ function wp_default_styles( &$styles ) {
        $styles->add( 'customize-controls', "/wp-admin/css/customize-controls$suffix.css", array( 'wp-admin', 'colors', 'ie' ) );
        $styles->add( 'media-views', "/wp-includes/css/media-views$suffix.css", array( 'buttons' ) );
        $styles->add( 'buttons', "/wp-includes/css/buttons$suffix.css" );
+       $styles->add( 'wp-auth-check', "/wp-includes/css/wp-auth-check$suffix.css" );
+
+       $styles->add( 'mediaelement', "/wp-includes/js/mediaelement/mediaelementplayer.min.css", array(), '2.13.0' );
+       $styles->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement.css", array( 'mediaelement' ) );
 
        foreach ( $rtl_styles as $rtl_style ) {
                $styles->add_data( $rtl_style, 'rtl', true );
@@ -567,7 +618,8 @@ function wp_just_in_time_script_localization() {
        wp_localize_script( 'autosave', 'autosaveL10n', array(
                'autosaveInterval' => AUTOSAVE_INTERVAL,
                'savingText' => __('Saving Draft&#8230;'),
-               'saveAlert' => __('The changes you made will be lost if you navigate away from this page.')
+               'saveAlert' => __('The changes you made will be lost if you navigate away from this page.'),
+               'blog_id' => get_current_blog_id(),
        ) );
 
 }
index 2dfc2774502d1cabf5a436675b38ce645b34035e..a40959491bc5f028c8da8465be686b2e4f379488 100644 (file)
@@ -127,6 +127,43 @@ function remove_all_shortcodes() {
        $shortcode_tags = array();
 }
 
+/**
+ * Whether a registered shortcode exists named $tag
+ *
+ * @since 3.6.0
+ *
+ * @global array $shortcode_tags
+ * @param string $tag
+ * @return boolean
+ */
+function shortcode_exists( $tag ) {
+       global $shortcode_tags;
+       return array_key_exists( $tag, $shortcode_tags );
+}
+
+/**
+ * Whether the passed content contains the specified shortcode
+ *
+ * @since 3.6.0
+ *
+ * @global array $shortcode_tags
+ * @param string $tag
+ * @return boolean
+ */
+function has_shortcode( $content, $tag ) {
+       if ( shortcode_exists( $tag ) ) {
+               preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER );
+               if ( empty( $matches ) )
+                       return false;
+
+               foreach ( $matches as $shortcode ) {
+                       if ( $tag === $shortcode[2] )
+                               return true;
+               }
+       }
+       return false;
+}
+
 /**
  * Search content for shortcodes and filter shortcodes through their hooks.
  *
@@ -289,9 +326,10 @@ function shortcode_parse_atts($text) {
  *
  * @param array $pairs Entire list of supported attributes and their defaults.
  * @param array $atts User defined attributes in shortcode tag.
+ * @param string $shortcode Optional. The name of the shortcode, provided for context to enable filtering
  * @return array Combined and filtered attribute list.
  */
-function shortcode_atts($pairs, $atts) {
+function shortcode_atts( $pairs, $atts, $shortcode = '' ) {
        $atts = (array)$atts;
        $out = array();
        foreach($pairs as $name => $default) {
@@ -300,6 +338,10 @@ function shortcode_atts($pairs, $atts) {
                else
                        $out[$name] = $default;
        }
+
+       if ( $shortcode )
+               $out = apply_filters( "shortcode_atts_{$shortcode}", $out, $pairs, $atts );
+
        return $out;
 }
 
index 1932bab383046c37401c0a03e98a6832f8d0212f..ecca35fc053b1c335e0d5e4f065f27edff4d44a9 100644 (file)
@@ -317,18 +317,19 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
        if ( ! is_array($wp_taxonomies) )
                $wp_taxonomies = array();
 
-       $defaults = array(      'hierarchical' => false,
-                                               'update_count_callback' => '',
-                                               'rewrite' => true,
-                                               'query_var' => $taxonomy,
-                                               'public' => true,
-                                               'show_ui' => null,
-                                               'show_tagcloud' => null,
-                                               '_builtin' => false,
-                                               'labels' => array(),
-                                               'capabilities' => array(),
-                                               'show_in_nav_menus' => null,
-                                       );
+       $defaults = array(
+               'hierarchical' => false,
+               'update_count_callback' => '',
+               'rewrite' => true,
+               'query_var' => $taxonomy,
+               'public' => true,
+               'show_ui' => null,
+               'show_tagcloud' => null,
+               '_builtin' => false,
+               'labels' => array(),
+               'capabilities' => array(),
+               'show_in_nav_menus' => null,
+       );
        $args = wp_parse_args($args, $defaults);
 
        if ( strlen( $taxonomy ) > 32 )
@@ -411,6 +412,7 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
  * - separate_items_with_commas - This string isn't used on hierarchical taxonomies. Default is "Separate tags with commas", used in the meta box.
  * - add_or_remove_items - This string isn't used on hierarchical taxonomies. Default is "Add or remove tags", used in the meta box when JavaScript is disabled.
  * - choose_from_most_used - This string isn't used on hierarchical taxonomies. Default is "Choose from the most used tags", used in the meta box.
+ * - not_found - This string isn't used on hierarchical taxonomies. Default is "No tags found", used in the meta box.
  *
  * Above, the first default value is for non-hierarchical taxonomies (like tags) and the second one is for hierarchical taxonomies (like categories).
  *
@@ -423,6 +425,9 @@ function get_taxonomy_labels( $tax ) {
        if ( isset( $tax->helps ) && empty( $tax->labels['separate_items_with_commas'] ) )
                $tax->labels['separate_items_with_commas'] = $tax->helps;
 
+       if ( isset( $tax->no_tagcloud ) && empty( $tax->labels['not_found'] ) )
+               $tax->labels['not_found'] = $tax->no_tagcloud;
+
        $nohier_vs_hier_defaults = array(
                'name' => array( _x( 'Tags', 'taxonomy general name' ), _x( 'Categories', 'taxonomy general name' ) ),
                'singular_name' => array( _x( 'Tag', 'taxonomy singular name' ), _x( 'Category', 'taxonomy singular name' ) ),
@@ -439,6 +444,7 @@ function get_taxonomy_labels( $tax ) {
                'separate_items_with_commas' => array( __( 'Separate tags with commas' ), null ),
                'add_or_remove_items' => array( __( 'Add or remove tags' ), null ),
                'choose_from_most_used' => array( __( 'Choose from the most used tags' ), null ),
+               'not_found' => array( __( 'No tags found.' ), null ),
        );
        $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];
 
@@ -785,7 +791,7 @@ class WP_Tax_Query {
                if ( $query['field'] == $resulting_field )
                        return;
 
-               $resulting_field = esc_sql( $resulting_field );
+               $resulting_field = sanitize_key( $resulting_field );
 
                switch ( $query['field'] ) {
                        case 'slug':
@@ -954,7 +960,7 @@ function get_term_by($field, $value, $taxonomy, $output = OBJECT, $filter = 'raw
                        return false;
        } else if ( 'name' == $field ) {
                // Assume already escaped
-               $value = stripslashes($value);
+               $value = wp_unslash($value);
                $field = 't.name';
        } else {
                $term = get_term( (int) $value, $taxonomy, $output, $filter);
@@ -1240,10 +1246,10 @@ function get_terms($taxonomies, $args = '') {
        // $args can be whatever, only use the args defined in defaults to compute the key
        $filter_key = ( has_filter('list_terms_exclusions') ) ? serialize($GLOBALS['wp_filter']['list_terms_exclusions']) : '';
        $key = md5( serialize( compact(array_keys($defaults)) ) . serialize( $taxonomies ) . $filter_key );
-       $last_changed = wp_cache_get('last_changed', 'terms');
-       if ( !$last_changed ) {
-               $last_changed = time();
-               wp_cache_set('last_changed', $last_changed, 'terms');
+       $last_changed = wp_cache_get( 'last_changed', 'terms' );
+       if ( ! $last_changed ) {
+               $last_changed = microtime();
+               wp_cache_set( 'last_changed', $last_changed, 'terms' );
        }
        $cache_key = "get_terms:$key:$last_changed";
        $cache = wp_cache_get( $cache_key, 'terms' );
@@ -1346,7 +1352,7 @@ function get_terms($taxonomies, $args = '') {
                $where .= ' AND tt.count > 0';
 
        // don't limit the query results when we have to descend the family tree
-       if ( ! empty($number) && ! $hierarchical && empty( $child_of ) && '' === $parent ) {
+       if ( $number && ! $hierarchical && ! $child_of && '' === $parent ) {
                if ( $offset )
                        $limits = 'LIMIT ' . $offset . ',' . $number;
                else
@@ -1451,9 +1457,8 @@ function get_terms($taxonomies, $args = '') {
                $terms = $_terms;
        }
 
-       if ( 0 < $number && intval(@count($terms)) > $number ) {
-               $terms = array_slice($terms, $offset, $number);
-       }
+       if ( $number && is_array( $terms ) && count( $terms ) > $number )
+               $terms = array_slice( $terms, $offset, $number );
 
        wp_cache_add( $cache_key, $terms, 'terms', DAY_IN_SECONDS );
 
@@ -1494,7 +1499,7 @@ function term_exists($term, $taxonomy = '', $parent = 0) {
                        return $wpdb->get_var( $wpdb->prepare( $select . $where, $term ) );
        }
 
-       $term = trim( stripslashes( $term ) );
+       $term = trim( wp_unslash( $term ) );
 
        if ( '' === $slug = sanitize_title($term) )
                return 0;
@@ -1712,26 +1717,21 @@ function wp_count_terms( $taxonomy, $args = array() ) {
  * @package WordPress
  * @subpackage Taxonomy
  * @since 2.3.0
- * @uses $wpdb
+ * @uses wp_remove_object_terms()
  *
  * @param int $object_id The term Object Id that refers to the term
  * @param string|array $taxonomies List of Taxonomy Names or single Taxonomy name.
  */
 function wp_delete_object_term_relationships( $object_id, $taxonomies ) {
-       global $wpdb;
-
        $object_id = (int) $object_id;
 
        if ( !is_array($taxonomies) )
                $taxonomies = array($taxonomies);
 
        foreach ( (array) $taxonomies as $taxonomy ) {
-               $tt_ids = wp_get_object_terms($object_id, $taxonomy, array('fields' => 'tt_ids'));
-               $in_tt_ids = "'" . implode("', '", $tt_ids) . "'";
-               do_action( 'delete_term_relationships', $object_id, $tt_ids );
-               $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_tt_ids)", $object_id) );
-               do_action( 'deleted_term_relationships', $object_id, $tt_ids );
-               wp_update_term_count($tt_ids, $taxonomy);
+               $term_ids = wp_get_object_terms( $object_id, $taxonomy, array( 'fields' => 'ids' ) );
+               $term_ids = array_map( 'intval', $term_ids );
+               wp_remove_object_terms( $object_id, $term_ids, $taxonomy );
        }
 }
 
@@ -1752,8 +1752,8 @@ function wp_delete_object_term_relationships( $object_id, $taxonomies ) {
  *
  * @uses $wpdb
  * @uses do_action() Calls both 'delete_term' and 'delete_$taxonomy' action
- *     hooks, passing term object, term id. 'delete_term' gets an additional
- *     parameter with the $taxonomy parameter.
+ *     hooks, passing term ID, term taxonomy ID, and deleted term object. 'delete_term'
+ *     also gets taxonomy as the third parameter.
  *
  * @param int $term Term ID
  * @param string $taxonomy Taxonomy Name
@@ -2062,8 +2062,8 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) {
        extract($args, EXTR_SKIP);
 
        // expected_slashed ($name)
-       $name = stripslashes($name);
-       $description = stripslashes($description);
+       $name = wp_unslash($name);
+       $description = wp_unslash($description);
 
        if ( empty($slug) )
                $slug = sanitize_title($name);
@@ -2158,7 +2158,7 @@ function wp_insert_term( $term, $taxonomy, $args = array() ) {
  * @package WordPress
  * @subpackage Taxonomy
  * @since 2.3.0
- * @uses $wpdb
+ * @uses wp_remove_object_terms()
  *
  * @param int $object_id The object to relate to.
  * @param array|int|string $terms The slug or id of the term, will replace all existing
@@ -2215,13 +2215,17 @@ function wp_set_object_terms($object_id, $terms, $taxonomy, $append = false) {
                wp_update_term_count( $new_tt_ids, $taxonomy );
 
        if ( ! $append ) {
-               $delete_terms = array_diff($old_tt_ids, $tt_ids);
-               if ( $delete_terms ) {
-                       $in_delete_terms = "'" . implode("', '", $delete_terms) . "'";
-                       do_action( 'delete_term_relationships', $object_id, $delete_terms );
-                       $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_delete_terms)", $object_id) );
-                       do_action( 'deleted_term_relationships', $object_id, $delete_terms );
-                       wp_update_term_count($delete_terms, $taxonomy);
+               $delete_tt_ids = array_diff( $old_tt_ids, $tt_ids );
+
+               if ( $delete_tt_ids ) {
+                       $in_delete_tt_ids = "'" . implode( "', '", $delete_tt_ids ) . "'";
+                       $delete_term_ids = $wpdb->get_col( $wpdb->prepare( "SELECT tt.term_id FROM $wpdb->term_taxonomy AS tt WHERE tt.taxonomy = %s AND tt.term_taxonomy_id IN ($in_delete_tt_ids)", $taxonomy ) );
+                       $delete_term_ids = array_map( 'intval', $delete_term_ids );
+
+                       $remove = wp_remove_object_terms( $object_id, $delete_term_ids, $taxonomy );
+                       if ( is_wp_error( $remove ) ) {
+                               return $remove;
+                       }
                }
        }
 
@@ -2244,6 +2248,86 @@ function wp_set_object_terms($object_id, $terms, $taxonomy, $append = false) {
        return $tt_ids;
 }
 
+/**
+ * Add term(s) associated with a given object.
+ *
+ * @package WordPress
+ * @subpackage Taxonomy
+ * @since 3.6
+ * @uses wp_set_object_terms()
+ *
+ * @param int $object_id The ID of the object to which the terms will be added.
+ * @param array|int|string $terms The slug(s) or ID(s) of the term(s) to add.
+ * @param array|string $taxonomy Taxonomy name.
+ * @return array|WP_Error Affected Term IDs
+ */
+function wp_add_object_terms( $object_id, $terms, $taxonomy ) {
+       return wp_set_object_terms( $object_id, $terms, $taxonomy, true );
+}
+
+/**
+ * Remove term(s) associated with a given object.
+ *
+ * @package WordPress
+ * @subpackage Taxonomy
+ * @since 3.6
+ * @uses $wpdb
+ *
+ * @uses apply_filters() Calls 'delete_term_relationships' hook with object_id and tt_ids as parameters.
+ * @uses apply_filters() Calls 'deleted_term_relationships' hook with object_id and tt_ids as parameters.
+ *
+ * @param int $object_id The ID of the object from which the terms will be removed.
+ * @param array|int|string $terms The slug(s) or ID(s) of the term(s) to remove.
+ * @param array|string $taxonomy Taxonomy name.
+ * @return bool|WP_Error True on success, false or WP_Error on failure.
+ */
+function wp_remove_object_terms( $object_id, $terms, $taxonomy ) {
+       global $wpdb;
+
+       $object_id = (int) $object_id;
+
+       if ( ! taxonomy_exists( $taxonomy ) ) {
+               return new WP_Error( 'invalid_taxonomy', __( 'Invalid Taxonomy' ) );
+       }
+
+       if ( ! is_array( $terms ) ) {
+               $terms = array( $terms );
+       }
+
+       $tt_ids = array();
+
+       foreach ( (array) $terms as $term ) {
+               if ( ! strlen( trim( $term ) ) ) {
+                       continue;
+               }
+
+               if ( ! $term_info = term_exists( $term, $taxonomy ) ) {
+                       // Skip if a non-existent term ID is passed.
+                       if ( is_int( $term ) ) {
+                               continue;
+                       }
+               }
+
+               if ( is_wp_error( $term_info ) ) {
+                       return $term_info;
+               }
+
+               $tt_ids[] = $term_info['term_taxonomy_id'];
+       }
+
+       if ( $tt_ids ) {
+               $in_tt_ids = "'" . implode( "', '", $tt_ids ) . "'";
+               do_action( 'delete_term_relationships', $object_id, $tt_ids );
+               $deleted = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_tt_ids)", $object_id ) );
+               do_action( 'deleted_term_relationships', $object_id, $tt_ids );
+               wp_update_term_count( $tt_ids, $taxonomy );
+
+               return (bool) $deleted;
+       }
+
+       return false;
+}
+
 /**
  * Will make slug unique, if it isn't already.
  *
@@ -2361,7 +2445,7 @@ function wp_update_term( $term_id, $taxonomy, $args = array() ) {
                return $term;
 
        // Escape data pulled from DB.
-       $term = add_magic_quotes($term);
+       $term = wp_slash($term);
 
        // Merge old and new args with new args overwriting old ones.
        $args = array_merge($term, $args);
@@ -2372,8 +2456,8 @@ function wp_update_term( $term_id, $taxonomy, $args = array() ) {
        extract($args, EXTR_SKIP);
 
        // expected_slashed ($name)
-       $name = stripslashes($name);
-       $description = stripslashes($description);
+       $name = wp_unslash($name);
+       $description = wp_unslash($description);
 
        if ( '' == trim($name) )
                return new WP_Error('empty_term_name', __('A name is required for this term'));
@@ -2632,7 +2716,7 @@ function clean_term_cache($ids, $taxonomy = '', $clean_taxonomy = true) {
                do_action('clean_term_cache', $ids, $taxonomy);
        }
 
-       wp_cache_set('last_changed', time(), 'terms');
+       wp_cache_set( 'last_changed', microtime(), 'terms' );
 }
 
 /**
index 99d004687b66155336d935c630ed5c66dbe5d3fd..5bee8ad52d17b0fe9ed4a55ea65037d0faf75089 100644 (file)
@@ -96,8 +96,8 @@ function get_author_template() {
 /**
  * Retrieve path of category template in current or parent template.
  *
- * Works by first retrieving the current slug for example 'category-default.php' and then
- * trying category ID, for example 'category-1.php' and will finally fallback to category.php
+ * Works by first retrieving the current slug, for example 'category-default.php', and then
+ * trying category ID, for example 'category-1.php', and will finally fall back to category.php
  * template, if those files don't exist.
  *
  * @since 1.5.0
@@ -122,8 +122,8 @@ function get_category_template() {
 /**
  * Retrieve path of tag template in current or parent template.
  *
- * Works by first retrieving the current tag name, for example 'tag-wordpress.php' and then
- * trying tag ID, for example 'tag-1.php' and will finally fallback to tag.php
+ * Works by first retrieving the current tag name, for example 'tag-wordpress.php', and then
+ * trying tag ID, for example 'tag-1.php', and will finally fall back to tag.php
  * template, if those files don't exist.
  *
  * @since 2.3.0
@@ -191,7 +191,7 @@ function get_date_template() {
 /**
  * Retrieve path of home template in current or parent template.
  *
- * This is the template used for the page containing the blog posts
+ * This is the template used for the page containing the blog posts.
  *
  * Attempts to locate 'home.php' first before falling back to 'index.php'.
  *
@@ -225,9 +225,9 @@ function get_front_page_template() {
 /**
  * Retrieve path of page template in current or parent template.
  *
- * Will first look for the specifically assigned page template
- * The will search for 'page-{slug}.php' followed by 'page-id.php'
- * and finally 'page.php'
+ * Will first look for the specifically assigned page template.
+ * Then will search for 'page-{slug}.php', followed by 'page-{id}.php',
+ * and finally 'page.php'.
  *
  * @since 1.5.0
  *
index d8c2419773d3e163bc1595de6f9ac435515999e1..a1dec2634e8f4b9fac44db5e277c91b40fe2cdb5 100644 (file)
@@ -340,7 +340,7 @@ function search_theme_directories( $force = false ) {
 
        // Set up maybe-relative, maybe-absolute array of theme directories.
        // We always want to return absolute, but we need to cache relative
-       // use in for get_theme_root().
+       // to use in get_theme_root().
        foreach ( $wp_theme_directories as $theme_root ) {
                if ( 0 === strpos( $theme_root, WP_CONTENT_DIR ) )
                        $relative_theme_roots[ str_replace( WP_CONTENT_DIR, '', $theme_root ) ] = $theme_root;
@@ -544,7 +544,7 @@ function locale_stylesheet() {
 /**
  * Start preview theme output buffer.
  *
- * Will only preform task if the user has permissions and template and preview
+ * Will only perform task if the user has permissions and template and preview
  * query variables exist.
  *
  * @since 2.6.0
@@ -631,7 +631,7 @@ function preview_theme_ob_filter( $content ) {
  */
 function preview_theme_ob_filter_callback( $matches ) {
        if ( strpos($matches[4], 'onclick') !== false )
-               $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\)\\1#i', '', $matches[4]); //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if its escaped by \  to prevent breaking mid-attribute.
+               $matches[4] = preg_replace('#onclick=([\'"]).*?(?<!\\\)\\1#i', '', $matches[4]); //Strip out any onclicks from rest of <a>. (?<!\\\) means to ignore the '" if it's escaped by \  to prevent breaking mid-attribute.
        if (
                ( false !== strpos($matches[3], '/wp-admin/') )
        ||
@@ -981,12 +981,12 @@ function is_random_header_image( $type = 'any' ) {
 }
 
 /**
- * Display header image path.
+ * Display header image URL.
  *
  * @since 2.1.0
  */
 function header_image() {
-       echo get_header_image();
+       echo esc_url( get_header_image() );
 }
 
 /**
@@ -1013,8 +1013,10 @@ function get_uploaded_header_images() {
                $header_images[$header_index]['attachment_id'] =  $header->ID;
                $header_images[$header_index]['url'] =  $url;
                $header_images[$header_index]['thumbnail_url'] =  $url;
-               $header_images[$header_index]['width'] = $header_data['width'];
-               $header_images[$header_index]['height'] = $header_data['height'];
+               if ( isset( $header_data['width'] ) )
+                       $header_images[$header_index]['width'] = $header_data['width'];
+               if ( isset( $header_data['height'] ) )
+                       $header_images[$header_index]['height'] = $header_data['height'];
        }
 
        return $header_images;
@@ -1489,7 +1491,7 @@ function _remove_theme_support( $feature ) {
 
        switch ( $feature ) {
                case 'custom-header' :
-                       if ( false === did_action( 'wp_loaded', '_custom_header_background_just_in_time' ) )
+                       if ( ! did_action( 'wp_loaded' ) )
                                break;
                        $support = get_theme_support( 'custom-header' );
                        if ( $support[0]['wp-head-callback'] )
@@ -1499,7 +1501,7 @@ function _remove_theme_support( $feature ) {
                        break;
 
                case 'custom-background' :
-                       if ( false === did_action( 'wp_loaded', '_custom_header_background_just_in_time' ) )
+                       if ( ! did_action( 'wp_loaded' ) )
                                break;
                        $support = get_theme_support( 'custom-background' );
                        remove_action( 'wp_head', $support[0]['wp-head-callback'] );
index b6205063f982f8e76ab4d360b998d9a38babbee0..61d163aaf40ac68b06644e3bc0813167b1fa7726 100644 (file)
@@ -51,13 +51,13 @@ function wp_version_check() {
        else
                $mysql_version = 'N/A';
 
-       if ( is_multisite( ) ) {
-               $user_count = get_user_count( );
-               $num_blogs = get_blog_count( );
-               $wp_install = network_site_url( );
+       if ( is_multisite() ) {
+               $user_count = get_user_count();
+               $num_blogs = get_blog_count();
+               $wp_install = network_site_url();
                $multisite_enabled = 1;
        } else {
-               $user_count = count_users( );
+               $user_count = count_users();
                $user_count = $user_count['total_users'];
                $multisite_enabled = 0;
                $num_blogs = 1;
@@ -274,7 +274,7 @@ function wp_update_themes() {
                        $timeout = 12 * HOUR_IN_SECONDS;
        }
 
-       $time_not_changed = isset( $last_update->last_checked ) && $timeout > ( time( ) - $last_update->last_checked );
+       $time_not_changed = isset( $last_update->last_checked ) && $timeout > ( time() - $last_update->last_checked );
 
        if ( $time_not_changed ) {
                $theme_changed = false;
@@ -313,7 +313,7 @@ function wp_update_themes() {
                return false;
 
        $new_update = new stdClass;
-       $new_update->last_checked = time( );
+       $new_update->last_checked = time();
        $new_update->checked = $checked;
 
        $response = maybe_unserialize( wp_remote_retrieve_body( $raw_response ) );
@@ -404,9 +404,9 @@ function _maybe_update_plugins() {
  * @since 2.7.0
  * @access private
  */
-function _maybe_update_themes( ) {
+function _maybe_update_themes() {
        $current = get_site_transient( 'update_themes' );
-       if ( isset( $current->last_checked ) && 12 * HOUR_IN_SECONDS > ( time( ) - $current->last_checked ) )
+       if ( isset( $current->last_checked ) && 12 * HOUR_IN_SECONDS > ( time() - $current->last_checked ) )
                return;
 
        wp_update_themes();
index 57f1ec94f97851fa39b5f613e12b03aa27736d12..bc583a57899dc31b7e2dd6e00cd1ad09cf49b8f8 100644 (file)
@@ -87,18 +87,18 @@ function wp_authenticate_username_password($user, $username, $password) {
        $user = get_user_by('login', $username);
 
        if ( !$user )
-               return new WP_Error('invalid_username', sprintf(__('<strong>ERROR</strong>: Invalid username. <a href="%s" title="Password Lost and Found">Lost your password</a>?'), wp_lostpassword_url()));
+               return new WP_Error( 'invalid_username', sprintf( __( '<strong>ERROR</strong>: Invalid username. <a href="%s" title="Password Lost and Found">Lost your password</a>?' ), wp_lostpassword_url() ) );
 
        if ( is_multisite() ) {
                // Is user marked as spam?
-               if ( 1 == $user->spam)
-                       return new WP_Error('invalid_username', __('<strong>ERROR</strong>: Your account has been marked as a spammer.'));
+               if ( 1 == $user->spam )
+                       return new WP_Error( 'spammer_account', __( '<strong>ERROR</strong>: Your account has been marked as a spammer.' ) );
 
                // Is a user's blog marked as spam?
-               if ( !is_super_admin( $user->ID ) && isset($user->primary_blog) ) {
+               if ( !is_super_admin( $user->ID ) && isset( $user->primary_blog ) ) {
                        $details = get_blog_details( $user->primary_blog );
                        if ( is_object( $details ) && $details->spam == 1 )
-                               return new WP_Error('blog_suspended', __('Site Suspended.'));
+                               return new WP_Error( 'blog_suspended', __( 'Site Suspended.' ) );
                }
        }
 
@@ -276,11 +276,6 @@ function update_user_option( $user_id, $option_name, $newvalue, $global = false
        if ( !$global )
                $option_name = $wpdb->prefix . $option_name;
 
-       // For backward compatibility. See differences between update_user_meta() and deprecated update_usermeta().
-       // http://core.trac.wordpress.org/ticket/13088
-       if ( is_null( $newvalue ) || is_scalar( $newvalue ) && empty( $newvalue ) )
-               return delete_user_meta( $user_id, $option_name );
-
        return update_user_meta( $user_id, $option_name, $newvalue );
 }
 
@@ -397,8 +392,10 @@ class WP_User_Query {
                        $qv['fields'] = array_unique( $qv['fields'] );
 
                        $this->query_fields = array();
-                       foreach ( $qv['fields'] as $field )
-                               $this->query_fields[] = $wpdb->users . '.' . esc_sql( $field );
+                       foreach ( $qv['fields'] as $field ) {
+                               $field = 'ID' === $field ? 'ID' : sanitize_key( $field );
+                               $this->query_fields[] = "$wpdb->users.$field";
+                       }
                        $this->query_fields = implode( ',', $this->query_fields );
                } elseif ( 'all' == $qv['fields'] ) {
                        $this->query_fields = "$wpdb->users.*";
@@ -474,12 +471,14 @@ class WP_User_Query {
                                        $search_columns = array('user_email');
                                elseif ( is_numeric($search) )
                                        $search_columns = array('user_login', 'ID');
-                               elseif ( preg_match('|^https?://|', $search) && ! ( is_multisite() && function_exists( 'wp_is_large_network' ) && wp_is_large_network( 'users' ) ) )
+                               elseif ( preg_match('|^https?://|', $search) && ! ( is_multisite() && wp_is_large_network( 'users' ) ) )
                                        $search_columns = array('user_url');
                                else
                                        $search_columns = array('user_login', 'user_nicename');
                        }
 
+                       $search_columns = apply_filters( 'user_search_columns', $search_columns, $search, $this );
+
                        $this->query_where .= $this->get_search_sql( $search, $search_columns, $wild );
                }
 
@@ -794,7 +793,7 @@ function is_user_member_of_blog( $user_id = 0, $blog_id = 0 ) {
  * @param string $meta_key Metadata name.
  * @param mixed $meta_value Metadata value.
  * @param bool $unique Optional, default is false. Whether the same key should not be added.
- * @return bool False for failure. True for success.
+ * @return int|bool Meta ID on success, false on failure.
  */
 function add_user_meta($user_id, $meta_key, $meta_value, $unique = false) {
        return add_metadata('user', $user_id, $meta_key, $meta_value, $unique);
@@ -814,7 +813,7 @@ function add_user_meta($user_id, $meta_key, $meta_value, $unique = false) {
  * @param int $user_id user ID
  * @param string $meta_key Metadata name.
  * @param mixed $meta_value Optional. Metadata value.
- * @return bool False for failure. True for success.
+ * @return bool True on success, false on failure.
  */
 function delete_user_meta($user_id, $meta_key, $meta_value = '') {
        return delete_metadata('user', $user_id, $meta_key, $meta_value);
@@ -853,7 +852,7 @@ function get_user_meta($user_id, $key = '', $single = false) {
  * @param string $meta_key Metadata key.
  * @param mixed $meta_value Metadata value.
  * @param mixed $prev_value Optional. Previous value to check before removing.
- * @return bool False on failure, true if success.
+ * @return bool True on success, false on failure.
  */
 function update_user_meta($user_id, $meta_key, $meta_value, $prev_value = '') {
        return update_metadata('user', $user_id, $meta_key, $meta_value, $prev_value);
@@ -1032,7 +1031,7 @@ function wp_dropdown_users( $args = '' ) {
        extract( $r, EXTR_SKIP );
 
        $query_args = wp_array_slice_assoc( $r, array( 'blog_id', 'include', 'exclude', 'orderby', 'order', 'who' ) );
-       $query_args['fields'] = array( 'ID', $show );
+       $query_args['fields'] = array( 'ID', 'user_login', $show );
        $users = get_users( $query_args );
 
        $output = '';
@@ -1390,7 +1389,7 @@ function wp_insert_user( $userdata ) {
        }
 
        $data = compact( 'user_pass', 'user_email', 'user_url', 'user_nicename', 'display_name', 'user_registered' );
-       $data = stripslashes_deep( $data );
+       $data = wp_unslash( $data );
 
        if ( $update ) {
                $wpdb->update( $wpdb->users, $data, compact( 'ID' ) );
@@ -1429,9 +1428,6 @@ function wp_insert_user( $userdata ) {
  * It is possible to update a user's password by specifying the 'user_pass'
  * value in the $userdata parameter array.
  *
- * If $userdata does not contain an 'ID' key, then a new user will be created
- * and the new user's ID will be returned.
- *
  * If current user's password is being updated, then the cookies will be
  * cleared.
  *
@@ -1453,7 +1449,7 @@ function wp_update_user($userdata) {
        // First, get all of the original fields
        $user_obj = get_userdata( $ID );
        if ( ! $user_obj )
-               return new WP_Error( 'invalid_user_id', __( 'Invalid user ID' ) );
+               return new WP_Error( 'invalid_user_id', __( 'Invalid user ID.' ) );
 
        $user = $user_obj->to_array();
 
@@ -1504,8 +1500,8 @@ function wp_update_user($userdata) {
  * @return int The new user's ID.
  */
 function wp_create_user($username, $password, $email = '') {
-       $user_login = esc_sql( $username );
-       $user_email = esc_sql( $email    );
+       $user_login = wp_slash( $username );
+       $user_email = wp_slash( $email    );
        $user_pass = $password;
 
        $userdata = compact('user_login', 'user_email', 'user_pass');
@@ -1527,7 +1523,9 @@ function _get_additional_user_keys( $user ) {
 }
 
 /**
- * Set up the default contact methods.
+ * Set up the contact methods.
+ *
+ * Default contact methods were removed in 3.6. A filter dictates contact methods.
  *
  * @since 2.9.0
  * @access private
@@ -1536,10 +1534,13 @@ function _get_additional_user_keys( $user ) {
  * @return array $user_contactmethods Array of contact methods and their labels.
  */
 function _wp_get_user_contactmethods( $user = null ) {
-       $user_contactmethods = array(
-               'aim' => __('AIM'),
-               'yim' => __('Yahoo IM'),
-               'jabber' => __('Jabber / Google Talk')
-       );
+       $user_contactmethods = array();
+       if ( get_site_option( 'initial_db_version' ) < 23588 ) {
+               $user_contactmethods = array(
+                       'aim'    => __( 'AIM' ),
+                       'yim'    => __( 'Yahoo IM' ),
+                       'jabber' => __( 'Jabber / Google Talk' )
+               );
+       }
        return apply_filters( 'user_contactmethods', $user_contactmethods, $user );
 }
index 23e0e5804f1c610c5631335a9b8e23ebd8f23059..f55cdbd9fdf5f155ee1bda078997cf133e342ed5 100644 (file)
@@ -93,10 +93,10 @@ $is_apache = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') !== false || strpos(
 $is_IIS = !$is_apache && (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false || strpos($_SERVER['SERVER_SOFTWARE'], 'ExpressionDevServer') !== false);
 
 /**
- * Whether the server software is IIS 7.X
+ * Whether the server software is IIS 7.X or greater
  * @global bool $is_iis7
  */
-$is_iis7 = $is_IIS && (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/7.') !== false);
+$is_iis7 = $is_IIS && intval( substr( $_SERVER['SERVER_SOFTWARE'], strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/' ) + 14 ) ) >= 7;
 
 /**
  * Test if the current browser runs on a mobile device (smart phone, tablet, etc.)
index 8a1b9570f26fda77a83799fec0144f37d50d3980..d26f9421b21d9a31cb4e735e521f936098f9934a 100644 (file)
@@ -4,21 +4,21 @@
  *
  * @global string $wp_version
  */
-$wp_version = '3.5.2';
+$wp_version = '3.6';
 
 /**
  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
  *
  * @global int $wp_db_version
  */
-$wp_db_version = 22442;
+$wp_db_version = 24448;
 
 /**
  * Holds the TinyMCE version
  *
  * @global string $tinymce_version
  */
-$tinymce_version = '358-24486';
+$tinymce_version = '358-24485';
 
 /**
  * Holds the required PHP version
index 2277fad192f230a6735b193e0a1f8b326906fdf5..d6f213a1d58f81e801ba3bfa99a11bf26126ba17 100644 (file)
@@ -70,13 +70,6 @@ class WP_Widget {
 
        // Functions you'll need to call.
 
-       /**
-        * PHP4 constructor
-        */
-       function WP_Widget( $id_base = false, $name, $widget_options = array(), $control_options = array() ) {
-               WP_Widget::__construct( $id_base, $name, $widget_options, $control_options );
-       }
-
        /**
         * PHP5 constructor
         *
@@ -90,7 +83,7 @@ class WP_Widget {
         *       - width: required if more than 250px
         *       - height: currently not used but may be needed in the future
         */
-       function __construct( $id_base = false, $name, $widget_options = array(), $control_options = array() ) {
+       function __construct( $id_base, $name, $widget_options = array(), $control_options = array() ) {
                $this->id_base = empty($id_base) ? preg_replace( '/(wp_)?widget_/', '', strtolower(get_class($this)) ) : strtolower($id_base);
                $this->name = $name;
                $this->option_name = 'widget_' . $this->id_base;
@@ -98,6 +91,13 @@ class WP_Widget {
                $this->control_options = wp_parse_args( $control_options, array('id_base' => $this->id_base) );
        }
 
+       /**
+        * PHP4 constructor
+        */
+       function WP_Widget( $id_base, $name, $widget_options = array(), $control_options = array() ) {
+               WP_Widget::__construct( $id_base, $name, $widget_options, $control_options );
+       }
+
        /**
         * Constructs name attributes for use in form() fields
         *
@@ -509,34 +509,45 @@ function register_sidebars($number = 1, $args = array()) {
 /**
  * Builds the definition for a single sidebar and returns the ID.
  *
- * The $args parameter takes either a string or an array with 'name' and 'id'
- * contained in either usage. It will be noted that the values will be applied
- * to all sidebars, so if creating more than one, it will be advised to allow
- * for WordPress to create the defaults for you.
- *
- * Example for string would be <code>'name=whatever;id=whatever1'</code> and for
- * the array it would be <code>array(
- *    'name' => 'whatever',
- *    'id' => 'whatever1')</code>.
- *
- * name - The name of the sidebar, which presumably the title which will be
- *     displayed.
- * id - The unique identifier by which the sidebar will be called by.
- * before_widget - The content that will prepended to the widgets when they are
- *     displayed.
- * after_widget - The content that will be appended to the widgets when they are
- *     displayed.
- * before_title - The content that will be prepended to the title when displayed.
- * after_title - the content that will be appended to the title when displayed.
- *
- * <em>Content</em> is assumed to be HTML and should be formatted as such, but
- * doesn't have to be.
+ * Accepts either a string or an array and then parses that against a set
+ * of default arguments for the new sidebar. WordPress will automatically
+ * generate a sidebar ID and name based on the current number of registered
+ * sidebars if those arguments are not included.
+ *
+ * When allowing for automatic generation of the name and ID parameters, keep
+ * in mind that the incrementor for your sidebar can change over time depending
+ * on what other plugins and themes are installed.
+ *
+ * If theme support for 'widgets' has not yet been added when this function is
+ * called, it will be automatically enabled through the use of add_theme_support()
+ *
+ * Arguments passed as a string should be separated by '&':
+ *
+ *     e.g. 'name=Sidebar&id=my_prefix_sidebar'
+ *
+ * The same arguments passed as an array:
+ *
+ *     array(
+ *         'name' => 'Sidebar',
+ *         'id'   => 'my_prefix_sidebar',
+ *     )
+ *
+ * Arguments:
+ *     name          - The name or title of the sidebar displayed in the admin dashboard.
+ *     id            - The unique identifier by which the sidebar will be called.
+ *     before_widget - HTML content that will be prepended to each widget's HTML output
+ *                     when assigned to this sidebar.
+ *     after_widget  - HTML content that will be appended to each widget's HTML output
+ *                     when assigned to this sidebar.
+ *     before_title  - HTML content that will be prepended to the sidebar title when displayed.
+ *     after_title   - HTML content that will be appended to the sidebar title when displayed.
  *
  * @since 2.2.0
  * @uses $wp_registered_sidebars Stores the new sidebar in this array by sidebar ID.
+ * @uses add_theme_support() to ensure widget support has been added.
  *
- * @param string|array $args Builds Sidebar based off of 'name' and 'id' values
- * @return string The sidebar id that was added.
+ * @param string|array $args Arguments for the sidebar being registered.
+ * @return string Sidebar ID added to $wp_registered_sidebars global.
  */
 function register_sidebar($args = array()) {
        global $wp_registered_sidebars;
index 4fc829fb6c56510ec81c82f32726018e12473d42..2398002e323dcc9519f71a29a972113a83688d1f 100644 (file)
@@ -441,15 +441,6 @@ class wpdb {
         */
        var $collate;
 
-       /**
-        * Whether to use mysql_real_escape_string
-        *
-        * @since 2.8.0
-        * @access public
-        * @var bool
-        */
-       var $real_escape = false;
-
        /**
         * Database Username
         *
@@ -536,7 +527,7 @@ class wpdb {
        function __construct( $dbuser, $dbpassword, $dbname, $dbhost ) {
                register_shutdown_function( array( $this, '__destruct' ) );
 
-               if ( WP_DEBUG )
+               if ( WP_DEBUG && WP_DEBUG_DISPLAY )
                        $this->show_errors();
 
                $this->init_charset();
@@ -640,15 +631,14 @@ class wpdb {
         * @param string   $charset The character set (optional)
         * @param string   $collate The collation (optional)
         */
-       function set_charset($dbh, $charset = null, $collate = null) {
-               if ( !isset($charset) )
+       function set_charset( $dbh, $charset = null, $collate = null ) {
+               if ( ! isset( $charset ) )
                        $charset = $this->charset;
-               if ( !isset($collate) )
+               if ( ! isset( $collate ) )
                        $collate = $this->collate;
-               if ( $this->has_cap( 'collation', $dbh ) && !empty( $charset ) ) {
-                       if ( function_exists( 'mysql_set_charset' ) && $this->has_cap( 'set_charset', $dbh ) ) {
+               if ( $this->has_cap( 'collation' ) && ! empty( $charset ) ) {
+                       if ( function_exists( 'mysql_set_charset' ) && $this->has_cap( 'set_charset' ) ) {
                                mysql_set_charset( $charset, $dbh );
-                               $this->real_escape = true;
                        } else {
                                $query = $this->prepare( 'SET NAMES %s', $charset );
                                if ( ! empty( $collate ) )
@@ -856,24 +846,29 @@ class wpdb {
        }
 
        /**
-        * Weak escape, using addslashes()
+        * Do not use, deprecated.
+        *
+        * Use esc_sql() or wpdb::prepare() instead.
         *
-        * @see addslashes()
         * @since 2.8.0
+        * @deprecated 3.6.0
+        * @see wpdb::prepare
+        * @see esc_sql()
         * @access private
         *
         * @param string $string
         * @return string
         */
        function _weak_escape( $string ) {
+               if ( func_num_args() === 1 && function_exists( '_deprecated_function' ) )
+                       _deprecated_function( __METHOD__, '3.6', 'wpdb::prepare() or esc_sql()' );
                return addslashes( $string );
        }
 
        /**
-        * Real escape, using mysql_real_escape_string() or addslashes()
+        * Real escape, using mysql_real_escape_string()
         *
         * @see mysql_real_escape_string()
-        * @see addslashes()
         * @since 2.8.0
         * @access private
         *
@@ -881,16 +876,17 @@ class wpdb {
         * @return string escaped
         */
        function _real_escape( $string ) {
-               if ( $this->dbh && $this->real_escape )
+               if ( $this->dbh )
                        return mysql_real_escape_string( $string, $this->dbh );
-               else
-                       return addslashes( $string );
+
+               $class = get_class( $this );
+               _doing_it_wrong( $class, "$class must set a database connection for use with escaping.", E_USER_NOTICE );
+               return addslashes( $string );
        }
 
        /**
         * Escape data. Works on arrays.
         *
-        * @uses wpdb::_escape()
         * @uses wpdb::_real_escape()
         * @since  2.8.0
         * @access private
@@ -900,7 +896,7 @@ class wpdb {
         */
        function _escape( $data ) {
                if ( is_array( $data ) ) {
-                       foreach ( (array) $data as $k => $v ) {
+                       foreach ( $data as $k => $v ) {
                                if ( is_array($v) )
                                        $data[$k] = $this->_escape( $v );
                                else
@@ -914,24 +910,30 @@ class wpdb {
        }
 
        /**
-        * Escapes content for insertion into the database using addslashes(), for security.
+        * Do not use, deprecated.
         *
-        * Works on arrays.
+        * Use esc_sql() or wpdb::prepare() instead.
         *
         * @since 0.71
-        * @param string|array $data to escape
-        * @return string|array escaped as query safe string
+        * @deprecated 3.6.0
+        * @see wpdb::prepare()
+        * @see esc_sql()
+        *
+        * @param mixed $data
+        * @return mixed
         */
        function escape( $data ) {
+               if ( func_num_args() === 1 && function_exists( '_deprecated_function' ) )
+                       _deprecated_function( __METHOD__, '3.6', 'wpdb::prepare() or esc_sql()' );
                if ( is_array( $data ) ) {
-                       foreach ( (array) $data as $k => $v ) {
+                       foreach ( $data as $k => $v ) {
                                if ( is_array( $v ) )
-                                       $data[$k] = $this->escape( $v );
+                                       $data[$k] = $this->escape( $v, 'recursive' );
                                else
-                                       $data[$k] = $this->_weak_escape( $v );
+                                       $data[$k] = $this->_weak_escape( $v, 'internal' );
                        }
                } else {
-                       $data = $this->_weak_escape( $data );
+                       $data = $this->_weak_escape( $data, 'internal' );
                }
 
                return $data;
@@ -987,13 +989,10 @@ class wpdb {
         * @return null|false|string Sanitized query string, null if there is no query, false if there is an error and string
         *      if there was something to prepare
         */
-       function prepare( $query, $args = null ) {
+       function prepare( $query, $args ) {
                if ( is_null( $query ) )
                        return;
 
-               if ( func_num_args() < 2 )
-                       _doing_it_wrong( 'wpdb::prepare', 'wpdb::prepare() requires at least two arguments.', '3.5' );
-
                $args = func_get_args();
                array_shift( $args );
                // If args were passed as an array (as in vsprintf), move them up
@@ -1205,6 +1204,10 @@ class wpdb {
 
                // If there is an error then take note of it..
                if ( $this->last_error = mysql_error( $this->dbh ) ) {
+                       // Clear insert_id on a subsequent failed insert.
+                       if ( $this->insert_id && preg_match( '/^\s*(insert|replace)\s/i', $query ) )
+                               $this->insert_id = 0;
+
                        $this->print_error();
                        return false;
                }
@@ -1693,12 +1696,12 @@ class wpdb {
        }
 
        /**
-        * Determine if a database supports a particular feature
+        * Determine if a database supports a particular feature.
         *
         * @since 2.7.0
-        * @see   wpdb::db_version()
+        * @see wpdb::db_version()
         *
-        * @param string $db_cap the feature
+        * @param string $db_cap The feature to check for.
         * @return bool
         */
        function has_cap( $db_cap ) {
@@ -1706,11 +1709,11 @@ class wpdb {
 
                switch ( strtolower( $db_cap ) ) {
                        case 'collation' :    // @since 2.5.0
-                       case 'group_concat' : // @since 2.7
-                       case 'subqueries' :   // @since 2.7
+                       case 'group_concat' : // @since 2.7.0
+                       case 'subqueries' :   // @since 2.7.0
                                return version_compare( $version, '4.1', '>=' );
                        case 'set_charset' :
-                               return version_compare($version, '5.0.7', '>=');
+                               return version_compare( $version, '5.0.7', '>=' );
                };
 
                return false;
index 65dd00743de144a0ee50010ec7de3d826019889b..62f4162fa37df5c7c72933ab84537bb83d29b826 100644 (file)
@@ -59,6 +59,15 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
         */
        var $inline_diff_renderer = 'WP_Text_Diff_Renderer_inline';
 
+       /**
+        * Should we show the split view or not
+        *
+        * @var string
+        * @access protected
+        * @since 3.6.0
+        */
+       var $_show_split_view = true;
+
        /**
         * Constructor - Call parent constructor with params array.
         *
@@ -70,6 +79,8 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
         */
        function __construct( $params = array() ) {
                parent::__construct( $params );
+               if ( isset( $params[ 'show_split_view' ] ) )
+                       $this->_show_split_view = $params[ 'show_split_view' ];
        }
 
        /**
@@ -98,7 +109,8 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
         * @return string
         */
        function addedLine( $line ) {
-               return "<td>+</td><td class='diff-addedline'>{$line}</td>";
+               return "<td class='diff-addedline'>{$line}</td>";
+
        }
 
        /**
@@ -108,7 +120,7 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
         * @return string
         */
        function deletedLine( $line ) {
-               return "<td>-</td><td class='diff-deletedline'>{$line}</td>";
+               return "<td class='diff-deletedline'>{$line}</td>";
        }
 
        /**
@@ -118,7 +130,7 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
         * @return string
         */
        function contextLine( $line ) {
-               return "<td> </td><td class='diff-context'>{$line}</td>";
+               return "<td class='diff-context'>{$line}</td>";
        }
 
        /**
@@ -127,7 +139,7 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
         * @return string
         */
        function emptyLine() {
-               return '<td colspan="2">&nbsp;</td>';
+               return '<td>&nbsp;</td>';
        }
 
        /**
@@ -143,7 +155,11 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
                foreach ($lines as $line) {
                        if ( $encode )
                                $line = htmlspecialchars( $line );
-                       $r .= '<tr>' . $this->emptyLine() . $this->addedLine( $line ) . "</tr>\n";
+                       if ( $this->_show_split_view ) {
+                               $r .= '<tr>' . $this->emptyLine() . $this->emptyLine() . $this->addedLine( $line ) . "</tr>\n";
+                       } else {
+                               $r .= '<tr>' . $this->addedLine( $line ) . "</tr>\n";
+                       }
                }
                return $r;
        }
@@ -161,7 +177,12 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
                foreach ($lines as $line) {
                        if ( $encode )
                                $line = htmlspecialchars( $line );
-                       $r .= '<tr>' . $this->deletedLine( $line ) . $this->emptyLine() . "</tr>\n";
+                       if ( $this->_show_split_view ) {
+                               $r .= '<tr>' . $this->deletedLine( $line ) . $this->emptyLine() . $this->emptyLine() . "</tr>\n";
+                       } else {
+                               $r .= '<tr>' . $this->deletedLine( $line ) . "</tr>\n";
+                       }
+
                }
                return $r;
        }
@@ -179,8 +200,11 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
                foreach ($lines as $line) {
                        if ( $encode )
                                $line = htmlspecialchars( $line );
-                       $r .= '<tr>' .
-                               $this->contextLine( $line ) . $this->contextLine( $line ) . "</tr>\n";
+                       if (  $this->_show_split_view ) {
+                               $r .= '<tr>' . $this->contextLine( $line ) . $this->emptyLine() . $this->contextLine( $line )  . "</tr>\n";
+                       } else {
+                               $r .= '<tr>' . $this->contextLine( $line ) . "</tr>\n";
+                       }
                }
                return $r;
        }
@@ -264,7 +288,11 @@ class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer {
                        } elseif ( $final_rows[$row] < 0 ) { // Final is blank. This is really a deleted row.
                                $r .= $this->_deleted( array($orig_line), false );
                        } else { // A true changed row.
-                               $r .= '<tr>' . $this->deletedLine( $orig_line ) . $this->addedLine( $final_line ) . "</tr>\n";
+                               if ( $this->_show_split_view ) {
+                                       $r .= '<tr>' . $this->deletedLine( $orig_line ) . $this->emptyLine() . $this->addedLine( $final_line ) . "</tr>\n";
+                               } else {
+                                       $r .= '<tr>' . $this->deletedLine( $orig_line ) . "</tr><tr>" . $this->addedLine( $final_line ) . "</tr>\n";
+                               }
                        }
                }
 
index 209341fa6adef8a5b00c28daa4bc6829a01b080f..532ffd970de3025aaca22dfe7184ff3ecac64eda 100644 (file)
@@ -65,7 +65,16 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') {
        wp_admin_css( 'colors-fresh', true );
 
        if ( wp_is_mobile() ) { ?>
-               <meta name="viewport" content="width=320; initial-scale=0.9; maximum-scale=1.0; user-scalable=0;" /><?php
+               <meta name="viewport" content="width=320, initial-scale=0.9, maximum-scale=1.0, user-scalable=0" /><?php
+       }
+
+       // Remove all stored post data on logging out.
+       // This could be added by add_action('login_head'...) like wp_shake_js()
+       // but maybe better if it's not removable by plugins
+       if ( 'loggedout' == $wp_error->get_error_code() ) {
+               ?>
+               <script>if("sessionStorage" in window){try{for(var key in sessionStorage){if(key.indexOf("wp-autosave-")!=-1){sessionStorage.removeItem(key)}}}catch(e){}};</script>
+               <?php
        }
 
        do_action( 'login_enqueue_scripts' );
@@ -82,16 +91,23 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') {
        $login_header_url   = apply_filters( 'login_headerurl',   $login_header_url   );
        $login_header_title = apply_filters( 'login_headertitle', $login_header_title );
 
-       // Don't allow interim logins to navigate away from the page.
-       if ( $interim_login )
-               $login_header_url = '#';
-
        $classes = array( 'login-action-' . $action, 'wp-core-ui' );
        if ( wp_is_mobile() )
                $classes[] = 'mobile';
        if ( is_rtl() )
                $classes[] = 'rtl';
+       if ( $interim_login ) {
+               $classes[] = 'interim-login';
+               ?>
+               <style type="text/css">html{background-color: transparent;}</style>
+               <?php
+
+               if ( 'success' ===  $interim_login )
+                       $classes[] = 'interim-login-success';
+       }
+
        $classes = apply_filters( 'login_body_class', $classes, $action );
+
        ?>
        </head>
        <body class="login <?php echo esc_attr( implode( ' ', $classes ) ); ?>">
@@ -248,7 +264,7 @@ function retrieve_password() {
        $message = apply_filters('retrieve_password_message', $message, $key);
 
        if ( $message && !wp_mail($user_email, $title, $message) )
-               wp_die( __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function...') );
+               wp_die( __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function.') );
 
        return true;
 }
@@ -338,7 +354,7 @@ function register_new_user( $user_login, $user_email ) {
        $user_pass = wp_generate_password( 12, false);
        $user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
        if ( ! $user_id ) {
-               $errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email' ) ) );
+               $errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn&#8217;t register you&hellip; please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email' ) ) );
                return $errors;
        }
 
@@ -386,6 +402,8 @@ do_action( 'login_init' );
 do_action( 'login_form_' . $action );
 
 $http_post = ('POST' == $_SERVER['REQUEST_METHOD']);
+$interim_login = isset($_REQUEST['interim-login']);
+
 switch ($action) {
 
 case 'postpass' :
@@ -393,7 +411,7 @@ case 'postpass' :
        $hasher = new PasswordHash( 8, true );
 
        // 10 days
-       setcookie( 'wp-postpass_' . COOKIEHASH, $hasher->HashPassword( stripslashes( $_POST['post_password'] ) ), time() + 10 * DAY_IN_SECONDS, COOKIEPATH );
+       setcookie( 'wp-postpass_' . COOKIEHASH, $hasher->HashPassword( wp_unslash( $_POST['post_password'] ) ), time() + 10 * DAY_IN_SECONDS, COOKIEPATH );
 
        wp_safe_redirect( wp_get_referer() );
        exit();
@@ -428,7 +446,7 @@ case 'retrievepassword' :
        do_action('lost_password');
        login_header(__('Lost Password'), '<p class="message">' . __('Please enter your username or email address. You will receive a link to create a new password via email.') . '</p>', $errors);
 
-       $user_login = isset($_POST['user_login']) ? stripslashes($_POST['user_login']) : '';
+       $user_login = isset($_POST['user_login']) ? wp_unslash($_POST['user_login']) : '';
 
 ?>
 
@@ -445,7 +463,7 @@ case 'retrievepassword' :
 <p id="nav">
 <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e('Log in') ?></a>
 <?php if ( get_option( 'users_can_register' ) ) : ?>
- | <a href="<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login' ) ); ?>"><?php _e( 'Register' ); ?></a>
+ | <?php echo apply_filters( 'register', sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ) ); ?>
 <?php endif; ?>
 </p>
 
@@ -482,7 +500,7 @@ case 'rp' :
        login_header(__('Reset Password'), '<p class="message reset-pass">' . __('Enter your new password below.') . '</p>', $errors );
 
 ?>
-<form name="resetpassform" id="resetpassform" action="<?php echo esc_url( site_url( 'wp-login.php?action=resetpass&key=' . urlencode( $_GET['key'] ) . '&login=' . urlencode( $_GET['login'] ), 'login_post' ) ); ?>" method="post">
+<form name="resetpassform" id="resetpassform" action="<?php echo esc_url( site_url( 'wp-login.php?action=resetpass&key=' . urlencode( $_GET['key'] ) . '&login=' . urlencode( $_GET['login'] ), 'login_post' ) ); ?>" method="post" autocomplete="off">
        <input type="hidden" id="user_login" value="<?php echo esc_attr( $_GET['login'] ); ?>" autocomplete="off" />
 
        <p>
@@ -504,7 +522,7 @@ case 'rp' :
 <p id="nav">
 <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
 <?php if ( get_option( 'users_can_register' ) ) : ?>
- | <a href="<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login' ) ); ?>"><?php _e( 'Register' ); ?></a>
+ | <?php echo apply_filters( 'register', sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ) ); ?>
 <?php endif; ?>
 </p>
 
@@ -544,11 +562,11 @@ case 'register' :
 <form name="registerform" id="registerform" action="<?php echo esc_url( site_url('wp-login.php?action=register', 'login_post') ); ?>" method="post">
        <p>
                <label for="user_login"><?php _e('Username') ?><br />
-               <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr(stripslashes($user_login)); ?>" size="20" /></label>
+               <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr(wp_unslash($user_login)); ?>" size="20" /></label>
        </p>
        <p>
                <label for="user_email"><?php _e('E-mail') ?><br />
-               <input type="text" name="user_email" id="user_email" class="input" value="<?php echo esc_attr(stripslashes($user_email)); ?>" size="25" /></label>
+               <input type="text" name="user_email" id="user_email" class="input" value="<?php echo esc_attr(wp_unslash($user_email)); ?>" size="25" /></label>
        </p>
 <?php do_action('register_form'); ?>
        <p id="reg_passmail"><?php _e('A password will be e-mailed to you.') ?></p>
@@ -569,7 +587,6 @@ break;
 case 'login' :
 default:
        $secure_cookie = '';
-       $interim_login = isset($_REQUEST['interim-login']);
        $customize_login = isset( $_REQUEST['customize-login'] );
        if ( $customize_login )
                wp_enqueue_script( 'customize-base' );
@@ -609,13 +626,8 @@ default:
        if ( !is_wp_error($user) && !$reauth ) {
                if ( $interim_login ) {
                        $message = '<p class="message">' . __('You have logged in successfully.') . '</p>';
+                       $interim_login = 'success';
                        login_header( '', $message ); ?>
-
-                       <?php if ( ! $customize_login ) : ?>
-                       <script type="text/javascript">setTimeout( function(){window.close()}, 8000);</script>
-                       <p class="alignright">
-                       <input type="button" class="button-primary" value="<?php esc_attr_e('Close'); ?>" onclick="window.close()" /></p>
-                       <?php endif; ?>
                        </div>
                        <?php do_action( 'login_footer' ); ?>
                        <?php if ( $customize_login ) : ?>
@@ -647,21 +659,26 @@ default:
        if ( isset($_POST['testcookie']) && empty($_COOKIE[TEST_COOKIE]) )
                $errors->add('test_cookie', __("<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress."));
 
-       // Some parts of this script use the main login form to display a message
-       if              ( isset($_GET['loggedout']) && true == $_GET['loggedout'] )
-               $errors->add('loggedout', __('You are now logged out.'), 'message');
-       elseif  ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] )
-               $errors->add('registerdisabled', __('User registration is currently not allowed.'));
-       elseif  ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] )
-               $errors->add('confirm', __('Check your e-mail for the confirmation link.'), 'message');
-       elseif  ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] )
-               $errors->add('newpass', __('Check your e-mail for your new password.'), 'message');
-       elseif  ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] )
-               $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message');
-       elseif  ( $interim_login )
-               $errors->add('expired', __('Your session has expired. Please log-in again.'), 'message');
-       elseif ( strpos( $redirect_to, 'about.php?updated' ) )
-               $errors->add('updated', __( '<strong>You have successfully updated WordPress!</strong> Please log back in to experience the awesomeness.' ), 'message' );
+       if ( $interim_login ) {
+               if ( ! $errors->get_error_code() )
+                       $errors->add('expired', __('Session expired. Please log in again. You will not move away from this page.'), 'message');
+       } else {
+               // Some parts of this script use the main login form to display a message
+               if              ( isset($_GET['loggedout']) && true == $_GET['loggedout'] )
+                       $errors->add('loggedout', __('You are now logged out.'), 'message');
+               elseif  ( isset($_GET['registration']) && 'disabled' == $_GET['registration'] )
+                       $errors->add('registerdisabled', __('User registration is currently not allowed.'));
+               elseif  ( isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail'] )
+                       $errors->add('confirm', __('Check your e-mail for the confirmation link.'), 'message');
+               elseif  ( isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail'] )
+                       $errors->add('newpass', __('Check your e-mail for your new password.'), 'message');
+               elseif  ( isset($_GET['checkemail']) && 'registered' == $_GET['checkemail'] )
+                       $errors->add('registered', __('Registration complete. Please check your e-mail.'), 'message');
+               elseif ( strpos( $redirect_to, 'about.php?updated' ) )
+                       $errors->add('updated', __( '<strong>You have successfully updated WordPress!</strong> Please log back in to experience the awesomeness.' ), 'message' );
+       }
+
+       $errors = apply_filters( 'wp_login_errors', $errors, $redirect_to );
 
        // Clear any stale cookies.
        if ( $reauth )
@@ -670,7 +687,7 @@ default:
        login_header(__('Log In'), '', $errors);
 
        if ( isset($_POST['log']) )
-               $user_login = ( 'incorrect_password' == $errors->get_error_code() || 'empty_password' == $errors->get_error_code() ) ? esc_attr(stripslashes($_POST['log'])) : '';
+               $user_login = ( 'incorrect_password' == $errors->get_error_code() || 'empty_password' == $errors->get_error_code() ) ? esc_attr(wp_unslash($_POST['log'])) : '';
        $rememberme = ! empty( $_POST['rememberme'] );
 ?>
 
@@ -699,14 +716,13 @@ default:
        </p>
 </form>
 
-<?php if ( !$interim_login ) { ?>
+<?php if ( ! $interim_login ) { ?>
 <p id="nav">
-<?php if ( isset($_GET['checkemail']) && in_array( $_GET['checkemail'], array('confirm', 'newpass') ) ) : ?>
-<?php elseif ( get_option('users_can_register') ) : ?>
-<a href="<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login' ) ); ?>"><?php _e( 'Register' ); ?></a> |
-<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>" title="<?php esc_attr_e( 'Password Lost and Found' ); ?>"><?php _e( 'Lost your password?' ); ?></a>
-<?php else : ?>
-<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>" title="<?php esc_attr_e( 'Password Lost and Found' ); ?>"><?php _e( 'Lost your password?' ); ?></a>
+<?php if ( ! isset( $_GET['checkemail'] ) || ! in_array( $_GET['checkemail'], array( 'confirm', 'newpass' ) ) ) : ?>
+       <?php if ( get_option( 'users_can_register' ) ) : ?>
+               <?php echo apply_filters( 'register', sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) ) ); ?> |
+       <?php endif; ?>
+       <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>" title="<?php esc_attr_e( 'Password Lost and Found' ); ?>"><?php _e( 'Lost your password?' ); ?></a>
 <?php endif; ?>
 </p>
 <?php } ?>
@@ -735,6 +751,17 @@ d.select();
 wp_attempt_focus();
 <?php } ?>
 if(typeof wpOnload=='function')wpOnload();
+<?php if ( $interim_login ) { ?>
+(function(){
+try {
+       var i, links = document.getElementsByTagName('a');
+       for ( i in links ) {
+               if ( links[i].href )
+                       links[i].target = '_blank';
+       }
+} catch(e){}
+}());
+<?php } ?>
 </script>
 
 <?php
index 5685b3acf9576c52d1a042c8d96bf3cdad8fea6f..27290b11151fcd2429aa9418cc306c56a0d7bf3f 100644 (file)
@@ -202,7 +202,7 @@ for ( $i = 1; $i <= $count; $i++ ) {
        $post_category = array(get_option('default_email_category'));
 
        $post_data = compact('post_content','post_title','post_date','post_date_gmt','post_author','post_category', 'post_status');
-       $post_data = add_magic_quotes($post_data);
+       $post_data = wp_slash($post_data);
 
        $post_ID = wp_insert_post($post_data);
        if ( is_wp_error( $post_ID ) )
index 65485a841064227188f0325c5c748aed73d33ee1..1094749e3580a61ad9a85eb491d8db7cc1b0d2a7 100644 (file)
@@ -23,7 +23,7 @@ require( ABSPATH . WPINC . '/default-constants.php' );
 require( ABSPATH . WPINC . '/version.php' );
 
 // Set initial default constants including WP_MEMORY_LIMIT, WP_MAX_MEMORY_LIMIT, WP_DEBUG, WP_CONTENT_DIR and WP_CACHE.
-wp_initial_constants( );
+wp_initial_constants();
 
 // Check for the required PHP version and for the MySQL extension or a database drop-in.
 wp_check_php_mysql_versions();
@@ -117,6 +117,8 @@ require( ABSPATH . WPINC . '/link-template.php' );
 require( ABSPATH . WPINC . '/author-template.php' );
 require( ABSPATH . WPINC . '/post.php' );
 require( ABSPATH . WPINC . '/post-template.php' );
+require( ABSPATH . WPINC . '/revision.php' );
+require( ABSPATH . WPINC . '/post-formats.php' );
 require( ABSPATH . WPINC . '/post-thumbnail-template.php' );
 require( ABSPATH . WPINC . '/category.php' );
 require( ABSPATH . WPINC . '/category-template.php' );
@@ -152,7 +154,7 @@ if ( is_multisite() ) {
 
 // Define constants that rely on the API to obtain the default value.
 // Define must-use plugin directory constants, which may be overridden in the sunrise.php drop-in.
-wp_plugin_directory_constants( );
+wp_plugin_directory_constants();
 
 // Load must-use plugins.
 foreach ( wp_get_mu_plugins() as $mu_plugin ) {
@@ -174,10 +176,10 @@ if ( is_multisite() )
        ms_cookie_constants(  );
 
 // Define constants after multisite is loaded. Cookie-related constants may be overridden in ms_network_cookies().
-wp_cookie_constants( );
+wp_cookie_constants();
 
 // Define and enforce our SSL constants
-wp_ssl_constants( );
+wp_ssl_constants();
 
 // Create common globals.
 require( ABSPATH . WPINC . '/vars.php' );
@@ -209,7 +211,7 @@ if ( WP_CACHE && function_exists( 'wp_cache_postload' ) )
 do_action( 'plugins_loaded' );
 
 // Define constants which affect functionality if not already defined.
-wp_functionality_constants( );
+wp_functionality_constants();
 
 // Add magic quotes and set up $_REQUEST ( $_GET + $_POST )
 wp_magic_quotes();
index 7d35d8659fd1e7fc45bd465cb9859f50a380ea1e..9dd2c3da9579377f7ff41625727e723e2e107cd7 100644 (file)
@@ -12,6 +12,11 @@ if ( is_array( get_site_option( 'illegal_names' )) && isset( $_GET[ 'new' ] ) &&
        die();
 }
 
+/**
+ * Prints signup_header via wp_head
+ *
+ * @since MU
+ */
 function do_signup_header() {
        do_action( 'signup_header' );
 }
@@ -30,6 +35,11 @@ if ( !is_main_site() ) {
 // Fix for page title
 $wp_query->is_404 = false;
 
+/**
+ * Prints styles for front-end Multisite signup pages
+ *
+ * @since MU
+ */
 function wpmu_signup_stylesheet() {
        ?>
        <style type="text/css">
@@ -58,6 +68,15 @@ do_action( 'before_signup_form' );
 <div id="content" class="widecolumn">
 <div class="mu_register">
 <?php
+/**
+ * Generates and displays the Signup and Create Site forms
+ *
+ * @since MU
+ *
+ * @param string $blogname The new site name
+ * @param string $blog_title The new site title
+ * @param array $errors
+ */
 function show_blog_form($blogname = '', $blog_title = '', $errors = '') {
        global $current_site;
        // Blog name
@@ -112,6 +131,15 @@ function show_blog_form($blogname = '', $blog_title = '', $errors = '') {
        do_action('signup_blogform', $errors);
 }
 
+/**
+ * Validate the new site signup
+ *
+ * @since MU
+ *
+ * @uses wp_get_current_user() to retrieve the current user
+ * @uses wpmu_validate_blog_signup() to validate new site signup for the current user
+ * @return array Contains the new site data and error messages.
+ */
 function validate_blog_form() {
        $user = '';
        if ( is_user_logged_in() )
@@ -120,6 +148,15 @@ function validate_blog_form() {
        return wpmu_validate_blog_signup($_POST['blogname'], $_POST['blog_title'], $user);
 }
 
+/**
+ * Display user registration form
+ *
+ * @since MU
+ *
+ * @param string $user_name The entered username
+ * @param string $user_email The entered email address
+ * @param array $errors
+ */
 function show_user_form($user_name = '', $user_email = '', $errors = '') {
        // User name
        echo '<label for="user_name">' . __('Username:') . '</label>';
@@ -142,10 +179,28 @@ function show_user_form($user_name = '', $user_email = '', $errors = '') {
        do_action( 'signup_extra_fields', $errors );
 }
 
+/**
+ * Validate user signup name and email
+ *
+ * @since MU
+ *
+ * @uses wpmu_validate_user_signup() to retrieve an array of user data
+ * @return array Contains username, email, and error messages.
+ */
 function validate_user_form() {
        return wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']);
 }
 
+/**
+ * Allow returning users to sign up for another site
+ *
+ * @since MU
+ *
+ * @uses wp_get_current_user() to get the current user
+ * @param string $blogname The new site name
+ * @param string $blog_title The new blog title
+ * @param array $errors
+ */
 function signup_another_blog($blogname = '', $blog_title = '', $errors = '') {
        global $current_site;
        $current_user = wp_get_current_user();
@@ -191,6 +246,16 @@ function signup_another_blog($blogname = '', $blog_title = '', $errors = '') {
        <?php
 }
 
+/**
+ * Validate a new blog signup
+ *
+ * @since MU
+ *
+ * @uses wp_get_current_user() to retrieve the current user
+ * @uses wpmu_create_blog() to add a new site
+ * @uses confirm_another_blog_signup() to confirm the user's new site signup
+ * @return bool True if blog signup was validated, false if error
+ */
 function validate_another_blog_signup() {
        global $wpdb, $blogname, $blog_title, $errors, $domain, $path;
        $current_user = wp_get_current_user();
@@ -214,7 +279,18 @@ function validate_another_blog_signup() {
        return true;
 }
 
-function confirm_another_blog_signup($domain, $path, $blog_title, $user_name, $user_email = '', $meta = '') {
+/**
+ * Confirm a new site signup
+ *
+ * @since MU
+ *
+ * @param string $domain The domain URL
+ * @param string $path The site root path
+ * @param string $user_name The username
+ * @param string $user_email The user's email address
+ * @param array $meta Any additional meta from the 'add_signup_meta' filter in validate_blog_signup()
+ */
+function confirm_another_blog_signup( $domain, $path, $blog_title, $user_name, $user_email = '', $meta = array() ) {
        ?>
        <h2><?php printf( __( 'The site %s is yours.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2>
        <p>
@@ -224,6 +300,17 @@ function confirm_another_blog_signup($domain, $path, $blog_title, $user_name, $u
        do_action( 'signup_finished' );
 }
 
+/**
+ * Setup the new user signup process
+ *
+ * @since MU
+ *
+ * @uses apply_filters() filter $filtered_results
+ * @uses show_user_form() to display the user registration form
+ * @param string $user_name The username
+ * @param string $user_email The user's email
+ * @param array $errors
+ */
 function signup_user($user_name = '', $user_email = '', $errors = '') {
        global $current_site, $active_signup;
 
@@ -265,6 +352,16 @@ function signup_user($user_name = '', $user_email = '', $errors = '') {
        <?php
 }
 
+/**
+ * Validate the new user signup
+ *
+ * @since MU
+ *
+ * @uses validate_user_form() to retrieve an array of the user data
+ * @uses wpmu_signup_user() to signup the new user
+ * @uses confirm_user_signup() to confirm the new user signup
+ * @return bool True if new user signup was validated, false if error
+ */
 function validate_user_signup() {
        $result = validate_user_form();
        extract($result);
@@ -285,6 +382,14 @@ function validate_user_signup() {
        return true;
 }
 
+/**
+ * New user signup confirmation
+ *
+ * @since MU
+ *
+ * @param string $user_name The username
+ * @param string $user_email The user's email address
+ */
 function confirm_user_signup($user_name, $user_email) {
        ?>
        <h2><?php printf( __( '%s is your new username' ), $user_name) ?></h2>
@@ -295,6 +400,19 @@ function confirm_user_signup($user_name, $user_email) {
        do_action( 'signup_finished' );
 }
 
+/**
+ * Setup the new site signup
+ *
+ * @since MU
+ *
+ * @uses apply_filters() to filter $filtered_results
+ * @uses show_blog_form() to display the blog signup form
+ * @param string $user_name The username
+ * @param string $user_email The user's email address
+ * @param string $blogname The site name
+ * @param string $blog_title The site title
+ * @param array $errors
+ */
 function signup_blog($user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '') {
        if ( !is_wp_error($errors) )
                $errors = new WP_Error();
@@ -321,6 +439,18 @@ function signup_blog($user_name = '', $user_email = '', $blogname = '', $blog_ti
        <?php
 }
 
+/**
+ * Validate new site signup
+ *
+ * @since MU
+ *
+ * @uses wpmu_validate_user_signup() to retrieve an array of the new user data and errors
+ * @uses wpmu_validate_blog_signup() to retrieve an array of the new site data and errors
+ * @uses apply_filters() to make signup $meta filterable
+ * @uses signup_user() to signup a new user
+ * @uses signup_blog() to signup a the new user to a new site
+ * @return bool True if the site signup was validated, false if error
+ */
 function validate_blog_signup() {
        // Re-validate user info.
        $result = wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']);
@@ -348,7 +478,19 @@ function validate_blog_signup() {
        return true;
 }
 
-function confirm_blog_signup($domain, $path, $blog_title, $user_name = '', $user_email = '', $meta) {
+/**
+ * New site signup confirmation
+ *
+ * @since MU
+ *
+ * @param string $domain The domain URL
+ * @param string $path The site root path
+ * @param string $blog_title The new site title
+ * @param string $user_name The user's username
+ * @param string $user_email The user's email address
+ * @param array $meta Any additional meta from the 'add_signup_meta' filter in validate_blog_signup()
+ */
+function confirm_blog_signup( $domain, $path, $blog_title, $user_name = '', $user_email = '', $meta = array() ) {
        ?>
        <h2><?php printf( __( 'Congratulations! Your new site, %s, is almost ready.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2>
 
@@ -361,7 +503,7 @@ function confirm_blog_signup($domain, $path, $blog_title, $user_name = '', $user
                <ul id="noemail-tips">
                        <li><p><strong><?php _e( 'Wait a little longer. Sometimes delivery of email can be delayed by processes outside of our control.' ) ?></strong></p></li>
                        <li><p><?php _e( 'Check the junk or spam folder of your email client. Sometime emails wind up there by mistake.' ) ?></p></li>
-                       <li><?php printf( __( 'Have you entered your email correctly?  You have entered %s, if it&#8217;s incorrect, you will not receive your email.' ), $user_email ) ?></li>
+                       <li><?php printf( __( 'Have you entered your email correctly? You have entered %s, if it&#8217;s incorrect, you will not receive your email.' ), $user_email ) ?></li>
                </ul>
        </p>
        <?php
@@ -427,9 +569,9 @@ if ( $active_signup == 'none' ) {
                                $newblog = get_blogaddress_by_name( $newblogname );
 
                                if ( $active_signup == 'blog' || $active_signup == 'all' )
-                                       printf( __( '<p><em>The site you were looking for, <strong>%s</strong> does not exist, but you can create it now!</em></p>' ), $newblog );
+                                       printf( '<p><em>' . __( 'The site you were looking for, <strong>%s</strong>, does not exist, but you can create it now!' ) . '</em></p>', $newblog );
                                else
-                                       printf( __( '<p><em>The site you were looking for, <strong>%s</strong>, does not exist.</em></p>' ), $newblog );
+                                       printf( '<p><em>' . __( 'The site you were looking for, <strong>%s</strong>, does not exist.' ) . '</em></p>', $newblog );
                        }
                        break;
        }
index 06e47507be221d742765f0463ce7f3fc9cd9f945..8b41505f2bbd9b6c96fb1610f347ed7bd0c7bab8 100644 (file)
@@ -11,7 +11,7 @@ if (empty($wp)) {
 }
 
 /**
- * trackback_response() - Respond with error or success XML message
+ * trackback_response() - Respond with an error or success XML message
  *
  * @param int|bool $error Whether there was an error
  * @param string $error_message Error message if an error occurred
@@ -45,9 +45,9 @@ $tb_url  = isset($_POST['url'])     ? $_POST['url']     : '';
 $charset = isset($_POST['charset']) ? $_POST['charset'] : '';
 
 // These three are stripslashed here so that they can be properly escaped after mb_convert_encoding()
-$title     = isset($_POST['title'])     ? stripslashes($_POST['title'])      : '';
-$excerpt   = isset($_POST['excerpt'])   ? stripslashes($_POST['excerpt'])    : '';
-$blog_name = isset($_POST['blog_name']) ? stripslashes($_POST['blog_name'])  : '';
+$title     = isset($_POST['title'])     ? wp_unslash($_POST['title'])      : '';
+$excerpt   = isset($_POST['excerpt'])   ? wp_unslash($_POST['excerpt'])    : '';
+$blog_name = isset($_POST['blog_name']) ? wp_unslash($_POST['blog_name'])  : '';
 
 if ($charset)
        $charset = str_replace( array(',', ' '), '', strtoupper( trim($charset) ) );
@@ -65,9 +65,9 @@ if ( function_exists('mb_convert_encoding') ) { // For international trackbacks
 }
 
 // Now that mb_convert_encoding() has been given a swing, we need to escape these three
-$title     = $wpdb->escape($title);
-$excerpt   = $wpdb->escape($excerpt);
-$blog_name = $wpdb->escape($blog_name);
+$title     = wp_slash($title);
+$excerpt   = wp_slash($excerpt);
+$blog_name = wp_slash($blog_name);
 
 if ( is_single() || is_page() )
        $tb_id = $posts[0]->ID;
@@ -87,8 +87,8 @@ if ( !empty($tb_url) && !empty($title) ) {
        if ( !pings_open($tb_id) )
                trackback_response(1, 'Sorry, trackbacks are closed for this item.');
 
-       $title =  wp_html_excerpt( $title, 250 ).'...';
-       $excerpt = wp_html_excerpt( $excerpt, 252 ).'...';
+       $title =  wp_html_excerpt( $title, 250, '&#8230;' );
+       $excerpt = wp_html_excerpt( $excerpt, 252, '&#8230;' );
 
        $comment_post_ID = (int) $tb_id;
        $comment_author = $blog_name;
index 1998e4a8b00b834162f794e0f634f029b971cfe1..59674df7276fd7e43c292a6b5aed035a4eb0cd3f 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 /**
- * Whether this is a XMLRPC Request
+ * Whether this is an XML-RPC Request
  *
  * @var bool
  */
@@ -55,7 +55,7 @@ include_once(ABSPATH . WPINC . '/class-IXR.php');
 include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php');
 
 /**
- * Posts submitted via the xmlrpc interface get that title
+ * Posts submitted via the XML-RPC interface get that title
  * @name post_default_title
  * @var string
  */