Changeset 29446
- Timestamp:
- 08/08/2014 03:45:55 AM (10 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/css/editor.css
r29340 r29446 177 177 } 178 178 179 .mce-path, 180 .mce-path-item, 181 .mce-path .mce-divider { 182 font-size: 12px; 183 line-height: 18px; 184 } 179 .mce-path, 180 .mce-path-item, 181 .mce-path .mce-divider { 182 font-size: 12px; 183 line-height: 18px; 184 } 185 185 186 186 .mce-toolbar .mce-btn, … … 935 935 top: 0; 936 936 right: 0; 937 margin-top: 5px; 938 margin-right: 5px; 937 margin: 5px 5px 0 0; 939 938 } 940 939 … … 942 941 .mce-toolbar .mce-btn button, 943 942 .qt-fullscreen { 944 padding: 7px 8px; 943 padding: 6px 7px; 944 } 945 946 #wp-fullscreen-buttons .mce-btn, 947 .mce-toolbar .mce-btn-group .mce-btn { 948 margin: 1px; 945 949 } 946 950 947 951 .qt-fullscreen { 948 width: 3 8px;952 width: 36px; 949 953 height: 34px; 950 954 } 951 955 956 .mce-toolbar .mce-btn-group .mce-btn.mce-wp-fullscreen { 957 margin: 4px 4px 0 0; 958 } 959 952 960 .mce-toolbar .mce-colorbutton .mce-preview { 953 margin-left: -21px; 961 left: 8px; 962 bottom: 6px; 954 963 } 955 964 … … 958 967 } 959 968 960 div.mce-toolbar-grp,961 . quicktags-toolbar {962 padding-right: 4 6px;969 .has-dfw div.mce-toolbar-grp .mce-toolbar.mce-first, 970 .has-dfw .quicktags-toolbar { 971 padding-right: 40px; 963 972 } 964 973 } -
trunk/src/wp-includes/css/media-views.css
r29441 r29446 17 17 .media-frame textarea { 18 18 padding: 6px 8px; 19 line-height: 16px;20 19 } 21 20 … … 145 144 right: 0; 146 145 width: 50px; 147 height: 48px;146 height: 50px; 148 147 z-index: 1000; 149 148 color: #777; … … 632 631 } 633 632 633 .media-frame-title .dashicons { 634 display: none; 635 } 636 634 637 .media-frame-title h1 { 635 638 padding: 0 16px; … … 695 698 margin-top: 11px; 696 699 padding: 4px; 697 line-height: 18px;698 700 font-size: 13px; 699 701 color: #464646; … … 731 733 -ms-user-select: none; 732 734 user-select: none; 733 width: 2 0%;735 width: 25%; 734 736 -webkit-box-sizing: border-box; 735 737 -moz-box-sizing: border-box; … … 1791 1793 } 1792 1794 1795 .image-details .embed-media-settings, 1796 .image-details .embed-media-settings div { 1797 box-sizing: border-box; 1798 } 1799 1793 1800 .image-details .column-settings { 1794 1801 background: #f3f3f3; 1795 1802 border-right: 1px solid #ddd; 1796 1803 min-height: 100%; 1797 width: 5 2%;1804 width: 55%; 1798 1805 position: absolute; 1799 1806 top: 0; … … 1808 1815 1809 1816 .image-details .column-image { 1810 width: 4 8%;1811 position: absolute; 1812 left: 5 2%;1817 width: 45%; 1818 position: absolute; 1819 left: 55%; 1813 1820 top: 0; 1814 1821 } … … 2126 2133 } 2127 2134 2128 @media only screen and (max-width: 9 60px) {2135 @media only screen and (max-width: 940px) { 2129 2136 .media-frame-content .media-toolbar-primary .search, 2130 2137 .media-frame-content .media-toolbar-secondary .attachment-filters { 2131 max-width: 1 20px;2138 max-width: 134px; 2132 2139 } 2133 2140 } … … 2137 2144 */ 2138 2145 @media only screen and (max-width: 900px) { 2139 .media-frame-menu { 2140 width: 139px; 2141 } 2142 2143 .media-menu > a { 2144 padding: 4px 5px; 2145 } 2146 2146 2147 /* Drop-down menu */ 2147 2148 .media-frame-title, 2148 2149 .media-frame-router, 2149 2150 .media-frame-content, 2150 2151 .media-frame-toolbar { 2151 left: 140px; 2152 } 2152 left: 0; 2153 } 2154 2155 .media-frame-menu { 2156 position: static; 2157 width: 0; 2158 } 2159 2160 .media-menu { 2161 display: none; 2162 } 2163 2164 .media-menu.visible { 2165 z-index: 2000; 2166 display: block; 2167 position: fixed; 2168 top: 30px; 2169 left: 30px; 2170 right: 30px; 2171 bottom: 30px; 2172 width: 250px; 2173 max-width: 100%; 2174 overflow: auto; 2175 } 2176 2177 .media-menu > a { 2178 padding: 10px 20px; 2179 font-size: 16px; 2180 } 2181 2182 .media-frame-title { 2183 left: 0; 2184 color: #21759b; 2185 } 2186 2187 .media-frame-title .dashicons { 2188 display: inline-block; 2189 line-height: 56px; 2190 } 2191 2192 .media-frame-title h1 { 2193 line-height: 3; 2194 font-size: 18px; 2195 float: left; 2196 cursor: pointer; 2197 } 2198 /* End drop-down menu */ 2153 2199 2154 2200 .media-sidebar { 2155 width: 159px; 2156 padding: 0 10px 24px; 2201 width: 230px; 2157 2202 } 2158 2203 … … 2160 2205 .attachments-browser .uploader-inline, 2161 2206 .attachments-browser .media-toolbar { 2162 right: 180px; 2207 right: 262px; 2208 } 2209 2210 .media-sidebar .setting { 2211 margin: 6px 0px; 2163 2212 } 2164 2213 … … 2173 2222 .compat-item label span { 2174 2223 text-align: inherit; 2175 display: block;2176 2224 min-height: 16px; 2177 2225 margin: 0; 2178 2226 padding: 8px 2px 0; 2227 } 2228 2229 .media-sidebar .setting .value { 2230 float: none; 2231 width: auto; 2179 2232 } 2180 2233 … … 2190 2243 width: 98%; 2191 2244 max-width: none; 2245 height: auto; 2192 2246 } 2193 2247 … … 2200 2254 .media-frame .search { 2201 2255 padding: 3px 6px; 2256 } 2257 2258 .image-details .column-image { 2259 width: 30%; 2260 left: 70%; 2261 } 2262 2263 .image-details .column-settings { 2264 width: 70%; 2202 2265 } 2203 2266 … … 2245 2308 } 2246 2309 2247 .media-modal-close { 2248 right: 10px; 2310 .media-modal .attachments-browser .media-toolbar-primary, 2311 .media-modal .attachments-browser .media-toolbar-secondary { 2312 width: 50%; 2313 } 2314 2315 .media-modal .attachments-browser .media-toolbar .search { 2316 max-width: 100%; 2317 height: auto; 2318 float: right; 2319 } 2320 2321 .media-modal .attachments-browser .media-toolbar .attachment-filters { 2322 margin: 11px 0 0; 2323 height: auto; 2324 max-width: 65%; 2325 max-width: calc(100% - 38px); 2326 } 2327 2328 .media-modal .attachments-browser .media-toolbar .spinner { 2329 margin: 14px 8px 0; 2249 2330 } 2250 2331 … … 2264 2345 /* Responsive on portrait and landscape */ 2265 2346 @media only screen and (max-width: 640px), screen and (max-height: 400px) { 2266 2267 /* Media tabs on the top */2268 .media-frame-content .media-toolbar .instructions {2269 display: none;2270 }2271 2272 .media-frame-menu {2273 width: auto;2274 bottom: auto;2275 right: 0;2276 height: 60px;2277 }2278 2279 .media-menu {2280 border-right: none;2281 position: relative;2282 border-bottom: 1px solid #dddddd;2283 overflow: hidden;2284 padding: 10px 0 10px 10px;2285 }2286 2287 .media-menu a {2288 float: left;2289 width: 42%;2290 white-space: nowrap;2291 text-overflow: ellipsis;2292 overflow: hidden;2293 }2294 2295 .media-frame-title {2296 display: none;2297 }2298 2299 .image-details .media-frame-title {2300 display: block;2301 top: 0;2302 font-size: 14px;2303 }2304 2305 .media-frame-toolbar {2306 position: absolute;2307 bottom: 0px;2308 left: 0;2309 right: 0;2310 background: #FFF;2311 border-top: 1px solid #DEDEDE;2312 }2313 2314 .media-toolbar {2315 position: relative;2316 }2317 2318 .media-frame {2319 overflow: hidden;2320 }2321 2322 .attachments-browser .attachments {2323 top: 42px;2324 }2325 2326 .attachment-details h3 {2327 margin-top: 45px;2328 }2329 2330 /* Shorten right-side links so they don't overlap the close button */2331 .media-menu a:nth-child(2),2332 .media-menu a:last-child {2333 width: 40%;2334 }2335 2336 .media-menu .separator {2337 display: none;2338 }2339 2340 .media-frame-title {2341 top: 72px;2342 left: auto;2343 height: auto;2344 }2345 2346 .media-frame-title h1 {2347 line-height: 3;2348 font-size: 18px;2349 }2350 2351 .media-frame-router {2352 top: 84px;2353 left: 0;2354 }2355 2356 .media-frame-content {2357 left: 0;2358 top: 118px;2359 }2360 2361 .image-details .media-frame.hide-router .media-frame-content {2362 top: 40px;2363 }2364 2365 .media-frame .attachments-browser {2366 padding-bottom: 300px;2367 }2368 2369 .media-sidebar {2370 border-bottom: 1px solid #dddddd;2371 }2372 2373 .media-modal {2374 width: auto;2375 }2376 2377 .media-toolbar-primary, .media-toolbar-secondary {2378 height: auto;2379 }2380 2381 .uploader-inline-content {2382 top: auto;2383 }2384 2385 .uploader-inline-content .upload-ui {2386 margin: 1em 0;2387 }2388 2389 .uploader-inline-content .post-upload-ui {2390 margin-bottom: 1em;2391 }2392 2393 .attachments-browser .attachments,2394 .attachments-browser .uploader-inline {2395 position: relative;2396 margin-right: 180px;2397 }2398 2399 2347 /* Full-bleed modal */ 2400 2348 .media-modal, 2401 .image-details .media-modal { 2349 .image-details .media-modal, 2350 .media-menu.visible { 2402 2351 position: fixed; 2403 2352 top: 0; … … 2411 2360 } 2412 2361 2413 .attachments-browser .attachment, 2414 .attachments-browser .attachment-preview { 2415 max-width: 100%; 2416 } 2417 2418 .attachments-browser .media-toolbar-primary input.search { 2419 max-width: 150px; 2420 } 2421 2422 .uploader-inline-content { 2423 position: relative; 2424 } 2425 2426 /* Image From Link */ 2427 .embed-link-settings, 2428 .embed-media-settings { 2429 padding-bottom: 52px; 2430 } 2431 2432 .image-details .column-settings, 2433 .image-details .column-image { 2434 position: relative; 2435 padding: 10px 0 20px 0; 2436 left: 0; 2437 width: 100%; 2438 min-height: inherit; 2439 } 2440 2441 2442 /* Gallery */ 2443 .media-frame.hide-router .media-frame-content { 2444 top: 73px; 2445 border-top: none; 2446 } 2447 2448 .collection-settings h3 { 2449 margin-top: 45px; 2450 } 2451 2362 .media-sidebar { 2363 display: none; 2364 } 2365 2366 .attachments-browser .attachments, 2367 .attachments-browser .uploader-inline, 2368 .attachments-browser .media-toolbar { 2369 right: 0; 2370 } 2371 2372 2373 2374 .image-details .media-frame-title { 2375 display: block; 2376 top: 0; 2377 font-size: 14px; 2378 } 2379 2380 /* Media tabs on the top */ 2381 .media-frame-content .media-toolbar .instructions { 2382 display: none; 2383 } 2452 2384 } 2453 2385 … … 2455 2387 @media screen and (max-height: 400px) { 2456 2388 .media-menu { 2457 padding: 0 0 0 10px; 2458 } 2459 2460 .media-menu a { 2461 float: left; 2462 width: 21%; 2463 white-space: nowrap; 2464 text-overflow: ellipsis; 2465 overflow: hidden; 2466 padding: 10px inherit; 2467 } 2468 2469 .media-menu a:nth-child(2), 2470 .media-menu a:last-child { 2471 width: 21%; 2472 } 2473 2474 .media-modal-close { 2475 top: 2px; 2389 padding: 0; 2476 2390 } 2477 2391 … … 2485 2399 2486 2400 .attachments-browser .attachments { 2487 top: 2px;2401 top: 40px; 2488 2402 } 2489 2403 … … 2494 2408 } 2495 2409 2496 @media only screen and (max-width: 680px) {2410 @media only screen and (max-width: 480px) { 2497 2411 .media-frame-content .media-toolbar .search, 2498 2412 .media-frame-content .media-toolbar .attachment-filters { 2499 max-width: 85px;2413 max-width: 90px; 2500 2414 } 2501 2415 } … … 2885 2799 position: static; 2886 2800 width: 100%; 2887 max-width: none !important;2801 max-width: 280px; 2888 2802 } 2889 2803 } -
trunk/src/wp-includes/js/media-editor.js
r29369 r29446 1049 1049 */ 1050 1050 open: function( id, options ) { 1051 var workflow, focusTrap ;1051 var workflow, focusTrap, scrollTop; 1052 1052 1053 1053 if ( 'ontouchend' in document ) { 1054 1054 // Close the onscreen keyboard 1055 1055 if ( ! focusTrap ) { 1056 focusTrap = $( '<input type="text" />' ); 1057 } 1056 focusTrap = $( '<input type="text" style="width: 1px; height: 1px;" />' ); 1057 } 1058 1059 // Keep the scroll position 1060 scrollTop = $( window ).scrollTop(); 1058 1061 1059 1062 $( document.body ).append( focusTrap ); 1060 1063 focusTrap.focus().blur().remove(); 1064 $( window ).scrollTop( scrollTop ); 1061 1065 } 1062 1066 -
trunk/src/wp-includes/js/media-views.js
r29439 r29446 1 1 /* global _wpMediaViewsL10n, confirm, getUserSetting, setUserSetting */ 2 (function($, _){ 3 var media = wp.media, l10n; 2 ( function( $, _ ) { 3 var l10n, 4 media = wp.media, 5 isTouchDevice = ( 'ontouchend' in document ); 4 6 5 7 // Link any localized strings. … … 1835 1837 regions: ['menu','title','content','toolbar','router'], 1836 1838 1839 events: { 1840 'click div.media-frame-title h1': 'toggleMenu' 1841 }, 1842 1837 1843 /** 1838 1844 * @global wp.Uploader … … 1884 1890 this.title.mode('default'); 1885 1891 1892 this.on( 'title:render', function( view ) { 1893 view.$el.append( '<span class="dashicons dashicons-arrow-down"></span>' ); 1894 }); 1895 1886 1896 // Bind default menu. 1887 1897 this.on( 'menu:create:default', this.createMenu, this ); … … 1919 1929 }); 1920 1930 }, 1931 1932 toggleMenu: function() { 1933 this.$el.find( '.media-menu' ).toggleClass( 'visible' ); 1934 }, 1935 1921 1936 /** 1922 1937 * @param {Object} toolbar … … 2556 2571 2557 2572 this.content.set( view ); 2558 view.url.focus(); 2573 2574 if ( ! isTouchDevice ) { 2575 view.url.focus(); 2576 } 2559 2577 }, 2560 2578 … … 4413 4431 // When selecting a tab along the left side, 4414 4432 // focus should be transferred into the main panel 4415 $('.media-frame-content input').first().focus(); 4433 if ( ! isTouchDevice ) { 4434 $('.media-frame-content input').first().focus(); 4435 } 4416 4436 }, 4417 4437 4418 4438 click: function() { 4419 4439 var state = this.options.state; 4440 4420 4441 if ( state ) { 4421 4442 this.controller.setState( state ); 4443 this.views.parent.$el.removeClass( 'visible' ); // TODO: or hide on any click, see below 4422 4444 } 4423 4445 }, … … 4453 4475 ItemView: media.view.MenuItem, 4454 4476 region: 'menu', 4477 4478 /* TODO: alternatively hide on any click anywhere 4479 events: { 4480 'click': 'click' 4481 }, 4482 4483 click: function() { 4484 this.$el.removeClass( 'visible' ); 4485 }, 4486 */ 4487 4455 4488 /** 4456 4489 * @param {Object} options … … 4616 4649 className: 'attachment', 4617 4650 template: media.template('attachment'), 4651 _isTouch: false, 4618 4652 4619 4653 attributes: { … … 4624 4658 events: { 4625 4659 'click .js--select-attachment': 'toggleSelectionHandler', 4660 'touchend .attachment-preview': 'setTouch', 4626 4661 'change [data-setting]': 'updateSetting', 4627 4662 'change [data-setting] input': 'updateSetting', … … 4748 4783 } 4749 4784 }, 4785 4786 setTouch: function() { 4787 this._isTouch = true; 4788 }, 4789 4750 4790 /** 4751 4791 * @param {Object} event … … 4784 4824 } else if ( event.ctrlKey || event.metaKey ) { 4785 4825 method = 'toggle'; 4826 } 4827 4828 if ( this._isTouch ) { 4829 this._isTouch = false; 4830 method = 'add'; 4786 4831 } 4787 4832 … … 4879 4924 4880 4925 // When selecting attachments, focus should be transferred to the right details panel 4881 $('.attachment-details input').first().focus(); 4926 if ( ! isTouchDevice ) { 4927 $('.attachment-details input').first().focus(); 4928 } 4882 4929 4883 4930 return; … … 4889 4936 selection.single( model ); 4890 4937 4891 if ( this.selected() ) {4938 if ( ! isTouchDevice && this.selected() ) { 4892 4939 // When selecting an attachment, focus should be transferred to the right details panel 4893 4940 $('.attachment-details input').first().focus(); 4894 4941 } 4895 4942 4943 return; 4944 } else if ( 'add' === method ) { 4945 selection.add( model ); 4946 selection.single( model ); 4896 4947 return; 4897 4948 } … … 4949 5000 4950 5001 // When selecting an attachment, focus should be transferred to the right details panel 4951 $('.attachment-details input').first().focus(); 5002 if ( ! isTouchDevice ) { 5003 $('.attachment-details input').first().focus(); 5004 } 4952 5005 }, 4953 5006 /** … … 5216 5269 5217 5270 _.defaults( this.options, { 5218 refreshSensitivity: 200,5271 refreshSensitivity: isTouchDevice ? 300 : 200, 5219 5272 refreshThreshold: 3, 5220 5273 AttachmentView: media.view.Attachment, 5221 5274 sortable: false, 5222 5275 resize: true, 5223 idealColumnWidth: 1505276 idealColumnWidth: $( window ).width() < 640 ? 135 : 150 5224 5277 }); 5225 5278 … … 5254 5307 5255 5308 if ( this.options.resize ) { 5256 $( window ).on( 'resize.attachments', this.setColumns ); 5309 $( window ).on( 'resize.media-modal-columns', this.setColumns ); 5310 this.controller.on( 'open', this.setColumns ); 5257 5311 } 5258 5312 … … 5264 5318 dispose: function() { 5265 5319 this.collection.props.off( null, null, this ); 5266 $( window ).off( 'resize. attachments', this.setColumns);5320 $( window ).off( 'resize.media-modal-columns' ); 5267 5321 5268 5322 /** … … 5273 5327 5274 5328 setColumns: function() { 5275 var prev = this.columns; 5276 5277 this.columns = Math.round( this.$el.width() / this.options.idealColumnWidth ); 5278 5279 if ( prev !== this.columns ) { 5280 this.$el.attr( 'data-columns', this.columns ); 5329 var prev = this.columns, 5330 width = this.$el.width(); 5331 5332 if ( width ) { 5333 this.columns = Math.round( width / this.options.idealColumnWidth ) || 1; 5334 5335 if ( ! prev || prev !== this.columns ) { 5336 this.$el.attr( 'data-columns', this.columns ); 5337 } 5281 5338 } 5282 5339 }, … … 5285 5342 var collection = this.collection; 5286 5343 5287 if ( ! this.options.sortable || ! $.fn.sortable ) {5344 if ( isTouchDevice || ! this.options.sortable || ! $.fn.sortable ) { 5288 5345 return; 5289 5346 } … … 5348 5405 5349 5406 refreshSortable: function() { 5350 if ( ! this.options.sortable || ! $.fn.sortable ) {5407 if ( isTouchDevice || ! this.options.sortable || ! $.fn.sortable ) { 5351 5408 return; 5352 5409 } … … 6274 6331 6275 6332 // If the input is visible, focus and select its contents. 6276 if ( $input.is(':visible') ) {6333 if ( ! isTouchDevice && $input.is(':visible') ) { 6277 6334 $input.focus()[0].select(); 6278 6335 } … … 6634 6691 6635 6692 ready: function() { 6636 this.focus(); 6693 if ( ! isTouchDevice ) { 6694 this.focus(); 6695 } 6637 6696 }, 6638 6697
Note: See TracChangeset
for help on using the changeset viewer.