On Tue, Nov 17, 2015 at 12:31 AM, Craig L Russell
<[email protected]> wrote:
> Another thought on this, since it would be nice to have this feature work
> both on a client and on the whimsy service.
>
> Maybe the “alert” could create an email message that can be edited to suit
> (similar to the commit message in SA tool) and once it’s perfect, the (send)
> button would send the completed, edited message to the email system to be
> sent.
>
> I’ll experiment with the alert dialog box to see what is involved.
I do suggest that you try the following patch before you explore a dialog box:
Index: icla-lint.cgi
===================================================================
--- icla-lint.cgi (revision 972667)
+++ icla-lint.cgi (working copy)
@@ -122,7 +122,8 @@
end
_td do
- _button 'email', data_id: id
+ _button 'email', data_email: "#{name} <#{email}>",
+ data_issue: note
_span note
end
@@ -151,8 +152,16 @@
buttons = document.querySelectorAll('button')
for i in 0...buttons.length
buttons[i].addEventListener('click') do |event|
- id = event.target.getAttribute('data-id')
- alert(id)
+ email = event.target.getAttribute('data-email')
+ issue = event.target.getAttribute('data-issue')
+
+ destination = "mailto:#{email}[email protected]"
+ subject = issue
+ body = 'blah, blah, blah'
+
+ window.location = destination +
+ "&subject=#{encodeURIComponent(subject)}" +
+ "&body=#{encodeURIComponent(body)}"
end
end
===================================================================
If you want to go the dialog box route, what the board agenda tool
uses is Bootstrap modals:
http://getbootstrap.com/javascript/#modals
To pull in bootstrap, add the following to the top of your script:
require 'wunderbar/bootstrap/theme'
Have fun!
- Sam Ruby