diff --git a/package-lock.json b/package-lock.json index 8b91062..8a34fe7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8669,6 +8669,12 @@ "integrity": "sha512-vLLoY452L+JBpALMP5UHum9+7nzR9PeIBCghU9ZtJ1eWm6ieUI8Zb/DI3MYxH32bxkjzYV1LRjNv4qr8d+uX/w==", "dev": true }, + "vue-slider-component": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/vue-slider-component/-/vue-slider-component-2.8.1.tgz", + "integrity": "sha512-iAHCwGF448KCE1dUrs0OuMzUvl1q87ZYptE2krgi+ka2ZDZg12jq/S38k/XuFZXAb4OW9AGWqnlkzvvnG+JsPQ==", + "dev": true + }, "vue-style-loader": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/vue-style-loader/-/vue-style-loader-3.1.2.tgz", diff --git a/package.json b/package.json index 55d6e33..2552862 100644 --- a/package.json +++ b/package.json @@ -25,9 +25,19 @@ }, "devDependencies": { "@branu-jp/v-drag": "0.0.10", + "babel-core": "^6.26.0", + "babel-loader": "^7.1.2", + "babel-polyfill": "^6.26.0", + "babel-preset-env": "^1.6.0", + "babel-preset-stage-3": "^6.24.1", + "cross-env": "^5.0.5", + "css-loader": "^0.28.7", "debounce": "^1.1.0", "event-emitter-es6": "^1.1.5", + "file-loader": "^1.1.4", + "node-sass": "^4.5.3", "query-parse": "^2.0.0", + "sass-loader": "^6.0.6", "three": "^0.89.0", "three-orbit-controls": "^82.1.0", "three.meshline": "^1.0.3", @@ -36,21 +46,12 @@ "vue-color": "^2.4.3", "vue-dragging": "^1.0.8", "vue-json-tree-view": "^2.1.3", + "vue-loader": "^13.0.5", "vue-material": "^1.0.0-beta-10.2", "vue-router": "^3.0.1", - "vuex": "^3.0.1", - "babel-core": "^6.26.0", - "babel-loader": "^7.1.2", - "babel-polyfill": "^6.26.0", - "babel-preset-env": "^1.6.0", - "babel-preset-stage-3": "^6.24.1", - "cross-env": "^5.0.5", - "css-loader": "^0.28.7", - "file-loader": "^1.1.4", - "node-sass": "^4.5.3", - "sass-loader": "^6.0.6", - "vue-loader": "^13.0.5", + "vue-slider-component": "^2.8.1", "vue-template-compiler": "^2.4.4", + "vuex": "^3.0.1", "webpack": "^3.6.0", "webpack-dev-server": "^2.9.1" }, diff --git a/speckle-plugin-manifest.json b/speckle-plugin-manifest.json index 825852d..b041417 100644 --- a/speckle-plugin-manifest.json +++ b/speckle-plugin-manifest.json @@ -1,6 +1,6 @@ { "name": "Speckle Viewer", - "version":"0.1.12", + "version":"0.2.0", "desc": "This plugins allows you to view streams in your browser, amongst other things.", "serveFrom": "/view", "author": "Speckle Project Contributors", diff --git a/src/App.vue b/src/App.vue index 6246986..af1829c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -15,14 +15,13 @@ - +
- - - {{ showAccounts ? "close" : "menu"}} + + + {{ showAccounts ? "arrow_left" : "menu"}} - Menu add @@ -36,7 +35,6 @@ list Show details for selected objects -

{{selectedObjects ? selectedObjects.hash : ''}}

@@ -65,8 +63,8 @@
- - + + @@ -124,7 +122,7 @@ export default { showAddStreamDialog: false, addStreamString: null, showStreamList: false, - showAccounts: false, + showAccounts: true, showViewSelect: false, showSettings: false, showObjectDetails: false, @@ -134,42 +132,40 @@ export default { progressMessage: 'All is ready.' } }, + computed: { + isMobileView( ) { + return /Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test( navigator.userAgent ) && window.innerWidth < 768 + }, + isIOS( ) { + return ( typeof window.orientation !== "undefined" ) && ( navigator.userAgent.indexOf( 'OS X' ) !== -1 ) + }, + receivers( ) { + return this.$store.getters.allReceivers + }, + objects( ) { + return this.$store.getters.allObjects + }, + selectedObjects( ) { + return this.$store.getters.selectedObjects + } + }, methods: { zoomExt( ) { if ( !this.selectedObjects ) - bus.$emit( 'zext' ) + bus.$emit( 'r-zoom-ext' ) else - bus.$emit( 'zoomToObject' ) + bus.$emit( 'r-zoom-to-object' ) }, + zoomToObject( ) { - bus.$emit( 'zoomToObject' ) - }, - createReceivers( ) { - if ( this.receiversCreated ) return - if ( this.$store.state.initStreams.length != 0 ) { - let receivers = this.$store.state.initStreams - .filter( id => id != "" ) - .map( id => { - return { - serverUrl: this.$store.state.server, - streamId: id, - token: this.$store.getters.user.apitoken, - objects: [ ], - layers: [ ], - history: [ ], - name: 'Loading ' + id + '...', - layerMaterials: [ ] - } - } ) - this.$store.commit( 'ADD_RECEIVERS', { receivers } ) - } + bus.$emit( 'r-zoom-to-object' ) }, + addReceiver( streamId ) { - if ( !streamId ) { - this.snackbarMessage = 'Invalid streamId' + if ( !streamId || streamId === '' ) { + this.snackbarMessage = 'Invalid streamId.' return this.showSnackbar = true } - console.log( 'Adding a receiver', streamId ) if ( this.$store.getters.receiverById( streamId ) ) { this.snackbarMessage = 'That stream is already loaded' return this.showSnackbar = true @@ -180,20 +176,33 @@ export default { token: this.$store.getters.user.apitoken, objects: [ ], layers: [ ], - history: [ ], - name: 'Loading ' + streamId + '...', - layerMaterials: [ ] + children: [ ], + parent: null, + createdAt: null, + updatedAt: null, + baseProperties: { + units: null + }, + owner: { + name: null, + surname: null, + }, + comments: null, + name: 'Loading ' + streamId + '...' } this.$store.commit( 'ADD_RECEIVER', { receiver } ) }, + saveSettings( settings ) { window.localStorage.setItem( 'viewerSettings', JSON.stringify( settings ) ) this.$store.commit( 'SET_VIEWER_SETTINGS', { settings } ) }, + snackbarUpdate( message ) { this.snackbarMessage = message this.showSnackbar = true }, + toggleObjectDetails( ) { if ( !this.selectedObjects ) { return this.snackbarUpdate( "No objects selected" ) @@ -203,44 +212,22 @@ export default { } }, created( ) { - this.createReceivers( ) - if ( window.localStorage.getItem( 'viewerSettings' ) !== null ) { this.$store.commit( 'SET_VIEWER_SETTINGS', { settings: JSON.parse( window.localStorage.getItem( 'viewerSettings' ) ) } ) } + this.viewerSettings = this.$store.getters.viewerSettings - }, - computed: { - searchobjects( ) { - let objects = this.$store.getters.allObjects - if ( objects.length === 0 ) return [ ] - let objectIds = objects.map( ( obj ) => { - return obj.type + ' ' + obj._id - } ) - return objectIds - }, - isMobileView( ) { - return /Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Kindle|Silk|Opera Mini/i.test( navigator.userAgent ) && window.innerWidth < 768 - }, - isIOS ( ) { - return (typeof window.orientation !== "undefined") && (navigator.userAgent.indexOf('OS X') !== -1) - }, - receivers( ) { - return this.$store.getters.allReceivers - }, - objects( ) { - return this.$store.getters.allObjects - }, - selectedObjects( ) { - return this.$store.getters.selectedObjects - } - }, - mounted( ) { + + this.$store.state.initStreams.forEach( streamId => { + this.addReceiver( streamId ) + } ) + bus.$on( 'snackbar-update', this.snackbarUpdate ) bus.$on( 'stream-load-progress', message => { this.progressMessage = message } ) - } + }, + mounted( ) {} } @@ -250,14 +237,6 @@ export default { border: 1px solid rgba(#000, .12); } -.view-field { - width: auto; -} - -.md-menu-content { - max-height: none; -} - #app { position: fixed; top: 0; @@ -266,6 +245,16 @@ export default { height: 100%; } -#main {} +.no-shadow { + box-shadow: none !important; +} + +.no-margin { + margin: 0 !important; +} + +.md-card.md-with-hover { + cursor: default; +} diff --git a/src/components/Controller.vue b/src/components/Controller.vue index ef3d1af..29db97a 100644 --- a/src/components/Controller.vue +++ b/src/components/Controller.vue @@ -1,59 +1,65 @@ - + diff --git a/src/components/LoginScreen.vue b/src/components/LoginScreen.vue index 376ea52..5cae593 100644 --- a/src/components/LoginScreen.vue +++ b/src/components/LoginScreen.vue @@ -12,10 +12,6 @@ Login - - Continue as guest - You will not be allowed to comment or edit. -