From 340fd28d82d823c8af4580443cd217beff042d6f Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Wed, 12 Jun 2019 21:03:52 +0000 Subject: [PATCH] Accessibility: Improve focus management in the Media Views. - keeps focus management only where necessary to avoid focus losses - removes focus management where a specific user workflow was assumed - makes the "Attachment Details" navigation buttons really disabled when there are no next or previous attachments - adds inline comments to clarify all the usages of focus() Fixes #43169. Built from https://develop.svn.wordpress.org/trunk@45524 git-svn-id: http://core.svn.wordpress.org/trunk@45335 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/css/media-rtl.css | 7 +- wp-admin/css/media-rtl.min.css | 2 +- wp-admin/css/media.css | 7 +- wp-admin/css/media.min.css | 2 +- wp-includes/js/media-audiovideo.js | 4 +- wp-includes/js/media-audiovideo.min.js | 2 +- wp-includes/js/media-grid.js | 28 +++- wp-includes/js/media-grid.min.js | 2 +- wp-includes/js/media-views.js | 208 ++++++++++++++++--------- wp-includes/js/media-views.min.js | 6 +- wp-includes/media-template.php | 4 +- wp-includes/version.php | 2 +- 12 files changed, 171 insertions(+), 103 deletions(-) diff --git a/wp-admin/css/media-rtl.css b/wp-admin/css/media-rtl.css index 939d26b789..ffc0f151a7 100644 --- a/wp-admin/css/media-rtl.css +++ b/wp-admin/css/media-rtl.css @@ -682,14 +682,11 @@ border color while dragging a file over the uploader drop area */ content: "\f341"; } -.edit-attachment-frame .edit-media-header .left.disabled, -.edit-attachment-frame .edit-media-header .right.disabled, -.edit-attachment-frame .edit-media-header .left.disabled:hover, -.edit-attachment-frame .edit-media-header .right.disabled:hover { +.edit-attachment-frame .edit-media-header [disabled], +.edit-attachment-frame .edit-media-header [disabled]:hover { color: #ccc; background: inherit; cursor: default; - pointer-events: none; } .edit-attachment-frame .media-frame-content, diff --git a/wp-admin/css/media-rtl.min.css b/wp-admin/css/media-rtl.min.css index e74fe735bd..e49355fed8 100644 --- a/wp-admin/css/media-rtl.min.css +++ b/wp-admin/css/media-rtl.min.css @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -.media-item .describe{border-collapse:collapse;width:100%;border-top:1px solid #ddd;clear:both;cursor:default}.media-item.media-blank .describe{border:0}.media-item .describe th{vertical-align:top;text-align:right;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 0 8px 8px;vertical-align:top}.media-item thead.media-item-info td{padding:4px 10px 0}.media-item .media-item-info .A1B1{padding:0 10px 0 0}.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-left:6px;margin-right:2px}.media-upload-form .align .field label{display:inline;padding:0 23px 0 0;margin:0 3px 0 1em;font-weight:600}.media-upload-form tr.image-size label{margin:0 5px 0 0;font-weight:600}.media-upload-form th.label label{font-weight:600;margin:.5em;font-size:13px}.media-upload-form th.label label span{padding:0 5px}.media-item .describe input[type=text],.media-item .describe textarea{width:460px}.media-item .describe p.help{margin:0;padding:0 5px 0 0}.describe-toggle-off,.describe-toggle-on,.media-item .edit-attachment{display:block;line-height:2.76923076;float:left;margin-left:10px}.media-item .describe-toggle-off,.media-item.open .describe-toggle-on{display:none}.media-item.open .describe-toggle-off{display:block}.media-upload-form .media-item{min-height:36px;margin-bottom:1px;position:relative;width:100%;background:#fff}.media-upload-form .media-item,.media-upload-form .media-item .error{box-shadow:0 1px 0 #ddd}#media-items:empty{border:0 none}.media-item .filename{line-height:2.76923076;overflow:hidden;margin-right:6px}.media-item .pinkynail{float:right;margin:2px 3px 0 10px;max-width:40px;max-height:32px}.media-item .startclosed,.media-item .startopen{display:none}.media-item .original{position:relative;height:34px}.media-item .progress{float:left;height:22px;margin:7px 6px;width:200px;line-height:2em;padding:0;overflow:hidden;border-radius:22px;background:#ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.media-item .bar{z-index:9;width:0;height:100%;margin-top:-22px;border-radius:22px;background-color:#0073aa;box-shadow:inset 0 0 2px rgba(0,0,0,.3)}.media-item .progress .percent{z-index:10;position:relative;width:200px;padding:0;color:#fff;text-align:center;line-height:22px;font-weight:400;text-shadow:0 1px 2px rgba(0,0,0,.2)}.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,.media-upload-form .media-item.error{width:auto;margin:0 0 1px 0}.media-upload-form .media-item .error{padding:10px 14px 10px 0}.media-item .error-div button.dismiss{float:left;margin:0 15px 0 10px}.find-box{background-color:#fff;box-shadow:0 3px 6px rgba(0,0,0,.3);width:600px;overflow:hidden;margin-right:-300px;position:fixed;top:30px;bottom:30px;right:50%;z-index:100105}.find-box-head{background:#fcfcfc;border-bottom:1px solid #ddd;height:36px;font-size:18px;font-weight:600;line-height:2;padding:0 16px 0 36px;position:absolute;top:0;right:0;left:0}.find-box-inside{overflow:auto;padding:16px;background-color:#fff;position:absolute;top:37px;bottom:45px;overflow-y:scroll;width:100%;box-sizing:border-box}.find-box-search{padding-bottom:16px}.find-box-search .spinner{float:none;right:105px;position:absolute}#find-posts-response,.find-box-search{position:relative}#find-posts-input,#find-posts-search{float:right}#find-posts-input{width:140px;height:28px;margin:0 0 0 4px}.widefat .found-radio{padding-left:0;width:16px}#find-posts-close{width:36px;height:36px;border:none;padding:0;position:absolute;top:0;left:0;cursor:pointer;text-align:center;background:0 0;color:#666}#find-posts-close:focus,#find-posts-close:hover{color:#00a0d2}#find-posts-close:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:2px solid transparent;outline-offset:-2px}#find-posts-close:before{font:normal 20px/36px dashicons;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f158"}.find-box-buttons{padding:8px 16px;background:#fcfcfc;border-top:1px solid #ddd;position:absolute;bottom:0;right:0;left:0}@media screen and (max-width:782px){.find-box-inside{bottom:57px}}@media screen and (max-width:660px){.find-box{top:0;bottom:0;right:0;left:0;margin:0;width:100%}}.ui-find-overlay{position:fixed;top:0;right:0;left:0;bottom:0;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:100100}.drag-drop #drag-drop-area{border:4px dashed #b4b9be;height:200px}.drag-drop .drag-drop-inside{margin:60px auto 0;width:250px}.drag-drop-inside p{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}.media-frame.mode-grid,.media-frame.mode-grid .attachments-browser .attachments,.media-frame.mode-grid .media-frame-content,.media-frame.mode-grid .uploader-inline-content{position:static}.media-frame.mode-grid .media-frame-menu,.media-frame.mode-grid .media-frame-router,.media-frame.mode-grid .media-frame-title{display:none}.media-frame.mode-grid .media-frame-content{background-color:transparent;border:none}.upload-php .mode-grid .media-sidebar{position:relative;width:auto;margin-top:12px;padding:0 16px;border-right:4px solid #dd3d36;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);background-color:#fff}.upload-php .mode-grid .hide-sidebar .media-sidebar{display:none}.upload-php .mode-grid .media-sidebar .media-uploader-status{border-bottom:none;padding-bottom:0;max-width:100%}.upload-php .mode-grid .media-sidebar .upload-error{margin:12px 0;padding:4px 0 0;border:none;box-shadow:none;background:0 0}.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors{top:-10px;left:-14px;padding:10px}.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:before{content:"\f153";display:block;font:normal 16px/1 dashicons;color:#72777c}.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:focus:before,.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:hover:before{color:#c00}.upload-php .mode-grid .media-sidebar .media-uploader-status.errors h2{display:none}.media-frame.mode-grid .uploader-inline{position:relative;top:auto;left:auto;right:auto;bottom:auto;padding-top:0;margin-top:20px;border:4px dashed #b4b9be}.media-frame.mode-select .attachments-browser.fixed .attachments{position:relative;top:94px;padding-bottom:94px}.media-frame.mode-grid .attachment.details:focus,.media-frame.mode-grid .attachment:focus,.media-frame.mode-grid .selected.attachment:focus{box-shadow:inset 0 0 2px 3px #f1f1f1,inset 0 0 0 7px #5b9dd9;outline:2px solid transparent;outline-offset:-6px}.media-frame.mode-grid .selected.attachment{box-shadow:inset 0 0 0 5px #f1f1f1,inset 0 0 0 7px #ccc}.media-frame.mode-grid .attachment.details{box-shadow:inset 0 0 0 3px #f1f1f1,inset 0 0 0 7px #1e8cbe}.media-frame.mode-grid.mode-select .attachment .thumbnail{opacity:.65}.media-frame.mode-select .attachment.selected .thumbnail{opacity:1}.media-frame.mode-grid .media-toolbar{margin-bottom:15px;height:auto}.media-frame.mode-grid .media-toolbar select{margin:0 0 0 10px;font-size:14px}.media-frame.mode-grid.mode-edit .media-toolbar-secondary>.select-mode-toggle-button{margin:0 0 0 8px;vertical-align:middle}.media-frame.mode-grid .attachments-browser .bulk-select{display:inline-block;margin:0 0 0 10px}.media-frame.mode-grid .search{margin-top:0}.media-frame.mode-grid .spinner{margin-top:16px}.attachments-browser .media-toolbar-secondary>.media-button{margin-left:10px}.media-frame.mode-select .attachments-browser.fixed .media-toolbar{position:fixed;top:32px;right:auto;left:20px;margin-top:0}.media-frame.mode-grid .attachments-browser{padding:0}.media-frame.mode-grid .attachments-browser .attachments{padding:2px}.media-frame.mode-grid .attachments-browser .no-media{color:#666;font-size:18px;font-style:normal;margin:0;padding:100px 0 0;text-align:center}.edit-attachment-frame{display:block;height:100%;width:100%}.edit-attachment-frame .edit-media-header{overflow:hidden}.upload-php .media-modal-close .media-modal-icon:before{content:"\f335";font-size:22px}.edit-attachment-frame .edit-media-header .left,.edit-attachment-frame .edit-media-header .right,.upload-php .media-modal-close{cursor:pointer;color:#72777c;background-color:transparent;height:50px;width:50px;padding:0;position:absolute;text-align:center;border:0;border-right:1px solid #ddd;transition:color .1s ease-in-out,background .1s ease-in-out}.upload-php .media-modal-close{top:0;left:0}.edit-attachment-frame .edit-media-header .left{left:102px}.edit-attachment-frame .edit-media-header .right{left:51px}.edit-attachment-frame .media-frame-title{right:0;left:150px}.edit-attachment-frame .edit-media-header .left:before,.edit-attachment-frame .edit-media-header .right:before{font:normal 20px/50px dashicons!important;display:inline;font-weight:300}.edit-attachment-frame .edit-media-header .left:focus,.edit-attachment-frame .edit-media-header .left:hover,.edit-attachment-frame .edit-media-header .right:focus,.edit-attachment-frame .edit-media-header .right:hover,.upload-php .media-modal-close:focus,.upload-php .media-modal-close:hover{background:#ddd;border-color:#ccc;color:#000;outline:0;box-shadow:none}.edit-attachment-frame .edit-media-header .left:focus,.edit-attachment-frame .edit-media-header .right:focus,.upload-php .media-modal-close:focus{outline:2px solid transparent;outline-offset:-2px}.upload-php .media-modal-close:focus .media-modal-icon:before,.upload-php .media-modal-close:hover .media-modal-icon:before{color:#000}.edit-attachment-frame .edit-media-header .left:before{content:"\f345"}.edit-attachment-frame .edit-media-header .right:before{content:"\f341"}.edit-attachment-frame .edit-media-header .left.disabled,.edit-attachment-frame .edit-media-header .left.disabled:hover,.edit-attachment-frame .edit-media-header .right.disabled,.edit-attachment-frame .edit-media-header .right.disabled:hover{color:#ccc;background:inherit;cursor:default;pointer-events:none}.edit-attachment-frame .media-frame-content,.edit-attachment-frame .media-frame-router{right:0}.edit-attachment-frame .media-frame-content{border-bottom:none;bottom:0;top:50px}.edit-attachment-frame .attachment-details{position:absolute;overflow:auto;top:0;bottom:0;left:0;right:0;box-shadow:inset 0 4px 4px -4px rgba(0,0,0,.1)}.edit-attachment-frame .attachment-media-view{float:right;width:65%;height:100%}.edit-attachment-frame .attachment-media-view .thumbnail{box-sizing:border-box;padding:16px;height:100%}.edit-attachment-frame .attachment-media-view .details-image{display:block;margin:0 auto 16px;max-width:100%;max-height:90%;max-height:calc(100% - 42px);background-image:linear-gradient(-45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4),linear-gradient(-45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4);background-position:100% 0,10px 10px;background-size:20px 20px}.edit-attachment-frame .attachment-media-view .details-image.icon{background:0 0}.edit-attachment-frame .attachment-media-view .attachment-actions{text-align:center}.edit-attachment-frame .wp-media-wrapper{margin-bottom:12px}.edit-attachment-frame input,.edit-attachment-frame textarea{padding:6px 8px;line-height:1.14285714}.edit-attachment-frame .attachment-info{overflow:auto;box-sizing:border-box;margin-bottom:0;padding:12px 16px 0;width:35%;height:100%;box-shadow:inset 0 4px 4px -4px rgba(0,0,0,.1);border-bottom:0;border-right:1px solid #ddd;background:#f3f3f3}.edit-attachment-frame .attachment-info .details,.edit-attachment-frame .attachment-info .settings{position:relative;overflow:hidden;float:none;margin-bottom:15px;padding-bottom:15px;border-bottom:1px solid #ddd}.edit-attachment-frame .attachment-info .filename{font-weight:400;color:#666}.edit-attachment-frame .attachment-info .thumbnail{margin-bottom:12px}.attachment-info .actions{margin-bottom:16px}.attachment-info .actions a{display:inline;text-decoration:none}.wp_attachment_details .attachment-alt-text{margin-bottom:5px}.wp_attachment_details .attachment-alt-text-description{margin-top:5px}.wp_attachment_details label[for=content]{font-size:13px;line-height:1.5;margin:1em 0}.wp_attachment_details #attachment_caption{height:4em}.describe .image-editor{vertical-align:top}.imgedit-wrap{position:relative;padding-top:10px}.imgedit-settings fieldset,.imgedit-settings p{margin:8px 0}.imgedit-settings legend{margin-bottom:5px}.describe .imgedit-wrap .imgedit-settings{padding:0 5px}.wp_attachment_holder div.updated{margin-top:0}.wp_attachment_holder .imgedit-wrap>div{height:auto}.wp_attachment_holder .imgedit-wrap .imgedit-panel-content{padding:3px 0 0 16px;float:right}.wp_attachment_holder .imgedit-wrap .imgedit-settings{float:left;width:250px}.imgedit-settings input{margin-top:0;vertical-align:middle}.imgedit-wait{position:absolute;top:0;bottom:0;width:100%;background:#fff;opacity:.7;filter:alpha(opacity=70);display:none}.imgedit-wait:before{content:"";display:block;width:20px;height:20px;position:absolute;right:50%;top:50%;margin:-10px -10px 0 0;background:transparent url(../images/spinner.gif) no-repeat center;background-size:20px 20px;transform:translateZ(0)}.no-float{float:none}.imgedit-settings .disabled,.media-disabled{color:#a0a5aa}.A1B1{overflow:hidden}.A1B1 .button,.wp_attachment_image .button{float:right}.no-js .wp_attachment_image .button{display:none}.A1B1 .spinner,.wp_attachment_image .spinner{float:right}.imgedit-menu{min-width:300px;margin:0 0 12px}.imgedit-menu .note-no-rotate{clear:both;margin:0;padding:1em 0 0}.image-editor .imgedit-menu .button{float:right;width:32px;height:32px;margin:0 0 0 8px;padding:0;background:#f1f1f1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:1.23076923;color:#72777c}.imgedit-menu .button:before{font:normal 20px/1 dashicons;speak:none;vertical-align:middle}.imgedit-menu .button.disabled{border-color:#ccc;background-color:#ddd;color:#72777c;filter:alpha(opacity=50);opacity:.5;cursor:default}.imgedit-crop:before{content:"\f165"}.imgedit-rleft:before{content:"\f166"}.imgedit-rright:before{content:"\f167"}.imgedit-flipv:before{content:"\f168"}.imgedit-fliph:before{content:"\f169"}.imgedit-undo:before{content:"\f171"}.imgedit-redo:before{content:"\f172"}.imgedit-crop-wrap{position:relative}.imgedit-crop-wrap img{background-image:linear-gradient(-45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4),linear-gradient(-45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4);background-position:100% 0,10px 10px;background-size:20px 20px}.imgedit-crop{margin:0 0 0 8px}.imgedit-rleft{margin:0 3px}.imgedit-rright{margin:0 3px 0 8px}.imgedit-flipv{margin:0 3px}.imgedit-fliph{margin:0 3px 0 8px}.imgedit-undo{margin:0 3px}.imgedit-redo{margin:0 3px 0 8px}.imgedit-thumbnail-preview{margin:10px 0 0 8px}.imgedit-thumbnail-preview-caption{display:block}#poststuff .imgedit-group-top h2{display:inline-block;margin:0;padding:0;font-size:14px;line-height:1.4}#poststuff .imgedit-group-top .button-link{text-decoration:none;color:#23282d}.imgedit-applyto .imgedit-label{display:block;padding:.5em 0 0}.imgedit-help{display:none;font-style:italic}.image-editor .imgedit-settings .imgedit-help-toggle,.image-editor .imgedit-settings .imgedit-help-toggle:active,.image-editor .imgedit-settings .imgedit-help-toggle:hover{border:1px solid transparent;margin:-1px -1px 0 0;padding:0;background:0 0;color:#0074a2;font-size:20px;line-height:1;cursor:pointer;box-sizing:content-box;box-shadow:none}.image-editor .imgedit-settings .imgedit-help-toggle:focus{color:#0074a2;border-color:#5b9dd9;box-shadow:0 0 3px rgba(0,115,170,.8);outline:2px solid transparent}.form-table td.imgedit-response{padding:0}.imgedit-submit{margin:8px 0 0}.imgedit-submit-btn{margin-right:20px}.imgedit-wrap .nowrap{white-space:nowrap;font-size:12px;line-height:inherit}span.imgedit-scale-warn{color:#dc3232;font-size:20px;font-style:normal;visibility:hidden;vertical-align:middle}.imgedit-save-target{margin:8px 0}.imgedit-save-target legend{font-weight:600}.imgedit-group{margin-bottom:8px;padding:10px}.imgedit-settings .imgedit-crop-ratio input[type=text],.imgedit-settings .imgedit-crop-sel input[type=text],.imgedit-settings .imgedit-scale input[type=text]{width:50px;font-size:14px;padding:5px 8px}.imgedit-separator{display:inline-block;width:7px;text-align:center;font-size:13px;color:#444}.imgedit-settings .imgedit-scale .button{margin-bottom:0}audio,video{display:inline-block;max-width:100%}.mejs-container{width:100%;max-width:100%}.mejs-container .mejs-controls{box-sizing:border-box}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.imgedit-wait:before{background-image:url(../images/spinner-2x.gif)}}@media screen and (max-width:782px){.wp_attachment_details label[for=content]{font-size:14px;line-height:1.5}.media-upload-form .media-item .error,.media-upload-form .media-item.error{font-size:13px;line-height:1.5}.media-upload-form .media-item.error{padding:1px 10px}.media-upload-form .media-item .error{padding:10px 12px 10px 0}.imgedit-settings .imgedit-crop-ratio input[type=text],.imgedit-settings .imgedit-crop-sel input[type=text],.imgedit-settings .imgedit-scale input[type=text]{width:60px;font-size:16px;padding:6px 10px}}@media only screen and (max-width:1120px){#wp-media-grid .wp-filter .attachment-filters{max-width:100%}}@media only screen and (max-width:782px){.media-frame.mode-select .attachments-browser.fixed .media-toolbar{top:46px;left:10px}}@media only screen and (max-width:600px){.media-frame.mode-select .attachments-browser.fixed .media-toolbar{top:0}}@media only screen and (max-width:480px){.edit-attachment-frame .media-frame-title{left:110px}.edit-attachment-frame .edit-media-header .left,.edit-attachment-frame .edit-media-header .right,.upload-php .media-modal-close{width:40px;height:40px}.edit-attachment-frame .edit-media-header .left:before,.edit-attachment-frame .edit-media-header .right:before{line-height:40px!important}.edit-attachment-frame .edit-media-header .left{left:82px}.edit-attachment-frame .edit-media-header .right{left:41px}.edit-attachment-frame .media-frame-content{top:40px}.edit-attachment-frame .attachment-media-view{float:none;height:auto;width:100%}.edit-attachment-frame .attachment-info{height:auto;width:100%}}@media only screen and (max-width:640px),screen and (max-height:400px){.upload-php .mode-grid .media-sidebar{max-width:100%}} \ No newline at end of file +.media-item .describe{border-collapse:collapse;width:100%;border-top:1px solid #ddd;clear:both;cursor:default}.media-item.media-blank .describe{border:0}.media-item .describe th{vertical-align:top;text-align:right;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 0 8px 8px;vertical-align:top}.media-item thead.media-item-info td{padding:4px 10px 0}.media-item .media-item-info .A1B1{padding:0 10px 0 0}.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-left:6px;margin-right:2px}.media-upload-form .align .field label{display:inline;padding:0 23px 0 0;margin:0 3px 0 1em;font-weight:600}.media-upload-form tr.image-size label{margin:0 5px 0 0;font-weight:600}.media-upload-form th.label label{font-weight:600;margin:.5em;font-size:13px}.media-upload-form th.label label span{padding:0 5px}.media-item .describe input[type=text],.media-item .describe textarea{width:460px}.media-item .describe p.help{margin:0;padding:0 5px 0 0}.describe-toggle-off,.describe-toggle-on,.media-item .edit-attachment{display:block;line-height:2.76923076;float:left;margin-left:10px}.media-item .describe-toggle-off,.media-item.open .describe-toggle-on{display:none}.media-item.open .describe-toggle-off{display:block}.media-upload-form .media-item{min-height:36px;margin-bottom:1px;position:relative;width:100%;background:#fff}.media-upload-form .media-item,.media-upload-form .media-item .error{box-shadow:0 1px 0 #ddd}#media-items:empty{border:0 none}.media-item .filename{line-height:2.76923076;overflow:hidden;margin-right:6px}.media-item .pinkynail{float:right;margin:2px 3px 0 10px;max-width:40px;max-height:32px}.media-item .startclosed,.media-item .startopen{display:none}.media-item .original{position:relative;height:34px}.media-item .progress{float:left;height:22px;margin:7px 6px;width:200px;line-height:2em;padding:0;overflow:hidden;border-radius:22px;background:#ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.media-item .bar{z-index:9;width:0;height:100%;margin-top:-22px;border-radius:22px;background-color:#0073aa;box-shadow:inset 0 0 2px rgba(0,0,0,.3)}.media-item .progress .percent{z-index:10;position:relative;width:200px;padding:0;color:#fff;text-align:center;line-height:22px;font-weight:400;text-shadow:0 1px 2px rgba(0,0,0,.2)}.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,.media-upload-form .media-item.error{width:auto;margin:0 0 1px 0}.media-upload-form .media-item .error{padding:10px 14px 10px 0}.media-item .error-div button.dismiss{float:left;margin:0 15px 0 10px}.find-box{background-color:#fff;box-shadow:0 3px 6px rgba(0,0,0,.3);width:600px;overflow:hidden;margin-right:-300px;position:fixed;top:30px;bottom:30px;right:50%;z-index:100105}.find-box-head{background:#fcfcfc;border-bottom:1px solid #ddd;height:36px;font-size:18px;font-weight:600;line-height:2;padding:0 16px 0 36px;position:absolute;top:0;right:0;left:0}.find-box-inside{overflow:auto;padding:16px;background-color:#fff;position:absolute;top:37px;bottom:45px;overflow-y:scroll;width:100%;box-sizing:border-box}.find-box-search{padding-bottom:16px}.find-box-search .spinner{float:none;right:105px;position:absolute}#find-posts-response,.find-box-search{position:relative}#find-posts-input,#find-posts-search{float:right}#find-posts-input{width:140px;height:28px;margin:0 0 0 4px}.widefat .found-radio{padding-left:0;width:16px}#find-posts-close{width:36px;height:36px;border:none;padding:0;position:absolute;top:0;left:0;cursor:pointer;text-align:center;background:0 0;color:#666}#find-posts-close:focus,#find-posts-close:hover{color:#00a0d2}#find-posts-close:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:2px solid transparent;outline-offset:-2px}#find-posts-close:before{font:normal 20px/36px dashicons;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f158"}.find-box-buttons{padding:8px 16px;background:#fcfcfc;border-top:1px solid #ddd;position:absolute;bottom:0;right:0;left:0}@media screen and (max-width:782px){.find-box-inside{bottom:57px}}@media screen and (max-width:660px){.find-box{top:0;bottom:0;right:0;left:0;margin:0;width:100%}}.ui-find-overlay{position:fixed;top:0;right:0;left:0;bottom:0;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:100100}.drag-drop #drag-drop-area{border:4px dashed #b4b9be;height:200px}.drag-drop .drag-drop-inside{margin:60px auto 0;width:250px}.drag-drop-inside p{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}.media-frame.mode-grid,.media-frame.mode-grid .attachments-browser .attachments,.media-frame.mode-grid .media-frame-content,.media-frame.mode-grid .uploader-inline-content{position:static}.media-frame.mode-grid .media-frame-menu,.media-frame.mode-grid .media-frame-router,.media-frame.mode-grid .media-frame-title{display:none}.media-frame.mode-grid .media-frame-content{background-color:transparent;border:none}.upload-php .mode-grid .media-sidebar{position:relative;width:auto;margin-top:12px;padding:0 16px;border-right:4px solid #dd3d36;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);background-color:#fff}.upload-php .mode-grid .hide-sidebar .media-sidebar{display:none}.upload-php .mode-grid .media-sidebar .media-uploader-status{border-bottom:none;padding-bottom:0;max-width:100%}.upload-php .mode-grid .media-sidebar .upload-error{margin:12px 0;padding:4px 0 0;border:none;box-shadow:none;background:0 0}.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors{top:-10px;left:-14px;padding:10px}.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:before{content:"\f153";display:block;font:normal 16px/1 dashicons;color:#72777c}.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:focus:before,.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:hover:before{color:#c00}.upload-php .mode-grid .media-sidebar .media-uploader-status.errors h2{display:none}.media-frame.mode-grid .uploader-inline{position:relative;top:auto;left:auto;right:auto;bottom:auto;padding-top:0;margin-top:20px;border:4px dashed #b4b9be}.media-frame.mode-select .attachments-browser.fixed .attachments{position:relative;top:94px;padding-bottom:94px}.media-frame.mode-grid .attachment.details:focus,.media-frame.mode-grid .attachment:focus,.media-frame.mode-grid .selected.attachment:focus{box-shadow:inset 0 0 2px 3px #f1f1f1,inset 0 0 0 7px #5b9dd9;outline:2px solid transparent;outline-offset:-6px}.media-frame.mode-grid .selected.attachment{box-shadow:inset 0 0 0 5px #f1f1f1,inset 0 0 0 7px #ccc}.media-frame.mode-grid .attachment.details{box-shadow:inset 0 0 0 3px #f1f1f1,inset 0 0 0 7px #1e8cbe}.media-frame.mode-grid.mode-select .attachment .thumbnail{opacity:.65}.media-frame.mode-select .attachment.selected .thumbnail{opacity:1}.media-frame.mode-grid .media-toolbar{margin-bottom:15px;height:auto}.media-frame.mode-grid .media-toolbar select{margin:0 0 0 10px;font-size:14px}.media-frame.mode-grid.mode-edit .media-toolbar-secondary>.select-mode-toggle-button{margin:0 0 0 8px;vertical-align:middle}.media-frame.mode-grid .attachments-browser .bulk-select{display:inline-block;margin:0 0 0 10px}.media-frame.mode-grid .search{margin-top:0}.media-frame.mode-grid .spinner{margin-top:16px}.attachments-browser .media-toolbar-secondary>.media-button{margin-left:10px}.media-frame.mode-select .attachments-browser.fixed .media-toolbar{position:fixed;top:32px;right:auto;left:20px;margin-top:0}.media-frame.mode-grid .attachments-browser{padding:0}.media-frame.mode-grid .attachments-browser .attachments{padding:2px}.media-frame.mode-grid .attachments-browser .no-media{color:#666;font-size:18px;font-style:normal;margin:0;padding:100px 0 0;text-align:center}.edit-attachment-frame{display:block;height:100%;width:100%}.edit-attachment-frame .edit-media-header{overflow:hidden}.upload-php .media-modal-close .media-modal-icon:before{content:"\f335";font-size:22px}.edit-attachment-frame .edit-media-header .left,.edit-attachment-frame .edit-media-header .right,.upload-php .media-modal-close{cursor:pointer;color:#72777c;background-color:transparent;height:50px;width:50px;padding:0;position:absolute;text-align:center;border:0;border-right:1px solid #ddd;transition:color .1s ease-in-out,background .1s ease-in-out}.upload-php .media-modal-close{top:0;left:0}.edit-attachment-frame .edit-media-header .left{left:102px}.edit-attachment-frame .edit-media-header .right{left:51px}.edit-attachment-frame .media-frame-title{right:0;left:150px}.edit-attachment-frame .edit-media-header .left:before,.edit-attachment-frame .edit-media-header .right:before{font:normal 20px/50px dashicons!important;display:inline;font-weight:300}.edit-attachment-frame .edit-media-header .left:focus,.edit-attachment-frame .edit-media-header .left:hover,.edit-attachment-frame .edit-media-header .right:focus,.edit-attachment-frame .edit-media-header .right:hover,.upload-php .media-modal-close:focus,.upload-php .media-modal-close:hover{background:#ddd;border-color:#ccc;color:#000;outline:0;box-shadow:none}.edit-attachment-frame .edit-media-header .left:focus,.edit-attachment-frame .edit-media-header .right:focus,.upload-php .media-modal-close:focus{outline:2px solid transparent;outline-offset:-2px}.upload-php .media-modal-close:focus .media-modal-icon:before,.upload-php .media-modal-close:hover .media-modal-icon:before{color:#000}.edit-attachment-frame .edit-media-header .left:before{content:"\f345"}.edit-attachment-frame .edit-media-header .right:before{content:"\f341"}.edit-attachment-frame .edit-media-header [disabled],.edit-attachment-frame .edit-media-header [disabled]:hover{color:#ccc;background:inherit;cursor:default}.edit-attachment-frame .media-frame-content,.edit-attachment-frame .media-frame-router{right:0}.edit-attachment-frame .media-frame-content{border-bottom:none;bottom:0;top:50px}.edit-attachment-frame .attachment-details{position:absolute;overflow:auto;top:0;bottom:0;left:0;right:0;box-shadow:inset 0 4px 4px -4px rgba(0,0,0,.1)}.edit-attachment-frame .attachment-media-view{float:right;width:65%;height:100%}.edit-attachment-frame .attachment-media-view .thumbnail{box-sizing:border-box;padding:16px;height:100%}.edit-attachment-frame .attachment-media-view .details-image{display:block;margin:0 auto 16px;max-width:100%;max-height:90%;max-height:calc(100% - 42px);background-image:linear-gradient(-45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4),linear-gradient(-45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4);background-position:100% 0,10px 10px;background-size:20px 20px}.edit-attachment-frame .attachment-media-view .details-image.icon{background:0 0}.edit-attachment-frame .attachment-media-view .attachment-actions{text-align:center}.edit-attachment-frame .wp-media-wrapper{margin-bottom:12px}.edit-attachment-frame input,.edit-attachment-frame textarea{padding:6px 8px;line-height:1.14285714}.edit-attachment-frame .attachment-info{overflow:auto;box-sizing:border-box;margin-bottom:0;padding:12px 16px 0;width:35%;height:100%;box-shadow:inset 0 4px 4px -4px rgba(0,0,0,.1);border-bottom:0;border-right:1px solid #ddd;background:#f3f3f3}.edit-attachment-frame .attachment-info .details,.edit-attachment-frame .attachment-info .settings{position:relative;overflow:hidden;float:none;margin-bottom:15px;padding-bottom:15px;border-bottom:1px solid #ddd}.edit-attachment-frame .attachment-info .filename{font-weight:400;color:#666}.edit-attachment-frame .attachment-info .thumbnail{margin-bottom:12px}.attachment-info .actions{margin-bottom:16px}.attachment-info .actions a{display:inline;text-decoration:none}.wp_attachment_details .attachment-alt-text{margin-bottom:5px}.wp_attachment_details .attachment-alt-text-description{margin-top:5px}.wp_attachment_details label[for=content]{font-size:13px;line-height:1.5;margin:1em 0}.wp_attachment_details #attachment_caption{height:4em}.describe .image-editor{vertical-align:top}.imgedit-wrap{position:relative;padding-top:10px}.imgedit-settings fieldset,.imgedit-settings p{margin:8px 0}.imgedit-settings legend{margin-bottom:5px}.describe .imgedit-wrap .imgedit-settings{padding:0 5px}.wp_attachment_holder div.updated{margin-top:0}.wp_attachment_holder .imgedit-wrap>div{height:auto}.wp_attachment_holder .imgedit-wrap .imgedit-panel-content{padding:3px 0 0 16px;float:right}.wp_attachment_holder .imgedit-wrap .imgedit-settings{float:left;width:250px}.imgedit-settings input{margin-top:0;vertical-align:middle}.imgedit-wait{position:absolute;top:0;bottom:0;width:100%;background:#fff;opacity:.7;filter:alpha(opacity=70);display:none}.imgedit-wait:before{content:"";display:block;width:20px;height:20px;position:absolute;right:50%;top:50%;margin:-10px -10px 0 0;background:transparent url(../images/spinner.gif) no-repeat center;background-size:20px 20px;transform:translateZ(0)}.no-float{float:none}.imgedit-settings .disabled,.media-disabled{color:#a0a5aa}.A1B1{overflow:hidden}.A1B1 .button,.wp_attachment_image .button{float:right}.no-js .wp_attachment_image .button{display:none}.A1B1 .spinner,.wp_attachment_image .spinner{float:right}.imgedit-menu{min-width:300px;margin:0 0 12px}.imgedit-menu .note-no-rotate{clear:both;margin:0;padding:1em 0 0}.image-editor .imgedit-menu .button{float:right;width:32px;height:32px;margin:0 0 0 8px;padding:0;background:#f1f1f1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:1.23076923;color:#72777c}.imgedit-menu .button:before{font:normal 20px/1 dashicons;speak:none;vertical-align:middle}.imgedit-menu .button.disabled{border-color:#ccc;background-color:#ddd;color:#72777c;filter:alpha(opacity=50);opacity:.5;cursor:default}.imgedit-crop:before{content:"\f165"}.imgedit-rleft:before{content:"\f166"}.imgedit-rright:before{content:"\f167"}.imgedit-flipv:before{content:"\f168"}.imgedit-fliph:before{content:"\f169"}.imgedit-undo:before{content:"\f171"}.imgedit-redo:before{content:"\f172"}.imgedit-crop-wrap{position:relative}.imgedit-crop-wrap img{background-image:linear-gradient(-45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4),linear-gradient(-45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4);background-position:100% 0,10px 10px;background-size:20px 20px}.imgedit-crop{margin:0 0 0 8px}.imgedit-rleft{margin:0 3px}.imgedit-rright{margin:0 3px 0 8px}.imgedit-flipv{margin:0 3px}.imgedit-fliph{margin:0 3px 0 8px}.imgedit-undo{margin:0 3px}.imgedit-redo{margin:0 3px 0 8px}.imgedit-thumbnail-preview{margin:10px 0 0 8px}.imgedit-thumbnail-preview-caption{display:block}#poststuff .imgedit-group-top h2{display:inline-block;margin:0;padding:0;font-size:14px;line-height:1.4}#poststuff .imgedit-group-top .button-link{text-decoration:none;color:#23282d}.imgedit-applyto .imgedit-label{display:block;padding:.5em 0 0}.imgedit-help{display:none;font-style:italic}.image-editor .imgedit-settings .imgedit-help-toggle,.image-editor .imgedit-settings .imgedit-help-toggle:active,.image-editor .imgedit-settings .imgedit-help-toggle:hover{border:1px solid transparent;margin:-1px -1px 0 0;padding:0;background:0 0;color:#0074a2;font-size:20px;line-height:1;cursor:pointer;box-sizing:content-box;box-shadow:none}.image-editor .imgedit-settings .imgedit-help-toggle:focus{color:#0074a2;border-color:#5b9dd9;box-shadow:0 0 3px rgba(0,115,170,.8);outline:2px solid transparent}.form-table td.imgedit-response{padding:0}.imgedit-submit{margin:8px 0 0}.imgedit-submit-btn{margin-right:20px}.imgedit-wrap .nowrap{white-space:nowrap;font-size:12px;line-height:inherit}span.imgedit-scale-warn{color:#dc3232;font-size:20px;font-style:normal;visibility:hidden;vertical-align:middle}.imgedit-save-target{margin:8px 0}.imgedit-save-target legend{font-weight:600}.imgedit-group{margin-bottom:8px;padding:10px}.imgedit-settings .imgedit-crop-ratio input[type=text],.imgedit-settings .imgedit-crop-sel input[type=text],.imgedit-settings .imgedit-scale input[type=text]{width:50px;font-size:14px;padding:5px 8px}.imgedit-separator{display:inline-block;width:7px;text-align:center;font-size:13px;color:#444}.imgedit-settings .imgedit-scale .button{margin-bottom:0}audio,video{display:inline-block;max-width:100%}.mejs-container{width:100%;max-width:100%}.mejs-container .mejs-controls{box-sizing:border-box}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.imgedit-wait:before{background-image:url(../images/spinner-2x.gif)}}@media screen and (max-width:782px){.wp_attachment_details label[for=content]{font-size:14px;line-height:1.5}.media-upload-form .media-item .error,.media-upload-form .media-item.error{font-size:13px;line-height:1.5}.media-upload-form .media-item.error{padding:1px 10px}.media-upload-form .media-item .error{padding:10px 12px 10px 0}.imgedit-settings .imgedit-crop-ratio input[type=text],.imgedit-settings .imgedit-crop-sel input[type=text],.imgedit-settings .imgedit-scale input[type=text]{width:60px;font-size:16px;padding:6px 10px}}@media only screen and (max-width:1120px){#wp-media-grid .wp-filter .attachment-filters{max-width:100%}}@media only screen and (max-width:782px){.media-frame.mode-select .attachments-browser.fixed .media-toolbar{top:46px;left:10px}}@media only screen and (max-width:600px){.media-frame.mode-select .attachments-browser.fixed .media-toolbar{top:0}}@media only screen and (max-width:480px){.edit-attachment-frame .media-frame-title{left:110px}.edit-attachment-frame .edit-media-header .left,.edit-attachment-frame .edit-media-header .right,.upload-php .media-modal-close{width:40px;height:40px}.edit-attachment-frame .edit-media-header .left:before,.edit-attachment-frame .edit-media-header .right:before{line-height:40px!important}.edit-attachment-frame .edit-media-header .left{left:82px}.edit-attachment-frame .edit-media-header .right{left:41px}.edit-attachment-frame .media-frame-content{top:40px}.edit-attachment-frame .attachment-media-view{float:none;height:auto;width:100%}.edit-attachment-frame .attachment-info{height:auto;width:100%}}@media only screen and (max-width:640px),screen and (max-height:400px){.upload-php .mode-grid .media-sidebar{max-width:100%}} \ No newline at end of file diff --git a/wp-admin/css/media.css b/wp-admin/css/media.css index 23796aacc2..5c7242224d 100644 --- a/wp-admin/css/media.css +++ b/wp-admin/css/media.css @@ -682,14 +682,11 @@ border color while dragging a file over the uploader drop area */ content: "\f345"; } -.edit-attachment-frame .edit-media-header .left.disabled, -.edit-attachment-frame .edit-media-header .right.disabled, -.edit-attachment-frame .edit-media-header .left.disabled:hover, -.edit-attachment-frame .edit-media-header .right.disabled:hover { +.edit-attachment-frame .edit-media-header [disabled], +.edit-attachment-frame .edit-media-header [disabled]:hover { color: #ccc; background: inherit; cursor: default; - pointer-events: none; } .edit-attachment-frame .media-frame-content, diff --git a/wp-admin/css/media.min.css b/wp-admin/css/media.min.css index 54feeafaee..f79d1c3958 100644 --- a/wp-admin/css/media.min.css +++ b/wp-admin/css/media.min.css @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -.media-item .describe{border-collapse:collapse;width:100%;border-top:1px solid #ddd;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:600}.media-upload-form tr.image-size label{margin:0 0 0 5px;font-weight:600}.media-upload-form th.label label{font-weight:600;margin:.5em;font-size:13px}.media-upload-form th.label label span{padding:0 5px}.media-item .describe input[type=text],.media-item .describe textarea{width:460px}.media-item .describe p.help{margin:0;padding:0 0 0 5px}.describe-toggle-off,.describe-toggle-on,.media-item .edit-attachment{display:block;line-height:2.76923076;float:right;margin-right:10px}.media-item .describe-toggle-off,.media-item.open .describe-toggle-on{display:none}.media-item.open .describe-toggle-off{display:block}.media-upload-form .media-item{min-height:36px;margin-bottom:1px;position:relative;width:100%;background:#fff}.media-upload-form .media-item,.media-upload-form .media-item .error{box-shadow:0 1px 0 #ddd}#media-items:empty{border:0 none}.media-item .filename{line-height:2.76923076;overflow:hidden;margin-left:6px}.media-item .pinkynail{float:left;margin:2px 10px 0 3px;max-width:40px;max-height:32px}.media-item .startclosed,.media-item .startopen{display:none}.media-item .original{position:relative;height:34px}.media-item .progress{float:right;height:22px;margin:7px 6px;width:200px;line-height:2em;padding:0;overflow:hidden;border-radius:22px;background:#ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.media-item .bar{z-index:9;width:0;height:100%;margin-top:-22px;border-radius:22px;background-color:#0073aa;box-shadow:inset 0 0 2px rgba(0,0,0,.3)}.media-item .progress .percent{z-index:10;position:relative;width:200px;padding:0;color:#fff;text-align:center;line-height:22px;font-weight:400;text-shadow:0 1px 2px rgba(0,0,0,.2)}.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,.media-upload-form .media-item.error{width:auto;margin:0 0 1px 0}.media-upload-form .media-item .error{padding:10px 0 10px 14px}.media-item .error-div button.dismiss{float:right;margin:0 10px 0 15px}.find-box{background-color:#fff;box-shadow:0 3px 6px rgba(0,0,0,.3);width:600px;overflow:hidden;margin-left:-300px;position:fixed;top:30px;bottom:30px;left:50%;z-index:100105}.find-box-head{background:#fcfcfc;border-bottom:1px solid #ddd;height:36px;font-size:18px;font-weight:600;line-height:2;padding:0 36px 0 16px;position:absolute;top:0;left:0;right:0}.find-box-inside{overflow:auto;padding:16px;background-color:#fff;position:absolute;top:37px;bottom:45px;overflow-y:scroll;width:100%;box-sizing:border-box}.find-box-search{padding-bottom:16px}.find-box-search .spinner{float:none;left:105px;position:absolute}#find-posts-response,.find-box-search{position:relative}#find-posts-input,#find-posts-search{float:left}#find-posts-input{width:140px;height:28px;margin:0 4px 0 0}.widefat .found-radio{padding-right:0;width:16px}#find-posts-close{width:36px;height:36px;border:none;padding:0;position:absolute;top:0;right:0;cursor:pointer;text-align:center;background:0 0;color:#666}#find-posts-close:focus,#find-posts-close:hover{color:#00a0d2}#find-posts-close:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:2px solid transparent;outline-offset:-2px}#find-posts-close:before{font:normal 20px/36px dashicons;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f158"}.find-box-buttons{padding:8px 16px;background:#fcfcfc;border-top:1px solid #ddd;position:absolute;bottom:0;left:0;right:0}@media screen and (max-width:782px){.find-box-inside{bottom:57px}}@media screen and (max-width:660px){.find-box{top:0;bottom:0;left:0;right:0;margin:0;width:100%}}.ui-find-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:100100}.drag-drop #drag-drop-area{border:4px dashed #b4b9be;height:200px}.drag-drop .drag-drop-inside{margin:60px auto 0;width:250px}.drag-drop-inside p{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}.media-frame.mode-grid,.media-frame.mode-grid .attachments-browser .attachments,.media-frame.mode-grid .media-frame-content,.media-frame.mode-grid .uploader-inline-content{position:static}.media-frame.mode-grid .media-frame-menu,.media-frame.mode-grid .media-frame-router,.media-frame.mode-grid .media-frame-title{display:none}.media-frame.mode-grid .media-frame-content{background-color:transparent;border:none}.upload-php .mode-grid .media-sidebar{position:relative;width:auto;margin-top:12px;padding:0 16px;border-left:4px solid #dd3d36;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);background-color:#fff}.upload-php .mode-grid .hide-sidebar .media-sidebar{display:none}.upload-php .mode-grid .media-sidebar .media-uploader-status{border-bottom:none;padding-bottom:0;max-width:100%}.upload-php .mode-grid .media-sidebar .upload-error{margin:12px 0;padding:4px 0 0;border:none;box-shadow:none;background:0 0}.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors{top:-10px;right:-14px;padding:10px}.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:before{content:"\f153";display:block;font:normal 16px/1 dashicons;color:#72777c}.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:focus:before,.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:hover:before{color:#c00}.upload-php .mode-grid .media-sidebar .media-uploader-status.errors h2{display:none}.media-frame.mode-grid .uploader-inline{position:relative;top:auto;right:auto;left:auto;bottom:auto;padding-top:0;margin-top:20px;border:4px dashed #b4b9be}.media-frame.mode-select .attachments-browser.fixed .attachments{position:relative;top:94px;padding-bottom:94px}.media-frame.mode-grid .attachment.details:focus,.media-frame.mode-grid .attachment:focus,.media-frame.mode-grid .selected.attachment:focus{box-shadow:inset 0 0 2px 3px #f1f1f1,inset 0 0 0 7px #5b9dd9;outline:2px solid transparent;outline-offset:-6px}.media-frame.mode-grid .selected.attachment{box-shadow:inset 0 0 0 5px #f1f1f1,inset 0 0 0 7px #ccc}.media-frame.mode-grid .attachment.details{box-shadow:inset 0 0 0 3px #f1f1f1,inset 0 0 0 7px #1e8cbe}.media-frame.mode-grid.mode-select .attachment .thumbnail{opacity:.65}.media-frame.mode-select .attachment.selected .thumbnail{opacity:1}.media-frame.mode-grid .media-toolbar{margin-bottom:15px;height:auto}.media-frame.mode-grid .media-toolbar select{margin:0 10px 0 0;font-size:14px}.media-frame.mode-grid.mode-edit .media-toolbar-secondary>.select-mode-toggle-button{margin:0 8px 0 0;vertical-align:middle}.media-frame.mode-grid .attachments-browser .bulk-select{display:inline-block;margin:0 10px 0 0}.media-frame.mode-grid .search{margin-top:0}.media-frame.mode-grid .spinner{margin-top:16px}.attachments-browser .media-toolbar-secondary>.media-button{margin-right:10px}.media-frame.mode-select .attachments-browser.fixed .media-toolbar{position:fixed;top:32px;left:auto;right:20px;margin-top:0}.media-frame.mode-grid .attachments-browser{padding:0}.media-frame.mode-grid .attachments-browser .attachments{padding:2px}.media-frame.mode-grid .attachments-browser .no-media{color:#666;font-size:18px;font-style:normal;margin:0;padding:100px 0 0;text-align:center}.edit-attachment-frame{display:block;height:100%;width:100%}.edit-attachment-frame .edit-media-header{overflow:hidden}.upload-php .media-modal-close .media-modal-icon:before{content:"\f335";font-size:22px}.edit-attachment-frame .edit-media-header .left,.edit-attachment-frame .edit-media-header .right,.upload-php .media-modal-close{cursor:pointer;color:#72777c;background-color:transparent;height:50px;width:50px;padding:0;position:absolute;text-align:center;border:0;border-left:1px solid #ddd;transition:color .1s ease-in-out,background .1s ease-in-out}.upload-php .media-modal-close{top:0;right:0}.edit-attachment-frame .edit-media-header .left{right:102px}.edit-attachment-frame .edit-media-header .right{right:51px}.edit-attachment-frame .media-frame-title{left:0;right:150px}.edit-attachment-frame .edit-media-header .left:before,.edit-attachment-frame .edit-media-header .right:before{font:normal 20px/50px dashicons!important;display:inline;font-weight:300}.edit-attachment-frame .edit-media-header .left:focus,.edit-attachment-frame .edit-media-header .left:hover,.edit-attachment-frame .edit-media-header .right:focus,.edit-attachment-frame .edit-media-header .right:hover,.upload-php .media-modal-close:focus,.upload-php .media-modal-close:hover{background:#ddd;border-color:#ccc;color:#000;outline:0;box-shadow:none}.edit-attachment-frame .edit-media-header .left:focus,.edit-attachment-frame .edit-media-header .right:focus,.upload-php .media-modal-close:focus{outline:2px solid transparent;outline-offset:-2px}.upload-php .media-modal-close:focus .media-modal-icon:before,.upload-php .media-modal-close:hover .media-modal-icon:before{color:#000}.edit-attachment-frame .edit-media-header .left:before{content:"\f341"}.edit-attachment-frame .edit-media-header .right:before{content:"\f345"}.edit-attachment-frame .edit-media-header .left.disabled,.edit-attachment-frame .edit-media-header .left.disabled:hover,.edit-attachment-frame .edit-media-header .right.disabled,.edit-attachment-frame .edit-media-header .right.disabled:hover{color:#ccc;background:inherit;cursor:default;pointer-events:none}.edit-attachment-frame .media-frame-content,.edit-attachment-frame .media-frame-router{left:0}.edit-attachment-frame .media-frame-content{border-bottom:none;bottom:0;top:50px}.edit-attachment-frame .attachment-details{position:absolute;overflow:auto;top:0;bottom:0;right:0;left:0;box-shadow:inset 0 4px 4px -4px rgba(0,0,0,.1)}.edit-attachment-frame .attachment-media-view{float:left;width:65%;height:100%}.edit-attachment-frame .attachment-media-view .thumbnail{box-sizing:border-box;padding:16px;height:100%}.edit-attachment-frame .attachment-media-view .details-image{display:block;margin:0 auto 16px;max-width:100%;max-height:90%;max-height:calc(100% - 42px);background-image:linear-gradient(45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4),linear-gradient(45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4);background-position:0 0,10px 10px;background-size:20px 20px}.edit-attachment-frame .attachment-media-view .details-image.icon{background:0 0}.edit-attachment-frame .attachment-media-view .attachment-actions{text-align:center}.edit-attachment-frame .wp-media-wrapper{margin-bottom:12px}.edit-attachment-frame input,.edit-attachment-frame textarea{padding:6px 8px;line-height:1.14285714}.edit-attachment-frame .attachment-info{overflow:auto;box-sizing:border-box;margin-bottom:0;padding:12px 16px 0;width:35%;height:100%;box-shadow:inset 0 4px 4px -4px rgba(0,0,0,.1);border-bottom:0;border-left:1px solid #ddd;background:#f3f3f3}.edit-attachment-frame .attachment-info .details,.edit-attachment-frame .attachment-info .settings{position:relative;overflow:hidden;float:none;margin-bottom:15px;padding-bottom:15px;border-bottom:1px solid #ddd}.edit-attachment-frame .attachment-info .filename{font-weight:400;color:#666}.edit-attachment-frame .attachment-info .thumbnail{margin-bottom:12px}.attachment-info .actions{margin-bottom:16px}.attachment-info .actions a{display:inline;text-decoration:none}.wp_attachment_details .attachment-alt-text{margin-bottom:5px}.wp_attachment_details .attachment-alt-text-description{margin-top:5px}.wp_attachment_details label[for=content]{font-size:13px;line-height:1.5;margin:1em 0}.wp_attachment_details #attachment_caption{height:4em}.describe .image-editor{vertical-align:top}.imgedit-wrap{position:relative;padding-top:10px}.imgedit-settings fieldset,.imgedit-settings p{margin:8px 0}.imgedit-settings legend{margin-bottom:5px}.describe .imgedit-wrap .imgedit-settings{padding:0 5px}.wp_attachment_holder div.updated{margin-top:0}.wp_attachment_holder .imgedit-wrap>div{height:auto}.wp_attachment_holder .imgedit-wrap .imgedit-panel-content{padding:3px 16px 0 0;float:left}.wp_attachment_holder .imgedit-wrap .imgedit-settings{float:right;width:250px}.imgedit-settings input{margin-top:0;vertical-align:middle}.imgedit-wait{position:absolute;top:0;bottom:0;width:100%;background:#fff;opacity:.7;filter:alpha(opacity=70);display:none}.imgedit-wait:before{content:"";display:block;width:20px;height:20px;position:absolute;left:50%;top:50%;margin:-10px 0 0 -10px;background:transparent url(../images/spinner.gif) no-repeat center;background-size:20px 20px;transform:translateZ(0)}.no-float{float:none}.imgedit-settings .disabled,.media-disabled{color:#a0a5aa}.A1B1{overflow:hidden}.A1B1 .button,.wp_attachment_image .button{float:left}.no-js .wp_attachment_image .button{display:none}.A1B1 .spinner,.wp_attachment_image .spinner{float:left}.imgedit-menu{min-width:300px;margin:0 0 12px}.imgedit-menu .note-no-rotate{clear:both;margin:0;padding:1em 0 0}.image-editor .imgedit-menu .button{float:left;width:32px;height:32px;margin:0 8px 0 0;padding:0;background:#f1f1f1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:1.23076923;color:#72777c}.imgedit-menu .button:before{font:normal 20px/1 dashicons;speak:none;vertical-align:middle}.imgedit-menu .button.disabled{border-color:#ccc;background-color:#ddd;color:#72777c;filter:alpha(opacity=50);opacity:.5;cursor:default}.imgedit-crop:before{content:"\f165"}.imgedit-rleft:before{content:"\f166"}.imgedit-rright:before{content:"\f167"}.imgedit-flipv:before{content:"\f168"}.imgedit-fliph:before{content:"\f169"}.imgedit-undo:before{content:"\f171"}.imgedit-redo:before{content:"\f172"}.imgedit-crop-wrap{position:relative}.imgedit-crop-wrap img{background-image:linear-gradient(45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4),linear-gradient(45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4);background-position:0 0,10px 10px;background-size:20px 20px}.imgedit-crop{margin:0 8px 0 0}.imgedit-rleft{margin:0 3px}.imgedit-rright{margin:0 8px 0 3px}.imgedit-flipv{margin:0 3px}.imgedit-fliph{margin:0 8px 0 3px}.imgedit-undo{margin:0 3px}.imgedit-redo{margin:0 8px 0 3px}.imgedit-thumbnail-preview{margin:10px 8px 0 0}.imgedit-thumbnail-preview-caption{display:block}#poststuff .imgedit-group-top h2{display:inline-block;margin:0;padding:0;font-size:14px;line-height:1.4}#poststuff .imgedit-group-top .button-link{text-decoration:none;color:#23282d}.imgedit-applyto .imgedit-label{display:block;padding:.5em 0 0}.imgedit-help{display:none;font-style:italic}.image-editor .imgedit-settings .imgedit-help-toggle,.image-editor .imgedit-settings .imgedit-help-toggle:active,.image-editor .imgedit-settings .imgedit-help-toggle:hover{border:1px solid transparent;margin:-1px 0 0 -1px;padding:0;background:0 0;color:#0074a2;font-size:20px;line-height:1;cursor:pointer;box-sizing:content-box;box-shadow:none}.image-editor .imgedit-settings .imgedit-help-toggle:focus{color:#0074a2;border-color:#5b9dd9;box-shadow:0 0 3px rgba(0,115,170,.8);outline:2px solid transparent}.form-table td.imgedit-response{padding:0}.imgedit-submit{margin:8px 0 0}.imgedit-submit-btn{margin-left:20px}.imgedit-wrap .nowrap{white-space:nowrap;font-size:12px;line-height:inherit}span.imgedit-scale-warn{color:#dc3232;font-size:20px;font-style:normal;visibility:hidden;vertical-align:middle}.imgedit-save-target{margin:8px 0}.imgedit-save-target legend{font-weight:600}.imgedit-group{margin-bottom:8px;padding:10px}.imgedit-settings .imgedit-crop-ratio input[type=text],.imgedit-settings .imgedit-crop-sel input[type=text],.imgedit-settings .imgedit-scale input[type=text]{width:50px;font-size:14px;padding:5px 8px}.imgedit-separator{display:inline-block;width:7px;text-align:center;font-size:13px;color:#444}.imgedit-settings .imgedit-scale .button{margin-bottom:0}audio,video{display:inline-block;max-width:100%}.mejs-container{width:100%;max-width:100%}.mejs-container .mejs-controls{box-sizing:border-box}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.imgedit-wait:before{background-image:url(../images/spinner-2x.gif)}}@media screen and (max-width:782px){.wp_attachment_details label[for=content]{font-size:14px;line-height:1.5}.media-upload-form .media-item .error,.media-upload-form .media-item.error{font-size:13px;line-height:1.5}.media-upload-form .media-item.error{padding:1px 10px}.media-upload-form .media-item .error{padding:10px 0 10px 12px}.imgedit-settings .imgedit-crop-ratio input[type=text],.imgedit-settings .imgedit-crop-sel input[type=text],.imgedit-settings .imgedit-scale input[type=text]{width:60px;font-size:16px;padding:6px 10px}}@media only screen and (max-width:1120px){#wp-media-grid .wp-filter .attachment-filters{max-width:100%}}@media only screen and (max-width:782px){.media-frame.mode-select .attachments-browser.fixed .media-toolbar{top:46px;right:10px}}@media only screen and (max-width:600px){.media-frame.mode-select .attachments-browser.fixed .media-toolbar{top:0}}@media only screen and (max-width:480px){.edit-attachment-frame .media-frame-title{right:110px}.edit-attachment-frame .edit-media-header .left,.edit-attachment-frame .edit-media-header .right,.upload-php .media-modal-close{width:40px;height:40px}.edit-attachment-frame .edit-media-header .left:before,.edit-attachment-frame .edit-media-header .right:before{line-height:40px!important}.edit-attachment-frame .edit-media-header .left{right:82px}.edit-attachment-frame .edit-media-header .right{right:41px}.edit-attachment-frame .media-frame-content{top:40px}.edit-attachment-frame .attachment-media-view{float:none;height:auto;width:100%}.edit-attachment-frame .attachment-info{height:auto;width:100%}}@media only screen and (max-width:640px),screen and (max-height:400px){.upload-php .mode-grid .media-sidebar{max-width:100%}} \ No newline at end of file +.media-item .describe{border-collapse:collapse;width:100%;border-top:1px solid #ddd;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:600}.media-upload-form tr.image-size label{margin:0 0 0 5px;font-weight:600}.media-upload-form th.label label{font-weight:600;margin:.5em;font-size:13px}.media-upload-form th.label label span{padding:0 5px}.media-item .describe input[type=text],.media-item .describe textarea{width:460px}.media-item .describe p.help{margin:0;padding:0 0 0 5px}.describe-toggle-off,.describe-toggle-on,.media-item .edit-attachment{display:block;line-height:2.76923076;float:right;margin-right:10px}.media-item .describe-toggle-off,.media-item.open .describe-toggle-on{display:none}.media-item.open .describe-toggle-off{display:block}.media-upload-form .media-item{min-height:36px;margin-bottom:1px;position:relative;width:100%;background:#fff}.media-upload-form .media-item,.media-upload-form .media-item .error{box-shadow:0 1px 0 #ddd}#media-items:empty{border:0 none}.media-item .filename{line-height:2.76923076;overflow:hidden;margin-left:6px}.media-item .pinkynail{float:left;margin:2px 10px 0 3px;max-width:40px;max-height:32px}.media-item .startclosed,.media-item .startopen{display:none}.media-item .original{position:relative;height:34px}.media-item .progress{float:right;height:22px;margin:7px 6px;width:200px;line-height:2em;padding:0;overflow:hidden;border-radius:22px;background:#ddd;box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.media-item .bar{z-index:9;width:0;height:100%;margin-top:-22px;border-radius:22px;background-color:#0073aa;box-shadow:inset 0 0 2px rgba(0,0,0,.3)}.media-item .progress .percent{z-index:10;position:relative;width:200px;padding:0;color:#fff;text-align:center;line-height:22px;font-weight:400;text-shadow:0 1px 2px rgba(0,0,0,.2)}.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,.media-upload-form .media-item.error{width:auto;margin:0 0 1px 0}.media-upload-form .media-item .error{padding:10px 0 10px 14px}.media-item .error-div button.dismiss{float:right;margin:0 10px 0 15px}.find-box{background-color:#fff;box-shadow:0 3px 6px rgba(0,0,0,.3);width:600px;overflow:hidden;margin-left:-300px;position:fixed;top:30px;bottom:30px;left:50%;z-index:100105}.find-box-head{background:#fcfcfc;border-bottom:1px solid #ddd;height:36px;font-size:18px;font-weight:600;line-height:2;padding:0 36px 0 16px;position:absolute;top:0;left:0;right:0}.find-box-inside{overflow:auto;padding:16px;background-color:#fff;position:absolute;top:37px;bottom:45px;overflow-y:scroll;width:100%;box-sizing:border-box}.find-box-search{padding-bottom:16px}.find-box-search .spinner{float:none;left:105px;position:absolute}#find-posts-response,.find-box-search{position:relative}#find-posts-input,#find-posts-search{float:left}#find-posts-input{width:140px;height:28px;margin:0 4px 0 0}.widefat .found-radio{padding-right:0;width:16px}#find-posts-close{width:36px;height:36px;border:none;padding:0;position:absolute;top:0;right:0;cursor:pointer;text-align:center;background:0 0;color:#666}#find-posts-close:focus,#find-posts-close:hover{color:#00a0d2}#find-posts-close:focus{box-shadow:0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8);outline:2px solid transparent;outline-offset:-2px}#find-posts-close:before{font:normal 20px/36px dashicons;vertical-align:top;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f158"}.find-box-buttons{padding:8px 16px;background:#fcfcfc;border-top:1px solid #ddd;position:absolute;bottom:0;left:0;right:0}@media screen and (max-width:782px){.find-box-inside{bottom:57px}}@media screen and (max-width:660px){.find-box{top:0;bottom:0;left:0;right:0;margin:0;width:100%}}.ui-find-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#000;opacity:.7;filter:alpha(opacity=70);z-index:100100}.drag-drop #drag-drop-area{border:4px dashed #b4b9be;height:200px}.drag-drop .drag-drop-inside{margin:60px auto 0;width:250px}.drag-drop-inside p{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}.media-frame.mode-grid,.media-frame.mode-grid .attachments-browser .attachments,.media-frame.mode-grid .media-frame-content,.media-frame.mode-grid .uploader-inline-content{position:static}.media-frame.mode-grid .media-frame-menu,.media-frame.mode-grid .media-frame-router,.media-frame.mode-grid .media-frame-title{display:none}.media-frame.mode-grid .media-frame-content{background-color:transparent;border:none}.upload-php .mode-grid .media-sidebar{position:relative;width:auto;margin-top:12px;padding:0 16px;border-left:4px solid #dd3d36;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);background-color:#fff}.upload-php .mode-grid .hide-sidebar .media-sidebar{display:none}.upload-php .mode-grid .media-sidebar .media-uploader-status{border-bottom:none;padding-bottom:0;max-width:100%}.upload-php .mode-grid .media-sidebar .upload-error{margin:12px 0;padding:4px 0 0;border:none;box-shadow:none;background:0 0}.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors{top:-10px;right:-14px;padding:10px}.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:before{content:"\f153";display:block;font:normal 16px/1 dashicons;color:#72777c}.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:focus:before,.upload-php .mode-grid .media-sidebar .media-uploader-status .upload-dismiss-errors:hover:before{color:#c00}.upload-php .mode-grid .media-sidebar .media-uploader-status.errors h2{display:none}.media-frame.mode-grid .uploader-inline{position:relative;top:auto;right:auto;left:auto;bottom:auto;padding-top:0;margin-top:20px;border:4px dashed #b4b9be}.media-frame.mode-select .attachments-browser.fixed .attachments{position:relative;top:94px;padding-bottom:94px}.media-frame.mode-grid .attachment.details:focus,.media-frame.mode-grid .attachment:focus,.media-frame.mode-grid .selected.attachment:focus{box-shadow:inset 0 0 2px 3px #f1f1f1,inset 0 0 0 7px #5b9dd9;outline:2px solid transparent;outline-offset:-6px}.media-frame.mode-grid .selected.attachment{box-shadow:inset 0 0 0 5px #f1f1f1,inset 0 0 0 7px #ccc}.media-frame.mode-grid .attachment.details{box-shadow:inset 0 0 0 3px #f1f1f1,inset 0 0 0 7px #1e8cbe}.media-frame.mode-grid.mode-select .attachment .thumbnail{opacity:.65}.media-frame.mode-select .attachment.selected .thumbnail{opacity:1}.media-frame.mode-grid .media-toolbar{margin-bottom:15px;height:auto}.media-frame.mode-grid .media-toolbar select{margin:0 10px 0 0;font-size:14px}.media-frame.mode-grid.mode-edit .media-toolbar-secondary>.select-mode-toggle-button{margin:0 8px 0 0;vertical-align:middle}.media-frame.mode-grid .attachments-browser .bulk-select{display:inline-block;margin:0 10px 0 0}.media-frame.mode-grid .search{margin-top:0}.media-frame.mode-grid .spinner{margin-top:16px}.attachments-browser .media-toolbar-secondary>.media-button{margin-right:10px}.media-frame.mode-select .attachments-browser.fixed .media-toolbar{position:fixed;top:32px;left:auto;right:20px;margin-top:0}.media-frame.mode-grid .attachments-browser{padding:0}.media-frame.mode-grid .attachments-browser .attachments{padding:2px}.media-frame.mode-grid .attachments-browser .no-media{color:#666;font-size:18px;font-style:normal;margin:0;padding:100px 0 0;text-align:center}.edit-attachment-frame{display:block;height:100%;width:100%}.edit-attachment-frame .edit-media-header{overflow:hidden}.upload-php .media-modal-close .media-modal-icon:before{content:"\f335";font-size:22px}.edit-attachment-frame .edit-media-header .left,.edit-attachment-frame .edit-media-header .right,.upload-php .media-modal-close{cursor:pointer;color:#72777c;background-color:transparent;height:50px;width:50px;padding:0;position:absolute;text-align:center;border:0;border-left:1px solid #ddd;transition:color .1s ease-in-out,background .1s ease-in-out}.upload-php .media-modal-close{top:0;right:0}.edit-attachment-frame .edit-media-header .left{right:102px}.edit-attachment-frame .edit-media-header .right{right:51px}.edit-attachment-frame .media-frame-title{left:0;right:150px}.edit-attachment-frame .edit-media-header .left:before,.edit-attachment-frame .edit-media-header .right:before{font:normal 20px/50px dashicons!important;display:inline;font-weight:300}.edit-attachment-frame .edit-media-header .left:focus,.edit-attachment-frame .edit-media-header .left:hover,.edit-attachment-frame .edit-media-header .right:focus,.edit-attachment-frame .edit-media-header .right:hover,.upload-php .media-modal-close:focus,.upload-php .media-modal-close:hover{background:#ddd;border-color:#ccc;color:#000;outline:0;box-shadow:none}.edit-attachment-frame .edit-media-header .left:focus,.edit-attachment-frame .edit-media-header .right:focus,.upload-php .media-modal-close:focus{outline:2px solid transparent;outline-offset:-2px}.upload-php .media-modal-close:focus .media-modal-icon:before,.upload-php .media-modal-close:hover .media-modal-icon:before{color:#000}.edit-attachment-frame .edit-media-header .left:before{content:"\f341"}.edit-attachment-frame .edit-media-header .right:before{content:"\f345"}.edit-attachment-frame .edit-media-header [disabled],.edit-attachment-frame .edit-media-header [disabled]:hover{color:#ccc;background:inherit;cursor:default}.edit-attachment-frame .media-frame-content,.edit-attachment-frame .media-frame-router{left:0}.edit-attachment-frame .media-frame-content{border-bottom:none;bottom:0;top:50px}.edit-attachment-frame .attachment-details{position:absolute;overflow:auto;top:0;bottom:0;right:0;left:0;box-shadow:inset 0 4px 4px -4px rgba(0,0,0,.1)}.edit-attachment-frame .attachment-media-view{float:left;width:65%;height:100%}.edit-attachment-frame .attachment-media-view .thumbnail{box-sizing:border-box;padding:16px;height:100%}.edit-attachment-frame .attachment-media-view .details-image{display:block;margin:0 auto 16px;max-width:100%;max-height:90%;max-height:calc(100% - 42px);background-image:linear-gradient(45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4),linear-gradient(45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4);background-position:0 0,10px 10px;background-size:20px 20px}.edit-attachment-frame .attachment-media-view .details-image.icon{background:0 0}.edit-attachment-frame .attachment-media-view .attachment-actions{text-align:center}.edit-attachment-frame .wp-media-wrapper{margin-bottom:12px}.edit-attachment-frame input,.edit-attachment-frame textarea{padding:6px 8px;line-height:1.14285714}.edit-attachment-frame .attachment-info{overflow:auto;box-sizing:border-box;margin-bottom:0;padding:12px 16px 0;width:35%;height:100%;box-shadow:inset 0 4px 4px -4px rgba(0,0,0,.1);border-bottom:0;border-left:1px solid #ddd;background:#f3f3f3}.edit-attachment-frame .attachment-info .details,.edit-attachment-frame .attachment-info .settings{position:relative;overflow:hidden;float:none;margin-bottom:15px;padding-bottom:15px;border-bottom:1px solid #ddd}.edit-attachment-frame .attachment-info .filename{font-weight:400;color:#666}.edit-attachment-frame .attachment-info .thumbnail{margin-bottom:12px}.attachment-info .actions{margin-bottom:16px}.attachment-info .actions a{display:inline;text-decoration:none}.wp_attachment_details .attachment-alt-text{margin-bottom:5px}.wp_attachment_details .attachment-alt-text-description{margin-top:5px}.wp_attachment_details label[for=content]{font-size:13px;line-height:1.5;margin:1em 0}.wp_attachment_details #attachment_caption{height:4em}.describe .image-editor{vertical-align:top}.imgedit-wrap{position:relative;padding-top:10px}.imgedit-settings fieldset,.imgedit-settings p{margin:8px 0}.imgedit-settings legend{margin-bottom:5px}.describe .imgedit-wrap .imgedit-settings{padding:0 5px}.wp_attachment_holder div.updated{margin-top:0}.wp_attachment_holder .imgedit-wrap>div{height:auto}.wp_attachment_holder .imgedit-wrap .imgedit-panel-content{padding:3px 16px 0 0;float:left}.wp_attachment_holder .imgedit-wrap .imgedit-settings{float:right;width:250px}.imgedit-settings input{margin-top:0;vertical-align:middle}.imgedit-wait{position:absolute;top:0;bottom:0;width:100%;background:#fff;opacity:.7;filter:alpha(opacity=70);display:none}.imgedit-wait:before{content:"";display:block;width:20px;height:20px;position:absolute;left:50%;top:50%;margin:-10px 0 0 -10px;background:transparent url(../images/spinner.gif) no-repeat center;background-size:20px 20px;transform:translateZ(0)}.no-float{float:none}.imgedit-settings .disabled,.media-disabled{color:#a0a5aa}.A1B1{overflow:hidden}.A1B1 .button,.wp_attachment_image .button{float:left}.no-js .wp_attachment_image .button{display:none}.A1B1 .spinner,.wp_attachment_image .spinner{float:left}.imgedit-menu{min-width:300px;margin:0 0 12px}.imgedit-menu .note-no-rotate{clear:both;margin:0;padding:1em 0 0}.image-editor .imgedit-menu .button{float:left;width:32px;height:32px;margin:0 8px 0 0;padding:0;background:#f1f1f1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;line-height:1.23076923;color:#72777c}.imgedit-menu .button:before{font:normal 20px/1 dashicons;speak:none;vertical-align:middle}.imgedit-menu .button.disabled{border-color:#ccc;background-color:#ddd;color:#72777c;filter:alpha(opacity=50);opacity:.5;cursor:default}.imgedit-crop:before{content:"\f165"}.imgedit-rleft:before{content:"\f166"}.imgedit-rright:before{content:"\f167"}.imgedit-flipv:before{content:"\f168"}.imgedit-fliph:before{content:"\f169"}.imgedit-undo:before{content:"\f171"}.imgedit-redo:before{content:"\f172"}.imgedit-crop-wrap{position:relative}.imgedit-crop-wrap img{background-image:linear-gradient(45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4),linear-gradient(45deg,#c4c4c4 25%,transparent 25%,transparent 75%,#c4c4c4 75%,#c4c4c4);background-position:0 0,10px 10px;background-size:20px 20px}.imgedit-crop{margin:0 8px 0 0}.imgedit-rleft{margin:0 3px}.imgedit-rright{margin:0 8px 0 3px}.imgedit-flipv{margin:0 3px}.imgedit-fliph{margin:0 8px 0 3px}.imgedit-undo{margin:0 3px}.imgedit-redo{margin:0 8px 0 3px}.imgedit-thumbnail-preview{margin:10px 8px 0 0}.imgedit-thumbnail-preview-caption{display:block}#poststuff .imgedit-group-top h2{display:inline-block;margin:0;padding:0;font-size:14px;line-height:1.4}#poststuff .imgedit-group-top .button-link{text-decoration:none;color:#23282d}.imgedit-applyto .imgedit-label{display:block;padding:.5em 0 0}.imgedit-help{display:none;font-style:italic}.image-editor .imgedit-settings .imgedit-help-toggle,.image-editor .imgedit-settings .imgedit-help-toggle:active,.image-editor .imgedit-settings .imgedit-help-toggle:hover{border:1px solid transparent;margin:-1px 0 0 -1px;padding:0;background:0 0;color:#0074a2;font-size:20px;line-height:1;cursor:pointer;box-sizing:content-box;box-shadow:none}.image-editor .imgedit-settings .imgedit-help-toggle:focus{color:#0074a2;border-color:#5b9dd9;box-shadow:0 0 3px rgba(0,115,170,.8);outline:2px solid transparent}.form-table td.imgedit-response{padding:0}.imgedit-submit{margin:8px 0 0}.imgedit-submit-btn{margin-left:20px}.imgedit-wrap .nowrap{white-space:nowrap;font-size:12px;line-height:inherit}span.imgedit-scale-warn{color:#dc3232;font-size:20px;font-style:normal;visibility:hidden;vertical-align:middle}.imgedit-save-target{margin:8px 0}.imgedit-save-target legend{font-weight:600}.imgedit-group{margin-bottom:8px;padding:10px}.imgedit-settings .imgedit-crop-ratio input[type=text],.imgedit-settings .imgedit-crop-sel input[type=text],.imgedit-settings .imgedit-scale input[type=text]{width:50px;font-size:14px;padding:5px 8px}.imgedit-separator{display:inline-block;width:7px;text-align:center;font-size:13px;color:#444}.imgedit-settings .imgedit-scale .button{margin-bottom:0}audio,video{display:inline-block;max-width:100%}.mejs-container{width:100%;max-width:100%}.mejs-container .mejs-controls{box-sizing:border-box}@media print,(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.imgedit-wait:before{background-image:url(../images/spinner-2x.gif)}}@media screen and (max-width:782px){.wp_attachment_details label[for=content]{font-size:14px;line-height:1.5}.media-upload-form .media-item .error,.media-upload-form .media-item.error{font-size:13px;line-height:1.5}.media-upload-form .media-item.error{padding:1px 10px}.media-upload-form .media-item .error{padding:10px 0 10px 12px}.imgedit-settings .imgedit-crop-ratio input[type=text],.imgedit-settings .imgedit-crop-sel input[type=text],.imgedit-settings .imgedit-scale input[type=text]{width:60px;font-size:16px;padding:6px 10px}}@media only screen and (max-width:1120px){#wp-media-grid .wp-filter .attachment-filters{max-width:100%}}@media only screen and (max-width:782px){.media-frame.mode-select .attachments-browser.fixed .media-toolbar{top:46px;right:10px}}@media only screen and (max-width:600px){.media-frame.mode-select .attachments-browser.fixed .media-toolbar{top:0}}@media only screen and (max-width:480px){.edit-attachment-frame .media-frame-title{right:110px}.edit-attachment-frame .edit-media-header .left,.edit-attachment-frame .edit-media-header .right,.upload-php .media-modal-close{width:40px;height:40px}.edit-attachment-frame .edit-media-header .left:before,.edit-attachment-frame .edit-media-header .right:before{line-height:40px!important}.edit-attachment-frame .edit-media-header .left{right:82px}.edit-attachment-frame .edit-media-header .right{right:41px}.edit-attachment-frame .media-frame-content{top:40px}.edit-attachment-frame .attachment-media-view{float:none;height:auto;width:100%}.edit-attachment-frame .attachment-info{height:auto;width:100%}}@media only screen and (max-width:640px),screen and (max-height:400px){.upload-php .mode-grid .media-sidebar{max-width:100%}} \ No newline at end of file diff --git a/wp-includes/js/media-audiovideo.js b/wp-includes/js/media-audiovideo.js index ee5d7f92de..40bb58bef9 100644 --- a/wp-includes/js/media-audiovideo.js +++ b/wp-includes/js/media-audiovideo.js @@ -1001,7 +1001,7 @@ MediaDetails = AttachmentDisplay.extend(/** @lends wp.media.view.MediaDetails.pr AttachmentDisplay.prototype.render.apply( this, arguments ); setTimeout( _.bind( function() { - this.resetFocus(); + this.scrollToTop(); }, this ), 10 ); this.settings = _.defaults( { @@ -1011,7 +1011,7 @@ MediaDetails = AttachmentDisplay.extend(/** @lends wp.media.view.MediaDetails.pr return this.setMedia(); }, - resetFocus: function() { + scrollToTop: function() { this.$( '.embed-media-settings' ).scrollTop( 0 ); } },/** @lends wp.media.view.MediaDetails */{ diff --git a/wp-includes/js/media-audiovideo.min.js b/wp-includes/js/media-audiovideo.min.js index 4f1b443f86..0b7723015b 100644 --- a/wp-includes/js/media-audiovideo.min.js +++ b/wp-includes/js/media-audiovideo.min.js @@ -1 +1 @@ -!function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{enumerable:!0,get:d})},b.r=function(a){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},b.t=function(a,c){if(1&c&&(a=b(a)),8&c)return a;if(4&c&&"object"==typeof a&&a&&a.__esModule)return a;var d=Object.create(null);if(b.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:a}),2&c&&"string"!=typeof a)for(var e in a)b.d(d,e,function(b){return a[b]}.bind(null,e));return d},b.n=function(a){var c=a&&a.__esModule?function(){return a["default"]}:function(){return a};return b.d(c,"a",c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p="",b(b.s=0)}([function(a,b,c){a.exports=c(1)},function(a,b,c){var d=wp.media,e=window._wpmejsSettings||{},f=window._wpMediaViewsL10n||{};wp.media.mixin={mejsSettings:e,removeAllPlayers:function(){var a;if(window.mejs&&window.mejs.players)for(a in window.mejs.players)window.mejs.players[a].pause(),this.removePlayer(window.mejs.players[a])},removePlayer:function(a){var b,c;if(a.options){for(b in a.options.features)if(c=a.options.features[b],a["clean"+c])try{a["clean"+c](a)}catch(d){}a.isDynamic||a.node.remove(),"html5"!==a.media.rendererName&&a.media.remove(),delete window.mejs.players[a.id],a.container.remove(),a.globalUnbind("resize",a.globalResizeCallback),a.globalUnbind("keydown",a.globalKeydownCallback),a.globalUnbind("click",a.globalClickCallback),delete a.media.player}},unsetPlayers:function(){this.players&&this.players.length&&(_.each(this.players,function(a){a.pause(),wp.media.mixin.removePlayer(a)}),this.players=[])}},wp.media.playlist=new wp.media.collection({tag:"playlist",editTitle:f.editPlaylistTitle,defaults:{id:wp.media.view.settings.post.id,style:"light",tracklist:!0,tracknumbers:!0,images:!0,artists:!0,type:"audio"}}),wp.media.audio={coerce:wp.media.coerce,defaults:{id:wp.media.view.settings.post.id,src:"",loop:!1,autoplay:!1,preload:"none",width:400},edit:function(a){var b,c=wp.shortcode.next("audio",a).shortcode;return b=wp.media({frame:"audio",state:"audio-details",metadata:_.defaults(c.attrs.named,this.defaults)})},shortcode:function(a){var b;return _.each(this.defaults,function(b,c){a[c]=this.coerce(a,c),b===a[c]&&delete a[c]},this),b=a.content,delete a.content,new wp.shortcode({tag:"audio",attrs:a,content:b})}},wp.media.video={coerce:wp.media.coerce,defaults:{id:wp.media.view.settings.post.id,src:"",poster:"",loop:!1,autoplay:!1,preload:"metadata",content:"",width:640,height:360},edit:function(a){var b,c,d=wp.shortcode.next("video",a).shortcode;return c=d.attrs.named,c.content=d.content,b=wp.media({frame:"video",state:"video-details",metadata:_.defaults(c,this.defaults)})},shortcode:function(a){var b;return _.each(this.defaults,function(b,c){a[c]=this.coerce(a,c),b===a[c]&&delete a[c]},this),b=a.content,delete a.content,new wp.shortcode({tag:"video",attrs:a,content:b})}},d.model.PostMedia=c(2),d.controller.AudioDetails=c(3),d.controller.VideoDetails=c(4),d.view.MediaFrame.MediaDetails=c(5),d.view.MediaFrame.AudioDetails=c(6),d.view.MediaFrame.VideoDetails=c(7),d.view.MediaDetails=c(8),d.view.AudioDetails=c(9),d.view.VideoDetails=c(10)},function(a,b){var c=Backbone.Model.extend({initialize:function(){this.attachment=!1},setSource:function(a){this.attachment=a,this.extension=a.get("filename").split(".").pop(),this.get("src")&&this.extension===this.get("src").split(".").pop()&&this.unset("src"),_.contains(wp.media.view.settings.embedExts,this.extension)?this.set(this.extension,this.attachment.get("url")):this.unset(this.extension)},changeAttachment:function(a){this.setSource(a),this.unset("src"),_.each(_.without(wp.media.view.settings.embedExts,this.extension),function(a){this.unset(a)},this)}});a.exports=c},function(a,b){var c,d=wp.media.controller.State,e=wp.media.view.l10n;c=d.extend({defaults:{id:"audio-details",toolbar:"audio-details",title:e.audioDetailsTitle,content:"audio-details",menu:"audio-details",router:!1,priority:60},initialize:function(a){this.media=a.media,d.prototype.initialize.apply(this,arguments)}}),a.exports=c},function(a,b){var c,d=wp.media.controller.State,e=wp.media.view.l10n;c=d.extend({defaults:{id:"video-details",toolbar:"video-details",title:e.videoDetailsTitle,content:"video-details",menu:"video-details",router:!1,priority:60},initialize:function(a){this.media=a.media,d.prototype.initialize.apply(this,arguments)}}),a.exports=c},function(a,b){var c,d=wp.media.view.MediaFrame.Select,e=wp.media.view.l10n;c=d.extend({defaults:{id:"media",url:"",menu:"media-details",content:"media-details",toolbar:"media-details",type:"link",priority:120},initialize:function(a){this.DetailsView=a.DetailsView,this.cancelText=a.cancelText,this.addText=a.addText,this.media=new wp.media.model.PostMedia(a.metadata),this.options.selection=new wp.media.model.Selection(this.media.attachment,{multiple:!1}),d.prototype.initialize.apply(this,arguments)},bindHandlers:function(){var a=this.defaults.menu;d.prototype.bindHandlers.apply(this,arguments),this.on("menu:create:"+a,this.createMenu,this),this.on("content:render:"+a,this.renderDetailsContent,this),this.on("menu:render:"+a,this.renderMenu,this),this.on("toolbar:render:"+a,this.renderDetailsToolbar,this)},renderDetailsContent:function(){var a=new this.DetailsView({controller:this,model:this.state().media,attachment:this.state().media.attachment}).render();this.content.set(a)},renderMenu:function(a){var b=this.lastState(),c=b&&b.id,d=this;a.set({cancel:{text:this.cancelText,priority:20,click:function(){c?d.setState(c):d.close()}},separateCancel:new wp.media.View({className:"separator",priority:40})})},setPrimaryButton:function(a,b){this.toolbar.set(new wp.media.view.Toolbar({controller:this,items:{button:{style:"primary",text:a,priority:80,click:function(){var a=this.controller;b.call(this,a,a.state()),a.setState(a.options.state),a.reset()}}}}))},renderDetailsToolbar:function(){this.setPrimaryButton(e.update,function(a,b){a.close(),b.trigger("update",a.media.toJSON())})},renderReplaceToolbar:function(){this.setPrimaryButton(e.replace,function(a,b){var c=b.get("selection").single();a.media.changeAttachment(c),b.trigger("replace",a.media.toJSON())})},renderAddSourceToolbar:function(){this.setPrimaryButton(this.addText,function(a,b){var c=b.get("selection").single();a.media.setSource(c),b.trigger("add-source",a.media.toJSON())})}}),a.exports=c},function(a,b){var c,d=wp.media.view.MediaFrame.MediaDetails,e=wp.media.controller.MediaLibrary,f=wp.media.view.l10n;c=d.extend({defaults:{id:"audio",url:"",menu:"audio-details",content:"audio-details",toolbar:"audio-details",type:"link",title:f.audioDetailsTitle,priority:120},initialize:function(a){a.DetailsView=wp.media.view.AudioDetails,a.cancelText=f.audioDetailsCancel,a.addText=f.audioAddSourceTitle,d.prototype.initialize.call(this,a)},bindHandlers:function(){d.prototype.bindHandlers.apply(this,arguments),this.on("toolbar:render:replace-audio",this.renderReplaceToolbar,this),this.on("toolbar:render:add-audio-source",this.renderAddSourceToolbar,this)},createStates:function(){this.states.add([new wp.media.controller.AudioDetails({media:this.media}),new e({type:"audio",id:"replace-audio",title:f.audioReplaceTitle,toolbar:"replace-audio",media:this.media,menu:"audio-details"}),new e({type:"audio",id:"add-audio-source",title:f.audioAddSourceTitle,toolbar:"add-audio-source",media:this.media,menu:!1})])}}),a.exports=c},function(a,b){var c,d=wp.media.view.MediaFrame.MediaDetails,e=wp.media.controller.MediaLibrary,f=wp.media.view.l10n;c=d.extend({defaults:{id:"video",url:"",menu:"video-details",content:"video-details",toolbar:"video-details",type:"link",title:f.videoDetailsTitle,priority:120},initialize:function(a){a.DetailsView=wp.media.view.VideoDetails,a.cancelText=f.videoDetailsCancel,a.addText=f.videoAddSourceTitle,d.prototype.initialize.call(this,a)},bindHandlers:function(){d.prototype.bindHandlers.apply(this,arguments),this.on("toolbar:render:replace-video",this.renderReplaceToolbar,this),this.on("toolbar:render:add-video-source",this.renderAddSourceToolbar,this),this.on("toolbar:render:select-poster-image",this.renderSelectPosterImageToolbar,this),this.on("toolbar:render:add-track",this.renderAddTrackToolbar,this)},createStates:function(){this.states.add([new wp.media.controller.VideoDetails({media:this.media}),new e({type:"video",id:"replace-video",title:f.videoReplaceTitle,toolbar:"replace-video",media:this.media,menu:"video-details"}),new e({type:"video",id:"add-video-source",title:f.videoAddSourceTitle,toolbar:"add-video-source",media:this.media,menu:!1}),new e({type:"image",id:"select-poster-image",title:f.videoSelectPosterImageTitle,toolbar:"select-poster-image",media:this.media,menu:"video-details"}),new e({type:"text",id:"add-track",title:f.videoAddTrackTitle,toolbar:"add-track",media:this.media,menu:"video-details"})])},renderSelectPosterImageToolbar:function(){this.setPrimaryButton(f.videoSelectPosterImageTitle,function(a,b){var c=[],d=b.get("selection").single();a.media.set("poster",d.get("url")),b.trigger("set-poster-image",a.media.toJSON()),_.each(wp.media.view.settings.embedExts,function(b){a.media.get(b)&&c.push(a.media.get(b))}),wp.ajax.send("set-attachment-thumbnail",{data:{urls:c,thumbnail_id:d.get("id")}})})},renderAddTrackToolbar:function(){this.setPrimaryButton(f.videoAddTrackTitle,function(a,b){var c=b.get("selection").single(),d=a.media.get("content");-1===d.indexOf(c.get("url"))&&(d+=[''].join(""),a.media.set("content",d)),b.trigger("add-track",a.media.toJSON())})}}),a.exports=c},function(a,b){var c,d=wp.media.view.Settings.AttachmentDisplay,e=jQuery;c=d.extend({initialize:function(){_.bindAll(this,"success"),this.players=[],this.listenTo(this.controller,"close",wp.media.mixin.unsetPlayers),this.on("ready",this.setPlayer),this.on("media:setting:remove",wp.media.mixin.unsetPlayers,this),this.on("media:setting:remove",this.render),this.on("media:setting:remove",this.setPlayer),d.prototype.initialize.apply(this,arguments)},events:function(){return _.extend({"click .remove-setting":"removeSetting","change .content-track":"setTracks","click .remove-track":"setTracks","click .add-media-source":"addSource"},d.prototype.events)},prepare:function(){return _.defaults({model:this.model.toJSON()},this.options)},removeSetting:function(a){var b,c=e(a.currentTarget).parent();b=c.find("input").data("setting"),b&&(this.model.unset(b),this.trigger("media:setting:remove",this)),c.remove()},setTracks:function(){var a="";_.each(this.$(".content-track"),function(b){a+=e(b).val()}),this.model.set("content",a),this.trigger("media:setting:remove",this)},addSource:function(a){this.controller.lastMime=e(a.currentTarget).data("mime"),this.controller.setState("add-"+this.controller.defaults.id+"-source")},loadPlayer:function(){this.players.push(new MediaElementPlayer(this.media,this.settings)),this.scriptXhr=!1},setPlayer:function(){var a;this.players.length||!this.media||this.scriptXhr||(a=this.model.get("src"),a&&a.indexOf("vimeo")>-1&&!("Vimeo"in window)?this.scriptXhr=e.getScript("https://player.vimeo.com/api/player.js",_.bind(this.loadPlayer,this)):this.loadPlayer())},setMedia:function(){return this},success:function(a){var b=a.attributes.autoplay&&"false"!==a.attributes.autoplay;"flash"===a.pluginType&&b&&a.addEventListener("canplay",function(){a.play()},!1),this.mejs=a},render:function(){return d.prototype.render.apply(this,arguments),setTimeout(_.bind(function(){this.resetFocus()},this),10),this.settings=_.defaults({success:this.success},wp.media.mixin.mejsSettings),this.setMedia()},resetFocus:function(){this.$(".embed-media-settings").scrollTop(0)}},{instances:0,prepareSrc:function(a){var b=c.instances++;return _.each(e(a).find("source"),function(a){a.src=[a.src,a.src.indexOf("?")>-1?"&":"?","_=",b].join("")}),a}}),a.exports=c},function(a,b){var c,d=wp.media.view.MediaDetails;c=d.extend({className:"audio-details",template:wp.template("audio-details"),setMedia:function(){var a=this.$(".wp-audio-shortcode");return a.find("source").length?(a.is(":hidden")&&a.show(),this.media=d.prepareSrc(a.get(0))):(a.hide(),this.media=!1),this}}),a.exports=c},function(a,b){var c,d=wp.media.view.MediaDetails;c=d.extend({className:"video-details",template:wp.template("video-details"),setMedia:function(){var a=this.$(".wp-video-shortcode");return a.find("source").length?(a.is(":hidden")&&a.show(),a.hasClass("youtube-video")||a.hasClass("vimeo-video")?this.media=a.get(0):this.media=d.prepareSrc(a.get(0))):(a.hide(),this.media=!1),this}}),a.exports=c}]); \ No newline at end of file +!function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{enumerable:!0,get:d})},b.r=function(a){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},b.t=function(a,c){if(1&c&&(a=b(a)),8&c)return a;if(4&c&&"object"==typeof a&&a&&a.__esModule)return a;var d=Object.create(null);if(b.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:a}),2&c&&"string"!=typeof a)for(var e in a)b.d(d,e,function(b){return a[b]}.bind(null,e));return d},b.n=function(a){var c=a&&a.__esModule?function(){return a["default"]}:function(){return a};return b.d(c,"a",c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p="",b(b.s=0)}([function(a,b,c){a.exports=c(1)},function(a,b,c){var d=wp.media,e=window._wpmejsSettings||{},f=window._wpMediaViewsL10n||{};wp.media.mixin={mejsSettings:e,removeAllPlayers:function(){var a;if(window.mejs&&window.mejs.players)for(a in window.mejs.players)window.mejs.players[a].pause(),this.removePlayer(window.mejs.players[a])},removePlayer:function(a){var b,c;if(a.options){for(b in a.options.features)if(c=a.options.features[b],a["clean"+c])try{a["clean"+c](a)}catch(d){}a.isDynamic||a.node.remove(),"html5"!==a.media.rendererName&&a.media.remove(),delete window.mejs.players[a.id],a.container.remove(),a.globalUnbind("resize",a.globalResizeCallback),a.globalUnbind("keydown",a.globalKeydownCallback),a.globalUnbind("click",a.globalClickCallback),delete a.media.player}},unsetPlayers:function(){this.players&&this.players.length&&(_.each(this.players,function(a){a.pause(),wp.media.mixin.removePlayer(a)}),this.players=[])}},wp.media.playlist=new wp.media.collection({tag:"playlist",editTitle:f.editPlaylistTitle,defaults:{id:wp.media.view.settings.post.id,style:"light",tracklist:!0,tracknumbers:!0,images:!0,artists:!0,type:"audio"}}),wp.media.audio={coerce:wp.media.coerce,defaults:{id:wp.media.view.settings.post.id,src:"",loop:!1,autoplay:!1,preload:"none",width:400},edit:function(a){var b,c=wp.shortcode.next("audio",a).shortcode;return b=wp.media({frame:"audio",state:"audio-details",metadata:_.defaults(c.attrs.named,this.defaults)})},shortcode:function(a){var b;return _.each(this.defaults,function(b,c){a[c]=this.coerce(a,c),b===a[c]&&delete a[c]},this),b=a.content,delete a.content,new wp.shortcode({tag:"audio",attrs:a,content:b})}},wp.media.video={coerce:wp.media.coerce,defaults:{id:wp.media.view.settings.post.id,src:"",poster:"",loop:!1,autoplay:!1,preload:"metadata",content:"",width:640,height:360},edit:function(a){var b,c,d=wp.shortcode.next("video",a).shortcode;return c=d.attrs.named,c.content=d.content,b=wp.media({frame:"video",state:"video-details",metadata:_.defaults(c,this.defaults)})},shortcode:function(a){var b;return _.each(this.defaults,function(b,c){a[c]=this.coerce(a,c),b===a[c]&&delete a[c]},this),b=a.content,delete a.content,new wp.shortcode({tag:"video",attrs:a,content:b})}},d.model.PostMedia=c(2),d.controller.AudioDetails=c(3),d.controller.VideoDetails=c(4),d.view.MediaFrame.MediaDetails=c(5),d.view.MediaFrame.AudioDetails=c(6),d.view.MediaFrame.VideoDetails=c(7),d.view.MediaDetails=c(8),d.view.AudioDetails=c(9),d.view.VideoDetails=c(10)},function(a,b){var c=Backbone.Model.extend({initialize:function(){this.attachment=!1},setSource:function(a){this.attachment=a,this.extension=a.get("filename").split(".").pop(),this.get("src")&&this.extension===this.get("src").split(".").pop()&&this.unset("src"),_.contains(wp.media.view.settings.embedExts,this.extension)?this.set(this.extension,this.attachment.get("url")):this.unset(this.extension)},changeAttachment:function(a){this.setSource(a),this.unset("src"),_.each(_.without(wp.media.view.settings.embedExts,this.extension),function(a){this.unset(a)},this)}});a.exports=c},function(a,b){var c,d=wp.media.controller.State,e=wp.media.view.l10n;c=d.extend({defaults:{id:"audio-details",toolbar:"audio-details",title:e.audioDetailsTitle,content:"audio-details",menu:"audio-details",router:!1,priority:60},initialize:function(a){this.media=a.media,d.prototype.initialize.apply(this,arguments)}}),a.exports=c},function(a,b){var c,d=wp.media.controller.State,e=wp.media.view.l10n;c=d.extend({defaults:{id:"video-details",toolbar:"video-details",title:e.videoDetailsTitle,content:"video-details",menu:"video-details",router:!1,priority:60},initialize:function(a){this.media=a.media,d.prototype.initialize.apply(this,arguments)}}),a.exports=c},function(a,b){var c,d=wp.media.view.MediaFrame.Select,e=wp.media.view.l10n;c=d.extend({defaults:{id:"media",url:"",menu:"media-details",content:"media-details",toolbar:"media-details",type:"link",priority:120},initialize:function(a){this.DetailsView=a.DetailsView,this.cancelText=a.cancelText,this.addText=a.addText,this.media=new wp.media.model.PostMedia(a.metadata),this.options.selection=new wp.media.model.Selection(this.media.attachment,{multiple:!1}),d.prototype.initialize.apply(this,arguments)},bindHandlers:function(){var a=this.defaults.menu;d.prototype.bindHandlers.apply(this,arguments),this.on("menu:create:"+a,this.createMenu,this),this.on("content:render:"+a,this.renderDetailsContent,this),this.on("menu:render:"+a,this.renderMenu,this),this.on("toolbar:render:"+a,this.renderDetailsToolbar,this)},renderDetailsContent:function(){var a=new this.DetailsView({controller:this,model:this.state().media,attachment:this.state().media.attachment}).render();this.content.set(a)},renderMenu:function(a){var b=this.lastState(),c=b&&b.id,d=this;a.set({cancel:{text:this.cancelText,priority:20,click:function(){c?d.setState(c):d.close()}},separateCancel:new wp.media.View({className:"separator",priority:40})})},setPrimaryButton:function(a,b){this.toolbar.set(new wp.media.view.Toolbar({controller:this,items:{button:{style:"primary",text:a,priority:80,click:function(){var a=this.controller;b.call(this,a,a.state()),a.setState(a.options.state),a.reset()}}}}))},renderDetailsToolbar:function(){this.setPrimaryButton(e.update,function(a,b){a.close(),b.trigger("update",a.media.toJSON())})},renderReplaceToolbar:function(){this.setPrimaryButton(e.replace,function(a,b){var c=b.get("selection").single();a.media.changeAttachment(c),b.trigger("replace",a.media.toJSON())})},renderAddSourceToolbar:function(){this.setPrimaryButton(this.addText,function(a,b){var c=b.get("selection").single();a.media.setSource(c),b.trigger("add-source",a.media.toJSON())})}}),a.exports=c},function(a,b){var c,d=wp.media.view.MediaFrame.MediaDetails,e=wp.media.controller.MediaLibrary,f=wp.media.view.l10n;c=d.extend({defaults:{id:"audio",url:"",menu:"audio-details",content:"audio-details",toolbar:"audio-details",type:"link",title:f.audioDetailsTitle,priority:120},initialize:function(a){a.DetailsView=wp.media.view.AudioDetails,a.cancelText=f.audioDetailsCancel,a.addText=f.audioAddSourceTitle,d.prototype.initialize.call(this,a)},bindHandlers:function(){d.prototype.bindHandlers.apply(this,arguments),this.on("toolbar:render:replace-audio",this.renderReplaceToolbar,this),this.on("toolbar:render:add-audio-source",this.renderAddSourceToolbar,this)},createStates:function(){this.states.add([new wp.media.controller.AudioDetails({media:this.media}),new e({type:"audio",id:"replace-audio",title:f.audioReplaceTitle,toolbar:"replace-audio",media:this.media,menu:"audio-details"}),new e({type:"audio",id:"add-audio-source",title:f.audioAddSourceTitle,toolbar:"add-audio-source",media:this.media,menu:!1})])}}),a.exports=c},function(a,b){var c,d=wp.media.view.MediaFrame.MediaDetails,e=wp.media.controller.MediaLibrary,f=wp.media.view.l10n;c=d.extend({defaults:{id:"video",url:"",menu:"video-details",content:"video-details",toolbar:"video-details",type:"link",title:f.videoDetailsTitle,priority:120},initialize:function(a){a.DetailsView=wp.media.view.VideoDetails,a.cancelText=f.videoDetailsCancel,a.addText=f.videoAddSourceTitle,d.prototype.initialize.call(this,a)},bindHandlers:function(){d.prototype.bindHandlers.apply(this,arguments),this.on("toolbar:render:replace-video",this.renderReplaceToolbar,this),this.on("toolbar:render:add-video-source",this.renderAddSourceToolbar,this),this.on("toolbar:render:select-poster-image",this.renderSelectPosterImageToolbar,this),this.on("toolbar:render:add-track",this.renderAddTrackToolbar,this)},createStates:function(){this.states.add([new wp.media.controller.VideoDetails({media:this.media}),new e({type:"video",id:"replace-video",title:f.videoReplaceTitle,toolbar:"replace-video",media:this.media,menu:"video-details"}),new e({type:"video",id:"add-video-source",title:f.videoAddSourceTitle,toolbar:"add-video-source",media:this.media,menu:!1}),new e({type:"image",id:"select-poster-image",title:f.videoSelectPosterImageTitle,toolbar:"select-poster-image",media:this.media,menu:"video-details"}),new e({type:"text",id:"add-track",title:f.videoAddTrackTitle,toolbar:"add-track",media:this.media,menu:"video-details"})])},renderSelectPosterImageToolbar:function(){this.setPrimaryButton(f.videoSelectPosterImageTitle,function(a,b){var c=[],d=b.get("selection").single();a.media.set("poster",d.get("url")),b.trigger("set-poster-image",a.media.toJSON()),_.each(wp.media.view.settings.embedExts,function(b){a.media.get(b)&&c.push(a.media.get(b))}),wp.ajax.send("set-attachment-thumbnail",{data:{urls:c,thumbnail_id:d.get("id")}})})},renderAddTrackToolbar:function(){this.setPrimaryButton(f.videoAddTrackTitle,function(a,b){var c=b.get("selection").single(),d=a.media.get("content");-1===d.indexOf(c.get("url"))&&(d+=[''].join(""),a.media.set("content",d)),b.trigger("add-track",a.media.toJSON())})}}),a.exports=c},function(a,b){var c,d=wp.media.view.Settings.AttachmentDisplay,e=jQuery;c=d.extend({initialize:function(){_.bindAll(this,"success"),this.players=[],this.listenTo(this.controller,"close",wp.media.mixin.unsetPlayers),this.on("ready",this.setPlayer),this.on("media:setting:remove",wp.media.mixin.unsetPlayers,this),this.on("media:setting:remove",this.render),this.on("media:setting:remove",this.setPlayer),d.prototype.initialize.apply(this,arguments)},events:function(){return _.extend({"click .remove-setting":"removeSetting","change .content-track":"setTracks","click .remove-track":"setTracks","click .add-media-source":"addSource"},d.prototype.events)},prepare:function(){return _.defaults({model:this.model.toJSON()},this.options)},removeSetting:function(a){var b,c=e(a.currentTarget).parent();b=c.find("input").data("setting"),b&&(this.model.unset(b),this.trigger("media:setting:remove",this)),c.remove()},setTracks:function(){var a="";_.each(this.$(".content-track"),function(b){a+=e(b).val()}),this.model.set("content",a),this.trigger("media:setting:remove",this)},addSource:function(a){this.controller.lastMime=e(a.currentTarget).data("mime"),this.controller.setState("add-"+this.controller.defaults.id+"-source")},loadPlayer:function(){this.players.push(new MediaElementPlayer(this.media,this.settings)),this.scriptXhr=!1},setPlayer:function(){var a;this.players.length||!this.media||this.scriptXhr||(a=this.model.get("src"),a&&a.indexOf("vimeo")>-1&&!("Vimeo"in window)?this.scriptXhr=e.getScript("https://player.vimeo.com/api/player.js",_.bind(this.loadPlayer,this)):this.loadPlayer())},setMedia:function(){return this},success:function(a){var b=a.attributes.autoplay&&"false"!==a.attributes.autoplay;"flash"===a.pluginType&&b&&a.addEventListener("canplay",function(){a.play()},!1),this.mejs=a},render:function(){return d.prototype.render.apply(this,arguments),setTimeout(_.bind(function(){this.scrollToTop()},this),10),this.settings=_.defaults({success:this.success},wp.media.mixin.mejsSettings),this.setMedia()},scrollToTop:function(){this.$(".embed-media-settings").scrollTop(0)}},{instances:0,prepareSrc:function(a){var b=c.instances++;return _.each(e(a).find("source"),function(a){a.src=[a.src,a.src.indexOf("?")>-1?"&":"?","_=",b].join("")}),a}}),a.exports=c},function(a,b){var c,d=wp.media.view.MediaDetails;c=d.extend({className:"audio-details",template:wp.template("audio-details"),setMedia:function(){var a=this.$(".wp-audio-shortcode");return a.find("source").length?(a.is(":hidden")&&a.show(),this.media=d.prepareSrc(a.get(0))):(a.hide(),this.media=!1),this}}),a.exports=c},function(a,b){var c,d=wp.media.view.MediaDetails;c=d.extend({className:"video-details",template:wp.template("video-details"),setMedia:function(){var a=this.$(".wp-video-shortcode");return a.find("source").length?(a.is(":hidden")&&a.show(),a.hasClass("youtube-video")||a.hasClass("vimeo-video")?this.media=a.get(0):this.media=d.prepareSrc(a.get(0))):(a.hide(),this.media=!1),this}}),a.exports=c}]); \ No newline at end of file diff --git a/wp-includes/js/media-grid.js b/wp-includes/js/media-grid.js index cac4e27f6d..9a32ffe543 100644 --- a/wp-includes/js/media-grid.js +++ b/wp-includes/js/media-grid.js @@ -718,8 +718,9 @@ EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAtta // Completely destroy the modal DOM element when closing it. this.modal.on( 'close', _.bind( function() { - $( 'body' ).off( 'keydown.media-modal' ); /* remove the keydown event */ - // Restore the original focus item if possible + // Remove the keydown event. + $( 'body' ).off( 'keydown.media-modal' ); + // Move focus back to the original item in the grid if possible. $( 'li.attachment[data-id="' + this.model.get( 'id' ) +'"]' ).focus(); this.resetRoute(); }, this ) ); @@ -800,8 +801,8 @@ EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAtta }, toggleNav: function() { - this.$('.left').toggleClass( 'disabled', ! this.hasPrevious() ); - this.$('.right').toggleClass( 'disabled', ! this.hasNext() ); + this.$( '.left' ).prop( 'disabled', ! this.hasPrevious() ); + this.$( '.right' ).prop( 'disabled', ! this.hasNext() ); }, /** @@ -831,8 +832,10 @@ EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAtta if ( ! this.hasPrevious() ) { return; } + this.trigger( 'refresh', this.library.at( this.getCurrentIndex() - 1 ) ); - this.$( '.left' ).focus(); + // Move focus to the Previous button. When there are no more items, to the Next button. + this.focusNavButton( this.hasPrevious() ? '.left' : '.right' ); }, /** @@ -842,8 +845,21 @@ EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAtta if ( ! this.hasNext() ) { return; } + this.trigger( 'refresh', this.library.at( this.getCurrentIndex() + 1 ) ); - this.$( '.right' ).focus(); + // Move focus to the Next button. When there are no more items, to the Previous button. + this.focusNavButton( this.hasNext() ? '.right' : '.left' ); + }, + + /** + * Set focus to the navigation buttons depending on the browsing direction. + * + * @since 5.3.0 + * + * @param {string} which A CSS selector to target the button to focus. + */ + focusNavButton: function( which ) { + $( which ).focus(); }, getCurrentIndex: function() { diff --git a/wp-includes/js/media-grid.min.js b/wp-includes/js/media-grid.min.js index 69ecd225c7..e7b02857f8 100644 --- a/wp-includes/js/media-grid.min.js +++ b/wp-includes/js/media-grid.min.js @@ -1 +1 @@ -!function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{enumerable:!0,get:d})},b.r=function(a){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},b.t=function(a,c){if(1&c&&(a=b(a)),8&c)return a;if(4&c&&"object"==typeof a&&a&&a.__esModule)return a;var d=Object.create(null);if(b.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:a}),2&c&&"string"!=typeof a)for(var e in a)b.d(d,e,function(b){return a[b]}.bind(null,e));return d},b.n=function(a){var c=a&&a.__esModule?function(){return a["default"]}:function(){return a};return b.d(c,"a",c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p="",b(b.s=11)}([,,,,,,,,,,,function(a,b,c){a.exports=c(12)},function(a,b,c){var d=wp.media;d.controller.EditAttachmentMetadata=c(13),d.view.MediaFrame.Manage=c(14),d.view.Attachment.Details.TwoColumn=c(15),d.view.MediaFrame.Manage.Router=c(16),d.view.EditImage.Details=c(17),d.view.MediaFrame.EditAttachments=c(18),d.view.SelectModeToggleButton=c(19),d.view.DeleteSelectedButton=c(20),d.view.DeleteSelectedPermanentlyButton=c(21)},function(a,b){var c,d=wp.media.view.l10n;c=wp.media.controller.State.extend({defaults:{id:"edit-attachment",title:d.attachmentDetails,content:"edit-metadata",menu:!1,toolbar:!1,router:!1}}),a.exports=c},function(a,b){var c,d=wp.media.view.MediaFrame,e=wp.media.controller.Library,f=Backbone.$;c=d.extend({initialize:function(){_.defaults(this.options,{title:"",modal:!1,selection:[],library:{},multiple:"add",state:"library",uploader:!0,mode:["grid","edit"]}),this.$body=f(document.body),this.$window=f(window),this.$adminBar=f("#wpadminbar"),this.$uploaderToggler=f(".page-title-action").attr("aria-expanded","false").on("click",_.bind(this.addNewClickHandler,this)),this.$window.on("scroll resize",_.debounce(_.bind(this.fixPosition,this),15)),this.$el.addClass("wp-core-ui"),!wp.Uploader.limitExceeded&&wp.Uploader.browser.supported||(this.options.uploader=!1),this.options.uploader&&(this.uploader=new wp.media.view.UploaderWindow({controller:this,uploader:{dropzone:document.body,container:document.body}}).render(),this.uploader.ready(),f("body").append(this.uploader.el),this.options.uploader=!1),this.gridRouter=new wp.media.view.MediaFrame.Manage.Router,d.prototype.initialize.apply(this,arguments),this.$el.appendTo(this.options.container),this.createStates(),this.bindRegionModeHandlers(),this.render(),this.bindSearchHandler(),wp.media.frames.browse=this},bindSearchHandler:function(){var a=this.$("#media-search-input"),b=this.browserView.toolbar.get("search").$el,c=this.$(".view-list"),d=_.throttle(function(a){var b=f(a.currentTarget).val(),c="";b&&(c+="?search="+b,this.gridRouter.navigate(this.gridRouter.baseUrl(c),{replace:!0}))},1e3);a.on("input",_.bind(d,this)),this.gridRouter.on("route:search",function(){var a=window.location.href;a.indexOf("mode=")>-1?a=a.replace(/mode=[^&]+/g,"mode=list"):a+=a.indexOf("?")>-1?"&mode=list":"?mode=list",a=a.replace("search=","s="),c.prop("href",a)}).on("route:reset",function(){b.val("").trigger("input")})},createStates:function(){var a=this.options;this.options.states||this.states.add([new e({library:wp.media.query(a.library),multiple:a.multiple,title:a.title,content:"browse",toolbar:"select",contentUserSetting:!1,filterable:"all",autoSelect:!1})])},bindRegionModeHandlers:function(){this.on("content:create:browse",this.browseContent,this),this.on("edit:attachment",this.openEditAttachmentModal,this),this.on("select:activate",this.bindKeydown,this),this.on("select:deactivate",this.unbindKeydown,this)},handleKeydown:function(a){27===a.which&&(a.preventDefault(),this.deactivateMode("select").activateMode("edit"))},bindKeydown:function(){this.$body.on("keydown.select",_.bind(this.handleKeydown,this))},unbindKeydown:function(){this.$body.off("keydown.select")},fixPosition:function(){var a,b;this.isModeActive("select")&&(a=this.$(".attachments-browser"),b=a.find(".media-toolbar"),a.offset().top+16-1},keyEvent:function(a){("INPUT"!==a.target.nodeName&&"TEXTAREA"!==a.target.nodeName||a.target.readOnly||a.target.disabled)&&(39===a.keyCode&&this.nextMediaItem(),37===a.keyCode&&this.previousMediaItem())},resetRoute:function(){var a=this.controller.browserView.toolbar.get("search").$el.val(),b=""!==a?"?search="+a:"";this.gridRouter.navigate(this.gridRouter.baseUrl(b),{replace:!0})}}),a.exports=c},function(a,b){var c,d=wp.media.view.Button,e=wp.media.view.l10n;c=d.extend({initialize:function(){_.defaults(this.options,{size:""}),d.prototype.initialize.apply(this,arguments),this.controller.on("select:activate select:deactivate",this.toggleBulkEditHandler,this),this.controller.on("selection:action:done",this.back,this)},back:function(){this.controller.deactivateMode("select").activateMode("edit")},click:function(){d.prototype.click.apply(this,arguments),this.controller.isModeActive("select")?this.back():this.controller.deactivateMode("edit").activateMode("select")},render:function(){return d.prototype.render.apply(this,arguments),this.$el.addClass("select-mode-toggle-button"),this},toggleBulkEditHandler:function(){var a,b=this.controller.content.get().toolbar;a=b.$(".media-toolbar-secondary > *, .media-toolbar-primary > *"),this.controller.isModeActive("select")?(this.model.set({size:"large",text:e.cancel}),a.not(".spinner, .media-button").hide(),this.$el.show(),b.$(".delete-selected-button").removeClass("hidden")):(this.model.set({size:"",text:e.bulkSelect}),this.controller.content.get().$el.removeClass("fixed"),b.$el.css("width",""),b.$(".delete-selected-button").addClass("hidden"),a.not(".media-button").show(),this.controller.state().get("selection").reset())}}),a.exports=c},function(a,b){var c,d=wp.media.view.Button,e=wp.media.view.l10n;c=d.extend({initialize:function(){d.prototype.initialize.apply(this,arguments),this.options.filters&&this.options.filters.model.on("change",this.filterChange,this),this.controller.on("selection:toggle",this.toggleDisabled,this)},filterChange:function(a){"trash"===a.get("status")?this.model.set("text",e.restoreSelected):wp.media.view.settings.mediaTrash?this.model.set("text",e.trashSelected):this.model.set("text",e.deletePermanently)},toggleDisabled:function(){this.model.set("disabled",!this.controller.state().get("selection").length)},render:function(){return d.prototype.render.apply(this,arguments),this.controller.isModeActive("select")?this.$el.addClass("delete-selected-button"):this.$el.addClass("delete-selected-button hidden"),this.toggleDisabled(),this}}),a.exports=c},function(a,b){var c,d=wp.media.view.Button,e=wp.media.view.DeleteSelectedButton;c=e.extend({initialize:function(){e.prototype.initialize.apply(this,arguments),this.controller.on("select:activate",this.selectActivate,this),this.controller.on("select:deactivate",this.selectDeactivate,this)},filterChange:function(a){this.canShow="trash"===a.get("status")},selectActivate:function(){this.toggleDisabled(),this.$el.toggleClass("hidden",!this.canShow)},selectDeactivate:function(){this.toggleDisabled(),this.$el.addClass("hidden")},render:function(){return d.prototype.render.apply(this,arguments),this.selectActivate(),this}}),a.exports=c}]); \ No newline at end of file +!function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{enumerable:!0,get:d})},b.r=function(a){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},b.t=function(a,c){if(1&c&&(a=b(a)),8&c)return a;if(4&c&&"object"==typeof a&&a&&a.__esModule)return a;var d=Object.create(null);if(b.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:a}),2&c&&"string"!=typeof a)for(var e in a)b.d(d,e,function(b){return a[b]}.bind(null,e));return d},b.n=function(a){var c=a&&a.__esModule?function(){return a["default"]}:function(){return a};return b.d(c,"a",c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p="",b(b.s=11)}([,,,,,,,,,,,function(a,b,c){a.exports=c(12)},function(a,b,c){var d=wp.media;d.controller.EditAttachmentMetadata=c(13),d.view.MediaFrame.Manage=c(14),d.view.Attachment.Details.TwoColumn=c(15),d.view.MediaFrame.Manage.Router=c(16),d.view.EditImage.Details=c(17),d.view.MediaFrame.EditAttachments=c(18),d.view.SelectModeToggleButton=c(19),d.view.DeleteSelectedButton=c(20),d.view.DeleteSelectedPermanentlyButton=c(21)},function(a,b){var c,d=wp.media.view.l10n;c=wp.media.controller.State.extend({defaults:{id:"edit-attachment",title:d.attachmentDetails,content:"edit-metadata",menu:!1,toolbar:!1,router:!1}}),a.exports=c},function(a,b){var c,d=wp.media.view.MediaFrame,e=wp.media.controller.Library,f=Backbone.$;c=d.extend({initialize:function(){_.defaults(this.options,{title:"",modal:!1,selection:[],library:{},multiple:"add",state:"library",uploader:!0,mode:["grid","edit"]}),this.$body=f(document.body),this.$window=f(window),this.$adminBar=f("#wpadminbar"),this.$uploaderToggler=f(".page-title-action").attr("aria-expanded","false").on("click",_.bind(this.addNewClickHandler,this)),this.$window.on("scroll resize",_.debounce(_.bind(this.fixPosition,this),15)),this.$el.addClass("wp-core-ui"),!wp.Uploader.limitExceeded&&wp.Uploader.browser.supported||(this.options.uploader=!1),this.options.uploader&&(this.uploader=new wp.media.view.UploaderWindow({controller:this,uploader:{dropzone:document.body,container:document.body}}).render(),this.uploader.ready(),f("body").append(this.uploader.el),this.options.uploader=!1),this.gridRouter=new wp.media.view.MediaFrame.Manage.Router,d.prototype.initialize.apply(this,arguments),this.$el.appendTo(this.options.container),this.createStates(),this.bindRegionModeHandlers(),this.render(),this.bindSearchHandler(),wp.media.frames.browse=this},bindSearchHandler:function(){var a=this.$("#media-search-input"),b=this.browserView.toolbar.get("search").$el,c=this.$(".view-list"),d=_.throttle(function(a){var b=f(a.currentTarget).val(),c="";b&&(c+="?search="+b,this.gridRouter.navigate(this.gridRouter.baseUrl(c),{replace:!0}))},1e3);a.on("input",_.bind(d,this)),this.gridRouter.on("route:search",function(){var a=window.location.href;a.indexOf("mode=")>-1?a=a.replace(/mode=[^&]+/g,"mode=list"):a+=a.indexOf("?")>-1?"&mode=list":"?mode=list",a=a.replace("search=","s="),c.prop("href",a)}).on("route:reset",function(){b.val("").trigger("input")})},createStates:function(){var a=this.options;this.options.states||this.states.add([new e({library:wp.media.query(a.library),multiple:a.multiple,title:a.title,content:"browse",toolbar:"select",contentUserSetting:!1,filterable:"all",autoSelect:!1})])},bindRegionModeHandlers:function(){this.on("content:create:browse",this.browseContent,this),this.on("edit:attachment",this.openEditAttachmentModal,this),this.on("select:activate",this.bindKeydown,this),this.on("select:deactivate",this.unbindKeydown,this)},handleKeydown:function(a){27===a.which&&(a.preventDefault(),this.deactivateMode("select").activateMode("edit"))},bindKeydown:function(){this.$body.on("keydown.select",_.bind(this.handleKeydown,this))},unbindKeydown:function(){this.$body.off("keydown.select")},fixPosition:function(){var a,b;this.isModeActive("select")&&(a=this.$(".attachments-browser"),b=a.find(".media-toolbar"),a.offset().top+16-1},keyEvent:function(a){("INPUT"!==a.target.nodeName&&"TEXTAREA"!==a.target.nodeName||a.target.readOnly||a.target.disabled)&&(39===a.keyCode&&this.nextMediaItem(),37===a.keyCode&&this.previousMediaItem())},resetRoute:function(){var a=this.controller.browserView.toolbar.get("search").$el.val(),b=""!==a?"?search="+a:"";this.gridRouter.navigate(this.gridRouter.baseUrl(b),{replace:!0})}}),a.exports=c},function(a,b){var c,d=wp.media.view.Button,e=wp.media.view.l10n;c=d.extend({initialize:function(){_.defaults(this.options,{size:""}),d.prototype.initialize.apply(this,arguments),this.controller.on("select:activate select:deactivate",this.toggleBulkEditHandler,this),this.controller.on("selection:action:done",this.back,this)},back:function(){this.controller.deactivateMode("select").activateMode("edit")},click:function(){d.prototype.click.apply(this,arguments),this.controller.isModeActive("select")?this.back():this.controller.deactivateMode("edit").activateMode("select")},render:function(){return d.prototype.render.apply(this,arguments),this.$el.addClass("select-mode-toggle-button"),this},toggleBulkEditHandler:function(){var a,b=this.controller.content.get().toolbar;a=b.$(".media-toolbar-secondary > *, .media-toolbar-primary > *"),this.controller.isModeActive("select")?(this.model.set({size:"large",text:e.cancel}),a.not(".spinner, .media-button").hide(),this.$el.show(),b.$(".delete-selected-button").removeClass("hidden")):(this.model.set({size:"",text:e.bulkSelect}),this.controller.content.get().$el.removeClass("fixed"),b.$el.css("width",""),b.$(".delete-selected-button").addClass("hidden"),a.not(".media-button").show(),this.controller.state().get("selection").reset())}}),a.exports=c},function(a,b){var c,d=wp.media.view.Button,e=wp.media.view.l10n;c=d.extend({initialize:function(){d.prototype.initialize.apply(this,arguments),this.options.filters&&this.options.filters.model.on("change",this.filterChange,this),this.controller.on("selection:toggle",this.toggleDisabled,this)},filterChange:function(a){"trash"===a.get("status")?this.model.set("text",e.restoreSelected):wp.media.view.settings.mediaTrash?this.model.set("text",e.trashSelected):this.model.set("text",e.deletePermanently)},toggleDisabled:function(){this.model.set("disabled",!this.controller.state().get("selection").length)},render:function(){return d.prototype.render.apply(this,arguments),this.controller.isModeActive("select")?this.$el.addClass("delete-selected-button"):this.$el.addClass("delete-selected-button hidden"),this.toggleDisabled(),this}}),a.exports=c},function(a,b){var c,d=wp.media.view.Button,e=wp.media.view.DeleteSelectedButton;c=e.extend({initialize:function(){e.prototype.initialize.apply(this,arguments),this.controller.on("select:activate",this.selectActivate,this),this.controller.on("select:deactivate",this.selectDeactivate,this)},filterChange:function(a){this.canShow="trash"===a.get("status")},selectActivate:function(){this.toggleDisabled(),this.$el.toggleClass("hidden",!this.canShow)},selectDeactivate:function(){this.toggleDisabled(),this.$el.addClass("hidden")},render:function(){return d.prototype.render.apply(this,arguments),this.selectActivate(),this}}),a.exports=c}]); \ No newline at end of file diff --git a/wp-includes/js/media-views.js b/wp-includes/js/media-views.js index 3a084fbabf..d1353e9f72 100644 --- a/wp-includes/js/media-views.js +++ b/wp-includes/js/media-views.js @@ -3655,8 +3655,7 @@ Post = Select.extend(/** @lends wp.media.view.MediaFrame.Post.prototype */{ frame.close(); } - // Keep focus inside media modal - // after canceling a gallery + // Move focus to the modal after canceling a Gallery. this.controller.modal.focusManager.focus(); } }, @@ -3682,6 +3681,9 @@ Post = Select.extend(/** @lends wp.media.view.MediaFrame.Post.prototype */{ } else { frame.close(); } + + // Move focus to the modal after canceling an Audio Playlist. + this.controller.modal.focusManager.focus(); } }, separateCancel: new wp.media.View({ @@ -3706,6 +3708,9 @@ Post = Select.extend(/** @lends wp.media.view.MediaFrame.Post.prototype */{ } else { frame.close(); } + + // Move focus to the modal after canceling a Video Playlist. + this.controller.modal.focusManager.focus(); } }, separateCancel: new wp.media.View({ @@ -3723,10 +3728,6 @@ Post = Select.extend(/** @lends wp.media.view.MediaFrame.Post.prototype */{ }).render(); this.content.set( view ); - - if ( ! wp.media.isTouchDevice ) { - view.url.focus(); - } }, editSelectionContent: function() { @@ -3848,10 +3849,10 @@ Post = Select.extend(/** @lends wp.media.view.MediaFrame.Post.prototype */{ multiple: true }) ); - this.controller.setState('gallery-edit'); + // Jump to Edit Gallery view. + this.controller.setState( 'gallery-edit' ); - // Keep focus inside media modal - // after jumping to gallery view + // Move focus to the modal after jumping to Edit Gallery view. this.controller.modal.focusManager.focus(); } }); @@ -3878,10 +3879,10 @@ Post = Select.extend(/** @lends wp.media.view.MediaFrame.Post.prototype */{ multiple: true }) ); - this.controller.setState('playlist-edit'); + // Jump to Edit Audio Playlist view. + this.controller.setState( 'playlist-edit' ); - // Keep focus inside media modal - // after jumping to playlist view + // Move focus to the modal after jumping to Edit Audio Playlist view. this.controller.modal.focusManager.focus(); } }); @@ -3908,10 +3909,10 @@ Post = Select.extend(/** @lends wp.media.view.MediaFrame.Post.prototype */{ multiple: true }) ); - this.controller.setState('video-playlist-edit'); + // Jump to Edit Video Playlist view. + this.controller.setState( 'video-playlist-edit' ); - // Keep focus inside media modal - // after jumping to video playlist view + // Move focus to the modal after jumping to Edit Video Playlist view. this.controller.modal.focusManager.focus(); } }); @@ -3981,6 +3982,8 @@ Post = Select.extend(/** @lends wp.media.view.MediaFrame.Post.prototype */{ edit.get('library').add( state.get('selection').models ); state.trigger('reset'); controller.setState('gallery-edit'); + // Move focus to the modal when jumping back from Add to Gallery to Edit Gallery view. + this.controller.modal.focusManager.focus(); } } } @@ -4038,6 +4041,8 @@ Post = Select.extend(/** @lends wp.media.view.MediaFrame.Post.prototype */{ edit.get('library').add( state.get('selection').models ); state.trigger('reset'); controller.setState('playlist-edit'); + // Move focus to the modal when jumping back from Add to Audio Playlist to Edit Audio Playlist view. + this.controller.modal.focusManager.focus(); } } } @@ -4092,6 +4097,8 @@ Post = Select.extend(/** @lends wp.media.view.MediaFrame.Post.prototype */{ edit.get('library').add( state.get('selection').models ); state.trigger('reset'); controller.setState('video-playlist-edit'); + // Move focus to the modal when jumping back from Add to Video Playlist to Edit Video Playlist view. + this.controller.modal.focusManager.focus(); } } } @@ -4427,10 +4434,12 @@ Modal = wp.media.View.extend(/** @lends wp.media.view.Modal.prototype */{ // Hide modal and remove restricted media modal tab focus once it's closed this.$el.hide().undelegate( 'keydown' ); - // Put focus back in useful location once modal is closed. + // Move focus back in useful location once modal is closed. if ( null !== this.clickedOpenerEl ) { + // Move focus back to the element that opened the modal. this.clickedOpenerEl.focus(); } else { + // Fallback to the admin page main element. $( '#wpbody-content' ) .attr( 'tabindex', '-1' ) .focus(); @@ -4519,11 +4528,20 @@ var FocusManager = wp.media.View.extend(/** @lends wp.media.view.FocusManager.pr }, /** - * Moves focus to the first visible menu item in the modal. + * Gets all the tabbable elements. + */ + getTabbables: function() { + // Skip the file input added by Plupload. + return this.$( ':tabbable' ).not( '.moxie-shim input[type="file"]' ); + }, + + /** + * Moves focus to the modal dialog. */ focus: function() { - this.$( '.media-menu-item' ).filter( ':visible' ).first().focus(); + this.$( '.media-modal' ).focus(); }, + /** * @param {Object} event */ @@ -4535,8 +4553,7 @@ var FocusManager = wp.media.View.extend(/** @lends wp.media.view.FocusManager.pr return; } - // Skip the file input added by Plupload. - tabbables = this.$( ':tabbable' ).not( '.moxie-shim input[type="file"]' ); + tabbables = this.getTabbables(); // Keep tab focus within media modal while it's open if ( tabbables.last()[0] === event.target && ! event.shiftKey ) { @@ -5177,7 +5194,7 @@ UploaderStatus = View.extend(/** @lends wp.media.view.UploaderStatus.prototype * _.invoke( errors, 'remove' ); } wp.Uploader.errors.reset(); - // Keep focus within the modal after the dismiss button gets removed from the DOM. + // Move focus to the modal after the dismiss button gets removed from the DOM. this.controller.modal.focusManager.focus(); } }); @@ -5745,8 +5762,7 @@ module.exports = PriorityList; /* 68 */ /***/ (function(module, exports) { -var $ = jQuery, - MenuItem; +var MenuItem; /** * wp.media.view.MenuItem @@ -5784,12 +5800,6 @@ MenuItem = wp.media.View.extend(/** @lends wp.media.view.MenuItem.prototype */{ } else { this.click(); } - - // When selecting a tab along the left side, - // focus should be transferred into the main panel - if ( ! wp.media.isTouchDevice ) { - $('.media-frame-content input').first().focus(); - } }, click: function() { @@ -6759,7 +6769,7 @@ Attachments = View.extend(/** @lends wp.media.view.Attachments.prototype */{ this.collection.on( 'reset', this.render, this ); - this.listenTo( this.controller, 'library:selection:add', this.attachmentFocus ); + this.controller.on( 'library:selection:add', this.attachmentFocus, this ); // Throttle the scroll handler and bind this. this.scroll = _.chain( this.scroll ).bind( this ).throttle( this.options.refreshSensitivity ).value(); @@ -6807,12 +6817,28 @@ Attachments = View.extend(/** @lends wp.media.view.Attachments.prototype */{ * @returns {void} */ attachmentFocus: function() { - this.$( 'li:first' ).focus(); + /* + * @todo: when uploading new attachments, this tries to move focus to the + * attachmentz grid. Actually, a progress bar gets initially displayed + * and then updated when uploading completes, so focus is lost. + * Additionally: this view is used for both the attachments list and the + * list of selected attachments in the bottom media toolbar. Thus, when + * uploading attachments, it is called twice and returns two different `this`. + * `this.columns` is truthy within the modal. + */ + if ( this.columns ) { + // Move focus to the grid list within the modal. + this.$el.focus(); + } }, /** * Restores focus to the selected item in the collection. * + * Moves focus back to the first selected attachment in the grid. Used when + * tabbing backwards from the attachment details sidebar. + * See media.view.AttachmentsBrowser. + * * @since 4.0.0 * * @returns {void} @@ -7584,6 +7610,7 @@ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.pro }, editSelection: function( modal ) { + // When editing a selection, move focus to the "Return to library" button. modal.$( '.media-button-backToLibrary' ).focus(); }, @@ -8066,8 +8093,7 @@ Selection = wp.media.View.extend(/** @lends wp.media.view.Selection.prototype */ event.preventDefault(); this.collection.reset(); - // Keep focus inside media modal - // after clear link is selected + // Move focus to the modal. this.controller.modal.focusManager.focus(); } }); @@ -8380,11 +8406,6 @@ AttachmentDisplay = Settings.extend(/** @lends wp.media.view.Settings.Attachment } $input.closest( '.setting' ).removeClass( 'hidden' ); - - // If the input is visible, focus and select its contents. - if ( ! wp.media.isTouchDevice && $input.is(':visible') ) { - $input.focus()[0].select(); - } } }); @@ -8443,6 +8464,7 @@ module.exports = Playlist; var Attachment = wp.media.view.Attachment, l10n = wp.media.view.l10n, + $ = jQuery, Details; /** @@ -8488,35 +8510,98 @@ Details = Attachment.extend(/** @lends wp.media.view.Attachment.Details.prototyp Attachment.prototype.initialize.apply( this, arguments ); }, + /** + * Gets the focusable elements to move focus to. + * + * @since 5.3.0 + */ + getFocusableElements: function() { + var editedAttachment = $( 'li[data-id="' + this.model.id + '"]' ); + + this.previousAttachment = editedAttachment.prev(); + this.nextAttachment = editedAttachment.next(); + }, + + /** + * Moves focus to the previous or next attachment in the grid. + * Fallbacks to the upload button or media frame when there are no attachments. + * + * @since 5.3.0 + */ + moveFocus: function() { + if ( this.previousAttachment.length ) { + this.previousAttachment.focus(); + return; + } + + if ( this.nextAttachment.length ) { + this.nextAttachment.focus(); + return; + } + + // Fallback: move focus to the "Select Files" button in the media modal. + if ( this.controller.uploader && this.controller.uploader.$browser ) { + this.controller.uploader.$browser.focus(); + return; + } + + // Last fallback. + this.moveFocusToLastFallback(); + }, + + /** + * Moves focus to the media frame as last fallback. + * + * @since 5.3.0 + */ + moveFocusToLastFallback: function() { + // Last fallback: make the frame focusable and move focus to it. + $( '.media-frame' ) + .attr( 'tabindex', '-1' ) + .focus(); + }, + /** * @param {Object} event */ deleteAttachment: function( event ) { event.preventDefault(); + this.getFocusableElements(); + if ( window.confirm( l10n.warnDelete ) ) { this.model.destroy(); - // Keep focus inside media modal - // after image is deleted - this.controller.modal.focusManager.focus(); + this.moveFocus(); } }, /** * @param {Object} event */ trashAttachment: function( event ) { - var library = this.controller.library; + var library = this.controller.library, + self = this; event.preventDefault(); + this.getFocusableElements(); + + // When in the Media Library and the Media trash is enabled. if ( wp.media.view.settings.mediaTrash && 'edit-metadata' === this.controller.content.mode() ) { this.model.set( 'status', 'trash' ); this.model.save().done( function() { library._requery( true ); + /* + * @todo: We need to move focus back to the previous, next, or first + * attachment but the library gets re-queried and refreshed. Thus, + * the references to the previous attachments are lost. We need an + * alternate method. + */ + self.moveFocusToLastFallback(); } ); - } else { + } else { this.model.destroy(); + this.moveFocus(); } }, /** @@ -8546,8 +8631,8 @@ Details = Attachment.extend(/** @lends wp.media.view.Attachment.Details.prototyp } }, /** - * When reverse tabbing(shift+tab) out of the right details panel, deliver - * the focus to the item in the list that was being edited. + * When reverse tabbing (shift+tab) out of the right details panel, + * move focus to the item that was being edited in the attachments list. * * @param {Object} event */ @@ -8556,11 +8641,6 @@ Details = Attachment.extend(/** @lends wp.media.view.Attachment.Details.prototyp this.controller.trigger( 'attachment:details:shift-tab', event ); return false; } - - if ( 37 === event.keyCode || 38 === event.keyCode || 39 === event.keyCode || 40 === event.keyCode ) { - this.controller.trigger( 'attachment:keydown:arrow', event ); - return; - } } }); @@ -8852,24 +8932,8 @@ EmbedUrl = View.extend(/** @lends wp.media.view.EmbedUrl.prototype */{ return this; }, - ready: function() { - if ( ! wp.media.isTouchDevice ) { - this.focus(); - } - }, - url: function( event ) { this.model.set( 'url', $.trim( event.target.value ) ); - }, - - /** - * If the input is visible, focus and select its contents. - */ - focus: function() { - var $input = this.$input; - if ( $input.is(':visible') ) { - $input.focus()[0].select(); - } } }); @@ -9095,7 +9159,7 @@ ImageDetails = AttachmentDisplay.extend(/** @lends wp.media.view.ImageDetails.pr }, postRender: function() { - setTimeout( _.bind( this.resetFocus, this ), 10 ); + setTimeout( _.bind( this.scrollToTop, this ), 10 ); this.toggleLinkSettings(); if ( window.getUserSetting( 'advImgDetails' ) === 'show' ) { this.toggleAdvanced( true ); @@ -9103,8 +9167,7 @@ ImageDetails = AttachmentDisplay.extend(/** @lends wp.media.view.ImageDetails.pr this.trigger( 'post-render' ); }, - resetFocus: function() { - this.$( '.link-to-custom' ).blur(); + scrollToTop: function() { this.$( '.embed-media-settings' ).scrollTop( 0 ); }, @@ -9436,12 +9499,7 @@ EditImage = View.extend(/** @lends wp.media.view.EditImage.prototype */{ }, loadEditor: function() { - var dfd = this.editor.open( this.model.get('id'), this.model.get('nonces').edit, this ); - dfd.done( _.bind( this.focus, this ) ); - }, - - focus: function() { - this.$( '.imgedit-submit .button' ).eq( 0 ).focus(); + this.editor.open( this.model.get( 'id' ), this.model.get( 'nonces' ).edit, this ); }, back: function() { diff --git a/wp-includes/js/media-views.min.js b/wp-includes/js/media-views.min.js index f7e0848496..f7220e7728 100644 --- a/wp-includes/js/media-views.min.js +++ b/wp-includes/js/media-views.min.js @@ -1,4 +1,4 @@ !function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={i:d,l:!1,exports:{}};return a[d].call(e.exports,e,e.exports,b),e.l=!0,e.exports}var c={};return b.m=a,b.c=c,b.d=function(a,c,d){b.o(a,c)||Object.defineProperty(a,c,{enumerable:!0,get:d})},b.r=function(a){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},b.t=function(a,c){if(1&c&&(a=b(a)),8&c)return a;if(4&c&&"object"==typeof a&&a&&a.__esModule)return a;var d=Object.create(null);if(b.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:a}),2&c&&"string"!=typeof a)for(var e in a)b.d(d,e,function(b){return a[b]}.bind(null,e));return d},b.n=function(a){var c=a&&a.__esModule?function(){return a["default"]}:function(){return a};return b.d(c,"a",c),c},b.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)},b.p="",b(b.s=29)}(Array(29).concat([function(a,b,c){a.exports=c(30)},function(a,b,c){var d,e=wp.media,f=jQuery;e.isTouchDevice="ontouchend"in document,d=e.view.l10n=window._wpMediaViewsL10n||{},e.view.settings=d.settings||{},delete d.settings,e.model.settings.post=e.view.settings.post,f.support.transition=function(){var a,b=document.documentElement.style,c={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};return a=_.find(_.keys(c),function(a){return!_.isUndefined(b[a])}),a&&{end:c[a]}}(),e.events=_.extend({},Backbone.Events),e.transition=function(a,b){var c=f.Deferred();return b=b||2e3,f.support.transition?(a instanceof f||(a=f(a)),a.first().one(f.support.transition.end,c.resolve),_.delay(c.resolve,b)):c.resolve(),c.promise()},e.controller.Region=c(31),e.controller.StateMachine=c(32),e.controller.State=c(33),e.selectionSync=c(34),e.controller.Library=c(35),e.controller.ImageDetails=c(36),e.controller.GalleryEdit=c(37),e.controller.GalleryAdd=c(38),e.controller.CollectionEdit=c(39),e.controller.CollectionAdd=c(40),e.controller.FeaturedImage=c(41),e.controller.ReplaceImage=c(42),e.controller.EditImage=c(43),e.controller.MediaLibrary=c(44),e.controller.Embed=c(45),e.controller.Cropper=c(46),e.controller.CustomizeImageCropper=c(47),e.controller.SiteIconCropper=c(48),e.View=c(49),e.view.Frame=c(50),e.view.MediaFrame=c(51),e.view.MediaFrame.Select=c(52),e.view.MediaFrame.Post=c(53),e.view.MediaFrame.ImageDetails=c(54),e.view.Modal=c(55),e.view.FocusManager=c(56),e.view.UploaderWindow=c(57),e.view.EditorUploader=c(58),e.view.UploaderInline=c(59),e.view.UploaderStatus=c(60),e.view.UploaderStatusError=c(61),e.view.Toolbar=c(62),e.view.Toolbar.Select=c(63),e.view.Toolbar.Embed=c(64),e.view.Button=c(65),e.view.ButtonGroup=c(66),e.view.PriorityList=c(67),e.view.MenuItem=c(68),e.view.Menu=c(69),e.view.RouterItem=c(70),e.view.Router=c(71),e.view.Sidebar=c(72),e.view.Attachment=c(73),e.view.Attachment.Library=c(74),e.view.Attachment.EditLibrary=c(75),e.view.Attachments=c(76),e.view.Search=c(77),e.view.AttachmentFilters=c(78),e.view.DateFilter=c(79),e.view.AttachmentFilters.Uploaded=c(80),e.view.AttachmentFilters.All=c(81),e.view.AttachmentsBrowser=c(82),e.view.Selection=c(83),e.view.Attachment.Selection=c(84),e.view.Attachments.Selection=c(85),e.view.Attachment.EditSelection=c(86),e.view.Settings=c(87),e.view.Settings.AttachmentDisplay=c(88),e.view.Settings.Gallery=c(89),e.view.Settings.Playlist=c(90),e.view.Attachment.Details=c(91),e.view.AttachmentCompat=c(92),e.view.Iframe=c(93),e.view.Embed=c(94),e.view.Label=c(95),e.view.EmbedUrl=c(96),e.view.EmbedLink=c(97),e.view.EmbedImage=c(98),e.view.ImageDetails=c(99),e.view.Cropper=c(100),e.view.SiteIconCropper=c(101),e.view.SiteIconPreview=c(102),e.view.EditImage=c(103),e.view.Spinner=c(104),e.view.Heading=c(105)},function(a,b){var c=function(a){_.extend(this,_.pick(a||{},"id","view","selector"))};c.extend=Backbone.Model.extend,_.extend(c.prototype,{mode:function(a){return a?a===this._mode?this:(this.trigger("deactivate"),this._mode=a,this.render(a),this.trigger("activate"),this):this._mode},render:function(a){if(a&&a!==this._mode)return this.mode(a);var b,c={view:null};return this.trigger("create",c),b=c.view,this.trigger("render",b),b&&this.set(b),this},get:function(){return this.view.views.first(this.selector)},set:function(a,b){return b&&(b.add=!1),this.view.views.set(this.selector,a,b)},trigger:function(a){var b,c;if(this._mode)return c=_.toArray(arguments),b=this.id+":"+a,c[0]=b+":"+this._mode,this.view.trigger.apply(this.view,c),c[0]=b,this.view.trigger.apply(this.view,c),this}}),a.exports=c},function(a,b){var c=function(a){this.states=new Backbone.Collection(a)};c.extend=Backbone.Model.extend,_.extend(c.prototype,Backbone.Events,{state:function(a){return this.states=this.states||new Backbone.Collection,a=a||this._state,a&&!this.states.get(a)&&this.states.add({id:a}),this.states.get(a)},setState:function(a){var b=this.state();return b&&a===b.id||!this.states||!this.states.get(a)?this:(b&&(b.trigger("deactivate"),this._lastState=b.id),this._state=a,this.state().trigger("activate"),this)},lastState:function(){if(this._lastState)return this.state(this._lastState)}}),_.each(["on","off","trigger"],function(a){c.prototype[a]=function(){return this.states=this.states||new Backbone.Collection,this.states[a].apply(this.states,arguments),this}}),a.exports=c},function(a,b){var c=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=!0},_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=!1,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(a){a.$el.text(this.get("title")||"")},_router:function(){var a,b=this.frame.router,c=this.get("router");this.frame.$el.toggleClass("hide-router",!c),c&&(this.frame.router.render(c),a=b.get(),a&&a.select&&a.select(this.frame.content.mode()))},_menu:function(){var a,b=this.frame.menu,c=this.get("menu");this.frame.$el.toggleClass("hide-menu",!c),c&&(b.mode(c),a=b.get(),a&&a.select&&a.select(this.id))},_updateMenu:function(){var a=this.previous("menu"),b=this.get("menu");a&&this.frame.off("menu:render:"+a,this._renderMenu,this),b&&this.frame.on("menu:render:"+b,this._renderMenu,this)},_renderMenu:function(a){var b=this.get("menuItem"),c=this.get("title"),d=this.get("priority");!b&&c&&(b={text:c},d&&(b.priority=d)),b&&a.set(this.id,b)}});_.each(["toolbar","content"],function(a){c.prototype["_"+a]=function(){var b=this.get(a);b&&this.frame[a].render(b)}}),a.exports=c},function(a,b){var c={syncSelection:function(){var a=this.get("selection"),b=this.frame._selection;this.get("syncSelection")&&b&&a&&(a.multiple&&(a.reset([],{silent:!0}),a.validateAll(b.attachments),b.difference=_.difference(b.attachments.models,a.models)),a.single(b.single))},recordSelection:function(){var a=this.get("selection"),b=this.frame._selection;this.get("syncSelection")&&b&&a&&(a.multiple?(b.attachments.reset(a.toArray().concat(b.difference)),b.difference=[]):b.attachments.add(a.toArray()),b.single=a._single)}};a.exports=c},function(a,b){var c,d=wp.media.view.l10n,e=window.getUserSetting,f=window.setUserSetting;c=wp.media.controller.State.extend({defaults:{id:"library",title:d.mediaLibraryTitle,multiple:!1,content:"upload",menu:"default",router:"browse",toolbar:"select",searchable:!0,filterable:!1,sortable:!0,autoSelect:!0,describe:!1,contentUserSetting:!0,syncSelection:!0},initialize:function(){var a,b=this.get("selection");this.get("library")||this.set("library",wp.media.query()),b instanceof wp.media.model.Selection||(a=b,a||(a=this.get("library").props.toJSON(),a=_.omit(a,"orderby","query")),this.set("selection",new wp.media.model.Selection(null,{multiple:this.get("multiple"),props:a}))),this.resetDisplays()},activate:function(){this.syncSelection(),wp.Uploader.queue.on("add",this.uploading,this),this.get("selection").on("add remove reset",this.refreshContent,this),this.get("router")&&this.get("contentUserSetting")&&(this.frame.on("content:activate",this.saveContentMode,this),this.set("content",e("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 a=wp.media.view.settings.defaultProps;this._displays=[],this._defaultDisplaySettings={align:e("align",a.align)||"none",size:e("imgsize",a.size)||"medium",link:e("urlbutton",a.link)||"none"}},display:function(a){var b=this._displays;return b[a.cid]||(b[a.cid]=new Backbone.Model(this.defaultDisplaySettings(a))),b[a.cid]},defaultDisplaySettings:function(a){var b=_.clone(this._defaultDisplaySettings);return(b.canEmbed=this.canEmbed(a))?b.link="embed":this.isImageAttachment(a)||"none"!==b.link||(b.link="file"),b},isImageAttachment:function(a){return a.get("uploading")?/\.(jpe?g|png|gif)$/i.test(a.get("filename")):"image"===a.get("type")},canEmbed:function(a){if(!a.get("uploading")){var b=a.get("type");if("audio"!==b&&"video"!==b)return!1}return _.contains(wp.media.view.settings.embedExts,a.get("filename").split(".").pop())},refreshContent:function(){var a=this.get("selection"),b=this.frame,c=b.router.get(),d=b.content.mode();this.active&&!a.length&&c&&!c.get(d)&&this.frame.content.render(this.get("content"))},uploading:function(a){var b=this.frame.content;"upload"===b.mode()&&this.frame.content.mode("browse"),this.get("autoSelect")&&(this.get("selection").add(a),this.frame.trigger("library:selection:add"))},saveContentMode:function(){if("browse"===this.get("router")){var a=this.frame.content.mode(),b=this.frame.router.get();b&&b.get(a)&&f("libraryContent",a)}}}),_.extend(c.prototype,wp.media.selectionSync),a.exports=c},function(a,b){var c,d=wp.media.controller.State,e=wp.media.controller.Library,f=wp.media.view.l10n;c=d.extend({defaults:_.defaults({id:"image-details",title:f.imageDetailsTitle,content:"image-details",menu:!1,router:!1,toolbar:"image-details",editing:!1,priority:60},e.prototype.defaults),initialize:function(a){this.image=a.image,d.prototype.initialize.apply(this,arguments)},activate:function(){this.frame.modal.$el.addClass("image-details")}}),a.exports=c},function(a,b){var c,d=wp.media.controller.Library,e=wp.media.view.l10n;c=d.extend({defaults:{id:"gallery-edit",title:e.editGalleryTitle,multiple:!1,searchable:!1,sortable:!0,date:!1,display:!1,content:"browse",toolbar:"gallery-edit",describe:!0,displaySettings:!0,dragInfo:!0,idealColumnWidth:170,editing:!1,priority:60,syncSelection:!1},initialize:function(){this.get("library")||this.set("library",new wp.media.model.Selection),this.get("AttachmentView")||this.set("AttachmentView",wp.media.view.Attachment.EditLibrary),d.prototype.initialize.apply(this,arguments)},activate:function(){var a=this.get("library");a.props.set("type","image"),this.get("library").observe(wp.Uploader.queue),this.frame.on("content:render:browse",this.gallerySettings,this),d.prototype.activate.apply(this,arguments)},deactivate:function(){this.get("library").unobserve(wp.Uploader.queue),this.frame.off("content:render:browse",this.gallerySettings,this),d.prototype.deactivate.apply(this,arguments)},gallerySettings:function(a){if(this.get("displaySettings")){var b=this.get("library");b&&a&&(b.gallery=b.gallery||new Backbone.Model,a.sidebar.set({gallery:new wp.media.view.Settings.Gallery({controller:this,model:b.gallery,priority:40})}),a.toolbar.set("reverse",{text:e.reverseOrder,priority:80,click:function(){b.reset(b.toArray().reverse())}}))}}}),a.exports=c},function(a,b){var c,d=wp.media.model.Selection,e=wp.media.controller.Library,f=wp.media.view.l10n;c=e.extend({defaults:_.defaults({id:"gallery-library",title:f.addToGalleryTitle,multiple:"add",filterable:"uploaded",menu:"gallery",toolbar:"gallery-add",priority:100,syncSelection:!1},e.prototype.defaults),initialize:function(){this.get("library")||this.set("library",wp.media.query({type:"image"})),e.prototype.initialize.apply(this,arguments)},activate:function(){var a=this.get("library"),b=this.frame.state("gallery-edit").get("library");this.editLibrary&&this.editLibrary!==b&&a.unobserve(this.editLibrary),a.validator=function(a){return!!this.mirroring.get(a.cid)&&!b.get(a.cid)&&d.prototype.validator.apply(this,arguments)},a.reset(a.mirroring.models,{silent:!0}),a.observe(b),this.editLibrary=b,e.prototype.activate.apply(this,arguments)}}),a.exports=c},function(a,b){var c,d=wp.media.controller.Library,e=wp.media.view.l10n,f=jQuery;c=d.extend({defaults:{multiple:!1,sortable:!0,date:!1,searchable:!1,content:"browse",describe:!0,dragInfo:!0,idealColumnWidth:170,editing:!1,priority:60,SettingsView:!1,syncSelection:!1},initialize:function(){var a=this.get("collectionType");"video"===this.get("type")&&(a="video-"+a),this.set("id",a+"-edit"),this.set("toolbar",a+"-edit"),this.get("library")||this.set("library",new wp.media.model.Selection),this.get("AttachmentView")||this.set("AttachmentView",wp.media.view.Attachment.EditLibrary),d.prototype.initialize.apply(this,arguments)},activate:function(){var a=this.get("library");a.props.set("type",this.get("type")),this.get("library").observe(wp.Uploader.queue),this.frame.on("content:render:browse",this.renderSettings,this),d.prototype.activate.apply(this,arguments)},deactivate:function(){this.get("library").unobserve(wp.Uploader.queue),this.frame.off("content:render:browse",this.renderSettings,this),d.prototype.deactivate.apply(this,arguments)},renderSettings:function(a){var b=this.get("library"),c=this.get("collectionType"),d=this.get("dragInfoText"),g=this.get("SettingsView"),h={};b&&a&&(b[c]=b[c]||new Backbone.Model,h[c]=new g({controller:this,model:b[c],priority:40}),a.sidebar.set(h),d&&a.toolbar.set("dragInfo",new wp.media.View({el:f('
'+d+"
")[0],priority:-40})),a.toolbar.set("reverse",{text:e.reverseOrder,priority:80,click:function(){b.reset(b.toArray().reverse())}}))}}),a.exports=c},function(a,b){var c,d=wp.media.model.Selection,e=wp.media.controller.Library;c=e.extend({defaults:_.defaults({multiple:"add",filterable:"uploaded",priority:100,syncSelection:!1},e.prototype.defaults),initialize:function(){var a=this.get("collectionType");"video"===this.get("type")&&(a="video-"+a),this.set("id",a+"-library"),this.set("toolbar",a+"-add"),this.set("menu",a),this.get("library")||this.set("library",wp.media.query({type:this.get("type")})),e.prototype.initialize.apply(this,arguments)},activate:function(){var a=this.get("library"),b=this.get("editLibrary"),c=this.frame.state(this.get("collectionType")+"-edit").get("library");b&&b!==c&&a.unobserve(b),a.validator=function(a){return!!this.mirroring.get(a.cid)&&!c.get(a.cid)&&d.prototype.validator.apply(this,arguments)},a.reset(a.mirroring.models,{silent:!0}),a.observe(c),this.set("editLibrary",c),e.prototype.activate.apply(this,arguments)}}),a.exports=c},function(a,b){var c,d=wp.media.model.Attachment,e=wp.media.controller.Library,f=wp.media.view.l10n;c=e.extend({defaults:_.defaults({id:"featured-image",title:f.setFeaturedImageTitle,multiple:!1,filterable:"uploaded",toolbar:"featured-image",priority:60,syncSelection:!0},e.prototype.defaults),initialize:function(){var a,b;this.get("library")||this.set("library",wp.media.query({type:"image"})),e.prototype.initialize.apply(this,arguments),a=this.get("library"),b=a.comparator,a.comparator=function(a,c){var d=!!this.mirroring.get(a.cid),e=!!this.mirroring.get(c.cid);return!d&&e?-1:d&&!e?1:b.apply(this,arguments)},a.observe(this.get("selection"))},activate:function(){this.updateSelection(),this.frame.on("open",this.updateSelection,this),e.prototype.activate.apply(this,arguments)},deactivate:function(){this.frame.off("open",this.updateSelection,this),e.prototype.deactivate.apply(this,arguments)},updateSelection:function(){var a,b=this.get("selection"),c=wp.media.view.settings.post.featuredImageId;""!==c&&-1!==c&&(a=d.get(c),a.fetch()),b.reset(a?[a]:[])}}),a.exports=c},function(a,b){var c,d=wp.media.controller.Library,e=wp.media.view.l10n;c=d.extend({defaults:_.defaults({id:"replace-image",title:e.replaceImageTitle,multiple:!1,filterable:"uploaded",toolbar:"replace",menu:!1,priority:60,syncSelection:!0},d.prototype.defaults),initialize:function(a){var b,c;this.image=a.image,this.get("library")||this.set("library",wp.media.query({type:"image"})),d.prototype.initialize.apply(this,arguments),b=this.get("library"),c=b.comparator,b.comparator=function(a,b){var d=!!this.mirroring.get(a.cid),e=!!this.mirroring.get(b.cid);return!d&&e?-1:d&&!e?1:c.apply(this,arguments)},b.observe(this.get("selection"))},activate:function(){this.updateSelection(),d.prototype.activate.apply(this,arguments)},updateSelection:function(){var a=this.get("selection"),b=this.image.attachment;a.reset(b?[b]:[])}}),a.exports=c},function(a,b){var c,d=wp.media.view.l10n;c=wp.media.controller.State.extend({defaults:{id:"edit-image",title:d.editImage,menu:!1,toolbar:"edit-image",content:"edit-image",url:""},activate:function(){this.frame.on("toolbar:render:edit-image",_.bind(this.toolbar,this))},deactivate:function(){this.frame.off("toolbar:render:edit-image")},toolbar:function(){var a=this.frame,b=a.lastState(),c=b&&b.id;a.toolbar.set(new wp.media.view.Toolbar({controller:a,items:{back:{style:"primary",text:d.back,priority:20,click:function(){c?a.setState(c):a.close()}}}}))}}),a.exports=c},function(a,b){var c,d=wp.media.controller.Library;c=d.extend({defaults:_.defaults({filterable:"uploaded",displaySettings:!1,priority:80,syncSelection:!1},d.prototype.defaults),initialize:function(a){this.media=a.media,this.type=a.type,this.set("library",wp.media.query({type:this.type})),d.prototype.initialize.apply(this,arguments)},activate:function(){wp.media.frame.lastMime&&(this.set("library",wp.media.query({type:wp.media.frame.lastMime})),delete wp.media.frame.lastMime),d.prototype.activate.apply(this,arguments)}}),a.exports=c},function(a,b){var c,d=wp.media.view.l10n,e=Backbone.$;c=wp.media.controller.State.extend({defaults:{id:"embed",title:d.insertFromUrlTitle,content:"embed",menu:"default",toolbar:"main-embed",priority:120,type:"link",url:"",metadata:{}},sensitivity:400,initialize:function(a){this.metadata=a.metadata,this.debouncedScan=_.debounce(_.bind(this.scan,this),this.sensitivity),this.props=new Backbone.Model(this.metadata||{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 a,b=this,c={type:"link",scanners:[]};this.props.get("url")&&this.trigger("scan",c),c.scanners.length?(a=c.scanners=e.when.apply(e,c.scanners),a.always(function(){b.get("scanners")===a&&b.set("loading",!1)})):c.scanners=null,c.loading=!!c.scanners,this.set(c)},scanImage:function(a){var b=this.frame,c=this,d=this.props.get("url"),f=new Image,g=e.Deferred();a.scanners.push(g.promise()),f.onload=function(){g.resolve(),c===b.state()&&d===c.props.get("url")&&(c.set({type:"image"}),c.props.set({width:f.width,height:f.height}))},f.onerror=g.reject,f.src=d},refresh:function(){this.frame.toolbar.get().refresh()},reset:function(){this.props.clear().set({url:""}),this.active&&this.refresh()}}),a.exports=c},function(a,b){var c,d=wp.media.view.l10n;c=wp.media.controller.State.extend({defaults:{id:"cropper",title:d.cropImage,toolbar:"crop",content:"crop",router:!1,canSkipCrop:!1,doCropArgs:{}},activate:function(){this.frame.on("content:create:crop",this.createCropContent,this),this.frame.on("close",this.removeCropper,this),this.set("selection",new Backbone.Collection(this.frame._selection.single))},deactivate:function(){this.frame.toolbar.mode("browse")},createCropContent:function(){this.cropperView=new wp.media.view.Cropper({controller:this,attachment:this.get("selection").first()}),this.cropperView.on("image-loaded",this.createCropToolbar,this),this.frame.content.set(this.cropperView)},removeCropper:function(){this.imgSelect.cancelSelection(),this.imgSelect.setOptions({remove:!0}),this.imgSelect.update(),this.cropperView.remove()},createCropToolbar:function(){var a,b;a=this.get("canSkipCrop")||!1,b={controller:this.frame,items:{insert:{style:"primary",text:d.cropImage,priority:80,requires:{library:!1,selection:!1},click:function(){var a,b=this.controller;a=b.state().get("selection").first(),a.set({cropDetails:b.state().imgSelect.getSelection()}),this.$el.text(d.cropping),this.$el.attr("disabled",!0),b.state().doCrop(a).done(function(a){b.trigger("cropped",a),b.close()}).fail(function(){b.trigger("content:error:crop")})}}}},a&&_.extend(b.items,{skip:{style:"secondary",text:d.skipCropping,priority:70,requires:{library:!1,selection:!1},click:function(){var a=this.controller.state().get("selection").first();this.controller.state().cropperView.remove(),this.controller.trigger("skippedcrop",a),this.controller.close()}}}),this.frame.toolbar.set(new wp.media.view.Toolbar(b))},doCrop:function(a){return wp.ajax.post("custom-header-crop",_.extend({},this.defaults.doCropArgs,{nonce:a.get("nonces").edit,id:a.get("id"),cropDetails:a.get("cropDetails")}))}}),a.exports=c},function(a,b){var c,d=wp.media.controller;c=d.Cropper.extend({doCrop:function(a){var b=a.get("cropDetails"),c=this.get("control"),d=b.width/b.height;return c.params.flex_width&&c.params.flex_height?(b.dst_width=b.width,b.dst_height=b.height):(b.dst_width=c.params.flex_width?c.params.height*d:c.params.width,b.dst_height=c.params.flex_height?c.params.width/d:c.params.height),wp.ajax.post("crop-image",{wp_customize:"on",nonce:a.get("nonces").edit,id:a.get("id"),context:c.id,cropDetails:b})}}),a.exports=c},function(a,b){var c,d=wp.media.controller;c=d.Cropper.extend({activate:function(){this.frame.on("content:create:crop",this.createCropContent,this),this.frame.on("close",this.removeCropper,this),this.set("selection",new Backbone.Collection(this.frame._selection.single))},createCropContent:function(){this.cropperView=new wp.media.view.SiteIconCropper({controller:this,attachment:this.get("selection").first()}),this.cropperView.on("image-loaded",this.createCropToolbar,this),this.frame.content.set(this.cropperView)},doCrop:function(a){var b=a.get("cropDetails"),c=this.get("control");return b.dst_width=c.params.width,b.dst_height=c.params.height,wp.ajax.post("crop-image",{nonce:a.get("nonces").edit,id:a.get("id"),context:"site-icon",cropDetails:b})}}),a.exports=c},function(a,b){var c=wp.Backbone.View.extend({constructor:function(a){a&&a.controller&&(this.controller=a.controller),wp.Backbone.View.apply(this,arguments)},dispose:function(){return this.undelegateEvents(),this.model&&this.model.off&&this.model.off(null,null,this),this.collection&&this.collection.off&&this.collection.off(null,null,this),this.controller&&this.controller.off&&this.controller.off(null,null,this),this},remove:function(){return this.dispose(),wp.Backbone.View.prototype.remove.apply(this,arguments)}});a.exports=c},function(a,b){var c=wp.media.View.extend({initialize:function(){_.defaults(this.options,{mode:["select"]}),this._createRegions(),this._createStates(),this._createModes()},_createRegions:function(){this.regions=this.regions?this.regions.slice():[],_.each(this.regions,function(a){this[a]=new wp.media.controller.Region({view:this,id:a,selector:".media-frame-"+a})},this)},_createStates:function(){this.states=new Backbone.Collection(null,{model:wp.media.controller.State}),this.states.on("add",function(a){a.frame=this,a.trigger("ready")},this),this.options.states&&this.states.add(this.options.states)},_createModes:function(){this.activeModes=new Backbone.Collection,this.activeModes.on("add remove reset",_.bind(this.triggerModeEvents,this)),_.each(this.options.mode,function(a){this.activateMode(a)},this)},reset:function(){return this.states.invoke("trigger","reset"),this},triggerModeEvents:function(a,b,c){var d,e,f={add:"activate",remove:"deactivate"};_.each(c,function(a,b){a&&(d=b)}),_.has(f,d)&&(e=a.get("id")+":"+f[d],this.trigger(e))},activateMode:function(a){if(!this.isModeActive(a))return this.activeModes.add([{id:a}]),this.$el.addClass("mode-"+a),this},deactivateMode:function(a){return this.isModeActive(a)?(this.activeModes.remove(this.activeModes.where({id:a})),this.$el.removeClass("mode-"+a),this.trigger(a+":deactivate"),this):this},isModeActive:function(a){return Boolean(this.activeModes.where({id:a}).length)}});_.extend(c.prototype,wp.media.controller.StateMachine.prototype),a.exports=c},function(a,b){var c,d=wp.media.view.Frame,e=jQuery;c=d.extend({className:"media-frame",template:wp.template("media-frame"),regions:["menu","title","content","toolbar","router"],events:{"click div.media-frame-title h1":"toggleMenu"},initialize:function(){d.prototype.initialize.apply(this,arguments),_.defaults(this.options,{title:"",modal:!0,uploader:!0}),this.$el.addClass("wp-core-ui"),this.options.modal&&(this.modal=new wp.media.view.Modal({controller:this,title:this.options.title}),this.modal.content(this)),!wp.Uploader.limitExceeded&&wp.Uploader.browser.supported||(this.options.uploader=!1),this.options.uploader&&(this.uploader=new wp.media.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("title:render",function(a){a.$el.append('')}),this.on("menu:create:default",this.createMenu,this)},render:function(){return!this.state()&&this.options.state&&this.setState(this.options.state),d.prototype.render.apply(this,arguments)},createTitle:function(a){a.view=new wp.media.View({controller:this,tagName:"h1"})},createMenu:function(a){a.view=new wp.media.view.Menu({controller:this})},toggleMenu:function(){this.$el.find(".media-menu").toggleClass("visible")},createToolbar:function(a){a.view=new wp.media.view.Toolbar({controller:this})},createRouter:function(a){a.view=new wp.media.view.Router({controller:this})},createIframeStates:function(a){var b,c=wp.media.view.settings,d=c.tabs,f=c.tabUrl;d&&f&&(b=e("#post_ID"),b.length&&(f+="&post_id="+b.val()),_.each(d,function(b,c){this.state("iframe:"+c).set(_.defaults({tab:c,src:f+"&tab="+c,title:b,content:"iframe",menu:"default"},a))},this),this.on("content:create:iframe",this.iframeContent,this),this.on("content:deactivate:iframe",this.iframeContentCleanup,this),this.on("menu:render:default",this.iframeMenu,this),this.on("open",this.hijackThickbox,this),this.on("close",this.restoreThickbox,this))},iframeContent:function(a){this.$el.addClass("hide-toolbar"),a.view=new wp.media.view.Iframe({controller:this})},iframeContentCleanup:function(){this.$el.removeClass("hide-toolbar")},iframeMenu:function(a){var b={};a&&(_.each(wp.media.view.settings.tabs,function(a,c){b["iframe:"+c]={text:this.state("iframe:"+c).get("title"),priority:200}},this),a.set(b))},hijackThickbox:function(){var a=this;window.tb_remove&&!this._tb_remove&&(this._tb_remove=window.tb_remove,window.tb_remove=function(){a.close(),a.reset(),a.setState(a.options.state),a._tb_remove.call(window)})},restoreThickbox:function(){this._tb_remove&&(window.tb_remove=this._tb_remove,delete this._tb_remove)}}),_.each(["open","close","attach","detach","escape"],function(a){c.prototype[a]=function(){return this.modal&&this.modal[a].apply(this.modal,arguments),this}}),a.exports=c},function(a,b){var c,d=wp.media.view.MediaFrame,e=wp.media.view.l10n;c=d.extend({initialize:function(){d.prototype.initialize.apply(this,arguments),_.defaults(this.options,{selection:[],library:{},multiple:!1,state:"library"}),this.createSelection(),this.createStates(),this.bindHandlers()},createSelection:function(){var a=this.options.selection;a instanceof wp.media.model.Selection||(this.options.selection=new wp.media.model.Selection(a,{multiple:this.options.multiple})),this._selection={attachments:new wp.media.model.Attachments,difference:[]}},createStates:function(){var a=this.options;this.options.states||this.states.add([new wp.media.controller.Library({library:wp.media.query(a.library),multiple:a.multiple,title:a.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(a){a.set({upload:{text:e.uploadFilesTitle,priority:20},browse:{text:e.mediaLibraryTitle,priority:40}})},browseContent:function(a){var b=this.state();this.$el.removeClass("hide-toolbar"),a.view=new wp.media.view.AttachmentsBrowser({controller:this,collection:b.get("library"),selection:b.get("selection"),model:b,sortable:b.get("sortable"),search:b.get("searchable"),filters:b.get("filterable"),date:b.get("date"),display:b.has("display")?b.get("display"):b.get("displaySettings"),dragInfo:b.get("dragInfo"),idealColumnWidth:b.get("idealColumnWidth"),suggestedWidth:b.get("suggestedWidth"),suggestedHeight:b.get("suggestedHeight"),AttachmentView:b.get("AttachmentView")})},uploadContent:function(){this.$el.removeClass("hide-toolbar"),this.content.set(new wp.media.view.UploaderInline({controller:this}))},createSelectToolbar:function(a,b){b=b||this.options.button||{},b.controller=this,a.view=new wp.media.view.Toolbar.Select(b)}}),a.exports=c},function(a,b){var c,d=wp.media.view.MediaFrame.Select,e=wp.media.controller.Library,f=wp.media.view.l10n;c=d.extend({initialize:function(){this.counts={audio:{count:wp.media.view.settings.attachmentCounts.audio,state:"playlist"},video:{count:wp.media.view.settings.attachmentCounts.video,state:"video-playlist"}},_.defaults(this.options,{multiple:!0,editing:!1,state:"insert",metadata:{}}),d.prototype.initialize.apply(this,arguments),this.createIframeStates()},createStates:function(){var a=this.options;this.states.add([new e({id:"insert",title:f.insertMediaTitle,priority:20,toolbar:"main-insert",filterable:"all",library:wp.media.query(a.library),multiple:!!a.multiple&&"reset",editable:!0,allowLocalEdits:!0,displaySettings:!0,displayUserSettings:!0}),new e({id:"gallery",title:f.createGalleryTitle,priority:40,toolbar:"main-gallery",filterable:"uploaded",multiple:"add",editable:!1,library:wp.media.query(_.defaults({type:"image"},a.library))}),new wp.media.controller.Embed({metadata:a.metadata}),new wp.media.controller.EditImage({model:a.editImage}),new wp.media.controller.GalleryEdit({library:a.selection,editing:a.editing,menu:"gallery"}),new wp.media.controller.GalleryAdd,new e({id:"playlist",title:f.createPlaylistTitle,priority:60,toolbar:"main-playlist",filterable:"uploaded",multiple:"add",editable:!1,library:wp.media.query(_.defaults({type:"audio"},a.library))}),new wp.media.controller.CollectionEdit({ -type:"audio",collectionType:"playlist",title:f.editPlaylistTitle,SettingsView:wp.media.view.Settings.Playlist,library:a.selection,editing:a.editing,menu:"playlist",dragInfoText:f.playlistDragInfo,dragInfo:!1}),new wp.media.controller.CollectionAdd({type:"audio",collectionType:"playlist",title:f.addToPlaylistTitle}),new e({id:"video-playlist",title:f.createVideoPlaylistTitle,priority:60,toolbar:"main-video-playlist",filterable:"uploaded",multiple:"add",editable:!1,library:wp.media.query(_.defaults({type:"video"},a.library))}),new wp.media.controller.CollectionEdit({type:"video",collectionType:"playlist",title:f.editVideoPlaylistTitle,SettingsView:wp.media.view.Settings.Playlist,library:a.selection,editing:a.editing,menu:"video-playlist",dragInfoText:f.videoPlaylistDragInfo,dragInfo:!1}),new wp.media.controller.CollectionAdd({type:"video",collectionType:"playlist",title:f.addToVideoPlaylistTitle})]),wp.media.view.settings.post.featuredImageId&&this.states.add(new wp.media.controller.FeaturedImage)},bindHandlers:function(){var a,b;d.prototype.bindHandlers.apply(this,arguments),this.on("activate",this.activate,this),b=_.find(this.counts,function(a){return 0===a.count}),"undefined"!=typeof b&&this.listenTo(wp.media.model.Attachments.all,"change:type",this.mediaTypeCounts),this.on("menu:create:gallery",this.createMenu,this),this.on("menu:create:playlist",this.createMenu,this),this.on("menu:create:video-playlist",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:main-playlist",this.createToolbar,this),this.on("toolbar:create:main-video-playlist",this.createToolbar,this),this.on("toolbar:create:featured-image",this.featuredImageToolbar,this),this.on("toolbar:create:main-embed",this.mainEmbedToolbar,this),a={menu:{"default":"mainMenu",gallery:"galleryMenu",playlist:"playlistMenu","video-playlist":"videoPlaylistMenu"},content:{embed:"embedContent","edit-image":"editImageContent","edit-selection":"editSelectionContent"},toolbar:{"main-insert":"mainInsertToolbar","main-gallery":"mainGalleryToolbar","gallery-edit":"galleryEditToolbar","gallery-add":"galleryAddToolbar","main-playlist":"mainPlaylistToolbar","playlist-edit":"playlistEditToolbar","playlist-add":"playlistAddToolbar","main-video-playlist":"mainVideoPlaylistToolbar","video-playlist-edit":"videoPlaylistEditToolbar","video-playlist-add":"videoPlaylistAddToolbar"}},_.each(a,function(a,b){_.each(a,function(a,c){this.on(b+":render:"+c,this[a],this)},this)},this)},activate:function(){_.each(this.counts,function(a){a.count<1&&this.menuItemVisibility(a.state,"hide")},this)},mediaTypeCounts:function(a,b){"undefined"!=typeof this.counts[b]&&this.counts[b].count<1&&(this.counts[b].count++,this.menuItemVisibility(this.counts[b].state,"show"))},mainMenu:function(a){a.set({"library-separator":new wp.media.View({className:"separator",priority:100})})},menuItemVisibility:function(a,b){var c=this.menu.get();"hide"===b?c.hide(a):"show"===b&&c.show(a)},galleryMenu:function(a){var b=this.lastState(),c=b&&b.id,d=this;a.set({cancel:{text:f.cancelGalleryTitle,priority:20,click:function(){c?d.setState(c):d.close(),this.controller.modal.focusManager.focus()}},separateCancel:new wp.media.View({className:"separator",priority:40})})},playlistMenu:function(a){var b=this.lastState(),c=b&&b.id,d=this;a.set({cancel:{text:f.cancelPlaylistTitle,priority:20,click:function(){c?d.setState(c):d.close()}},separateCancel:new wp.media.View({className:"separator",priority:40})})},videoPlaylistMenu:function(a){var b=this.lastState(),c=b&&b.id,d=this;a.set({cancel:{text:f.cancelVideoPlaylistTitle,priority:20,click:function(){c?d.setState(c):d.close()}},separateCancel:new wp.media.View({className:"separator",priority:40})})},embedContent:function(){var a=new wp.media.view.Embed({controller:this,model:this.state()}).render();this.content.set(a),wp.media.isTouchDevice||a.url.focus()},editSelectionContent:function(){var a,b=this.state(),c=b.get("selection");a=new wp.media.view.AttachmentsBrowser({controller:this,collection:c,selection:c,model:b,sortable:!0,search:!1,date:!1,dragInfo:!0,AttachmentView:wp.media.view.Attachments.EditSelection}).render(),a.toolbar.set("backToLibrary",{text:f.returnToLibrary,priority:-100,click:function(){this.controller.content.mode("browse")}}),this.content.set(a),this.trigger("edit:selection",this)},editImageContent:function(){var a=this.state().get("image"),b=new wp.media.view.EditImage({model:a,controller:this}).render();this.content.set(b),b.loadEditor()},selectionStatusToolbar:function(a){var b=this.state().get("editable");a.set("selection",new wp.media.view.Selection({controller:this,collection:this.state().get("selection"),priority:-40,editable:b&&function(){this.controller.content.mode("edit-selection")}}).render())},mainInsertToolbar:function(a){var b=this;this.selectionStatusToolbar(a),a.set("insert",{style:"primary",priority:80,text:f.insertIntoPost,requires:{selection:!0},click:function(){var a=b.state(),c=a.get("selection");b.close(),a.trigger("insert",c).reset()}})},mainGalleryToolbar:function(a){var b=this;this.selectionStatusToolbar(a),a.set("gallery",{style:"primary",text:f.createNewGallery,priority:60,requires:{selection:!0},click:function(){var a=b.state().get("selection"),c=b.state("gallery-edit"),d=a.where({type:"image"});c.set("library",new wp.media.model.Selection(d,{props:a.props.toJSON(),multiple:!0})),this.controller.setState("gallery-edit"),this.controller.modal.focusManager.focus()}})},mainPlaylistToolbar:function(a){var b=this;this.selectionStatusToolbar(a),a.set("playlist",{style:"primary",text:f.createNewPlaylist,priority:100,requires:{selection:!0},click:function(){var a=b.state().get("selection"),c=b.state("playlist-edit"),d=a.where({type:"audio"});c.set("library",new wp.media.model.Selection(d,{props:a.props.toJSON(),multiple:!0})),this.controller.setState("playlist-edit"),this.controller.modal.focusManager.focus()}})},mainVideoPlaylistToolbar:function(a){var b=this;this.selectionStatusToolbar(a),a.set("video-playlist",{style:"primary",text:f.createNewVideoPlaylist,priority:100,requires:{selection:!0},click:function(){var a=b.state().get("selection"),c=b.state("video-playlist-edit"),d=a.where({type:"video"});c.set("library",new wp.media.model.Selection(d,{props:a.props.toJSON(),multiple:!0})),this.controller.setState("video-playlist-edit"),this.controller.modal.focusManager.focus()}})},featuredImageToolbar:function(a){this.createSelectToolbar(a,{text:f.setFeaturedImage,state:this.options.state})},mainEmbedToolbar:function(a){a.view=new wp.media.view.Toolbar.Embed({controller:this})},galleryEditToolbar:function(){var a=this.state().get("editing");this.toolbar.set(new wp.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:a?f.updateGallery:f.insertGallery,priority:80,requires:{library:!0},click:function(){var a=this.controller,b=a.state();a.close(),b.trigger("update",b.get("library")),a.setState(a.options.state),a.reset()}}}}))},galleryAddToolbar:function(){this.toolbar.set(new wp.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:f.addToGallery,priority:80,requires:{selection:!0},click:function(){var a=this.controller,b=a.state(),c=a.state("gallery-edit");c.get("library").add(b.get("selection").models),b.trigger("reset"),a.setState("gallery-edit")}}}}))},playlistEditToolbar:function(){var a=this.state().get("editing");this.toolbar.set(new wp.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:a?f.updatePlaylist:f.insertPlaylist,priority:80,requires:{library:!0},click:function(){var a=this.controller,b=a.state();a.close(),b.trigger("update",b.get("library")),a.setState(a.options.state),a.reset()}}}}))},playlistAddToolbar:function(){this.toolbar.set(new wp.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:f.addToPlaylist,priority:80,requires:{selection:!0},click:function(){var a=this.controller,b=a.state(),c=a.state("playlist-edit");c.get("library").add(b.get("selection").models),b.trigger("reset"),a.setState("playlist-edit")}}}}))},videoPlaylistEditToolbar:function(){var a=this.state().get("editing");this.toolbar.set(new wp.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:a?f.updateVideoPlaylist:f.insertVideoPlaylist,priority:140,requires:{library:!0},click:function(){var a=this.controller,b=a.state(),c=b.get("library");c.type="video",a.close(),b.trigger("update",c),a.setState(a.options.state),a.reset()}}}}))},videoPlaylistAddToolbar:function(){this.toolbar.set(new wp.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:f.addToVideoPlaylist,priority:140,requires:{selection:!0},click:function(){var a=this.controller,b=a.state(),c=a.state("video-playlist-edit");c.get("library").add(b.get("selection").models),b.trigger("reset"),a.setState("video-playlist-edit")}}}}))}}),a.exports=c},function(a,b){var c,d=wp.media.view.MediaFrame.Select,e=wp.media.view.l10n;c=d.extend({defaults:{id:"image",url:"",menu:"image-details",content:"image-details",toolbar:"image-details",type:"link",title:e.imageDetailsTitle,priority:120},initialize:function(a){this.image=new wp.media.model.PostImage(a.metadata),this.options.selection=new wp.media.model.Selection(this.image.attachment,{multiple:!1}),d.prototype.initialize.apply(this,arguments)},bindHandlers:function(){d.prototype.bindHandlers.apply(this,arguments),this.on("menu:create:image-details",this.createMenu,this),this.on("content:create:image-details",this.imageDetailsContent,this),this.on("content:render:edit-image",this.editImageContent,this),this.on("toolbar:render:image-details",this.renderImageDetailsToolbar,this),this.on("toolbar:render:replace",this.renderReplaceImageToolbar,this)},createStates:function(){this.states.add([new wp.media.controller.ImageDetails({image:this.image,editable:!1}),new wp.media.controller.ReplaceImage({id:"replace-image",library:wp.media.query({type:"image"}),image:this.image,multiple:!1,title:e.imageReplaceTitle,toolbar:"replace",priority:80,displaySettings:!0}),new wp.media.controller.EditImage({image:this.image,selection:this.options.selection})])},imageDetailsContent:function(a){a.view=new wp.media.view.ImageDetails({controller:this,model:this.state().image,attachment:this.state().image.attachment})},editImageContent:function(){var a,b=this.state(),c=b.get("image");c&&(a=new wp.media.view.EditImage({model:c,controller:this}).render(),this.content.set(a),a.loadEditor())},renderImageDetailsToolbar:function(){this.toolbar.set(new wp.media.view.Toolbar({controller:this,items:{select:{style:"primary",text:e.update,priority:80,click:function(){var a=this.controller,b=a.state();a.close(),b.trigger("update",a.image.toJSON()),a.setState(a.options.state),a.reset()}}}}))},renderReplaceImageToolbar:function(){var a=this,b=a.lastState(),c=b&&b.id;this.toolbar.set(new wp.media.view.Toolbar({controller:this,items:{back:{text:e.back,priority:80,click:function(){c?a.setState(c):a.close()}},replace:{style:"primary",text:e.replace,priority:20,requires:{selection:!0},click:function(){var a=this.controller,b=a.state(),c=b.get("selection"),d=c.single();a.close(),a.image.changeAttachment(d,b.display(d)),b.trigger("replace",a.image.toJSON()),a.setState(a.options.state),a.reset()}}}}))}}),a.exports=c},function(a,b){var c,d=jQuery;c=wp.media.View.extend({tagName:"div",template:wp.template("media-modal"),events:{"click .media-modal-backdrop, .media-modal-close":"escapeHandler",keydown:"keydown"},clickedOpenerEl:null,initialize:function(){_.defaults(this.options,{container:document.body,title:"",propagate:!0,hasCloseButton:!0}),this.focusManager=new wp.media.view.FocusManager({el:this.el})},prepare:function(){return{title:this.options.title,hasCloseButton:this.options.hasCloseButton}},attach:function(){return this.views.attached?this:(this.views.rendered||this.render(),this.$el.appendTo(this.options.container),this.views.attached=!0,this.views.ready(),this.propagate("attach"))},detach:function(){return this.$el.is(":visible")&&this.close(),this.$el.detach(),this.views.attached=!1,this.propagate("detach")},open:function(){var a,b=this.$el;return b.is(":visible")?this:(this.clickedOpenerEl=document.activeElement,this.views.attached||this.attach(),d("body").addClass("modal-open"),b.show(),"ontouchend"in document&&(a=window.tinymce&&window.tinymce.activeEditor)&&!a.isHidden()&&a.iframeElement&&(a.iframeElement.focus(),a.iframeElement.blur(),setTimeout(function(){a.iframeElement.blur()},100)),this.$(".media-modal").focus(),this.propagate("open"))},close:function(a){return this.views.attached&&this.$el.is(":visible")?(d("body").removeClass("modal-open"),this.$el.hide().undelegate("keydown"),null!==this.clickedOpenerEl?this.clickedOpenerEl.focus():d("#wpbody-content").attr("tabindex","-1").focus(),this.propagate("close"),a&&a.escape&&this.propagate("escape"),this):this},escape:function(){return this.close({escape:!0})},escapeHandler:function(a){a.preventDefault(),this.escape()},content:function(a){return this.views.set(".media-modal-content",a),this},propagate:function(a){return this.trigger(a),this.options.propagate&&this.controller.trigger(a),this},keydown:function(a){27===a.which&&this.$el.is(":visible")&&(this.escape(),a.stopImmediatePropagation())}}),a.exports=c},function(a,b){var c=wp.media.View.extend({events:{keydown:"constrainTabbing"},focus:function(){this.$(".media-menu-item").filter(":visible").first().focus()},constrainTabbing:function(a){var b;if(9===a.keyCode)return b=this.$(":tabbable").not('.moxie-shim input[type="file"]'),b.last()[0]!==a.target||a.shiftKey?b.first()[0]===a.target&&a.shiftKey?(b.last().focus(),!1):void 0:(b.first().focus(),!1)}});a.exports=c},function(a,b){var c,d=jQuery;c=wp.media.View.extend({tagName:"div",className:"uploader-window",template:wp.template("uploader-window"),initialize:function(){var a;this.$browser=d('