SlackAPI - Include dialogs input and original message - slack-api

I'm using SlackAPI views_open with trigger_id to open a dialog modal.
In that dialog modal user will input some information. My issue is I want to include this input and original message before submit.
Would anyone guide me how to do this?
I'm very appreciated for your help.

After read Slack document I found the way, just push data into private_metadata for later use
https://api.slack.com/reference/surfaces/views

Related

issue with adding upload field to mautic form

I need to add a file upload custom type to my mautic form but I can't find the right way to do it.
Is there a plugin to add or I must work with symfony to add it
Any suggestions please !
The closest thing to the file upload field feature is this PR: https://github.com/mautic/mautic/pull/3054
If you need it and you know PHP a little, you could help the author to finish it.
UPDATE: Form file upload was finished in PR https://github.com/mautic/mautic/pull/5082 and released in Mautic 2.11.0.

Add-on for Submitting File from Clipboard

Is There A Browser-Add-on That Can Create A Temporary Txt File From My Clipboard And Populate The File Submit Dialog?
Guide for firefox:
Get the data from your clipboard with this: paste data from clipboard using document.execCommand("paste"); within firefox extension
Now you can either create a temporary file with something like OS.File: https://developer.mozilla.org/en-US/docs/JavaScript_OS.File/OS.File_for_the_main_thread
Or create a object with something like window.createObjectUrl.
Then assuming the file submit dialog is prompted by a html5 uploader, then you should just set value of that html5 dialog box there are other ways though too, like mozSetDataAt, mozSetFileArray etc, search github for these keywords shows excellent examples:
https://github.com/search?l=javascript&q=mozSetDataAt&type=Code&utf8=%E2%9C%93
https://github.com/search?l=javascript&q=mozSetFileArray&ref=searchresults&type=Code&utf8=%E2%9C%93
You might need to use the mimeType of application/x-moz-file not sure. Definitely experiement with it and share your solution, and ask for help along the way. This is fun stuff.
There are probably other smarter ways to attach into a input type=file, i was trying to do it the other week. I would also be interested if someone else could share some solutions to actually trick the file input element to think the native file dialog was actually used, maybe using XPCOM.

Send OnClick message to TWebBrowser

How can I send a mouse onclick message to TWebBrowser in Delphi? The OnClick message must be sent to specific control appears in website.
for Example i have a radio button appears in the website named XXXRB and I want send the message to that Radio button (which is named XXXRB) to select it.
How can I do it?
Regards.
can you call JS from Delphi ?
http://www.delphidabbler.com/articles?article=21
http://jansfreeware.com/articles/delphi-ie-javascript.html
http://www.programmersheaven.com/article/12946-How+to+call+JavaScript+functions+in+a+TWebBrowser+from+Delphi/info.aspx
probably there should be way
http://www.roseindia.net/javascript/javascript-click-method.shtml
To locate the control DOM Object you may try collections such as GetXXXByName or libraries like jQuery or custom JS code.
however that is the question on Internet Epxlorer + JavaScript, not on Delphi.
No need for javascript as Arioch implies.
You can have access to the complete DOM via TWebBrowser.Document.
There are many resources on the net on this subject, this is the most complete one:
http://www.cryer.co.uk/brian/delphi/twebbrowser/read_write_form_elements.htm
if you look around on SO you also will find some snippets.

Highlights Epub open in UIWebView

Any one can help me out for highlighting on epub. I open epub on UIWebView and allow user to highlight the text which he can see in future too. I am having database to store highlights detail. I am able to highlight using javascript. But since it uses range etc it remain till page is not change or reload.
Those who donot know what is epub you can suggest me on simple html page.
Please any one can suggest me how to implement highlight just like ibook have
Any logics?
Thanks in advance
See the following for the Javascript required:
https://github.com/fedefrappi/AePubReader/blob/master/AePubReader/SearchWebView.js
Download entire project to see how it's used.

Extract part of an url using a bookmarklet or similar (e.g. firefox addon)

Does anybody know of a bookmarklet or firefox addon that let's you extract part of an url.
Specifically I want to extract the message id from a gmail conversation.
Every message in gmail has a unique ID. The url may look like this: https://mail.google.com/a/domain.com/#all/1251b8f40722a3c2
What I want, is to be able to extract the last 16 characters (the "1251b8f40722a3c2" part) from the url and have it copied to the clipboard automatically.
A bookmarklet would be preferred (compatibility), but a firefox addon is also okay.
Thank you! :)
Forgot all about this question.
I got this answer from someone, I can't remember who. But maybe it will help someone else in my situation.
javascript:(function(){var%20theSnippedURL=location.href.match(/([0-9]|[a-f]){16}/g);if(theSnippedURL){var%20url=prompt(%22Copy%20the%20extracted%20ID%20below.%22,theSnippedURL);}else{alert(%22Couldn't%20find%20conversation%20ID.%22);}})();
This javascript can be used in a bookmarklet like this. It extracts the message ID from Gmail, and shows it in a popup box. Unfortunatly it doesn't copy the ID to the clipboard, but you can just copy it from the popup, so that's ok.

Resources