Is there DroneDeployApi listener on annotations changed? - dronedeploy

I am curious to know if there is an embedded listener on area annotations change/creation in the DroneDeploy API?
And if there is no such option, am I correct that the best catch would be to listen clicks on div.leaflet-marker-draggable?

There isn't currently a change listener for annotations. You won't be able to listen to clicks on the map because every app is inside an iframe and once you're app going to "testing" it will be loaded on a different domain and you won't be able to access anything from window.top.
Other developers have also hit this problem and have simply added a refresh button.

Related

Branch.io custom event count not increasing for quick links

I have created a quick link from https://dashboard.branch.io/quick-links. When the user opens the link and tries to register the account on our website, a custom event is triggered from server side (Java) using the branch http API.
I can see that event in the Liveview section of Branch.io dashboard. But, when I go to the quicks section, the count for my custom event column is always showing as 0.
Is there any specific Branch related parameter that I need to send from client side (browser) to server side while submitting the form, to let Branch know that the custom event should be linked to a specific link, so I can see the custom event count increasing for that link in quick links section.
Your custom event will not be attributed to your link click if you trigger the event on the server side.
You should trigger the custom event from the client side post registration. You can put this in the callback of your registration method. If you navigate away from the initial redirect to your webpage, make sure that page has the Branch Web SDK initialized, and that you have the _branch_match_id(found in the address bar of your redirect) appended to your web url. This _branch_match_id is what Branch uses to attribute the custom event to your link click.
https://docs.branch.io/pages/web/integrate/#track-events

WKWebView - replace web action

Inside my app, I'm using the WKWebView to display a website. My goal is, when user is pressing a button on this website, I want to stop an action linked to this event and replace it with my own, natively made (custom action outside the WKWebView). I've been trying to search for any solution to fetch mentioned event but unsuccessful. What more came to my mind, if there is a way to fetch a JavaScript in WKWebView, I have a possibility to add some JS script code to this site (not to delete the action I want to block). Thank you for any help.
First, do you have a permission to mess with this web site's behaviour? I assume you do, otherwise it is likely illegal.
Second, try using Safari Web Inspector with a device/simulator, and use the DOM tree and console tools to find out what is the HTML/javascript that is involved with this action on this site.
If you can't find what happens in HTML/JS yourself, feel free to post a new separate question on SO with your target URL, some HTML/JS code, and which link/action you want to replace. Tag the question with "javascript" and ask if it is possible to write some javascript to replace that particular action to some custom JS code.
Usually there are 2 types of actions: either it is something that provokes AJAX calls to a server API triggered by an event handler, or it is a plain HTML link that results in a web navigation. For both cases it is possible to write a JS script that overrides the action.
Finally, use WKUserScript to inject javascript into the page, and override the action. Use window.webkit.messageHandlers to send an event from your custom action to the app side. Use WKScriptMessageHandler to process the event in the Objective-C or Swift code.
See an example here: http://nshipster.com/wkwebkit/

Aurelia: Show Dialog State In URL

I have a simple Aurelia application that displays accounts. The default view is a list of accounts. There's also an account details view.
I'd to make the details view open in a modal/dialog over the top of the list view. However, I want the presence of the modal to show up as part of the URL.
I found it easy to use the aurelia-dialog plugin to display the details view, but can't figure out how to get the dialog's presence to show up in the URL.
Another option might be to throw out aurelia-dialog and use a child router to display the details view, then figure out how to make that show and hide as a modal.
And, of course, another possibility is that there's a better way that I just don't see yet.
Has anybody seen or created something like this?
One possibility that occurs to me would be to add the dialog's presence as a parameter to the current route and then call it. You could use the route like /account?dialog=true. Run some tests to ensure that the ?dialog=true still routes to the same page. Then, use that route to check whether that parameter is set and display or hide the dialog window. When you refresh the page, the dialog window should still be open/closed. This also means that whenever you open or close the dialog window, you need to send a new route to the router (basically same route but different parameter).
This isn't a detailed solution but might get you on the right path.

Make Web Browser control communicate with VB.NET Program

What I am looking for here is a way to possibly click a button inside a web browser control and have it call a sub from inside the program or have the program react to something on the page.
I am trying to make a HTML5 GUI for my application. I don't really want use any 3rd party API's to handle commands from a HTML5 interface but if I can find another alternative that would be good. But if there is no other way I would be content with using a 3rd party API.
The way I have done this in the past is to specify a special protocol for my app.
yourapp:somefunction/someparameter
Handle the Navigating event, and in your code for when that event is fired, check to see if the URL has your protocol on the front of it. If it is, set e.Cancel = true to cancel navigation, and add code to handle the URL parameters yoruself.

Synchronous state provider?

I'm creating a TabPanel component where the specific tabs are created/defined by user configuration.
So far, I've taken the approach of just using a stateful component to keep the users preferences of which tabs to show and been using the simple Ext.state.LocalStorageProvider to keep the users preferences.
But I actually ultimately want to store the user preferences/config in my database, so I created my own StateProvider that will store/load the prefs via AJAX calls.
The problem I've encountered is that my tab panel is loaded far sooner than the AJAX calls inside my StateProvider return, so what I need is some way to do a synchronous ajax call (which I know is morally wrong) or to somehow delay my tab panel from rendering until the preferences in my state provider are finished loading.
Anyone had a similar issue? It might be as simple as sleeping one thread for a while, but I know that's not nice either.
I think this is a bit old, but as I have found a similar problem...
Instead of sleeping, you can load the tab panel on the listener of your StateProvider ajax calls. So when your call returns, the tab will still not be loaded.