UWP RichEditBox Text with Inline Rich Objects - facebook

I am working on a UWP app and I'm basically trying to do exactly what Facebook does with their app when composing a post.
Basically I want to be able to type text and At Mention someone in the RichEditBox. The person's name should be highlighted and when I tap on it I should be able to invoke a Command in my view model. Also once I hit send, I need to parse out what is text and what's a link to a person's account. I've played around a lot with the RichEditBox but can't quite figure this out.
Does anyone have any hints or ideas? I'm thinking I'll have to keep track of my object's position on every keystroke, just wondering if there's a cleaner way to do it.

You could use the RichTextBox.Document.Selection.Link property to store a custom link to your entity (ex: "mention://JohnDoe")
https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.text.itextrange.link.aspx

Related

Visual Basic - Button on website doesnt have an ID

I'm trying to build a application which logs you into instagram. I've got it to input the username + password no problem
However, when i go to get the ID for the submit button their isnt one.. and i've been using .GetElementById. Is their anyway around this?
I'm pretty new to visual basic so please dumb it down to simpleton terms!
Thank you in advance!
Getting elements by ID is not the only solution. You can always get them by it's names or you can find the element by yourself. Just look at the whole page's source code, search for something spesific that button carries and invoke it. Visual basic's library can be insufficient for situations like that.
WebBrowser1.Document.GetElementById("username").InvokeMember("select")
WebBrowser1.Document.ActiveElement.Focus()
SendKeys.Send("{ENTER}")
This is the code that works! Change the "username" ID to the form you will be changing, then it focuses onto it and presses enter! Simulating the submit button.

confluence display content by user

I am trying to get specific content on a confluence cloud wiki to display content based on a specific user. The scenario here is that there are links on a page but only 1 should display, the one that displays is based on whom ever is logged in.
I have been told how a macro is the way forward, but I have read the documentation and I am at a loss. I do not understand what I have to do or how to write a confluence macro. could someone help me out with either an example or some links? I have searched like crazy, but maybe i am not asking the right questions but hopfully you can all help me out?
There's a plugin for this:
https://marketplace.atlassian.com/plugins/net.customware.confluence.plugin.visibility
But I'm not sure how thoroughly it hides the content. It might still be visible if users view the page source. If you're trying to hide content which needs to be really protected, you'll probably need to do something else.
Depending on how many users are going to be using the page, you could also just make separate spaces for them, add the permissions to those spaces, and then use a page-include on your "main" page to display the content. If they don't have access it shouldn't show up. You might experience some formatting issues with that solution, however.
Finally, you could grab the username with jquery and display stuff based on that. This solution will be pretty easy if you are familiar with javascript/jquery.
Edit: Here are some helpful resources on how to use javascript and jquery within confluence:
https://confluence.atlassian.com/display/CONFKB/How+to+Use+JavaScript+in+Confluence
https://developer.atlassian.com/confdev/confluence-plugin-guide/writing-confluence-plugins/including-javascript-and-css-resources

Auto form filling

I have a requirement like I need to fill an online form automatically. (Auto form filling).
Means I need to create an application in which clicking on the "Auto fill” button it will open the form in browser (form is another website page) and fill the data automatically.
The data (which may change each time) I will supply from my application. So first I thought of implementing the functionality using iMacro.
But later I realized I can’t call this imacro from an application if it is free version. So please suggest me some idea to achieve this functionality.
Thanks.
as far as i under stand your problem i would say try sikuli ..it just a simple you can say a compiler and a language which uses image recognition and you can make autobot through this and a very easy to learn ..

GWT, programmatically get the same effect of a hyperlink

So some background, I am working in GWT, using MVP and activities and places. So I have all my stuff working with hyperlinks, and places are changing. I am also using a PlaceController.gotTo(Place).
Now what I want to do is be able to send the person to another place but programatically. Right now with the setup GWT manages the converting of the url into a place, and then fires the activities from that, but what I would like, is to either convert a url to a place, using the same way gwt does it or change the url, and fire a history changed type of effect onto the site.
What I don't need is an anchor to reload my whole site, I just want to feed a string into something and get the whole place change situation moving.
I want the effect of a hyperlink.
I'm not sure I understand exactly what you're trying to do, but PlaceHistoryMapper is the only tool that GWT uses: feed a String to getPlace and it gives your the corresponding place. Alternately, you could use History.newItem (note that contrary to PlaceController#goTo, if the user cancels the PlaceChangeRequestEvent, the URL would have already changed).

How did twitter implement new autocomplete feature in iPhone app?

Twitter has an awesome new way to enter "#" and "#" in the latest iPhone app.
http://blog.twitter.com/2011/03/twitter-for-iphone-ipad-even-better.html
When you type "#" or "#" and then type characters it instantly starts to autocomplete in a table below. How are they doing this? It feels native, but is it?
If it's native, how did they do it? UITextView with an active UITableView? It's really fast and smooth, so I'm guessing they load the phone with trending #'s and your #'s and it's fast because the data is local (it goes to just typing if it's not there).
But I'm wondering if there was a way to achieve this affect with data that is remote on a webserver using async calls.
Any thoughts on how to do this / get started?
If by 'native' you mean, build into the SDK, then I have to disappoint you, this is not a build-in SDK feature (there is something similar with the UISearchController/UISearchBar classes, but that's not what Twitter is leveraging).
This however, does not mean that you cannot build it yourself. I believe it would be quite simple. All you would have to do is monitor every time the user inputs text into the UITextView (this can easily be done using the UITextView delegate methods). You do a check on all the text, and if the user enters an '#' or a '#', or any other symbol you want to watch for, you create/show a UITableView beneath the text view (or wherever you want it).
As for the table view's datasource, it would have to be based on information you gather through search. When Twitter shows you a list of trending tags, etc. I would think it is something they have pulled down when you synced your feed, and then cached somewhere. If you were using a web server, you could do the same. When the user starts entering specific text, you could do a search on the server. If you do the network requests asynchronously, you can display a UIActivityIndicator in the table view, until you've gotten a response from the server. If the user enters more text before the server has 'replied' to you, simply cancel the old server request, and start a new one.
I haven't implemented something like this myself, and I have no knowledge of how it would perform in real-life, but if I was to implement something similar off the top of my head, this would be the aproach I would pursue. It might not suit your case perfectly, but hopefully, it will have given you some inspiration :)