How to implement javascript blocking modal dialog in with DHTML - javascript

I have a website with a flash image viewer. Once user clicks on flash button, I need to give a confirmation modal dialog before saving the file and if user clicks on OK only I have to pop file download dialog.
Confirmation dialog with in flash is not an option for me. So I have to invoke JS function to pop a confirmation.
Within the site, a custom DHTML confirmation modal dialog is used and it has two JS callback functions one for "OK" and the other for "Cancel" button click event handers. I have to use this modal dialog for this need.
With Flash player 10 security features, it is unable to pop flash file download dialog via JavaScript.
Simple JS confirm dialog works for me as I can return the user's action by calling JS function from flash as JS confirm dialog is a blocking dialog.
How can I implement same blocking type custom confirm dialog ?

You need to wrap your popup into a div.
Make this div the top element in your page, eg: using z-index.
And give a fixed position with a height and width of 100%.
You can leave it transparent or give some effect using semi-transparent colors.
If you have select elements in your page, they will go through this div.
To avoid this problem, you can put behind the div a transparent iframe with the same size.

Related

How to make window.open() pop up a sticky popup?

I am creating a program where i use popup with the help of javascript window.open(). It is working fine but i want to make it sticky popup. Here i try make you understand what i'm looking for. For ex. I have page called add_data.php in this page i have button called upload picture when i click upload picture button a popup appears where pircture can b uploaded. But i dont want to user allow to do anything on other tabs until upload picture tab is completed or closed. In other words i want to stick the picture upload popup.
There is no way to make a new browser window modal.
People doing this sort of thing generally use DOM manipulation to display new UI elements on top of the current page (which block accesses to the rest of the page using overlays and methods to disable access with the tab key etc).
There are lots of JavaScript libraries / UI frameworks that provide a modal.

Display bootstrap modal dialog on top of child popup window

I'm modifying Moodle LMS to include some user alerts during their chat sessions if some problems have been identified. Chat module in Moodle appears as a popup window displayed on top of Moodle index page.
Since I can't modify Moodle core code, I'm able to embed some custom javascript code in the Moodle index page, but not in the chat child popup window. This custom javascript code displays bootstrap Modal dialog with notification for the user, but the problem is that this modal dialog is covered by the child popup, so user doesn't see the message.
Ideal scenario would be if modal dialog appears on top of child popup window. However, if that's not possible another solution might be if somehow I can return focus to parent window so user is still able to see notification in modal dialog before he returns to the chat window.
I hope someone has some idea how to make this work.

How to bind an event in a Facebook Like Button

first of all, sorry for my bad english.
I would like to create a "like-close" button for my site. Now I'll explain what I mean.
I've created 2 div, 1 for an overlay background in all the browser window and one for a window where I ask users to "Like" my facebook page.
I have also created a close button for hide the 2 divs and in this button I have hidden another Facebook Like Button and, when a user try to close the popup, he will put a "Like". In this button I wrote "close and like" so, for who thinks It's a clickjacking, the users know what they are doing.
I've been able to close the window in the same moment when the user click on the button on the first time (so, before he didn't like my page) with the method
FB.Event.subscribe('edge.create', function(response) {
jQuery('#overlay').hide(); //hide the overlay
jQuery('#popoup').hide(); //hide the popup window
});
Now when he visit my page again, the popup will appear again and I don't know how to close it without "dislike" the page.
I tried to bind an event "click" in the iframe of like button but it didn't work.
I tried to bind an event in the wrapper of the iframe but it didn't work...
So I have no more ideas and I know it's possibile because I saw this trick in another web site.
Thank you all for help
Sorry, in the button where I hide the Facebook like I wrote "like and close". It's the only button in the Window for show the main page content just to fans.

Calling a JavaScript function on a CKeditor dialog instead of a popup window

I currently have a custom dialog within the link plugin that launches a popup with all the internal pages on my CMS for the user to pick and it inputs the url into the box
{type:'button',id:'browseInternal',label:i.browseWebsite,filebrowser:{action:'Browse',url:'/admin/pages/links'}}
However, I now use a popup modal window all over my system and would like the same modal style window to be used here. Any ideas on how I can implement it? I dont want to launch a popup window but instead the button needs to call this function
loadPopup( '/admin/pages/links', '', 'destination' );
After gathering my thoughts and a little more help from Google I eventially found the right page on the CKeditor docs see here

Clicking OK in a prompt

I know how to create alerts and confirm boxes, but what I cannot find out how to do is to do the actual clicking of OK. I have a page that pops up a confirm box. I want to click OK using a Java Script add-on. Basically, I want my code to click a link on the page, then click ok when prompted. Is that possible?
That's not possible with a browser pop-up.
However if it's a modal dialog that sits within the DOM of the page, then you can trigger a JavaScript event to close it. An example of such a dialog is jQuery's dialog.

Categories

Resources