popup

How to handle ESC keydown on javascript popup window

ぃ、小莉子 提交于 2019-11-28 04:19:34
I have a javascript window.open popup, and I want the popup to close itself when the user presses the ESC key. I can't figure out how to hook the keydown event (and on what object?) so that I can catch the ESC key. I'm using jQuery. Try something like this: $(document).keydown(function(e) { // ESCAPE key pressed if (e.keyCode == 27) { window.close(); } }); user3874938 It is possible to achieve with JS Without using jQuery. window.onkeydown = function( event ) { if ( event.keyCode == 27 ) { console.log( 'escape pressed' ); } }; event.key === "Escape" No more arbitrary number codes! document

How to create a system tray popup message with python? (Windows)

六月ゝ 毕业季﹏ 提交于 2019-11-28 04:08:19
I'd like to know how to create a system tray popup message with python. I have seen those in lots of softaware, but yet difficult to find resources to do it easily with any language. Anyone knows some library for doing this in Python? With the help of the pywin32 library you can use the following example code I found here : from win32api import * from win32gui import * import win32con import sys, os import struct import time class WindowsBalloonTip: def __init__(self, title, msg): message_map = { win32con.WM_DESTROY: self.OnDestroy, } # Register the Window class. wc = WNDCLASS() hinst = wc

I want to open a new tab instead of a popup window

99封情书 提交于 2019-11-28 04:00:24
问题 I am trying to open a new tab. But Window.open() is opening up popup window. I want to open hello.php file in a new tab. But it is opening up in a new popup window. <!DOCTYPE html> <html> <head> <script language="javascript"> document.onmousedown=disableclick; //status="Right Click Disabled"; function disableclick(event) { if(event.button==2) { //alert(status); return false; } } </script> </head> <body oncontextmenu="return false"> <form action="" method="POST" oncontextmenu="return false">

window.open returns undefined in chrome extension

会有一股神秘感。 提交于 2019-11-28 03:37:14
问题 I have content script based Chrome extension. I initiate the sign in process through a popup window in the content script. I open a popup window using the below code and then wait till its closed. However, I get an 'undefined' from window.open method. Does anybody know why this happens? loginwin is undefined in below code although the popup window opens up fine with the specified login_url . The code below is called from my content script. var loginWin = window.open(login_url, 'LoginWindow',

How to remove auto focus/keyboard popup of a field when the screen shows up?

為{幸葍}努か 提交于 2019-11-28 03:31:19
I have a screen where the first field is an EditText, and it gains the focus at startup, also popups the numeric input type, which is very annoying How can I make sure that when the activity is started the focus is not gained, and/or the input panel is not raised? Mitul Nakum InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(editTextField.getWindowToken(), 0); or set activity property in manifest file as below in the application tag android:windowSoftInputMode="stateHidden" go to your application manifest file, and write

jquery mobile popup not working?

非 Y 不嫁゛ 提交于 2019-11-28 02:45:19
问题 im using jquery mobile. im trying to create a popup. I found this simpel code that should work. http://jquerymobile.com/branches/popup-widget/docs/pages/popup/index.html I tried the code in the example <a href="#popupBasic" data-rel="popup">Tooltip</a> <div data-role="popup" id="popupBasic"> This is a completely basic popup, no options set. </div> but when I put this in my own code the div will still display and when I click on the button it goes to an other page, instead of a popup. Can

Hide div 24hr cookie javascript? [closed]

房东的猫 提交于 2019-11-28 02:18:47
I would like a simple JavaScript code that will allow me to hide a certain div element when clicked for a predefined amount of time. To be a little more informative, I have a suggestions box that appears when the home page is loaded. What I would like is when the div close button is clicked it sets a cookie to keep the box div closed for 24 hours (1day). Simply said, when the div close button is pressed, the box div is hidden for 24 hours. Note: I have a javascript that allows the close button to close the box but it will load every refresh. http://i.stack.imgur.com/du1pA.jpg Although T.J.

Angular <router-outlet name=“popup”> change URL path structure?

微笑、不失礼 提交于 2019-11-28 02:01:42
I'm using a popup (refering to the docs): https://angular.io/guide/router#displaying-multiple-routes-in-named-outlets Everything is fine apart from the URL structure: /domain/subPath/(popup:myopoup) How can I change this default structure with parenthesis? I would like it to be as follows: /domain/subPath/popup In other words, I want to remove the brackets including the colon inside the URL. Inside their documentation the popup also appears in that manner (with brackets) Here is some code: .ts { path: 'mypopup', component: MyComponent, outlet: 'popup' }, .html <a [routerLink]="[{ outlets: {

Get DOM elements of a popup for jQuery manipulation

筅森魡賤 提交于 2019-11-28 01:44:47
问题 I am creating a popup as follows: var comet = { popup: null, newPopup: function(windowsname, w, h){ this.popup = window.open(windowsname, windowsname, 'width=' + w + ',height=' + h); var self = comet; var logOut= null; $(this.popup.document).ready(function(){ logOut = self.popup.document.getElementById('logout'); console.log(logOut); $(logOut).live('click', function(){ alert('HELLO'); return false; }) }) }, some_function: function(){ //calling it here: this.newPopup('index.php',1120,550); } }

Download file from internet via R despite the popup

纵饮孤独 提交于 2019-11-28 01:33:47
问题 Downloading a file from the internet using R is easy and has been addressed previously. My question regards how to get past a popup message that seems to prevent my download from executing. Specifically, download.file(url = "https://www.chicagofed.org/applications/bhc_data/bhcdata_index.cfm?DYR=2012&DQIR=4", destfile = "data/test.zip") gives me a little file of garbage instead of the desired 18 megabyte file that you would get if you went to the website and entered the year 2012 and the