Hello and thanks for taking time to read this,
we developing an App with Autodesk Forge for displaying informations related to some specific components. In this context we disabled and unloaded a few Extensions which are preLoaded by the Forge Viewer. Which is similar to this StackOverflow -- Unload Forge Extensions.
We also want to unload the 'Autodesk.FullScreen' und purpose of our Users. https://forge.autodesk.com/en/docs/viewer/v7/reference/Extensions/FullScreenExtension/
Following i added the Code we tried in Console of the Browser with the provided result:
First we let us show the loaded extensions:
NOP_VIEWER.getLoadedExtensions()
{Autodesk.BIM360.Minimap: l, BasicExtension: U, Autodesk.ViewCubeUi: Y, Autodesk.CompGeom: l, Autodesk.LayerManager: P, …}
Autodesk.BIM360.Minimap: l {viewer: C, globalManager: e, setGlobalManager: ƒ, onSetGlobalManager: ƒ, getWindow: ƒ, …}
Autodesk.BoxSelection: r {viewer: C, globalManager: e, setGlobalManager: ƒ, onSetGlobalManager: ƒ, getWindow: ƒ, …}
Autodesk.CompGeom: l {viewer: C, globalManager: e, setGlobalManager: ƒ, onSetGlobalManager: ƒ, getWindow: ƒ, …}
Autodesk.LayerManager: P {viewer: C, globalManager: e, setGlobalManager: ƒ, onSetGlobalManager: ƒ, getWindow: ƒ, …}
Autodesk.Measure: Pe {viewer: C, globalManager: e, setGlobalManager: ƒ, onSetGlobalManager: ƒ, getWindow: ƒ, …}
Autodesk.Section: _ {viewer: C, globalManager: e, setGlobalManager: ƒ, onSetGlobalManager: ƒ, getWindow: ƒ, …}
Autodesk.Snapping: c {viewer: C, globalManager: e, setGlobalManager: ƒ, onSetGlobalManager: ƒ, getWindow: ƒ, …}
Autodesk.ViewCubeUi: Y {viewer: C, globalManager: e, setGlobalManager: ƒ, onSetGlobalManager: ƒ, getWindow: ƒ, …}
BasicExtension: U {viewer: C, extOptions: {…}, eventArgsTypeMap: {…}, eventStreams: Array(10), events: Array(10), …}
[[Prototype]]: Object
Here we don't the the Autodesk.FullScreen Extensions which is a bit strange. Because it is definitly in the Toolbar and useable as you can see on the attached Image in the end of this Post...
Optimistic as we are we try to unload it:
NOP_VIEWER.unloadExtension('Autodesk.FullScreen')
false
As expected we getting a false... But nevermind to be sure we check if its loaded:
NOP_VIEWER.getExtension('Autodesk.FullScreen')
null
As expected we getting a null back. But the Extension is still there and working?
So what is the difference here to the other Extensions? Is it as designed? If it so, than the Documentation is missleading here. Maybe someone has a idea? Fun Fact you can see the same behaviour regarding to the 'Autodesk.ViewerSettings' Extension Autodesk Forge - Autodesk.ViewerSettings Extension
Showing Taskbar with Extensions
Is there something different about this Extension? Can it be unloaded or is it in another Context and the complete Toolbar needs to be removed? Maybe to mention that the Button is unloaded on a Mobile Device by default. So there must be some working mechanism to unload it.
Take a look at this post which describes how to remove toolbar buttons and when : When to remove toolbar buttons
You can intercept the TOOLBAR_CREATED_EVENT and remove the related control.
Related
I'm calling window.ethereum and there are all these functions but it's confusing what they accept and the types. My understanding is that MetaMask injects something into window.ethereum... so I assume all the methods are from MetaMask? If so, are all the methods different for Coinbase wallet then?
Where are the docs for window.ethereum?
Are there any types associated with this?
My console when I console.log(window.ethereum);
coinbase - window.ethereum
w {_events: {…}, _eventsCount: 4, _maxListeners: undefined, _filterPolyfill: e.FilterPolyfill, _subscriptionManager: e.SubscriptionManager, …}
close: ƒ ()
enable: ƒ ()
genericRequest: ƒ ()
getChainId: ƒ ()
hasMadeFirstChainChangedEmission: false
isCoinbaseWallet: true
request: ƒ ()
scanQRCode: ƒ ()
send: ƒ ()
sendAsync: ƒ ()
setAppInfo: ƒ ()
setProviderInfo: ƒ ()
updateProviderInfo: ƒ ()
_addresses: ['0xmyAddress']
_eventListener: undefined
_events: {chainChanged: Array(2), accountsChanged: Array(2), connect: ƒ, message: ƒ}
_eventsCount: 4
_filterPolyfill: e.FilterPolyfill {logFilters: Map(0), blockFilters: Set(0), pendingTransactionFilters: Set(0), cursors: Map(0), timeouts: Map(0), …}
_jsonRpcUrlFromOpts: "https://mainnet-infura.wallet.coinbase.com"
_maxListeners: undefined
_overrideIsMetaMask: false
_relay: S {appName: 'localhost:3000', appLogoUrl: 'http://localhost:3000/favicon.ico', subscriptions: t, accountsCallback: ƒ, chainCallback: ƒ, …}
_relayEventManager: e.WalletSDKRelayEventManager {_nextRequestId: 0, callbacks: Map(0)}
_relayProvider: async ƒ I()
_send: ƒ ()
_sendAsync: ƒ ()
_setAddresses: ƒ ()
_storage: e.ScopedLocalStorage {scope: '-walletlink:https://www.walletlink.org'}
_subscriptionManager: e.SubscriptionManager {events: o, subscriptionMiddleware: ƒ}
chainId: (...)
connected: (...)
host: (...)
isChainOverridden: (...)
isMetaMask: (...)
isWalletLink: (...)
jsonRpcUrl: (...)
networkVersion: (...)
selectedAddress: (...)
[[Prototype]]: o
For example:
I can't find setProviderInfo in the Ethereum docs
I can't find setProviderInfo in the Metamask docs either
Just to show I'm not lazy... Coinbase wallet docs are here
window.ethereum is described in EIP-1193.
EIP-1193 specification.
I am following the learning ClojurScript book from Packt, and I am a little lost on something. I have a project.clj file with the following configuration
(defproject piggieback_project "0.5.2"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.10.3"]
[org.clojure/clojurescript "1.10.879"]
[weasel "0.7.1" :exclusions
[org.clojure/clojurescript]]]
:profiles {:dev {:dependencies [[cider/piggieback "0.5.2"]
[org.clojure/tools.nrepl"0.2.10"]]
:repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}}})
I am able to run lein repl
and get a repl
I then run the following with this result
Clojure 1.10.3
OpenJDK 64-Bit Server VM 1.8.0_302-b08
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=> (require 'cljs.build.api)
nil
user=> (cljs.build.api/build "src"
#_=> {:main 'piggieback-project.core
#_=> :output-to "out/main.js"
#_=> :verbose true})
Options passed to ClojureScript compiler: {:output-dir "out", :closure-warnings {:check-types :off, :check-variables :off}, :closure-defines {}, :ups-libs nil, :cache-analysis true, :closure-module-roots [], :optimizations :none, :ups-foreign-libs [], :verbose true, :aot-cache false, :preloads [process.env], :ignore-js-module-exts [".css"], :output-to "out/main.js", :preamble ["cljs/imul.js"], :ups-externs nil, :opts-cache "cljsc_opts.edn", :source-map true, :cache-analysis-format :transit, :main piggieback-project.core, :language-in :es6, :emit-constants nil}
Unexpected error compiling at (REPL:1).
Could not write JavaScript nil
user=> (require 'weasel.repl.websocket)
user=> (cider.piggieback/cljs-repl
#_=> (weasel.repl.websocket/repl-env :ip "0.0.0.0" :port
#_=> 9001))
<< started Weasel server on ws://0.0.0.0:9001 >>
<< waiting for client to connect ...
This is correct according to the book as to my result. But The next step is to open up my html file at the root which looks like this
<html>
<body>
<script type="text/javascript" src="out/main.js"></script>
</body>
</html>
and in my src directory I have a core.clj file with the following
(ns piggieback-project.core
(:require [weasel.repl :as repl]))
(when-not (repl/alive?)
(repl/connect "ws://localhost:9001"))
When I open the html file it's supposed to connect to the weasel websocket server and give me a user repl but it does not.
I am brand new to Clojurscript, So any help here at all would be great thanks
Your core.clj file should be named core.cljs! (Full path from the project root: src/piggieback_project/core.cljs.)
P.S. Remove the incomplete "out" directory before you try again, to give the compiler a fresh start.
After a request to a symfony API platform they return me properties like this:
#context: "/api/contexts/User"
#id: "/api/users"
#type: "hydra:Collection"
hydra:member: Array(2)
0: "Création de compte enregistrée."
1: {#id: "/api/users/3", #type: "User", id: 3, email: "*******#outlook.com", firstname: "******", …}
length: 2
__proto__: Array(0)
hydra:totalItems: 2
__proto__: Object
But I can't access to the hydra: member properties from react JavaScript.
You can access object properties with symbols like this: object['hydra:member']. Same thing with #id, #type.
I am building an API documentation, I`m new to programming in general and this is the first time I work in Swagger.
This is my code:
/stareMesaj:
post:
tags:
- Metode disponibile
summary: Stare mesaj
description: Call de verificat stare mesaj. More soon.
operationId: stareMesaj
responses:
'200':
description: Ultimele 60 zile - Nu aveti drept de interogare stare pentru mesaj
headers:
X-Rate-Limit:
description: calls per hour allowed by the user
schema:
type: integer
format: int32
X-Expires-After:
$ref: '#/components/headers/ExpiresAfter'
content:
application/json:
schema:
type: string
examples:
response:
value: Hello world!
application/xml:
schema:
type: string
text/csv:
schema:
type: string
On the responses tag I get the following error:
Structural error at paths./stareMesaj.post.responses
should only have three-digit status codes, `default`, and vendor extensions (`x-*`) as properties
Jump to line 395
I don't know what to do. I googled the error but can't find it. What is the problem here?
I'm integrating a 3rd party API, and at one step they post JSON data into our server.
The content type they are sending is application/json, but the payload is actually gzipped, is this valid? I believe it should be gzip/json content type.
Update 1
the env["RAW_POST_DATA"] contains binary data, rather than JSON in text format that I would expect.
Update 2
This is a fairly standard Rails application, hosted on heroku with Puma for staging and production.
Update 3
I've not debugged at this level on heroku previously, so it's possible that I'm missing something, but I do not see a content-encoding header (I did miss the "HTTP_CONTENT_ENCODING"=>"gzip" header). The headers that I do get are:
2015-12-04T08:00:08.001620+00:00 app[web.1]: D, [2015-12-04T08:00:08.001590 #7] DEBUG -- : REQUEST_PATH: /
2015-12-04T08:00:08.001660+00:00 app[web.1]: D, [2015-12-04T08:00:08.001620 #7] DEBUG -- : REQUEST_URI: /
2015-12-04T08:00:08.001701+00:00 app[web.1]: D, [2015-12-04T08:00:08.001656 #7] DEBUG -- : HTTP_VERSION: HTTP/1.1
2015-12-04T08:00:08.001735+00:00 app[web.1]: D, [2015-12-04T08:00:08.001698 #7] DEBUG -- : HTTP_HOST: staging.redacted.com
2015-12-04T08:00:08.001768+00:00 app[web.1]: D, [2015-12-04T08:00:08.001732 #7] DEBUG -- : HTTP_CONNECTION: close
2015-12-04T08:00:08.001801+00:00 app[web.1]: D, [2015-12-04T08:00:08.001765 #7] DEBUG -- : HTTP_ACCEPT:
2015-12-04T08:00:08.001823+00:00 app[web.1]: D, [2015-12-04T08:00:08.001798 #7] DEBUG -- : CONTENT_LENGTH: 277
2015-12-04T08:00:08.001861+00:00 app[web.1]: D, [2015-12-04T08:00:08.001826 #7] DEBUG -- : CONTENT_TYPE: application/json
2015-12-04T08:00:08.001918+00:00 app[web.1]: D, [2015-12-04T08:00:08.001858 #7] DEBUG -- : HTTP_CACHE_CONTROL:
2015-12-04T08:00:08.001920+00:00 app[web.1]: D, [2015-12-04T08:00:08.001891 #7] DEBUG -- : HTTP_ORIGIN:
2015-12-04T08:00:08.001958+00:00 app[web.1]: D, [2015-12-04T08:00:08.001921 #7] DEBUG -- : HTTP_USER_AGENT: Apache-HttpClient/4.3.4 (java 1.5)
2015-12-04T08:00:08.001996+00:00 app[web.1]: D, [2015-12-04T08:00:08.001953 #7] DEBUG -- : HTTP_POSTMAN_TOKEN:
2015-12-04T08:00:08.002029+00:00 app[web.1]: D, [2015-12-04T08:00:08.001992 #7] DEBUG -- : HTTP_DNT:
2015-12-04T08:00:08.001801+00:00 app[web.1]: D, [2015-12-04T08:00:08.001765 #7] DEBUG -- : HTTP_CONTENT_ENCODING: gzip
2015-12-04T08:00:08.002074+00:00 app[web.1]: D, [2015-12-04T08:00:08.002027 #7] DEBUG -- : HTTP_ACCEPT_ENCODING: gzip,deflate
2015-12-04T08:00:08.002093+00:00 app[web.1]: D, [2015-12-04T08:00:08.002061 #7] DEBUG -- : HTTP_ACCEPT_LANGUAGE:
2015-12-04T08:00:08.002137+00:00 app[web.1]: D, [2015-12-04T08:00:08.002094 #7] DEBUG -- : HTTP_COOKIE:
And the raw post data prints out as:
2015-12-04T08:00:08.002165+00:00 app[web.1]: D, [2015-12-04T08:00:08.002128 #7] DEBUG -- : RAW_POST_DATA:
2015-12-04T08:00:08.002166+00:00 app[web.1]:
2015-12-04T08:00:08.002168+00:00 app[web.1]: ���_%���R�#�S%#�4ݶ��n���wg�4$Wz��9�/me�J���pоp Eٍ��!B�,N��#��k4g�
2015-12-04T08:00:08.002169+00:00 app[web.1]: -���*c�8�[�PK&DفR���LM�
2015-12-04T08:00:08.002169+00:00 app[web.1]: k=t#:?"'��Ip|�dpg��縼Ѻ|�u�cBC��Hly��*�ǯ'Meq�W�]N͛C�F
So the request body is gzipped, and the request carries "Content-Encoding: gzip". No surprises here. See RFC 7231 Section 3.1.2 Encoding for Compression or Integrity.