-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #159 from xwp/feature/image-details
Feature/image details
- Loading branch information
Showing
14 changed files
with
706 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import { withUnsplashAttachmentDetails } from './views'; | ||
|
||
// Override media frames in the media library. | ||
if ( wp.media && wp.media.view ) { | ||
/** | ||
* Override two-column frame in the media library. | ||
*/ | ||
if ( | ||
wp.media.view.Attachment && | ||
wp.media.view.Attachment.Details && | ||
wp.media.view.Attachment.Details.TwoColumn | ||
) { | ||
wp.media.view.Attachment.Details.TwoColumn = withUnsplashAttachmentDetails( | ||
wp.media.view.Attachment.Details.TwoColumn | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as withUnsplashAttachmentDetails } from './with-unsplash-attachment-details'; |
6 changes: 6 additions & 0 deletions
6
assets/src/media-library/views/with-unsplash-attachment-details.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default View => { | ||
return View.extend( { | ||
// Use the custom Unsplash template. | ||
template: wp.template( 'unsplash-attachment-details-two-column' ), | ||
} ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -244,3 +244,7 @@ | |
top: 50px; | ||
} | ||
} | ||
|
||
.attachment-info .filename { | ||
font-weight: normal; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const Details = wp.media.view.Attachment.Details.extend( { | ||
className: 'attachment-details unsplash-attachment-details', | ||
template: wp.template( 'unsplash-attachment-details' ), | ||
} ); | ||
|
||
export default Details; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.