Skip to content

Commit

Permalink
Update photo-sphere-viewer.js to v4
Browse files Browse the repository at this point in the history
related to #1
  • Loading branch information
R0Wi committed May 18, 2021
1 parent 8289d58 commit 666dba1
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 994 deletions.
17 changes: 12 additions & 5 deletions css/photo-sphere-viewer.min.css

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions js/browser.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions js/fileAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @author Robin Windey <ro.windey@gmail.com>
*
* @copyright Robin Windey 2019
*
*
* Injected via the OCA\Files::loadAdditionalScripts-callback.
* Used to hook into the actionhandler for images.
*/
Expand Down Expand Up @@ -126,7 +126,7 @@
*/
_showImage: function (fileObject, xmpResultModel) {
var imageUrl = this._getFileUrl(fileObject);

var urlParams = {
url: imageUrl,
filename: fileObject.name
Expand All @@ -153,12 +153,12 @@
this.showFrame(videoUrl, filename, null, false, 'video');
},
/*
* Injects the iframe with the viewer into the current page.
* Injects the iframe with the viewer into the current page.
* Suiteable for both the sharing option (based on a token) and the authenticated explorer view (filename).
* @param {string} imageUrl - The url from which the panorama can be loaded
* @param {string} imageUrl - The url from which the panorama can be loaded
* @param {string} fileName - The name of the image. Used as caption in the viewer.
* @param {object} xmpResultModel - The xmp-information, read from the server.
* @param {bool} isSharedViewer - True, if we are on single-fileshare
* @param {bool} isSharedViewer - True, if we are on single-fileshare
* @param {string} frameType - image or video
*/
showFrame: function (imageUrl, fileName, xmpResultModel, isSharedViewer, frameType) {
Expand All @@ -185,7 +185,7 @@
// Add xmpData (cropping-info) to image-viewer-params, if we have some
if (frameType == 'image' && xmpResultModel && xmpResultModel.containsCroppingConfig) {
var extendObject = {
pano_data: xmpResultModel.croppingConfig
panoData: xmpResultModel.croppingConfig
};
configObject = $.extend(configObject, extendObject);
}
Expand Down Expand Up @@ -307,7 +307,7 @@
},

/*
* Initialize action callbacks. "Override"
* Initialize action callbacks. "Override"
* the action for image/jpeg
*/
init: function (isDirectoryShare, sharingToken) {
Expand Down Expand Up @@ -342,7 +342,7 @@
e.action.name &&
typeof (e.action.name) === "string" &&
e.action.name.toLowerCase() === 'view') {
// Override but store the registered action
// Override but store the registered action
// which was registered after ours. This is
// case (2)
this._oldActionHandler = e.action.actionHandler;
Expand All @@ -355,9 +355,9 @@
/*
* Determines, if a file is a photosphere.
* The file must be a normal user-file (normal login required).
* @param {string} filename
* @param {string} filename
* @param {object} context
* @param {function} callback
* @param {function} callback
*/
canShow: function (filename, context, callback) {
// Trigger serverside function to
Expand Down Expand Up @@ -392,8 +392,8 @@
/*
* Determines, if a file is a photosphere.
* The file must single-shared file.
* @param {string} shareToken
* @param {function} callback
* @param {string} shareToken
* @param {function} callback
*/
canShowSingleFileShare: function (shareToken, callback) {
var xmpBackendUrl = OC.generateUrl('apps/files_photospheres') +
Expand Down
12 changes: 6 additions & 6 deletions js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@
* @author Robin Windey <ro.windey@gmail.com>
*
* @copyright Robin Windey 2019
*
*
* Initializes the viewer-component with a given photospere-image-configuration
*/

class PhotoSphereViewerRenderer {
render(configObject) {
const defaults = {
container: 'viewer',
time_anim: false,
usexmpdata: false,
container: document.querySelector('#viewer'),
autorotateDelay: false,
useXmpData: false,
// Fix iframe problem on Safari #32
with_credentials: true
withCredentials: true
};

// Merge with defaults
Object.assign(configObject, defaults);

const viewer = new PhotoSphereViewer(configObject);
const viewer = new PhotoSphereViewer.Viewer(configObject);
window.photoSphereViewer = viewer;
}
}
Expand Down
19 changes: 13 additions & 6 deletions js/photo-sphere-viewer.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 666dba1

Please sign in to comment.