Can not fire the ondialogaccept event handler in Thunderbird 68.5.0 add-on's xul dialog - xul

In my currently writing Thunderbird 68.5.0's addon, the dialog's event handlers both ondialogaccept and ondialogcancel are not fired for unknown reasons.
enter image description here
When clicking the "strangers" button on the sample dialog, the alert is shown.
However clicking the "Accept" button or the "Cancel" button, any alert is not.
The just written code is as follows:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<dialog id="sample" title="event handlers"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
buttons="accept,cancel"
ondialogaccept="window.alert('Hi!');return true;"
ondialogcancel="window.alert('Oops!');return true;"
>
<button label="strangers" onclick="window.alert('Yip Yip!');" />
</dialog>
// launcher.js
window.openDialog(
"chrome://myaddon/content/sample.xul",
"sampleDlg",
"resizable,chrome,modal,titlebar,centerscreen");
Thank you in advance.

In TB68, the on... handlers do no longer work due to CSP.
In your javascript, you need to load a listener to the event. See the update info to TB 60 in mozilla TB wiki and/or the upgrade info on developer.thunderbird.net
Klaus

Related

VBA: Load custom ribbion at runtime with access

I try to load and display a ribbon out of a textfile in microsoft access via VBA at runtime.
So I call this code:
Dim strGUID As String
strGUID = "RadToolRibbons"
Const RadToolRibbonFile = "c:\Temp\Ribbons.xml"
Dim XMLText As String
With CreateObject("Scripting.FileSystemObject")
XMLText = .OpenTextFile(RadToolRibbonFile, 1).ReadAll
End With
Application.LoadCustomUI strGUID, XMLText
But it does not show the ribbon. When I call the code again I get an error:
#32609 " this customization already loaded..."
The xml looks like this:
<?xml version="1.0"?>
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon startFromScratch="true">
<tabs>
<tab id="tab1" label="MyNew">
<group id="StartHelp" label="Help">
<button id="Test" label="Test" size="large" imageMso="AcceptTask" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
What Im doing wrong?
By default, if a VSTO Add-in attempts to manipulate the Microsoft Office user interface (UI) and fails, no error message is displayed. However, you can configure Microsoft Office applications to display messages for errors that relate to the UI. You can use these messages to help determine why a custom ribbon does not appear, or why a ribbon appears but no controls appear.
To show VSTO Add-in user interface errors
Start the application.
Click the File tab.
Click Options.
In the categories pane, click Advanced.
In the details pane, select Show VSTO Add-in user interface errors, and then click OK.
Read more about that in the How to: Show Add-in user interface errors article.

Magnific popup - how to open it on mouseover?

I'm using Magnific popup our product product pages as a method for image hot points. Right now when you click on a hot point a popup appears with larger image and text. I received a request to open the popup on a mouseover.
Is there a way to trigger open Magnific Popup on a mouseover not on a mouse click?
I was trying to call the mouseover event on the link first, but it seems the Popup still requires a click. How to I make it so it opens up just with a mouseover?
<!-- Popup link -->
Show inline popup
<!-- Popup itself -->
<div id="test-popup" class="white-popup mfp-hide">
Popup content
</div>
Javascript:
$('.open-popup-link').mouseover(function(){
$(this).magnificPopup({
type: 'inline'
});
});
Answering my own question. After a bit more research I found that I needed to open the popup directly via API. It works now:
$('.open-popup-link').mouseover(function(){
$.magnificPopup.open({
items: {
src: '.white-popup' // can be a HTML string, jQuery object, or CSS selector
}
})
});
Working example: https://codepen.io/pen/ZKrVNK
Taking it further with multiple links opening separate slides of a gallery, using event delegation:
http://codepen.io/pen/EmEOMa

Is there an easy way to make the fileupload work with IE11 without updating zk

In IE11 file upload button of ZK is not working.
I got few replies, It says after updating ZK it will fix the problem.
But we can't update ZK, So in this scenario is there any way to work out this problem any how.
If you can't upgrade ZK then you can try to "downgrade" the IE using "X-UA-Compatible" either as meta-tag or as a response header
here an example using the meta tag:
<?meta http-equiv="X-UA-Compatible" content="IE=10" ?>
<zk>
<fileupload label="upload" onUpload="alert(event.getMedia().getName())"/>
</zk>
and what it looks like in the browser (in the IE dev tools F12 you can check if the meta tag had an effect, you'll see that IE falls back to version 10):
http://screencast.com/t/ftheLA9Ud8
Finally I got the Solution.
AS IE 11 having problem to attach event for listening to open File chooser.
You just manually add the listener.
<button id="browsebtn" upload="true,maxsize=-1" visible="true" sclass="text">
<attribute w:name="doMouseDown_">
function (evt) {
}
</attribute>
</button>
Its simple and weird, However what I found is make the parent component as draggable="true"
<row draggable="true">
<div style="text-align : right;">
<label value="Image File:" />
</div>
<fileupload id="fileUpload" label="Upload" tooltiptext="Click to upload image file."/>
</row>
Now suddenly you will see your fileupload button in ZK started working correctly for IE11 as well.

How to showConfirmationDialog window form Struts Action

Hi Experts,
I want to know if it is possible in Struts 1.x to display a
confirmation dialog from Struts Action. In more detail :
I have Action Form,Action Class and importList.jsp file. When i click
a button(on the main Jsp file) .. the current importList.jsp is
displayed by setting the properties of Action Form. In this jsp file i
have ok and cancel button. When i click OK button, on the basis of
some condition i want to show the confirmation dialog saying yes or
no, if the user clicks yes it will move forward, and on cancel.. it
will move to main jsp file(not to importList.jsp file)
Any ideas ....
You can use javascript to get this done. Instead of "Yes/No" dialog you will get "Ok/Cancel" dialog box. You will have to replace "importList url" and "main page url" with your actual urls.
This may not be syntactically accurate but it's a start.
<head>
<script type="text/javascript">
$(document).ready(function(){
$('input[type=submit]').click(function(){
var answer = confirm("You will be forwarded. ");
if(answer){
//your logic
document.location.href="importList url";
}else{
//your logic
document.location.href="main page url";
}
});
});
</script>
</head>
<body>
<input type="submit" value="Ok" />
</body>

VB.net clicking a submit button using Web Browser

I want to click the submit button of the webpage i am displaying in my Web Browser but it seems not to work at all here is my code:
WebBrowser1.Document.Forms(0).InvokeMember("image")
i was basing on the html code of the button i want to click which is:
<div class="buttonRow forward">
<input type="image" src="includes/templates/template_default/buttons/english/button_send.gif" alt="Send Now" title=" Send Now ">
</div>
did i miss something? i really need help.
Try setting this property
Webbrowser.AllowNavigation = True