Skip to content

Commit

Permalink
Merge branch 'master' of github.com:JustinHoldstock/box-content-previ…
Browse files Browse the repository at this point in the history
…ew into Highlight-annotations-on-mobile
  • Loading branch information
Justin Holdstock committed Aug 1, 2017
2 parents 849fe7f + 6b361ed commit ef2929e
Show file tree
Hide file tree
Showing 39 changed files with 1,363 additions and 649 deletions.
763 changes: 369 additions & 394 deletions CHANGELOG.md

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions README.md
@@ -1,7 +1,7 @@
[![Project Status](https://img.shields.io/badge/status-active-brightgreen.svg?style=flat-square)](http://opensource.box.com/badges/)
[![Styled With Prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![build status](https://img.shields.io/travis/box/box-content-preview/master.svg?style=flat-square)](https://travis-ci.org/box/box-content-preview)
[![version](https://img.shields.io/badge/version-v1.2.0-blue.svg?style=flat-square)](https://github.com/box/box-content-preview)
[![version](https://img.shields.io/badge/version-v1.3.0-blue.svg?style=flat-square)](https://github.com/box/box-content-preview)
[![npm version](https://img.shields.io/npm/v/box-ui-elements.svg?style=flat-square)](https://www.npmjs.com/package/box-ui-elements)

[Box Content Preview](https://docs.box.com/docs/box-content-preview)
Expand All @@ -19,11 +19,11 @@ If you are using Internet Explorer 11, which doesn't natively support promises,

Current Version
---------------
* Version: v1.2.0
* Version: v1.3.0
* Locale: en-US

https://cdn01.boxcdn.net/platform/preview/1.2.0/en-US/preview.js
https://cdn01.boxcdn.net/platform/preview/1.2.0/en-US/preview.css
https://cdn01.boxcdn.net/platform/preview/1.3.0/en-US/preview.js
https://cdn01.boxcdn.net/platform/preview/1.3.0/en-US/preview.css

Supported Locales
-----------------
Expand Down Expand Up @@ -53,8 +53,8 @@ You can self-host the Box Content Preview UI Element or reference the versions a
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=Promise"></script>

<!-- Latest version of Preview SDK for your locale -->
<script src="https://cdn01.boxcdn.net/platform/preview/1.2.0/en-US/preview.js"></script>
<link rel="stylesheet" href="https://cdn01.boxcdn.net/platform/preview/1.2.0/en-US/preview.css" />
<script src="https://cdn01.boxcdn.net/platform/preview/1.3.0/en-US/preview.js"></script>
<link rel="stylesheet" href="https://cdn01.boxcdn.net/platform/preview/1.3.0/en-US/preview.css" />
</head>
<body>
<div class="preview-container" style="height:400px;width:575px"></div>
Expand Down
43 changes: 31 additions & 12 deletions build/release.sh
Expand Up @@ -14,7 +14,7 @@ patch_release=false


reset_to_master() {
# Update to latest code on Github master
# Update to latest code on GitHub master
git checkout master || return 1

# Wipe tags
Expand Down Expand Up @@ -71,7 +71,7 @@ update_changelog() {
echo "Updating CHANGELOG.md"
echo "----------------------------------------------------------------------"

if github_changelog_generator box/box-content-preview --future-release v$VERSION --exclude-labels legacy-ignore; then
if ./node_modules/.bin/conventional-changelog -i CHANGELOG.md --same-file; then
echo "----------------------------------------------------------------------"
echo "Updated CHANGELOG successfully"
echo "----------------------------------------------------------------------"
Expand Down Expand Up @@ -110,16 +110,29 @@ push_to_github() {
echo "Master version is now at" $VERSION
echo "----------------------------------------------------------------------"

# Push to Github including tags
if git push github-upstream master --tags --no-verify; then
echo "----------------------------------------------------------------------"
echo "Pushed version" $VERSION "to git successfully"
echo "----------------------------------------------------------------------"
# Push release to GitHub
if $patch_release; then
if git push github-upstream v$VERSION --no-verify; then
echo "----------------------------------------------------------------------"
echo "Pushed version" $VERSION "to git successfully"
echo "----------------------------------------------------------------------"
else
echo "----------------------------------------------------------------------"
echo "Error while pushing version" $VERSION "to git"
echo "----------------------------------------------------------------------"
return 1
fi
else
echo "----------------------------------------------------------------------"
echo "Error while pushing version" $VERSION "to git"
echo "----------------------------------------------------------------------"
return 1
if git push github-upstream master --tags --no-verify; then
echo "----------------------------------------------------------------------"
echo "Pushed version" $VERSION "to git successfully"
echo "----------------------------------------------------------------------"
else
echo "----------------------------------------------------------------------"
echo "Error while pushing version" $VERSION "to git"
echo "----------------------------------------------------------------------"
return 1
fi
fi
}

Expand Down Expand Up @@ -156,8 +169,14 @@ push_new_release() {
# Update readme
update_readme || return 1

# Push to Github
# Push to GitHub
push_to_github || return 1

# Push GitHub release
echo "----------------------------------------------------------------------"
echo "Pushing new GitHub release"
echo "----------------------------------------------------------------------"
./node_modules/.bin/conventional-github-releaser
}


Expand Down
4 changes: 3 additions & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "box-content-preview",
"version": "1.2.0",
"version": "1.3.0",
"description": "Box Content Preview UI Element",
"author": "Box (https://www.box.com/)",
"license": "SEE LICENSE IN LICENSE",
Expand All @@ -26,7 +26,9 @@
"chai": "^3.5.0",
"chai-as-promised": "5.3.0",
"chai-dom": "^1.5.0",
"conventional-changelog-cli": "^1.3.2",
"conventional-changelog-lint": "^1.1.7",
"conventional-github-releaser": "^1.1.12",
"css-loader": "^0.27.3",
"cssnano-cli": "^1.0.5",
"deepmerge": "^1.5.0",
Expand Down
40 changes: 20 additions & 20 deletions src/i18n/en-AU.properties
Expand Up @@ -5,9 +5,9 @@ zoom_in=Zoom in
# Button tooltip for zooming out of a preview
zoom_out=Zoom out
# Button tooltip for entering a full screen preview
enter_fullscreen=Enter fullscreen
enter_fullscreen=Enter full screen
# Button tooltip for exiting a full screen preview
exit_fullscreen=Exit fullscreen
exit_fullscreen=Exit full screen
# Button tooltip for going to the previous page in a preview
previous_page=Previous page
# Input tooltip for navigating to a specific page in a preview
Expand All @@ -29,31 +29,31 @@ previous_file=Previous file
# Accessible text for right navigation arrow that navigates user to next file in collection
next_file=Next file
# Text shown while preview is loading
loading_preview=Loading Preview...
loading_preview=Loading preview...
# Text for download button shown while preview is loading
download_file=Download File
download_file=Download file
# Text shown when a text file has been truncated due to size limits.
text_truncated=This file has been truncated due to size limits. Please download to view the whole file.

# Error messages
# Default preview error message
error_default=We're sorry, the preview didn't load. This file type may not be supported.
error_default=Sorry! The preview hasn't loaded. This file type may not be supported.
# No permissions preview error message
error_permissions=We're sorry, you don't have permission to preview this file.
error_permissions=Sorry! You don't have permission to preview this file.
# Preview refresh error message suggesting refreshing the page as a possible fix
error_refresh=We're sorry, the preview didn't load. Please refresh the page.
error_refresh=Sorry! The preview hasn't loaded. Please refresh the page.
# Preview rate limit error suggesting waiting a few minutes to avoid rate limit
error_rate_limit=We're sorry, the preview didn't load because your request was rate limited. Please wait a few minutes and try again.
error_rate_limit=Sorry! The preview hasn't loaded because your request has been rate limited. Please wait a few minutes and try again.
# Preview re-upload error message suggesting re-uploading the file or contacting support as a possible fix
error_reupload=We're sorry, the preview didn't load. Please re-upload the file or contact Box support.
error_reupload=Sorry! The preview hasn't loaded. Please re-upload the file or contact Box support.
# Preview error message shown when the user's browser doesn't support previews of this file type
error_browser_unsupported=We're sorry, your browser doesn't support preview for {1}.
error_browser_unsupported=Sorry! Your browser doesn't support preview for {1}.
# Preview error message shown when the file has invalid formatting (most likely a 3D file)
error_file_type_unsupported=We're sorry, this file format is not supported.
error_file_type_unsupported=Sorry! This file format is not supported.
# Preview error message shown when an iWork file is previewed
error_iwork=We're sorry, iWork files are not currently supported.
error_iwork=Sorry! iWork files are not currently supported.
# Preview error message shown when document loading fails (most likely due to password or watermark)
error_document=We're sorry, the preview didn't load. This document may be protected.
error_document=Sorry! The preview hasn't loaded. This document may be protected.

# Media Preview
# Label for changing speed in media player
Expand All @@ -65,9 +65,9 @@ media_quality=Quality
# Label for automatic quality in media player
media_quality_auto=Auto
# Label for volume slider in media player
media_volume_slider=Volume Slider
media_volume_slider=Volume slider
# Label for time slider in media player
media_time_slider=Media Slider
media_time_slider=Media slider
# Label for Volume button in media player
media_mute=Mute
# Label for Volume button in media player
Expand All @@ -79,7 +79,7 @@ media_pause=Pause
# Label for Settings button in media player
media_settings=Settings
# Label for subtitles/closed-captions in media player
media_subtitles_cc=Subtitles/Closed Captions
media_subtitles_cc=Subtitles/closed captions
# Used in ARIA label for volume
volume=Volume
# Used in ARIA label for timescrubber progress
Expand Down Expand Up @@ -118,7 +118,7 @@ annotation_delete_confirmation_message=Delete this annotation?
# Alternate text for profile picture
annotation_profile_alt=Avatar
# Username for anonymous user
annotation_anonymous_user_name=Some User
annotation_anonymous_user_name=Some user
# Message that annotation is in the process of being posted
annotation_posting_message=Posting...
# Accessibilty message for button that toggles point annotation mode
Expand All @@ -132,11 +132,11 @@ annotation_highlight_comment=Add comment to highlighted text
# Text for which user made the highlight annotation
annotation_who_highlighted={1} highlighted
# Text for when annotations fail to load
annotations_load_error=We're sorry, annotations failed to load for this file.
annotations_load_error=Sorry! Annotations failed to load for this file.
# Text for when the annotation can't be created
annotations_create_error=We're sorry, the annotation could not be created.
annotations_create_error=Sorry! The annotation could not be created.
# Text for when the annotation can't be deleted
annotations_delete_error=We're sorry, the annotation could not be deleted.
annotations_delete_error=Sorry! The annotation could not be deleted.
# Text for when the authorization token is invalid
annotations_authorization_error=Your session has expired. Please refresh the page.

Expand Down
40 changes: 20 additions & 20 deletions src/i18n/en-GB.properties
Expand Up @@ -5,9 +5,9 @@ zoom_in=Zoom in
# Button tooltip for zooming out of a preview
zoom_out=Zoom out
# Button tooltip for entering a full screen preview
enter_fullscreen=Enter fullscreen
enter_fullscreen=Enter full screen
# Button tooltip for exiting a full screen preview
exit_fullscreen=Exit fullscreen
exit_fullscreen=Exit full screen
# Button tooltip for going to the previous page in a preview
previous_page=Previous page
# Input tooltip for navigating to a specific page in a preview
Expand All @@ -29,31 +29,31 @@ previous_file=Previous file
# Accessible text for right navigation arrow that navigates user to next file in collection
next_file=Next file
# Text shown while preview is loading
loading_preview=Loading Preview...
loading_preview=Loading preview...
# Text for download button shown while preview is loading
download_file=Download File
download_file=Download file
# Text shown when a text file has been truncated due to size limits.
text_truncated=This file has been truncated due to size limits. Please download to view the whole file.

# Error messages
# Default preview error message
error_default=We're sorry, the preview didn't load. This file type may not be supported.
error_default=Sorry! The preview hasn't loaded. This file type may not be supported.
# No permissions preview error message
error_permissions=We're sorry, you don't have permission to preview this file.
error_permissions=Sorry! You don't have permission to preview this file.
# Preview refresh error message suggesting refreshing the page as a possible fix
error_refresh=We're sorry, the preview didn't load. Please refresh the page.
error_refresh=Sorry! The preview hasn't loaded. Please refresh the page.
# Preview rate limit error suggesting waiting a few minutes to avoid rate limit
error_rate_limit=We're sorry, the preview didn't load because your request was rate limited. Please wait a few minutes and try again.
error_rate_limit=Sorry! The preview hasn't loaded because your request has been rate limited. Please wait a few minutes and try again.
# Preview re-upload error message suggesting re-uploading the file or contacting support as a possible fix
error_reupload=We're sorry, the preview didn't load. Please re-upload the file or contact Box support.
error_reupload=Sorry! The preview hasn't loaded. Please re-upload the file or contact Box support.
# Preview error message shown when the user's browser doesn't support previews of this file type
error_browser_unsupported=We're sorry, your browser doesn't support preview for {1}.
error_browser_unsupported=Sorry! Your browser doesn't support preview for {1}.
# Preview error message shown when the file has invalid formatting (most likely a 3D file)
error_file_type_unsupported=We're sorry, this file format is not supported.
error_file_type_unsupported=Sorry! This file format is not supported.
# Preview error message shown when an iWork file is previewed
error_iwork=We're sorry, iWork files are not currently supported.
error_iwork=Sorry! iWork files are not currently supported.
# Preview error message shown when document loading fails (most likely due to password or watermark)
error_document=We're sorry, the preview didn't load. This document may be protected.
error_document=Sorry! The preview hasn't loaded. This document may be protected.

# Media Preview
# Label for changing speed in media player
Expand All @@ -65,9 +65,9 @@ media_quality=Quality
# Label for automatic quality in media player
media_quality_auto=Auto
# Label for volume slider in media player
media_volume_slider=Volume Slider
media_volume_slider=Volume slider
# Label for time slider in media player
media_time_slider=Media Slider
media_time_slider=Media slider
# Label for Volume button in media player
media_mute=Mute
# Label for Volume button in media player
Expand All @@ -79,7 +79,7 @@ media_pause=Pause
# Label for Settings button in media player
media_settings=Settings
# Label for subtitles/closed-captions in media player
media_subtitles_cc=Subtitles/Closed Captions
media_subtitles_cc=Subtitles/closed captions
# Used in ARIA label for volume
volume=Volume
# Used in ARIA label for timescrubber progress
Expand Down Expand Up @@ -118,7 +118,7 @@ annotation_delete_confirmation_message=Delete this annotation?
# Alternate text for profile picture
annotation_profile_alt=Avatar
# Username for anonymous user
annotation_anonymous_user_name=Some User
annotation_anonymous_user_name=Some user
# Message that annotation is in the process of being posted
annotation_posting_message=Posting...
# Accessibilty message for button that toggles point annotation mode
Expand All @@ -132,11 +132,11 @@ annotation_highlight_comment=Add comment to highlighted text
# Text for which user made the highlight annotation
annotation_who_highlighted={1} highlighted
# Text for when annotations fail to load
annotations_load_error=We're sorry, annotations failed to load for this file.
annotations_load_error=Sorry! Annotations failed to load for this file.
# Text for when the annotation can't be created
annotations_create_error=We're sorry, the annotation could not be created.
annotations_create_error=Sorry! The annotation could not be created.
# Text for when the annotation can't be deleted
annotations_delete_error=We're sorry, the annotation could not be deleted.
annotations_delete_error=Sorry! The annotation could not be deleted.
# Text for when the authorization token is invalid
annotations_authorization_error=Your session has expired. Please refresh the page.

Expand Down
1 change: 1 addition & 0 deletions src/lib/Controls.scss
Expand Up @@ -41,6 +41,7 @@
opacity: .7;
outline: 0;
padding: 0;
// disables non-standard gestures such as double-tap to zoom
touch-action: manipulation;
user-select: none;
width: 48px;
Expand Down
11 changes: 11 additions & 0 deletions src/lib/_common.scss
Expand Up @@ -25,6 +25,8 @@ $header-height: 48px;
overflow: hidden;
padding: 0;
position: relative;
// disables non-standard gestures such as double-tap to zoom
touch-action: manipulation;
width: 100%;

a {
Expand Down Expand Up @@ -131,6 +133,15 @@ $header-height: 48px;
right: 0;
top: 0;

// Pseudo fullscreen for iOS Safari which doesn't support the fullscreen API
&.bp-fullscreen-unsupported {
bottom: 0;
left: 0;
position: fixed;
right: 0;
top: 0;
}

&.bp-dark {
background-color: $black;
}
Expand Down

0 comments on commit ef2929e

Please sign in to comment.