Changeset 2494280
- Timestamp:
- 03/12/2021 03:14:33 PM (4 years ago)
- Location:
- wp-virtualtour/tags/1.0.5
- Files:
-
- 9 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
wp-virtualtour/tags/1.0.5/README.txt
r2460938 r2494280 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html 9 Stable tag: 1.0. 09 Stable tag: 1.0.5 10 10 11 11 Easily create interactive virtual 360° tours. -
wp-virtualtour/tags/1.0.5/admin/block/build/index.asset.php
r2460938 r2494280 1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => ' d1cc74301d316551d465c7ebbf379610');1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'c458e12d9fa1a549ba1d6aa2ab7c7fb3'); -
wp-virtualtour/tags/1.0.5/admin/block/build/index.js
r2460938 r2494280 1 !function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=10)}([function(t,e){t.exports=window.wp.element},function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp. blockEditor},function(t,e){t.exports=window.wp.components},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e,n){var r=n(11);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},function(t,e,n){var r=n(12),o=n(13);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?o(t):e}},function(t,e){t.exports=window.wp.blocks},function(t,e,n){"use strict";n.r(e);var r=n(5),o=n.n(r),i=n(6),u=n.n(i),a=n(7),l=n.n(a),c=n(8),p=n.n(c),s=n(4),f=n.n(s),b=n(0),d=n(9),y=n(1),m=n(2),v=n(3);Object(d.registerBlockType)("wp-virtualtour/wp-virtualtour-block",{apiVersion:2,title:Object(y.__)("WP Virtual Tour","wp_virtualtour"),description:Object(y.__)("Block to show a virtual tour.","wp_virtualtour"),keywords:[Object(y.__)("tour","wp_virtualtour"),Object(y.__)("virtual tour","wp_virtualtour"),Object(y.__)("3d","wp_virtualtour"),Object(y.__)("360","wp_virtualtour")],icon:"images-alt",category:"media",supports:{alignWide:!0,align:["full"]},attributes:{id:{type:"string",default:""},height:{type:"integer",default:400},pannellumInstance:{type:"object",default:{}}},edit:function(t){l()(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=f()(e);if(n){var o=f()(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return p()(this,t)});function i(){var t;return o()(this,i),(t=r.apply(this,arguments)).state={alignment:t.props.attributes.alignment,id:t.props.attributes.id,height:t.props.attributes.height,pannellumInstance:t.props.attributes.pannellumInstance},t}return u()(i,[{key:"render",value:function(){var t,e=this,n=this.props.attributes,r=(n.alignment,n.height),o=n.id,i=(n.pannellumInstance,function(t){e.props.setAttributes({id:t}),u(t)}),u=function(t){Object.keys(e.props.attributes.pannellumInstance).length&&e.props.attributes.pannellumInstance.destroy(),setTimeout((function(){e.props.attributes.pannellumInstance=window.pannellum.viewer("panorama-"+t,wp_virtualtour.tours.filter((function(e){return e.id===t}))[0])}),100)};return this.props.attributes.id&&u(this.props.attributes.id),this.props.attributes.id||i(wp_virtualtour.tours[0].id),Object(b.createElement)(b.Fragment,null,Object(b.createElement)(m.InspectorControls,null,Object(b.createElement)(v.PanelBody,{title:Object(y.__)("Settings","wp_virtualtour")},Object(b.createElement)(v.RangeControl,{label:"Height",value:r,onChange:function(t){e.props.setAttributes({height:t}),e.props.attributes.pannellumInstance.resize()},min:0,max:1e3}),Object(b.createElement)(v.SelectControl,{label:Object(y.__)("Select tour","wp_virtualtour"),value:o,onChange:i,options:(t=[{value:null,label:Object(y.__)("Select tour","wp_virtualtour"),disabled:!0}],wp_virtualtour.tours.forEach((function(e,n){t.push({value:e.id,label:e.default.title})})),t)}))),Object(b.createElement)(m.__experimentalBlock.div,null,Object(b.createElement)("div",{style:{height:r+"px"},id:"panorama-"+o})))}}]),i}(b.Component),save:function(t){var e=m.useBlockProps.save(),n=t.attributes.id,r=t.attributes.height;return Object(b.createElement)("div",e,Object(b.createElement)("div",{style:{height:r+"px"},id:"panorama_"+n,class:"wp-virtualtour-element","data-id":n}))}})},function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},function(t,e){function n(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}t.exports=n},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}}]);1 !function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=10)}([function(t,e){t.exports=window.wp.element},function(t,e){t.exports=window.wp.i18n},function(t,e){t.exports=window.wp.components},function(t,e){t.exports=window.wp.blockEditor},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(e)}t.exports=n},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}t.exports=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}},function(t,e,n){var r=n(11);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&r(t,e)}},function(t,e,n){var r=n(12),o=n(13);t.exports=function(t,e){return!e||"object"!==r(e)&&"function"!=typeof e?o(t):e}},function(t,e){t.exports=window.wp.blocks},function(t,e,n){"use strict";n.r(e);var r=n(5),o=n.n(r),i=n(6),u=n.n(i),c=n(7),a=n.n(c),l=n(8),s=n.n(l),p=n(4),f=n.n(p),b=n(0),d=n(9),y=n(1),m=n(3),v=n(2);Object(d.registerBlockType)("wp-virtualtour/wp-virtualtour-block",{apiVersion:2,title:Object(y.__)("WP Virtual Tour","wp_virtualtour"),description:Object(y.__)("Block to show a virtual tour.","wp_virtualtour"),keywords:[Object(y.__)("tour","wp_virtualtour"),Object(y.__)("virtual tour","wp_virtualtour"),Object(y.__)("3d","wp_virtualtour"),Object(y.__)("360","wp_virtualtour")],icon:"images-alt",category:"media",supports:{alignWide:!0,align:["full"]},attributes:{id:{type:"string",default:""},focused:{type:"boolean",default:!1},height:{type:"integer",default:400},pannellumInstance:{type:"object",default:{}}},edit:Object(v.withFocusOutside)(function(t){a()(i,t);var e,n,r=(e=i,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=f()(e);if(n){var o=f()(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return s()(this,t)});function i(){var t;return o()(this,i),(t=r.apply(this,arguments)).state={alignment:t.props.attributes.alignment,id:t.props.attributes.id,height:t.props.attributes.height,pannellumInstance:t.props.attributes.pannellumInstance,focused:t.props.focused},t}return u()(i,[{key:"handleFocusOutside",value:function(){this.props.setAttributes({focused:!1})}},{key:"render",value:function(){var t=this;console.log("desc: ",this.props),console.log("this.props.isSelected: ",this.props.isSelected),this.props.isSelected&&this.props.setAttributes({focused:!0});var e,n=this.props.attributes,r=(n.alignment,n.height),o=n.id,i=(n.pannellumInstance,n.focused),u=function(e){t.props.setAttributes({id:e}),c(e)},c=function(e){Object.keys(t.props.attributes.pannellumInstance).length&&t.props.attributes.pannellumInstance.destroy(),setTimeout((function(){t.props.attributes.pannellumInstance=window.pannellum.viewer("panorama-"+e,wp_virtualtour.tours.filter((function(t){return t.id===e}))[0])}),100)};return this.props.attributes.id&&c(this.props.attributes.id),this.props.attributes.id||u(wp_virtualtour.tours[0].id),Object(b.createElement)(b.Fragment,null,Object(b.createElement)(m.InspectorControls,null,Object(b.createElement)(v.PanelBody,{title:Object(y.__)("Settings","wp_virtualtour")},Object(b.createElement)(v.RangeControl,{label:"Height",value:r,onChange:function(e){t.props.setAttributes({height:e}),t.props.attributes.pannellumInstance.resize()},min:0,max:1e3}),Object(b.createElement)(v.SelectControl,{label:Object(y.__)("Select tour","wp_virtualtour"),value:o,onChange:u,options:(e=[{value:null,label:Object(y.__)("Select tour","wp_virtualtour"),disabled:!0}],wp_virtualtour.tours.forEach((function(t,n){e.push({value:t.id,label:t.default.title})})),e)}))),Object(b.createElement)(m.__experimentalBlock.div,null,Object(b.createElement)("div",{className:"panorama-wrapper ".concat(i?"focused":"")},Object(b.createElement)("div",{style:{height:r+"px"},id:"panorama-"+o}))))}}]),i}(b.Component)),save:function(t){var e=m.useBlockProps.save(),n=t.attributes.id,r=t.attributes.height;return Object(b.createElement)("div",e,Object(b.createElement)("div",{style:{height:r+"px"},id:"panorama_"+n,class:"wp-virtualtour-element","data-id":n}))}})},function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(e,r)}t.exports=n},function(t,e){function n(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(t){return typeof t}:t.exports=n=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(e)}t.exports=n},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}}]); -
wp-virtualtour/tags/1.0.5/admin/block/package-lock.json
r2460938 r2494280 3312 3312 "dev": true 3313 3313 }, 3314 "prettier": {3315 "version": "npm:[email protected]",3316 "resolved": "https://registry.npmjs.org/wp-prettier/-/wp-prettier-2.2.1-beta-1.tgz",3317 "integrity": "sha512-+JHkqs9LC/JPp51yy1hzs3lQ7qeuWCwOcSzpQNeeY/G7oSpnF61vxt7hRh87zNRTr6ob2ndy0W8rVzhgrcA+Gw==",3318 "dev": true3319 },3320 "puppeteer": {3321 "version": "npm:[email protected]",3322 "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-3.0.0.tgz",3323 "integrity": "sha512-oWjZFGMc0q2ak+8OxdmMffS79LIT0UEtmpV4h1/AARvESIqqKljf8mrfP+dQ2kas7XttsAZIxRBuWu7Y5JH8KQ==",3324 "dev": true,3325 "requires": {3326 "@types/mime-types": "^2.1.0",3327 "debug": "^4.1.0",3328 "extract-zip": "^2.0.0",3329 "https-proxy-agent": "^4.0.0",3330 "mime": "^2.0.3",3331 "mime-types": "^2.1.25",3332 "progress": "^2.0.1",3333 "proxy-from-env": "^1.0.0",3334 "rimraf": "^3.0.2",3335 "tar-fs": "^2.0.0",3336 "unbzip2-stream": "^1.3.3",3337 "ws": "^7.2.3"3338 }3339 },3340 "rimraf": {3341 "version": "3.0.2",3342 "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz",3343 "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==",3344 "dev": true,3345 "requires": {3346 "glob": "^7.1.3"3347 }3348 },3349 3314 "supports-color": { 3350 3315 "version": "7.2.0", … … 4253 4218 }, 4254 4219 "bl": { 4255 "version": "4. 0.3",4256 "resolved": "https://registry.npmjs.org/bl/-/bl-4. 0.3.tgz",4257 "integrity": "sha512- fs4G6/Hu4/EE+F75J8DuN/0IpQqNjAdC7aEQv7Qt8MHGUH7Ckv2MwTEEeN9QehD0pfIDkMI1bkHYkKy7xHyKIg==",4220 "version": "4.1.0", 4221 "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", 4222 "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", 4258 4223 "dev": true, 4259 4224 "requires": { … … 12741 12706 "dev": true 12742 12707 }, 12708 "prettier": { 12709 "version": "npm:[email protected]", 12710 "resolved": "https://registry.npmjs.org/wp-prettier/-/wp-prettier-2.2.1-beta-1.tgz", 12711 "integrity": "sha512-+JHkqs9LC/JPp51yy1hzs3lQ7qeuWCwOcSzpQNeeY/G7oSpnF61vxt7hRh87zNRTr6ob2ndy0W8rVzhgrcA+Gw==", 12712 "dev": true 12713 }, 12743 12714 "prettier-linter-helpers": { 12744 12715 "version": "1.0.0", … … 12941 12912 "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", 12942 12913 "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" 12914 }, 12915 "puppeteer": { 12916 "version": "npm:[email protected]", 12917 "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-3.0.0.tgz", 12918 "integrity": "sha512-oWjZFGMc0q2ak+8OxdmMffS79LIT0UEtmpV4h1/AARvESIqqKljf8mrfP+dQ2kas7XttsAZIxRBuWu7Y5JH8KQ==", 12919 "dev": true, 12920 "requires": { 12921 "@types/mime-types": "^2.1.0", 12922 "debug": "^4.1.0", 12923 "extract-zip": "^2.0.0", 12924 "https-proxy-agent": "^4.0.0", 12925 "mime": "^2.0.3", 12926 "mime-types": "^2.1.25", 12927 "progress": "^2.0.1", 12928 "proxy-from-env": "^1.0.0", 12929 "rimraf": "^3.0.2", 12930 "tar-fs": "^2.0.0", 12931 "unbzip2-stream": "^1.3.3", 12932 "ws": "^7.2.3" 12933 }, 12934 "dependencies": { 12935 "rimraf": { 12936 "version": "3.0.2", 12937 "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", 12938 "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", 12939 "dev": true, 12940 "requires": { 12941 "glob": "^7.1.3" 12942 } 12943 } 12944 } 12943 12945 }, 12944 12946 "q": { … … 15706 15708 }, 15707 15709 "tar-stream": { 15708 "version": "2. 1.4",15709 "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2. 1.4.tgz",15710 "integrity": "sha512- o3pS2zlG4gxr67GmFYBLlq+dM8gyRGUOvsrHclSkvtVtQbjV0s/+ZE8OpICbaj8clrX3tjeHngYGP7rweaBnuw==",15710 "version": "2.2.0", 15711 "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", 15712 "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", 15711 15713 "dev": true, 15712 15714 "requires": { -
wp-virtualtour/tags/1.0.5/admin/block/src/index.js
r2460938 r2494280 4 4 useBlockProps, 5 5 InspectorControls, 6 __experimentalBlock as Block 6 __experimentalBlock as Block, BlockControls 7 7 } from '@wordpress/block-editor' 8 import { PanelBody, RangeControl, SelectControl } from '@wordpress/components'8 import { PanelBody, RangeControl, SelectControl, withFocusOutside, withFocusReturn } from '@wordpress/components' 9 9 import { Component } from '@wordpress/element' 10 10 … … 30 30 default: '' 31 31 }, 32 focused: { 33 type: 'boolean', 34 default: false 35 }, 32 36 height: { 33 37 type: 'integer', … … 40 44 }, 41 45 // edit: (props) => { 42 edit: class extends Component { 46 edit: 47 withFocusOutside( 48 class extends Component { 43 49 44 constructor() {45 super(...arguments)50 constructor() { 51 super(...arguments) 46 52 47 // example how to bind `this` to the current component for our callbacks48 // this.onChangeContent = this.onChangeContent.bind(this)53 // example how to bind `this` to the current component for our callbacks 54 // this.onChangeContent = this.onChangeContent.bind(this) 49 55 50 // some place for your state 51 this.state = { 52 alignment: this.props.attributes.alignment, 53 id: this.props.attributes.id, 54 height: this.props.attributes.height, 55 pannellumInstance: this.props.attributes.pannellumInstance 56 // some place for your state 57 this.state = { 58 alignment: this.props.attributes.alignment, 59 id: this.props.attributes.id, 60 height: this.props.attributes.height, 61 pannellumInstance: this.props.attributes.pannellumInstance, 62 focused: this.props.focused 63 } 64 65 } 66 67 handleFocusOutside() { 68 this.props.setAttributes({ 69 focused: false 70 }) 71 } 72 73 render() { 74 console.log('desc: ', this.props) 75 console.log('this.props.isSelected: ', this.props.isSelected) 76 if (this.props.isSelected) { 77 this.props.setAttributes({ 78 focused: true 79 }) 80 } 81 82 const { 83 attributes: { 84 alignment, 85 height, 86 id, 87 pannellumInstance, 88 focused 89 } 90 } = this.props 91 92 const onChangeHeight = (newHeight) => { 93 this.props.setAttributes({ 94 height: newHeight 95 }) 96 this.props.attributes.pannellumInstance.resize() 97 } 98 99 const onChangeTour = (tourId) => { 100 this.props.setAttributes({ 101 id: tourId 102 }) 103 initPannellum(tourId) 104 } 105 106 const initPannellum = (tourId) => { 107 if (Object.keys(this.props.attributes.pannellumInstance).length) { 108 this.props.attributes.pannellumInstance.destroy() 109 } 110 setTimeout(() => { // wait for the block to have the id assigned 111 this.props.attributes.pannellumInstance = window.pannellum.viewer('panorama-' + tourId, wp_virtualtour.tours.filter(tour => tour.id === tourId)[0]) 112 }, 100) 113 } 114 115 if (this.props.attributes.id) { 116 initPannellum(this.props.attributes.id) 117 } 118 119 if (!this.props.attributes.id) { 120 onChangeTour(wp_virtualtour.tours[0].id) 121 } 122 123 const getTourOptions = () => { 124 const tourOptions = [{value: null, label: __('Select tour', 'wp_virtualtour'), disabled: true}] 125 wp_virtualtour.tours.forEach((tour, i) => { 126 tourOptions.push({ 127 value: tour.id, 128 label: tour.default.title 129 }) 130 }) 131 return tourOptions 132 } 133 134 const onChangeAlignment = (updatedAlignment) => { 135 this.props.setAttributes({alignment: updatedAlignment}) 136 } 137 138 return ( 139 <> 140 {/*<BlockControls>*/} 141 {/*</BlockControls>*/} 142 <InspectorControls> 143 <PanelBody title={__('Settings', 'wp_virtualtour')}> 144 <RangeControl 145 label="Height" 146 value={height} 147 onChange={onChangeHeight} 148 min={0} 149 max={1000} 150 /> 151 <SelectControl 152 label={__('Select tour', 'wp_virtualtour')} 153 value={id} 154 onChange={onChangeTour} 155 options={getTourOptions()} 156 /> 157 </PanelBody> 158 </InspectorControls> 159 <Block.div> 160 <div className={`panorama-wrapper ${focused ? 'focused' : ''}`}> 161 <div style={{ 162 height: height + 'px' 163 }} id={'panorama-' + id}></div> 164 </div> 165 </Block.div> 166 </> 167 ) 168 } 169 56 170 } 57 58 } 59 60 render() { 61 const { 62 attributes: { 63 alignment, 64 height, 65 id, 66 pannellumInstance 67 } 68 } = this.props 69 70 const onChangeHeight = (newHeight) => { 71 this.props.setAttributes({ 72 height: newHeight 73 }) 74 this.props.attributes.pannellumInstance.resize() 75 } 76 77 const onChangeTour = (tourId) => { 78 this.props.setAttributes({ 79 id: tourId 80 }) 81 initPannellum(tourId) 82 } 83 84 const initPannellum = (tourId) => { 85 if (Object.keys(this.props.attributes.pannellumInstance).length) { 86 this.props.attributes.pannellumInstance.destroy() 87 } 88 setTimeout(() => { // wait for the block to have the id assigned 89 this.props.attributes.pannellumInstance = window.pannellum.viewer('panorama-' + tourId, wp_virtualtour.tours.filter(tour => tour.id === tourId)[0]) 90 }, 100) 91 } 92 93 if (this.props.attributes.id) { 94 initPannellum(this.props.attributes.id) 95 } 96 97 if (!this.props.attributes.id) { 98 onChangeTour(wp_virtualtour.tours[0].id) 99 } 100 101 const getTourOptions = () => { 102 const tourOptions = [{value: null, label: __('Select tour', 'wp_virtualtour'), disabled: true}] 103 wp_virtualtour.tours.forEach((tour, i) => { 104 tourOptions.push({ 105 value: tour.id, 106 label: tour.default.title 107 }) 108 }) 109 return tourOptions 110 } 111 112 const onChangeAlignment = (updatedAlignment) => { 113 this.props.setAttributes({alignment: updatedAlignment}) 114 } 115 116 return ( 117 <> 118 {/*<BlockControls>*/} 119 {/*</BlockControls>*/} 120 <InspectorControls> 121 <PanelBody title={__('Settings', 'wp_virtualtour')}> 122 <RangeControl 123 label="Height" 124 value={height} 125 onChange={onChangeHeight} 126 min={0} 127 max={1000} 128 /> 129 <SelectControl 130 label={__('Select tour', 'wp_virtualtour')} 131 value={id} 132 onChange={onChangeTour} 133 options={getTourOptions()} 134 /> 135 </PanelBody> 136 </InspectorControls> 137 <Block.div> 138 <div style={{ 139 height: height + 'px' 140 }} id={'panorama-' + id}></div> 141 </Block.div> 142 </> 143 ) 144 } 145 146 }, 171 ), 147 172 save: (props) => { 148 173 const blockProps = useBlockProps.save() -
wp-virtualtour/tags/1.0.5/admin/class-wp_virtualtour-admin.php
r2460938 r2494280 63 63 $completeTourData = array(); 64 64 65 if (!$tours) { 66 return; 67 } 68 65 69 foreach ($tours as $tour) { 66 70 $completeTourData[] = get_option('wp_virtualtours_tour_' . $tour->id); … … 126 130 wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__) . 'vue-app/dist/style.css', array(), $this->version, 'all'); 127 131 } 132 wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__) . 'assets/block-editor.css', array(), $this->version, 'all'); 128 133 } 129 134 -
wp-virtualtour/tags/1.0.5/admin/class-wp_virtualtour-ajax-actions.php
r2460938 r2494280 28 28 } 29 29 30 p rivatefunction general_ajax_action()30 public function general_ajax_action() 31 31 { 32 32 $data = null; -
wp-virtualtour/tags/1.0.5/public/class-wp_virtualtour-public.php
r2460938 r2494280 85 85 public function enqueue_block_assets() 86 86 { 87 88 $allTourData = array(); 89 $tours = get_option('wp_virtualtours_tours'); 90 91 if (!count($tours)) { 92 return; 93 } 94 87 95 wp_enqueue_script($this->plugin_name . '_pannellum', plugin_dir_url(__FILE__) . 'js/[email protected]', array('jquery'), rand(0, 99999), true); 88 96 wp_enqueue_script($this->plugin_name . '_script', plugin_dir_url(__FILE__) . 'js/wp_virtualtour-public.js', array(), rand(0, 99999), true); 89 97 90 $allTourData = array();91 $tours = get_option('wp_virtualtours_tours');92 98 foreach ($tours as $tour) { 93 $allTourData[$tour ['id']] = get_option('wp_virtualtours_tour_' . $tour['id']);99 $allTourData[$tour->id] = get_option('wp_virtualtours_tour_' . $tour->id); 94 100 } 95 101 -
wp-virtualtour/tags/1.0.5/wp-virtualtour.php
r2460938 r2494280 10 10 Plugin Name: WP Virtual Tour 11 11 Description: Create virtual 360° tours. 12 Version: 1.0. 012 Version: 1.0.5 13 13 Author: Martin Blaas 14 License: GPL-2.0+15 License URI: http://www.gnu.org/licenses/gpl-2.0.txt16 Text Domain: wp_virtualtour14 License: GPL-2.0+ 15 License URI: http://www.gnu.org/licenses/gpl-2.0.txt 16 Text Domain: wp_virtualtour 17 17 Domain Path: /languages 18 18 */
Note: See TracChangeset
for help on using the changeset viewer.