How can I track a button click from a different UI? - javascript

I'm sorry if this question isn't framed the way it should, I have trouble wording out my problem.
Is it possible to see which button the user clicked, if the button was on a different UI?
I have a GSP page that is displaying a Jenkins Blue Ocean to monitor a pipeline. I want to track if the user has pressed any pause or abort buttons, but because the Jenkins Blue Ocean isn't part of my page, I can't send anything to my controller.
Would there be any work arounds or methods to track something like this?
Thank you!

Related

JavaScript (background and sound change to all pages) help needed

For my final project for a course I want to make some kind of minimalistic, meditation/relaxation website but I'm struggling with coding the JS functions. I'll try to explain the steps for what I want to do:
The page starts out with a white background.
Text fades in. (i.e. "Welcome")
When a key is pressed or the screen is tapped on mobile, the previous text fades out and another text fades in, but still on the same page.
Another text later, with options below for the background. When an option is clicked, the background changes and again, the text fades out.
Same as #4, but with background music.
Then there are 3 routes to go to (so different pages), the codes for those are simple so I don't need a lot of help, but how do I make them so that the background image and the sound that the user has chosen, carries on?
Is this completely doable with only JavaScript?
Should I incorporate Flask in my program (i.e. HTML layout/template?)
I'm really lost :( Does anyone know which functions I could use? Help will be appreciated!
Yes you could achieve this result by using only javascript
You can send the user's selected background and music through query parameters and access them with url in your javascript of other pages.

When the users are on the same webpage, is it possible that one user has clicked on a button and that will notify all other users?

Just like the title says. I want to create a shared online timer for my friends and say when one of my friends clicked the "refresh timer" button, ideally that all my other friends' page should get automatically refreshed with the new timer, or a notification saying that the timer has refreshed and require them to refresh the page.
I think at least the latter one is possible since when you get a comment of your question on Stackoverflow, you will get notified somewhere in the page telling you there's a new comment.
How to achieve this functionality? In JS or? Thanks in advance!
Javascript setInterval
using Javascript setInterval when the page is loaded, if you're not using MySQL, check a notepad for the text update(or whatever you want) and when it's found, clear it and then run whatever code
When the user presses a button, have it write to the file update(the same thing as above)
There would be 2 ways to go about it:
Simpler one would be to use polling through setInterval and look for changes on the backend.
A more accurate way would be to use Websockets which relay information to the clients that the timer has been reset.
Your choice of tool would depend on how complex you're willing to let it be

Best way to do navigation in a hybrid Cordova Application

I have some doubts about my project, I am making a small hybrid app, so far everything I am doing without PhoneGap, directly with PHP, HTML5, CSS3 and JavaScript on my local server. Then I will use PhoneGap to turn my project into an application.
In my application there is a navbar with 3 tabs, my question is about the second tab, I explain how I imagine the structure should be:
When the user clicks on the second tab for the first time, the user should see a list, such as a menu of options:
Option A
Option B
Option C
When clicking on any of those options on the same screen (tab 2) should change the "view" and display the suboptions of the chosen option, the structure is the following. For example, if you choose "Option A", you will see something like this:
Photo1
Name1
Link1
Photo2
First Name2
Link2
...
PhotoN
NameN
LinkN
I guess it would be great to do "pagination" since it is likely that each option has many suboptions and I do not want to saturate the memory.
Finally, when clicking on some of the Links, we will assume "Link1", in the same tab 2 I would like to see all the complete information about that element in the list. Obviously all that information is in a database. My question is:
What is the best way to do the navigation of the interface I just raised?
I was thinking of making a "container" div on tab 2 and changing its DOM, but then I wonder how I will manage the "back" action - ie the "return" action and obviously the user will think he/she can return by pressing the Back button (in case of Android).
I must clarify that I am not using any framework like ionic, react or angular. ALl is from scratch, the only thing I use is jQuery.
Thanks for reading and please forgive my horrible way to write english.

Hide and show forms after press a button HTML?

I'm creating a kind of calculator of economic status, using two separated forms in the same web page, but hiding the second one.
What I need is a way to do this, how to "move" the first form away of screen and show the second one after pressing a button and also show the results in the same way. Honestly I have no idea of how to search for that so I ended here.
Also, what would you recomend me to use with this, only Javascript? thaking in mind that there is no users or any kind of storage besides the data obteined from the form.
I would use angularJS (ngShow ngHide) or use a new state

Alert Box Methods

I just need a little advice on what may be the best method for handling my situation.
I'm in need of placing three buttons in the sidebar of the website I maintain. The website is massive and hard to handle. Currently, it's all HTML files (there are over 10,000 of them believe it or not). We're transitioning to a database website so I don't want to make any sweeping changes that are site-wide, as they may just be scrapped in our re-design process in coming months.
However, these buttons are for an application process. When you click on them, an alert box will need to pop up to give you a bit of information and they either allow you to cancel the action or proceed. The buttons are currently located in the left nav which is included on every page of the website.
Would it be possible to accomplish this using JS or jQuery? I'd be unable to easily add scripts into the tags on all of the applicable pages, but I'd like to avoid the browser driven "http://www...Says: blah blah" message if possible. Any insight is greatly appreciated! Thank you!
Check out the jQueryUI dialog examples, particularly the modal boxes, although you will have to add the script to every page.

Categories

Resources