<!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>[22810] trunk/wp-includes: Compress scripts/styles: 3.5-beta3-22810.</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/22810">22810</a></dd>
<dt>Author</dt> <dd>bumpbot</dd>
<dt>Date</dt> <dd>2012-11-22 06:58:42 +0000 (Thu, 22 Nov 2012)</dd>
</dl>
<h3>Log Message</h3>
<pre>Compress scripts/styles: 3.5-beta3-22810.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludescssmediaviewsmincss">trunk/wp-includes/css/media-views.min.css</a></li>
<li><a href="#trunkwpincludesjsmediaeditorminjs">trunk/wp-includes/js/media-editor.min.js</a></li>
<li><a href="#trunkwpincludesjsmediamodelsminjs">trunk/wp-includes/js/media-models.min.js</a></li>
<li><a href="#trunkwpincludesjsmediaviewsminjs">trunk/wp-includes/js/media-views.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 (22809 => 22810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/css/media-views.min.css        2012-11-22 06:30:25 UTC (rev 22809)
+++ trunk/wp-includes/css/media-views.min.css        2012-11-22 06:58:42 UTC (rev 22810)
</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{height:28px;line-height:28px;margin-top:3px}a{color:#21759b}a:hover{color:#d54e21}input[type="text"],input[type="password"],input[type="number"],input[type="search"],input[type="email"],input[type="url"],textarea,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:#dfdfdf}input[type="search"]{-webkit-appearance:textfield}.media-modal{position:fixed;top:60px;left:40px;right:40px;bottom:40px;z-index:125000}.media-modal-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;background:#000;opacity:.8;z-index:120000}.media-moda
l-backdrop div{position:absolute;top:10px;left:10px;right:10px;bottom:10px;border:1px dashed rgba(255,255,255,0.5)}.media-modal-title,.media-modal-close{position:absolute;top:-40px;height:40px;line-height:40px;color:#fff;font-weight:200;text-shadow:0 0 16px rgba(0,0,0,0.6)}a.media-modal-close{color:#fff}.media-modal-title{left:0;float:left;padding:0;margin:0;font-size:16px}.media-modal-close{right:0;float:right;text-decoration:none;font-size:1.8em}.media-modal-close:hover,.media-modal-close:focus{color:#fff;text-shadow:0 0 16px rgba(255,255,255,0.8)}.media-modal-close:active{outline:0}.media-modal-content{position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;background:#fff}.media-toolbar{position:absolute;top:0;left:0;right:0;z-index:100;height:60px;padding:0 16px;border:0 solid #dfdfdf}.media-frame-toolbar>.media-toolbar{top:auto;left:200px;bottom:0;border-width:1px 0 0 0;box-shadow:0 -4px 4px -4px rgba(0,0,0,0.1)}.hide-toolbar .media-frame-toolbar>.media-too
lbar{bottom:-61px}.media-toolbar-primary{float:right}.media-toolbar-secondary{float:left}.media-toolbar-primary>.media-button,.media-toolbar-primary>.media-button-group{margin-left:10px;float:left;margin-top:15px}.media-toolbar-secondary>.media-button,.media-toolbar-secondary>.media-button-group{margin-right:10px;float:left;margin-top:15px}.media-sidebar{position:absolute;top:0;right:0;bottom:61px;width:267px;padding:0 16px 24px;z-index:75;background:#f5f5f5;border-left:1px solid #dfdfdf;overflow:auto}.hide-sidebar .media-sidebar{right:-300px}.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 .selection-preview{display:block;padding-top:5px}.media-sidebar h3{position:relative;font-weight:bold;text-transform:uppercase;font-size:12px;color:#7
77;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%}.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%;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 .lab
el 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;bottom:0;width:199px;margin:0;padding:16px 0;z-index:200;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 li{position:relative;padding:4px 20px;margin:0;line-height:18px;font-size:14px;color:#21759b;text-shadow:0 1px 0 #fff}.media-menu-item{cursor:pointer}.media-menu li:hover{background:rgba(0,0,0,0.04)}.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-menu>a.button{margin:0 20px}.media-frame{overflow:hidden}.media-frame .region-content{position:absolute;top:0;left:200px;right:300px;bottom:61px;height:auto;width:auto;margi
n:0;overflow:auto}.media-frame.hide-sidebar .region-content{right:0}.media-frame.hide-toolbar .region-content{bottom:0}.media-frame .media-toolbar .add-to-gallery{display:none}.media-frame .media-iframe{overflow:hidden}.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}.media-toolbar-secondary .search{margin-right:16px}.attachments{margin:0;padding-right:16px}.attachment{position:relative;float:left;padding:0;margin:0 10px 20px;color:#464646;list-style:none;-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,.attachment .thumbnail{display:block;position:absolute;top:0;left:0;margin:0 auto;overflow:hidden;max-width:100%;max-height:100%}.attachment .icon{top:50%;left:50%}.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 .icon,.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;bott
om:0;padding:5px 10px;text-align:center;font-weight:bold;background:rgba(255,255,255,0.8);box-shadow:0 0 2px rgba(0,0,0,0.2)}.attachment-preview .thumbnail{width:199px;height:199px}.attachment .thumbnail img{position:absolute}.attachment .close{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:#fff;border-width:0;box-shadow:0 0 0 1px rgba(0,0,0,0.3)}.attachment .button:hover{box-shadow:0 0 0 1px rgba(0,0,0,0.6)}.attachment .close{display:none}.attachment:hover .close{display:block}.attachment .check{display:none;height:24px;width:24px;position:absolute;top:-7px;right:-7px;line-height:24px;font-size:16px;text-align:center;text-decoration:none;outline:0;color:#333;border:1px solid #fff;border-radius:3px;text-shadow:0 1px 0 #fff;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(#e1
e1e1));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 .dash{font-weight:bold;font-size:18px;line-height:22px}.attachment .check .dash,.attachment .check:hover span{display:none}.attachment.selected .check,.attachment .check:hover .dash{display:block}.attachment.details .check{color:#fff;text-shadow:0 1px 0 rgba(0,0,0,0.5);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(top,#1e8cbe,#0074a2);background-image:-o-linear-gradient(top,#1e8cbe,#0074a2);background-image:linear-gradient(to bottom,#1e8cbe,#0074a2)}.media-frame .describe{position:relative;display:block;width:100%;margin:-1px 0
0;padding:8px;font-size:12px;border-radius:0}.media-frame .attachments-browser{overflow:hidden}.attachments-browser .media-toolbar{height:50px}.attachments-browser .media-toolbar-primary>.media-button,.attachments-browser .media-toolbar-primary>.media-button-group,.attachments-browser .media-toolbar-secondary>.media-button,.attachments-browser .media-toolbar-secondary>.media-button-group{margin-top:10px}.attachments-browser .attachments{position:absolute;top:50px;left:0;right:0;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:8px;width:70%;margin:10px auto;padding:2px;border:2px solid #ccc;border-radius:8px;background:#fff}.media-progress-bar div{height:8px;min-width:8px;width:0;background:#ccc;border-radius:10px;-webkit-transition:width 300ms;-moz-transition:width 300ms;-ms-transition:width 300ms;-o-transition:width 300ms;transiti
on:width 300ms}.attachment-preview .media-progress-bar{position:absolute;top:50%;left:15%;width:70%;margin:-8px 0 0 -4px}.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 .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 .uploade
r-window .media-progress-bar{display:block}.upload-flash-bypass{font-size:12px}.region-content.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 h3{display:none;font-size:20px;font-weight:200;margin-bottom:1.6em}.supports-drag-drop .uploader-inline h3{display:block}.uploader-inline .media-progress-bar{display:none}.uploading.uploader-inline .media-progress-bar{display:block}.uploader-inline .browser{display: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{display:none}.media-selection .count{display:block;padding-top:12px;font-size:14px;line-height:20px;font-weight:bold}.media-selection .selection-in
fo 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}.media-selection .selection-info .clear-selection{color:red}.media-selection .selection-info .clear-selection:hover{background:red}.media-selection .attachments{display:inline-block;height:60px;margin-top:5px;overflow:hidden;vertical-align:top}.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-i
mage:-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}.selection-preview{position:relative;height:60px;overflow:hidden}.selected-img{float:left;position:relative;margin-right:14px}.selection-preview img{max-width:40px;max-height:40px;float:left;margin-top:6px;margin-left:1px;border:2px solid white;box-shadow:0 0 0 1px #ccc,3px 3px 0 0 #fff,3px 3px 0 1px #ccc,6px 6px 0 0 #fff,6px 6px 0 1px #ccc}.selection-preview .selected-count-1 img{margin-top:8px;box-shadow:0 0 0 1px #ccc}.selection-preview .selected-count-2 img{margin-top:7px;box-shadow:0 0 0 1px #ccc,3px 3px 0 0 #fff,3px 3px 0 1px #ccc}.selection-preview .count{position:absolute;bottom:0;right:0;height:
16px;min-width:8px;padding:0 4px;font-size:12px;text-align:center;font-weight:bold;color:#999;background:#fff;box-shadow:-1px -1px 2px -1px rgba(0,0,0,0.2)}.selection-preview .clear-selection{float:left;line-height:60px}.attachment-details{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}.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:32px}.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:blo
ck;max-width:120px;max-height:120px;margin:0 auto}.attachment-info .details{float:left;font-size:12px}.attachment-info .compat-meta{float:left}.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:75px;padding:16px 16px;margin:0;z-index:50;border-bottom:1px solid #dfdfdf;box-shadow:0 4px 4px -4px rgba(0,0,0,0.1);font-size:18px;font-weight:200}.embed-url span{display:block;padding:4px 0 6px 2px}.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:108px;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{conte
nt:'';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}
</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{height:28px;line-height:28px;margin-top:3px}a{color:#21759b}a:hover{color:#d54e21}input[type="text"],input[type="password"],input[type="number"],input[type="search"],input[type="email"],input[type="url"],textarea,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:#dfdfdf}input[type="search"]{-webkit-appearance:textfield}.media-modal{position:fixed;top:60px;left:40px;right:40px;bottom:40px;z-index:125000}.media-modal-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;background:#000;opacity:.8;z-index:120000}.media-moda
l-backdrop div{position:absolute;top:10px;left:10px;right:10px;bottom:10px;border:1px dashed rgba(255,255,255,0.5)}.media-modal-title,.media-modal-close{position:absolute;top:-40px;height:40px;line-height:40px;color:#fff;font-weight:200;text-shadow:0 0 16px rgba(0,0,0,0.6)}a.media-modal-close{color:#fff}.media-modal-title{left:0;float:left;padding:0;margin:0;font-size:16px}.media-modal-close{right:0;float:right;text-decoration:none;font-size:1.8em}.media-modal-close:hover,.media-modal-close:focus{color:#fff;text-shadow:0 0 16px rgba(255,255,255,0.8)}.media-modal-close:active{outline:0}.media-modal-content{position:absolute;top:0;left:0;right:0;bottom:0;overflow:auto;background:#fff}.media-toolbar{position:absolute;top:0;left:0;right:0;z-index:100;height:60px;padding:0 16px;border:0 solid #dfdfdf}.media-frame-toolbar>.media-toolbar{top:auto;left:200px;bottom:0;border-width:1px 0 0 0;box-shadow:0 -4px 4px -4px rgba(0,0,0,0.1)}.hide-toolbar .media-frame-toolbar>.media-too
lbar{bottom:-61px}.media-toolbar-primary{float:right}.media-toolbar-secondary{float:left}.media-toolbar-primary>.media-button,.media-toolbar-primary>.media-button-group{margin-left:10px;float:left;margin-top:15px}.media-toolbar-secondary>.media-button,.media-toolbar-secondary>.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}.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 .selection-preview{display:block;padding-top:5px}.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%}.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%;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;bottom:0;width:199px;margin:0;padding:16px 0;z-index:200;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 li{position:relative;padding:4px 20px;margin:0;line-height:18px;font-size:14px;color:#21759b;text-shadow:0 1px 0 #fff}.media-menu-item{cursor:pointer}.media-menu li:hover{background:rgba(0,0,0,0.04)}.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-menu>a.button{margin:0 20px}.media-frame{overflow:hidden}.media-frame .region-content{position:absolute;top:0;left:200px;right:0;bottom:61px;height:auto;width:auto;margin:0;overflow:auto}.media-frame.hide-toolbar .regi
on-content{bottom:0}.media-frame .media-toolbar .add-to-gallery{display:none}.media-frame .media-iframe{overflow:hidden}.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}.media-toolbar-secondary .search{margin-right:16px}.attachments{margin:0;padding-right:16px}.attachment{position:relative;float:left;padding:0;margin:0 10px 20px;color:#464646;list-style:none;-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,.attachment .thumbnail{d
isplay:block;position:absolute;top:0;left:0;margin:0 auto;overflow:hidden;max-width:100%;max-height:100%}.attachment .icon{top:50%;left:50%}.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 .icon,.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;padding:5px 10px;text-align:center;font-weight:bold;background:rgba(255,255,255,0.8);box-shado
w:0 0 2px rgba(0,0,0,0.2)}.attachment-preview .thumbnail{width:199px;height:199px}.attachment .thumbnail img{position:absolute}.attachment .close{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:#fff;border-width:0;box-shadow:0 0 0 1px rgba(0,0,0,0.3)}.attachment .button:hover{box-shadow:0 0 0 1px rgba(0,0,0,0.6)}.attachment .close{display:none}.attachment:hover .close{display:block}.attachment .check{display:none;height:24px;width:24px;position:absolute;top:-7px;right:-7px;line-height:24px;font-size:16px;text-align:center;text-decoration:none;outline:0;color:#333;border:1px solid #fff;border-radius:3px;text-shadow:0 1px 0 #fff;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-g
radient(top,#f1f1f1,#e1e1e1);background-image:-o-linear-gradient(top,#f1f1f1,#e1e1e1);background-image:linear-gradient(to bottom,#f1f1f1,#e1e1e1)}.attachment .check .dash{font-weight:bold;font-size:18px;line-height:22px}.attachment .check .dash,.attachment .check:hover span{display:none}.attachment.selected .check,.attachment .check:hover .dash{display:block}.attachment.details .check{color:#fff;text-shadow:0 1px 0 rgba(0,0,0,0.5);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(top,#1e8cbe,#0074a2);background-image:-o-linear-gradient(top,#1e8cbe,#0074a2);background-image:linear-gradient(to bottom,#1e8cbe,#0074a2)}.media-frame .describe{position:relative;display:block;width:100%;margin:-1px 0 0;padding:8px;font-size:12px;border-radius:0}.media-frame .attachments-browser{overflow:hidden}.att
achments-browser .media-toolbar{right:300px;height:50px}.attachments-browser .media-toolbar-primary>.media-button,.attachments-browser .media-toolbar-primary>.media-button-group,.attachments-browser .media-toolbar-secondary>.media-button,.attachments-browser .media-toolbar-secondary>.media-button-group{margin-top:10px}.attachments-browser .attachments{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:8px;width:70%;margin:10px auto;padding:2px;border:2px solid #ccc;border-radius:8px;background:#fff}.media-progress-bar div{height:8px;min-width:8px;width:0;background:#ccc;border-radius:10px;-webkit-transition:width 300ms;-moz-transition:width 300ms;-ms-transition:width 300ms;-o-transition:width 300ms;transition:width 300ms}.attachment-preview .media-progress-bar{position:absolute;top:50%;le
ft:15%;width:70%;margin:-8px 0 0 -4px}.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 .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}.upload-flash-bypass{font-size:12px}.reg
ion-content.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 h3{display:none;font-size:20px;font-weight:200;margin-bottom:1.6em}.supports-drag-drop .uploader-inline h3{display:block}.uploader-inline .media-progress-bar{display:none}.uploading.uploader-inline .media-progress-bar{display:block}.uploader-inline .browser{display: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{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:1
6px;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}.media-selection .selection-info .clear-selection{color:red}.media-selection .selection-info .clear-selection:hover{background:red}.media-selection .attachments{display:inline-block;height:60px;margin-top:5px;overflow:hidden;vertical-align:top}.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));backgro
und-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}.selection-preview{position:relative;height:60px;overflow:hidden}.selected-img{float:left;position:relative;margin-right:14px}.selection-preview img{max-width:40px;max-height:40px;float:left;margin-top:6px;margin-left:1px;border:2px solid white;box-shadow:0 0 0 1px #ccc,3px 3px 0 0 #fff,3px 3px 0 1px #ccc,6px 6px 0 0 #fff,6px 6px 0 1px #ccc}.selection-preview .selected-count-1 img{margin-top:8px;box-shadow:0 0 0 1px #ccc}.selection-preview .selected-count-2 img{margin-top:7px;box-shadow:0 0 0 1px #ccc,3px 3px 0 0 #fff,3px 3px 0 1px #ccc}.selection-preview .count{position:absolute;bottom:0;right:0;height:16px;min-width:8px;padding:0 4px;font-size:12px;text-align:center;font-weight:bold;
color:#999;background:#fff;box-shadow:-1px -1px 2px -1px rgba(0,0,0,0.2)}.selection-preview .clear-selection{float:left;line-height:60px}.attachment-details{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}.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:32px}.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:l
eft;font-size:12px}.attachment-info .compat-meta{float:left}.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:75px;padding:16px 16px;margin:0;z-index:50;border-bottom:1px solid #dfdfdf;box-shadow:0 4px 4px -4px rgba(0,0,0,0.1);font-size:18px;font-weight:200}.embed-url span{display:block;padding:4px 0 6px 2px}.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:108px;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:inse
t 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}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjsmediaeditorminjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/media-editor.min.js (22809 => 22810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/media-editor.min.js        2012-11-22 06:30:25 UTC (rev 22809)
+++ trunk/wp-includes/js/media-editor.min.js        2012-11-22 06:58:42 UTC (rev 22810)
</span><span class="lines">@@ -1 +1 @@
</span><del>-(function(b){var a={};wp.media.string={props:function(e,h){var g,c,d,f;e=e?_.clone(e):{};if(h&&h.type){e.type=h.type}if("image"===e.type){e=_.defaults(e||{},{align:getUserSetting("align","none"),size:getUserSetting("imgsize","medium"),url:"",classes:[]})}if(!h){return e}g=e.link||getUserSetting("urlbutton","post");if("file"===g){c=h.url}else{if("post"===g){c=h.link}else{if("custom"===g){c=e.linkUrl}}}e.linkUrl=c||"";if("image"===h.type){e.classes.push("wp-image-"+h.id);f=h.sizes;d=f&&f[e.size]?f[e.size]:h;_.extend(e,_.pick(h,"align","caption"),{width:d.width,height:d.height,src:d.url,captionId:"attachment_"+h.id})}else{_.extend(e,{title:h.title||h.filename,rel:"attachment wp-att-"+h.id})}return e},link:function(d,e){var c;d=wp.media.string.props(d,e);c={tag:"a"
,content:d.title,attrs:{href:d.linkUrl}};if(d.rel){c.attrs.rel=d.rel}return wp.html.string(c)},image:function(g,i){var c={},d,f,h,e;g=wp.media.string.props(g,i);f=g.classes||[];c.src=g.url;_.extend(c,_.pick(g,"width","height","alt"));if(g.align&&!g.caption){f.push("align"+g.align)}if(g.size){f.push("size-"+g.size)}c["class"]=_.compact(f).join(" ");d={tag:"img",attrs:c,single:true};if(g.linkUrl){d={tag:"a",attrs:{href:g.linkUrl},content:d}}e=wp.html.string(d);if(g.caption){h={};if(c.width){h.width=c.width}if(g.captionId){h.id=g.captionId}if(g.align){h.align="align"+g.align}e=wp.shortcode.string({tag:"caption",attrs:h,content:e+" "+g.caption})}return e}};wp.media.gallery=(function(){var c={};return{defaults:{order:"ASC",id:wp.media.view.settings.postId,itemtag:"dl",icontag:"dt",captiontag:"dd",columns:3,size:&qu
ot;thumbnail"},attachments:function(h){var j=h.string(),d=c[j],f,e,i,g;delete c[j];if(d){return d}f=h.attrs.named;e=_.pick(f,"orderby","order");e.type="image";e.perPage=-1;if(f.ids){e.post__in=f.ids.split(",");e.orderby="post__in"}else{if(f.include){e.post__in=f.include.split(",")}}if(f.exclude){e.post__not_in=f.exclude.split(",")}if(!e.post__in){e.parent=f.id}g={};_.filter(f,function(l,k){if(_.isUndefined(e[k])){g[k]=l}});i=media.query(e);i.gallery=new Backbone.Model(g);return i},shortcode:function(d){var f=d.props.toJSON(),e=_.pick(f,"include","exclude","orderby","order"),g,h;if(d.gallery){_.extend(e,d.gallery.toJSON())}e.ids=d.pluck("id");if(e.ids&&"post__in"===e.orderby){delete e.orderby}_.each(wp.media.gallery.defaults,function(j,i){if(j===e[i]){delete e[i]}});g=new wp.shortcode({tag:"gallery",attrs:e,type:"single&
quot;});h=new wp.media.model.Attachments(d.models,{props:f});h.gallery=d.gallery;c[g.string()]=h;return g},edit:function(g){var f=wp.shortcode.next("gallery",g),h=wp.media.gallery.defaults.id,d,e;if(!f||f.content!==g){return}f=f.shortcode;if(_.isUndefined(f.get("id"))&&!_.isUndefined(h)){f.set("id",h)}d=wp.media.gallery.attachments(f);e=new wp.media.model.Selection(d.models,{props:d.props.toJSON(),multiple:true});e.gallery=d.gallery;e.more().done(function(){e.props.set({query:false});e.unmirror();e.props.unset("orderby")});return wp.media({frame:"post",state:"gallery-edit",title:wp.media.view.l10n.editGalleryTitle,editing:true,multiple:true,selection:e})}}}());wp.media.editor={insert:function(g){var d=typeof(tinymce)!="undefined",j=typeof(QTags)!="undefined",c=window.wpActiveEditor,f;if(window.send_to_editor){return window.send_to_editor.apply(this,arguments)}if(!c){if(d&&tinymce.
activeEditor){f=tinymce.activeEditor;c=window.wpActiveEditor=f.id}else{if(!j){return false}}}else{if(d){if(tinymce.activeEditor&&(tinymce.activeEditor.id=="mce_fullscreen"||tinymce.activeEditor.id=="wp_mce_fullscreen")){f=tinymce.activeEditor}else{f=tinymce.get(c)}}}if(f&&!f.isHidden()){if(tinymce.isIE&&f.windowManager.insertimagebookmark){f.selection.moveToBookmark(f.windowManager.insertimagebookmark)}if(g.indexOf("[caption")===0){if(f.wpSetImgCaption){g=f.wpSetImgCaption(g)}}else{if(g.indexOf("[gallery")===0){if(f.plugins.wpgallery){g=f.plugins.wpgallery._do_gallery(g)}}else{if(g.indexOf("[embed")===0){if(f.plugins.wordpress){g=f.plugins.wordpress._setEmbed(g)}}}}f.execCommand("mceInsertContent",false,g)}else{if(j){QTags.insertContent(g)}else{document.getElementById(c).value+=g}}if(window.tb_remove){try{window.tb_remove()}catch(i){}}},add:function(e,c){var d=this.get(e);if(d){return d}d=a[e
]=wp.media(_.defaults(c||{},{frame:"post",title:wp.media.view.l10n.insertMedia,multiple:true}));d.on("insert",function(g){var h=d.state(),f=h.get("details");g=g||h.get("selection");if(!g||!f){return}g.each(function(j){var i=f[j.cid];if(i){i=i.toJSON()}delete f[j.cid];j=j.toJSON();this.send.attachment(i,j)},this)},this);d.get("gallery-edit").on("update",function(f){this.insert(wp.media.gallery.shortcode(f).string())},this);d.get("embed").on("select",function(){var f=d.state().toJSON();f.url=f.url||"";if("link"===f.type){_.defaults(f,{title:f.url,linkUrl:f.url});this.send.link(f)}else{if("image"===f.type){_.defaults(f,{title:f.url,linkUrl:"",align:"none",link:"none"});if("none"===f.link){f.linkUrl=""}else{if("file"===f.link){f.linkUrl=f.url}}this.insert(wp.media.string.image(f))}}},this);return d},get:function
(c){return a[c]},remove:function(c){delete a[c]},send:{attachment:function(f,g){var c=g.caption,d,e;if(!wp.media.view.settings.captions){delete g.caption}f=wp.media.string.props(f,g);d={id:g.id};if("image"===g.type){e=wp.media.string.image(f);d.caption=c;_.each({align:"image-align",size:"image-size",alt:"image-alt",linkUrl:"url"},function(h,i){if(f[i]){d[h]=f[i]}})}else{e=wp.media.string.link(f);d.title=f.title}return media.post("send-attachment-to-editor",{nonce:wp.media.view.settings.nonce.sendToEditor,attachment:d,html:e}).done(function(h){wp.media.editor.insert(h)})},link:function(c){return media.post("send-link-to-editor",{nonce:wp.media.view.settings.nonce.sendToEditor,src:c.linkUrl,title:c.title,html:wp.media.string.link(c)}).done(function(d){wp.media.editor.insert(d)})}},init:function(){b(document.body).on("click",".insert-media",function(d){var e=b(this),c=e.data("editor&q
uot;),f;d.preventDefault();e.blur();if(!_.isString(c)){return}f=wp.media.editor.get(c);if(f){f.open();return}wp.media.editor.add(c)})}};b(wp.media.editor.init)}(jQuery));
</del><span class="cx">\ No newline at end of file
</span><ins>+(function(b){var a={};wp.media.string={props:function(e,h){var g,c,d,f;e=e?_.clone(e):{};if(h&&h.type){e.type=h.type}if("image"===e.type){e=_.defaults(e||{},{align:getUserSetting("align","none"),size:getUserSetting("imgsize","medium"),url:"",classes:[]})}if(!h){return e}g=e.link||getUserSetting("urlbutton","post");if("file"===g){c=h.url}else{if("post"===g){c=h.link}else{if("custom"===g){c=e.linkUrl}}}e.linkUrl=c||"";if("image"===h.type){e.classes.push("wp-image-"+h.id);f=h.sizes;d=f&&f[e.size]?f[e.size]:h;_.extend(e,_.pick(h,"align","caption"),{width:d.width,height:d.height,src:d.url,captionId:"attachment_"+h.id})}else{_.extend(e,{title:h.title||h.filename,rel:"attachment wp-att-"+h.id})}return e},link:function(d,e){var c;d=wp.media.string.props(d,e);c={tag:"a"
,content:d.title,attrs:{href:d.linkUrl}};if(d.rel){c.attrs.rel=d.rel}return wp.html.string(c)},image:function(g,i){var c={},d,f,h,e;g=wp.media.string.props(g,i);f=g.classes||[];c.src=g.url;_.extend(c,_.pick(g,"width","height","alt"));if(g.align&&!g.caption){f.push("align"+g.align)}if(g.size){f.push("size-"+g.size)}c["class"]=_.compact(f).join(" ");d={tag:"img",attrs:c,single:true};if(g.linkUrl){d={tag:"a",attrs:{href:g.linkUrl},content:d}}e=wp.html.string(d);if(g.caption){h={};if(c.width){h.width=c.width}if(g.captionId){h.id=g.captionId}if(g.align){h.align="align"+g.align}e=wp.shortcode.string({tag:"caption",attrs:h,content:e+" "+g.caption})}return e}};wp.media.gallery=(function(){var c={};return{defaults:{order:"ASC",id:wp.media.view.settings.postId,itemtag:"dl",icontag:"dt",captiontag:"dd",columns:3,size:&qu
ot;thumbnail"},attachments:function(h){var j=h.string(),d=c[j],f,e,i,g;delete c[j];if(d){return d}f=h.attrs.named;e=_.pick(f,"orderby","order");e.type="image";e.perPage=-1;if(f.ids){e.post__in=f.ids.split(",");e.orderby="post__in"}else{if(f.include){e.post__in=f.include.split(",")}}if(f.exclude){e.post__not_in=f.exclude.split(",")}if(!e.post__in){e.parent=f.id}g={};_.filter(f,function(l,k){if(_.isUndefined(e[k])){g[k]=l}});i=media.query(e);i.gallery=new Backbone.Model(g);return i},shortcode:function(d){var f=d.props.toJSON(),e=_.pick(f,"include","exclude","orderby","order"),g,h;if(d.gallery){_.extend(e,d.gallery.toJSON())}e.ids=d.pluck("id");if(e.ids&&"post__in"===e.orderby){delete e.orderby}_.each(wp.media.gallery.defaults,function(j,i){if(j===e[i]){delete e[i]}});g=new wp.shortcode({tag:"gallery",attrs:e,type:"single&
quot;});h=new wp.media.model.Attachments(d.models,{props:f});h.gallery=d.gallery;c[g.string()]=h;return g},edit:function(g){var f=wp.shortcode.next("gallery",g),h=wp.media.gallery.defaults.id,d,e;if(!f||f.content!==g){return}f=f.shortcode;if(_.isUndefined(f.get("id"))&&!_.isUndefined(h)){f.set("id",h)}d=wp.media.gallery.attachments(f);e=new wp.media.model.Selection(d.models,{props:d.props.toJSON(),multiple:true});e.gallery=d.gallery;e.more().done(function(){e.props.set({query:false});e.unmirror();e.props.unset("orderby")});return wp.media({frame:"post",state:"gallery-edit",title:wp.media.view.l10n.editGalleryTitle,editing:true,multiple:true,selection:e})}}}());wp.media.editor={insert:function(g){var d=typeof(tinymce)!="undefined",j=typeof(QTags)!="undefined",c=window.wpActiveEditor,f;if(window.send_to_editor){return window.send_to_editor.apply(this,arguments)}if(!c){if(d&&tinymce.
activeEditor){f=tinymce.activeEditor;c=window.wpActiveEditor=f.id}else{if(!j){return false}}}else{if(d){if(tinymce.activeEditor&&(tinymce.activeEditor.id=="mce_fullscreen"||tinymce.activeEditor.id=="wp_mce_fullscreen")){f=tinymce.activeEditor}else{f=tinymce.get(c)}}}if(f&&!f.isHidden()){if(tinymce.isIE&&f.windowManager.insertimagebookmark){f.selection.moveToBookmark(f.windowManager.insertimagebookmark)}if(g.indexOf("[caption")===0){if(f.wpSetImgCaption){g=f.wpSetImgCaption(g)}}else{if(g.indexOf("[gallery")===0){if(f.plugins.wpgallery){g=f.plugins.wpgallery._do_gallery(g)}}else{if(g.indexOf("[embed")===0){if(f.plugins.wordpress){g=f.plugins.wordpress._setEmbed(g)}}}}f.execCommand("mceInsertContent",false,g)}else{if(j){QTags.insertContent(g)}else{document.getElementById(c).value+=g}}if(window.tb_remove){try{window.tb_remove()}catch(i){}}},add:function(e,c){var d=this.get(e);if(d){return d}d=a[e
]=wp.media(_.defaults(c||{},{frame:"post",title:wp.media.view.l10n.insertMedia,multiple:true}));d.on("insert",function(f){var g=d.state();f=f||g.get("selection");if(!f){return}f.each(function(i){var h=g.display(i).toJSON();this.send.attachment(h,i.toJSON())},this)},this);d.get("gallery-edit").on("update",function(f){this.insert(wp.media.gallery.shortcode(f).string())},this);d.get("embed").on("select",function(){var f=d.state().toJSON();f.url=f.url||"";if("link"===f.type){_.defaults(f,{title:f.url,linkUrl:f.url});this.send.link(f)}else{if("image"===f.type){_.defaults(f,{title:f.url,linkUrl:"",align:"none",link:"none"});if("none"===f.link){f.linkUrl=""}else{if("file"===f.link){f.linkUrl=f.url}}this.insert(wp.media.string.image(f))}}},this);return d},get:function(c){return a[c]},remove:function(c){delete a[c]},send:{atta
chment:function(f,g){var c=g.caption,d,e;if(!wp.media.view.settings.captions){delete g.caption}f=wp.media.string.props(f,g);d={id:g.id};if("image"===g.type){e=wp.media.string.image(f);d.caption=c;_.each({align:"image-align",size:"image-size",alt:"image-alt",linkUrl:"url"},function(h,i){if(f[i]){d[h]=f[i]}})}else{e=wp.media.string.link(f);d.title=f.title}return media.post("send-attachment-to-editor",{nonce:wp.media.view.settings.nonce.sendToEditor,attachment:d,html:e}).done(function(h){wp.media.editor.insert(h)})},link:function(c){return media.post("send-link-to-editor",{nonce:wp.media.view.settings.nonce.sendToEditor,src:c.linkUrl,title:c.title,html:wp.media.string.link(c)}).done(function(d){wp.media.editor.insert(d)})}},init:function(){b(document.body).on("click",".insert-media",function(d){var e=b(this),c=e.data("editor"),f;d.preventDefault();e.blur();if(!_.isString(c)){retu
rn}f=wp.media.editor.get(c);if(f){f.open();return}wp.media.editor.add(c)})}};b(wp.media.editor.init)}(jQuery));
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesjsmediamodelsminjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/media-models.min.js (22809 => 22810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/media-models.min.js        2012-11-22 06:30:25 UTC (rev 22809)
+++ trunk/wp-includes/js/media-models.min.js        2012-11-22 06:58:42 UTC (rev 22810)
</span><span class="lines">@@ -1 +1 @@
</span><del>-window.wp=window.wp||{};(function(f){var d,c,a,e,b;media=wp.media=function(g){var h=media.view.MediaFrame,i;if(!h){return}g=_.defaults(g||{},{frame:"select"});if("select"===g.frame&&h.Select){i=new h.Select(g)}else{if("post"===g.frame&&h.Post){i=new h.Post(g)}}delete g.frame;i.state(i.options.state);return i.render().attach().open()};_.extend(media,{model:{},view:{},controller:{}});b=media.model.l10n=typeof _wpMediaModelsL10n==="undefined"?{}:_wpMediaModelsL10n;media.model.settings=b.settings||{};delete b.settings;e=function(h,g,i,j){if(_.isEqual(h,g)){return i===j?0:(i>j?-1:1)}else{return h>g?-1:1}};_.extend(media,{template:_.memoize(function(i){var h,g={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(j){h=h||_.template(f("#tmpl-"+i).html(),null,g);return h(j)}}),post:function(h,g){return medi
a.ajax({data:_.isObject(h)?h:_.extend(g||{},{action:h})})},ajax:function(h,g){if(_.isObject(h)){g=h}else{g=g||{};g.data=_.extend(g.data||{},{action:h})}g=_.defaults(g||{},{type:"POST",url:media.model.settings.ajaxurl,context:this});return f.Deferred(function(i){if(g.success){i.done(g.success)}if(g.error){i.fail(g.error)}delete g.success;delete g.error;f.ajax(g).done(function(j){if(_.isObject(j)&&!_.isUndefined(j.success)){i[j.success?"resolveWith":"rejectWith"](this,[j.data])}else{i.rejectWith(this,[j])}}).fail(function(){i.rejectWith(this,arguments)})}).promise()},fit:function(k){var h=k.width,g=k.height,j=k.maxWidth,i=k.maxHeight,l;if(!_.isUndefined(j)&&!_.isUndefined(i)){l=(h/g>j/i)?"width":"height"}else{if(_.isUndefined(i)){l="width"}else{if(_.isUndefined(j)&&g>i){l="height"}}}if("width"===l&&h>j){return{width:j,height:Math.round(j*g/h)}}else{if("
height"===l&&g>i){return{width:Math.round(i*h/g),height:i}}else{return{width:h,height:g}}}}});d=media.model.Attachment=Backbone.Model.extend({sync:function(i,h,g){if("read"===i){g=g||{};g.context=this;g.data=_.extend(g.data||{},{action:"get-attachment",id:this.id});return media.ajax(g)}else{if("update"===i){g=g||{};g.context=this;g.data=_.extend(g.data||{},{action:"save-attachment",id:this.id,nonce:media.model.settings.saveAttachmentNonce});if(g.changes){_.each(g.changes,function(k,j){g.changes[j]=this.get(j)},this);g.data.changes=g.changes;delete g.changes}return media.ajax(g)}}},parse:function(h,g){if(!h){return h}h.date=new Date(h.date);h.modified=new Date(h.modified);return h},saveCompat:function(i,h){var g=this;return media.post("save-attachment-compat",_.defaults({id:this.id,nonce:b.saveAttachmentNonce},i)).done(function(l,j,k){g.set(g.parse(l,k),h)})}},{create:function(g){return c.all.push(g)},get:_.mem
oize(function(h,g){return c.all.push(g||{id:h})})});c=media.model.Attachments=Backbone.Collection.extend({model:d,initialize:function(h,g){g=g||{};this.props=new Backbone.Model();this.filters=g.filters||{};this.props.on("change:order",this._changeOrder,this);this.props.on("change:orderby",this._changeOrderby,this);this.props.on("change:query",this._changeQuery,this);this.props.on("change:search",this._changeSearch,this);this.props.on("change:type",this._changeType,this);this.props.set(_.defaults(g.props||{}));if(g.observe){this.observe(g.observe)}},_changeOrder:function(h,g){if(this.comparator){this.sort()}},_changeOrderby:function(g,h){if(this.comparator&&this.comparator!==c.comparator){return}if(h&&"post__in"!==h){this.comparator=c.comparator}else{delete this.comparator}},_changeQuery:function(g,h){if(h){this.props.on("change",this._requery,this);this._requery()}else{this.props.off("
change",this._requery,this)}},_changeFilteredProp:function(i,g,h){if(this.props.get("query")){return}if(h&&!this.filters[i]){this.filters[i]=c.filters[i]}else{if(!h&&this.filters[i]===c.filters[i]){delete this.filters[i]}}if(!this._source){this._source=new c(this.models)}this.reset(this._source.filter(this.validator,this))},_changeSearch:function(g,h){return this._changeFilteredProp("search",g,h)},_changeType:function(g,h){return this._changeFilteredProp("type",g,h)},validator:function(g){return _.all(this.filters,function(i,h){return !!i.call(this,g)},this)},validate:function(j,h){var i=this.validator(j),g=!!this.getByCid(j.cid);if(!i&&g){this.remove(j,h)}else{if(i&&!g){this.add(j,h)}}return this},validateAll:function(g,h){h=h||{};_.each(g.models,function(i){this.validate(i,{silent:true})},this);if(!h.silent){this.trigger("reset",this,h)}return this},observe:function(g){this.observers=this.observer
s||[];this.observers.push(g);g.on("add change remove",this._validateHandler,this);g.on("reset",this._validateAllHandler,this);this.validateAll(g);return this},unobserve:function(g){if(g){g.off(null,null,this);this.observers=_.without(this.observers,g)}else{_.each(this.observers,function(h){h.off(null,null,this)},this);delete this.observers}return this},_validateHandler:function(i,g,h){h=g===this.mirroring?h:{silent:h&&h.silent};return this.validate(i,h)},_validateAllHandler:function(g,h){return this.validateAll(g,h)},mirror:function(g){if(this.mirroring&&this.mirroring===g){return this}this.unmirror();this.mirroring=g;this.reset([],{silent:true});this.observe(g);return this},unmirror:function(){if(!this.mirroring){return}this.unobserve(this.mirroring);delete this.mirroring},more:function(g){if(this.mirroring&&this.mirroring.more){return this.mirroring.more(g)}return f.Deferred().resolve().promise()},parse:function(h,g){return _.map
(h,function(i){var j=d.get(i.id);return j.set(j.parse(i,g))})},_requery:function(){if(this.props.get("query")){this.mirror(a.get(this.props.toJSON()))}}},{comparator:function(i,h){var j=this.props.get("orderby"),g=this.props.get("order")||"DESC",k=i.cid,l=h.cid;i=i.get(j);h=h.get(j);if("date"===j||"modified"===j){i=i||new Date();h=h||new Date()}return("DESC"===g)?e(i,h,k,l):e(h,i,l,k)},filters:{search:function(g){if(!this.props.get("search")){return true}return _.any(["title","filename","description","caption","name"],function(h){var i=g.get(h);return i&&-1!==i.search(this.props.get("search"))},this)},type:function(h){var g=this.props.get("type");if(!g){return true}return -1!==g.indexOf(h.get("type"))}}});c.all=new c();media.query=function(g){return new c(null,{props:_.extend(_.defaults(g||{},{orderby:"da
te"}),{query:true})})};a=media.model.Query=c.extend({initialize:function(i,g){var h;g=g||{};c.prototype.initialize.apply(this,arguments);this.args=g.args;this.hasMore=true;this.created=new Date();this.filters.order=function(j){if(!this.comparator){return true}if(this.length){return 1!==this.comparator(j,this.last())}else{if("DESC"===this.args.order&&("date"===this.args.orderby||"modified"===this.args.orderby)){return j.get(this.args.orderby)>=this.created}}return false};h=["s","order","orderby","posts_per_page","post_mime_type"];if(wp.Uploader&&_(this.args).chain().keys().difference(h).isEmpty().value()){this.observe(wp.Uploader.queue)}},more:function(g){var h=this;if(this._more&&"pending"===this._more.state()){return this._more}if(!this.hasMore){return f.Deferred().resolve().promise()}g=g||{};g.add=true;return this._more=this.fetch(g).done(function(i){if
(_.isEmpty(i)||-1===this.args.posts_per_page||i.length<this.args.posts_per_page){h.hasMore=false}})},sync:function(j,h,g){var i;if("read"===j){g=g||{};g.context=this;g.data=_.extend(g.data||{},{action:"query-attachments"});args=_.clone(this.args);if(-1!==args.posts_per_page){args.paged=Math.floor(this.length/args.posts_per_page)+1}g.data.query=args;return media.ajax(g)}else{i=c.prototype.sync?c.prototype:Backbone;return i.sync.apply(this,arguments)}}},{defaultProps:{orderby:"date",order:"DESC"},defaultArgs:{posts_per_page:40},orderby:{allowed:["name","author","date","title","modified","uploadedTo","id","post__in"],valuemap:{id:"ID",uploadedTo:"parent"}},propmap:{search:"s",type:"post_mime_type",parent:"post_parent",perPage:"posts_per_page"},get:(function(){var g=[];return function(j,i){var h={},
l=a.orderby,m=a.defaultProps,k;delete j.query;_.defaults(j,m);j.order=j.order.toUpperCase();if("DESC"!==j.order&&"ASC"!==j.order){j.order=m.order.toUpperCase()}if(!_.contains(l.allowed,j.orderby)){j.orderby=m.orderby}_.each(j,function(n,o){if(_.isNull(n)){return}h[a.propmap[o]||o]=n});_.defaults(h,a.defaultArgs);h.orderby=l.valuemap[j.orderby]||j.orderby;k=_.find(g,function(n){return _.isEqual(n.args,h)});if(!k){k=new a([],_.extend(i||{},{props:j,args:h}));g.push(k)}return k}}())});media.model.Selection=c.extend({initialize:function(h,g){c.prototype.initialize.apply(this,arguments);this.multiple=g&&g.multiple;this.on("add remove reset",_.bind(this.single,this,false))},add:function(h,g){if(!this.multiple){h=_.isArray(h)&&h.length?_.first(h):h;this.clear(g)}return c.prototype.add.call(this,h,g)},clear:function(g){this.remove(this.models,g).single();return this},reset:function(h,g){this.clear(g).add(h,g).single();return this
},has:function(g){return !!(this.getByCid(g.cid)||this.get(g.id))},single:function(g){var h=this._single;if(g){this._single=g}if(this._single&&!this.has(this._single)){delete this._single}this._single=this._single||this.last();if(this._single!==h){if(this._single){this._single.trigger("selection:single",this._single,this)}if(h){h.trigger("selection:unsingle",h,this)}}return this._single}})}(jQuery));
</del><span class="cx">\ No newline at end of file
</span><ins>+window.wp=window.wp||{};(function(f){var d,c,a,e,b;media=wp.media=function(g){var h=media.view.MediaFrame,i;if(!h){return}g=_.defaults(g||{},{frame:"select"});if("select"===g.frame&&h.Select){i=new h.Select(g)}else{if("post"===g.frame&&h.Post){i=new h.Post(g)}}delete g.frame;i.state(i.options.state);return i.render().attach().open()};_.extend(media,{model:{},view:{},controller:{}});b=media.model.l10n=typeof _wpMediaModelsL10n==="undefined"?{}:_wpMediaModelsL10n;media.model.settings=b.settings||{};delete b.settings;e=function(h,g,i,j){if(_.isEqual(h,g)){return i===j?0:(i>j?-1:1)}else{return h>g?-1:1}};_.extend(media,{template:_.memoize(function(i){var h,g={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(j){h=h||_.template(f("#tmpl-"+i).html(),null,g);return h(j)}}),post:function(h,g){return medi
a.ajax({data:_.isObject(h)?h:_.extend(g||{},{action:h})})},ajax:function(h,g){if(_.isObject(h)){g=h}else{g=g||{};g.data=_.extend(g.data||{},{action:h})}g=_.defaults(g||{},{type:"POST",url:media.model.settings.ajaxurl,context:this});return f.Deferred(function(i){if(g.success){i.done(g.success)}if(g.error){i.fail(g.error)}delete g.success;delete g.error;f.ajax(g).done(function(j){if(_.isObject(j)&&!_.isUndefined(j.success)){i[j.success?"resolveWith":"rejectWith"](this,[j.data])}else{i.rejectWith(this,[j])}}).fail(function(){i.rejectWith(this,arguments)})}).promise()},fit:function(k){var h=k.width,g=k.height,j=k.maxWidth,i=k.maxHeight,l;if(!_.isUndefined(j)&&!_.isUndefined(i)){l=(h/g>j/i)?"width":"height"}else{if(_.isUndefined(i)){l="width"}else{if(_.isUndefined(j)&&g>i){l="height"}}}if("width"===l&&h>j){return{width:j,height:Math.round(j*g/h)}}else{if("
height"===l&&g>i){return{width:Math.round(i*h/g),height:i}}else{return{width:h,height:g}}}}});d=media.model.Attachment=Backbone.Model.extend({sync:function(i,h,g){if("read"===i){g=g||{};g.context=this;g.data=_.extend(g.data||{},{action:"get-attachment",id:this.id});return media.ajax(g)}else{if("update"===i){g=g||{};g.context=this;g.data=_.extend(g.data||{},{action:"save-attachment",id:this.id,nonce:media.model.settings.saveAttachmentNonce});if(g.changes){_.each(g.changes,function(k,j){g.changes[j]=this.get(j)},this);g.data.changes=g.changes;delete g.changes}return media.ajax(g)}}},parse:function(h,g){if(!h){return h}h.date=new Date(h.date);h.modified=new Date(h.modified);return h},saveCompat:function(i,h){var g=this;return media.post("save-attachment-compat",_.defaults({id:this.id,nonce:b.saveAttachmentNonce},i)).done(function(l,j,k){g.set(g.parse(l,k),h)})}},{create:function(g){return c.all.push(g)},get:_.mem
oize(function(h,g){return c.all.push(g||{id:h})})});c=media.model.Attachments=Backbone.Collection.extend({model:d,initialize:function(h,g){g=g||{};this.props=new Backbone.Model();this.filters=g.filters||{};this.props.on("change:order",this._changeOrder,this);this.props.on("change:orderby",this._changeOrderby,this);this.props.on("change:query",this._changeQuery,this);this.props.on("change:search",this._changeSearch,this);this.props.on("change:type",this._changeType,this);this.props.set(_.defaults(g.props||{}));if(g.observe){this.observe(g.observe)}},_changeOrder:function(h,g){if(this.comparator){this.sort()}},_changeOrderby:function(g,h){if(this.comparator&&this.comparator!==c.comparator){return}if(h&&"post__in"!==h){this.comparator=c.comparator}else{delete this.comparator}},_changeQuery:function(g,h){if(h){this.props.on("change",this._requery,this);this._requery()}else{this.props.off("
change",this._requery,this)}},_changeFilteredProp:function(i,g,h){if(this.props.get("query")){return}if(h&&!this.filters[i]){this.filters[i]=c.filters[i]}else{if(!h&&this.filters[i]===c.filters[i]){delete this.filters[i]}}if(!this._source){this._source=new c(this.models)}this.reset(this._source.filter(this.validator,this))},_changeSearch:function(g,h){return this._changeFilteredProp("search",g,h)},_changeType:function(g,h){return this._changeFilteredProp("type",g,h)},validator:function(g){return _.all(this.filters,function(i,h){return !!i.call(this,g)},this)},validate:function(j,h){var i=this.validator(j),g=!!this.getByCid(j.cid);if(!i&&g){this.remove(j,h)}else{if(i&&!g){this.add(j,h)}}return this},validateAll:function(g,h){h=h||{};_.each(g.models,function(i){this.validate(i,{silent:true})},this);if(!h.silent){this.trigger("reset",this,h)}return this},observe:function(g){this.observers=this.observer
s||[];this.observers.push(g);g.on("add change remove",this._validateHandler,this);g.on("reset",this._validateAllHandler,this);this.validateAll(g);return this},unobserve:function(g){if(g){g.off(null,null,this);this.observers=_.without(this.observers,g)}else{_.each(this.observers,function(h){h.off(null,null,this)},this);delete this.observers}return this},_validateHandler:function(i,g,h){h=g===this.mirroring?h:{silent:h&&h.silent};return this.validate(i,h)},_validateAllHandler:function(g,h){return this.validateAll(g,h)},mirror:function(g){if(this.mirroring&&this.mirroring===g){return this}this.unmirror();this.mirroring=g;this.reset([],{silent:true});this.observe(g);return this},unmirror:function(){if(!this.mirroring){return}this.unobserve(this.mirroring);delete this.mirroring},more:function(g){if(this.mirroring&&this.mirroring.more){return this.mirroring.more(g)}return f.Deferred().resolve().promise()},parse:function(h,g){return _.map
(h,function(i){var j=d.get(i.id);return j.set(j.parse(i,g))})},_requery:function(){if(this.props.get("query")){this.mirror(a.get(this.props.toJSON()))}}},{comparator:function(i,h){var j=this.props.get("orderby"),g=this.props.get("order")||"DESC",k=i.cid,l=h.cid;i=i.get(j);h=h.get(j);if("date"===j||"modified"===j){i=i||new Date();h=h||new Date()}return("DESC"===g)?e(i,h,k,l):e(h,i,l,k)},filters:{search:function(g){if(!this.props.get("search")){return true}return _.any(["title","filename","description","caption","name"],function(h){var i=g.get(h);return i&&-1!==i.search(this.props.get("search"))},this)},type:function(h){var g=this.props.get("type");if(!g){return true}return -1!==g.indexOf(h.get("type"))}}});c.all=new c();media.query=function(g){return new c(null,{props:_.extend(_.defaults(g||{},{orderby:"da
te"}),{query:true})})};a=media.model.Query=c.extend({initialize:function(i,g){var h;g=g||{};c.prototype.initialize.apply(this,arguments);this.args=g.args;this.hasMore=true;this.created=new Date();this.filters.order=function(j){if(!this.comparator){return true}if(this.length){return 1!==this.comparator(j,this.last())}else{if("DESC"===this.args.order&&("date"===this.args.orderby||"modified"===this.args.orderby)){return j.get(this.args.orderby)>=this.created}}return false};h=["s","order","orderby","posts_per_page","post_mime_type"];if(wp.Uploader&&_(this.args).chain().keys().difference(h).isEmpty().value()){this.observe(wp.Uploader.queue)}},more:function(g){var h=this;if(this._more&&"pending"===this._more.state()){return this._more}if(!this.hasMore){return f.Deferred().resolve().promise()}g=g||{};g.add=true;return this._more=this.fetch(g).done(function(i){if
(_.isEmpty(i)||-1===this.args.posts_per_page||i.length<this.args.posts_per_page){h.hasMore=false}})},sync:function(j,h,g){var i;if("read"===j){g=g||{};g.context=this;g.data=_.extend(g.data||{},{action:"query-attachments"});args=_.clone(this.args);if(-1!==args.posts_per_page){args.paged=Math.floor(this.length/args.posts_per_page)+1}g.data.query=args;return media.ajax(g)}else{i=c.prototype.sync?c.prototype:Backbone;return i.sync.apply(this,arguments)}}},{defaultProps:{orderby:"date",order:"DESC"},defaultArgs:{posts_per_page:40},orderby:{allowed:["name","author","date","title","modified","uploadedTo","id","post__in"],valuemap:{id:"ID",uploadedTo:"parent"}},propmap:{search:"s",type:"post_mime_type",parent:"post_parent",perPage:"posts_per_page"},get:(function(){var g=[];return function(j,i){var h={},
l=a.orderby,m=a.defaultProps,k;delete j.query;_.defaults(j,m);j.order=j.order.toUpperCase();if("DESC"!==j.order&&"ASC"!==j.order){j.order=m.order.toUpperCase()}if(!_.contains(l.allowed,j.orderby)){j.orderby=m.orderby}_.each(j,function(n,o){if(_.isNull(n)){return}h[a.propmap[o]||o]=n});_.defaults(h,a.defaultArgs);h.orderby=l.valuemap[j.orderby]||j.orderby;k=_.find(g,function(n){return _.isEqual(n.args,h)});if(!k){k=new a([],_.extend(i||{},{props:j,args:h}));g.push(k)}return k}}())});media.model.Selection=c.extend({initialize:function(h,g){c.prototype.initialize.apply(this,arguments);this.multiple=g&&g.multiple;this.on("add remove reset",_.bind(this.single,this,false))},add:function(h,g){if(!this.multiple){h=_.isArray(h)&&h.length?_.first(h):h;this.clear(g)}return c.prototype.add.call(this,h,g)},clear:function(g){this.remove(this.models,g).single();return this},reset:function(h,g){this.clear(g).add(h,g).single();return this
},has:function(g){return !!(this.getByCid(g.cid)||this.get(g.id))},single:function(g){var h=this._single;if(g){this._single=g}if(this._single&&!this.has(this._single)){delete this._single}this._single=this._single||this.last();if(this._single!==h){if(h){h.trigger("selection:unsingle",h,this)}if(this._single){this._single.trigger("selection:single",this._single,this)}}return this._single}})}(jQuery));
</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 (22809 => 22810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/media-views.min.js        2012-11-22 06:30:25 UTC (rev 22809)
+++ trunk/wp-includes/js/media-views.min.js        2012-11-22 06:58:42 UTC (rev 22810)
</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==="undefined"?{}:_wpMediaViewsL10n;f.view.settings=b.settings||{};delete b.settings;e.support.transition=(function(){var g=document.documentElement.style,h={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},i;i=_.find(_.keys(h),function(j){return !_.isUndefined(g[j])});return i&&{end:h[i]}}());f.transition=function(g){var h=e.Deferred();if(e.support.transition){if(!(g instanceof e)){g=e(g)}g.first().one(e.support.transition.end,h.resolve)}else{h.resolve()}return h.promise()};f.controller.Region=function(g){_.extend(this,_.pick(g||{},"id","controller","selector"));this.on("activate:empty",this.empty,this);this.mode("empty")};f.controller.Regio
n.extend=Backbone.Model.extend;_.extend(f.controller.Region.prototype,Backbone.Events,{trigger:(function(){var g=/\s+/,h=Backbone.Events.trigger;return function(i){var j=":"+this._mode,k=i.split(g).join(j)+j;h.apply(this,arguments);h.apply(this,[k].concat(_.rest(arguments)));return this}}()),mode:function(g){if(g){this.trigger("deactivate",this);this._mode=g;return this.trigger("activate",this)}return this._mode},view:function(g){var h=this._view,i=this._mode,j=this.id;if(!g){return h}if(g===h){return}if(j){g.$el.addClass("region-"+j)}if(i){g.$el.addClass("mode-"+i)}this.controller.views.set(this.selector,g);this._view=g},empty:function(){this.view(new f.View())}});f.controller.StateMachine=function(g){this.states=new Backbone.Collection(g)};f.controller.StateMachine.extend=Backbone.Model.extend;_.extend(f.controller.StateMachine.prototype,Backbone.Events,{get:function(g){this.states=this.states||new Backbone.Collection();if(
!this.states.get(g)){this.states.add({id:g})}return this.states.get(g)},state:function(h){var g;if(!h){return this._state?this.get(this._state):null}g=this.state();if((g&&h===g.id)||!this.states||!this.states.get(h)){return}if(g){g.trigger("deactivate");this._previous=g.id}this._state=h;this.state().trigger("activate")},previous:function(){return this._previous}});_.each(["on","off","trigger"],function(g){f.controller.StateMachine.prototype[g]=function(){this.states=this.states||new Backbone.Collection();this.states[g].apply(this.states,arguments);return this}});f.controller.State=Backbone.Model.extend({initialize:function(){this.on("activate",this._activate,this);this.on("activate",this.activate,this);this.on("deactivate",this._deactivate,this);this.on("deactivate",this.deactivate,this);this.on("reset",this.reset,this)},activate:function(){},_activate:function(){this.
active=true;this.menu();this.toolbar();this.sidebar();this.content()},deactivate:function(){},_deactivate:function(){this.active=false},reset:function(){},menu:function(){var i=this.frame.menu,h=this.get("menu"),g;if(!h){return}if(i.mode()!==h){i.mode(h)}g=i.view();if(g.select){g.select(this.id)}}});_.each(["toolbar","sidebar","content"],function(g){f.controller.State.prototype[g]=function(){var h=this.get(g);if(h){this.frame[g].mode(h)}}});f.controller.Library=f.controller.State.extend({defaults:{id:"library",multiple:false,describe:false,toolbar:"main-attachments",sidebar:"settings",searchable:true,filterable:false},initialize:function(){if(!this.get("selection")){this.set("selection",new f.model.Selection(null,{multiple:this.get("multiple")}))}if(!this.get("library")){this.set("library",f.query())}if(!this.get("edge")){this.set("edge"
,120)}if(!this.get("gutter")){this.set("gutter",8)}if(!this.get("details")){this.set("details",[])}f.controller.State.prototype.initialize.apply(this,arguments)},activate:function(){var g=this.get("selection");this._excludeStateLibrary();this.buildComposite();this.on("change:library change:exclude",this.buildComposite,this);this.on("change:excludeState",this._excludeState,this);if(this.get("multiple")){wp.Uploader.queue.on("add",this.selectUpload,this)}g.on("selection:single selection:unsingle",this.sidebar,this);g.on("add remove reset",this.refreshSelection,this);this._updateEmpty();this.get("library").on("add remove reset",this._updateEmpty,this);this.on("change:empty",this.refresh,this);this.refresh()},deactivate:function(){this.off("change:empty",this.refresh,this);this.get("library").off("add remove reset&qu
ot;,this._updateEmpty,this);this.get("selection").off(null,null,this);wp.Uploader.queue.off(null,null,this);this.off("change:excludeState",this._excludeState,this);this.off("change:library change:exclude",this.buildComposite,this);this.destroyComposite()},reset:function(){this.get("selection").clear()},sidebar:function(){var g=this.frame.sidebar;if(this.get("selection").single()){g.mode(this.get("sidebar"))}else{g.mode("clear")}},content:function(){var g=this.frame;if(this.get("empty")){this.get("library").more();g.content.mode("upload")}else{g.content.mode("browse")}},refresh:function(){this.frame.$el.toggleClass("hide-sidebar hide-toolbar",this.get("empty"));this.content();this.refreshSelection()},_updateEmpty:function(){var g=this.get("library"),h=g.props;if(this.get("filterable")&&(h.get("type")||h.get(&qu
ot;parent"))){return}this.set("empty",!g.length&&!g.props.get("search"))},refreshSelection:function(){var g=this.get("selection"),h=this.frame.content.mode();this.frame.toolbar.view().refresh();this.trigger("refresh:selection",this,g);if(!g.length&&"browse"!==h&&"upload"!==h){this.content()}},selectUpload:function(g){this.get("selection").add(g)},buildComposite:function(){var h=this.get("_library"),g=this.get("exclude"),i;this.destroyComposite();if(!this.get("exclude")){return}if(!h){this.set("_library",h=this.get("library"))}i=new f.model.Attachments(null,{props:_.pick(h.props.toJSON(),"order","orderby")});i.validator=function(j){return !!h.getByCid(j.cid)&&!g.getByCid(j.cid)};i.mirror(h).observe(g);this.set("library",i)},destroyComposite:function(){var h=this.get("library"),g=thi
s.get("_library");if(!g){return}h.unobserve();this.set("library",g);this.unset("_library")},_excludeState:function(){var h=this.get("excludeState"),g=this.previous("excludeState");if(g){this.frame.get(g).off("change:library",this._excludeStateLibrary,this)}if(h){this.frame.get(h).on("change:library",this._excludeStateLibrary,this)}},_excludeStateLibrary:function(){var g=this.get("excludeState");if(!g){return}this.set("exclude",this.frame.get(g).get("library"))}});f.controller.Upload=f.controller.State.extend({defaults:_.defaults({id:"upload",content:"upload",sidebar:"empty",toolbar:"empty",libraryState:"library"},f.controller.State.prototype.defaults),initialize:function(){f.controller.State.prototype.initialize.apply(this,arguments)},activate:function(){wp.Uploader.queue.on("add",this.uploading,this);f.controller.Sta
te.prototype.activate.apply(this,arguments)},deactivate:function(){wp.Uploader.queue.off(null,null,this);f.controller.State.prototype.deactivate.apply(this,arguments)},uploading:function(h){var g=this.get("libraryState");this.frame.get(g).get("selection").add(h);this.frame.state(g)}});f.controller.Gallery=f.controller.Library.extend({defaults:{id:"gallery-edit",multiple:false,describe:true,edge:199,editing:false,sortable:true,searchable:false,toolbar:"gallery-edit",sidebar:"settings"},initialize:function(){if(!this.get("library")){this.set("library",new f.model.Selection())}if(!this.get("AttachmentView")){this.set("AttachmentView",f.view.Attachment.EditLibrary)}f.controller.Library.prototype.initialize.apply(this,arguments)},activate:function(){var g=this.get("library");g.props.set("type","image");this.get("library").observe(wp.Uploader.queue);f.c
ontroller.Library.prototype.activate.apply(this,arguments)},deactivate:function(){this.get("library").unobserve(wp.Uploader.queue);f.controller.Library.prototype.deactivate.apply(this,arguments)},sidebar:function(){f.controller.Library.prototype.sidebar.apply(this,arguments);this.frame.sidebar.trigger("gallery-settings");return this}});f.controller.Embed=f.controller.State.extend({defaults:{id:"embed",url:"",menu:"main",content:"embed",toolbar:"main-embed",type:"link"},sensitivity:200,initialize:function(){this.debouncedScan=_.debounce(_.bind(this.scan,this),this.sensitivity);this.on("change:url",this.debouncedScan,this);this.on("scan",this.scanImage,this);f.controller.State.prototype.initialize.apply(this,arguments)},scan:function(){var g={type:"link"};this.trigger("scan",g);this.set(g)},scanImage:function(g){var k=this.frame,i=this,h=this.get("url&qu
ot;),j=new Image();j.onload=function(){if(i!==k.state()||h!==i.get("url")){return}i.set({type:"image",width:j.width,height:j.height})};j.src=h},reset:function(){_.each(_.difference(_.keys(this.attributes),_.keys(this.defaults)),function(g){this.unset(g)},this);this.set("url","");this.frame.toolbar.view().refresh()}});f.Views=function(h,g){this.view=h;this._views=_.isArray(g)?{"":g}:g||{}};f.Views.extend=Backbone.Model.extend;_.extend(f.Views.prototype,{all:function(){return _.flatten(this._views)},get:function(g){g=g||"";return this._views[g]},first:function(g){var h=this.get(g);return h&&h.length?h[0]:null},set:function(g,h,i){var k,j;if(!_.isString(g)){i=h;h=g;g=""}i=i||{};h=_.isArray(h)?h:[h];k=this.get(g);j=h;if(k){if(i.add){if(_.isUndefined(i.at)){j=k.concat(h)}else{j=k;j.splice.apply(j,[i.at,0].concat(h))}}else{_.each(j,function(l){l.__detach=true});_.each(k,function(l){if(l.__detach){l.$el.d
etach()}else{l.dispose()}});_.each(j,function(l){delete l.__detach})}}this._views[g]=j;_.each(h,function(n){var l=n.Views||f.Views,m=n.views=n.views||new l(n);m.parent=this.view;m.selector=g},this);if(!i.silent){this._attach(g,h,_.extend({ready:this._isReady()},i))}return this},add:function(g,h,i){if(!_.isString(g)){i=h;h=g;g=""}return this.set(g,h,_.extend({add:true},i))},unset:function(g,h,i){var j;if(!_.isString(g)){i=h;h=g;g=""}if(j=this.get(g)){h=_.isArray(h)?h:[h];this._views[g]=h.length?_.difference(j,h):[]}if(!i||!i.silent){_.invoke(h,"dispose",{silent:true})}return this},detach:function(){e(_.pluck(this.all(),"el")).detach();return this},render:function(){var g={ready:this._isReady()};_.each(this._views,function(i,h){this._attach(h,i,g)},this);this.rendered=true;return this},dispose:function(g){if(!g||!g.silent){if(this.parent&&this.parent.views){this.parent.views.unset(this.selector,this.view,{silent:true})}delete thi
s.parent;delete this.selector}_.invoke(this.all(),"dispose");this._views=[];return this},replace:function(g,h){g.html(h);return this},insert:function(h,k,j){var g=j&&j.at,i;if(_.isNumber(g)&&(i=h.children()).length>g){i.eq(g).before(k)}else{h.append(k)}return this},ready:function(){this.view.trigger("ready");_.chain(this.all()).map(function(g){return g.views}).flatten().where({attached:true}).invoke("ready")},_attach:function(g,h,i){var k=g?this.view.$(g):this.view.$el,j;if(!k.length){return this}j=_.chain(h).pluck("views").flatten().value();_.each(j,function(l){if(l.rendered){return}l.view.render();l.rendered=true},this);this[i.add?"insert":"replace"](k,_.pluck(h,"el"),i);_.each(j,function(l){l.attached=true;if(i.ready){l.ready()}},this);return this},_isReady:function(){var g=this.view.el;while(g){if(g===document.body){return true}g=g.parentNode}return false}});f.View=Backbone.View.exte
nd({Views:f.Views,constructor:function(){this.views=new this.Views(this,this.views);this.on("ready",this.ready,this);Backbone.View.apply(this,arguments)},dispose:function(){this.undelegateEvents();if(this.model&&this.model.off){this.model.off(null,null,this)}if(this.collection&&this.collection.off){this.collection.off(null,null,this)}if(this.controller&&this.controller.off){this.controller.off(null,null,this)}if(this.views){this.views.dispose()}return this},remove:function(){this.dispose();return Backbone.View.prototype.remove.apply(this,arguments)},render:function(){var g;this.views.detach();if(this.template){g=this.prepare?this.prepare():{};this.trigger("prepare",g);this.$el.html(this.template(g))}this.views.render();return this},prepare:function(){return this.options},ready:function(){}});f.view.Frame=f.View.extend({initialize:function(){this._createRegions();this._createStates()},_createRegions:function(){this.regions=this.regi
ons?this.regions.slice():[];_.each(this.regions,function(g){this[g]=new f.controller.Region({controller:this,id:g,selector:".media-frame-"+g})},this)},_createStates:function(){this.states=new Backbone.Collection(null,{model:f.controller.State});this.states.on("add",function(g){g.frame=this},this)},reset:function(){this.states.invoke("trigger","reset");return this}});_.extend(f.view.Frame.prototype,f.controller.StateMachine.prototype);f.view.MediaFrame=f.view.Frame.extend({className:"media-frame",template:f.template("media-frame"),regions:["menu","content","sidebar","toolbar"],initialize:function(){f.view.Frame.prototype.initialize.apply(this,arguments);_.defaults(this.options,{title:"",modal:true,uploader:true});if(this.options.modal){this.modal=new f.view.Modal({controller:this,$content:this.$el,title:this.options.title})}if(this.options.uploader){this.uploader=new
f.view.UploaderWindow({controller:this,uploader:{dropzone:this.modal?this.modal.$el:this.$el,container:this.$el}});this.views.set(".media-frame-uploader",this.uploader)}this.on("attach",_.bind(this.views.ready,this.views),this)},render:function(){if(this.modal){this.modal.render()}f.view.Frame.prototype.render.apply(this,arguments);return this},createIframeStates:function(g){var j=f.view.settings,i=j.tabs,k=j.tabUrl,h;if(!i||!k){return}h=e("#post_ID");if(h.length){k+="&post_id="+h.val()}_.each(i,function(m,n){var l=this.get("iframe:"+n).set(_.defaults({tab:n,src:k+"&tab="+n,title:m,content:"iframe",menu:"main"},g))},this);this.content.on("activate:iframe",this.iframeContent,this);this.menu.on("activate:main",this.iframeMenu,this);this.on("open",this.hijackThickbox,this);this.on("close",this.restoreThickbox,this)},iframeContent:function(){this.$el.ad
dClass("hide-toolbar hide-sidebar");this.content.view(new f.view.Iframe({controller:this}).render())},iframeMenu:function(){var g={};_.each(f.view.settings.tabs,function(h,i){g["iframe:"+i]={text:this.get("iframe:"+i).get("title"),priority:200}},this);this.menu.view().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.state(g.options.state);g._tb_remove.call(window)}},restoreThickbox:function(){if(!this._tb_remove){return}window.tb_remove=this._tb_remove;delete this._tb_remove}});_.each(["open","close","attach","detach"],function(g){f.view.MediaFrame.prototype[g]=function(h){if(this.modal){this.modal[g].apply(this.modal,arguments)}this.trigger(g);return this}});f.view.MediaFrame.Select=f.view.MediaFrame.extend({initialize:function(){f.view.MediaFrame.prototype.initialize.appl
y(this,arguments);_.defaults(this.options,{state:"upload",selection:[],library:{},multiple:false});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:this.options.multiple,menu:"main",toolbar:"select"}),new f.controller.Upload({menu:"main"})])},bindHandlers:function(){this.menu.on("activate:main",this.mainMenu,this);this.content.on("activate:browse",this.browseContent,this);this.content.on("activate:upload",this.uploadContent,this);this.sidebar.on("activate:clear",this.clearSidebar,this);this.sidebar.on("activate:settings",this.settingsSidebar,this);th
is.toolbar.on("activate:select",this.selectToolbar,this);this.on("refresh:selection",this.refreshSelectToolbar,this)},mainMenu:function(g){this.menu.view(new f.view.Menu({controller:this,silent:g&&g.silent,views:{upload:{text:b.uploadFilesTitle,priority:20},library:{text:b.mediaLibraryTitle,priority:40}}}))},browseContent:function(){var g=this.state();this.content.view(new f.view.AttachmentsBrowser({controller:this,collection:g.get("library"),selection:g.get("selection"),model:g,sortable:g.get("sortable"),search:g.get("searchable"),upload:g.get("upload"),filters:g.get("filterable"),AttachmentView:g.get("AttachmentView")}))},uploadContent:function(){this.$el.addClass("hide-sidebar hide-toolbar");this.content.view(new f.view.UploaderInline({controller:this}))},clearSidebar:function(){this.sidebar.view(new f.view.Sidebar({controller:this}))},settingsSidebar:function(h){va
r i=this.state().get("selection").single(),g={};g.details=new f.view.Attachment.Details({controller:this,model:i,priority:80}).render();if(i.get("compat")){g.compat=new f.view.AttachmentCompat({controller:this,model:i,priority:120}).render()}this.sidebar.view(new f.view.Sidebar({controller:this,silent:h&&h.silent,views:g}))},selectToolbar:function(g){g=_.defaults(g||{},{event:"select",silent:false,state:false});this.toolbar.view(new f.view.Toolbar({controller:this,silent:g.silent,items:{select:{style:"primary",text:b.select,priority:80,click:function(){var h=this.controller;h.close();h.state().trigger(g.event);h.reset();if(g.state){h.state(g.state)}}}}}))},refreshSelectToolbar:function(){var g=this.state().get("selection");if(!g||"select"!==this.toolbar.mode()){return}this.toolbar.view().get("select").model.set("disabled",!g.length)}});f.view.MediaFrame.Post=f.view.MediaFrame.Select.exten
d({initialize:function(){_.defaults(this.options,{state:"upload",multiple:true,editing:false});f.view.MediaFrame.Select.prototype.initialize.apply(this,arguments);this.createIframeStates()},createStates:function(){var g=this.options;this.states.add([new f.controller.Library({selection:g.selection,library:f.query(g.library),editable:true,filterable:"all",multiple:this.options.multiple,menu:"main",sidebar:"attachment-settings",displayUserSettings:true}),new f.controller.Upload({menu:"main"}),new f.controller.Embed(),new f.controller.Gallery({library:g.selection,editing:g.editing,menu:"gallery"}),new f.controller.Library({id:"gallery-library",library:f.query({type:"image"}),filterable:"uploaded",multiple:true,menu:"gallery",toolbar:"gallery-add",excludeState:"gallery-edit"}),new f.controller.Upload({id:"gallery-upload",menu:"gallery",librar
yState:"gallery-edit"})])},bindHandlers:function(){f.view.MediaFrame.Select.prototype.bindHandlers.apply(this,arguments);var g={menu:{gallery:"galleryMenu"},content:{embed:"embedContent","edit-selection":"editSelectionContent"},sidebar:{"attachment-settings":"attachmentSettingsSidebar"},toolbar:{"main-attachments":"mainAttachmentsToolbar","main-embed":"mainEmbedToolbar","gallery-edit":"galleryEditToolbar","gallery-add":"galleryAddToolbar"}};_.each(g,function(i,h){_.each(i,function(k,j){this[h].on("activate:"+j,this[k],this)},this)},this);this.sidebar.on("gallery-settings",this.onSidebarGallerySettings,this)},mainMenu:function(){f.view.MediaFrame.Select.prototype.mainMenu.call(this,{silent:true});this.menu.view().set({separateLibrary:new f.View({className:"separator",priority:60}),embed:{text:b.embe
dFromUrlTitle,priority:80}})},galleryMenu:function(){var g=this.previous(),h=this;this.menu.view(new f.view.Menu({controller:this,views:{cancel:{text:b.cancelGalleryTitle,priority:20,click:function(){if(g){h.state(g)}else{h.close()}}},separateCancel:new f.View({className:"separator",priority:40}),"gallery-edit":{text:b.editGalleryTitle,priority:60},"gallery-upload":{text:b.uploadImagesTitle,priority:80},"gallery-library":{text:b.mediaLibraryTitle,priority:100}}}))},embedContent:function(){var g=new f.view.Embed({controller:this,model:this.state()}).render();this.$el.addClass("hide-sidebar");this.content.view(g);g.url.focus()},editSelectionContent:function(){var i=this.state(),h=i.get("selection"),g;g=new f.view.AttachmentsBrowser({controller:this,collection:h,selection:h,model:i,sortable:true,search:false,AttachmentView:f.view.Attachment.EditSelection}).render();g.toolbar.set("backToLibrary",{text:b.return
ToLibrary,priority:-100,click:function(){this.controller.content.mode("browse")}});this.content.view(g)},onSidebarGallerySettings:function(h){var g=this.state().get("library");if(!g){return}g.gallery=g.gallery||new Backbone.Model();this.sidebar.view().set({gallery:new f.view.Settings.Gallery({controller:this,model:g.gallery,priority:40}).render()},h)},attachmentSettingsSidebar:function(g){var h=this.state(),i=h.get("details"),j=h.get("selection").single();this.settingsSidebar({silent:true});i[j.cid]=i[j.cid]||new Backbone.Model({align:getUserSetting("align","none"),size:getUserSetting("imgsize","medium"),link:getUserSetting("urlbutton","post")});this.sidebar.view().set({display:new f.view.Settings.AttachmentDisplay({controller:this,model:i[j.cid],attachment:j,priority:160,userSettings:h.get("displayUserSettings")}).render()},g)},mainAttachmentsToolbar:function(){this
.toolbar.view(new f.view.Toolbar.Insert({controller:this,editable:this.state().get("editable")}))},mainEmbedToolbar:function(){this.toolbar.view(new f.view.Toolbar.Embed({controller:this}));this.$el.removeClass("hide-toolbar")},galleryEditToolbar:function(){var g=this.state().get("editing");this.toolbar.view(new f.view.Toolbar({controller:this,items:{insert:{style:"primary",text:g?b.updateGallery:b.insertGallery,priority:80,click:function(){var h=this.controller,i=h.state();h.close();i.trigger("update",i.get("library"));h.reset();h.state("upload")}}}}))},galleryAddToolbar:function(){this.toolbar.view(new f.view.Toolbar({controller:this,items:{insert:{style:"primary",text:b.addToGallery,priority:80,click:function(){var g=this.controller,i=g.state(),h=g.get("gallery-edit");h.get("library").add(i.get("selection").models);i.trigger("reset");g.state("galler
y-edit")}}}}))}});f.view.Modal=f.View.extend({tagName:"div",template:f.template("media-modal"),events:{"click .media-modal-backdrop, .media-modal-close":"closeHandler"},initialize:function(){this.controller=this.options.controller;_.defaults(this.options,{container:document.body,title:""})},render:function(){this.options.$content=this.options.$content||e("<div />");this.options.$content.detach();this.$el.html(this.template({title:this.options.title}));this.options.$content.addClass("media-modal-content");this.$(".media-modal").append(this.options.$content);return this},attach:function(){this.$el.appendTo(this.options.container);this.trigger("attach");return this},detach:function(){this.$el.detach();this.trigger("detach");return this},open:function(){this.$el.show();this.trigger("open");return this},close:function(){this.$el.hide();this.trigger("close&
quot;);return this},closeHandler:function(g){g.preventDefault();this.close()},content:function(g){if(this.options.$content){this.options.$content.detach()}this.options.$content=(g instanceof Backbone.View)?g.$el:g;return this.render()}});f.view.UploaderWindow=f.View.extend({tagName:"div",className:"uploader-window",template:f.template("uploader-window"),initialize:function(){var g;this.controller=this.options.controller;this.$browser=e('<a href="#" class="browser" />').hide().appendTo("body");g=this.options.uploader=_.defaults(this.options.uploader||{},{dropzone:this.$el,browser:this.$browser,params:{}});if(g.dropzone&&!(g.dropzone instanceof e)){g.dropzone=e(g.dropzone)}this.controller.on("activate",this.refresh,this)},refresh:function(){if(this.uploader){this.uploader.refresh()}},ready:function(){var h=f.view.settings.postId,g;if(this.uploader){return}if(h){this.options.uploader.params.post
_id=h}this.uploader=new wp.Uploader(this.options.uploader);g=this.uploader.dropzone;g.on("dropzone:enter",_.bind(this.show,this));g.on("dropzone:leave",_.bind(this.hide,this))},show:function(){var g=this.$el.show();_.defer(function(){g.css({opacity:1})})},hide:function(){var g=this.$el.css({opacity:0});f.transition(g).done(function(){if("0"===g.css("opacity")){g.hide()}})}});f.view.UploaderInline=f.View.extend({tagName:"div",className:"uploader-inline",template:f.template("uploader-inline"),initialize:function(){this.controller=this.options.controller;if(!this.options.$browser){this.options.$browser=this.controller.uploader.$browser}wp.Uploader.queue.on("add remove reset change:percent",this.renderUploadProgress,this)},dispose:function(){wp.Uploader.queue.off(null,null,this);f.View.prototype.dispose.apply(this,arguments);return this},render:function(){var g=this.options.$browser,h;this.renderUplo
adProgress();this.$el.html(this.template(this.options));h=this.$(".browser");g.detach().text(h.text());g[0].className=h[0].className;h.replaceWith(g.show());this.$bar=this.$(".media-progress-bar div");this.views.render();return this},renderUploadProgress:function(){var g=wp.Uploader.queue;this.$el.toggleClass("uploading",!!g.length);if(!this.$bar||!g.length){return}this.$bar.width((g.reduce(function(h,i){if(i.get("uploading")){return h+(i.get("percent")||0)}else{return h+100}},0)/g.length)+"%")}});f.view.Toolbar=f.View.extend({tagName:"div",className:"media-toolbar",initialize:function(){this.controller=this.options.controller;this._views={};this.$primary=e('<div class="media-toolbar-primary" />').prependTo(this.$el);this.$secondary=e('<div class="media-toolbar-secondary" />').prependTo(this.$el);if(this.options.items){this.set(this.options.items,{silent:true})}if(
!this.options.silent){this.render()}},destroy:function(){this.remove();if(this.model){this.model.off(null,null,this)}if(this.collection){this.collection.off(null,null,this)}this.controller.off(null,null,this);_.each(this._views,function(g){if(g.destroy){g.destroy()}})},render:function(){var g=_.chain(this._views).sortBy(function(h){return h.options.priority||10}).groupBy(function(h){return(h.options.priority||10)>0?"primary":"secondary"}).value();e(_.pluck(this._views,"el")).detach();this.$primary.html(_.pluck(g.primary||[],"el"));this.$secondary.html(_.pluck(g.secondary||[],"el"));this.refresh();return this},set:function(i,g,h){h=h||{};if(_.isObject(i)){_.each(i,function(j,k){this.set(k,j,{silent:true})},this)}else{if(!(g instanceof Backbone.View)){g.classes=["media-button-"+i].concat(g.classes||[]);g=new f.view.Button(g).render()}g.controller=g.controller||this.controller;this._views[i]=g}if(!h.silent){this.ren
der()}return this},get:function(g){return this._views[g]},unset:function(h,g){delete this._views[h];if(!g||!g.silent){this.render()}return this},refresh:function(){}});f.view.Toolbar.Select=f.view.Toolbar.extend({initialize:function(){var h=this.options,g=h.controller,i=g.state().get("selection");_.bindAll(this,"clickSelect");_.defaults(h,{event:"select",state:false,reset:true,close:true,text:b.select});h.items=_.defaults(h.items||{},{select:{style:"primary",text:h.text,priority:80,click:this.clickSelect}});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.state(h.state)}}});f.view.Toolbar.Embed=f.view.Toolbar.Select.extend({initialize:function(){var g=this.options.controller;_.defaults(this.options,{text:b.insertEmbed});f.view.Toolbar.Select.prototype.initialize.apply(thi
s,arguments);g.on("change:url",this.refresh,this)},refresh:function(){var g=this.controller.state().get("url");this.get("select").model.set("disabled",!g||/^https?:\/\/$/.test(g))}});f.view.Toolbar.Insert=f.view.Toolbar.extend({initialize:function(){var g=this.options.controller,i=g.state().get("selection"),h;h=function(k,j){return function(){var l=this.controller,m=l.state().get("selection"),n=l.get(k),o=j?j(m):m.models;n.set("library",new f.model.Selection(o,{props:m.props.toJSON(),multiple:true}));this.controller.state(k)}};this.options.items=_.defaults(this.options.items||{},{selection:new f.view.Selection({controller:g,collection:i,priority:-40,editable:this.options.editable&&function(){this.controller.content.mode("edit-selection")}}).render(),insert:{style:"primary",priority:80,text:b.insertIntoPost,click:function(){g.close();g.state().trigger("insert",i).reset(
)}},gallery:{text:b.createNewGallery,priority:40,click:h("gallery-edit",function(j){return j.where({type:"image"})})}});f.view.Toolbar.prototype.initialize.apply(this,arguments)},refresh:function(){var g=this.controller.state().get("selection"),h=g.length;this.get("insert").model.set("disabled",!g.length);this.get("gallery").$el.toggle(h>1&&g.any(function(i){return"image"===i.get("type")}))}});f.view.Button=f.View.extend({tagName:"a",className:"media-button",attributes:{href:"#"},events:{click:"click"},defaults:{text:"",style:"",size:"large",disabled:false},initialize:function(){this.model=new Backbone.Model(this.defaults);_.each(this.defaults,function(i,g){var h=this.options[g];if(_.isUndefined(h)){return}this.model.set(g,h);delete this.options[g]},this);this.model.on("change",this.render,this)},render:fun
ction(){var h=["button",this.className],g=this.model.toJSON();if(g.style){h.push("button-"+g.style)}if(g.size){h.push("button-"+g.size)}h=_.uniq(h.concat(this.options.classes));this.el.className=h.join(" ");this.$el.attr("disabled",g.disabled);this.$el.text(this.model.get("text"));return this},click:function(g){if("#"===this.attributes.href){g.preventDefault()}if(this.options.click&&!this.model.get("disabled")){this.options.click.apply(this,arguments)}}});f.view.ButtonGroup=f.View.extend({tagName:"div",className:"button-group button-large media-button-group",initialize:function(){this.buttons=_.map(this.options.buttons||[],function(g){if(g instanceof Backbone.View){return g}else{return new f.view.Button(g).render()}});delete this.options.buttons;if(this.options.classes){this.$el.addClass(this.options.classes)}},render:function(){this.$el.html(e(_.pluck(this.buttons,&qu
ot;el")).detach());return this}});f.view.PriorityList=f.View.extend({tagName:"div",initialize:function(){this.controller=this.options.controller;this._views={};this.set(_.extend({},this._views,this.options.views),{silent:true});delete this.options.views;if(!this.options.silent){this.render()}},destroy:this.dispose,set:function(l,h,j){var k,g,i;j=j||{};if(_.isObject(l)){_.each(l,function(m,n){this.set(n,m)},this);return this}if(!(h instanceof Backbone.View)){h=this.toView(h,l,j)}h.controller=h.controller||this.controller;this.unset(l);k=h.options.priority||10;g=this.views.get()||[];_.find(g,function(n,m){if(n.options.priority>k){i=m;return true}});this._views[l]=h;this.views.add(h,{at:_.isNumber(i)?i:g.length||0});return this},get:function(g){return this._views[g]},unset:function(h){var g=this.get(h);if(g){g.dispose()}delete this._views[h];return this},toView:function(g){return new f.View(g)}});f.view.Menu=f.view.PriorityList.extend({tagName:"ul",c
lassName:"media-menu",toView:function(g,h){g=g||{};g.id=g.id||h;return new f.view.MenuItem(g).render()},select:function(h){var g=this.get(h);if(!g){return}this.deselect();g.$el.addClass("active")},deselect:function(){this.$el.children().removeClass("active")}});f.view.MenuItem=f.View.extend({tagName:"li",className:"media-menu-item",events:{click:"click"},click:function(){var g=this.options;if(g.click){g.click.call(this)}else{if(g.id){this.controller.state(g.id)}}},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.Sidebar=f.view.PriorityList.extend({className:"media-sidebar"});f.view.Attachment=f.View.extend({tagName:"li",className:"attachment",template:f.template("attachment"),events:{"click .attachment-preview":"toggleSelection","change [data-setting]":"updateSe
tting","change [data-setting] input":"updateSetting","change [data-setting] select":"updateSetting","change [data-setting] textarea":"updateSetting","click .close":"removeFromLibrary","click .check":"removeFromSelection","click a":"preventDefault"},buttons:{},initialize:function(){this.controller=this.options.controller;this.model.on("change:sizes change:uploading change:caption change:title",this.render,this);this.model.on("change:percent",this.progress,this);this.model.on("add",this.select,this);this.model.on("remove",this.deselect,this);this.model.on("selection:single selection:unsingle",this.details,this);this.details(this.model,this.controller.state().get("selection"))},destroy:function(){this.model.off(null,null,this);this.remove()},render:function(){var h=this.model.toJSON(),g=_.default
s(this.model.toJSON(),{orientation:"landscape",uploading:false,type:"",subtype:"",icon:"",filename:"",caption:"",title:"",dateFormatted:"",width:"",height:"",compat:false,alt:""});g.buttons=this.buttons;g.describe=this.controller.state().get("describe");if("image"===g.type){g.size=this.imageSize()}this.$el.html(this.template(g));this.$el.toggleClass("uploading",g.uploading);if(g.uploading){this.$bar=this.$(".media-progress-bar div")}else{delete this.$bar}if(this.selected()){this.select()}return this},progress:function(){if(this.$bar&&this.$bar.length){this.$bar.width(this.model.get("percent")+"%")}},toggleSelection:function(i){var h=this.options.selection,g=this.model;if(!h){return}if(h.has(g)){h[h.single()===g?"remove":"single"](g)}else{h.add(g).single(g)}},selected:function(){va
r g=this.options.selection;if(g){return g.has(this.model)}},select:function(g,i){var h=this.options.selection;if(!h||(i&&i!==h)){return}this.$el.addClass("selected")},deselect:function(g,i){var h=this.options.selection;if(!h||(i&&i!==h)){return}this.$el.removeClass("selected")},details:function(g,j){var i=this.options.selection,h;if(i!==j){return}h=i.single();this.$el.toggleClass("details",h===this.model)},preventDefault:function(g){g.preventDefault()},imageSize:function(g){var h=this.model.get("sizes");g=g||"medium";if(h&&h[g]){return _.clone(h[g])}else{return{url:this.model.get("url"),width:this.model.get("width"),height:this.model.get("height"),orientation:this.model.get("orientation")}}},updateSetting:function(h){var g=e(h.target).closest("[data-setting]");if(!g.length){return}this.model.save(g.data("setting"),h.target.value)},removeFromLi
brary: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:"ul",className:"attachments",template:f.template("attachments-css"),events:{scroll:"scroll"},initialize:function(){this.controller=this.options.controller;this.el.id=_.uniqueId("__attachments-view-");_.defaults(this.options,{refreshSensitivity:200,refreshThreshold:3,AttachmentView:f.view.Attachment,sortable:false});_.each(["add","remove"],function(g){this.collection.on(g,function(j,h,i){this[g](j,i.index)},this)},this);this.collection.on("reset",this.render,this);this.scroll=_.chain(this.scroll).bind(this).throttle
(this.options.refreshSensitivity).value();this.initSortable();this.collection.props.on("change:orderby",this.refreshSortable,this);_.bindAll(this,"css");this.model.on("change:edge change:gutter",this.css,this);this._resizeCss=_.debounce(_.bind(this.css,this),this.refreshSensitivity);e(window).on("resize.attachments",this._resizeCss);this.css()},dispose:function(){this.collection.props.off(null,null,this);e(window).off("resize.attachments",this._resizeCss);f.View.prototype.dispose.apply(this,arguments)},css:function(){var g=e("#"+this.el.id+"-css");if(g.length){g.remove()}f.view.Attachments.$head().append(this.template({id:this.el.id,edge:this.edge(),gutter:this.model.get("gutter")}))},edge:function(){var i=this.model.get("edge"),j,h,g;if(!this.$el.is(":visible")){return i}j=this.model.get("gutter")*2;h=this.$el.width()-j;g=Math.ceil(h/(i+j));i=Math.floor((h-(g*j))/g)
;return i},initSortable:function(){var g=this.collection,h;if(!this.options.sortable||!e.fn.sortable){return}this.$el.sortable({disabled:!!g.comparator,containment:this.$el,tolerance:"pointer",start:function(i,j){h=j.item.index()},update:function(j,k){var i=g.at(h);g.remove(i,{silent:true}).add(i,{at:k.item.index(),silent:true})}});g.props.on("change:orderby",function(){this.$el.sortable("option","disabled",!!g.comparator)},this)},refreshSortable:function(){if(!this.options.sortable||!e.fn.sortable){return}this.$el.sortable("option","disabled",!!this.collection.comparator)},render:function(){if(!this.collection.length){this.collection.more().done(this.scroll);this.$el.empty();return this}this.$el.html(this.collection.map(function(g){return new this.options.AttachmentView({controller:this.controller,model:g,collection:this.collection,selection:this.options.selection}).render().$el},this));return this},ready:function(
){this.scroll()},add:function(j,h){var g,i;g=new this.options.AttachmentView({controller:this.controller,model:j,collection:this.collection,selection:this.options.selection}).render();i=this.$el.children();if(i.length>h){i.eq(h).before(g.$el)}else{this.$el.append(g.$el)}},remove:function(i,g){var h=this.$el.children();if(h.length){h.eq(g).detach()}},scroll:function(g){if(!this.$el.is(":visible")){return}if(this.el.scrollHeight<this.el.scrollTop+(this.el.clientHeight*this.options.refreshThreshold)){this.collection.more().done(this.scroll)}}},{$head:(function(){var g;return function(){return g=g||e("head")}}())});f.view.Search=f.View.extend({tagName:"input",className:"search",attributes:{type:"search",placeholder:b.search},events:{keyup:"search",change:"search",search:"search"},render:function(){this.el.value=this.model.escape("search");return this},search:function(g){if(g.target.va
lue){this.model.set("search",g.target.value)}else{this.model.unset("search")}}});f.view.AttachmentFilters=f.View.extend({tagName:"select",className:"attachment-filters",events:{change:"change"},filters:{},keys:[],initialize:function(){this.$el.html(_.chain(this.filters).map(function(g,h){return{el:this.make("option",{value:h},g.text),priority:g.priority||50}},this).sortBy("priority").pluck("el").value());this.model.on("change",this.select,this);this.select()},change:function(h){var g=this.filters[this.el.value];if(g){this.model.set(g.props)}},select:function(){var g=this.model,i="all",h=g.toJSON();_.find(this.filters,function(k,l){var j=_.all(k.props,function(n,m){return n===(_.isUndefined(h[m])?null:h[m])});if(j){return i=l}});this.$el.val(i)}});f.view.AttachmentFilters.Uploaded=f.view.AttachmentFilters.extend({filters:{all:{text:b.allMediaItems,props:{parent:null},priority:1
0},uploaded:{text:b.uploadedToThisPost,props:{parent:f.view.settings.postId},priority:20}}});f.view.AttachmentFilters.All=f.view.AttachmentFilters.extend({filters:(function(){var g={};_.each(f.view.settings.mimeTypes||{},function(i,h){g[h]={text:i,props:{type:h,parent:null}}});g.all={text:b.allMediaItems,props:{type:null,parent:null},priority:10};g.uploaded={text:b.uploadedToThisPost,props:{type:null,parent:f.view.settings.postId},priority:20};return g}())});f.view.AttachmentsBrowser=f.View.extend({tagName:"div",className:"attachments-browser",initialize:function(){var h,g;this.controller=this.options.controller;_.defaults(this.options,{filters:false,search:true,upload:false,AttachmentView:f.view.Attachment.Library});this.toolbar=new f.view.Toolbar({controller:this.controller});this.views.add(this.toolbar);h=this.options.filters;if("uploaded"===h){g=f.view.AttachmentFilters.Uploaded}else{if("all"===h){g=f.view.AttachmentFilters.All}}if
(g){this.toolbar.set("filters",new g({controller:this.controller,model:this.collection.props,priority:-80}).render())}if(this.options.search){this.toolbar.set("search",new f.view.Search({controller:this.controller,model:this.collection.props,priority:60}).render())}if(this.options.sortable){this.toolbar.set("dragInfo",new f.View({el:e('<div class="instructions">'+b.dragInfo+"</div>")[0],priority:-40}))}if(this.options.upload&&this.controller.uploader){this.toolbar.set("upload",new f.view.Button(_.extend({el:this.controller.uploader.$browser.detach()[0],priority:-60,size:"large",text:b.selectFiles},this.options.upload)).render())}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)}});f.vie
w.SelectionPreview=f.View.extend({tagName:"div",className:"selection-preview",template:f.template("media-selection-preview"),events:{"click .clear-selection":"clear"},initialize:function(){_.defaults(this.options,{clearable:true});this.controller=this.options.controller;this.collection.on("add change:url remove",this.render,this);this.render()},render:function(){var g=_.clone(this.options),j,i,h;if(!this.collection.length){this.$el.empty();return this}g.count=this.collection.length;j=this.collection.last();i=j.get("sizes");if("image"===j.get("type")){g.thumbnail=(i&&i.thumbnail)?i.thumbnail.url:j.get("url")}else{g.thumbnail=j.get("icon")}this.$el.html(this.template(g));return this},clear:function(g){g.preventDefault();this.collection.clear()}});f.view.Selection=f.View.extend({tagName:"div",className:"media-selection",template:f.template(&q
uot;media-selection"),events:{"click .edit-selection":"edit","click .clear-selection":"clear"},initialize:function(){_.defaults(this.options,{editable:false,clearable:true});this.controller=this.options.controller;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.collection.on("add remove reset",this.refresh,this)},destroy:function(){this.remove();this.collection.off("add remove reset",this.refresh,this);this.attachments.destroy()},render:function(){this.attachments.$el.detach();this.attachments.render();this.$el.html(this.template(this.options));this.$(".selection-view").replaceWith(this.attachments.$el);this.refresh();return this},refresh:function(){if(!this.$el.children().length){return}this.$el.toggleClass("empty&qu
ot;,!this.collection.length);this.$(".count").text(this.collection.length+" "+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.clear()}});f.view.Attachment.Selection=f.view.Attachment.extend({className:"attachment selection",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:{"click button":"updateHandler","change input":"updateHandler","change select":"updateHandler","change textarea":"updateHandler"},initialize:function(){this.model=this.model||new Backbone.Model();this.model.on("change",this.updateChanges,this)},destroy:function(){this.model.off(null,null,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(i){var j=this.model.get(i),h=this.$('[data-setting="'+i+'"]'),g;if(!h.length){return}if(h.is("select")){h.find('[value="'+j+'"]').attr("selected",true)}else{if(h.hasClass("button-group")){g=h.find("button").removeClass("active");g.filter('[value="'+j+'"]').addClass("active")}else{if(h.is('input[type="text"], textarea')){if(!h.is(":focus")){h.val(j)}}}}},updateHandler:function(i){var h=e(i.target).closest("[data-setting]"),j=i.target.value,g;i.preventDefault();if(!h.length){return}this.model.set(h.data("setting"),j);if(g=h.data("userSetting")){setUserSetting(g,j)}},updateChanges:function(h,g){if(g.changes){_(g.changes).chain().keys().each(this.update,this)}}});f.vie
w.Settings.AttachmentDisplay=f.view.Settings.extend({className:"attachment-display-settings",template:f.template("attachment-display-settings"),initialize:function(){var g=this.options.attachment;_.defaults(this.options,{userSettings:false});f.view.Settings.prototype.initialize.apply(this,arguments);this.model.on("change:link",this.updateCustomLink,this);if(g){g.on("change:uploading",this.render,this)}},dispose:function(){var g=this.options.attachment;if(g){g.off(null,null,this)}f.view.Settings.prototype.dispose.apply(this,arguments)},render:function(){var g=this.options.attachment;if(g){_.extend(this.options,{sizes:g.get("sizes"),type:g.get("type")})}f.view.Settings.prototype.render.call(this);this.updateCustomLink();return this},updateCustomLink:function(){var g="custom"===this.model.get("link"),h=this.$(".link-to-custom");if(!g){h.hide();return}h.show();if(!this.model.get("linkU
rl")){h.val("http://")}if(h.is(":visible")){h.focus()[0].select()}}});f.view.Settings.Gallery=f.view.Settings.extend({className:"gallery-settings",template:f.template("gallery-settings")});f.view.Attachment.Details=f.view.Attachment.extend({tagName:"div",className:"attachment-details",template:f.template("attachment-details"),events:{"change [data-setting]":"updateSetting","change [data-setting] input":"updateSetting","change [data-setting] select":"updateSetting","change [data-setting] textarea":"updateSetting"}});f.view.AttachmentCompat=f.View.extend({tagName:"form",className:"compat-item",events:{submit:"preventDefault","change input":"save","change select":"save","change textarea":"save"},initialize:function(){this.model.on("
change:compat",this.render,this)},destroy:function(){this.model.off(null,null,this)},render:function(){var g=this.model.get("compat");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:"media-iframe",initialize:function(){this.controller=this.options.controller},render:function(){this.$el.html('<iframe src="'+this.controller.state().get("src")+'" />');return this}});f.view.Embed=f.View.extend({className:"media-embed",initialize:function(){this.controller=this.options.controller;this.url=new f.view.EmbedUrl({controller:this.controller,model:this.model}).render();this._settings=new f.View();this.refresh();this.model.on("change:type",this.refresh,this)},render:function(){this.$el.h
tml([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);if(this._settings.destroy){this._settings.destroy()}this._settings.remove();this._settings=g},refresh:function(){var h=this.model.get("type"),g;if("image"===h){g=f.view.EmbedImage}else{if("link"===h){g=f.view.EmbedLink}else{return}}this.settings(new g({controller:this.controller,model:this.model,priority:40}))}});f.view.EmbedUrl=f.View.extend({tagName:"label",className:"embed-url",events:{keyup:"url"},initialize:function(){this.label=this.make("span",null,this.options.label||b.url);this.input=this.make("input",{type:"text",value:this.model.get("url")||""});this.$label=e(this.label);this.$input=e(this.input);this.$el.append([this.label,this.input]);this.model.on("change:url",this.render,this)},destroy:fu
nction(){this.model.off(null,null,this)},render:function(){var g=this.$input;if(g.is(":focus")){return}this.input.value=this.model.get("url")||"http://";return this},url:function(g){this.model.set("url",g.target.value)},focus:function(){var g=this.$input;if(g.is(":visible")){g.focus()[0].select()}}});f.view.EmbedLink=f.view.Settings.extend({className:"embed-link-settings",template:f.template("embed-link-settings")});f.view.EmbedImage=f.view.Settings.AttachmentDisplay.extend({className:"embed-image-settings",template:f.template("embed-image-settings"),initialize:function(){f.view.Settings.AttachmentDisplay.prototype.initialize.apply(this,arguments);this.model.on("change:url",this.updateImage,this)},destroy:function(){this.model.off(null,null,this);f.view.Settings.AttachmentDisplay.prototype.destroy.apply(this,arguments)},updateImage:function(){this.$("img").attr("
;src",this.model.get("url"))}})}(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==="undefined"?{}:_wpMediaViewsL10n;f.view.settings=b.settings||{};delete b.settings;e.support.transition=(function(){var g=document.documentElement.style,h={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},i;i=_.find(_.keys(h),function(j){return !_.isUndefined(g[j])});return i&&{end:h[i]}}());f.transition=function(g){var h=e.Deferred();if(e.support.transition){if(!(g instanceof e)){g=e(g)}g.first().one(e.support.transition.end,h.resolve)}else{h.resolve()}return h.promise()};f.controller.Region=function(g){_.extend(this,_.pick(g||{},"id","controller","selector"));this.on("activate:empty",this.empty,this);this.mode("empty")};f.controller.Regio
n.extend=Backbone.Model.extend;_.extend(f.controller.Region.prototype,Backbone.Events,{trigger:(function(){var g=/\s+/,h=Backbone.Events.trigger;return function(i){var j=":"+this._mode,k=i.split(g).join(j)+j;h.apply(this,arguments);h.apply(this,[k].concat(_.rest(arguments)));return this}}()),mode:function(g){if(g){this.trigger("deactivate",this);this._mode=g;return this.trigger("activate",this)}return this._mode},view:function(g){var h=this._view,i=this._mode,j=this.id;if(!g){return h}if(g===h){return}if(j){g.$el.addClass("region-"+j)}if(i){g.$el.addClass("mode-"+i)}this.controller.views.set(this.selector,g);this._view=g},empty:function(){this.view(new f.View())}});f.controller.StateMachine=function(g){this.states=new Backbone.Collection(g)};f.controller.StateMachine.extend=Backbone.Model.extend;_.extend(f.controller.StateMachine.prototype,Backbone.Events,{get:function(g){this.states=this.states||new Backbone.Collection();if(
!this.states.get(g)){this.states.add({id:g})}return this.states.get(g)},state:function(h){var g;if(!h){return this._state?this.get(this._state):null}g=this.state();if((g&&h===g.id)||!this.states||!this.states.get(h)){return}if(g){g.trigger("deactivate");this._previous=g.id}this._state=h;this.state().trigger("activate")},previous:function(){return this._previous}});_.each(["on","off","trigger"],function(g){f.controller.StateMachine.prototype[g]=function(){this.states=this.states||new Backbone.Collection();this.states[g].apply(this.states,arguments);return this}});f.controller.State=Backbone.Model.extend({initialize:function(){this.on("activate",this._activate,this);this.on("activate",this.activate,this);this.on("deactivate",this._deactivate,this);this.on("deactivate",this.deactivate,this);this.on("reset",this.reset,this)},activate:function(){},_activate:function(){this.
active=true;this.menu();this.toolbar();this.content()},deactivate:function(){},_deactivate:function(){this.active=false},reset:function(){},menu:function(){var i=this.frame.menu,h=this.get("menu"),g;if(!h){return}if(i.mode()!==h){i.mode(h)}g=i.view();if(g.select){g.select(this.id)}}});_.each(["toolbar","content"],function(g){f.controller.State.prototype[g]=function(){var h=this.get(g);if(h){this.frame[g].mode(h)}}});f.controller.Library=f.controller.State.extend({defaults:{id:"library",multiple:false,describe:false,toolbar:"main-attachments",sidebar:"settings",searchable:true,filterable:false},initialize:function(){if(!this.get("selection")){this.set("selection",new f.model.Selection(null,{multiple:this.get("multiple")}))}if(!this.get("library")){this.set("library",f.query())}if(!this.get("edge")){this.set("edge",120)}if(!this.get("gutter&quo
t;)){this.set("gutter",8)}this.resetDisplays();f.controller.State.prototype.initialize.apply(this,arguments)},activate:function(){var g=this.get("library"),h=this.get("selection");this._excludeStateLibrary();this.buildComposite();this.on("change:library change:exclude",this.buildComposite,this);this.on("change:excludeState",this._excludeState,this);if(this.get("multiple")){wp.Uploader.queue.on("add",this.selectUpload,this)}h.on("add remove reset",this.refreshSelection,this);this._updateEmpty();g.on("add remove reset",this._updateEmpty,this);this.on("change:empty",this.refresh,this);this.refresh();this.on("insert",this._insertDisplaySettings,this)},deactivate:function(){this.off("change:empty",this.refresh,this);this.get("library").off("add remove reset",this._updateEmpty,this);this.get("selection").off(null,null,this);wp.Upload
er.queue.off(null,null,this);this.off("change:excludeState",this._excludeState,this);this.off("change:library change:exclude",this.buildComposite,this);this.destroyComposite()},reset:function(){this.get("selection").clear();this.resetDisplays()},content:function(){var g=this.frame;if(this.get("empty")){this.get("library").more();g.content.mode("upload")}else{g.content.mode("browse")}},refresh:function(){this.frame.$el.toggleClass("hide-toolbar",this.get("empty"));this.content();this.refreshSelection()},resetDisplays:function(){this._displays=[];this._defaultDisplaySettings={align:getUserSetting("align","none"),size:getUserSetting("imgsize","medium"),link:getUserSetting("urlbutton","post")}},display:function(h){var g=this._displays;if(!g[h.cid]){g[h.cid]=new Backbone.Model(this._defaultDisplaySettings)}return g[h.cid]},_insertDi
splaySettings:function(){var g=this.get("selection"),h;if(g.length!==1){return}h=this.display(g.first()).toJSON();setUserSetting("align",h.align);setUserSetting("imgsize",h.size);setUserSetting("urlbutton",h.link)},_updateEmpty:function(){var g=this.get("library"),h=g.props;if(this.get("filterable")&&(h.get("type")||h.get("parent"))){return}this.set("empty",!g.length&&!g.props.get("search"))},refreshSelection:function(){var g=this.get("selection"),h=this.frame.content.mode();this.frame.toolbar.view().refresh();this.trigger("refresh:selection",this,g);if(!g.length&&"browse"!==h&&"upload"!==h){this.content()}},selectUpload:function(g){this.get("selection").add(g)},buildComposite:function(){var h=this.get("_library"),g=this.get("exclude"),i;this.destroyComposite();if(!this.get(&q
uot;exclude")){return}if(!h){this.set("_library",h=this.get("library"))}i=new f.model.Attachments(null,{props:_.pick(h.props.toJSON(),"order","orderby")});i.validator=function(j){return !!h.getByCid(j.cid)&&!g.getByCid(j.cid)};i.mirror(h).observe(g);this.set("library",i)},destroyComposite:function(){var h=this.get("library"),g=this.get("_library");if(!g){return}h.unobserve();this.set("library",g);this.unset("_library")},_excludeState:function(){var h=this.get("excludeState"),g=this.previous("excludeState");if(g){this.frame.get(g).off("change:library",this._excludeStateLibrary,this)}if(h){this.frame.get(h).on("change:library",this._excludeStateLibrary,this)}},_excludeStateLibrary:function(){var g=this.get("excludeState");if(!g){return}this.set("exclude",this.frame.get(g).get("library"))}});f.controller.Upl
oad=f.controller.State.extend({defaults:_.defaults({id:"upload",content:"upload",toolbar:"empty",libraryState:"library"},f.controller.State.prototype.defaults),initialize:function(){f.controller.State.prototype.initialize.apply(this,arguments)},activate:function(){wp.Uploader.queue.on("add",this.uploading,this);f.controller.State.prototype.activate.apply(this,arguments)},deactivate:function(){wp.Uploader.queue.off(null,null,this);f.controller.State.prototype.deactivate.apply(this,arguments)},uploading:function(h){var g=this.get("libraryState");this.frame.get(g).get("selection").add(h);this.frame.state(g)}});f.controller.Gallery=f.controller.Library.extend({defaults:{id:"gallery-edit",multiple:false,describe:true,edge:199,editing:false,sortable:true,searchable:false,toolbar:"gallery-edit"},initialize:function(){if(!this.get("library")){this.set("library",new f.model.S
election())}if(!this.get("AttachmentView")){this.set("AttachmentView",f.view.Attachment.EditLibrary)}f.controller.Library.prototype.initialize.apply(this,arguments)},activate:function(){var g=this.get("library");g.props.set("type","image");this.get("library").observe(wp.Uploader.queue);this.frame.content.on("activate:browse",this.gallerySettings,this);f.controller.Library.prototype.activate.apply(this,arguments)},deactivate:function(){this.get("library").unobserve(wp.Uploader.queue);this.frame.content.off(null,null,this);f.controller.Library.prototype.deactivate.apply(this,arguments)},gallerySettings:function(){var g=this.get("library");if(!g){return}g.gallery=g.gallery||new Backbone.Model();this.frame.content.view().sidebar.set({gallery:new f.view.Settings.Gallery({controller:this,model:g.gallery,priority:40})})}});f.controller.Embed=f.controller.State.extend({defaults:{id:"embed&
quot;,url:"",menu:"main",content:"embed",toolbar:"main-embed",type:"link"},sensitivity:200,initialize:function(){this.debouncedScan=_.debounce(_.bind(this.scan,this),this.sensitivity);this.on("change:url",this.debouncedScan,this);this.on("scan",this.scanImage,this);f.controller.State.prototype.initialize.apply(this,arguments)},scan:function(){var g={type:"link"};this.trigger("scan",g);this.set(g)},scanImage:function(g){var k=this.frame,i=this,h=this.get("url"),j=new Image();j.onload=function(){if(i!==k.state()||h!==i.get("url")){return}i.set({type:"image",width:j.width,height:j.height})};j.src=h},reset:function(){_.each(_.difference(_.keys(this.attributes),_.keys(this.defaults)),function(g){this.unset(g)},this);this.set("url","");this.frame.toolbar.view().refresh()}});f.Views=function(h,g){this.view=h;this._views=_.isArray(g)?{"&quo
t;:g}:g||{}};f.Views.extend=Backbone.Model.extend;_.extend(f.Views.prototype,{all:function(){return _.flatten(this._views)},get:function(g){g=g||"";return this._views[g]},first:function(g){var h=this.get(g);return h&&h.length?h[0]:null},set:function(g,h,i){var k,j;if(!_.isString(g)){i=h;h=g;g=""}i=i||{};h=_.isArray(h)?h:[h];k=this.get(g);j=h;if(k){if(i.add){if(_.isUndefined(i.at)){j=k.concat(h)}else{j=k;j.splice.apply(j,[i.at,0].concat(h))}}else{_.each(j,function(l){l.__detach=true});_.each(k,function(l){if(l.__detach){l.$el.detach()}else{l.dispose()}});_.each(j,function(l){delete l.__detach})}}this._views[g]=j;_.each(h,function(n){var l=n.Views||f.Views,m=n.views=n.views||new l(n);m.parent=this.view;m.selector=g},this);if(!i.silent){this._attach(g,h,_.extend({ready:this._isReady()},i))}return this},add:function(g,h,i){if(!_.isString(g)){i=h;h=g;g=""}return this.set(g,h,_.extend({add:true},i))},unset:function(g,h,i){var j;if(!_.isString(
g)){i=h;h=g;g=""}if(j=this.get(g)){h=_.isArray(h)?h:[h];this._views[g]=h.length?_.difference(j,h):[]}if(!i||!i.silent){_.invoke(h,"dispose",{silent:true})}return this},detach:function(){e(_.pluck(this.all(),"el")).detach();return this},render:function(){var g={ready:this._isReady()};_.each(this._views,function(i,h){this._attach(h,i,g)},this);this.rendered=true;return this},dispose:function(g){if(!g||!g.silent){if(this.parent&&this.parent.views){this.parent.views.unset(this.selector,this.view,{silent:true})}delete this.parent;delete this.selector}_.invoke(this.all(),"dispose");this._views=[];return this},replace:function(g,h){g.html(h);return this},insert:function(h,k,j){var g=j&&j.at,i;if(_.isNumber(g)&&(i=h.children()).length>g){i.eq(g).before(k)}else{h.append(k)}return this},ready:function(){this.view.trigger("ready");_.chain(this.all()).map(function(g){return g.views}).flatten().where({attached:t
rue}).invoke("ready")},_attach:function(g,h,i){var k=g?this.view.$(g):this.view.$el,j;if(!k.length){return this}j=_.chain(h).pluck("views").flatten().value();_.each(j,function(l){if(l.rendered){return}l.view.render();l.rendered=true},this);this[i.add?"insert":"replace"](k,_.pluck(h,"el"),i);_.each(j,function(l){l.attached=true;if(i.ready){l.ready()}},this);return this},_isReady:function(){var g=this.view.el;while(g){if(g===document.body){return true}g=g.parentNode}return false}});f.View=Backbone.View.extend({Views:f.Views,constructor:function(){this.views=new this.Views(this,this.views);this.on("ready",this.ready,this);Backbone.View.apply(this,arguments)},dispose:function(){this.undelegateEvents();if(this.model&&this.model.off){this.model.off(null,null,this)}if(this.collection&&this.collection.off){this.collection.off(null,null,this)}if(this.controller&&this.controller.off){this.controller.of
f(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;this.views.detach();if(this.template){g=this.prepare?this.prepare():{};this.trigger("prepare",g);this.$el.html(this.template(g))}this.views.render();return this},prepare:function(){return this.options},ready:function(){}});f.view.Frame=f.View.extend({initialize:function(){this._createRegions();this._createStates()},_createRegions:function(){this.regions=this.regions?this.regions.slice():[];_.each(this.regions,function(g){this[g]=new f.controller.Region({controller:this,id:g,selector:".media-frame-"+g})},this)},_createStates:function(){this.states=new Backbone.Collection(null,{model:f.controller.State});this.states.on("add",function(g){g.frame=this},this)},reset:function(){this.states.invoke("trigger","reset");return this}});_.extend(f.view.Fram
e.prototype,f.controller.StateMachine.prototype);f.view.MediaFrame=f.view.Frame.extend({className:"media-frame",template:f.template("media-frame"),regions:["menu","content","toolbar"],initialize:function(){f.view.Frame.prototype.initialize.apply(this,arguments);_.defaults(this.options,{title:"",modal:true,uploader:true});if(this.options.modal){this.modal=new f.view.Modal({controller:this,$content:this.$el,title:this.options.title})}if(this.options.uploader){this.uploader=new f.view.UploaderWindow({controller:this,uploader:{dropzone:this.modal?this.modal.$el:this.$el,container:this.$el}});this.views.set(".media-frame-uploader",this.uploader)}this.on("attach",_.bind(this.views.ready,this.views),this)},render:function(){if(this.modal){this.modal.render()}f.view.Frame.prototype.render.apply(this,arguments);return this},createIframeStates:function(g){var j=f.view.settings,i=j.tabs,k=j.tabUrl,h;if(!i||
!k){return}h=e("#post_ID");if(h.length){k+="&post_id="+h.val()}_.each(i,function(m,n){var l=this.get("iframe:"+n).set(_.defaults({tab:n,src:k+"&tab="+n,title:m,content:"iframe",menu:"main"},g))},this);this.content.on("activate:iframe",this.iframeContent,this);this.menu.on("activate:main",this.iframeMenu,this);this.on("open",this.hijackThickbox,this);this.on("close",this.restoreThickbox,this)},iframeContent:function(){this.$el.addClass("hide-toolbar");this.content.view(new f.view.Iframe({controller:this}).render())},iframeMenu:function(){var g={};_.each(f.view.settings.tabs,function(h,i){g["iframe:"+i]={text:this.get("iframe:"+i).get("title"),priority:200}},this);this.menu.view().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.state(g.options.state);g._tb_remove.call(window)}},restoreThickbox:function(){if(!this._tb_remove){return}window.tb_remove=this._tb_remove;delete this._tb_remove}});_.each(["open","close","attach","detach"],function(g){f.view.MediaFrame.prototype[g]=function(h){if(this.modal){this.modal[g].apply(this.modal,arguments)}this.trigger(g);return this}});f.view.MediaFrame.Select=f.view.MediaFrame.extend({initialize:function(){f.view.MediaFrame.prototype.initialize.apply(this,arguments);_.defaults(this.options,{state:"upload",selection:[],library:{},multiple:false});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.selecti
on,library:f.query(g.library),multiple:this.options.multiple,menu:"main",toolbar:"select"}),new f.controller.Upload({menu:"main"})])},bindHandlers:function(){this.menu.on("activate:main",this.mainMenu,this);this.content.on("activate:browse",this.browseContent,this);this.content.on("activate:upload",this.uploadContent,this);this.toolbar.on("activate:select",this.selectToolbar,this);this.on("refresh:selection",this.refreshSelectToolbar,this)},mainMenu:function(g){this.menu.view(new f.view.Menu({controller:this,silent:g&&g.silent,views:{upload:{text:b.uploadFilesTitle,priority:20},library:{text:b.mediaLibraryTitle,priority:40}}}))},browseContent:function(){var g=this.state();this.content.view(new f.view.AttachmentsBrowser({controller:this,collection:g.get("library"),selection:g.get("selection"),model:g,sortable:g.get("sortable"),search:g.get("searchable&quo
t;),upload:g.get("upload"),filters:g.get("filterable"),display:g.get("displaySettings"),AttachmentView:g.get("AttachmentView")}))},uploadContent:function(){this.$el.addClass("hide-toolbar");this.content.view(new f.view.UploaderInline({controller:this}))},selectToolbar:function(g){g=_.defaults(g||{},{event:"select",silent:false,state:false});this.toolbar.view(new f.view.Toolbar({controller:this,silent:g.silent,items:{select:{style:"primary",text:b.select,priority:80,click:function(){var h=this.controller;h.close();h.state().trigger(g.event);h.reset();if(g.state){h.state(g.state)}}}}}))},refreshSelectToolbar:function(){var g=this.state().get("selection");if(!g||"select"!==this.toolbar.mode()){return}this.toolbar.view().get("select").model.set("disabled",!g.length)}});f.view.MediaFrame.Post=f.view.MediaFrame.Select.extend({initialize:function(){_.defaults(this.options,{
state:"upload",multiple:true,editing:false});f.view.MediaFrame.Select.prototype.initialize.apply(this,arguments);this.createIframeStates()},createStates:function(){var g=this.options;this.states.add([new f.controller.Library({selection:g.selection,library:f.query(g.library),editable:true,filterable:"all",multiple:this.options.multiple,menu:"main",displaySettings:true,displayUserSettings:true}),new f.controller.Upload({menu:"main"}),new f.controller.Embed(),new f.controller.Gallery({library:g.selection,editing:g.editing,menu:"gallery"}),new f.controller.Library({id:"gallery-library",library:f.query({type:"image"}),filterable:"uploaded",multiple:true,menu:"gallery",toolbar:"gallery-add",excludeState:"gallery-edit"}),new f.controller.Upload({id:"gallery-upload",menu:"gallery",libraryState:"gallery-edit"})])},bindHandlers:function(){f.view.M
ediaFrame.Select.prototype.bindHandlers.apply(this,arguments);var g={menu:{gallery:"galleryMenu"},content:{embed:"embedContent","edit-selection":"editSelectionContent"},toolbar:{"main-attachments":"mainAttachmentsToolbar","main-embed":"mainEmbedToolbar","gallery-edit":"galleryEditToolbar","gallery-add":"galleryAddToolbar"}};_.each(g,function(i,h){_.each(i,function(k,j){this[h].on("activate:"+j,this[k],this)},this)},this)},mainMenu:function(){f.view.MediaFrame.Select.prototype.mainMenu.call(this,{silent:true});this.menu.view().set({separateLibrary:new f.View({className:"separator",priority:60}),embed:{text:b.embedFromUrlTitle,priority:80}})},galleryMenu:function(){var g=this.previous(),h=this;this.menu.view(new f.view.Menu({controller:this,views:{cancel:{text:b.cancelGalleryTitle,priority:20,click:function(){if(g){h.state(g)}else{h.close(
)}}},separateCancel:new f.View({className:"separator",priority:40}),"gallery-edit":{text:b.editGalleryTitle,priority:60},"gallery-upload":{text:b.uploadImagesTitle,priority:80},"gallery-library":{text:b.mediaLibraryTitle,priority:100}}}))},embedContent:function(){var g=new f.view.Embed({controller:this,model:this.state()}).render();this.content.view(g);g.url.focus()},editSelectionContent:function(){var i=this.state(),h=i.get("selection"),g;g=new f.view.AttachmentsBrowser({controller:this,collection:h,selection:h,model:i,sortable:true,search:false,AttachmentView:f.view.Attachment.EditSelection}).render();g.toolbar.set("backToLibrary",{text:b.returnToLibrary,priority:-100,click:function(){this.controller.content.mode("browse")}});this.content.view(g)},onSidebarGallerySettings:function(h){var g=this.state().get("library");if(!g){return}g.gallery=g.gallery||new Backbone.Model();this.sidebar.view().se
t({gallery:new f.view.Settings.Gallery({controller:this,model:g.gallery,priority:40}).render()},h)},mainAttachmentsToolbar:function(){this.toolbar.view(new f.view.Toolbar.Insert({controller:this,editable:this.state().get("editable")}))},mainEmbedToolbar:function(){this.toolbar.view(new f.view.Toolbar.Embed({controller:this}));this.$el.removeClass("hide-toolbar")},galleryEditToolbar:function(){var g=this.state().get("editing");this.toolbar.view(new f.view.Toolbar({controller:this,items:{insert:{style:"primary",text:g?b.updateGallery:b.insertGallery,priority:80,click:function(){var h=this.controller,i=h.state();h.close();i.trigger("update",i.get("library"));h.reset();h.state("upload")}}}}))},galleryAddToolbar:function(){this.toolbar.view(new f.view.Toolbar({controller:this,items:{insert:{style:"primary",text:b.addToGallery,priority:80,click:function(){var g=this.controller,i=g.state(),h=g.get("
;gallery-edit");h.get("library").add(i.get("selection").models);i.trigger("reset");g.state("gallery-edit")}}}}))}});f.view.Modal=f.View.extend({tagName:"div",template:f.template("media-modal"),events:{"click .media-modal-backdrop, .media-modal-close":"closeHandler"},initialize:function(){this.controller=this.options.controller;_.defaults(this.options,{container:document.body,title:""})},render:function(){this.options.$content=this.options.$content||e("<div />");this.options.$content.detach();this.$el.html(this.template({title:this.options.title}));this.options.$content.addClass("media-modal-content");this.$(".media-modal").append(this.options.$content);return this},attach:function(){this.$el.appendTo(this.options.container);this.trigger("attach");return this},detach:function(){this.$el.detach();this.trigger("detach");return th
is},open:function(){this.$el.show();this.trigger("open");return this},close:function(){this.$el.hide();this.trigger("close");return this},closeHandler:function(g){g.preventDefault();this.close()},content:function(g){if(this.options.$content){this.options.$content.detach()}this.options.$content=(g instanceof Backbone.View)?g.$el:g;return this.render()}});f.view.UploaderWindow=f.View.extend({tagName:"div",className:"uploader-window",template:f.template("uploader-window"),initialize:function(){var g;this.controller=this.options.controller;this.$browser=e('<a href="#" class="browser" />').hide().appendTo("body");g=this.options.uploader=_.defaults(this.options.uploader||{},{dropzone:this.$el,browser:this.$browser,params:{}});if(g.dropzone&&!(g.dropzone instanceof e)){g.dropzone=e(g.dropzone)}this.controller.on("activate",this.refresh,this)},refresh:function(){if(this.uploader){
this.uploader.refresh()}},ready:function(){var h=f.view.settings.postId,g;if(this.uploader){return}if(h){this.options.uploader.params.post_id=h}this.uploader=new wp.Uploader(this.options.uploader);g=this.uploader.dropzone;g.on("dropzone:enter",_.bind(this.show,this));g.on("dropzone:leave",_.bind(this.hide,this))},show:function(){var g=this.$el.show();_.defer(function(){g.css({opacity:1})})},hide:function(){var g=this.$el.css({opacity:0});f.transition(g).done(function(){if("0"===g.css("opacity")){g.hide()}})}});f.view.UploaderInline=f.View.extend({tagName:"div",className:"uploader-inline",template:f.template("uploader-inline"),initialize:function(){this.controller=this.options.controller;if(!this.options.$browser){this.options.$browser=this.controller.uploader.$browser}wp.Uploader.queue.on("add remove reset change:percent",this.renderUploadProgress,this)},dispose:function(){wp.Uploader.queue.off(n
ull,null,this);f.View.prototype.dispose.apply(this,arguments);return this},render:function(){var g=this.options.$browser,h;this.renderUploadProgress();this.$el.html(this.template(this.options));h=this.$(".browser");g.detach().text(h.text());g[0].className=h[0].className;h.replaceWith(g.show());this.$bar=this.$(".media-progress-bar div");this.views.render();return this},renderUploadProgress:function(){var g=wp.Uploader.queue;this.$el.toggleClass("uploading",!!g.length);if(!this.$bar||!g.length){return}this.$bar.width((g.reduce(function(h,i){if(i.get("uploading")){return h+(i.get("percent")||0)}else{return h+100}},0)/g.length)+"%")}});f.view.Toolbar=f.View.extend({tagName:"div",className:"media-toolbar",initialize:function(){this.controller=this.options.controller;this._views={};this.$primary=e('<div class="media-toolbar-primary" />').prependTo(this.$el);this.$secondary=e('<div c
lass="media-toolbar-secondary" />').prependTo(this.$el);if(this.options.items){this.set(this.options.items,{silent:true})}if(!this.options.silent){this.render()}},destroy:function(){this.remove();if(this.model){this.model.off(null,null,this)}if(this.collection){this.collection.off(null,null,this)}this.controller.off(null,null,this);_.each(this._views,function(g){if(g.destroy){g.destroy()}})},render:function(){var g=_.chain(this._views).sortBy(function(h){return h.options.priority||10}).groupBy(function(h){return(h.options.priority||10)>0?"primary":"secondary"}).value();e(_.pluck(this._views,"el")).detach();this.$primary.html(_.pluck(g.primary||[],"el"));this.$secondary.html(_.pluck(g.secondary||[],"el"));this.refresh();return this},set:function(i,g,h){h=h||{};if(_.isObject(i)){_.each(i,function(j,k){this.set(k,j,{silent:true})},this)}else{if(!(g instanceof Backbone.View)){g.classes=["media-button-"+i
].concat(g.classes||[]);g=new f.view.Button(g).render()}g.controller=g.controller||this.controller;this._views[i]=g}if(!h.silent){this.render()}return this},get:function(g){return this._views[g]},unset:function(h,g){delete this._views[h];if(!g||!g.silent){this.render()}return this},refresh:function(){}});f.view.Toolbar.Select=f.view.Toolbar.extend({initialize:function(){var h=this.options,g=h.controller,i=g.state().get("selection");_.bindAll(this,"clickSelect");_.defaults(h,{event:"select",state:false,reset:true,close:true,text:b.select});h.items=_.defaults(h.items||{},{select:{style:"primary",text:h.text,priority:80,click:this.clickSelect}});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.state(h.state)}}});f.view.Toolbar.Embed=f.view.Toolbar.Select.extend({initialize:f
unction(){var g=this.options.controller;_.defaults(this.options,{text:b.insertEmbed});f.view.Toolbar.Select.prototype.initialize.apply(this,arguments);g.on("change:url",this.refresh,this)},refresh:function(){var g=this.controller.state().get("url");this.get("select").model.set("disabled",!g||/^https?:\/\/$/.test(g))}});f.view.Toolbar.Insert=f.view.Toolbar.extend({initialize:function(){var g=this.options.controller,i=g.state().get("selection"),h;h=function(k,j){return function(){var l=this.controller,m=l.state().get("selection"),n=l.get(k),o=j?j(m):m.models;n.set("library",new f.model.Selection(o,{props:m.props.toJSON(),multiple:true}));this.controller.state(k)}};this.options.items=_.defaults(this.options.items||{},{selection:new f.view.Selection({controller:g,collection:i,priority:-40,editable:this.options.editable&&function(){this.controller.content.mode("edit-selection")}}).render(),ins
ert:{style:"primary",priority:80,text:b.insertIntoPost,click:function(){g.close();g.state().trigger("insert",i).reset()}},gallery:{text:b.createNewGallery,priority:40,click:h("gallery-edit",function(j){return j.where({type:"image"})})}});f.view.Toolbar.prototype.initialize.apply(this,arguments)},refresh:function(){var g=this.controller.state().get("selection"),h=g.length;this.get("insert").model.set("disabled",!g.length);this.get("gallery").$el.toggle(h>1&&g.any(function(i){return"image"===i.get("type")}))}});f.view.Button=f.View.extend({tagName:"a",className:"media-button",attributes:{href:"#"},events:{click:"click"},defaults:{text:"",style:"",size:"large",disabled:false},initialize:function(){this.model=new Backbone.Model(this.defaults);_.each(this.defaults,function(i,g){var h=this.options[g];if
(_.isUndefined(h)){return}this.model.set(g,h);delete this.options[g]},this);this.model.on("change",this.render,this)},render:function(){var h=["button",this.className],g=this.model.toJSON();if(g.style){h.push("button-"+g.style)}if(g.size){h.push("button-"+g.size)}h=_.uniq(h.concat(this.options.classes));this.el.className=h.join(" ");this.$el.attr("disabled",g.disabled);this.$el.text(this.model.get("text"));return this},click:function(g){if("#"===this.attributes.href){g.preventDefault()}if(this.options.click&&!this.model.get("disabled")){this.options.click.apply(this,arguments)}}});f.view.ButtonGroup=f.View.extend({tagName:"div",className:"button-group button-large media-button-group",initialize:function(){this.buttons=_.map(this.options.buttons||[],function(g){if(g instanceof Backbone.View){return g}else{return new f.view.Button(g).render()}});delete this.opt
ions.buttons;if(this.options.classes){this.$el.addClass(this.options.classes)}},render:function(){this.$el.html(e(_.pluck(this.buttons,"el")).detach());return this}});f.view.PriorityList=f.View.extend({tagName:"div",initialize:function(){this.controller=this.options.controller;this._views={};this.set(_.extend({},this._views,this.options.views),{silent:true});delete this.options.views;if(!this.options.silent){this.render()}},destroy:this.dispose,set:function(l,h,j){var k,g,i;j=j||{};if(_.isObject(l)){_.each(l,function(m,n){this.set(n,m)},this);return this}if(!(h instanceof Backbone.View)){h=this.toView(h,l,j)}h.controller=h.controller||this.controller;this.unset(l);k=h.options.priority||10;g=this.views.get()||[];_.find(g,function(n,m){if(n.options.priority>k){i=m;return true}});this._views[l]=h;this.views.add(h,{at:_.isNumber(i)?i:g.length||0});return this},get:function(g){return this._views[g]},unset:function(h){var g=this.get(h);if(g){g.remove()}delet
e this._views[h];return this},toView:function(g){return new f.View(g)}});f.view.Menu=f.view.PriorityList.extend({tagName:"ul",className:"media-menu",toView:function(g,h){g=g||{};g.id=g.id||h;return new f.view.MenuItem(g).render()},select:function(h){var g=this.get(h);if(!g){return}this.deselect();g.$el.addClass("active")},deselect:function(){this.$el.children().removeClass("active")}});f.view.MenuItem=f.View.extend({tagName:"li",className:"media-menu-item",events:{click:"click"},click:function(){var g=this.options;if(g.click){g.click.call(this)}else{if(g.id){this.controller.state(g.id)}}},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.Sidebar=f.view.PriorityList.extend({className:"media-sidebar"});f.view.Attachment=f.View.extend({tagName:"li",className:"attachment",template:f.template("att
achment"),events:{"click .attachment-preview":"toggleSelection","change [data-setting]":"updateSetting","change [data-setting] input":"updateSetting","change [data-setting] select":"updateSetting","change [data-setting] textarea":"updateSetting","click .close":"removeFromLibrary","click .check":"removeFromSelection","click a":"preventDefault"},buttons:{},initialize:function(){this.controller=this.options.controller;this.model.on("change:sizes change:uploading change:caption change:title",this.render,this);this.model.on("change:percent",this.progress,this);this.model.on("add",this.select,this);this.model.on("remove",this.deselect,this);this.model.on("selection:single selection:unsingle",this.details,this);this.details(this.model,this.controller.state().get("se
lection"))},destroy:function(){this.model.off(null,null,this);this.remove()},render:function(){var h=this.model.toJSON(),g=_.defaults(this.model.toJSON(),{orientation:"landscape",uploading:false,type:"",subtype:"",icon:"",filename:"",caption:"",title:"",dateFormatted:"",width:"",height:"",compat:false,alt:""});g.buttons=this.buttons;g.describe=this.controller.state().get("describe");if("image"===g.type){g.size=this.imageSize()}this.$el.html(this.template(g));this.$el.toggleClass("uploading",g.uploading);if(g.uploading){this.$bar=this.$(".media-progress-bar div")}else{delete this.$bar}if(this.selected()){this.select()}return this},progress:function(){if(this.$bar&&this.$bar.length){this.$bar.width(this.model.get("percent")+"%")}},toggleSelection:function(i){var h=this.options.selection,g=this.mod
el;if(!h){return}if(h.has(g)){h[h.single()===g?"remove":"single"](g)}else{h.add(g).single(g)}},selected:function(){var g=this.options.selection;if(g){return g.has(this.model)}},select:function(g,i){var h=this.options.selection;if(!h||(i&&i!==h)){return}this.$el.addClass("selected")},deselect:function(g,i){var h=this.options.selection;if(!h||(i&&i!==h)){return}this.$el.removeClass("selected")},details:function(g,j){var i=this.options.selection,h;if(i!==j){return}h=i.single();this.$el.toggleClass("details",h===this.model)},preventDefault:function(g){g.preventDefault()},imageSize:function(g){var h=this.model.get("sizes");g=g||"medium";if(h&&h[g]){return _.clone(h[g])}else{return{url:this.model.get("url"),width:this.model.get("width"),height:this.model.get("height"),orientation:this.model.get("orientation")}}},updateSetting:function(h){var g=e(h.t
arget).closest("[data-setting]");if(!g.length){return}this.model.save(g.data("setting"),h.target.value)},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:"ul",className:"attachments",template:f.template("attachments-css"),events:{scroll:"scroll"},initialize:function(){this.controller=this.options.controller;this.el.id=_.uniqueId("__attachments-view-");_.defaults(this.options,{refreshSensitivity:200,refreshThreshold:3,AttachmentView:f.view.Attachment,sortable:false});_.each(["add","remove"],function(g){this.collection.on(g,function(j,h,i){thi
s[g](j,i.index)},this)},this);this.collection.on("reset",this.render,this);this.scroll=_.chain(this.scroll).bind(this).throttle(this.options.refreshSensitivity).value();this.initSortable();this.collection.props.on("change:orderby",this.refreshSortable,this);_.bindAll(this,"css");this.model.on("change:edge change:gutter",this.css,this);this._resizeCss=_.debounce(_.bind(this.css,this),this.refreshSensitivity);e(window).on("resize.attachments",this._resizeCss);this.css()},dispose:function(){this.collection.props.off(null,null,this);e(window).off("resize.attachments",this._resizeCss);f.View.prototype.dispose.apply(this,arguments)},css:function(){var g=e("#"+this.el.id+"-css");if(g.length){g.remove()}f.view.Attachments.$head().append(this.template({id:this.el.id,edge:this.edge(),gutter:this.model.get("gutter")}))},edge:function(){var i=this.model.get("edge"),j,h,g;if(!this.$el.is(&
quot;:visible")){return i}j=this.model.get("gutter")*2;h=this.$el.width()-j;g=Math.ceil(h/(i+j));i=Math.floor((h-(g*j))/g);return i},initSortable:function(){var g=this.collection,h;if(!this.options.sortable||!e.fn.sortable){return}this.$el.sortable({disabled:!!g.comparator,containment:this.$el,tolerance:"pointer",start:function(i,j){h=j.item.index()},update:function(j,k){var i=g.at(h);g.remove(i,{silent:true}).add(i,{at:k.item.index(),silent:true})}});g.props.on("change:orderby",function(){this.$el.sortable("option","disabled",!!g.comparator)},this)},refreshSortable:function(){if(!this.options.sortable||!e.fn.sortable){return}this.$el.sortable("option","disabled",!!this.collection.comparator)},render:function(){if(!this.collection.length){this.collection.more().done(this.scroll);this.$el.empty();return this}this.$el.html(this.collection.map(function(g){return new this.options.AttachmentView({controlle
r:this.controller,model:g,collection:this.collection,selection:this.options.selection}).render().$el},this));return this},ready:function(){this.scroll()},add:function(j,h){var g,i;g=new this.options.AttachmentView({controller:this.controller,model:j,collection:this.collection,selection:this.options.selection}).render();i=this.$el.children();if(i.length>h){i.eq(h).before(g.$el)}else{this.$el.append(g.$el)}},remove:function(i,g){var h=this.$el.children();if(h.length){h.eq(g).detach()}},scroll:function(g){if(!this.$el.is(":visible")){return}if(this.el.scrollHeight<this.el.scrollTop+(this.el.clientHeight*this.options.refreshThreshold)){this.collection.more().done(this.scroll)}}},{$head:(function(){var g;return function(){return g=g||e("head")}}())});f.view.Search=f.View.extend({tagName:"input",className:"search",attributes:{type:"search",placeholder:b.search},events:{keyup:"search",change:"search",search
:"search"},render:function(){this.el.value=this.model.escape("search");return this},search:function(g){if(g.target.value){this.model.set("search",g.target.value)}else{this.model.unset("search")}}});f.view.AttachmentFilters=f.View.extend({tagName:"select",className:"attachment-filters",events:{change:"change"},filters:{},keys:[],initialize:function(){this.$el.html(_.chain(this.filters).map(function(g,h){return{el:this.make("option",{value:h},g.text),priority:g.priority||50}},this).sortBy("priority").pluck("el").value());this.model.on("change",this.select,this);this.select()},change:function(h){var g=this.filters[this.el.value];if(g){this.model.set(g.props)}},select:function(){var g=this.model,i="all",h=g.toJSON();_.find(this.filters,function(k,l){var j=_.all(k.props,function(n,m){return n===(_.isUndefined(h[m])?null:h[m])});if(j){return i=l}});this.$el.val(i
)}});f.view.AttachmentFilters.Uploaded=f.view.AttachmentFilters.extend({filters:{all:{text:b.allMediaItems,props:{parent:null},priority:10},uploaded:{text:b.uploadedToThisPost,props:{parent:f.view.settings.postId},priority:20}}});f.view.AttachmentFilters.All=f.view.AttachmentFilters.extend({filters:(function(){var g={};_.each(f.view.settings.mimeTypes||{},function(i,h){g[h]={text:i,props:{type:h,parent:null}}});g.all={text:b.allMediaItems,props:{type:null,parent:null},priority:10};g.uploaded={text:b.uploadedToThisPost,props:{type:null,parent:f.view.settings.postId},priority:20};return g}())});f.view.AttachmentsBrowser=f.View.extend({tagName:"div",className:"attachments-browser",initialize:function(){this.controller=this.options.controller;_.defaults(this.options,{filters:false,search:true,upload:false,display:false,AttachmentView:f.view.Attachment.Library});this.createToolbar();this.createAttachments();this.createSidebar()},dispose:function(){this.options
.selection.off(null,null,this);f.View.prototype.dispose.apply(this,arguments);return this},createToolbar:function(){var h,g;this.toolbar=new f.view.Toolbar({controller:this.controller});this.views.add(this.toolbar);h=this.options.filters;if("uploaded"===h){g=f.view.AttachmentFilters.Uploaded}else{if("all"===h){g=f.view.AttachmentFilters.All}}if(g){this.toolbar.set("filters",new g({controller:this.controller,model:this.collection.props,priority:-80}).render())}if(this.options.search){this.toolbar.set("search",new f.view.Search({controller:this.controller,model:this.collection.props,priority:60}).render())}if(this.options.sortable){this.toolbar.set("dragInfo",new f.View({el:e('<div class="instructions">'+b.dragInfo+"</div>")[0],priority:-40}))}if(this.options.upload&&this.controller.uploader){this.toolbar.set("upload",new f.view.Button(_.extend({el:this.controller.uploader.$brow
ser.detach()[0],priority:-60,size:"large",text:b.selectFiles},this.options.upload)).render())}},createAttachments:function(){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(){this.sidebar=new f.view.Sidebar({controller:this.controller});this.views.add(this.sidebar);this.options.selection.on("selection:single",this.createSingle,this);this.options.selection.on("selection:unsingle",this.disposeSingle,this)},createSingle:function(){var h=this.sidebar,i=this.options.selection.single(),g={};h.set("details",new f.view.Attachment.Details({controller:this.controller,model:i,priority:80}));if(i.get("compat")){h.set("compat",new f.view.AttachmentCompat({controller:this.controller,model:i,priority:120}
))}if(this.options.display){h.set("display",new f.view.Settings.AttachmentDisplay({controller:this.controller,model:this.model.display(i),attachment:i,priority:160,userSettings:this.model.get("displayUserSettings")}))}},disposeSingle:function(){var g=this.sidebar;g.unset("details");g.unset("compat");g.unset("display")}});f.view.SelectionPreview=f.View.extend({tagName:"div",className:"selection-preview",template:f.template("media-selection-preview"),events:{"click .clear-selection":"clear"},initialize:function(){_.defaults(this.options,{clearable:true});this.controller=this.options.controller;this.collection.on("add change:url remove",this.render,this);this.render()},render:function(){var g=_.clone(this.options),j,i,h;if(!this.collection.length){this.$el.empty();return this}g.count=this.collection.length;j=this.collection.last();i=j.get("sizes");if("ima
ge"===j.get("type")){g.thumbnail=(i&&i.thumbnail)?i.thumbnail.url:j.get("url")}else{g.thumbnail=j.get("icon")}this.$el.html(this.template(g));return this},clear:function(g){g.preventDefault();this.collection.clear()}});f.view.Selection=f.View.extend({tagName:"div",className:"media-selection",template:f.template("media-selection"),events:{"click .edit-selection":"edit","click .clear-selection":"clear"},initialize:function(){_.defaults(this.options,{editable:false,clearable:true});this.controller=this.options.controller;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.collection.on("add remove reset",this.refresh,this)},destroy:function(){this.remove();this.collection.off("
add remove reset",this.refresh,this);this.attachments.destroy()},render:function(){this.attachments.$el.detach();this.attachments.render();this.$el.html(this.template(this.options));this.$(".selection-view").replaceWith(this.attachments.$el);this.refresh();return this},refresh:function(){if(!this.$el.children().length){return}this.$el.toggleClass("empty",!this.collection.length);this.$(".count").text(this.collection.length+" "+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.clear()}});f.view.Attachment.Selection=f.view.Attachment.extend({className:"attachment selection",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:{"click button"
:"updateHandler","change input":"updateHandler","change select":"updateHandler","change textarea":"updateHandler"},initialize:function(){this.model=this.model||new Backbone.Model();this.model.on("change",this.updateChanges,this)},destroy:function(){this.model.off(null,null,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(i){var j=this.model.get(i),h=this.$('[data-setting="'+i+'"]'),g;if(!h.length){return}if(h.is("select")){h.find('[value="'+j+'"]').attr("selected",true)}else{if(h.hasClass("button-group")){g=h.find("button").removeClass("active");g.filter('[value="'+j+'"]').addClass("active")}else{if(h.is('input[type="text"], textarea')){if(!h.is(&quo
t;:focus")){h.val(j)}}}}},updateHandler:function(i){var h=e(i.target).closest("[data-setting]"),j=i.target.value,g;i.preventDefault();if(!h.length){return}this.model.set(h.data("setting"),j);if(g=h.data("userSetting")){setUserSetting(g,j)}},updateChanges:function(h,g){if(g.changes){_(g.changes).chain().keys().each(this.update,this)}}});f.view.Settings.AttachmentDisplay=f.view.Settings.extend({className:"attachment-display-settings",template:f.template("attachment-display-settings"),initialize:function(){var g=this.options.attachment;_.defaults(this.options,{userSettings:false});f.view.Settings.prototype.initialize.apply(this,arguments);this.model.on("change:link",this.updateCustomLink,this);if(g){g.on("change:uploading",this.render,this)}},dispose:function(){var g=this.options.attachment;if(g){g.off(null,null,this)}f.view.Settings.prototype.dispose.apply(this,arguments)},render:function(){var g=this.o
ptions.attachment;if(g){_.extend(this.options,{sizes:g.get("sizes"),type:g.get("type")})}f.view.Settings.prototype.render.call(this);this.updateCustomLink();return this},updateCustomLink:function(){var g="custom"===this.model.get("link"),h=this.$(".link-to-custom");if(!g){h.hide();return}h.show();if(!this.model.get("linkUrl")){h.val("http://")}if(h.is(":visible")){h.focus()[0].select()}}});f.view.Settings.Gallery=f.view.Settings.extend({className:"gallery-settings",template:f.template("gallery-settings")});f.view.Attachment.Details=f.view.Attachment.extend({tagName:"div",className:"attachment-details",template:f.template("attachment-details"),events:{"change [data-setting]":"updateSetting","change [data-setting] input":"updateSetting","change [data-setting] select":"updateSetting","c
hange [data-setting] textarea":"updateSetting"}});f.view.AttachmentCompat=f.View.extend({tagName:"form",className:"compat-item",events:{submit:"preventDefault","change input":"save","change select":"save","change textarea":"save"},initialize:function(){this.model.on("change:compat",this.render,this)},destroy:function(){this.model.off(null,null,this)},render:function(){var g=this.model.get("compat");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:"media-iframe",initialize:function(){this.controller=this.options.controller},render:function(){this.$el.html('<iframe src="'+this.controller.state().get("sr
c")+'" />');return this}});f.view.Embed=f.View.extend({className:"media-embed",initialize:function(){this.controller=this.options.controller;this.url=new f.view.EmbedUrl({controller:this.controller,model:this.model}).render();this._settings=new f.View();this.refresh();this.model.on("change:type",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);if(this._settings.destroy){this._settings.destroy()}this._settings.remove();this._settings=g},refresh:function(){var h=this.model.get("type"),g;if("image"===h){g=f.view.EmbedImage}else{if("link"===h){g=f.view.EmbedLink}else{return}}this.settings(new g({controller:this.controller,model:this.model,priority:40}))}});f.view.EmbedUrl=f.View.extend({tagName:"label",className:"embed-url",events:{keyup:"
url"},initialize:function(){this.label=this.make("span",null,this.options.label||b.url);this.input=this.make("input",{type:"text",value:this.model.get("url")||""});this.$label=e(this.label);this.$input=e(this.input);this.$el.append([this.label,this.input]);this.model.on("change:url",this.render,this)},destroy:function(){this.model.off(null,null,this)},render:function(){var g=this.$input;if(g.is(":focus")){return}this.input.value=this.model.get("url")||"http://";return this},url:function(g){this.model.set("url",g.target.value)},focus:function(){var g=this.$input;if(g.is(":visible")){g.focus()[0].select()}}});f.view.EmbedLink=f.view.Settings.extend({className:"embed-link-settings",template:f.template("embed-link-settings")});f.view.EmbedImage=f.view.Settings.AttachmentDisplay.extend({className:"embed-image-settings",template:f.templat
e("embed-image-settings"),initialize:function(){f.view.Settings.AttachmentDisplay.prototype.initialize.apply(this,arguments);this.model.on("change:url",this.updateImage,this)},destroy:function(){this.model.off(null,null,this);f.view.Settings.AttachmentDisplay.prototype.destroy.apply(this,arguments)},updateImage:function(){this.$("img").attr("src",this.model.get("url"))}})}(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 (22809 => 22810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/version.php        2012-11-22 06:30:25 UTC (rev 22809)
+++ trunk/wp-includes/version.php        2012-11-22 06:58:42 UTC (rev 22810)
</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-beta3-22808';
</del><ins>+$wp_version = '3.5-beta3-22810';
</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>