<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[23054] trunk/wp-includes: Compress scripts/styles: 3.5-RC3-23054.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/23054">23054</a></dd>
<dt>Author</dt> <dd>bumpbot</dd>
<dt>Date</dt> <dd>2012-12-05 00:58:31 +0000 (Wed, 05 Dec 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Compress scripts/styles: 3.5-RC3-23054.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludescssmediaviewsmincss">trunk/wp-includes/css/media-views.min.css</a></li>
<li><a href="#trunkwpincludesjsmediaviewsminjs">trunk/wp-includes/js/media-views.min.js</a></li>
<li><a href="#trunkwpincludesjspluploadwppluploadminjs">trunk/wp-includes/js/plupload/wp-plupload.min.js</a></li>
<li><a href="#trunkwpincludesversionphp">trunk/wp-includes/version.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludescssmediaviewsmincss"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/css/media-views.min.css (23053 => 23054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/css/media-views.min.css        2012-12-05 00:45:21 UTC (rev 23053)
+++ trunk/wp-includes/css/media-views.min.css        2012-12-05 00:58:31 UTC (rev 23054)
</span><span class="lines">@@ -1 +1 @@
</span><del>-.media-modal,.media-frame{font-family:sans-serif;font-size:12px}.media-frame input,.media-frame textarea{padding:6px 8px;line-height:16px}.media-frame select,.wp-admin .media-frame select{line-height:28px;margin-top:3px}.media-frame a{color:#21759b}.media-frame a:hover{color:#d54e21}.media-frame a.button{color:#333}.media-frame a.button:hover{color:#222}.media-frame a.button-primary,.media-frame a.button-primary:hover{color:#fff}.media-frame input[type=&quot;text&quot;],.media-frame input[type=&quot;password&quot;],.media-frame input[type=&quot;number&quot;],.media-frame input[type=&quot;search&quot;],.media-frame input[type=&quot;email&quot;],.media-frame input[type=&quot;url&quot;],.media-frame textarea,.media-frame select{font-family:sans-serif;font-size:12px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:3px;border-radius:3px;border-width:1px;border-style:solid;border-color:#dfdfd
 f}.media-frame input:disabled,.media-frame textarea:disabled,.media-frame input[readonly],.media-frame textarea[readonly]{background-color:#eee}.media-frame input[type=&quot;search&quot;]{-webkit-appearance:textfield}.media-frame :-moz-placeholder{color:#a9a9a9}.ui-sortable,.ui-draggable{-ms-touch-action:none}.media-modal{position:fixed;top:30px;left:30px;right:30px;bottom:30px;z-index:160000}.media-modal-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;background:#000;opacity:.7;z-index:159900}.media-modal-close{position:absolute;top:7px;right:7px;width:30px;height:30px;z-index:1000}.media-modal-close span{display:block;margin:8px auto 0;width:15px;height:15px;background-position:-100px 0}.media-modal-close:active{outline:0}.media-modal-content{position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;background:#fff}.media-modal-icon{background-image:url(../images/uploader-icons.png);background-repeat:no-repeat}.media-toolbar{position:absolute;top:0;left:0;right:0
 ;z-index:100;height:60px;padding:0 16px;border:0 solid #dfdfdf}.media-toolbar-primary{float:right}.media-toolbar-secondary{float:left}.media-toolbar-primary&gt;.media-button,.media-toolbar-primary&gt;.media-button-group{margin-left:10px;float:left;margin-top:15px}.media-toolbar-secondary&gt;.media-button,.media-toolbar-secondary&gt;.media-button-group{margin-right:10px;float:left;margin-top:15px}.media-sidebar{position:absolute;top:0;right:0;bottom:0;width:267px;padding:0 16px 24px;z-index:75;background:#f5f5f5;border-left:1px solid #dfdfdf;overflow:auto;-webkit-overflow-scrolling:touch}.hide-toolbar .media-sidebar{bottom:0}.media-sidebar .sidebar-title{font-weight:200;font-size:20px;margin:0;padding:12px 10px 10px;line-height:28px}.media-sidebar .sidebar-content{padding:0 10px;margin-bottom:130px}.media-sidebar .search{display:block;width:100%}.media-sidebar h3{position:relative;font-weight:bold;text-transform:uppercase;font-size:12px;color:#777;text-shadow:0 1px 0 #fff;mar
 gin:24px 0 8px}.media-sidebar .setting{display:block;float:left;width:100%;margin:1px 0}.media-sidebar .setting span{min-width:30%;margin-right:4%;font-size:12px}.media-sidebar .setting select{max-width:65%;*max-width:55%}.media-sidebar .setting input[type=&quot;checkbox&quot;]{width:auto;height:30px;float:none;margin:0;padding:0}.media-sidebar .setting span,.compat-item label span{float:left;min-height:22px;padding-top:8px;line-height:16px;text-align:right;font-weight:normal;color:#999;text-shadow:0 1px 0 #fff}.media-sidebar .setting input,.media-sidebar .setting textarea{width:65%;*width:55%;float:right}.media-sidebar .setting textarea,.compat-item .field textarea{height:62px;resize:vertical}.media-sidebar select{margin-top:3px}.compat-item{float:left;width:100%;overflow:hidden}.compat-item table{width:100%;table-layout:fixed;border-spacing:0;border:0}.compat-item tr{padding:2px 0;display:block;overflow:hidden}.compat-item .label,.compat-item .field{display:block;margin:0;
 padding:0}.compat-item .label{min-width:30%;margin-right:4%;float:left;text-align:right}.compat-item .label span{display:block;width:100%}.compat-item .field{float:right;width:65%;padding-right:1px}.compat-item .field input{width:100%;margin:0}.media-menu{position:absolute;top:0;left:0;right:0;bottom:0;margin:0;padding:16px 0;border-right:1px solid #d9d9d9;box-shadow:inset -6px 0 6px -6px rgba(0,0,0,0.2);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.media-menu&gt;a{display:block;position:relative;padding:4px 20px;margin:0;line-height:18px;font-size:14px;color:#21759b;text-shadow:0 1px 0 #fff;text-decoration:none}.media-menu&gt;a:hover{color:#21759b;background:rgba(0,0,0,0.04)}.media-menu&gt;a:active{outline:0}.media-menu .active,.media-menu .active:hover{color:#333;font-weight:bold}.media-menu .separator{height:0;margin:12px 20px;padding:0;border-top:1px solid #dfdfdf;border-bottom:1px solid #fff}.media-router{position:relative;padding
 :0 6px;margin:0;clear:both;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.media-router&gt;a{position:relative;float:left;padding:2px 10px;margin:0;height:18px;line-height:18px;font-size:14px;border-right:1px solid #dfdfdf;text-shadow:0 1px 0 #fff;text-decoration:none}.media-router&gt;a:last-child{border-right:0}.media-router&gt;a:active,.media-router&gt;a:focus{outline:0}.media-router .active,.media-router .active:hover{color:#333}.media-router .active:after{content:'';display:block;margin:-100px auto 0;width:7px;height:7px;background:#fff;box-shadow:1px 1px 1px rgba(0,0,0,0.2);z-index:300;-webkit-transform:rotate(45deg) translate(75px,75px);-moz-transform:rotate(45deg) translate(75px,75px);-ms-transform:rotate(45deg) translate(75px,75px);-o-transform:rotate(45deg) translate(75px,75px);transform:rotate(45deg) translate(75px,75px)}.media-frame{overflow:hidden;position:absolute;top:0;left:0;right:0;bottom:0}.media-frame-menu{position:abso
 lute;top:0;left:0;bottom:0;width:199px;z-index:150}.media-frame-title{position:absolute;top:0;left:200px;right:0;height:45px;z-index:200}.media-frame-router{position:absolute;top:45px;left:200px;right:0;height:30px;z-index:200;border-bottom:1px solid #dfdfdf;box-shadow:0 4px 4px -4px rgba(0,0,0,0.1)}.media-frame-content{position:absolute;top:75px;left:200px;right:0;bottom:61px;height:auto;width:auto;margin:0;overflow:auto}.media-frame-toolbar{position:absolute;left:200px;right:0;bottom:0;height:60px;z-index:100;border:0 solid #dfdfdf;border-width:1px 0 0 0;box-shadow:0 -4px 4px -4px rgba(0,0,0,0.1)}.media-frame.hide-menu .media-frame-title,.media-frame.hide-menu .media-frame-router,.media-frame.hide-menu .media-frame-toolbar,.media-frame.hide-menu .media-frame-content{left:0}.media-frame.hide-menu .media-frame-menu{left:-200px}.media-frame.hide-toolbar .media-frame-content{bottom:0}.media-frame.hide-toolbar .media-frame-toolbar{bottom:-61px}.media-frame.hide-router .media-fr
 ame-content{top:45px}.media-frame.hide-router .media-frame-router{display:none}.media-frame.hide-router .media-frame-title{border-bottom:1px solid #dfdfdf;box-shadow:0 4px 4px -4px rgba(0,0,0,0.1)}.media-frame .media-toolbar .add-to-gallery{display:none}.media-frame-title h1{padding:0 16px;font-size:22px;font-weight:200;line-height:45px;margin:0}.media-frame .media-iframe{overflow:hidden}.media-frame .media-iframe,.media-frame .media-iframe iframe{height:100%;width:100%}.media-frame select.attachment-filters{margin-top:11px;margin-right:10px}.media-frame .search{margin-top:11px;padding:4px;line-height:18px;font-size:13px;color:#464646;font-family:sans-serif;-webkit-appearance:none}.media-toolbar-secondary .search{margin-right:16px}.attachments{margin:0;padding-right:16px;-webkit-overflow-scrolling:touch}.attachment{position:relative;float:left;padding:0;margin:0 10px 20px;color:#464646;list-style:none;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-
 select:none;-o-user-select:none;user-select:none}.selected.attachment{box-shadow:0 0 0 1px #fff,0 0 0 3px #ccc}.details.attachment{box-shadow:0 0 0 1px #fff,0 0 0 5px #1e8cbe}.attachment-preview{position:relative;width:199px;height:199px;box-shadow:inset 0 0 15px rgba(0,0,0,0.1),inset 0 0 0 1px rgba(0,0,0,0.05);background:#eee;cursor:pointer}.attachment .icon{margin:0 auto;overflow:hidden;padding-top:20%}.attachment .thumbnail{display:block;position:absolute;top:0;left:0;margin:0 auto;overflow:hidden;max-width:100%;max-height:100%}.attachment-preview .thumbnail:after{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;box-shadow:inset 0 0 0 1px rgba(0,0,0,0.1);overflow:hidden}.attachment .thumbnail img{top:0;left:0}.attachment .thumbnail .centered{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-transform:translate(50%,50%);-moz-transform:translate(50%,50%);-ms-transform:translate(50%,50%);-o-transform:translate(50%,50%);transform:translate(
 50%,50%)}.attachment .thumbnail .centered img{-webkit-transform:translate(-50%,-50%);-moz-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);-o-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.attachment .filename{position:absolute;left:0;right:0;bottom:0;overflow:hidden;max-height:100%;word-wrap:break-word;text-align:center;font-weight:bold;background:rgba(255,255,255,0.8);box-shadow:inset 0 0 0 1px rgba(0,0,0,0.15)}.attachment .filename div{padding:5px 10px}.attachment-preview .thumbnail{width:199px;height:199px}.attachment .thumbnail img{position:absolute}.attachment .close{display:none;position:absolute;top:5px;right:5px;height:22px;width:22px;padding:0;font-size:20px;line-height:20px;text-align:center;text-decoration:none;color:#464646;background-color:#fff;background-position:-96px 4px;border-width:0;border-radius:3px;box-shadow:0 0 0 1px rgba(0,0,0,0.3)}.attachment .close:hover{box-shadow:0 0 0 1px rgba(0,0,0,0.6)}.attachment:hover .close{
 display:block}.attachment .check{display:none;height:24px;width:24px;position:absolute;top:-7px;right:-7px;outline:0;border:1px solid #fff;border-radius:3px;box-shadow:0 0 0 1px rgba(0,0,0,0.4);background:#f1f1f1;background-image:-webkit-gradient(linear,left top,left bottom,from(#f1f1f1),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#f1f1f1,#e1e1e1);background-image:-moz-linear-gradient(top,#f1f1f1,#e1e1e1);background-image:-o-linear-gradient(top,#f1f1f1,#e1e1e1);background-image:linear-gradient(to bottom,#f1f1f1,#e1e1e1)}.attachment .check div{background-position:-1px 0;height:15px;width:15px;margin:5px}.attachment .check:hover div{background-position:-40px 0}.attachment.selected .check{display:block}.attachment.details .check{box-shadow:0 0 0 1px #1e8cbe;background:#1e8cbe;background-image:-webkit-gradient(linear,left top,left bottom,from(#1e8cbe),to(#0074a2));background-image:-webkit-linear-gradient(top,#1e8cbe,#0074a2);background-image:-moz-linear-gradient(to
 p,#1e8cbe,#0074a2);background-image:-o-linear-gradient(top,#1e8cbe,#0074a2);background-image:linear-gradient(to bottom,#1e8cbe,#0074a2)}.attachment.details .check div{background-position:-21px 0}.attachment.details .check:hover div{background-position:-60px 0}.media-frame .attachment .describe{position:relative;display:block;width:100%;*width:183px;margin:-1px 0 0;padding:8px;font-size:12px;border-radius:0}.media-frame .attachments-browser{position:relative;width:100%;height:100%;overflow:hidden}.attachments-browser .media-toolbar{right:300px;height:50px}.attachments-browser .media-toolbar-primary&gt;.media-button,.attachments-browser .media-toolbar-primary&gt;.media-button-group,.attachments-browser .media-toolbar-secondary&gt;.media-button,.attachments-browser .media-toolbar-secondary&gt;.media-button-group{margin-top:10px}.attachments-browser .attachments,.attachments-browser .uploader-inline{position:absolute;top:50px;left:0;right:300px;bottom:0;overflow:auto}.attachment
 s-browser .instructions{display:inline-block;margin-top:16px;line-height:18px;font-size:13px;color:#999}.media-progress-bar{position:relative;height:10px;width:70%;margin:10px auto;border-radius:10px;background:#dfdfdf;background:rgba(0,0,0,0.1)}.media-progress-bar div{height:10px;min-width:20px;width:0;background:#aaa;background:rgba(0,0,0,0.2);border-radius:10px;-webkit-transition:width 300ms;-moz-transition:width 300ms;-ms-transition:width 300ms;-o-transition:width 300ms;transition:width 300ms}.media-uploader-status .media-progress-bar{display:none;width:100%}.uploading.media-uploader-status .media-progress-bar{display:block}.attachment-preview .media-progress-bar{position:absolute;top:50%;left:15%;width:70%;margin:-5px 0 0 0}.media-uploader-status{position:relative;margin:0 auto;padding-bottom:10px;max-width:400px}.media-sidebar .media-uploader-status{border-bottom:1px solid #dfdfdf;box-shadow:0 1px 0 #fff}.uploader-inline .media-uploader-status h3{display:none}.media-up
 loader-status .upload-details{display:none;font-size:12px;color:#666;text-shadow:0 1px 0 #fff}.uploading.media-uploader-status .upload-details{display:block}.media-uploader-status .upload-detail-separator{padding:0 4px}.media-uploader-status .upload-count{color:#464646}.media-uploader-status .upload-dismiss-errors,.media-uploader-status .upload-errors{display:none}.errors.media-uploader-status .upload-dismiss-errors,.errors.media-uploader-status .upload-errors{display:block}.media-uploader-status .upload-dismiss-errors{text-decoration:none}.media-sidebar .media-uploader-status .upload-dismiss-errors{position:absolute;top:0;right:0}.upload-errors .upload-error{margin:8px auto 0 auto;padding:8px;border:1px #c00 solid;background:#ffebe8;border-radius:3px}.upload-errors .upload-error-label{padding:2px 4px;margin-right:8px;font-weight:bold;color:#fff;background:#e00;background-image:-webkit-gradient(linear,left top,left bottom,from(#e00),to(#a00));background-image:-webkit-linear-
 gradient(top,#e00,#a00);background-image:-moz-linear-gradient(top,#e00,#a00);background-image:-o-linear-gradient(top,#e00,#a00);background-image:linear-gradient(to bottom,#e00,#a00);border-radius:3px}.upload-errors .upload-error-message{display:block;padding-top:8px;color:#b44;word-wrap:break-word}.uploader-window{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,86,132,0.9);z-index:250000;display:none;text-align:center;opacity:0;-webkit-transition:opacity 250ms;-moz-transition:opacity 250ms;-ms-transition:opacity 250ms;-o-transition:opacity 250ms;transition:opacity 250ms}.uploader-window-content{position:absolute;top:10px;left:10px;right:10px;bottom:10px;border:1px dashed #fff}.uploader-window h3{position:absolute;top:50%;left:0;right:0;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);-o-transform:translateY(-50%);transform:translateY(-50%);font-size:20px;font-weight:200;color:#fff;padding:0}.uploader-window .med
 ia-progress-bar{margin-top:20px;max-width:300px;background:transparent;border-color:#fff;display:none}.uploader-window .media-progress-bar div{background:#fff}.uploading .uploader-window .media-progress-bar{display:block}.media-frame .uploader-inline{margin:20px;padding:20px;text-align:center}.uploader-inline-content{position:absolute;top:30%;left:0;right:0}.uploader-inline-content .upload-ui{margin:4em 0}.uploader-inline .has-upload-message .upload-ui{margin:0 0 4em}.uploader-inline h3{font-size:20px;line-height:28px;font-weight:200;margin-bottom:1.6em}.uploader-inline .has-upload-message .upload-instructions{font-size:14px;color:#464646;font-weight:normal}.uploader-inline .drop-instructions{display:none}.supports-drag-drop .uploader-inline .drop-instructions{display:block}.uploader-inline p{font-size:12px}.uploader-inline .media-progress-bar{display:none}.uploading.uploader-inline .media-progress-bar{display:block}.uploader-inline .browser{display:inline-block!important}.m
 edia-selection{position:absolute;top:0;left:0;right:350px;height:60px;padding:0 0 0 16px;overflow:hidden;white-space:nowrap}.media-selection .selection-info{display:inline-block;font-size:12px;height:60px;margin-right:10px;vertical-align:top}.media-selection.empty,.media-selection.editing{display:none}.media-selection.one .edit-selection{display:none}.media-selection .count{display:block;padding-top:12px;font-size:14px;line-height:20px;font-weight:bold}.media-selection .selection-info a{display:block;float:left;padding:1px 8px;margin:1px 8px 1px -8px;line-height:16px;text-decoration:none;border-right:1px solid #dfdfdf;color:#21759b}.media-selection .selection-info a:hover{background:#21759b;color:#fff;border-color:transparent}.media-selection .selection-info a:last-child{border-right:0;margin-right:0}.media-selection .selection-info .clear-selection{color:red}.media-selection .selection-info .clear-selection:hover{background:red}.media-selection .selection-view{display:inlin
 e-block}.media-selection .attachments{display:inline-block;height:48px;margin-top:5px;overflow:hidden;vertical-align:top}.media-selection .attachment .icon{width:50%}.attachment.selection.selected{box-shadow:none}.attachment.selection.details{box-shadow:0 0 0 1px #fff,0 0 0 4px #1e8cbe}.media-selection .attachment.selection.details{box-shadow:0 0 0 1px #fff,0 0 0 3px #1e8cbe}.media-selection:after{content:'';display:block;position:absolute;top:0;right:0;bottom:0;width:25px;background-image:-webkit-gradient(linear,right top,left top,from(rgba(255,255,255,1)),to(rgba(255,255,255,0)));background-image:-webkit-linear-gradient(right,rgba(255,255,255,1),rgba(255,255,255,0));background-image:-moz-linear-gradient(right,rgba(255,255,255,1),rgba(255,255,255,0));background-image:-o-linear-gradient(right,rgba(255,255,255,1),rgba(255,255,255,0));background-image:linear-gradient(to left,rgba(255,255,255,1),rgba(255,255,255,0))}.media-selection .attachment .filename{display:none}.media-sid
 ebar .settings-save-status{background:#f5f5f5;float:right;text-transform:none;z-index:10}.media-sidebar .settings-save-status .spinner{background:url(../images/wpspin.gif) no-repeat;background-size:16px 16px;display:none;float:right;opacity:.7;filter:alpha(opacity=70);width:16px;height:16px;margin:0 5px 0}.media-sidebar .settings-save-status .saved{float:right;display:none}.media-sidebar .save-waiting .settings-save-status .spinner,.media-sidebar .save-complete .settings-save-status .saved{display:block}.attachment-details{position:relative;overflow:auto}.attachment-info{overflow:hidden;min-height:60px;margin-bottom:16px;line-height:18px;color:#999;border-bottom:1px solid #e5e5e5;box-shadow:0 1px 0 #fff;padding-bottom:11px}.attachment-info .filename{font-weight:bold;color:#464646;word-wrap:break-word}.attachment-info .thumbnail{position:relative;float:left;max-width:120px;max-height:120px;margin-right:10px;margin-bottom:5px}.uploading .attachment-info .thumbnail{width:120px;
 height:80px;box-shadow:inset 0 0 15px rgba(0,0,0,0.1)}.uploading .attachment-info .media-progress-bar{margin-top:35px}.attachment-info .thumbnail:after{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;box-shadow:inset 0 0 0 1px rgba(0,0,0,0.15);overflow:hidden}.attachment-info .thumbnail img{display:block;max-width:120px;max-height:120px;margin:0 auto}.attachment-info .details{float:left;font-size:12px;max-width:100%}.attachment-info .delete-attachment a{color:red;padding:2px 4px;margin:-2px -4px;text-decoration:none;white-space:nowrap}.attachment-info .delete-attachment a:hover{color:#fff;background:red}.attachment-display-settings{width:100%;float:left;overflow:hidden}.attachment-display-settings h4{margin:1.4em 0 .4em}.gallery-settings{overflow:hidden}.embed-url{display:block;position:relative;height:40px;padding:0 16px 16px;margin:0;z-index:250;background:#fff;border-bottom:1px solid #dfdfdf;box-shadow:0 4px 4px -4px rgba(0,0,0,0.1);font-size:18px
 ;font-weight:200}.media-frame .embed-url input{font-size:18px;padding:12px 14px;width:100%;min-width:200px;box-shadow:inset 2px 2px 4px -2px rgba(0,0,0,0.1)}.embed-link-settings,.embed-image-settings{position:absolute;background:#f5f5f5;top:57px;left:0;right:0;bottom:0;padding:16px 16px 32px;overflow:auto}.media-embed .thumbnail{max-width:100%;max-height:200px;position:relative;float:left}.media-embed .thumbnail img{max-height:200px}.media-embed .thumbnail:after{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;box-shadow:inset 0 0 0 1px rgba(0,0,0,0.1);overflow:hidden}.media-embed .setting{width:100%;margin-top:10px;float:left;display:block;clear:both}.media-embed .setting span{display:block;width:200px;font-size:13px;line-height:24px;color:#999;text-shadow:0 1px 0 #fff}.media-embed .setting .button-group{margin:2px 0}.media-embed .setting input,.media-embed .setting textarea{display:block;width:100%;max-width:400px;margin:1px 0}@media only screen and
  (max-width:900px){.media-frame-menu{width:139px}.media-menu&gt;a{padding:4px 10px}.media-frame-title,.media-frame-router,.media-frame-content,.media-frame-toolbar{left:140px}.media-sidebar{width:159px;padding:0 10px 24px}.attachments-browser .attachments,.attachments-browser .uploader-inline,.attachments-browser .media-toolbar{right:180px}.media-sidebar .setting input,.media-sidebar .setting textarea,.media-sidebar .setting span,.compat-item label span{float:none}.media-sidebar .setting span,.compat-item label span{text-align:inherit;display:block;min-height:16px;margin:0;padding:8px 2px 0}.media-sidebar .setting input,.media-sidebar .setting textarea,.media-sidebar .setting select{width:98%;max-width:none}.media-sidebar .setting select.columns{width:auto}.media-frame-content .media-toolbar-primary,.media-frame-content .media-toolbar-secondary{display:inline;float:none}.media-frame-content .media-toolbar-primary .search,.media-frame-content .media-toolbar-secondary select{m
 ax-width:45%}.media-frame input,.media-frame textarea,.media-frame .search{padding:3px 6px}.media-frame-content .attachment .icon{top:40%}.media-selection{min-width:120px}.media-selection:after{background:0}.media-selection .attachments{display:none}.media-menu .separator{margin:12px 10px}}@media only screen and (max-width:600px){.media-modal{width:540px;position:absolute}.media-modal-backdrop{width:600px;position:absolute}}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.media-modal-icon{background-image:url(../images/uploader-icons-2x.png);background-size:134px 15px}.media-sidebar .settings-save-status .spinner{background-image:url(../images/wpspin-2x.gif)}}
</del><span class="cx">\ No newline at end of file
</span><ins>+.media-modal,.media-frame{font-family:sans-serif;font-size:12px}.media-frame input,.media-frame textarea{padding:6px 8px;line-height:16px}.media-frame select,.wp-admin .media-frame select{line-height:28px;margin-top:3px}.media-frame a{color:#21759b}.media-frame a:hover{color:#d54e21}.media-frame a.button{color:#333}.media-frame a.button:hover{color:#222}.media-frame a.button-primary,.media-frame a.button-primary:hover{color:#fff}.media-frame input[type=&quot;text&quot;],.media-frame input[type=&quot;password&quot;],.media-frame input[type=&quot;number&quot;],.media-frame input[type=&quot;search&quot;],.media-frame input[type=&quot;email&quot;],.media-frame input[type=&quot;url&quot;],.media-frame textarea,.media-frame select{font-family:sans-serif;font-size:12px;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-border-radius:3px;border-radius:3px;border-width:1px;border-style:solid;border-color:#dfdfd
 f}.media-frame input:disabled,.media-frame textarea:disabled,.media-frame input[readonly],.media-frame textarea[readonly]{background-color:#eee}.media-frame input[type=&quot;search&quot;]{-webkit-appearance:textfield}.media-frame :-moz-placeholder{color:#a9a9a9}.ui-sortable,.ui-draggable{-ms-touch-action:none}.media-modal{position:fixed;top:30px;left:30px;right:30px;bottom:30px;z-index:160000}.media-modal-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;min-height:360px;background:#000;opacity:.7;z-index:159900}.media-modal-close{position:absolute;top:7px;right:7px;width:30px;height:30px;z-index:1000}.media-modal-close span{display:block;margin:8px auto 0;width:15px;height:15px;background-position:-100px 0}.media-modal-close:active{outline:0}.media-modal-content{position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;min-height:300px;background:#fff}.media-modal-icon{background-image:url(../images/uploader-icons.png);background-repeat:no-repeat}.media-toolbar{posi
 tion:absolute;top:0;left:0;right:0;z-index:100;height:60px;padding:0 16px;border:0 solid #dfdfdf}.media-toolbar-primary{float:right}.media-toolbar-secondary{float:left}.media-toolbar-primary&gt;.media-button,.media-toolbar-primary&gt;.media-button-group{margin-left:10px;float:left;margin-top:15px}.media-toolbar-secondary&gt;.media-button,.media-toolbar-secondary&gt;.media-button-group{margin-right:10px;float:left;margin-top:15px}.media-sidebar{position:absolute;top:0;right:0;bottom:0;width:267px;padding:0 16px 24px;z-index:75;background:#f5f5f5;border-left:1px solid #dfdfdf;overflow:auto;-webkit-overflow-scrolling:touch}.hide-toolbar .media-sidebar{bottom:0}.media-sidebar .sidebar-title{font-weight:200;font-size:20px;margin:0;padding:12px 10px 10px;line-height:28px}.media-sidebar .sidebar-content{padding:0 10px;margin-bottom:130px}.media-sidebar .search{display:block;width:100%}.media-sidebar h3{position:relative;font-weight:bold;text-transform:uppercase;font-size:12px;color
 :#777;text-shadow:0 1px 0 #fff;margin:24px 0 8px}.media-sidebar .setting{display:block;float:left;width:100%;margin:1px 0}.media-sidebar .setting span{min-width:30%;margin-right:4%;font-size:12px}.media-sidebar .setting select{max-width:65%;*max-width:55%}.media-sidebar .setting input[type=&quot;checkbox&quot;]{width:auto;float:none;margin-top:8px;padding:0}.media-sidebar .setting span,.compat-item label span{float:left;min-height:22px;padding-top:8px;line-height:16px;text-align:right;font-weight:normal;color:#999;text-shadow:0 1px 0 #fff}.media-sidebar .setting input,.media-sidebar .setting textarea{width:65%;*width:55%;float:right}.media-sidebar .setting textarea,.compat-item .field textarea{height:62px;resize:vertical}.media-sidebar select{margin-top:3px}.compat-item{float:left;width:100%;overflow:hidden}.compat-item table{width:100%;table-layout:fixed;border-spacing:0;border:0}.compat-item tr{padding:2px 0;display:block;overflow:hidden}.compat-item .label,.compat-item .f
 ield{display:block;margin:0;padding:0}.compat-item .label{min-width:30%;margin-right:4%;float:left;text-align:right}.compat-item .label span{display:block;width:100%}.compat-item .field{float:right;width:65%;padding-right:1px}.compat-item .field input{width:100%;margin:0}.media-menu{position:absolute;top:0;left:0;right:0;bottom:0;margin:0;padding:16px 0;border-right:1px solid #d9d9d9;box-shadow:inset -6px 0 6px -6px rgba(0,0,0,0.2);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.media-menu&gt;a{display:block;position:relative;padding:4px 20px;margin:0;line-height:18px;font-size:14px;color:#21759b;text-shadow:0 1px 0 #fff;text-decoration:none}.media-menu&gt;a:hover{color:#21759b;background:rgba(0,0,0,0.04)}.media-menu&gt;a:active{outline:0}.media-menu .active,.media-menu .active:hover{color:#333;font-weight:bold}.media-menu .separator{height:0;margin:12px 20px;padding:0;border-top:1px solid #dfdfdf;border-bottom:1px solid #fff}.media-rout
 er{position:relative;padding:0 6px;margin:0;clear:both;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.media-router&gt;a{position:relative;float:left;padding:2px 10px;margin:0;height:18px;line-height:18px;font-size:14px;border-right:1px solid #dfdfdf;text-shadow:0 1px 0 #fff;text-decoration:none}.media-router&gt;a:last-child{border-right:0}.media-router&gt;a:active,.media-router&gt;a:focus{outline:0}.media-router .active,.media-router .active:hover{color:#333}.media-router .active:after{content:'';display:block;margin:-100px auto 0;width:7px;height:7px;background:#fff;box-shadow:1px 1px 1px rgba(0,0,0,0.2);z-index:300;-webkit-transform:rotate(45deg) translate(75px,75px);-moz-transform:rotate(45deg) translate(75px,75px);-ms-transform:rotate(45deg) translate(75px,75px);-o-transform:rotate(45deg) translate(75px,75px);transform:rotate(45deg) translate(75px,75px)}.media-frame{overflow:hidden;position:absolute;top:0;left:0;right:0;bottom:0}.me
 dia-frame-menu{position:absolute;top:0;left:0;bottom:0;width:199px;z-index:150}.media-frame-title{position:absolute;top:0;left:200px;right:0;height:45px;z-index:200}.media-frame-router{position:absolute;top:45px;left:200px;right:0;height:30px;z-index:200;border-bottom:1px solid #dfdfdf;box-shadow:0 4px 4px -4px rgba(0,0,0,0.1)}.media-frame-content{position:absolute;top:75px;left:200px;right:0;bottom:61px;height:auto;width:auto;margin:0;overflow:auto}.media-frame-toolbar{position:absolute;left:200px;right:0;bottom:0;height:60px;z-index:100;border:0 solid #dfdfdf;border-width:1px 0 0 0;box-shadow:0 -4px 4px -4px rgba(0,0,0,0.1)}.media-frame.hide-menu .media-frame-title,.media-frame.hide-menu .media-frame-router,.media-frame.hide-menu .media-frame-toolbar,.media-frame.hide-menu .media-frame-content{left:0}.media-frame.hide-menu .media-frame-menu{left:-200px}.media-frame.hide-toolbar .media-frame-content{bottom:0}.media-frame.hide-toolbar .media-frame-toolbar{bottom:-61px}.media
 -frame.hide-router .media-frame-content{top:45px}.media-frame.hide-router .media-frame-router{display:none}.media-frame.hide-router .media-frame-title{border-bottom:1px solid #dfdfdf;box-shadow:0 4px 4px -4px rgba(0,0,0,0.1)}.media-frame .media-toolbar .add-to-gallery{display:none}.media-frame-title h1{padding:0 16px;font-size:22px;font-weight:200;line-height:45px;margin:0}.media-frame .media-iframe{overflow:hidden}.media-frame .media-iframe,.media-frame .media-iframe iframe{height:100%;width:100%}.media-frame select.attachment-filters{margin-top:11px;margin-right:10px}.media-frame .search{margin-top:11px;padding:4px;line-height:18px;font-size:13px;color:#464646;font-family:sans-serif;-webkit-appearance:none}.media-toolbar-secondary .search{margin-right:16px}.attachments{margin:0;padding-right:16px;-webkit-overflow-scrolling:touch}.attachment{position:relative;float:left;padding:0;margin:0 10px 20px;color:#464646;list-style:none;text-align:center;-webkit-user-select:none;-mo
 z-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.selected.attachment{box-shadow:0 0 0 1px #fff,0 0 0 3px #ccc}.details.attachment{box-shadow:0 0 0 1px #fff,0 0 0 5px #1e8cbe}.attachment-preview{position:relative;width:199px;height:199px;box-shadow:inset 0 0 15px rgba(0,0,0,0.1),inset 0 0 0 1px rgba(0,0,0,0.05);background:#eee;cursor:pointer}.attachment .icon{margin:0 auto;overflow:hidden;padding-top:20%}.attachment .thumbnail{display:block;position:absolute;top:0;left:0;margin:0 auto;overflow:hidden;max-width:100%;max-height:100%}.attachment-preview .thumbnail:after{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;box-shadow:inset 0 0 0 1px rgba(0,0,0,0.1);overflow:hidden}.attachment .thumbnail img{top:0;left:0}.attachment .thumbnail .centered{position:absolute;top:0;left:0;width:100%;height:100%;-webkit-transform:translate(50%,50%);-moz-transform:translate(50%,50%);-ms-transform:translate(50%,50%);-o-transform:translate(5
 0%,50%);transform:translate(50%,50%)}.attachment .thumbnail .centered img{-webkit-transform:translate(-50%,-50%);-moz-transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);-o-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.attachment .filename{position:absolute;left:0;right:0;bottom:0;overflow:hidden;max-height:100%;word-wrap:break-word;text-align:center;font-weight:bold;background:rgba(255,255,255,0.8);box-shadow:inset 0 0 0 1px rgba(0,0,0,0.15)}.attachment .filename div{padding:5px 10px}.attachment-preview .thumbnail{width:199px;height:199px}.attachment .thumbnail img{position:absolute}.attachment .close{display:none;position:absolute;top:5px;right:5px;height:22px;width:22px;padding:0;font-size:20px;line-height:20px;text-align:center;text-decoration:none;color:#464646;background-color:#fff;background-position:-96px 4px;border-width:0;border-radius:3px;box-shadow:0 0 0 1px rgba(0,0,0,0.3)}.attachment .close:hover{box-shadow:0 0 0 1px rgba(0,0,0,0.
 6)}.attachment:hover .close{display:block}.attachment .check{display:none;height:24px;width:24px;position:absolute;top:-7px;right:-7px;outline:0;border:1px solid #fff;border-radius:3px;box-shadow:0 0 0 1px rgba(0,0,0,0.4);background:#f1f1f1;background-image:-webkit-gradient(linear,left top,left bottom,from(#f1f1f1),to(#e1e1e1));background-image:-webkit-linear-gradient(top,#f1f1f1,#e1e1e1);background-image:-moz-linear-gradient(top,#f1f1f1,#e1e1e1);background-image:-o-linear-gradient(top,#f1f1f1,#e1e1e1);background-image:linear-gradient(to bottom,#f1f1f1,#e1e1e1)}.attachment .check div{background-position:-1px 0;height:15px;width:15px;margin:5px}.attachment .check:hover div{background-position:-40px 0}.attachment.selected .check{display:block}.attachment.details .check{box-shadow:0 0 0 1px #1e8cbe;background:#1e8cbe;background-image:-webkit-gradient(linear,left top,left bottom,from(#1e8cbe),to(#0074a2));background-image:-webkit-linear-gradient(top,#1e8cbe,#0074a2);background-i
 mage:-moz-linear-gradient(top,#1e8cbe,#0074a2);background-image:-o-linear-gradient(top,#1e8cbe,#0074a2);background-image:linear-gradient(to bottom,#1e8cbe,#0074a2)}.attachment.details .check div{background-position:-21px 0}.attachment.details .check:hover div{background-position:-60px 0}.media-frame .attachment .describe{position:relative;display:block;width:100%;*width:183px;margin:-1px 0 0;padding:8px;font-size:12px;border-radius:0}.media-frame .attachments-browser{position:relative;width:100%;height:100%;overflow:hidden}.attachments-browser .media-toolbar{right:300px;height:50px}.attachments-browser .media-toolbar-primary&gt;.media-button,.attachments-browser .media-toolbar-primary&gt;.media-button-group,.attachments-browser .media-toolbar-secondary&gt;.media-button,.attachments-browser .media-toolbar-secondary&gt;.media-button-group{margin-top:10px}.attachments-browser .attachments,.attachments-browser .uploader-inline{position:absolute;top:50px;left:0;right:300px;bottom
 :0;overflow:auto}.attachments-browser .instructions{display:inline-block;margin-top:16px;line-height:18px;font-size:13px;color:#999}.media-progress-bar{position:relative;height:10px;width:70%;margin:10px auto;border-radius:10px;background:#dfdfdf;background:rgba(0,0,0,0.1)}.media-progress-bar div{height:10px;min-width:20px;width:0;background:#aaa;background:rgba(0,0,0,0.2);border-radius:10px;-webkit-transition:width 300ms;-moz-transition:width 300ms;-ms-transition:width 300ms;-o-transition:width 300ms;transition:width 300ms}.media-uploader-status .media-progress-bar{display:none;width:100%}.uploading.media-uploader-status .media-progress-bar{display:block}.attachment-preview .media-progress-bar{position:absolute;top:50%;left:15%;width:70%;margin:-5px 0 0 0}.media-uploader-status{position:relative;margin:0 auto;padding-bottom:10px;max-width:400px}.media-sidebar .media-uploader-status{border-bottom:1px solid #dfdfdf;box-shadow:0 1px 0 #fff}.uploader-inline .media-uploader-stat
 us h3{display:none}.media-uploader-status .upload-details{display:none;font-size:12px;color:#666;text-shadow:0 1px 0 #fff}.uploading.media-uploader-status .upload-details{display:block}.media-uploader-status .upload-detail-separator{padding:0 4px}.media-uploader-status .upload-count{color:#464646}.media-uploader-status .upload-dismiss-errors,.media-uploader-status .upload-errors{display:none}.errors.media-uploader-status .upload-dismiss-errors,.errors.media-uploader-status .upload-errors{display:block}.media-uploader-status .upload-dismiss-errors{text-decoration:none}.media-sidebar .media-uploader-status .upload-dismiss-errors{position:absolute;top:0;right:0}.upload-errors .upload-error{margin:8px auto 0 auto;padding:8px;border:1px #c00 solid;background:#ffebe8;border-radius:3px}.upload-errors .upload-error-label{padding:2px 4px;margin-right:8px;font-weight:bold;color:#fff;background:#e00;background-image:-webkit-gradient(linear,left top,left bottom,from(#e00),to(#a00));back
 ground-image:-webkit-linear-gradient(top,#e00,#a00);background-image:-moz-linear-gradient(top,#e00,#a00);background-image:-o-linear-gradient(top,#e00,#a00);background-image:linear-gradient(to bottom,#e00,#a00);border-radius:3px}.upload-errors .upload-error-message{display:block;padding-top:8px;color:#b44;word-wrap:break-word}.uploader-window{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,86,132,0.9);z-index:250000;display:none;text-align:center;opacity:0;-webkit-transition:opacity 250ms;-moz-transition:opacity 250ms;-ms-transition:opacity 250ms;-o-transition:opacity 250ms;transition:opacity 250ms}.uploader-window-content{position:absolute;top:10px;left:10px;right:10px;bottom:10px;border:1px dashed #fff}.uploader-window h3{position:absolute;top:50%;left:0;right:0;-webkit-transform:translateY(-50%);-moz-transform:translateY(-50%);-ms-transform:translateY(-50%);-o-transform:translateY(-50%);transform:translateY(-50%);font-size:20px;font-weight:200;color:#fff;pad
 ding:0}.uploader-window .media-progress-bar{margin-top:20px;max-width:300px;background:transparent;border-color:#fff;display:none}.uploader-window .media-progress-bar div{background:#fff}.uploading .uploader-window .media-progress-bar{display:block}.media-frame .uploader-inline{margin:20px;padding:20px;text-align:center}.uploader-inline-content{position:absolute;top:30%;left:0;right:0}.uploader-inline-content .upload-ui{margin:4em 0}.uploader-inline .has-upload-message .upload-ui{margin:0 0 4em}.uploader-inline h3{font-size:20px;line-height:28px;font-weight:200;margin-bottom:1.6em}.uploader-inline .has-upload-message .upload-instructions{font-size:14px;color:#464646;font-weight:normal}.uploader-inline .drop-instructions{display:none}.supports-drag-drop .uploader-inline .drop-instructions{display:block}.uploader-inline p{font-size:12px}.uploader-inline .media-progress-bar{display:none}.uploading.uploader-inline .media-progress-bar{display:block}.uploader-inline .browser{displ
 ay:inline-block!important}.media-selection{position:absolute;top:0;left:0;right:350px;height:60px;padding:0 0 0 16px;overflow:hidden;white-space:nowrap}.media-selection .selection-info{display:inline-block;font-size:12px;height:60px;margin-right:10px;vertical-align:top}.media-selection.empty,.media-selection.editing{display:none}.media-selection.one .edit-selection{display:none}.media-selection .count{display:block;padding-top:12px;font-size:14px;line-height:20px;font-weight:bold}.media-selection .selection-info a{display:block;float:left;padding:1px 8px;margin:1px 8px 1px -8px;line-height:16px;text-decoration:none;border-right:1px solid #dfdfdf;color:#21759b}.media-selection .selection-info a:hover{background:#21759b;color:#fff;border-color:transparent}.media-selection .selection-info a:last-child{border-right:0;margin-right:0}.media-selection .selection-info .clear-selection{color:red}.media-selection .selection-info .clear-selection:hover{background:red}.media-selection .
 selection-view{display:inline-block}.media-selection .attachments{display:inline-block;height:48px;margin-top:5px;overflow:hidden;vertical-align:top}.media-selection .attachment .icon{width:50%}.attachment.selection.selected{box-shadow:none}.attachment.selection.details{box-shadow:0 0 0 1px #fff,0 0 0 4px #1e8cbe}.media-selection .attachment.selection.details{box-shadow:0 0 0 1px #fff,0 0 0 3px #1e8cbe}.media-selection:after{content:'';display:block;position:absolute;top:0;right:0;bottom:0;width:25px;background-image:-webkit-gradient(linear,right top,left top,from(rgba(255,255,255,1)),to(rgba(255,255,255,0)));background-image:-webkit-linear-gradient(right,rgba(255,255,255,1),rgba(255,255,255,0));background-image:-moz-linear-gradient(right,rgba(255,255,255,1),rgba(255,255,255,0));background-image:-o-linear-gradient(right,rgba(255,255,255,1),rgba(255,255,255,0));background-image:linear-gradient(to left,rgba(255,255,255,1),rgba(255,255,255,0))}.media-selection .attachment .file
 name{display:none}.media-sidebar .settings-save-status{background:#f5f5f5;float:right;text-transform:none;z-index:10}.media-sidebar .settings-save-status .spinner{background:url(../images/wpspin.gif) no-repeat;background-size:16px 16px;display:none;float:right;opacity:.7;filter:alpha(opacity=70);width:16px;height:16px;margin:0 5px 0}.media-sidebar .settings-save-status .saved{float:right;display:none}.media-sidebar .save-waiting .settings-save-status .spinner,.media-sidebar .save-complete .settings-save-status .saved{display:block}.attachment-details{position:relative;overflow:auto}.attachment-info{overflow:hidden;min-height:60px;margin-bottom:16px;line-height:18px;color:#999;border-bottom:1px solid #e5e5e5;box-shadow:0 1px 0 #fff;padding-bottom:11px}.attachment-info .filename{font-weight:bold;color:#464646;word-wrap:break-word}.attachment-info .thumbnail{position:relative;float:left;max-width:120px;max-height:120px;margin-right:10px;margin-bottom:5px}.uploading .attachment-
 info .thumbnail{width:120px;height:80px;box-shadow:inset 0 0 15px rgba(0,0,0,0.1)}.uploading .attachment-info .media-progress-bar{margin-top:35px}.attachment-info .thumbnail:after{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;box-shadow:inset 0 0 0 1px rgba(0,0,0,0.15);overflow:hidden}.attachment-info .thumbnail img{display:block;max-width:120px;max-height:120px;margin:0 auto}.attachment-info .details{float:left;font-size:12px;max-width:100%}.attachment-info .delete-attachment a{color:red;padding:2px 4px;margin:-2px -4px;text-decoration:none;white-space:nowrap}.attachment-info .delete-attachment a:hover{color:#fff;background:red}.attachment-display-settings{width:100%;float:left;overflow:hidden}.attachment-display-settings h4{margin:1.4em 0 .4em}.gallery-settings{overflow:hidden}.embed-url{display:block;position:relative;height:40px;padding:0 16px 16px;margin:0;z-index:250;background:#fff;border-bottom:1px solid #dfdfdf;box-shadow:0 4px 4px -4px rg
 ba(0,0,0,0.1);font-size:18px;font-weight:200}.media-frame .embed-url input{font-size:18px;padding:12px 14px;width:100%;min-width:200px;box-shadow:inset 2px 2px 4px -2px rgba(0,0,0,0.1)}.embed-link-settings,.embed-image-settings{position:absolute;background:#f5f5f5;top:57px;left:0;right:0;bottom:0;padding:16px 16px 32px;overflow:auto}.media-embed .thumbnail{max-width:100%;max-height:200px;position:relative;float:left}.media-embed .thumbnail img{max-height:200px}.media-embed .thumbnail:after{content:'';display:block;position:absolute;top:0;left:0;right:0;bottom:0;box-shadow:inset 0 0 0 1px rgba(0,0,0,0.1);overflow:hidden}.media-embed .setting{width:100%;margin-top:10px;float:left;display:block;clear:both}.media-embed .setting span{display:block;width:200px;font-size:13px;line-height:24px;color:#999;text-shadow:0 1px 0 #fff}.media-embed .setting .button-group{margin:2px 0}.media-embed .setting input,.media-embed .setting textarea{display:block;width:100%;max-width:400px;margin:
 1px 0}@media only screen and (max-width:900px){.media-frame-menu{width:139px}.media-menu&gt;a{padding:4px 10px}.media-frame-title,.media-frame-router,.media-frame-content,.media-frame-toolbar{left:140px}.media-sidebar{width:159px;padding:0 10px 24px}.attachments-browser .attachments,.attachments-browser .uploader-inline,.attachments-browser .media-toolbar{right:180px}.media-sidebar .setting input,.media-sidebar .setting textarea,.media-sidebar .setting span,.compat-item label span{float:none}.media-sidebar .setting span,.compat-item label span{text-align:inherit;display:block;min-height:16px;margin:0;padding:8px 2px 0}.media-sidebar .setting input,.media-sidebar .setting textarea,.media-sidebar .setting select{width:98%;max-width:none}.media-sidebar .setting select.columns{width:auto}.media-frame-content .media-toolbar-primary,.media-frame-content .media-toolbar-secondary{display:inline;float:none}.media-frame-content .media-toolbar-primary .search,.media-frame-content .medi
 a-toolbar-secondary select{max-width:45%}.media-frame input,.media-frame textarea,.media-frame .search{padding:3px 6px}.media-frame-content .attachment .icon{top:40%}.media-selection{min-width:120px}.media-selection:after{background:0}.media-selection .attachments{display:none}.media-menu .separator{margin:12px 10px}}@media only screen and (max-width:600px){.media-modal{width:540px;position:absolute}.media-modal-backdrop{width:600px;position:absolute}}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.media-modal-icon{background-image:url(../images/uploader-icons-2x.png);background-size:134px 15px}.media-sidebar .settings-save-status .spinner{background-image:url(../images/wpspin-2x.gif)}}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjsmediaviewsminjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/media-views.min.js (23053 => 23054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/media-views.min.js        2012-12-05 00:45:21 UTC (rev 23053)
+++ trunk/wp-includes/js/media-views.min.js        2012-12-05 00:58:31 UTC (rev 23054)
</span><span class="lines">@@ -1 +1 @@
</span><del>-(function(e){var f=wp.media,d=f.model.Attachment,c=f.model.Attachments,a=f.model.Query,b;b=f.view.l10n=typeof _wpMediaViewsL10n===&quot;undefined&quot;?{}:_wpMediaViewsL10n;f.view.settings=b.settings||{};delete b.settings;f.model.settings.post=f.view.settings.post;e.support.transition=(function(){var g=document.documentElement.style,h={WebkitTransition:&quot;webkitTransitionEnd&quot;,MozTransition:&quot;transitionend&quot;,OTransition:&quot;oTransitionEnd otransitionend&quot;,transition:&quot;transitionend&quot;},i;i=_.find(_.keys(h),function(j){return !_.isUndefined(g[j])});return i&amp;&amp;{end:h[i]}}());f.transition=function(g,h){var i=e.Deferred();h=h||2000;if(e.support.transition){if(!(g instanceof e)){g=e(g)}g.first().one(e.support.transition.end,i.resolve);_.delay(i.resolve,h)}else{i.resolve()}return i.promise()};f.controller.Region=function(g){_.extend(this,_.pick(g||{},&quot;id&quot;,&quot;view&quot;,&quot;selector&quot;))};f.controller.Region.extend=Ba
 ckbone.Model.extend;_.extend(f.controller.Region.prototype,{mode:function(g){if(!g){return this._mode}if(g===this._mode){return this}this.trigger(&quot;deactivate&quot;);this._mode=g;this.render(g);this.trigger(&quot;activate&quot;);return this},render:function(h){if(h&amp;&amp;h!==this._mode){return this.mode(h)}var i={view:null},g;this.trigger(&quot;create&quot;,i);g=i.view;this.trigger(&quot;render&quot;,g);if(g){this.set(g)}return this},get:function(){return this.view.views.first(this.selector)},set:function(g,h){if(h){h.add=false}return this.view.views.set(this.selector,g,h)},trigger:function(h){var i;if(!this._mode){return}var g=_.toArray(arguments);i=this.id+&quot;:&quot;+h;g[0]=i+&quot;:&quot;+this._mode;this.view.trigger.apply(this.view,g);g[0]=i;this.view.trigger.apply(this.view,g);return this}});f.controller.StateMachine=function(g){this.states=new Backbone.Collection(g)};f.controller.StateMachine.extend=Backbone.Model.extend;_.extend(f.controller.StateMachine.pro
 totype,Backbone.Events,{state:function(g){this.states=this.states||new Backbone.Collection();g=g||this._state;if(g&amp;&amp;!this.states.get(g)){this.states.add({id:g})}return this.states.get(g)},setState:function(h){var g=this.state();if((g&amp;&amp;h===g.id)||!this.states||!this.states.get(h)){return this}if(g){g.trigger(&quot;deactivate&quot;);this._lastState=g.id}this._state=h;this.state().trigger(&quot;activate&quot;);return this},lastState:function(){if(this._lastState){return this.state(this._lastState)}}});_.each([&quot;on&quot;,&quot;off&quot;,&quot;trigger&quot;],function(g){f.controller.StateMachine.prototype[g]=function(){this.states=this.states||new Backbone.Collection();this.states[g].apply(this.states,arguments);return this}});f.controller.State=Backbone.Model.extend({constructor:function(){this.on(&quot;activate&quot;,this._preActivate,this);this.on(&quot;activate&quot;,this.activate,this);this.on(&quot;activate&quot;,this._postActivate,this);this.on(&quot;de
 activate&quot;,this._deactivate,this);this.on(&quot;deactivate&quot;,this.deactivate,this);this.on(&quot;reset&quot;,this.reset,this);this.on(&quot;ready&quot;,this._ready,this);this.on(&quot;ready&quot;,this.ready,this);this.on(&quot;change:menu&quot;,this._updateMenu,this);Backbone.Model.apply(this,arguments)},ready:function(){},activate:function(){},deactivate:function(){},reset:function(){},_ready:function(){this._updateMenu()},_preActivate:function(){this.active=true},_postActivate:function(){this.on(&quot;change:menu&quot;,this._menu,this);this.on(&quot;change:titleMode&quot;,this._title,this);this.on(&quot;change:content&quot;,this._content,this);this.on(&quot;change:toolbar&quot;,this._toolbar,this);this.frame.on(&quot;title:render:default&quot;,this._renderTitle,this);this._title();this._menu();this._toolbar();this._content();this._router()},_deactivate:function(){this.active=false;this.frame.off(&quot;title:render:default&quot;,this._renderTitle,this);this.off(&quo
 t;change:menu&quot;,this._menu,this);this.off(&quot;change:titleMode&quot;,this._title,this);this.off(&quot;change:content&quot;,this._content,this);this.off(&quot;change:toolbar&quot;,this._toolbar,this)},_title:function(){this.frame.title.render(this.get(&quot;titleMode&quot;)||&quot;default&quot;)},_renderTitle:function(g){g.$el.text(this.get(&quot;title&quot;)||&quot;&quot;)},_router:function(){var h=this.frame.router,i=this.get(&quot;router&quot;),g;this.frame.$el.toggleClass(&quot;hide-router&quot;,!i);if(!i){return}this.frame.router.render(i);g=h.get();if(g.select){g.select(this.frame.content.mode())}},_menu:function(){var i=this.frame.menu,h=this.get(&quot;menu&quot;),g;if(!h){return}i.mode(h);g=i.get();if(g.select){g.select(this.id)}},_updateMenu:function(){var g=this.previous(&quot;menu&quot;),h=this.get(&quot;menu&quot;);if(g){this.frame.off(&quot;menu:render:&quot;+g,this._renderMenu,this)}if(h){this.frame.on(&quot;menu:render:&quot;+h,this._renderMenu,this)}},_r
 enderMenu:function(g){var i=this.get(&quot;menuItem&quot;),j=this.get(&quot;title&quot;),h=this.get(&quot;priority&quot;);if(!i&amp;&amp;j){i={text:j};if(h){i.priority=h}}if(!i){return}g.set(this.id,i)}});_.each([&quot;toolbar&quot;,&quot;content&quot;],function(g){f.controller.State.prototype[&quot;_&quot;+g]=function(){var h=this.get(g);if(h){this.frame[g].render(h)}}});f.controller.Library=f.controller.State.extend({defaults:{id:&quot;library&quot;,multiple:false,describe:false,toolbar:&quot;select&quot;,sidebar:&quot;settings&quot;,content:&quot;upload&quot;,router:&quot;browse&quot;,searchable:true,filterable:false,sortable:true,title:b.mediaLibraryTitle,contentUserSetting:true,syncLastSelection:true},initialize:function(){if(!this.get(&quot;selection&quot;)){this.set(&quot;selection&quot;,new f.model.Selection(null,{multiple:this.get(&quot;multiple&quot;)}))}if(!this.get(&quot;library&quot;)){this.set(&quot;library&quot;,f.query())}if(!this.get(&quot;edge&quot;)){this.
 set(&quot;edge&quot;,120)}if(!this.get(&quot;gutter&quot;)){this.set(&quot;gutter&quot;,8)}this.resetDisplays()},activate:function(){if(this.get(&quot;syncLastSelection&quot;)){this.getLastSelection()}this._excludeStateLibrary();this.buildComposite();this.on(&quot;change:library change:exclude&quot;,this.buildComposite,this);this.on(&quot;change:excludeState&quot;,this._excludeState,this);wp.Uploader.queue.on(&quot;add&quot;,this.uploading,this);this.get(&quot;selection&quot;).on(&quot;add remove reset&quot;,this.refreshContent,this);this.on(&quot;insert&quot;,this._insertDisplaySettings,this);if(this.get(&quot;contentUserSetting&quot;)){this.frame.on(&quot;content:activate&quot;,this.saveContentMode,this);this.set(&quot;content&quot;,getUserSetting(&quot;libraryContent&quot;,this.get(&quot;content&quot;)))}},deactivate:function(){this.frame.off(&quot;content:activate&quot;,this.saveContentMode,this);this.get(&quot;selection&quot;).off(null,null,this);wp.Uploader.queue.off(n
 ull,null,this);this.off(&quot;change:excludeState&quot;,this._excludeState,this);this.off(&quot;change:library change:exclude&quot;,this.buildComposite,this);this.destroyComposite()},reset:function(){this.get(&quot;selection&quot;).reset();this.resetDisplays();this.refreshContent()},resetDisplays:function(){this._displays=[];this._defaultDisplaySettings={align:getUserSetting(&quot;align&quot;,&quot;none&quot;),size:getUserSetting(&quot;imgsize&quot;,&quot;medium&quot;),link:getUserSetting(&quot;urlbutton&quot;,&quot;post&quot;)}},display:function(h){var g=this._displays;if(!g[h.cid]){g[h.cid]=new Backbone.Model(this._defaultDisplaySettings)}return g[h.cid]},_insertDisplaySettings:function(){var g=this.get(&quot;selection&quot;),h;if(g.length!==1){return}h=this.display(g.first()).toJSON();setUserSetting(&quot;align&quot;,h.align);setUserSetting(&quot;imgsize&quot;,h.size);setUserSetting(&quot;urlbutton&quot;,h.link)},getLastSelection:function(){var j=this.get(&quot;selection&
 quot;),i=this.frame.lastState(),h=i&amp;&amp;i.get(&quot;selection&quot;),g,k;if(!h){return}g=!!h.multiple;k=!!j.multiple;if(g!==k){return}j.reset(h.toArray()).single(h.single())},refreshContent:function(){var h=this.get(&quot;selection&quot;),j=this.frame,g=j.router,i=j.content.mode();if(this.active&amp;&amp;!h.length&amp;&amp;!g.get(i)){this.frame.content.render(this.get(&quot;content&quot;))}},uploading:function(h){var g=this.frame.content;if(&quot;upload&quot;===g.mode()){this.frame.content.mode(&quot;browse&quot;)}if(this.get(&quot;multiple&quot;)){this.get(&quot;selection&quot;).add(h)}},saveContentMode:function(){if(&quot;browse&quot;!==this.get(&quot;router&quot;)){return}var h=this.frame.content.mode(),g=this.frame.router.get();if(g&amp;&amp;g.get(h)){setUserSetting(&quot;libraryContent&quot;,h)}},buildComposite:function(){var h=this.get(&quot;_library&quot;),g=this.get(&quot;exclude&quot;),i;this.destroyComposite();if(!this.get(&quot;exclude&quot;)){return}if(!h){t
 his.set(&quot;_library&quot;,h=this.get(&quot;library&quot;))}i=new f.model.Attachments(null,{props:_.pick(h.props.toJSON(),&quot;order&quot;,&quot;orderby&quot;)});i.validator=function(j){return !!h.getByCid(j.cid)&amp;&amp;!g.getByCid(j.cid)};i.mirror(h).observe(g);this.set(&quot;library&quot;,i)},destroyComposite:function(){var h=this.get(&quot;library&quot;),g=this.get(&quot;_library&quot;);if(!g){return}h.unobserve();this.set(&quot;library&quot;,g);this.unset(&quot;_library&quot;)},_excludeState:function(){var h=this.get(&quot;excludeState&quot;),g=this.previous(&quot;excludeState&quot;);if(g){this.frame.state(g).off(&quot;change:library&quot;,this._excludeStateLibrary,this)}if(h){this.frame.state(h).on(&quot;change:library&quot;,this._excludeStateLibrary,this)}},_excludeStateLibrary:function(){var g=this.get(&quot;excludeState&quot;);if(!g){return}this.set(&quot;exclude&quot;,this.frame.state(g).get(&quot;library&quot;))}});f.controller.GalleryEdit=f.controller.Library
 .extend({defaults:{id:&quot;gallery-edit&quot;,multiple:false,describe:true,edge:199,editing:false,sortable:true,searchable:false,toolbar:&quot;gallery-edit&quot;,content:&quot;browse&quot;,title:b.editGalleryTitle,priority:60,dragInfo:true},initialize:function(){if(!this.get(&quot;library&quot;)){this.set(&quot;library&quot;,new f.model.Selection())}if(!this.get(&quot;AttachmentView&quot;)){this.set(&quot;AttachmentView&quot;,f.view.Attachment.EditLibrary)}f.controller.Library.prototype.initialize.apply(this,arguments)},activate:function(){var g=this.get(&quot;library&quot;);g.props.set(&quot;type&quot;,&quot;image&quot;);this.get(&quot;library&quot;).observe(wp.Uploader.queue);this.frame.on(&quot;content:render:browse&quot;,this.gallerySettings,this);f.controller.Library.prototype.activate.apply(this,arguments)},deactivate:function(){this.get(&quot;library&quot;).unobserve(wp.Uploader.queue);this.frame.off(&quot;content:render:browse&quot;,this.gallerySettings,this);f.cont
 roller.Library.prototype.deactivate.apply(this,arguments)},gallerySettings:function(h){var g=this.get(&quot;library&quot;);if(!g||!h){return}g.gallery=g.gallery||new Backbone.Model();h.sidebar.set({gallery:new f.view.Settings.Gallery({controller:this,model:g.gallery,priority:40})});h.toolbar.set(&quot;reverse&quot;,{text:b.reverseOrder,priority:80,click:function(){g.reset(g.toArray().reverse())}})}});f.controller.FeaturedImage=f.controller.Library.extend({defaults:_.defaults({id:&quot;featured-image&quot;,filterable:&quot;uploaded&quot;,multiple:false,menu:&quot;main&quot;,toolbar:&quot;featured-image&quot;,title:b.featuredImageTitle,priority:60},f.controller.Library.prototype.defaults),initialize:function(){var h,g;if(!this.get(&quot;library&quot;)){this.set(&quot;library&quot;,f.query({type:&quot;image&quot;}))}f.controller.Library.prototype.initialize.apply(this,arguments);h=this.get(&quot;library&quot;);g=h.comparator;h.comparator=function(j,i){var l=!!this.mirroring.get
 ByCid(j.cid),k=!!this.mirroring.getByCid(i.cid);if(!l&amp;&amp;k){return -1}else{if(l&amp;&amp;!k){return 1}else{return g.apply(this,arguments)}}};h.observe(this.get(&quot;selection&quot;))},activate:function(){var g=this.get(&quot;selection&quot;),i=f.view.settings.post.featuredImageId,h;if(&quot;&quot;!==i&amp;&amp;-1!==i){h=d.get(i);h.fetch()}g.reset(h?[h]:[]);f.controller.Library.prototype.activate.apply(this,arguments)}});f.controller.Embed=f.controller.State.extend({defaults:{id:&quot;embed&quot;,url:&quot;&quot;,menu:&quot;main&quot;,content:&quot;embed&quot;,toolbar:&quot;main-embed&quot;,type:&quot;link&quot;,title:b.fromUrlTitle,priority:120},sensitivity:200,initialize:function(){this.debouncedScan=_.debounce(_.bind(this.scan,this),this.sensitivity);this.props=new Backbone.Model({url:&quot;&quot;});this.props.on(&quot;change:url&quot;,this.debouncedScan,this);this.props.on(&quot;change:url&quot;,this.refresh,this);this.on(&quot;scan&quot;,this.scanImage,this)},scan
 :function(){var g={type:&quot;link&quot;};this.trigger(&quot;scan&quot;,g);this.set(g)},scanImage:function(g){var k=this.frame,i=this,h=this.props.get(&quot;url&quot;),j=new Image();j.onload=function(){if(i!==k.state()||h!==i.props.get(&quot;url&quot;)){return}i.set({type:&quot;image&quot;,width:j.width,height:j.height})};j.src=h},refresh:function(){this.frame.toolbar.get().refresh()},reset:function(){this.props=new Backbone.Model({url:&quot;&quot;});if(this.active){this.refresh()}}});f.Views=function(h,g){this.view=h;this._views=_.isArray(g)?{&quot;&quot;:g}:g||{}};f.Views.extend=Backbone.Model.extend;_.extend(f.Views.prototype,{all:function(){return _.flatten(this._views)},get:function(g){g=g||&quot;&quot;;return this._views[g]},first:function(g){var h=this.get(g);return h&amp;&amp;h.length?h[0]:null},set:function(g,h,i){var k,j;if(!_.isString(g)){i=h;h=g;g=&quot;&quot;}i=i||{};h=_.isArray(h)?h:[h];k=this.get(g);j=h;if(k){if(i.add){if(_.isUndefined(i.at)){j=k.concat(h)}els
 e{j=k;j.splice.apply(j,[i.at,0].concat(h))}}else{_.each(j,function(l){l.__detach=true});_.each(k,function(l){if(l.__detach){l.$el.detach()}else{l.dispose()}});_.each(j,function(l){delete l.__detach})}}this._views[g]=j;_.each(h,function(n){var l=n.Views||f.Views,m=n.views=n.views||new l(n);m.parent=this.view;m.selector=g},this);if(!i.silent){this._attach(g,h,_.extend({ready:this._isReady()},i))}return this},add:function(g,h,i){if(!_.isString(g)){i=h;h=g;g=&quot;&quot;}return this.set(g,h,_.extend({add:true},i))},unset:function(g,h,i){var j;if(!_.isString(g)){i=h;h=g;g=&quot;&quot;}h=h||[];if(j=this.get(g)){h=_.isArray(h)?h:[h];this._views[g]=h.length?_.difference(j,h):[]}if(!i||!i.silent){_.invoke(h,&quot;dispose&quot;)}return this},detach:function(){e(_.pluck(this.all(),&quot;el&quot;)).detach();return this},render:function(){var g={ready:this._isReady()};_.each(this._views,function(i,h){this._attach(h,i,g)},this);this.rendered=true;return this},dispose:function(g){if(!g||!g
 .silent){if(this.parent&amp;&amp;this.parent.views){this.parent.views.unset(this.selector,this.view,{silent:true})}delete this.parent;delete this.selector}_.invoke(this.all(),&quot;dispose&quot;);this._views=[];return this},replace:function(g,h){g.html(h);return this},insert:function(h,k,j){var g=j&amp;&amp;j.at,i;if(_.isNumber(g)&amp;&amp;(i=h.children()).length&gt;g){i.eq(g).before(k)}else{h.append(k)}return this},ready:function(){this.view.trigger(&quot;ready&quot;);_.chain(this.all()).map(function(g){return g.views}).flatten().where({attached:true}).invoke(&quot;ready&quot;)},_attach:function(g,h,i){var k=g?this.view.$(g):this.view.$el,j;if(!k.length){return this}j=_.chain(h).pluck(&quot;views&quot;).flatten().value();_.each(j,function(l){if(l.rendered){return}l.view.render();l.rendered=true},this);this[i.add?&quot;insert&quot;:&quot;replace&quot;](k,_.pluck(h,&quot;el&quot;),i);_.each(j,function(l){l.attached=true;if(i.ready){l.ready()}},this);return this},_isReady:func
 tion(){var g=this.view.el;while(g){if(g===document.body){return true}g=g.parentNode}return false}});f.View=Backbone.View.extend({Views:f.Views,constructor:function(g){this.views=new this.Views(this,this.views);this.on(&quot;ready&quot;,this.ready,this);if(g&amp;&amp;g.controller){this.controller=g.controller}Backbone.View.apply(this,arguments)},dispose:function(){this.undelegateEvents();if(this.model&amp;&amp;this.model.off){this.model.off(null,null,this)}if(this.collection&amp;&amp;this.collection.off){this.collection.off(null,null,this)}if(this.controller&amp;&amp;this.controller.off){this.controller.off(null,null,this)}if(this.views){this.views.dispose()}return this},remove:function(){this.dispose();return Backbone.View.prototype.remove.apply(this,arguments)},render:function(){var g;if(this.prepare){g=this.prepare()}this.views.detach();if(this.template){g=g||{};this.trigger(&quot;prepare&quot;,g);this.$el.html(this.template(g))}this.views.render();return this},prepare:fun
 ction(){return this.options},ready:function(){}});f.view.Frame=f.View.extend({initialize:function(){this._createRegions();this._createStates()},_createRegions:function(){this.regions=this.regions?this.regions.slice():[];_.each(this.regions,function(g){this[g]=new f.controller.Region({view:this,id:g,selector:&quot;.media-frame-&quot;+g})},this)},_createStates:function(){this.states=new Backbone.Collection(null,{model:f.controller.State});this.states.on(&quot;add&quot;,function(g){g.frame=this;g.trigger(&quot;ready&quot;)},this)},reset:function(){this.states.invoke(&quot;trigger&quot;,&quot;reset&quot;);return this}});_.extend(f.view.Frame.prototype,f.controller.StateMachine.prototype);f.view.MediaFrame=f.view.Frame.extend({className:&quot;media-frame&quot;,template:f.template(&quot;media-frame&quot;),regions:[&quot;menu&quot;,&quot;title&quot;,&quot;content&quot;,&quot;toolbar&quot;,&quot;router&quot;],initialize:function(){f.view.Frame.prototype.initialize.apply(this,argumen
 ts);_.defaults(this.options,{title:&quot;&quot;,modal:true,uploader:true});this.$el.addClass(&quot;wp-core-ui&quot;);if(this.options.modal){this.modal=new f.view.Modal({controller:this,title:this.options.title});this.modal.content(this)}if(wp.Uploader.limitExceeded||!wp.Uploader.browser.supported){this.options.uploader=false}if(this.options.uploader){this.uploader=new f.view.UploaderWindow({controller:this,uploader:{dropzone:this.modal?this.modal.$el:this.$el,container:this.$el}});this.views.set(&quot;.media-frame-uploader&quot;,this.uploader)}this.on(&quot;attach&quot;,_.bind(this.views.ready,this.views),this);this.on(&quot;title:create:default&quot;,this.createTitle,this);this.title.mode(&quot;default&quot;)},render:function(){if(!this.state()&amp;&amp;this.options.state){this.setState(this.options.state)}return f.view.Frame.prototype.render.apply(this,arguments)},createTitle:function(g){g.view=new f.View({controller:this,tagName:&quot;h1&quot;})},createMenu:function(g){g.
 view=new f.view.Menu({controller:this})},createToolbar:function(g){g.view=new f.view.Toolbar({controller:this})},createRouter:function(g){g.view=new f.view.Router({controller:this})},createIframeStates:function(g){var j=f.view.settings,i=j.tabs,k=j.tabUrl,h;if(!i||!k){return}h=e(&quot;#post_ID&quot;);if(h.length){k+=&quot;&amp;post_id=&quot;+h.val()}_.each(i,function(m,n){var l=this.state(&quot;iframe:&quot;+n).set(_.defaults({tab:n,src:k+&quot;&amp;tab=&quot;+n,title:m,content:&quot;iframe&quot;,menu:&quot;main&quot;},g))},this);this.on(&quot;content:create:iframe&quot;,this.iframeContent,this);this.on(&quot;menu:render:main&quot;,this.iframeMenu,this);this.on(&quot;open&quot;,this.hijackThickbox,this);this.on(&quot;close&quot;,this.restoreThickbox,this)},iframeContent:function(g){this.$el.addClass(&quot;hide-toolbar&quot;);g.view=new f.view.Iframe({controller:this})},iframeMenu:function(h){var g={};if(!h){return}_.each(f.view.settings.tabs,function(i,j){g[&quot;iframe:&quo
 t;+j]={text:this.state(&quot;iframe:&quot;+j).get(&quot;title&quot;),priority:200}},this);h.set(g)},hijackThickbox:function(){var g=this;if(!window.tb_remove||this._tb_remove){return}this._tb_remove=window.tb_remove;window.tb_remove=function(){g.close();g.reset();g.setState(g.options.state);g._tb_remove.call(window)}},restoreThickbox:function(){if(!this._tb_remove){return}window.tb_remove=this._tb_remove;delete this._tb_remove}});_.each([&quot;open&quot;,&quot;close&quot;,&quot;attach&quot;,&quot;detach&quot;,&quot;escape&quot;],function(g){f.view.MediaFrame.prototype[g]=function(h){if(this.modal){this.modal[g].apply(this.modal,arguments)}return this}});f.view.MediaFrame.Select=f.view.MediaFrame.extend({initialize:function(){f.view.MediaFrame.prototype.initialize.apply(this,arguments);_.defaults(this.options,{selection:[],library:{},multiple:false,state:&quot;library&quot;});this.createSelection();this.createStates();this.bindHandlers()},createSelection:function(){var g=this
 ,h=this.options.selection;if(!(h instanceof f.model.Selection)){this.options.selection=new f.model.Selection(h,{multiple:this.options.multiple})}},createStates:function(){var g=this.options;this.states.add([new f.controller.Library({selection:g.selection,library:f.query(g.library),multiple:g.multiple,menu:&quot;main&quot;,title:g.title,priority:20})])},bindHandlers:function(){this.on(&quot;menu:create:main&quot;,this.createMenu,this);this.on(&quot;router:create:browse&quot;,this.createRouter,this);this.on(&quot;router:render:browse&quot;,this.browseRouter,this);this.on(&quot;content:create:browse&quot;,this.browseContent,this);this.on(&quot;content:render:upload&quot;,this.uploadContent,this);this.on(&quot;toolbar:create:select&quot;,this.createSelectToolbar,this)},browseRouter:function(g){g.set({upload:{text:b.uploadFilesTitle,priority:20},browse:{text:b.mediaLibraryTitle,priority:40}})},browseContent:function(g){var h=this.state();this.$el.removeClass(&quot;hide-toolbar&qu
 ot;);g.view=new f.view.AttachmentsBrowser({controller:this,collection:h.get(&quot;library&quot;),selection:h.get(&quot;selection&quot;),model:h,sortable:h.get(&quot;sortable&quot;),search:h.get(&quot;searchable&quot;),filters:h.get(&quot;filterable&quot;),display:h.get(&quot;displaySettings&quot;),dragInfo:h.get(&quot;dragInfo&quot;),AttachmentView:h.get(&quot;AttachmentView&quot;)})},uploadContent:function(){this.$el.removeClass(&quot;hide-toolbar&quot;);this.content.set(new f.view.UploaderInline({controller:this}))},createSelectToolbar:function(h,g){g=g||this.options.button||{};g.controller=this;h.view=new f.view.Toolbar.Select(g)}});f.view.MediaFrame.Post=f.view.MediaFrame.Select.extend({initialize:function(){_.defaults(this.options,{multiple:true,editing:false,state:&quot;insert&quot;});f.view.MediaFrame.Select.prototype.initialize.apply(this,arguments);this.createIframeStates()},createStates:function(){var g=this.options,h=g.selection;this.states.add([new f.controller.L
 ibrary({id:&quot;insert&quot;,title:b.insertMediaTitle,priority:20,menu:&quot;main&quot;,toolbar:&quot;main-insert&quot;,filterable:&quot;all&quot;,library:f.query(g.library),selection:h,multiple:g.multiple?&quot;reset&quot;:false,editable:true,displaySettings:true,displayUserSettings:true}),new f.controller.Library({id:&quot;gallery&quot;,title:b.createGalleryTitle,priority:40,menu:&quot;main&quot;,toolbar:&quot;main-gallery&quot;,filterable:&quot;uploaded&quot;,multiple:&quot;add&quot;,editable:false,library:f.query(_.defaults({type:&quot;image&quot;},g.library)),selection:new f.model.Selection(h.models,{multiple:&quot;add&quot;})}),new f.controller.Embed(),new f.controller.GalleryEdit({library:g.selection,editing:g.editing,menu:&quot;gallery&quot;}),new f.controller.Library({id:&quot;gallery-library&quot;,library:f.query({type:&quot;image&quot;}),filterable:&quot;uploaded&quot;,multiple:&quot;add&quot;,menu:&quot;gallery&quot;,toolbar:&quot;gallery-add&quot;,excludeState:
 &quot;gallery-edit&quot;,title:b.addToGalleryTitle,priority:100})]);if(f.view.settings.post.featuredImageId){this.states.add(new f.controller.FeaturedImage({controller:this,menu:&quot;main&quot;}))}},bindHandlers:function(){f.view.MediaFrame.Select.prototype.bindHandlers.apply(this,arguments);this.on(&quot;menu:create:gallery&quot;,this.createMenu,this);this.on(&quot;toolbar:create:main-insert&quot;,this.createToolbar,this);this.on(&quot;toolbar:create:main-gallery&quot;,this.createToolbar,this);this.on(&quot;toolbar:create:featured-image&quot;,this.featuredImageToolbar,this);this.on(&quot;toolbar:create:main-embed&quot;,this.mainEmbedToolbar,this);var g={menu:{main:&quot;mainMenu&quot;,gallery:&quot;galleryMenu&quot;},content:{embed:&quot;embedContent&quot;,&quot;edit-selection&quot;:&quot;editSelectionContent&quot;},toolbar:{&quot;main-insert&quot;:&quot;mainInsertToolbar&quot;,&quot;main-gallery&quot;:&quot;mainGalleryToolbar&quot;,&quot;gallery-edit&quot;:&quot;galleryEd
 itToolbar&quot;,&quot;gallery-add&quot;:&quot;galleryAddToolbar&quot;}};_.each(g,function(i,h){_.each(i,function(k,j){this.on(h+&quot;:render:&quot;+j,this[k],this)},this)},this)},mainMenu:function(g){g.set({&quot;library-separator&quot;:new f.View({className:&quot;separator&quot;,priority:100})})},galleryMenu:function(g){var h=this.lastState(),i=h&amp;&amp;h.id,j=this;g.set({cancel:{text:b.cancelGalleryTitle,priority:20,click:function(){if(i){j.setState(i)}else{j.close()}}},separateCancel:new f.View({className:&quot;separator&quot;,priority:40})})},embedContent:function(){var g=new f.view.Embed({controller:this,model:this.state()}).render();this.content.set(g);g.url.focus()},editSelectionContent:function(){var i=this.state(),h=i.get(&quot;selection&quot;),g;g=new f.view.AttachmentsBrowser({controller:this,collection:h,selection:h,model:i,sortable:true,search:false,dragInfo:true,AttachmentView:f.view.Attachment.EditSelection}).render();g.toolbar.set(&quot;backToLibrary&quot;
 ,{text:b.returnToLibrary,priority:-100,click:function(){this.controller.content.mode(&quot;browse&quot;)}});this.content.set(g)},selectionStatusToolbar:function(g){var h=this.state().get(&quot;editable&quot;);g.set(&quot;selection&quot;,new f.view.Selection({controller:this,collection:this.state().get(&quot;selection&quot;),priority:-40,editable:h&amp;&amp;function(){this.controller.content.mode(&quot;edit-selection&quot;)}}).render())},mainInsertToolbar:function(h){var g=this;this.selectionStatusToolbar(h);h.set(&quot;insert&quot;,{style:&quot;primary&quot;,priority:80,text:b.insertIntoPost,requires:{selection:true},click:function(){var j=g.state(),i=j.get(&quot;selection&quot;);g.close();j.trigger(&quot;insert&quot;,i).reset()}})},mainGalleryToolbar:function(h){var g=this;this.selectionStatusToolbar(h);h.set(&quot;gallery&quot;,{style:&quot;primary&quot;,text:b.createNewGallery,priority:60,requires:{selection:true},click:function(){var i=g.state().get(&quot;selection&quot;
 ),j=g.state(&quot;gallery-edit&quot;),k=i.where({type:&quot;image&quot;});j.set(&quot;library&quot;,new f.model.Selection(k,{props:i.props.toJSON(),multiple:true}));this.controller.setState(&quot;gallery-edit&quot;)}})},featuredImageToolbar:function(g){this.createSelectToolbar(g,{text:b.setFeaturedImage,state:this.options.state||&quot;upload&quot;})},mainEmbedToolbar:function(g){g.view=new f.view.Toolbar.Embed({controller:this})},galleryEditToolbar:function(){var g=this.state().get(&quot;editing&quot;);this.toolbar.set(new f.view.Toolbar({controller:this,items:{insert:{style:&quot;primary&quot;,text:g?b.updateGallery:b.insertGallery,priority:80,requires:{library:true},click:function(){var h=this.controller,i=h.state();h.close();i.trigger(&quot;update&quot;,i.get(&quot;library&quot;));h.reset();h.setState(&quot;upload&quot;)}}}}))},galleryAddToolbar:function(){this.toolbar.set(new f.view.Toolbar({controller:this,items:{insert:{style:&quot;primary&quot;,text:b.addToGallery,pri
 ority:80,click:function(){var g=this.controller,i=g.state(),h=g.state(&quot;gallery-edit&quot;);h.get(&quot;library&quot;).add(i.get(&quot;selection&quot;).models);i.trigger(&quot;reset&quot;);g.setState(&quot;gallery-edit&quot;)}}}}))}});f.view.Modal=f.View.extend({tagName:&quot;div&quot;,template:f.template(&quot;media-modal&quot;),attributes:{tabindex:0},events:{&quot;click .media-modal-backdrop, .media-modal-close&quot;:&quot;escapeHandler&quot;,keydown:&quot;keydown&quot;},initialize:function(){_.defaults(this.options,{container:document.body,title:&quot;&quot;,propagate:true,freeze:document.body})},prepare:function(){return{title:this.options.title}},attach:function(){if(this.views.attached){return this}if(!this.views.rendered){this.render()}this.$el.appendTo(this.options.container);this.views.attached=true;this.views.ready();return this.propagate(&quot;attach&quot;)},detach:function(){if(this.$el.is(&quot;:visible&quot;)){this.close()}this.$el.detach();this.views.atta
 ched=false;return this.propagate(&quot;detach&quot;)},open:function(){var i=this.$el,h=this.options,g;if(i.is(&quot;:visible&quot;)){return this}if(!this.views.attached){this.attach()}if(h.freeze){g=e(h.freeze);this._freeze={overflow:g.css(&quot;overflow&quot;),scrollTop:e(window).scrollTop()};g.css(&quot;overflow&quot;,&quot;hidden&quot;)}i.show().focus();return this.propagate(&quot;open&quot;)},close:function(g){var h=this._freeze;if(!this.views.attached||!this.$el.is(&quot;:visible&quot;)){return this}this.$el.hide();this.propagate(&quot;close&quot;);if(h){e(this.options.freeze).css(&quot;overflow&quot;,h.overflow);e(window).scrollTop(h.scrollTop)}if(g&amp;&amp;g.escape){this.propagate(&quot;escape&quot;)}return this},escape:function(){return this.close({escape:true})},escapeHandler:function(g){g.preventDefault();this.escape()},content:function(g){this.views.set(&quot;.media-modal-content&quot;,g);return this},propagate:function(g){this.trigger(g);if(this.options.propagat
 e){this.controller.trigger(g)}return this},keydown:function(g){if(27===g.which){g.preventDefault();this.escape();return}}});f.view.UploaderWindow=f.View.extend({tagName:&quot;div&quot;,className:&quot;uploader-window&quot;,template:f.template(&quot;uploader-window&quot;),initialize:function(){var g;this.$browser=e('&lt;a href=&quot;#&quot; class=&quot;browser&quot; /&gt;').hide().appendTo(&quot;body&quot;);g=this.options.uploader=_.defaults(this.options.uploader||{},{dropzone:this.$el,browser:this.$browser,params:{}});if(g.dropzone&amp;&amp;!(g.dropzone instanceof e)){g.dropzone=e(g.dropzone)}this.controller.on(&quot;activate&quot;,this.refresh,this)},refresh:function(){if(this.uploader){this.uploader.refresh()}},ready:function(){var h=f.view.settings.post.id,g;if(this.uploader){return}if(h){this.options.uploader.params.post_id=h}this.uploader=new wp.Uploader(this.options.uploader);g=this.uploader.dropzone;g.on(&quot;dropzone:enter&quot;,_.bind(this.show,this));g.on(&quot;dr
 opzone:leave&quot;,_.bind(this.hide,this))},show:function(){var g=this.$el.show();_.defer(function(){g.css({opacity:1})})},hide:function(){var g=this.$el.css({opacity:0});f.transition(g).done(function(){if(&quot;0&quot;===g.css(&quot;opacity&quot;)){g.hide()}})}});f.view.UploaderInline=f.View.extend({tagName:&quot;div&quot;,className:&quot;uploader-inline&quot;,template:f.template(&quot;uploader-inline&quot;),initialize:function(){_.defaults(this.options,{message:&quot;&quot;,status:true});if(!this.options.$browser&amp;&amp;this.controller.uploader){this.options.$browser=this.controller.uploader.$browser}if(_.isUndefined(this.options.postId)){this.options.postId=f.view.settings.post.id}if(this.options.status){this.views.set(&quot;.upload-inline-status&quot;,new f.view.UploaderStatus({controller:this.controller}))}},ready:function(){var g=this.options.$browser,h;if(this.controller.uploader){h=this.$(&quot;.browser&quot;);if(h[0]===g[0]){return}g.detach().text(h.text());g[0].c
 lassName=h[0].className;h.replaceWith(g.show())}return this}});f.view.UploaderStatus=f.View.extend({className:&quot;media-uploader-status&quot;,template:f.template(&quot;uploader-status&quot;),events:{&quot;click .upload-dismiss-errors&quot;:&quot;dismiss&quot;},initialize:function(){this.queue=wp.Uploader.queue;this.queue.on(&quot;add remove reset&quot;,this.visibility,this);this.queue.on(&quot;add remove reset change:percent&quot;,this.progress,this);this.queue.on(&quot;add remove reset change:uploading&quot;,this.info,this);this.errors=wp.Uploader.errors;this.errors.reset();this.errors.on(&quot;add remove reset&quot;,this.visibility,this);this.errors.on(&quot;add&quot;,this.error,this)},dispose:function(){wp.Uploader.queue.off(null,null,this);f.View.prototype.dispose.apply(this,arguments);return this},visibility:function(){this.$el.toggleClass(&quot;uploading&quot;,!!this.queue.length);this.$el.toggleClass(&quot;errors&quot;,!!this.errors.length);this.$el.toggle(!!this.qu
 eue.length||!!this.errors.length)},ready:function(){_.each({&quot;$bar&quot;:&quot;.media-progress-bar div&quot;,&quot;$index&quot;:&quot;.upload-index&quot;,&quot;$total&quot;:&quot;.upload-total&quot;,&quot;$filename&quot;:&quot;.upload-filename&quot;},function(g,h){this[h]=this.$(g)},this);this.visibility();this.progress();this.info()},progress:function(){var g=this.queue,i=this.$bar,h=0;if(!i||!g.length){return}i.width((g.reduce(function(j,l){if(!l.get(&quot;uploading&quot;)){return j+100}var k=l.get(&quot;percent&quot;);return j+(_.isNumber(k)?k:100)},0)/g.length)+&quot;%&quot;)},info:function(){var g=this.queue,h=0,i;if(!g.length){return}i=this.queue.find(function(k,j){h=j;return k.get(&quot;uploading&quot;)});this.$index.text(h+1);this.$total.text(g.length);this.$filename.html(i?this.filename(i.get(&quot;filename&quot;)):&quot;&quot;)},filename:function(g){return f.truncate(_.escape(g),24)},error:function(g){this.views.add(&quot;.upload-errors&quot;,new f.view.Uploade
 rStatusError({filename:this.filename(g.get(&quot;file&quot;).name),message:g.get(&quot;message&quot;)}),{at:0})},dismiss:function(g){var h=this.views.get(&quot;.upload-errors&quot;);g.preventDefault();if(h){_.invoke(h,&quot;remove&quot;)}wp.Uploader.errors.reset()}});f.view.UploaderStatusError=f.View.extend({className:&quot;upload-error&quot;,template:f.template(&quot;uploader-status-error&quot;)});f.view.Toolbar=f.View.extend({tagName:&quot;div&quot;,className:&quot;media-toolbar&quot;,initialize:function(){var i=this.controller.state(),h=this.selection=i.get(&quot;selection&quot;),g=this.library=i.get(&quot;library&quot;);this._views={};this.primary=new f.view.PriorityList();this.secondary=new f.view.PriorityList();this.primary.$el.addClass(&quot;media-toolbar-primary&quot;);this.secondary.$el.addClass(&quot;media-toolbar-secondary&quot;);this.views.set([this.secondary,this.primary]);if(this.options.items){this.set(this.options.items,{silent:true})}if(!this.options.silent)
 {this.render()}if(h){h.on(&quot;add remove reset&quot;,this.refresh,this)}if(g){g.on(&quot;add remove reset&quot;,this.refresh,this)}},dispose:function(){if(this.selection){this.selection.off(null,null,this)}if(this.library){this.library.off(null,null,this)}return f.View.prototype.dispose.apply(this,arguments)},ready:function(){this.refresh()},set:function(j,g,h){var i;h=h||{};if(_.isObject(j)){_.each(j,function(k,l){this.set(l,k,{silent:true})},this)}else{if(!(g instanceof Backbone.View)){g.classes=[&quot;media-button-&quot;+j].concat(g.classes||[]);g=new f.view.Button(g).render()}g.controller=g.controller||this.controller;this._views[j]=g;i=g.options.priority&lt;0?&quot;secondary&quot;:&quot;primary&quot;;this[i].set(j,g,h)}if(!h.silent){this.refresh()}return this},get:function(g){return this._views[g]},unset:function(h,g){delete this._views[h];this.primary.unset(h,g);this.secondary.unset(h,g);if(!g||!g.silent){this.refresh()}return this},refresh:function(){var i=this.cont
 roller.state(),g=i.get(&quot;library&quot;),h=i.get(&quot;selection&quot;);_.each(this._views,function(j){if(!j.model||!j.options||!j.options.requires){return}var l=j.options.requires,k=false;if(l.selection&amp;&amp;h&amp;&amp;!h.length){k=true}else{if(l.library&amp;&amp;g&amp;&amp;!g.length){k=true}}j.model.set(&quot;disabled&quot;,k)})}});f.view.Toolbar.Select=f.view.Toolbar.extend({initialize:function(){var h=this.options,g=h.controller,i=g.state().get(&quot;selection&quot;);_.bindAll(this,&quot;clickSelect&quot;);_.defaults(h,{event:&quot;select&quot;,state:false,reset:true,close:true,text:b.select,requires:{selection:true}});h.items=_.defaults(h.items||{},{select:{style:&quot;primary&quot;,text:h.text,priority:80,click:this.clickSelect,requires:h.requires}});f.view.Toolbar.prototype.initialize.apply(this,arguments)},clickSelect:function(){var h=this.options,g=this.controller;if(h.close){g.close()}if(h.event){g.state().trigger(h.event)}if(h.reset){g.reset()}if(h.state){g
 .setState(h.state)}}});f.view.Toolbar.Embed=f.view.Toolbar.Select.extend({initialize:function(){_.defaults(this.options,{text:b.insertIntoPost,requires:false});f.view.Toolbar.Select.prototype.initialize.apply(this,arguments)},refresh:function(){var g=this.controller.state().props.get(&quot;url&quot;);this.get(&quot;select&quot;).model.set(&quot;disabled&quot;,!g||/^https?:\/\/$/.test(g));f.view.Toolbar.Select.prototype.refresh.apply(this,arguments)}});f.view.Button=f.View.extend({tagName:&quot;a&quot;,className:&quot;media-button&quot;,attributes:{href:&quot;#&quot;},events:{click:&quot;click&quot;},defaults:{text:&quot;&quot;,style:&quot;&quot;,size:&quot;large&quot;,disabled:false},initialize:function(){this.model=new Backbone.Model(this.defaults);_.each(this.defaults,function(i,g){var h=this.options[g];if(_.isUndefined(h)){return}this.model.set(g,h);delete this.options[g]},this);this.model.on(&quot;change&quot;,this.render,this)},render:function(){var h=[&quot;button&quot
 ;,this.className],g=this.model.toJSON();if(g.style){h.push(&quot;button-&quot;+g.style)}if(g.size){h.push(&quot;button-&quot;+g.size)}h=_.uniq(h.concat(this.options.classes));this.el.className=h.join(&quot; &quot;);this.$el.attr(&quot;disabled&quot;,g.disabled);this.$el.text(this.model.get(&quot;text&quot;));return this},click:function(g){if(&quot;#&quot;===this.attributes.href){g.preventDefault()}if(this.options.click&amp;&amp;!this.model.get(&quot;disabled&quot;)){this.options.click.apply(this,arguments)}}});f.view.ButtonGroup=f.View.extend({tagName:&quot;div&quot;,className:&quot;button-group button-large media-button-group&quot;,initialize:function(){this.buttons=_.map(this.options.buttons||[],function(g){if(g instanceof Backbone.View){return g}else{return new f.view.Button(g).render()}});delete this.options.buttons;if(this.options.classes){this.$el.addClass(this.options.classes)}},render:function(){this.$el.html(e(_.pluck(this.buttons,&quot;el&quot;)).detach());return t
 his}});f.view.PriorityList=f.View.extend({tagName:&quot;div&quot;,initialize:function(){this._views={};this.set(_.extend({},this._views,this.options.views),{silent:true});delete this.options.views;if(!this.options.silent){this.render()}},set:function(l,h,j){var k,g,i;j=j||{};if(_.isObject(l)){_.each(l,function(m,n){this.set(n,m)},this);return this}if(!(h instanceof Backbone.View)){h=this.toView(h,l,j)}h.controller=h.controller||this.controller;this.unset(l);k=h.options.priority||10;g=this.views.get()||[];_.find(g,function(n,m){if(n.options.priority&gt;k){i=m;return true}});this._views[l]=h;this.views.add(h,{at:_.isNumber(i)?i:g.length||0});return this},get:function(g){return this._views[g]},unset:function(h){var g=this.get(h);if(g){g.remove()}delete this._views[h];return this},toView:function(g){return new f.View(g)}});f.view.MenuItem=f.View.extend({tagName:&quot;a&quot;,className:&quot;media-menu-item&quot;,attributes:{href:&quot;#&quot;},events:{click:&quot;_click&quot;},_
 click:function(g){var h=this.options.click;if(g){g.preventDefault()}if(h){h.call(this)}else{this.click()}},click:function(){var g=this.options.state;if(g){this.controller.setState(g)}},render:function(){var g=this.options;if(g.text){this.$el.text(g.text)}else{if(g.html){this.$el.html(g.html)}}return this}});f.view.Menu=f.view.PriorityList.extend({tagName:&quot;div&quot;,className:&quot;media-menu&quot;,property:&quot;state&quot;,ItemView:f.view.MenuItem,region:&quot;menu&quot;,toView:function(g,h){g=g||{};g[this.property]=g[this.property]||h;return new this.ItemView(g).render()},ready:function(){f.view.PriorityList.prototype.ready.apply(this,arguments);this.visibility()},set:function(){f.view.PriorityList.prototype.set.apply(this,arguments);this.visibility()},unset:function(){f.view.PriorityList.prototype.unset.apply(this,arguments);this.visibility()},visibility:function(){var j=this.region,h=this.controller[j].get(),g=this.views.get(),i=!g||g.length&lt;2;if(this===h){this.c
 ontroller.$el.toggleClass(&quot;hide-&quot;+j,i)}},select:function(h){var g=this.get(h);if(!g){return}this.deselect();g.$el.addClass(&quot;active&quot;)},deselect:function(){this.$el.children().removeClass(&quot;active&quot;)}});f.view.RouterItem=f.view.MenuItem.extend({click:function(){var g=this.options.contentMode;if(g){this.controller.content.mode(g)}}});f.view.Router=f.view.Menu.extend({tagName:&quot;div&quot;,className:&quot;media-router&quot;,property:&quot;contentMode&quot;,ItemView:f.view.RouterItem,region:&quot;router&quot;,initialize:function(){this.controller.on(&quot;content:render&quot;,this.update,this);f.view.Menu.prototype.initialize.apply(this,arguments)},update:function(){var g=this.controller.content.mode();if(g){this.select(g)}}});f.view.Sidebar=f.view.PriorityList.extend({className:&quot;media-sidebar&quot;});f.view.Attachment=f.View.extend({tagName:&quot;li&quot;,className:&quot;attachment&quot;,template:f.template(&quot;attachment&quot;),events:{&quot
 ;click .attachment-preview&quot;:&quot;toggleSelectionHandler&quot;,&quot;change [data-setting]&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] input&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] select&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] textarea&quot;:&quot;updateSetting&quot;,&quot;click .close&quot;:&quot;removeFromLibrary&quot;,&quot;click .check&quot;:&quot;removeFromSelection&quot;,&quot;click a&quot;:&quot;preventDefault&quot;},buttons:{},initialize:function(){var g=this.options.selection;this.model.on(&quot;change:sizes change:uploading change:caption change:title&quot;,this.render,this);this.model.on(&quot;change:percent&quot;,this.progress,this);this.model.on(&quot;add&quot;,this.select,this);this.model.on(&quot;remove&quot;,this.deselect,this);if(g){g.on(&quot;reset&quot;,this.updateSelect,this)}this.model.on(&quot;selection:single selection:unsingle&quot;,this.details,this);this.details(this.model,this.controller
 .state().get(&quot;selection&quot;))},dispose:function(){var g=this.options.selection;this.updateAll();if(g){g.off(null,null,this)}f.View.prototype.dispose.apply(this,arguments);return this},render:function(){var g=_.defaults(this.model.toJSON(),{orientation:&quot;landscape&quot;,uploading:false,type:&quot;&quot;,subtype:&quot;&quot;,icon:&quot;&quot;,filename:&quot;&quot;,caption:&quot;&quot;,title:&quot;&quot;,dateFormatted:&quot;&quot;,width:&quot;&quot;,height:&quot;&quot;,compat:false,alt:&quot;&quot;});g.buttons=this.buttons;g.describe=this.controller.state().get(&quot;describe&quot;);if(&quot;image&quot;===g.type){g.size=this.imageSize()}g.can={};if(g.nonces){g.can.remove=!!g.nonces[&quot;delete&quot;];g.can.save=!!g.nonces.update}this.views.detach();this.$el.html(this.template(g));this.$el.toggleClass(&quot;uploading&quot;,g.uploading);if(g.uploading){this.$bar=this.$(&quot;.media-progress-bar div&quot;)}else{delete this.$bar}this.updateSelect();this.updateSave();thi
 s.views.render();return this},progress:function(){if(this.$bar&amp;&amp;this.$bar.length){this.$bar.width(this.model.get(&quot;percent&quot;)+&quot;%&quot;)}},toggleSelectionHandler:function(g){var h;if(g.shiftKey){h=&quot;between&quot;}else{if(g.ctrlKey||g.metaKey){h=&quot;toggle&quot;}}this.toggleSelection({method:h})},toggleSelection:function(p){var k=this.collection,l=this.options.selection,j=this.model,g=p&amp;&amp;p.method,m,n,h,i,o;if(!l){return}m=l.single();g=_.isUndefined(g)?l.multiple:g;if(&quot;between&quot;===g&amp;&amp;m&amp;&amp;l.multiple){if(m===j){return}i=k.indexOf(m);o=k.indexOf(this.model);if(i&lt;o){h=k.models.slice(i,o+1)}else{h=k.models.slice(o,i+1)}l.add(h).single(j);return}else{if(&quot;toggle&quot;===g){l[this.selected()?&quot;remove&quot;:&quot;add&quot;](j).single(j);return}}if(g!==&quot;add&quot;){g=&quot;reset&quot;}if(this.selected()){l[m===j?&quot;remove&quot;:&quot;single&quot;](j)}else{l[g](j).single(j)}},updateSelect:function(){this[this.se
 lected()?&quot;select&quot;:&quot;deselect&quot;]()},selected:function(){var g=this.options.selection;if(g){return !!g.getByCid(this.model.cid)}},select:function(g,i){var h=this.options.selection;if(!h||(i&amp;&amp;i!==h)){return}this.$el.addClass(&quot;selected&quot;)},deselect:function(g,i){var h=this.options.selection;if(!h||(i&amp;&amp;i!==h)){return}this.$el.removeClass(&quot;selected&quot;)},details:function(g,j){var i=this.options.selection,h;if(i!==j){return}h=i.single();this.$el.toggleClass(&quot;details&quot;,h===this.model)},preventDefault:function(g){g.preventDefault()},imageSize:function(g){var h=this.model.get(&quot;sizes&quot;);g=g||&quot;medium&quot;;if(h&amp;&amp;h[g]){return _.clone(h[g])}else{return{url:this.model.get(&quot;url&quot;),width:this.model.get(&quot;width&quot;),height:this.model.get(&quot;height&quot;),orientation:this.model.get(&quot;orientation&quot;)}}},updateSetting:function(i){var g=e(i.target).closest(&quot;[data-setting]&quot;),h,j;if(!
 g.length){return}h=g.data(&quot;setting&quot;);j=i.target.value;if(this.model.get(h)!==j){this.save(h,j)}},save:function(){var g=this,i=this._save=this._save||{status:&quot;ready&quot;},h=this.model.save.apply(this.model,arguments),j=i.requests?e.when(h,i.requests):h;if(i.savedTimer){clearTimeout(i.savedTimer)}this.updateSave(&quot;waiting&quot;);i.requests=j;j.always(function(){if(i.requests!==j){return}g.updateSave(j.state()===&quot;resolved&quot;?&quot;complete&quot;:&quot;error&quot;);i.savedTimer=setTimeout(function(){g.updateSave(&quot;ready&quot;);delete i.savedTimer},2000)})},updateSave:function(g){var h=this._save=this._save||{status:&quot;ready&quot;};if(g&amp;&amp;g!==h.status){this.$el.removeClass(&quot;save-&quot;+h.status);h.status=g}this.$el.addClass(&quot;save-&quot;+h.status);return this},updateAll:function(){var h=this.$(&quot;[data-setting]&quot;),g=this.model,i;i=_.chain(h).map(function(k){var m=e(&quot;input, textarea, select, [value]&quot;,k),j,l;if(!m.
 length){return}j=e(k).data(&quot;setting&quot;);l=m.val();if(g.get(j)!==l){return[j,l]}}).compact().object().value();if(!_.isEmpty(i)){g.save(i)}},removeFromLibrary:function(g){g.stopPropagation();this.collection.remove(this.model)},removeFromSelection:function(h){var g=this.options.selection;if(!g){return}h.stopPropagation();g.remove(this.model)}});f.view.Attachment.Library=f.view.Attachment.extend({buttons:{check:true}});f.view.Attachment.EditLibrary=f.view.Attachment.extend({buttons:{close:true}});f.view.Attachments=f.View.extend({tagName:&quot;ul&quot;,className:&quot;attachments&quot;,cssTemplate:f.template(&quot;attachments-css&quot;),events:{scroll:&quot;scroll&quot;},initialize:function(){this.el.id=_.uniqueId(&quot;__attachments-view-&quot;);_.defaults(this.options,{refreshSensitivity:200,refreshThreshold:3,AttachmentView:f.view.Attachment,sortable:false});this._viewsByCid={};this.collection.on(&quot;add&quot;,function(i,g,h){this.views.add(this.createAttachmentView
 (i),{at:h.index})},this);this.collection.on(&quot;remove&quot;,function(j,g,i){var h=this._viewsByCid[j.cid];delete this._viewsByCid[j.cid];if(h){h.remove()}},this);this.collection.on(&quot;reset&quot;,this.render,this);this.scroll=_.chain(this.scroll).bind(this).throttle(this.options.refreshSensitivity).value();this.initSortable();_.bindAll(this,&quot;css&quot;);this.model.on(&quot;change:edge change:gutter&quot;,this.css,this);this._resizeCss=_.debounce(_.bind(this.css,this),this.refreshSensitivity);e(window).on(&quot;resize.attachments&quot;,this._resizeCss);this.css()},dispose:function(){this.collection.props.off(null,null,this);e(window).off(&quot;resize.attachments&quot;,this._resizeCss);f.View.prototype.dispose.apply(this,arguments)},css:function(){var g=e(&quot;#&quot;+this.el.id+&quot;-css&quot;);if(g.length){g.remove()}f.view.Attachments.$head().append(this.cssTemplate({id:this.el.id,edge:this.edge(),gutter:this.model.get(&quot;gutter&quot;)}))},edge:function(){var
  i=this.model.get(&quot;edge&quot;),j,h,g;if(!this.$el.is(&quot;:visible&quot;)){return i}j=this.model.get(&quot;gutter&quot;)*2;h=this.$el.width()-j;g=Math.ceil(h/(i+j));i=Math.floor((h-(g*j))/g);return i},initSortable:function(){var g=this.collection,h;if(!this.options.sortable||!e.fn.sortable){return}this.$el.sortable({disabled:!!g.comparator,containment:this.$el,tolerance:&quot;pointer&quot;,start:function(i,j){h=j.item.index()},update:function(k,l){var j=g.at(h),i=g.comparator;delete g.comparator;g.remove(j,{silent:true}).add(j,{silent:true,at:l.item.index()});g.comparator=i;g.trigger(&quot;reset&quot;,g);g.saveMenuOrder()}});g.props.on(&quot;change:orderby&quot;,function(){this.$el.sortable(&quot;option&quot;,&quot;disabled&quot;,!!g.comparator)},this);this.collection.props.on(&quot;change:orderby&quot;,this.refreshSortable,this);this.refreshSortable()},refreshSortable:function(){if(!this.options.sortable||!e.fn.sortable){return}var i=this.collection,h=i.props.get(&quo
 t;orderby&quot;),g=&quot;menuOrder&quot;===h||!i.comparator;this.$el.sortable(&quot;option&quot;,&quot;disabled&quot;,!g)},createAttachmentView:function(h){var g=new this.options.AttachmentView({controller:this.controller,model:h,collection:this.collection,selection:this.options.selection});return this._viewsByCid[h.cid]=g},prepare:function(){if(this.collection.length){this.views.set(this.collection.map(this.createAttachmentView,this))}else{this.views.unset();this.collection.more().done(this.scroll)}},ready:function(){this.scroll()},scroll:function(g){if(!this.$el.is(&quot;:visible&quot;)){return}if(this.collection.hasMore()&amp;&amp;this.el.scrollHeight&lt;this.el.scrollTop+(this.el.clientHeight*this.options.refreshThreshold)){this.collection.more().done(this.scroll)}}},{$head:(function(){var g;return function(){return g=g||e(&quot;head&quot;)}}())});f.view.Search=f.View.extend({tagName:&quot;input&quot;,className:&quot;search&quot;,attributes:{type:&quot;search&quot;,place
 holder:b.search},events:{input:&quot;search&quot;,keyup:&quot;search&quot;,change:&quot;search&quot;,search:&quot;search&quot;},render:function(){this.el.value=this.model.escape(&quot;search&quot;);return this},search:function(g){if(g.target.value){this.model.set(&quot;search&quot;,g.target.value)}else{this.model.unset(&quot;search&quot;)}}});f.view.AttachmentFilters=f.View.extend({tagName:&quot;select&quot;,className:&quot;attachment-filters&quot;,events:{change:&quot;change&quot;},keys:[],initialize:function(){this.createFilters();_.extend(this.filters,this.options.filters);this.$el.html(_.chain(this.filters).map(function(g,h){return{el:this.make(&quot;option&quot;,{value:h},g.text),priority:g.priority||50}},this).sortBy(&quot;priority&quot;).pluck(&quot;el&quot;).value());this.model.on(&quot;change&quot;,this.select,this);this.select()},createFilters:function(){this.filters={}},change:function(h){var g=this.filters[this.el.value];if(g){this.model.set(g.props)}},select:fun
 ction(){var g=this.model,i=&quot;all&quot;,h=g.toJSON();_.find(this.filters,function(k,l){var j=_.all(k.props,function(n,m){return n===(_.isUndefined(h[m])?null:h[m])});if(j){return i=l}});this.$el.val(i)}});f.view.AttachmentFilters.Uploaded=f.view.AttachmentFilters.extend({createFilters:function(){var h=this.model.get(&quot;type&quot;),g=f.view.settings.mimeTypes,i;if(g&amp;&amp;h){i=g[h]}this.filters={all:{text:i||b.allMediaItems,props:{uploadedTo:null,orderby:&quot;date&quot;,order:&quot;DESC&quot;},priority:10},uploaded:{text:b.uploadedToThisPost,props:{uploadedTo:f.view.settings.post.id,orderby:&quot;menuOrder&quot;,order:&quot;ASC&quot;},priority:20}}}});f.view.AttachmentFilters.All=f.view.AttachmentFilters.extend({createFilters:function(){var g={};_.each(f.view.settings.mimeTypes||{},function(i,h){g[h]={text:i,props:{type:h,uploadedTo:null,orderby:&quot;date&quot;,order:&quot;DESC&quot;}}});g.all={text:b.allMediaItems,props:{type:null,uploadedTo:null,orderby:&quot;dat
 e&quot;,order:&quot;DESC&quot;},priority:10};g.uploaded={text:b.uploadedToThisPost,props:{type:null,uploadedTo:f.view.settings.post.id,orderby:&quot;menuOrder&quot;,order:&quot;ASC&quot;},priority:20};this.filters=g}});f.view.AttachmentsBrowser=f.View.extend({tagName:&quot;div&quot;,className:&quot;attachments-browser&quot;,initialize:function(){_.defaults(this.options,{filters:false,search:true,display:false,AttachmentView:f.view.Attachment.Library});this.createToolbar();this.updateContent();this.createSidebar();this.collection.on(&quot;add remove reset&quot;,this.updateContent,this)},dispose:function(){this.options.selection.off(null,null,this);f.View.prototype.dispose.apply(this,arguments);return this},createToolbar:function(){var h,g;this.toolbar=new f.view.Toolbar({controller:this.controller});this.views.add(this.toolbar);h=this.options.filters;if(&quot;uploaded&quot;===h){g=f.view.AttachmentFilters.Uploaded}else{if(&quot;all&quot;===h){g=f.view.AttachmentFilters.All}}i
 f(g){this.toolbar.set(&quot;filters&quot;,new g({controller:this.controller,model:this.collection.props,priority:-80}).render())}if(this.options.search){this.toolbar.set(&quot;search&quot;,new f.view.Search({controller:this.controller,model:this.collection.props,priority:60}).render())}if(this.options.dragInfo){this.toolbar.set(&quot;dragInfo&quot;,new f.View({el:e('&lt;div class=&quot;instructions&quot;&gt;'+b.dragInfo+&quot;&lt;/div&gt;&quot;)[0],priority:-40}))}},updateContent:function(){var g=this;if(!this.attachments){this.createAttachments()}if(!this.collection.length){this.collection.more().done(function(){if(!g.collection.length){g.createUploader()}})}},removeContent:function(){_.each([&quot;attachments&quot;,&quot;uploader&quot;],function(g){if(this[g]){this[g].remove();delete this[g]}},this)},createUploader:function(){this.removeContent();this.uploader=new f.view.UploaderInline({controller:this.controller,status:false,message:b.noItemsFound});this.views.add(this.up
 loader)},createAttachments:function(){this.removeContent();this.attachments=new f.view.Attachments({controller:this.controller,collection:this.collection,selection:this.options.selection,model:this.model,sortable:this.options.sortable,AttachmentView:this.options.AttachmentView});this.views.add(this.attachments)},createSidebar:function(){var g=this.options,h=g.selection,i=this.sidebar=new f.view.Sidebar({controller:this.controller});this.views.add(i);if(this.controller.uploader){i.set(&quot;uploads&quot;,new f.view.UploaderStatus({controller:this.controller,priority:40}))}h.on(&quot;selection:single&quot;,this.createSingle,this);h.on(&quot;selection:unsingle&quot;,this.disposeSingle,this);if(h.single()){this.createSingle()}},createSingle:function(){var h=this.sidebar,i=this.options.selection.single(),g={};h.set(&quot;details&quot;,new f.view.Attachment.Details({controller:this.controller,model:i,priority:80}));h.set(&quot;compat&quot;,new f.view.AttachmentCompat({controller:t
 his.controller,model:i,priority:120}));if(this.options.display){h.set(&quot;display&quot;,new f.view.Settings.AttachmentDisplay({controller:this.controller,model:this.model.display(i),attachment:i,priority:160,userSettings:this.model.get(&quot;displayUserSettings&quot;)}))}},disposeSingle:function(){var g=this.sidebar;g.unset(&quot;details&quot;);g.unset(&quot;compat&quot;);g.unset(&quot;display&quot;)}});f.view.Selection=f.View.extend({tagName:&quot;div&quot;,className:&quot;media-selection&quot;,template:f.template(&quot;media-selection&quot;),events:{&quot;click .edit-selection&quot;:&quot;edit&quot;,&quot;click .clear-selection&quot;:&quot;clear&quot;},initialize:function(){_.defaults(this.options,{editable:false,clearable:true});this.attachments=new f.view.Attachments({controller:this.controller,collection:this.collection,selection:this.collection,sortable:true,model:new Backbone.Model({edge:40,gutter:5}),AttachmentView:f.view.Attachment.Selection});this.views.set(&quot
 ;.selection-view&quot;,this.attachments);this.collection.on(&quot;add remove reset&quot;,this.refresh,this);this.controller.on(&quot;content:activate&quot;,this.refresh,this)},ready:function(){this.refresh()},refresh:function(){if(!this.$el.children().length){return}var h=this.collection,g=&quot;edit-selection&quot;===this.controller.content.mode();this.$el.toggleClass(&quot;empty&quot;,!h.length);this.$el.toggleClass(&quot;one&quot;,1===h.length);this.$el.toggleClass(&quot;editing&quot;,g);this.$(&quot;.count&quot;).text(h.length+&quot; &quot;+b.selected)},edit:function(g){g.preventDefault();if(this.options.editable){this.options.editable.call(this,this.collection)}},clear:function(g){g.preventDefault();this.collection.reset()}});f.view.Attachment.Selection=f.view.Attachment.extend({className:&quot;attachment selection&quot;,toggleSelection:function(){this.options.selection.single(this.model)}});f.view.Attachment.EditSelection=f.view.Attachment.Selection.extend({buttons:{cl
 ose:true}});f.view.Settings=f.View.extend({events:{&quot;click button&quot;:&quot;updateHandler&quot;,&quot;change input&quot;:&quot;updateHandler&quot;,&quot;change select&quot;:&quot;updateHandler&quot;,&quot;change textarea&quot;:&quot;updateHandler&quot;},initialize:function(){this.model=this.model||new Backbone.Model();this.model.on(&quot;change&quot;,this.updateChanges,this)},render:function(){this.$el.html(this.template(_.defaults({model:this.model.toJSON()},this.options)));_(this.model.attributes).chain().keys().each(this.update,this);return this},update:function(j){var k=this.model.get(j),i=this.$('[data-setting=&quot;'+j+'&quot;]'),g,h;if(!i.length){return}if(i.is(&quot;select&quot;)){h=i.find('[value=&quot;'+k+'&quot;]');if(h.length){h.prop(&quot;selected&quot;,true)}else{this.model.set(i.data(&quot;setting&quot;),i.find(&quot;:selected&quot;).val())}}else{if(i.hasClass(&quot;button-group&quot;)){g=i.find(&quot;button&quot;).removeClass(&quot;active&quot;);g.filte
 r('[value=&quot;'+k+'&quot;]').addClass(&quot;active&quot;)}else{if(i.is('input[type=&quot;text&quot;], textarea')){if(!i.is(&quot;:focus&quot;)){i.val(k)}}else{if(i.is('input[type=&quot;checkbox&quot;]')){i.attr(&quot;checked&quot;,!!k)}}}}},updateHandler:function(i){var h=e(i.target).closest(&quot;[data-setting]&quot;),j=i.target.value,g;i.preventDefault();if(!h.length){return}if(h.is('input[type=&quot;checkbox&quot;]')){j=h[0].checked}this.model.set(h.data(&quot;setting&quot;),j);if(g=h.data(&quot;userSetting&quot;)){setUserSetting(g,j)}},updateChanges:function(h,g){if(g.changes){_(g.changes).chain().keys().each(this.update,this)}}});f.view.Settings.AttachmentDisplay=f.view.Settings.extend({className:&quot;attachment-display-settings&quot;,template:f.template(&quot;attachment-display-settings&quot;),initialize:function(){var g=this.options.attachment;_.defaults(this.options,{userSettings:false});f.view.Settings.prototype.initialize.apply(this,arguments);this.model.on(&quo
 t;change:link&quot;,this.updateLinkTo,this);if(g){g.on(&quot;change:uploading&quot;,this.render,this)}},dispose:function(){var g=this.options.attachment;if(g){g.off(null,null,this)}f.view.Settings.prototype.dispose.apply(this,arguments)},render:function(){var g=this.options.attachment;if(g){_.extend(this.options,{sizes:g.get(&quot;sizes&quot;),type:g.get(&quot;type&quot;)})}f.view.Settings.prototype.render.call(this);this.updateLinkTo();return this},updateLinkTo:function(){var h=this.model.get(&quot;link&quot;),i=this.$(&quot;.link-to-custom&quot;),g=this.options.attachment;if(&quot;none&quot;===h||(!g&amp;&amp;&quot;custom&quot;!==h)){i.hide();return}if(g){if(&quot;post&quot;===h){i.val(g.get(&quot;link&quot;))}else{if(&quot;file&quot;===h){i.val(g.get(&quot;url&quot;))}else{if(!this.model.get(&quot;linkUrl&quot;)){i.val(&quot;http://&quot;)}}}i.prop(&quot;readonly&quot;,&quot;custom&quot;!==h)}i.show();if(i.is(&quot;:visible&quot;)){i.focus()[0].select()}}});f.view.Setting
 s.Gallery=f.view.Settings.extend({className:&quot;gallery-settings&quot;,template:f.template(&quot;gallery-settings&quot;)});f.view.Attachment.Details=f.view.Attachment.extend({tagName:&quot;div&quot;,className:&quot;attachment-details&quot;,template:f.template(&quot;attachment-details&quot;),events:{&quot;change [data-setting]&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] input&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] select&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] textarea&quot;:&quot;updateSetting&quot;,&quot;click .delete-attachment&quot;:&quot;deleteAttachment&quot;},deleteAttachment:function(g){g.preventDefault();if(confirm(b.warnDelete)){this.model.destroy()}}});f.view.AttachmentCompat=f.View.extend({tagName:&quot;form&quot;,className:&quot;compat-item&quot;,events:{submit:&quot;preventDefault&quot;,&quot;change input&quot;:&quot;save&quot;,&quot;change select&quot;:&quot;save&quot;,&quot;change textarea&quot;:&quot;
 save&quot;},initialize:function(){this.model.on(&quot;change:compat&quot;,this.render,this)},render:function(){var g=this.model.get(&quot;compat&quot;);if(!g||!g.item){return}this.$el.html(g.item);return this},preventDefault:function(g){g.preventDefault()},save:function(g){var h={};g.preventDefault();_.each(this.$el.serializeArray(),function(i){h[i.name]=i.value});this.model.saveCompat(h)}});f.view.Iframe=f.View.extend({className:&quot;media-iframe&quot;,render:function(){this.views.detach();this.$el.html('&lt;iframe src=&quot;'+this.controller.state().get(&quot;src&quot;)+'&quot; /&gt;');this.views.render();return this}});f.view.Embed=f.View.extend({className:&quot;media-embed&quot;,initialize:function(){this.url=new f.view.EmbedUrl({controller:this.controller,model:this.model.props}).render();this._settings=new f.View();this.refresh();this.model.on(&quot;change:type&quot;,this.refresh,this)},render:function(){this.$el.html([this.url.el,this._settings.el]);this.url.focus();
 this.views.render();return this},settings:function(g){g.render();this._settings.$el.replaceWith(g.$el);this._settings.remove();this._settings=g},refresh:function(){var h=this.model.get(&quot;type&quot;),g;if(&quot;image&quot;===h){g=f.view.EmbedImage}else{if(&quot;link&quot;===h){g=f.view.EmbedLink}else{return}}this.settings(new g({controller:this.controller,model:this.model.props,priority:40}))}});f.view.EmbedUrl=f.View.extend({tagName:&quot;label&quot;,className:&quot;embed-url&quot;,events:{input:&quot;url&quot;,keyup:&quot;url&quot;,change:&quot;url&quot;},initialize:function(){this.input=this.make(&quot;input&quot;,{type:&quot;text&quot;,value:this.model.get(&quot;url&quot;)||&quot;&quot;});this.$input=e(this.input);this.$el.append(this.input);this.model.on(&quot;change:url&quot;,this.render,this)},render:function(){var g=this.$input;if(g.is(&quot;:focus&quot;)){return}this.input.value=this.model.get(&quot;url&quot;)||&quot;http://&quot;;return this},url:function(g){thi
 s.model.set(&quot;url&quot;,g.target.value)},focus:function(){var g=this.$input;if(g.is(&quot;:visible&quot;)){g.focus()[0].select()}}});f.view.EmbedLink=f.view.Settings.extend({className:&quot;embed-link-settings&quot;,template:f.template(&quot;embed-link-settings&quot;)});f.view.EmbedImage=f.view.Settings.AttachmentDisplay.extend({className:&quot;embed-image-settings&quot;,template:f.template(&quot;embed-image-settings&quot;),initialize:function(){f.view.Settings.AttachmentDisplay.prototype.initialize.apply(this,arguments);this.model.on(&quot;change:url&quot;,this.updateImage,this)},updateImage:function(){this.$(&quot;img&quot;).attr(&quot;src&quot;,this.model.get(&quot;url&quot;))}})}(jQuery));
</del><span class="cx">\ No newline at end of file
</span><ins>+(function(e){var f=wp.media,d=f.model.Attachment,c=f.model.Attachments,a=f.model.Query,b;b=f.view.l10n=typeof _wpMediaViewsL10n===&quot;undefined&quot;?{}:_wpMediaViewsL10n;f.view.settings=b.settings||{};delete b.settings;f.model.settings.post=f.view.settings.post;e.support.transition=(function(){var g=document.documentElement.style,h={WebkitTransition:&quot;webkitTransitionEnd&quot;,MozTransition:&quot;transitionend&quot;,OTransition:&quot;oTransitionEnd otransitionend&quot;,transition:&quot;transitionend&quot;},i;i=_.find(_.keys(h),function(j){return !_.isUndefined(g[j])});return i&amp;&amp;{end:h[i]}}());f.transition=function(g,h){var i=e.Deferred();h=h||2000;if(e.support.transition){if(!(g instanceof e)){g=e(g)}g.first().one(e.support.transition.end,i.resolve);_.delay(i.resolve,h)}else{i.resolve()}return i.promise()};f.controller.Region=function(g){_.extend(this,_.pick(g||{},&quot;id&quot;,&quot;view&quot;,&quot;selector&quot;))};f.controller.Region.extend=Ba
 ckbone.Model.extend;_.extend(f.controller.Region.prototype,{mode:function(g){if(!g){return this._mode}if(g===this._mode){return this}this.trigger(&quot;deactivate&quot;);this._mode=g;this.render(g);this.trigger(&quot;activate&quot;);return this},render:function(h){if(h&amp;&amp;h!==this._mode){return this.mode(h)}var i={view:null},g;this.trigger(&quot;create&quot;,i);g=i.view;this.trigger(&quot;render&quot;,g);if(g){this.set(g)}return this},get:function(){return this.view.views.first(this.selector)},set:function(g,h){if(h){h.add=false}return this.view.views.set(this.selector,g,h)},trigger:function(h){var i;if(!this._mode){return}var g=_.toArray(arguments);i=this.id+&quot;:&quot;+h;g[0]=i+&quot;:&quot;+this._mode;this.view.trigger.apply(this.view,g);g[0]=i;this.view.trigger.apply(this.view,g);return this}});f.controller.StateMachine=function(g){this.states=new Backbone.Collection(g)};f.controller.StateMachine.extend=Backbone.Model.extend;_.extend(f.controller.StateMachine.pro
 totype,Backbone.Events,{state:function(g){this.states=this.states||new Backbone.Collection();g=g||this._state;if(g&amp;&amp;!this.states.get(g)){this.states.add({id:g})}return this.states.get(g)},setState:function(h){var g=this.state();if((g&amp;&amp;h===g.id)||!this.states||!this.states.get(h)){return this}if(g){g.trigger(&quot;deactivate&quot;);this._lastState=g.id}this._state=h;this.state().trigger(&quot;activate&quot;);return this},lastState:function(){if(this._lastState){return this.state(this._lastState)}}});_.each([&quot;on&quot;,&quot;off&quot;,&quot;trigger&quot;],function(g){f.controller.StateMachine.prototype[g]=function(){this.states=this.states||new Backbone.Collection();this.states[g].apply(this.states,arguments);return this}});f.controller.State=Backbone.Model.extend({constructor:function(){this.on(&quot;activate&quot;,this._preActivate,this);this.on(&quot;activate&quot;,this.activate,this);this.on(&quot;activate&quot;,this._postActivate,this);this.on(&quot;de
 activate&quot;,this._deactivate,this);this.on(&quot;deactivate&quot;,this.deactivate,this);this.on(&quot;reset&quot;,this.reset,this);this.on(&quot;ready&quot;,this._ready,this);this.on(&quot;ready&quot;,this.ready,this);this.on(&quot;change:menu&quot;,this._updateMenu,this);Backbone.Model.apply(this,arguments)},ready:function(){},activate:function(){},deactivate:function(){},reset:function(){},_ready:function(){this._updateMenu()},_preActivate:function(){this.active=true},_postActivate:function(){this.on(&quot;change:menu&quot;,this._menu,this);this.on(&quot;change:titleMode&quot;,this._title,this);this.on(&quot;change:content&quot;,this._content,this);this.on(&quot;change:toolbar&quot;,this._toolbar,this);this.frame.on(&quot;title:render:default&quot;,this._renderTitle,this);this._title();this._menu();this._toolbar();this._content();this._router()},_deactivate:function(){this.active=false;this.frame.off(&quot;title:render:default&quot;,this._renderTitle,this);this.off(&quo
 t;change:menu&quot;,this._menu,this);this.off(&quot;change:titleMode&quot;,this._title,this);this.off(&quot;change:content&quot;,this._content,this);this.off(&quot;change:toolbar&quot;,this._toolbar,this)},_title:function(){this.frame.title.render(this.get(&quot;titleMode&quot;)||&quot;default&quot;)},_renderTitle:function(g){g.$el.text(this.get(&quot;title&quot;)||&quot;&quot;)},_router:function(){var h=this.frame.router,i=this.get(&quot;router&quot;),g;this.frame.$el.toggleClass(&quot;hide-router&quot;,!i);if(!i){return}this.frame.router.render(i);g=h.get();if(g.select){g.select(this.frame.content.mode())}},_menu:function(){var i=this.frame.menu,h=this.get(&quot;menu&quot;),g;if(!h){return}i.mode(h);g=i.get();if(g.select){g.select(this.id)}},_updateMenu:function(){var g=this.previous(&quot;menu&quot;),h=this.get(&quot;menu&quot;);if(g){this.frame.off(&quot;menu:render:&quot;+g,this._renderMenu,this)}if(h){this.frame.on(&quot;menu:render:&quot;+h,this._renderMenu,this)}},_r
 enderMenu:function(g){var i=this.get(&quot;menuItem&quot;),j=this.get(&quot;title&quot;),h=this.get(&quot;priority&quot;);if(!i&amp;&amp;j){i={text:j};if(h){i.priority=h}}if(!i){return}g.set(this.id,i)}});_.each([&quot;toolbar&quot;,&quot;content&quot;],function(g){f.controller.State.prototype[&quot;_&quot;+g]=function(){var h=this.get(g);if(h){this.frame[g].render(h)}}});f.controller.Library=f.controller.State.extend({defaults:{id:&quot;library&quot;,multiple:false,describe:false,toolbar:&quot;select&quot;,sidebar:&quot;settings&quot;,content:&quot;upload&quot;,router:&quot;browse&quot;,searchable:true,filterable:false,sortable:true,title:b.mediaLibraryTitle,contentUserSetting:true,syncLastSelection:true},initialize:function(){if(!this.get(&quot;selection&quot;)){this.set(&quot;selection&quot;,new f.model.Selection(null,{multiple:this.get(&quot;multiple&quot;)}))}if(!this.get(&quot;library&quot;)){this.set(&quot;library&quot;,f.query())}if(!this.get(&quot;edge&quot;)){this.
 set(&quot;edge&quot;,120)}if(!this.get(&quot;gutter&quot;)){this.set(&quot;gutter&quot;,8)}this.resetDisplays()},activate:function(){if(this.get(&quot;syncLastSelection&quot;)){this.getLastSelection()}this._excludeStateLibrary();this.buildComposite();this.on(&quot;change:library change:exclude&quot;,this.buildComposite,this);this.on(&quot;change:excludeState&quot;,this._excludeState,this);wp.Uploader.queue.on(&quot;add&quot;,this.uploading,this);this.get(&quot;selection&quot;).on(&quot;add remove reset&quot;,this.refreshContent,this);this.on(&quot;insert&quot;,this._insertDisplaySettings,this);if(this.get(&quot;contentUserSetting&quot;)){this.frame.on(&quot;content:activate&quot;,this.saveContentMode,this);this.set(&quot;content&quot;,getUserSetting(&quot;libraryContent&quot;,this.get(&quot;content&quot;)))}},deactivate:function(){this.frame.off(&quot;content:activate&quot;,this.saveContentMode,this);this.get(&quot;selection&quot;).off(null,null,this);wp.Uploader.queue.off(n
 ull,null,this);this.off(&quot;change:excludeState&quot;,this._excludeState,this);this.off(&quot;change:library change:exclude&quot;,this.buildComposite,this);this.destroyComposite()},reset:function(){this.get(&quot;selection&quot;).reset();this.resetDisplays();this.refreshContent()},resetDisplays:function(){this._displays=[];this._defaultDisplaySettings={align:getUserSetting(&quot;align&quot;,&quot;none&quot;),size:getUserSetting(&quot;imgsize&quot;,&quot;medium&quot;),link:getUserSetting(&quot;urlbutton&quot;,&quot;post&quot;)}},display:function(h){var g=this._displays;if(!g[h.cid]){g[h.cid]=new Backbone.Model(this._defaultDisplaySettings)}return g[h.cid]},_insertDisplaySettings:function(){var g=this.get(&quot;selection&quot;),h;if(g.length!==1){return}h=this.display(g.first()).toJSON();setUserSetting(&quot;align&quot;,h.align);setUserSetting(&quot;imgsize&quot;,h.size);setUserSetting(&quot;urlbutton&quot;,h.link)},getLastSelection:function(){var j=this.get(&quot;selection&
 quot;),i=this.frame.lastState(),h=i&amp;&amp;i.get(&quot;selection&quot;),g,k;if(!h){return}g=!!h.multiple;k=!!j.multiple;if(g!==k){return}j.reset(h.toArray()).single(h.single())},refreshContent:function(){var h=this.get(&quot;selection&quot;),j=this.frame,g=j.router.get(),i=j.content.mode();if(this.active&amp;&amp;!h.length&amp;&amp;!g.get(i)){this.frame.content.render(this.get(&quot;content&quot;))}},uploading:function(h){var g=this.frame.content;if(&quot;upload&quot;===g.mode()){this.frame.content.mode(&quot;browse&quot;)}if(this.get(&quot;multiple&quot;)){this.get(&quot;selection&quot;).add(h)}},saveContentMode:function(){if(&quot;browse&quot;!==this.get(&quot;router&quot;)){return}var h=this.frame.content.mode(),g=this.frame.router.get();if(g&amp;&amp;g.get(h)){setUserSetting(&quot;libraryContent&quot;,h)}},buildComposite:function(){var h=this.get(&quot;_library&quot;),g=this.get(&quot;exclude&quot;),i;this.destroyComposite();if(!this.get(&quot;exclude&quot;)){return}if
 (!h){this.set(&quot;_library&quot;,h=this.get(&quot;library&quot;))}i=new f.model.Attachments(null,{props:_.pick(h.props.toJSON(),&quot;order&quot;,&quot;orderby&quot;)});i.validator=function(j){return !!h.getByCid(j.cid)&amp;&amp;!g.getByCid(j.cid)};i.mirror(h).observe(g);this.set(&quot;library&quot;,i)},destroyComposite:function(){var h=this.get(&quot;library&quot;),g=this.get(&quot;_library&quot;);if(!g){return}h.unobserve();this.set(&quot;library&quot;,g);this.unset(&quot;_library&quot;)},_excludeState:function(){var h=this.get(&quot;excludeState&quot;),g=this.previous(&quot;excludeState&quot;);if(g){this.frame.state(g).off(&quot;change:library&quot;,this._excludeStateLibrary,this)}if(h){this.frame.state(h).on(&quot;change:library&quot;,this._excludeStateLibrary,this)}},_excludeStateLibrary:function(){var g=this.get(&quot;excludeState&quot;);if(!g){return}this.set(&quot;exclude&quot;,this.frame.state(g).get(&quot;library&quot;))}});f.controller.GalleryEdit=f.controller.L
 ibrary.extend({defaults:{id:&quot;gallery-edit&quot;,multiple:false,describe:true,edge:199,editing:false,sortable:true,searchable:false,toolbar:&quot;gallery-edit&quot;,content:&quot;browse&quot;,title:b.editGalleryTitle,priority:60,dragInfo:true},initialize:function(){if(!this.get(&quot;library&quot;)){this.set(&quot;library&quot;,new f.model.Selection())}if(!this.get(&quot;AttachmentView&quot;)){this.set(&quot;AttachmentView&quot;,f.view.Attachment.EditLibrary)}f.controller.Library.prototype.initialize.apply(this,arguments)},activate:function(){var g=this.get(&quot;library&quot;);g.props.set(&quot;type&quot;,&quot;image&quot;);this.get(&quot;library&quot;).observe(wp.Uploader.queue);this.frame.on(&quot;content:render:browse&quot;,this.gallerySettings,this);f.controller.Library.prototype.activate.apply(this,arguments)},deactivate:function(){this.get(&quot;library&quot;).unobserve(wp.Uploader.queue);this.frame.off(&quot;content:render:browse&quot;,this.gallerySettings,this);
 f.controller.Library.prototype.deactivate.apply(this,arguments)},gallerySettings:function(h){var g=this.get(&quot;library&quot;);if(!g||!h){return}g.gallery=g.gallery||new Backbone.Model();h.sidebar.set({gallery:new f.view.Settings.Gallery({controller:this,model:g.gallery,priority:40})});h.toolbar.set(&quot;reverse&quot;,{text:b.reverseOrder,priority:80,click:function(){g.reset(g.toArray().reverse())}})}});f.controller.FeaturedImage=f.controller.Library.extend({defaults:_.defaults({id:&quot;featured-image&quot;,filterable:&quot;uploaded&quot;,multiple:false,menu:&quot;main&quot;,toolbar:&quot;featured-image&quot;,title:b.featuredImageTitle,priority:60},f.controller.Library.prototype.defaults),initialize:function(){var h,g;if(!this.get(&quot;library&quot;)){this.set(&quot;library&quot;,f.query({type:&quot;image&quot;}))}f.controller.Library.prototype.initialize.apply(this,arguments);h=this.get(&quot;library&quot;);g=h.comparator;h.comparator=function(j,i){var l=!!this.mirrori
 ng.getByCid(j.cid),k=!!this.mirroring.getByCid(i.cid);if(!l&amp;&amp;k){return -1}else{if(l&amp;&amp;!k){return 1}else{return g.apply(this,arguments)}}};h.observe(this.get(&quot;selection&quot;))},activate:function(){var g=this.get(&quot;selection&quot;),i=f.view.settings.post.featuredImageId,h;if(&quot;&quot;!==i&amp;&amp;-1!==i){h=d.get(i);h.fetch()}g.reset(h?[h]:[]);f.controller.Library.prototype.activate.apply(this,arguments)}});f.controller.Embed=f.controller.State.extend({defaults:{id:&quot;embed&quot;,url:&quot;&quot;,menu:&quot;main&quot;,content:&quot;embed&quot;,toolbar:&quot;main-embed&quot;,type:&quot;link&quot;,title:b.fromUrlTitle,priority:120},sensitivity:200,initialize:function(){this.debouncedScan=_.debounce(_.bind(this.scan,this),this.sensitivity);this.props=new Backbone.Model({url:&quot;&quot;});this.props.on(&quot;change:url&quot;,this.debouncedScan,this);this.props.on(&quot;change:url&quot;,this.refresh,this);this.on(&quot;scan&quot;,this.scanImage,this)
 },scan:function(){var g={type:&quot;link&quot;};this.trigger(&quot;scan&quot;,g);this.set(g)},scanImage:function(g){var k=this.frame,i=this,h=this.props.get(&quot;url&quot;),j=new Image();j.onload=function(){if(i!==k.state()||h!==i.props.get(&quot;url&quot;)){return}i.set({type:&quot;image&quot;,width:j.width,height:j.height})};j.src=h;h=h.replace(/([?|#].*)$/,&quot;&quot;);if(/\.(png|jpe?g|gif)$/i.test(h)){g.type=&quot;image&quot;}},refresh:function(){this.frame.toolbar.get().refresh()},reset:function(){this.props=new Backbone.Model({url:&quot;&quot;});if(this.active){this.refresh()}}});f.Views=function(h,g){this.view=h;this._views=_.isArray(g)?{&quot;&quot;:g}:g||{}};f.Views.extend=Backbone.Model.extend;_.extend(f.Views.prototype,{all:function(){return _.flatten(this._views)},get:function(g){g=g||&quot;&quot;;return this._views[g]},first:function(g){var h=this.get(g);return h&amp;&amp;h.length?h[0]:null},set:function(g,h,i){var k,j;if(!_.isString(g)){i=h;h=g;g=&quot;&quot;
 }i=i||{};h=_.isArray(h)?h:[h];k=this.get(g);j=h;if(k){if(i.add){if(_.isUndefined(i.at)){j=k.concat(h)}else{j=k;j.splice.apply(j,[i.at,0].concat(h))}}else{_.each(j,function(l){l.__detach=true});_.each(k,function(l){if(l.__detach){l.$el.detach()}else{l.dispose()}});_.each(j,function(l){delete l.__detach})}}this._views[g]=j;_.each(h,function(n){var l=n.Views||f.Views,m=n.views=n.views||new l(n);m.parent=this.view;m.selector=g},this);if(!i.silent){this._attach(g,h,_.extend({ready:this._isReady()},i))}return this},add:function(g,h,i){if(!_.isString(g)){i=h;h=g;g=&quot;&quot;}return this.set(g,h,_.extend({add:true},i))},unset:function(g,h,i){var j;if(!_.isString(g)){i=h;h=g;g=&quot;&quot;}h=h||[];if(j=this.get(g)){h=_.isArray(h)?h:[h];this._views[g]=h.length?_.difference(j,h):[]}if(!i||!i.silent){_.invoke(h,&quot;dispose&quot;)}return this},detach:function(){e(_.pluck(this.all(),&quot;el&quot;)).detach();return this},render:function(){var g={ready:this._isReady()};_.each(this._vie
 ws,function(i,h){this._attach(h,i,g)},this);this.rendered=true;return this},dispose:function(g){if(!g||!g.silent){if(this.parent&amp;&amp;this.parent.views){this.parent.views.unset(this.selector,this.view,{silent:true})}delete this.parent;delete this.selector}_.invoke(this.all(),&quot;dispose&quot;);this._views=[];return this},replace:function(g,h){g.html(h);return this},insert:function(h,k,j){var g=j&amp;&amp;j.at,i;if(_.isNumber(g)&amp;&amp;(i=h.children()).length&gt;g){i.eq(g).before(k)}else{h.append(k)}return this},ready:function(){this.view.trigger(&quot;ready&quot;);_.chain(this.all()).map(function(g){return g.views}).flatten().where({attached:true}).invoke(&quot;ready&quot;)},_attach:function(g,h,i){var k=g?this.view.$(g):this.view.$el,j;if(!k.length){return this}j=_.chain(h).pluck(&quot;views&quot;).flatten().value();_.each(j,function(l){if(l.rendered){return}l.view.render();l.rendered=true},this);this[i.add?&quot;insert&quot;:&quot;replace&quot;](k,_.pluck(h,&quot;e
 l&quot;),i);_.each(j,function(l){l.attached=true;if(i.ready){l.ready()}},this);return this},_isReady:function(){var g=this.view.el;while(g){if(g===document.body){return true}g=g.parentNode}return false}});f.View=Backbone.View.extend({Views:f.Views,constructor:function(g){this.views=new this.Views(this,this.views);this.on(&quot;ready&quot;,this.ready,this);if(g&amp;&amp;g.controller){this.controller=g.controller}Backbone.View.apply(this,arguments)},dispose:function(){this.undelegateEvents();if(this.model&amp;&amp;this.model.off){this.model.off(null,null,this)}if(this.collection&amp;&amp;this.collection.off){this.collection.off(null,null,this)}if(this.controller&amp;&amp;this.controller.off){this.controller.off(null,null,this)}if(this.views){this.views.dispose()}return this},remove:function(){this.dispose();return Backbone.View.prototype.remove.apply(this,arguments)},render:function(){var g;if(this.prepare){g=this.prepare()}this.views.detach();if(this.template){g=g||{};this.tr
 igger(&quot;prepare&quot;,g);this.$el.html(this.template(g))}this.views.render();return this},prepare:function(){return this.options},ready:function(){}});f.view.Frame=f.View.extend({initialize:function(){this._createRegions();this._createStates()},_createRegions:function(){this.regions=this.regions?this.regions.slice():[];_.each(this.regions,function(g){this[g]=new f.controller.Region({view:this,id:g,selector:&quot;.media-frame-&quot;+g})},this)},_createStates:function(){this.states=new Backbone.Collection(null,{model:f.controller.State});this.states.on(&quot;add&quot;,function(g){g.frame=this;g.trigger(&quot;ready&quot;)},this)},reset:function(){this.states.invoke(&quot;trigger&quot;,&quot;reset&quot;);return this}});_.extend(f.view.Frame.prototype,f.controller.StateMachine.prototype);f.view.MediaFrame=f.view.Frame.extend({className:&quot;media-frame&quot;,template:f.template(&quot;media-frame&quot;),regions:[&quot;menu&quot;,&quot;title&quot;,&quot;content&quot;,&quot;too
 lbar&quot;,&quot;router&quot;],initialize:function(){f.view.Frame.prototype.initialize.apply(this,arguments);_.defaults(this.options,{title:&quot;&quot;,modal:true,uploader:true});this.$el.addClass(&quot;wp-core-ui&quot;);if(this.options.modal){this.modal=new f.view.Modal({controller:this,title:this.options.title});this.modal.content(this)}if(wp.Uploader.limitExceeded||!wp.Uploader.browser.supported){this.options.uploader=false}if(this.options.uploader){this.uploader=new f.view.UploaderWindow({controller:this,uploader:{dropzone:this.modal?this.modal.$el:this.$el,container:this.$el}});this.views.set(&quot;.media-frame-uploader&quot;,this.uploader)}this.on(&quot;attach&quot;,_.bind(this.views.ready,this.views),this);this.on(&quot;title:create:default&quot;,this.createTitle,this);this.title.mode(&quot;default&quot;)},render:function(){if(!this.state()&amp;&amp;this.options.state){this.setState(this.options.state)}return f.view.Frame.prototype.render.apply(this,arguments)},creat
 eTitle:function(g){g.view=new f.View({controller:this,tagName:&quot;h1&quot;})},createMenu:function(g){g.view=new f.view.Menu({controller:this})},createToolbar:function(g){g.view=new f.view.Toolbar({controller:this})},createRouter:function(g){g.view=new f.view.Router({controller:this})},createIframeStates:function(g){var j=f.view.settings,i=j.tabs,k=j.tabUrl,h;if(!i||!k){return}h=e(&quot;#post_ID&quot;);if(h.length){k+=&quot;&amp;post_id=&quot;+h.val()}_.each(i,function(m,n){var l=this.state(&quot;iframe:&quot;+n).set(_.defaults({tab:n,src:k+&quot;&amp;tab=&quot;+n,title:m,content:&quot;iframe&quot;,menu:&quot;main&quot;},g))},this);this.on(&quot;content:create:iframe&quot;,this.iframeContent,this);this.on(&quot;menu:render:main&quot;,this.iframeMenu,this);this.on(&quot;open&quot;,this.hijackThickbox,this);this.on(&quot;close&quot;,this.restoreThickbox,this)},iframeContent:function(g){this.$el.addClass(&quot;hide-toolbar&quot;);g.view=new f.view.Iframe({controller:this})},if
 rameMenu:function(h){var g={};if(!h){return}_.each(f.view.settings.tabs,function(i,j){g[&quot;iframe:&quot;+j]={text:this.state(&quot;iframe:&quot;+j).get(&quot;title&quot;),priority:200}},this);h.set(g)},hijackThickbox:function(){var g=this;if(!window.tb_remove||this._tb_remove){return}this._tb_remove=window.tb_remove;window.tb_remove=function(){g.close();g.reset();g.setState(g.options.state);g._tb_remove.call(window)}},restoreThickbox:function(){if(!this._tb_remove){return}window.tb_remove=this._tb_remove;delete this._tb_remove}});_.each([&quot;open&quot;,&quot;close&quot;,&quot;attach&quot;,&quot;detach&quot;,&quot;escape&quot;],function(g){f.view.MediaFrame.prototype[g]=function(h){if(this.modal){this.modal[g].apply(this.modal,arguments)}return this}});f.view.MediaFrame.Select=f.view.MediaFrame.extend({initialize:function(){f.view.MediaFrame.prototype.initialize.apply(this,arguments);_.defaults(this.options,{selection:[],library:{},multiple:false,state:&quot;library&quot
 ;});this.createSelection();this.createStates();this.bindHandlers()},createSelection:function(){var g=this,h=this.options.selection;if(!(h instanceof f.model.Selection)){this.options.selection=new f.model.Selection(h,{multiple:this.options.multiple})}},createStates:function(){var g=this.options;this.states.add([new f.controller.Library({selection:g.selection,library:f.query(g.library),multiple:g.multiple,menu:&quot;main&quot;,title:g.title,priority:20})])},bindHandlers:function(){this.on(&quot;menu:create:main&quot;,this.createMenu,this);this.on(&quot;router:create:browse&quot;,this.createRouter,this);this.on(&quot;router:render:browse&quot;,this.browseRouter,this);this.on(&quot;content:create:browse&quot;,this.browseContent,this);this.on(&quot;content:render:upload&quot;,this.uploadContent,this);this.on(&quot;toolbar:create:select&quot;,this.createSelectToolbar,this)},browseRouter:function(g){g.set({upload:{text:b.uploadFilesTitle,priority:20},browse:{text:b.mediaLibraryTitl
 e,priority:40}})},browseContent:function(g){var h=this.state();this.$el.removeClass(&quot;hide-toolbar&quot;);g.view=new f.view.AttachmentsBrowser({controller:this,collection:h.get(&quot;library&quot;),selection:h.get(&quot;selection&quot;),model:h,sortable:h.get(&quot;sortable&quot;),search:h.get(&quot;searchable&quot;),filters:h.get(&quot;filterable&quot;),display:h.get(&quot;displaySettings&quot;),dragInfo:h.get(&quot;dragInfo&quot;),AttachmentView:h.get(&quot;AttachmentView&quot;)})},uploadContent:function(){this.$el.removeClass(&quot;hide-toolbar&quot;);this.content.set(new f.view.UploaderInline({controller:this}))},createSelectToolbar:function(h,g){g=g||this.options.button||{};g.controller=this;h.view=new f.view.Toolbar.Select(g)}});f.view.MediaFrame.Post=f.view.MediaFrame.Select.extend({initialize:function(){_.defaults(this.options,{multiple:true,editing:false,state:&quot;insert&quot;});f.view.MediaFrame.Select.prototype.initialize.apply(this,arguments);this.createIfr
 ameStates()},createStates:function(){var g=this.options,h=g.selection;this.states.add([new f.controller.Library({id:&quot;insert&quot;,title:b.insertMediaTitle,priority:20,menu:&quot;main&quot;,toolbar:&quot;main-insert&quot;,filterable:&quot;all&quot;,library:f.query(g.library),selection:h,multiple:g.multiple?&quot;reset&quot;:false,editable:true,displaySettings:true,displayUserSettings:true}),new f.controller.Library({id:&quot;gallery&quot;,title:b.createGalleryTitle,priority:40,menu:&quot;main&quot;,toolbar:&quot;main-gallery&quot;,filterable:&quot;uploaded&quot;,multiple:&quot;add&quot;,editable:false,library:f.query(_.defaults({type:&quot;image&quot;},g.library)),selection:new f.model.Selection(h.models,{multiple:&quot;add&quot;})}),new f.controller.Embed(),new f.controller.GalleryEdit({library:g.selection,editing:g.editing,menu:&quot;gallery&quot;}),new f.controller.Library({id:&quot;gallery-library&quot;,library:f.query({type:&quot;image&quot;}),filterable:&quot;uploa
 ded&quot;,multiple:&quot;add&quot;,menu:&quot;gallery&quot;,toolbar:&quot;gallery-add&quot;,excludeState:&quot;gallery-edit&quot;,title:b.addToGalleryTitle,priority:100})]);if(f.view.settings.post.featuredImageId){this.states.add(new f.controller.FeaturedImage({controller:this,menu:&quot;main&quot;}))}},bindHandlers:function(){f.view.MediaFrame.Select.prototype.bindHandlers.apply(this,arguments);this.on(&quot;menu:create:gallery&quot;,this.createMenu,this);this.on(&quot;toolbar:create:main-insert&quot;,this.createToolbar,this);this.on(&quot;toolbar:create:main-gallery&quot;,this.createToolbar,this);this.on(&quot;toolbar:create:featured-image&quot;,this.featuredImageToolbar,this);this.on(&quot;toolbar:create:main-embed&quot;,this.mainEmbedToolbar,this);var g={menu:{main:&quot;mainMenu&quot;,gallery:&quot;galleryMenu&quot;},content:{embed:&quot;embedContent&quot;,&quot;edit-selection&quot;:&quot;editSelectionContent&quot;},toolbar:{&quot;main-insert&quot;:&quot;mainInsertToolb
 ar&quot;,&quot;main-gallery&quot;:&quot;mainGalleryToolbar&quot;,&quot;gallery-edit&quot;:&quot;galleryEditToolbar&quot;,&quot;gallery-add&quot;:&quot;galleryAddToolbar&quot;}};_.each(g,function(i,h){_.each(i,function(k,j){this.on(h+&quot;:render:&quot;+j,this[k],this)},this)},this)},mainMenu:function(g){g.set({&quot;library-separator&quot;:new f.View({className:&quot;separator&quot;,priority:100})})},galleryMenu:function(g){var h=this.lastState(),i=h&amp;&amp;h.id,j=this;g.set({cancel:{text:b.cancelGalleryTitle,priority:20,click:function(){if(i){j.setState(i)}else{j.close()}}},separateCancel:new f.View({className:&quot;separator&quot;,priority:40})})},embedContent:function(){var g=new f.view.Embed({controller:this,model:this.state()}).render();this.content.set(g);g.url.focus()},editSelectionContent:function(){var i=this.state(),h=i.get(&quot;selection&quot;),g;g=new f.view.AttachmentsBrowser({controller:this,collection:h,selection:h,model:i,sortable:true,search:false,dragIn
 fo:true,AttachmentView:f.view.Attachment.EditSelection}).render();g.toolbar.set(&quot;backToLibrary&quot;,{text:b.returnToLibrary,priority:-100,click:function(){this.controller.content.mode(&quot;browse&quot;)}});this.content.set(g)},selectionStatusToolbar:function(g){var h=this.state().get(&quot;editable&quot;);g.set(&quot;selection&quot;,new f.view.Selection({controller:this,collection:this.state().get(&quot;selection&quot;),priority:-40,editable:h&amp;&amp;function(){this.controller.content.mode(&quot;edit-selection&quot;)}}).render())},mainInsertToolbar:function(h){var g=this;this.selectionStatusToolbar(h);h.set(&quot;insert&quot;,{style:&quot;primary&quot;,priority:80,text:b.insertIntoPost,requires:{selection:true},click:function(){var j=g.state(),i=j.get(&quot;selection&quot;);g.close();j.trigger(&quot;insert&quot;,i).reset()}})},mainGalleryToolbar:function(h){var g=this;this.selectionStatusToolbar(h);h.set(&quot;gallery&quot;,{style:&quot;primary&quot;,text:b.createNe
 wGallery,priority:60,requires:{selection:true},click:function(){var i=g.state().get(&quot;selection&quot;),j=g.state(&quot;gallery-edit&quot;),k=i.where({type:&quot;image&quot;});j.set(&quot;library&quot;,new f.model.Selection(k,{props:i.props.toJSON(),multiple:true}));this.controller.setState(&quot;gallery-edit&quot;)}})},featuredImageToolbar:function(g){this.createSelectToolbar(g,{text:b.setFeaturedImage,state:this.options.state||&quot;upload&quot;})},mainEmbedToolbar:function(g){g.view=new f.view.Toolbar.Embed({controller:this})},galleryEditToolbar:function(){var g=this.state().get(&quot;editing&quot;);this.toolbar.set(new f.view.Toolbar({controller:this,items:{insert:{style:&quot;primary&quot;,text:g?b.updateGallery:b.insertGallery,priority:80,requires:{library:true},click:function(){var h=this.controller,i=h.state();h.close();i.trigger(&quot;update&quot;,i.get(&quot;library&quot;));h.reset();h.setState(&quot;upload&quot;)}}}}))},galleryAddToolbar:function(){this.toolbar
 .set(new f.view.Toolbar({controller:this,items:{insert:{style:&quot;primary&quot;,text:b.addToGallery,priority:80,click:function(){var g=this.controller,i=g.state(),h=g.state(&quot;gallery-edit&quot;);h.get(&quot;library&quot;).add(i.get(&quot;selection&quot;).models);i.trigger(&quot;reset&quot;);g.setState(&quot;gallery-edit&quot;)}}}}))}});f.view.Modal=f.View.extend({tagName:&quot;div&quot;,template:f.template(&quot;media-modal&quot;),attributes:{tabindex:0},events:{&quot;click .media-modal-backdrop, .media-modal-close&quot;:&quot;escapeHandler&quot;,keydown:&quot;keydown&quot;},initialize:function(){_.defaults(this.options,{container:document.body,title:&quot;&quot;,propagate:true,freeze:document.body})},prepare:function(){return{title:this.options.title}},attach:function(){if(this.views.attached){return this}if(!this.views.rendered){this.render()}this.$el.appendTo(this.options.container);this.views.attached=true;this.views.ready();return this.propagate(&quot;attach&quot;
 )},detach:function(){if(this.$el.is(&quot;:visible&quot;)){this.close()}this.$el.detach();this.views.attached=false;return this.propagate(&quot;detach&quot;)},open:function(){var i=this.$el,h=this.options,g;if(i.is(&quot;:visible&quot;)){return this}if(!this.views.attached){this.attach()}if(h.freeze){g=e(h.freeze);this._freeze={overflow:g.css(&quot;overflow&quot;),scrollTop:e(window).scrollTop()};g.css(&quot;overflow&quot;,&quot;hidden&quot;)}i.show().focus();return this.propagate(&quot;open&quot;)},close:function(g){var h=this._freeze;if(!this.views.attached||!this.$el.is(&quot;:visible&quot;)){return this}this.$el.hide();this.propagate(&quot;close&quot;);if(h){e(this.options.freeze).css(&quot;overflow&quot;,h.overflow);e(window).scrollTop(h.scrollTop)}if(g&amp;&amp;g.escape){this.propagate(&quot;escape&quot;)}return this},escape:function(){return this.close({escape:true})},escapeHandler:function(g){g.preventDefault();this.escape()},content:function(g){this.views.set(&quot;
 .media-modal-content&quot;,g);return this},propagate:function(g){this.trigger(g);if(this.options.propagate){this.controller.trigger(g)}return this},keydown:function(g){if(27===g.which){g.preventDefault();this.escape();return}}});f.view.UploaderWindow=f.View.extend({tagName:&quot;div&quot;,className:&quot;uploader-window&quot;,template:f.template(&quot;uploader-window&quot;),initialize:function(){var g;this.$browser=e('&lt;a href=&quot;#&quot; class=&quot;browser&quot; /&gt;').hide().appendTo(&quot;body&quot;);g=this.options.uploader=_.defaults(this.options.uploader||{},{dropzone:this.$el,browser:this.$browser,params:{}});if(g.dropzone&amp;&amp;!(g.dropzone instanceof e)){g.dropzone=e(g.dropzone)}this.controller.on(&quot;activate&quot;,this.refresh,this)},refresh:function(){if(this.uploader){this.uploader.refresh()}},ready:function(){var h=f.view.settings.post.id,g;if(this.uploader){return}if(h){this.options.uploader.params.post_id=h}this.uploader=new wp.Uploader(this.options
 .uploader);g=this.uploader.dropzone;g.on(&quot;dropzone:enter&quot;,_.bind(this.show,this));g.on(&quot;dropzone:leave&quot;,_.bind(this.hide,this))},show:function(){var g=this.$el.show();_.defer(function(){g.css({opacity:1})})},hide:function(){var g=this.$el.css({opacity:0});f.transition(g).done(function(){if(&quot;0&quot;===g.css(&quot;opacity&quot;)){g.hide()}})}});f.view.UploaderInline=f.View.extend({tagName:&quot;div&quot;,className:&quot;uploader-inline&quot;,template:f.template(&quot;uploader-inline&quot;),initialize:function(){_.defaults(this.options,{message:&quot;&quot;,status:true});if(!this.options.$browser&amp;&amp;this.controller.uploader){this.options.$browser=this.controller.uploader.$browser}if(_.isUndefined(this.options.postId)){this.options.postId=f.view.settings.post.id}if(this.options.status){this.views.set(&quot;.upload-inline-status&quot;,new f.view.UploaderStatus({controller:this.controller}))}},dispose:function(){if(this.disposing){return f.View.proto
 type.dispose.apply(this,arguments)}this.disposing=true;return this.remove()},remove:function(){var g=f.View.prototype.remove.apply(this,arguments);_.defer(_.bind(this.refresh,this));return g},refresh:function(){var g=this.controller.uploader;if(g){g.refresh()}},ready:function(){var g=this.options.$browser,h;if(this.controller.uploader){h=this.$(&quot;.browser&quot;);if(h[0]===g[0]){return}g.detach().text(h.text());g[0].className=h[0].className;h.replaceWith(g.show())}this.refresh();return this}});f.view.UploaderStatus=f.View.extend({className:&quot;media-uploader-status&quot;,template:f.template(&quot;uploader-status&quot;),events:{&quot;click .upload-dismiss-errors&quot;:&quot;dismiss&quot;},initialize:function(){this.queue=wp.Uploader.queue;this.queue.on(&quot;add remove reset&quot;,this.visibility,this);this.queue.on(&quot;add remove reset change:percent&quot;,this.progress,this);this.queue.on(&quot;add remove reset change:uploading&quot;,this.info,this);this.errors=wp.Up
 loader.errors;this.errors.reset();this.errors.on(&quot;add remove reset&quot;,this.visibility,this);this.errors.on(&quot;add&quot;,this.error,this)},dispose:function(){wp.Uploader.queue.off(null,null,this);f.View.prototype.dispose.apply(this,arguments);return this},visibility:function(){this.$el.toggleClass(&quot;uploading&quot;,!!this.queue.length);this.$el.toggleClass(&quot;errors&quot;,!!this.errors.length);this.$el.toggle(!!this.queue.length||!!this.errors.length)},ready:function(){_.each({&quot;$bar&quot;:&quot;.media-progress-bar div&quot;,&quot;$index&quot;:&quot;.upload-index&quot;,&quot;$total&quot;:&quot;.upload-total&quot;,&quot;$filename&quot;:&quot;.upload-filename&quot;},function(g,h){this[h]=this.$(g)},this);this.visibility();this.progress();this.info()},progress:function(){var g=this.queue,i=this.$bar,h=0;if(!i||!g.length){return}i.width((g.reduce(function(j,l){if(!l.get(&quot;uploading&quot;)){return j+100}var k=l.get(&quot;percent&quot;);return j+(_.isNumbe
 r(k)?k:100)},0)/g.length)+&quot;%&quot;)},info:function(){var g=this.queue,h=0,i;if(!g.length){return}i=this.queue.find(function(k,j){h=j;return k.get(&quot;uploading&quot;)});this.$index.text(h+1);this.$total.text(g.length);this.$filename.html(i?this.filename(i.get(&quot;filename&quot;)):&quot;&quot;)},filename:function(g){return f.truncate(_.escape(g),24)},error:function(g){this.views.add(&quot;.upload-errors&quot;,new f.view.UploaderStatusError({filename:this.filename(g.get(&quot;file&quot;).name),message:g.get(&quot;message&quot;)}),{at:0})},dismiss:function(g){var h=this.views.get(&quot;.upload-errors&quot;);g.preventDefault();if(h){_.invoke(h,&quot;remove&quot;)}wp.Uploader.errors.reset()}});f.view.UploaderStatusError=f.View.extend({className:&quot;upload-error&quot;,template:f.template(&quot;uploader-status-error&quot;)});f.view.Toolbar=f.View.extend({tagName:&quot;div&quot;,className:&quot;media-toolbar&quot;,initialize:function(){var i=this.controller.state(),h=this
 .selection=i.get(&quot;selection&quot;),g=this.library=i.get(&quot;library&quot;);this._views={};this.primary=new f.view.PriorityList();this.secondary=new f.view.PriorityList();this.primary.$el.addClass(&quot;media-toolbar-primary&quot;);this.secondary.$el.addClass(&quot;media-toolbar-secondary&quot;);this.views.set([this.secondary,this.primary]);if(this.options.items){this.set(this.options.items,{silent:true})}if(!this.options.silent){this.render()}if(h){h.on(&quot;add remove reset&quot;,this.refresh,this)}if(g){g.on(&quot;add remove reset&quot;,this.refresh,this)}},dispose:function(){if(this.selection){this.selection.off(null,null,this)}if(this.library){this.library.off(null,null,this)}return f.View.prototype.dispose.apply(this,arguments)},ready:function(){this.refresh()},set:function(j,g,h){var i;h=h||{};if(_.isObject(j)){_.each(j,function(k,l){this.set(l,k,{silent:true})},this)}else{if(!(g instanceof Backbone.View)){g.classes=[&quot;media-button-&quot;+j].concat(g.classe
 s||[]);g=new f.view.Button(g).render()}g.controller=g.controller||this.controller;this._views[j]=g;i=g.options.priority&lt;0?&quot;secondary&quot;:&quot;primary&quot;;this[i].set(j,g,h)}if(!h.silent){this.refresh()}return this},get:function(g){return this._views[g]},unset:function(h,g){delete this._views[h];this.primary.unset(h,g);this.secondary.unset(h,g);if(!g||!g.silent){this.refresh()}return this},refresh:function(){var i=this.controller.state(),g=i.get(&quot;library&quot;),h=i.get(&quot;selection&quot;);_.each(this._views,function(j){if(!j.model||!j.options||!j.options.requires){return}var l=j.options.requires,k=false;if(l.selection&amp;&amp;h&amp;&amp;!h.length){k=true}else{if(l.library&amp;&amp;g&amp;&amp;!g.length){k=true}}j.model.set(&quot;disabled&quot;,k)})}});f.view.Toolbar.Select=f.view.Toolbar.extend({initialize:function(){var h=this.options,g=h.controller,i=g.state().get(&quot;selection&quot;);_.bindAll(this,&quot;clickSelect&quot;);_.defaults(h,{event:&quot;s
 elect&quot;,state:false,reset:true,close:true,text:b.select,requires:{selection:true}});h.items=_.defaults(h.items||{},{select:{style:&quot;primary&quot;,text:h.text,priority:80,click:this.clickSelect,requires:h.requires}});f.view.Toolbar.prototype.initialize.apply(this,arguments)},clickSelect:function(){var h=this.options,g=this.controller;if(h.close){g.close()}if(h.event){g.state().trigger(h.event)}if(h.reset){g.reset()}if(h.state){g.setState(h.state)}}});f.view.Toolbar.Embed=f.view.Toolbar.Select.extend({initialize:function(){_.defaults(this.options,{text:b.insertIntoPost,requires:false});f.view.Toolbar.Select.prototype.initialize.apply(this,arguments)},refresh:function(){var g=this.controller.state().props.get(&quot;url&quot;);this.get(&quot;select&quot;).model.set(&quot;disabled&quot;,!g||/^https?:\/\/$/.test(g));f.view.Toolbar.Select.prototype.refresh.apply(this,arguments)}});f.view.Button=f.View.extend({tagName:&quot;a&quot;,className:&quot;media-button&quot;,attribut
 es:{href:&quot;#&quot;},events:{click:&quot;click&quot;},defaults:{text:&quot;&quot;,style:&quot;&quot;,size:&quot;large&quot;,disabled:false},initialize:function(){this.model=new Backbone.Model(this.defaults);_.each(this.defaults,function(i,g){var h=this.options[g];if(_.isUndefined(h)){return}this.model.set(g,h);delete this.options[g]},this);this.model.on(&quot;change&quot;,this.render,this)},render:function(){var h=[&quot;button&quot;,this.className],g=this.model.toJSON();if(g.style){h.push(&quot;button-&quot;+g.style)}if(g.size){h.push(&quot;button-&quot;+g.size)}h=_.uniq(h.concat(this.options.classes));this.el.className=h.join(&quot; &quot;);this.$el.attr(&quot;disabled&quot;,g.disabled);this.$el.text(this.model.get(&quot;text&quot;));return this},click:function(g){if(&quot;#&quot;===this.attributes.href){g.preventDefault()}if(this.options.click&amp;&amp;!this.model.get(&quot;disabled&quot;)){this.options.click.apply(this,arguments)}}});f.view.ButtonGroup=f.View.extend({
 tagName:&quot;div&quot;,className:&quot;button-group button-large media-button-group&quot;,initialize:function(){this.buttons=_.map(this.options.buttons||[],function(g){if(g instanceof Backbone.View){return g}else{return new f.view.Button(g).render()}});delete this.options.buttons;if(this.options.classes){this.$el.addClass(this.options.classes)}},render:function(){this.$el.html(e(_.pluck(this.buttons,&quot;el&quot;)).detach());return this}});f.view.PriorityList=f.View.extend({tagName:&quot;div&quot;,initialize:function(){this._views={};this.set(_.extend({},this._views,this.options.views),{silent:true});delete this.options.views;if(!this.options.silent){this.render()}},set:function(l,h,j){var k,g,i;j=j||{};if(_.isObject(l)){_.each(l,function(m,n){this.set(n,m)},this);return this}if(!(h instanceof Backbone.View)){h=this.toView(h,l,j)}h.controller=h.controller||this.controller;this.unset(l);k=h.options.priority||10;g=this.views.get()||[];_.find(g,function(n,m){if(n.options.prio
 rity&gt;k){i=m;return true}});this._views[l]=h;this.views.add(h,{at:_.isNumber(i)?i:g.length||0});return this},get:function(g){return this._views[g]},unset:function(h){var g=this.get(h);if(g){g.remove()}delete this._views[h];return this},toView:function(g){return new f.View(g)}});f.view.MenuItem=f.View.extend({tagName:&quot;a&quot;,className:&quot;media-menu-item&quot;,attributes:{href:&quot;#&quot;},events:{click:&quot;_click&quot;},_click:function(g){var h=this.options.click;if(g){g.preventDefault()}if(h){h.call(this)}else{this.click()}},click:function(){var g=this.options.state;if(g){this.controller.setState(g)}},render:function(){var g=this.options;if(g.text){this.$el.text(g.text)}else{if(g.html){this.$el.html(g.html)}}return this}});f.view.Menu=f.view.PriorityList.extend({tagName:&quot;div&quot;,className:&quot;media-menu&quot;,property:&quot;state&quot;,ItemView:f.view.MenuItem,region:&quot;menu&quot;,toView:function(g,h){g=g||{};g[this.property]=g[this.property]||h;re
 turn new this.ItemView(g).render()},ready:function(){f.view.PriorityList.prototype.ready.apply(this,arguments);this.visibility()},set:function(){f.view.PriorityList.prototype.set.apply(this,arguments);this.visibility()},unset:function(){f.view.PriorityList.prototype.unset.apply(this,arguments);this.visibility()},visibility:function(){var j=this.region,h=this.controller[j].get(),g=this.views.get(),i=!g||g.length&lt;2;if(this===h){this.controller.$el.toggleClass(&quot;hide-&quot;+j,i)}},select:function(h){var g=this.get(h);if(!g){return}this.deselect();g.$el.addClass(&quot;active&quot;)},deselect:function(){this.$el.children().removeClass(&quot;active&quot;)}});f.view.RouterItem=f.view.MenuItem.extend({click:function(){var g=this.options.contentMode;if(g){this.controller.content.mode(g)}}});f.view.Router=f.view.Menu.extend({tagName:&quot;div&quot;,className:&quot;media-router&quot;,property:&quot;contentMode&quot;,ItemView:f.view.RouterItem,region:&quot;router&quot;,initialize
 :function(){this.controller.on(&quot;content:render&quot;,this.update,this);f.view.Menu.prototype.initialize.apply(this,arguments)},update:function(){var g=this.controller.content.mode();if(g){this.select(g)}}});f.view.Sidebar=f.view.PriorityList.extend({className:&quot;media-sidebar&quot;});f.view.Attachment=f.View.extend({tagName:&quot;li&quot;,className:&quot;attachment&quot;,template:f.template(&quot;attachment&quot;),events:{&quot;click .attachment-preview&quot;:&quot;toggleSelectionHandler&quot;,&quot;change [data-setting]&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] input&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] select&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] textarea&quot;:&quot;updateSetting&quot;,&quot;click .close&quot;:&quot;removeFromLibrary&quot;,&quot;click .check&quot;:&quot;removeFromSelection&quot;,&quot;click a&quot;:&quot;preventDefault&quot;},buttons:{},initialize:function(){var g=this.options.selectio
 n;this.model.on(&quot;change:sizes change:uploading change:caption change:title&quot;,this.render,this);this.model.on(&quot;change:percent&quot;,this.progress,this);this.model.on(&quot;add&quot;,this.select,this);this.model.on(&quot;remove&quot;,this.deselect,this);if(g){g.on(&quot;reset&quot;,this.updateSelect,this)}this.model.on(&quot;selection:single selection:unsingle&quot;,this.details,this);this.details(this.model,this.controller.state().get(&quot;selection&quot;))},dispose:function(){var g=this.options.selection;this.updateAll();if(g){g.off(null,null,this)}f.View.prototype.dispose.apply(this,arguments);return this},render:function(){var g=_.defaults(this.model.toJSON(),{orientation:&quot;landscape&quot;,uploading:false,type:&quot;&quot;,subtype:&quot;&quot;,icon:&quot;&quot;,filename:&quot;&quot;,caption:&quot;&quot;,title:&quot;&quot;,dateFormatted:&quot;&quot;,width:&quot;&quot;,height:&quot;&quot;,compat:false,alt:&quot;&quot;});g.buttons=this.buttons;g.describe=th
 is.controller.state().get(&quot;describe&quot;);if(&quot;image&quot;===g.type){g.size=this.imageSize()}g.can={};if(g.nonces){g.can.remove=!!g.nonces[&quot;delete&quot;];g.can.save=!!g.nonces.update}this.views.detach();this.$el.html(this.template(g));this.$el.toggleClass(&quot;uploading&quot;,g.uploading);if(g.uploading){this.$bar=this.$(&quot;.media-progress-bar div&quot;)}else{delete this.$bar}this.updateSelect();this.updateSave();this.views.render();return this},progress:function(){if(this.$bar&amp;&amp;this.$bar.length){this.$bar.width(this.model.get(&quot;percent&quot;)+&quot;%&quot;)}},toggleSelectionHandler:function(g){var h;if(g.shiftKey){h=&quot;between&quot;}else{if(g.ctrlKey||g.metaKey){h=&quot;toggle&quot;}}this.toggleSelection({method:h})},toggleSelection:function(p){var k=this.collection,l=this.options.selection,j=this.model,g=p&amp;&amp;p.method,m,n,h,i,o;if(!l){return}m=l.single();g=_.isUndefined(g)?l.multiple:g;if(&quot;between&quot;===g&amp;&amp;m&amp;&amp;l
 .multiple){if(m===j){return}i=k.indexOf(m);o=k.indexOf(this.model);if(i&lt;o){h=k.models.slice(i,o+1)}else{h=k.models.slice(o,i+1)}l.add(h).single(j);return}else{if(&quot;toggle&quot;===g){l[this.selected()?&quot;remove&quot;:&quot;add&quot;](j).single(j);return}}if(g!==&quot;add&quot;){g=&quot;reset&quot;}if(this.selected()){l[m===j?&quot;remove&quot;:&quot;single&quot;](j)}else{l[g](j).single(j)}},updateSelect:function(){this[this.selected()?&quot;select&quot;:&quot;deselect&quot;]()},selected:function(){var g=this.options.selection;if(g){return !!g.getByCid(this.model.cid)}},select:function(g,i){var h=this.options.selection;if(!h||(i&amp;&amp;i!==h)){return}this.$el.addClass(&quot;selected&quot;)},deselect:function(g,i){var h=this.options.selection;if(!h||(i&amp;&amp;i!==h)){return}this.$el.removeClass(&quot;selected&quot;)},details:function(g,j){var i=this.options.selection,h;if(i!==j){return}h=i.single();this.$el.toggleClass(&quot;details&quot;,h===this.model)},preventD
 efault:function(g){g.preventDefault()},imageSize:function(g){var h=this.model.get(&quot;sizes&quot;);g=g||&quot;medium&quot;;if(h&amp;&amp;h[g]){return _.clone(h[g])}else{return{url:this.model.get(&quot;url&quot;),width:this.model.get(&quot;width&quot;),height:this.model.get(&quot;height&quot;),orientation:this.model.get(&quot;orientation&quot;)}}},updateSetting:function(i){var g=e(i.target).closest(&quot;[data-setting]&quot;),h,j;if(!g.length){return}h=g.data(&quot;setting&quot;);j=i.target.value;if(this.model.get(h)!==j){this.save(h,j)}},save:function(){var g=this,i=this._save=this._save||{status:&quot;ready&quot;},h=this.model.save.apply(this.model,arguments),j=i.requests?e.when(h,i.requests):h;if(i.savedTimer){clearTimeout(i.savedTimer)}this.updateSave(&quot;waiting&quot;);i.requests=j;j.always(function(){if(i.requests!==j){return}g.updateSave(j.state()===&quot;resolved&quot;?&quot;complete&quot;:&quot;error&quot;);i.savedTimer=setTimeout(function(){g.updateSave(&quot;re
 ady&quot;);delete i.savedTimer},2000)})},updateSave:function(g){var h=this._save=this._save||{status:&quot;ready&quot;};if(g&amp;&amp;g!==h.status){this.$el.removeClass(&quot;save-&quot;+h.status);h.status=g}this.$el.addClass(&quot;save-&quot;+h.status);return this},updateAll:function(){var h=this.$(&quot;[data-setting]&quot;),g=this.model,i;i=_.chain(h).map(function(k){var m=e(&quot;input, textarea, select, [value]&quot;,k),j,l;if(!m.length){return}j=e(k).data(&quot;setting&quot;);l=m.val();if(g.get(j)!==l){return[j,l]}}).compact().object().value();if(!_.isEmpty(i)){g.save(i)}},removeFromLibrary:function(g){g.stopPropagation();this.collection.remove(this.model)},removeFromSelection:function(h){var g=this.options.selection;if(!g){return}h.stopPropagation();g.remove(this.model)}});f.view.Attachment.Library=f.view.Attachment.extend({buttons:{check:true}});f.view.Attachment.EditLibrary=f.view.Attachment.extend({buttons:{close:true}});f.view.Attachments=f.View.extend({tagName:&q
 uot;ul&quot;,className:&quot;attachments&quot;,cssTemplate:f.template(&quot;attachments-css&quot;),events:{scroll:&quot;scroll&quot;},initialize:function(){this.el.id=_.uniqueId(&quot;__attachments-view-&quot;);_.defaults(this.options,{refreshSensitivity:200,refreshThreshold:3,AttachmentView:f.view.Attachment,sortable:false});this._viewsByCid={};this.collection.on(&quot;add&quot;,function(i,g,h){this.views.add(this.createAttachmentView(i),{at:h.index})},this);this.collection.on(&quot;remove&quot;,function(j,g,i){var h=this._viewsByCid[j.cid];delete this._viewsByCid[j.cid];if(h){h.remove()}},this);this.collection.on(&quot;reset&quot;,this.render,this);this.scroll=_.chain(this.scroll).bind(this).throttle(this.options.refreshSensitivity).value();this.initSortable();_.bindAll(this,&quot;css&quot;);this.model.on(&quot;change:edge change:gutter&quot;,this.css,this);this._resizeCss=_.debounce(_.bind(this.css,this),this.refreshSensitivity);e(window).on(&quot;resize.attachments&quot;
 ,this._resizeCss);this.css()},dispose:function(){this.collection.props.off(null,null,this);e(window).off(&quot;resize.attachments&quot;,this._resizeCss);f.View.prototype.dispose.apply(this,arguments)},css:function(){var g=e(&quot;#&quot;+this.el.id+&quot;-css&quot;);if(g.length){g.remove()}f.view.Attachments.$head().append(this.cssTemplate({id:this.el.id,edge:this.edge(),gutter:this.model.get(&quot;gutter&quot;)}))},edge:function(){var i=this.model.get(&quot;edge&quot;),j,h,g;if(!this.$el.is(&quot;:visible&quot;)){return i}j=this.model.get(&quot;gutter&quot;)*2;h=this.$el.width()-j;g=Math.ceil(h/(i+j));i=Math.floor((h-(g*j))/g);return i},initSortable:function(){var g=this.collection,h;if(!this.options.sortable||!e.fn.sortable){return}this.$el.sortable({disabled:!!g.comparator,containment:this.$el,tolerance:&quot;pointer&quot;,start:function(i,j){h=j.item.index()},update:function(k,l){var j=g.at(h),i=g.comparator;delete g.comparator;g.remove(j,{silent:true}).add(j,{silent:tru
 e,at:l.item.index()});g.comparator=i;g.trigger(&quot;reset&quot;,g);g.saveMenuOrder()}});g.props.on(&quot;change:orderby&quot;,function(){this.$el.sortable(&quot;option&quot;,&quot;disabled&quot;,!!g.comparator)},this);this.collection.props.on(&quot;change:orderby&quot;,this.refreshSortable,this);this.refreshSortable()},refreshSortable:function(){if(!this.options.sortable||!e.fn.sortable){return}var i=this.collection,h=i.props.get(&quot;orderby&quot;),g=&quot;menuOrder&quot;===h||!i.comparator;this.$el.sortable(&quot;option&quot;,&quot;disabled&quot;,!g)},createAttachmentView:function(h){var g=new this.options.AttachmentView({controller:this.controller,model:h,collection:this.collection,selection:this.options.selection});return this._viewsByCid[h.cid]=g},prepare:function(){if(this.collection.length){this.views.set(this.collection.map(this.createAttachmentView,this))}else{this.views.unset();this.collection.more().done(this.scroll)}},ready:function(){this.scroll()},scroll:func
 tion(g){if(!this.$el.is(&quot;:visible&quot;)){return}if(this.collection.hasMore()&amp;&amp;this.el.scrollHeight&lt;this.el.scrollTop+(this.el.clientHeight*this.options.refreshThreshold)){this.collection.more().done(this.scroll)}}},{$head:(function(){var g;return function(){return g=g||e(&quot;head&quot;)}}())});f.view.Search=f.View.extend({tagName:&quot;input&quot;,className:&quot;search&quot;,attributes:{type:&quot;search&quot;,placeholder:b.search},events:{input:&quot;search&quot;,keyup:&quot;search&quot;,change:&quot;search&quot;,search:&quot;search&quot;},render:function(){this.el.value=this.model.escape(&quot;search&quot;);return this},search:function(g){if(g.target.value){this.model.set(&quot;search&quot;,g.target.value)}else{this.model.unset(&quot;search&quot;)}}});f.view.AttachmentFilters=f.View.extend({tagName:&quot;select&quot;,className:&quot;attachment-filters&quot;,events:{change:&quot;change&quot;},keys:[],initialize:function(){this.createFilters();_.extend(th
 is.filters,this.options.filters);this.$el.html(_.chain(this.filters).map(function(g,h){return{el:this.make(&quot;option&quot;,{value:h},g.text),priority:g.priority||50}},this).sortBy(&quot;priority&quot;).pluck(&quot;el&quot;).value());this.model.on(&quot;change&quot;,this.select,this);this.select()},createFilters:function(){this.filters={}},change:function(h){var g=this.filters[this.el.value];if(g){this.model.set(g.props)}},select:function(){var g=this.model,i=&quot;all&quot;,h=g.toJSON();_.find(this.filters,function(k,l){var j=_.all(k.props,function(n,m){return n===(_.isUndefined(h[m])?null:h[m])});if(j){return i=l}});this.$el.val(i)}});f.view.AttachmentFilters.Uploaded=f.view.AttachmentFilters.extend({createFilters:function(){var h=this.model.get(&quot;type&quot;),g=f.view.settings.mimeTypes,i;if(g&amp;&amp;h){i=g[h]}this.filters={all:{text:i||b.allMediaItems,props:{uploadedTo:null,orderby:&quot;date&quot;,order:&quot;DESC&quot;},priority:10},uploaded:{text:b.uploadedToTh
 isPost,props:{uploadedTo:f.view.settings.post.id,orderby:&quot;menuOrder&quot;,order:&quot;ASC&quot;},priority:20}}}});f.view.AttachmentFilters.All=f.view.AttachmentFilters.extend({createFilters:function(){var g={};_.each(f.view.settings.mimeTypes||{},function(i,h){g[h]={text:i,props:{type:h,uploadedTo:null,orderby:&quot;date&quot;,order:&quot;DESC&quot;}}});g.all={text:b.allMediaItems,props:{type:null,uploadedTo:null,orderby:&quot;date&quot;,order:&quot;DESC&quot;},priority:10};g.uploaded={text:b.uploadedToThisPost,props:{type:null,uploadedTo:f.view.settings.post.id,orderby:&quot;menuOrder&quot;,order:&quot;ASC&quot;},priority:20};this.filters=g}});f.view.AttachmentsBrowser=f.View.extend({tagName:&quot;div&quot;,className:&quot;attachments-browser&quot;,initialize:function(){_.defaults(this.options,{filters:false,search:true,display:false,AttachmentView:f.view.Attachment.Library});this.createToolbar();this.updateContent();this.createSidebar();this.collection.on(&quot;add re
 move reset&quot;,this.updateContent,this)},dispose:function(){this.options.selection.off(null,null,this);f.View.prototype.dispose.apply(this,arguments);return this},createToolbar:function(){var h,g;this.toolbar=new f.view.Toolbar({controller:this.controller});this.views.add(this.toolbar);h=this.options.filters;if(&quot;uploaded&quot;===h){g=f.view.AttachmentFilters.Uploaded}else{if(&quot;all&quot;===h){g=f.view.AttachmentFilters.All}}if(g){this.toolbar.set(&quot;filters&quot;,new g({controller:this.controller,model:this.collection.props,priority:-80}).render())}if(this.options.search){this.toolbar.set(&quot;search&quot;,new f.view.Search({controller:this.controller,model:this.collection.props,priority:60}).render())}if(this.options.dragInfo){this.toolbar.set(&quot;dragInfo&quot;,new f.View({el:e('&lt;div class=&quot;instructions&quot;&gt;'+b.dragInfo+&quot;&lt;/div&gt;&quot;)[0],priority:-40}))}},updateContent:function(){var g=this;if(!this.attachments){this.createAttachment
 s()}if(!this.collection.length){this.collection.more().done(function(){if(!g.collection.length){g.createUploader()}})}},removeContent:function(){_.each([&quot;attachments&quot;,&quot;uploader&quot;],function(g){if(this[g]){this[g].remove();delete this[g]}},this)},createUploader:function(){this.removeContent();this.uploader=new f.view.UploaderInline({controller:this.controller,status:false,message:b.noItemsFound});this.views.add(this.uploader)},createAttachments:function(){this.removeContent();this.attachments=new f.view.Attachments({controller:this.controller,collection:this.collection,selection:this.options.selection,model:this.model,sortable:this.options.sortable,AttachmentView:this.options.AttachmentView});this.views.add(this.attachments)},createSidebar:function(){var g=this.options,h=g.selection,i=this.sidebar=new f.view.Sidebar({controller:this.controller});this.views.add(i);if(this.controller.uploader){i.set(&quot;uploads&quot;,new f.view.UploaderStatus({controller:thi
 s.controller,priority:40}))}h.on(&quot;selection:single&quot;,this.createSingle,this);h.on(&quot;selection:unsingle&quot;,this.disposeSingle,this);if(h.single()){this.createSingle()}},createSingle:function(){var h=this.sidebar,i=this.options.selection.single(),g={};h.set(&quot;details&quot;,new f.view.Attachment.Details({controller:this.controller,model:i,priority:80}));h.set(&quot;compat&quot;,new f.view.AttachmentCompat({controller:this.controller,model:i,priority:120}));if(this.options.display){h.set(&quot;display&quot;,new f.view.Settings.AttachmentDisplay({controller:this.controller,model:this.model.display(i),attachment:i,priority:160,userSettings:this.model.get(&quot;displayUserSettings&quot;)}))}},disposeSingle:function(){var g=this.sidebar;g.unset(&quot;details&quot;);g.unset(&quot;compat&quot;);g.unset(&quot;display&quot;)}});f.view.Selection=f.View.extend({tagName:&quot;div&quot;,className:&quot;media-selection&quot;,template:f.template(&quot;media-selection&quot;
 ),events:{&quot;click .edit-selection&quot;:&quot;edit&quot;,&quot;click .clear-selection&quot;:&quot;clear&quot;},initialize:function(){_.defaults(this.options,{editable:false,clearable:true});this.attachments=new f.view.Attachments({controller:this.controller,collection:this.collection,selection:this.collection,sortable:true,model:new Backbone.Model({edge:40,gutter:5}),AttachmentView:f.view.Attachment.Selection});this.views.set(&quot;.selection-view&quot;,this.attachments);this.collection.on(&quot;add remove reset&quot;,this.refresh,this);this.controller.on(&quot;content:activate&quot;,this.refresh,this)},ready:function(){this.refresh()},refresh:function(){if(!this.$el.children().length){return}var h=this.collection,g=&quot;edit-selection&quot;===this.controller.content.mode();this.$el.toggleClass(&quot;empty&quot;,!h.length);this.$el.toggleClass(&quot;one&quot;,1===h.length);this.$el.toggleClass(&quot;editing&quot;,g);this.$(&quot;.count&quot;).text(h.length+&quot; &quot;
 +b.selected)},edit:function(g){g.preventDefault();if(this.options.editable){this.options.editable.call(this,this.collection)}},clear:function(g){g.preventDefault();this.collection.reset()}});f.view.Attachment.Selection=f.view.Attachment.extend({className:&quot;attachment selection&quot;,toggleSelection:function(){this.options.selection.single(this.model)}});f.view.Attachment.EditSelection=f.view.Attachment.Selection.extend({buttons:{close:true}});f.view.Settings=f.View.extend({events:{&quot;click button&quot;:&quot;updateHandler&quot;,&quot;change input&quot;:&quot;updateHandler&quot;,&quot;change select&quot;:&quot;updateHandler&quot;,&quot;change textarea&quot;:&quot;updateHandler&quot;},initialize:function(){this.model=this.model||new Backbone.Model();this.model.on(&quot;change&quot;,this.updateChanges,this)},render:function(){this.$el.html(this.template(_.defaults({model:this.model.toJSON()},this.options)));_(this.model.attributes).chain().keys().each(this.update,this);r
 eturn this},update:function(j){var k=this.model.get(j),i=this.$('[data-setting=&quot;'+j+'&quot;]'),g,h;if(!i.length){return}if(i.is(&quot;select&quot;)){h=i.find('[value=&quot;'+k+'&quot;]');if(h.length){h.prop(&quot;selected&quot;,true)}else{this.model.set(i.data(&quot;setting&quot;),i.find(&quot;:selected&quot;).val())}}else{if(i.hasClass(&quot;button-group&quot;)){g=i.find(&quot;button&quot;).removeClass(&quot;active&quot;);g.filter('[value=&quot;'+k+'&quot;]').addClass(&quot;active&quot;)}else{if(i.is('input[type=&quot;text&quot;], textarea')){if(!i.is(&quot;:focus&quot;)){i.val(k)}}else{if(i.is('input[type=&quot;checkbox&quot;]')){i.attr(&quot;checked&quot;,!!k)}}}}},updateHandler:function(i){var h=e(i.target).closest(&quot;[data-setting]&quot;),j=i.target.value,g;i.preventDefault();if(!h.length){return}if(h.is('input[type=&quot;checkbox&quot;]')){j=h[0].checked}this.model.set(h.data(&quot;setting&quot;),j);if(g=h.data(&quot;userSetting&quot;)){setUserSetting(g,j)}},up
 dateChanges:function(h,g){if(g.changes){_(g.changes).chain().keys().each(this.update,this)}}});f.view.Settings.AttachmentDisplay=f.view.Settings.extend({className:&quot;attachment-display-settings&quot;,template:f.template(&quot;attachment-display-settings&quot;),initialize:function(){var g=this.options.attachment;_.defaults(this.options,{userSettings:false});f.view.Settings.prototype.initialize.apply(this,arguments);this.model.on(&quot;change:link&quot;,this.updateLinkTo,this);if(g){g.on(&quot;change:uploading&quot;,this.render,this)}},dispose:function(){var g=this.options.attachment;if(g){g.off(null,null,this)}f.view.Settings.prototype.dispose.apply(this,arguments)},render:function(){var g=this.options.attachment;if(g){_.extend(this.options,{sizes:g.get(&quot;sizes&quot;),type:g.get(&quot;type&quot;)})}f.view.Settings.prototype.render.call(this);this.updateLinkTo();return this},updateLinkTo:function(){var h=this.model.get(&quot;link&quot;),i=this.$(&quot;.link-to-custom&qu
 ot;),g=this.options.attachment;if(&quot;none&quot;===h||(!g&amp;&amp;&quot;custom&quot;!==h)){i.hide();return}if(g){if(&quot;post&quot;===h){i.val(g.get(&quot;link&quot;))}else{if(&quot;file&quot;===h){i.val(g.get(&quot;url&quot;))}else{if(!this.model.get(&quot;linkUrl&quot;)){i.val(&quot;http://&quot;)}}}i.prop(&quot;readonly&quot;,&quot;custom&quot;!==h)}i.show();if(i.is(&quot;:visible&quot;)){i.focus()[0].select()}}});f.view.Settings.Gallery=f.view.Settings.extend({className:&quot;gallery-settings&quot;,template:f.template(&quot;gallery-settings&quot;)});f.view.Attachment.Details=f.view.Attachment.extend({tagName:&quot;div&quot;,className:&quot;attachment-details&quot;,template:f.template(&quot;attachment-details&quot;),events:{&quot;change [data-setting]&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] input&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] select&quot;:&quot;updateSetting&quot;,&quot;change [data-setting] textarea&quot;:&quot;update
 Setting&quot;,&quot;click .delete-attachment&quot;:&quot;deleteAttachment&quot;},deleteAttachment:function(g){g.preventDefault();if(confirm(b.warnDelete)){this.model.destroy()}}});f.view.AttachmentCompat=f.View.extend({tagName:&quot;form&quot;,className:&quot;compat-item&quot;,events:{submit:&quot;preventDefault&quot;,&quot;change input&quot;:&quot;save&quot;,&quot;change select&quot;:&quot;save&quot;,&quot;change textarea&quot;:&quot;save&quot;},initialize:function(){this.model.on(&quot;change:compat&quot;,this.render,this)},render:function(){var g=this.model.get(&quot;compat&quot;);if(!g||!g.item){return}this.$el.html(g.item);return this},preventDefault:function(g){g.preventDefault()},save:function(g){var h={};g.preventDefault();_.each(this.$el.serializeArray(),function(i){h[i.name]=i.value});this.model.saveCompat(h)}});f.view.Iframe=f.View.extend({className:&quot;media-iframe&quot;,render:function(){this.views.detach();this.$el.html('&lt;iframe src=&quot;'+this.controller
 .state().get(&quot;src&quot;)+'&quot; /&gt;');this.views.render();return this}});f.view.Embed=f.View.extend({className:&quot;media-embed&quot;,initialize:function(){this.url=new f.view.EmbedUrl({controller:this.controller,model:this.model.props}).render();this._settings=new f.View();this.refresh();this.model.on(&quot;change:type&quot;,this.refresh,this)},render:function(){this.$el.html([this.url.el,this._settings.el]);this.url.focus();this.views.render();return this},settings:function(g){g.render();this._settings.$el.replaceWith(g.$el);this._settings.remove();this._settings=g},refresh:function(){var h=this.model.get(&quot;type&quot;),g;if(&quot;image&quot;===h){g=f.view.EmbedImage}else{if(&quot;link&quot;===h){g=f.view.EmbedLink}else{return}}this.settings(new g({controller:this.controller,model:this.model.props,priority:40}))}});f.view.EmbedUrl=f.View.extend({tagName:&quot;label&quot;,className:&quot;embed-url&quot;,events:{input:&quot;url&quot;,keyup:&quot;url&quot;,change:
 &quot;url&quot;},initialize:function(){this.input=this.make(&quot;input&quot;,{type:&quot;text&quot;,value:this.model.get(&quot;url&quot;)||&quot;&quot;});this.$input=e(this.input);this.$el.append(this.input);this.model.on(&quot;change:url&quot;,this.render,this)},render:function(){var g=this.$input;if(g.is(&quot;:focus&quot;)){return}this.input.value=this.model.get(&quot;url&quot;)||&quot;http://&quot;;return this},url:function(g){this.model.set(&quot;url&quot;,g.target.value)},focus:function(){var g=this.$input;if(g.is(&quot;:visible&quot;)){g.focus()[0].select()}}});f.view.EmbedLink=f.view.Settings.extend({className:&quot;embed-link-settings&quot;,template:f.template(&quot;embed-link-settings&quot;)});f.view.EmbedImage=f.view.Settings.AttachmentDisplay.extend({className:&quot;embed-image-settings&quot;,template:f.template(&quot;embed-image-settings&quot;),initialize:function(){f.view.Settings.AttachmentDisplay.prototype.initialize.apply(this,arguments);this.model.on(&quot
 ;change:url&quot;,this.updateImage,this)},updateImage:function(){this.$(&quot;img&quot;).attr(&quot;src&quot;,this.model.get(&quot;url&quot;))}})}(jQuery));
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjspluploadwppluploadminjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/plupload/wp-plupload.min.js (23053 => 23054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/plupload/wp-plupload.min.js        2012-12-05 00:45:21 UTC (rev 23053)
+++ trunk/wp-includes/js/plupload/wp-plupload.min.js        2012-12-05 00:58:31 UTC (rev 23054)
</span><span class="lines">@@ -1 +1 @@
</span><del>-window.wp=window.wp||{};(function(a,b){var c;if(typeof _wpPluploadSettings===&quot;undefined&quot;){return}c=function(f){var d=this,h={container:&quot;container&quot;,browser:&quot;browse_button&quot;,dropzone:&quot;drop_element&quot;},g,e;this.supports={upload:c.browser.supported};this.supported=this.supports.upload;if(!this.supported){return}this.plupload=b.extend(true,{multipart_params:{}},c.defaults);this.container=document.body;b.extend(true,this,f);for(g in this){if(b.isFunction(this[g])){this[g]=b.proxy(this[g],this)}}for(g in h){if(!this[g]){continue}this[g]=b(this[g]).first();if(!this[g].length){delete this[g];continue}if(!this[g].prop(&quot;id&quot;)){this[g].prop(&quot;id&quot;,&quot;__wp-uploader-id-&quot;+c.uuid++)}this.plupload[h[g]]=this[g].prop(&quot;id&quot;)}if(!(this.browser&amp;&amp;this.browser.length)&amp;&amp;!(this.dropzone&amp;&amp;this.dropzone.length)){return}this.uploader=new plupload.Uploader(this.plupload);delete this.plupload;this.p
 aram(this.params||{});delete this.params;e=function(j,k,i){if(i.attachment){i.attachment.destroy()}c.errors.unshift({message:j||pluploadL10n.default_error,data:k,file:i});d.error(j,k,i)};this.uploader.init();this.supports.dragdrop=this.uploader.features.dragdrop&amp;&amp;!c.browser.mobile;(function(j,i){var l,k;if(!j){return}j.toggleClass(&quot;supports-drag-drop&quot;,!!i);if(!i){return j.unbind(&quot;.wp-uploader&quot;)}j.bind(&quot;dragover.wp-uploader&quot;,function(){if(l){clearTimeout(l)}if(k){return}j.trigger(&quot;dropzone:enter&quot;).addClass(&quot;drag-over&quot;);k=true});j.bind(&quot;dragleave.wp-uploader, drop.wp-uploader&quot;,function(){l=setTimeout(function(){k=false;j.trigger(&quot;dropzone:leave&quot;).removeClass(&quot;drag-over&quot;)},0)})}(this.dropzone,this.supports.dragdrop));if(this.browser){this.browser.on(&quot;mouseenter&quot;,this.refresh)}else{this.uploader.disableBrowse(true);b(&quot;#&quot;+this.uploader.id+&quot;_html5_container&quot;).hide(
 )}this.uploader.bind(&quot;FilesAdded&quot;,function(i,j){_.each(j,function(l){var k,m;k=_.extend({file:l,uploading:true,date:new Date(),filename:l.name,menuOrder:0,uploadedTo:wp.media.model.settings.post.id},_.pick(l,&quot;loaded&quot;,&quot;size&quot;,&quot;percent&quot;));m=/(?:jpe?g|png|gif)$/i.exec(l.name);if(m){k.type=&quot;image&quot;;k.subtype=(&quot;jpg&quot;===m[0])?&quot;jpeg&quot;:m[0]}l.attachment=wp.media.model.Attachment.create(k);c.queue.add(l.attachment);d.added(l.attachment)});i.refresh();i.start()});this.uploader.bind(&quot;UploadProgress&quot;,function(i,j){j.attachment.set(_.pick(j,&quot;loaded&quot;,&quot;percent&quot;));d.progress(j.attachment)});this.uploader.bind(&quot;FileUploaded&quot;,function(i,l,k){var j;try{k=JSON.parse(k.response)}catch(m){return e(pluploadL10n.default_error,m,l)}if(!_.isObject(k)||_.isUndefined(k.success)){return e(pluploadL10n.default_error,null,l)}else{if(!k.success){return e(k.data&amp;&amp;k.data.message,k.data,l)}}_.each
 ([&quot;file&quot;,&quot;loaded&quot;,&quot;size&quot;,&quot;percent&quot;],function(n){l.attachment.unset(n)});l.attachment.set(_.extend(k.data,{uploading:false}));wp.media.model.Attachment.get(k.data.id,l.attachment);j=c.queue.all(function(n){return !n.get(&quot;uploading&quot;)});if(j){c.queue.reset()}d.success(l.attachment)});this.uploader.bind(&quot;Error&quot;,function(i,l){var k=pluploadL10n.default_error,j;for(j in c.errorMap){if(l.code===plupload[j]){k=c.errorMap[j];if(_.isFunction(k)){k=k(l.file,l)}break}}e(k,l,l.file);i.refresh()});this.init()};b.extend(c,_wpPluploadSettings);c.uuid=0;c.errorMap={FAILED:pluploadL10n.upload_failed,FILE_EXTENSION_ERROR:pluploadL10n.invalid_filetype,IMAGE_FORMAT_ERROR:pluploadL10n.not_an_image,IMAGE_MEMORY_ERROR:pluploadL10n.image_memory_exceeded,IMAGE_DIMENSIONS_ERROR:pluploadL10n.image_dimensions_exceeded,GENERIC_ERROR:pluploadL10n.upload_failed,IO_ERROR:pluploadL10n.io_error,HTTP_ERROR:pluploadL10n.http_error,SECURITY_ERROR:pluplo
 adL10n.security_error,FILE_SIZE_ERROR:function(d){return pluploadL10n.file_exceeds_size_limit.replace(&quot;%s&quot;,d.name)}};b.extend(c.prototype,{param:function(d,e){if(arguments.length===1&amp;&amp;typeof d===&quot;string&quot;){return this.uploader.settings.multipart_params[d]}if(arguments.length&gt;1){this.uploader.settings.multipart_params[d]=e}else{b.extend(this.uploader.settings.multipart_params,d)}},init:function(){},error:function(){},success:function(){},added:function(){},progress:function(){},complete:function(){},refresh:function(){this.uploader.refresh()}});c.queue=new wp.media.model.Attachments([],{query:false});c.errors=new Backbone.Collection();a.Uploader=c})(wp,jQuery);
</del><span class="cx">\ No newline at end of file
</span><ins>+window.wp=window.wp||{};(function(a,b){var c;if(typeof _wpPluploadSettings===&quot;undefined&quot;){return}c=function(f){var d=this,h={container:&quot;container&quot;,browser:&quot;browse_button&quot;,dropzone:&quot;drop_element&quot;},g,e;this.supports={upload:c.browser.supported};this.supported=this.supports.upload;if(!this.supported){return}this.plupload=b.extend(true,{multipart_params:{}},c.defaults);this.container=document.body;b.extend(true,this,f);for(g in this){if(b.isFunction(this[g])){this[g]=b.proxy(this[g],this)}}for(g in h){if(!this[g]){continue}this[g]=b(this[g]).first();if(!this[g].length){delete this[g];continue}if(!this[g].prop(&quot;id&quot;)){this[g].prop(&quot;id&quot;,&quot;__wp-uploader-id-&quot;+c.uuid++)}this.plupload[h[g]]=this[g].prop(&quot;id&quot;)}if(!(this.browser&amp;&amp;this.browser.length)&amp;&amp;!(this.dropzone&amp;&amp;this.dropzone.length)){return}this.uploader=new plupload.Uploader(this.plupload);delete this.plupload;this.p
 aram(this.params||{});delete this.params;e=function(j,k,i){if(i.attachment){i.attachment.destroy()}c.errors.unshift({message:j||pluploadL10n.default_error,data:k,file:i});d.error(j,k,i)};this.uploader.init();this.supports.dragdrop=this.uploader.features.dragdrop&amp;&amp;!c.browser.mobile;(function(j,i){var l,k;if(!j){return}j.toggleClass(&quot;supports-drag-drop&quot;,!!i);if(!i){return j.unbind(&quot;.wp-uploader&quot;)}j.bind(&quot;dragover.wp-uploader&quot;,function(){if(l){clearTimeout(l)}if(k){return}j.trigger(&quot;dropzone:enter&quot;).addClass(&quot;drag-over&quot;);k=true});j.bind(&quot;dragleave.wp-uploader, drop.wp-uploader&quot;,function(){l=setTimeout(function(){k=false;j.trigger(&quot;dropzone:leave&quot;).removeClass(&quot;drag-over&quot;)},0)})}(this.dropzone,this.supports.dragdrop));if(this.browser){this.browser.on(&quot;mouseenter&quot;,this.refresh)}else{this.uploader.disableBrowse(true);b(&quot;#&quot;+this.uploader.id+&quot;_html5_container&quot;).hide(
 )}this.uploader.bind(&quot;FilesAdded&quot;,function(i,j){_.each(j,function(l){var k,m;k=_.extend({file:l,uploading:true,date:new Date(),filename:l.name,menuOrder:0,uploadedTo:wp.media.model.settings.post.id},_.pick(l,&quot;loaded&quot;,&quot;size&quot;,&quot;percent&quot;));m=/(?:jpe?g|png|gif)$/i.exec(l.name);if(m){k.type=&quot;image&quot;;k.subtype=(&quot;jpg&quot;===m[0])?&quot;jpeg&quot;:m[0]}l.attachment=wp.media.model.Attachment.create(k);c.queue.add(l.attachment);d.added(l.attachment)});i.refresh();i.start()});this.uploader.bind(&quot;UploadProgress&quot;,function(i,j){j.attachment.set(_.pick(j,&quot;loaded&quot;,&quot;percent&quot;));d.progress(j.attachment)});this.uploader.bind(&quot;FileUploaded&quot;,function(i,l,k){var j;try{k=JSON.parse(k.response)}catch(m){return e(pluploadL10n.default_error,m,l)}if(!_.isObject(k)||_.isUndefined(k.success)){return e(pluploadL10n.default_error,null,l)}else{if(!k.success){return e(k.data&amp;&amp;k.data.message,k.data,l)}}_.each
 ([&quot;file&quot;,&quot;loaded&quot;,&quot;size&quot;,&quot;percent&quot;],function(n){l.attachment.unset(n)});l.attachment.set(_.extend(k.data,{uploading:false}));wp.media.model.Attachment.get(k.data.id,l.attachment);j=c.queue.all(function(n){return !n.get(&quot;uploading&quot;)});if(j){c.queue.reset()}d.success(l.attachment)});this.uploader.bind(&quot;Error&quot;,function(i,l){var k=pluploadL10n.default_error,j;for(j in c.errorMap){if(l.code===plupload[j]){k=c.errorMap[j];if(_.isFunction(k)){k=k(l.file,l)}break}}e(k,l,l.file);i.refresh()});this.init()};b.extend(c,_wpPluploadSettings);c.uuid=0;c.errorMap={FAILED:pluploadL10n.upload_failed,FILE_EXTENSION_ERROR:pluploadL10n.invalid_filetype,IMAGE_FORMAT_ERROR:pluploadL10n.not_an_image,IMAGE_MEMORY_ERROR:pluploadL10n.image_memory_exceeded,IMAGE_DIMENSIONS_ERROR:pluploadL10n.image_dimensions_exceeded,GENERIC_ERROR:pluploadL10n.upload_failed,IO_ERROR:pluploadL10n.io_error,HTTP_ERROR:pluploadL10n.http_error,SECURITY_ERROR:pluplo
 adL10n.security_error,FILE_SIZE_ERROR:function(d){return pluploadL10n.file_exceeds_size_limit.replace(&quot;%s&quot;,d.name)}};b.extend(c.prototype,{param:function(d,e){if(arguments.length===1&amp;&amp;typeof d===&quot;string&quot;){return this.uploader.settings.multipart_params[d]}if(arguments.length&gt;1){this.uploader.settings.multipart_params[d]=e}else{b.extend(this.uploader.settings.multipart_params,d)}},init:function(){},error:function(){},success:function(){},added:function(){},progress:function(){},complete:function(){},refresh:function(){var f,e,d;if(this.browser){f=this.browser[0];while(f){if(f===document.body){e=true;break}f=f.parentNode}this.uploader.disableBrowse(!e);this._container().toggle(e)}this.uploader.refresh()},_container:function(){var d=this.uploader.runtime;if(this._$container&amp;&amp;this._$container.length){return this._$container}if(&quot;html4&quot;===d){return b('[target=&quot;'+this.uploader.id+'_iframe&quot;]')}if(&quot;html5&quot;!==d&amp;&am
 p;&quot;flash&quot;!==d&amp;&amp;&quot;silverlight&quot;!==d){return b()}this._$container=b(&quot;#&quot;+this.uploader.id+&quot;_&quot;+d+&quot;_container&quot;);return this._$container}});c.queue=new wp.media.model.Attachments([],{query:false});c.errors=new Backbone.Collection();a.Uploader=c})(wp,jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesversionphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/version.php (23053 => 23054)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/version.php        2012-12-05 00:45:21 UTC (rev 23053)
+++ trunk/wp-includes/version.php        2012-12-05 00:58:31 UTC (rev 23054)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx">  *
</span><span class="cx">  * @global string $wp_version
</span><span class="cx">  */
</span><del>-$wp_version = '3.5-RC3-23047';
</del><ins>+$wp_version = '3.5-RC3-23054';
</ins><span class="cx"> 
</span><span class="cx"> /**
</span><span class="cx">  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
</span></span></pre>
</div>
</div>

</body>
</html>