Changeset 22818
- Timestamp:
- 11/22/2012 10:56:10 AM (12 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/css/media-views.css
r22816 r22818 739 739 740 740 .media-uploader-status .media-progress-bar { 741 width: 100%; 741 display: none; 742 width: 100%; 743 } 744 745 .uploading.media-uploader-status .media-progress-bar { 746 display: block; 742 747 } 743 748 … … 751 756 752 757 .media-uploader-status { 758 position: relative; 753 759 padding-bottom: 10px; 754 760 border-bottom: 1px solid #dfdfdf; … … 757 763 758 764 .media-uploader-status .upload-details { 765 display: none; 759 766 font-size: 12px; 760 767 color: #666; … … 762 769 } 763 770 771 .uploading.media-uploader-status .upload-details { 772 display: block; 773 } 774 764 775 .media-uploader-status .upload-detail-separator { 765 776 padding: 0 4px; … … 768 779 .media-uploader-status .upload-count { 769 780 color: #464646; 781 } 782 783 .media-uploader-status .upload-dismiss-errors, 784 .media-uploader-status .upload-errors { 785 display: none; 786 } 787 788 .errors.media-uploader-status .upload-dismiss-errors, 789 .errors.media-uploader-status .upload-errors { 790 display: block; 791 } 792 793 .media-uploader-status .upload-dismiss-errors { 794 position: absolute; 795 top: 0; 796 right: 0; 797 text-decoration: none; 798 } 799 800 .media-uploader-status .upload-error { 801 margin: 8px 0 0 0; 802 padding: 8px; 803 border: 1px #c00 solid; 804 background: #ffebe8; 805 border-radius: 3px; 806 } 807 808 .media-uploader-status .upload-error-label { 809 padding: 2px 4px; 810 margin-right: 8px; 811 font-weight: bold; 812 color: #fff; 813 background: #f00; 814 background: -webkit-linear-gradient( top, #e00, #a00 ); 815 border-radius: 3px; 816 } 817 818 .media-uploader-status .upload-error-message { 819 display: block; 820 padding-top: 8px; 821 color: #b44; 770 822 } 771 823 -
trunk/wp-includes/js/media-views.js
r22816 r22818 33 33 34 34 // Makes it easier to bind events using transitions. 35 media.transition = function( selector ) {35 media.transition = function( selector, sensitivity ) { 36 36 var deferred = $.Deferred(); 37 38 sensitivity = sensitivity || 2000; 37 39 38 40 if ( $.support.transition ) { … … 42 44 // Resolve the deferred when the first element finishes animating. 43 45 selector.first().one( $.support.transition.end, deferred.resolve ); 46 47 // Just in case the event doesn't trigger, fire a callback. 48 _.delay( deferred.resolve, sensitivity ); 44 49 45 50 // Otherwise, execute on the spot. … … 1836 1841 template: media.template('uploader-status'), 1837 1842 1843 events: { 1844 'click .upload-dismiss-errors': 'dismiss' 1845 }, 1846 1838 1847 initialize: function() { 1839 1848 this.controller = this.options.controller; … … 1845 1854 1846 1855 this.errors = wp.Uploader.errors; 1856 this.errors.on( 'add remove reset', this.visibility, this ); 1857 this.errors.on( 'add', this.error, this ); 1847 1858 }, 1848 1859 … … 1855 1866 visibility: function() { 1856 1867 this.$el.toggleClass( 'uploading', !! this.queue.length ); 1868 this.$el.toggleClass( 'errors', !! this.errors.length ); 1857 1869 this.$el.toggle( !! this.queue.length || !! this.errors.length ); 1858 1870 }, … … 1904 1916 this.$index.text( index + 1 ); 1905 1917 this.$total.text( queue.length ); 1906 this.$filename.html( active ? media.truncate( _.escape( active.get('filename') ), 24 ) : '' ); 1907 } 1918 this.$filename.html( active ? this.filename( active.get('filename') ) : '' ); 1919 }, 1920 1921 filename: function( filename ) { 1922 return media.truncate( _.escape( filename ), 24 ); 1923 }, 1924 1925 error: function( error ) { 1926 this.views.add( '.upload-errors', new media.view.UploaderStatusError({ 1927 filename: this.filename( error.get('file').name ), 1928 message: error.get('message') 1929 }), { at: 0 }); 1930 }, 1931 1932 dismiss: function( event ) { 1933 var errors = this.views.get('.upload-errors'); 1934 1935 event.preventDefault(); 1936 1937 if ( errors ) 1938 _.invoke( errors, 'remove' ); 1939 wp.Uploader.errors.reset(); 1940 } 1941 }); 1942 1943 media.view.UploaderStatusError = media.View.extend({ 1944 className: 'upload-error', 1945 template: media.template('uploader-status-error') 1908 1946 }); 1909 1947 -
trunk/wp-includes/js/plupload/wp-plupload.js
r22816 r22818 89 89 90 90 Uploader.errors.unshift({ 91 message: message ,91 message: message || pluploadL10n.default_error, 92 92 data: data, 93 93 file: file … … 200 200 return error( pluploadL10n.default_error, null, file ); 201 201 else if ( ! response.success ) 202 return error( response.data .message, response.data, file );202 return error( response.data && response.data.message, response.data, file ); 203 203 204 204 _.each(['file','loaded','size','percent'], function( key ) { -
trunk/wp-includes/media.php
r22817 r22818 1504 1504 <script type="text/html" id="tmpl-uploader-status"> 1505 1505 <h3><?php _e( 'Uploading' ); ?></h3> 1506 <a class="upload-dismiss-errors" href="#"><?php _e('Dismiss Errors'); ?></a> 1507 1506 1508 <div class="media-progress-bar"><div></div></div> 1507 1509 <div class="upload-details"> … … 1514 1516 <div class="upload-errors"> 1515 1517 </div> 1518 </script> 1519 1520 <script type="text/html" id="tmpl-uploader-status-error"> 1521 <span class="upload-error-label"><?php _e('Error'); ?></span> 1522 <span class="upload-error-filename">{{{ data.filename }}}</span> 1523 <span class="upload-error-message">{{ data.message }}</span> 1516 1524 </script> 1517 1525
Note: See TracChangeset
for help on using the changeset viewer.