How can I trigger a javascript Facebook authentication dialog box on an anchor tag? - ajax

I have a simple rating system that logged in users can just click and it updates asynchronously.
However, I still want non-logged in users to see the rating mechanism (let's say a simple "up" arrow) but trigger the Facebook authentication popup when they click the link.
Can you help? I have the regular fb:login button working just fine. But how can I trigger this action on a regular anchor tag (in addition to the fb:login button).

You need to call the FB.login method
https://developers.facebook.com/docs/reference/javascript/FB.login/
You can bind this to the button click for non logged in users, on the callback you can register the original rating action or refresh the page.

Related

Intercepting external redirections with Cypress

Here is my test scenario:
The user opens a page in my application, fills in some details in a form, and then clicks the button in the form.
A third-party library triggers a redirect to an external website to validate some information. After the validation is complete (this validation takes place in a single page), the script on the external site redirects the user back to my application with a custom URL.
I know that what I described above is similar to an oauth flow, but for something different.
So I know that it is not possible to test external websites with Cypress. As a workaround, I am thinking of intercepting the redirect that is triggered by the button click and manually processing the external site with cy.request. But I am getting nowhere with intercepting the redirect after the button click event. How can I use cy.intercept to get the URL that is requested after the button is clicked?
The second question is that the page I will be working on with 'cy.request' redirects to my app with a custom URL. So I need to intercept this redirect as well to continue testing with the relevant page in my app.

How do I edit through inspect element, but when I click on submit it won't make any changes?

When I open the website I need to fill in the form. I already disabled some field from editing, so the user is not able to change the information on the form. However, the user can still right-click and update through the inspect element and when the user clicks submit, the data will be submitted and updated. So now what I want to do is, even after the user edit through the inspect element, but when the user clicks on submit, the data won't pass through and there will be no changes. In order to do this, what do I change in the coding? These are the attachments of the merchant request form and the merchant controller.
MerchantRequest
MerchantController

Can outlook web add-in entry page(taskpaneurl) know which task pane button triggers the visit?

My add-in has multiple drop down items when you click the add-in button.
All of them will navigate you to the same log-in page.
But after log in, the app needs to know to which subsequent page the user need to be redirected to.
For example, when I click the "play" button in the drop down, after log in I will be redirected to the play.html. And "study" will be to the study.html.
If the log in page(taskpaneurl) has no such knowledge, I need to have multiple log in page tided to different subsequent pages.
The add-in platform doesn't provide an API for this, but you can do this by providing a query string in your url.

Binding Form Data on Browser Back Spring MVC

I'm Developing a application using Spring MVC + Hibernate. So It have a function that have a confirmation screen before complete the task.
In here After submit the main input form it creates a form submit. Then it redirect to confirmation screen and ask for users to review it. after reviewing user can proceed it for last step.
If user want to change values then i put a back button on confirmation.
back button manually and bind all the data and redirect it to first page. It is working.
But i want to know how to bind the data back to first form when user press browser back button ?
Sorry about my poor English.

Implementing a login/logout system

i have a problem with a WP7 app. I want that a user can login into the application, doing some stuff and logout.
Now, then a new user get the phone, it should not be possible to get into the session of the old user (by simply pressing back until the user see the intern data of the previous user who was logged in).
how to make this?
The best thing would be, that when a user press the back button, it will be forwared to the first page of the app. the problem then is, that there will be a loop and the app will not pass the certification because it will not be possible to exit it.
Here is an overview:
loginPage (no return just exiting the app) -> internPage (possibility to logout and return to loginPage)
You can clear the back stack using NavigationService.RemoveBackEntry:
while (this.NavigationService.BackStack.Any())
{
this.NavigationService.RemoveBackEntry();
}
Put this in the OnNavigatedTo of your LoginPage, so pressing back on this page will exit the application. If the LoginPage is the first page the user sees when launching the app (and therefore is the application main page), it should pass certification.
try the nonlinearnavigationservice that way back will unwind your history properly an you back out of the mainpage it will exit your app correctly.
http://create.msdn.com/en-US/education/catalog/article/nln-serv-wp7
why not have the mainpage show the icons for the different users, and a click onto the user would ask for their password?
You cannot change the navigation flow of your application so that the back-button takes you to the first page. This will result in you failing the marketplace certification.
What you could do is handle the application lifecycle events, when the user leaves your application, then navigates back to it via the back-button you application is re-started either from a dormant or tombstoned state.
You can read about the lifecycle here:
http://www.scottlogic.co.uk/blog/colin/2011/10/a-windows-phone-7-1-mango-mvvm-tombstoning-example/
You need to add logic into the Activated event. At this point you could display a logic Popup that ensures the user has to re-enter their credentials to continue using the application.
The best way is to create separate view like UserControl and then show it as Popup when you need user to log in.
This is the way recommended by Microsoft also, and zou won't be having this navigation problems.
Something like this:
enter link description here

Resources