I have an image within an extension pages dialog box that I would like to magnify when the mouse pans over the image.
I found this bit of js and css:
http://www.nihilogic.dk/labs/mojomagnify/
It works great if the image is on the main page. But if the image is within an extension pages dialog box, the dialog box is popped up, and the mouse is moved over the image, the mouse pointer does not change to the cross hairs and the image is not magnified.
Any theories as to why? Or now to fix it?
Any image magnifies that would work within a dialog box?
The dialog is probably loaded and triggered dynamically and using partial refresh so your JavaScript is loaded before the dialog box is available.
The onClientLoad events are only triggered when the xpage loads. Not on partial refreshes
What you need to do is to make sure your JavaScript loads after the dialog is available. This can be done using another JavaScript that listens to partial refresh events found here
http://dontpanic82.blogspot.se/2010/01/xpages-hijackingpublishing-partial.html
Related
I developed a simple chrome extension. Following the answers in this SO post I was able to programmatically open the popup window on certain webpages. The default behavior of the popup is to open a window at the top right. Is it possible to modify this behavior? Ideally, I would like the popup window to slide in from the right after the automatic window.open is invoked in the background script.
No, you have no control over how and where it appears.
If you want something like slide-in, you're better off injecting your GUI elements into the page itself.
How feasible it is depends on whether you need to inject it into an arbitrary page or if you're working with just one specific website. Shadow DOM might help you isolate styles from the parent page.
Intro
I have a chrome extension I am working on, that uses the background page to listen to the following window and tab events:
chrome.tabs.onActivated
chrome.tabs.onUpdated
chrome.windows.onFocusChanged
The background process basically retrieves the HTML source from each qualifying page the user visits, via a content script injection and messaging.
Once the message with the HTML source is received in the background page, it performs specific tests which may take anywhere from few to several of seconds, depending on the source size.
The Problem
I found that each time I click on the extension icon to open the popup.html view, it renders my background page again and runs the HTML collection and analysis. The issue is the popup view window doesn't open until the background has finished, which on certain pages may take 5-10 seconds.
I tried running the entire background page async with setTimeout(function(){..},0) which didn't work..
How can I solve this?
Is there a way that the popup page will not render the background again? This happens anyway when the user views the tab, so I don't need it?
If not, is there a way for the popup to display regardless of the background operation?
any other suggestions?
Thanks!
I've been doing searches trying to find help on this, but so far all I have found is how to set options for popping up a SharePoint modal dialog box from custom code.
However, I haven't created any custom web parts to display modal dialogs. What's happening, is if someone clicks the upload document button in a library, the upload document modal dialog comes up, but the ok and cancel buttons are half off of the bottom of the box. Users can click on them, but it just doesn't look very good.
I started playing with the CSS to make the modal dialog box bigger to reveal the buttons, and that works for the most part, but the real problem is the grant user permission dialog box.
When that is clicked, it doesn't show the ok and cancel buttons, and maximizing the dialog box doesn't reveal them. The user has to hit tab about 5-10 times before the focus moves to the ok button and is then clickable.
I would post an image, but I don't have enough reputation to do so.
Has anyone come across this? It seems very strange that the out of the box setting would have this problem.
The CSS that I use to adjust the height and width of the modal dialog is:
.ms-dlgFrame, .ms-dlgContent, .ms-dlgBorder, .ms-dlgFrameContainer
I'm just trying to set the height/min-height values, but I haven't had much luck.
We're using Internet Explorer 11 to view the pages.
Stevangelista actually pointed me in the right direction, I wish I could mark comments as answers, and since I'm new I can't upvote the comment, but here's the solution:
I am using a customized master page, and that comment had me take a look at the elements in the page.
Since the master page is being used in the dialog boxes as well, I used the s4-notdlg class to remove parts that weren't needed in the dialogs. Those parts were pushing the buttons below the bottom of the screen.
I'm not a css expert, so there may be ways of keeping those parts and still have the buttons accessible, but the particular issue I was trying to fix was resolved by using the s4-notdlg class to objects in my custom master page.
I have a dijit dialog created declaratively in my static html page.
If I open this dialog as soon as my page is loaded it opens properly in the center of the page, but if I perform some actions available on the page and then load the dialog then the dialog gets padded to the bottom of the page.
This happens ONLY THE FIRST TIME the dialog is loaded and ONLY if the first time happens to be after performing some actions on the page. All the other times the dialog is loaded properly in the center of the page.
There's a similar question here:
Dojo and dijit.Dialog not centered
but the solution given there is not working for me because I'm already using dialog.startup() and dialog.show().
This happens in Firefox, Chrome and IE and I'm using Dojo 1.8
Anyone have some sample code for an in-app browser that they would like to share?
I am looking to add a browser view in my app that is pushed and includes a toolbar with four buttons: back, forward, stop/refresh and actions. However, I'd like to show somewhat transparent and none-tapable buttons when you can't go forward or back, and also have the stop/refresh button show the appropriate icon when it's loading and done loading?
My issue is currently that I cannot get "blanked out" back and forward that cannot be tapped if you cannot go back in the web history. Also, how do I change out the stop icon with the refreshing icon when the view is loading?
For tool bar items, simply set "item.enabled = webview.canGoForward;" (or canGoBack). To change the refresh/stop button you can set item.customView if you want to use a progress view or some such, otherwise if you just want to use a static image you can set item.image. All this is in the documentation as well.