How can I add an alert popup with yes/no responses using Greasemonkey - greasemonkey

I am trying to create a script that will auto-popup with a window prompting agents to check to see if the ticket needs to be marked as a complaint, I can already create the function to mark it as a complaint but can't figure out how to get the yes/no option to appear.
Any Ideas?

Related

PowerApps Template - How to edit collections?

Hello Stack Community!
I'm currently in the process of adopting the Leave Request template for use in my organization. However, I've run into a few problems. I'm attempting to edit the already established collections in the app and am having a lot of trouble doing so. I've read the Patch article and I just can't figure out how to successfully use the Patch function to update the various collections I will need.
Some methods I've tried include editing the OnStart action in the Login Screen and this didn't work. I figured out how to edit the Company Holidays Collection via Excel on OneDrive. Essentially, I just need to edit one collection, the LeaveTypeCollection. I want to edit the options as well as the image (icon) available.
Can someone please give me a step-by-step guide on how to do so? I would be extremely grateful.
To update the LeaveTypeCollection, you can click on the Login Screen and then select the OnStart property in the formula dropdown and then expand the formula bar. You should be able to edit the values that you want to change or add a new leave type to the collection. You can then save and reopen the app and you should see the new leave types show up in the preview of an app.

telegram bot prefill text for user to edit

Telegram bot sends me a message with a text snippet, which I want to edit, and send back to the bot for further processing.
Copy and paste takes time. Typing message anew takes time.
Ideally I'd like to press an inline button "Edit" on the bot's message and get the message text appear in my reply input box for editing.(A message id attached to my reply somehow would be a plus).
I tried to use deep linking with parameters other than /start*, but that doesn't seem to work.
Can I use bot API (or any other telegram API) to have text ready for editing in my input box?
It's impossible in official apps yet. Your question is about working with drafts - there are no methods in both API to create them or clear.
Nevertheless, you could fork any official app stored on GiHub and implement what you need if you would prefer a hard way, but compared to that copy/past solution seems much more easier, isn't it?
UPD
I can offer to you a new idea how to solve your problem - hope it will be helpful.
This is about switch_inline_query_current_chat field of InlineKeyboardButton. Just attach an inline button to messages you need to edit. Set a text for this field gotten from recieved message and after pressing you will get this text to your input area. All seems good, but you will take bot's username before the text also.

Showing messages and errors to users, alternative to alert()

I'm working on a Chrome extension that'll need to display some messages to the users, be them instructions or errors. Right now the former are completely missing and errors are displayed in alert boxes.
We came up with this
alert(message); Not great, especially for instructions. Currently used.
chrome.notifications are not meant to be used this way: they appear off-center and disappear before the user may be done reading.
appending html content to the current tab, which we see as a last resort since we don't want to risk conflicts
Is there a better way to inform the user?
There is some other ways to do that, although none of them can be what you are looking for. Anyway, I'll share my solutions
1) Customizing default popup
You can append customized content to your popup window and let your users informed by setting the badge text:
chrome.browserAction.setBadgeText({text: "error"})
See https://developer.chrome.com/extensions/browserAction#method-setBadgeText
I think this is the best solution to show errors because your user won't be annoyed
2) Creating a new tab
To show instructions most extensions I used creates a new tab
chrome.tabs.create({url: "instructions.html"});
See https://developer.chrome.com/extensions/tabs#method-create
This occurs usually after the user installs the extension.
We ended up using humane.js to show messages on the page since it only required two small files, both of which have been "isolated" to avoid any possible CSS class clash with the existing content.
Still not ideal since I'd rather not having to add any elements/CSS to the page, but that's the best we got now.

Xpages dropdown menu resubmission on SSJS submission using submit value property

Just for reference before mentioning the problem I would like to say that I have asked to same question on IBM Lotus forum(http://www-10.lotus.com/ldd/ndseforum.nsf/xpTopicThread.xsp?documentId=2AD7C8F89D8930E685257BD50022A9E9) and I have not received any reply for the same in last 2 weeks.
So, I have a typical xpage dropdown menu with say around 40-50 leaf nodes, Every leaf node submits a specific value (using submitValue property) which is then evaluated and action is performed. However, the problem is that, after the action is performed if I try to refresh the page i get the browser notification for re-submission (I believe that it is some kind of programming error by me, however I don't know how to resolve it.)
One example to make it more clear:
I have a delete node inside the dropdown. It basically deletes the selected entries from the view(generated using repeat control) and then refreshes the view content. But at this point of time if I try to refresh the page then I get the notification of re-submission by the browser. If I accept it, then it tries to delete it again (which I prevent it but still this shouldn't happen) and if I don't accept it, it just doesn't refresh the page.
Any reply would be appreciated.
Thank you in advance. Hoping to hear some suggestions. (Please let me know if event he code is required)
I believe you need to implement the Post/Redirect/Get pattern to avoid re-posting on refresh.
Here's a solution by Tommy Valand for XPages for that pattern: http://dontpanic82.blogspot.dk/2010/06/xpages-avoid-saving-duplicate-documents.html

Web scraping from a Google Chrome extension

I've started to develop a Chrome extension to navigate and perform actions on a website. Until now the extension is able to receive a couple of parameters and check a set of radio-buttons, fill in a few inputs of a form and then submit it.
What I want to do now is to repeat the process, but I'm stuck when the page is reloaded. And I don't know how can I do to make the script react to the finish of the request.
The workflow I want to achieve is the following (is for automatically copying a certain object):
Popup side
Enter the number of the Master object to copy
Enter the base name of the copies (example Mod, so the I can iterate and add mod1, mod2, modn)
Enter the number of copies
Background side
Select master
Select standard options
Fill in inputs
Submit form
Wait for the page to complete the request and continue to the next copy. (here I need help)
The problem is on the repetition, the rest is taking care of. I assume that must be a way of dealing with requests. Any ideas?
By the way I'm doing it all with the extension and tabs methods of Google Chrome plus JavaScript and jQuery.
Ok, i´m going to answer the question myself based on Matthew Getner´s comment. The chrome.webRequest.onCompleted was the solution to the problem. With this method I was able to wait for the request to be completed and start over with the process. And with the messegaes methods I´ve achieved the comunication between the background and the extension itself. So I finally was able to filled a form, send it, and repeat. This way I´ve made a kind of robot to help a co-worker with a lame repetitive task on a aged web plataform.

Resources