How can I create a persistent extension page? - firefox

Is it possible to make the browserAction popup persistent so that it's not reloaded every time? Failing that, is it possible to have any viewable extension page that can be hidden instead of closed?
I have a complex layout involving a large number of elements that I'm currently saving and loading as a string or using importNode to work around the issue but neither option is great.

No, you can not cause an actual browserAction or pageAction popup to persist. However, just like any HTML page in your extension, you can open that HTML page in either a tab or window.
As to hiding an extension page: A tab does not need to be currently viewed. A window displaying the HTML page could be hidden by minimizing the window you desire to hide. Alternately, you could placed the window you desire to hide under another window by bringing the other window into focus. A third option would be to move the to-be-hidden window to coordinates that are off the screen. All of these are accomplished with windows.update().

Related

How to perform Preview in CKEditor

I am using CKEditor to get HTML from the user. The user will use HTML tags and it will be saved in the database. I need a functionality for the user to see how the page will be displayed when open as .html before saving in the database.
Is it possible to do that using CKEditor and if yes.....then how?
Thanks-in-Advance
It's certainly possible, but depends a lot on your specific requirements.
Get the contents of the editor using editor.getData(), then open a pop up window displaying that content - this should be relatively simple with JavaScript so I won't give any examples - you'll have to try it yourself first :). If a pop up is not something you want to use, maybe use an inline dialog, such as the ones that jQuery uses.
I would create the workflow so that the preview box has a save button inside it, forcing the user to preview before saving. If that's not acceptable, then create a separate button on your page to do the preview.

Telerik RadWindow to replace existing window

How can I open a telerik:RadWindow so that it replaces the existing window (parent)? I do not want the window as a modal.
If you are opening a RadWindow from within a RadWindow read this: http://www.telerik.com/help/aspnet-ajax/window-programming-opening-from-within-dialog.html.
If your RadWindows use their ContentTemplate it should not be needed and they should be able to move in the entire browser.
If they are already in an iframe (e.g., in a splitter pane, pageview or some other layout you have) the same approach from getting the main window (usually via window.top) will do the trick.
If you do not want an HTML popup you will need to use browser popups. a RadWindow is merely HTML + CSS + JS so it cannot be equivalent to a real browser window.
If you want certain pages to open in the main page when initially opened in a RadWindow look into these articles:
- http://www.telerik.com/help/aspnet-ajax/window-application-alert-for-entire-page.html
- http://www.telerik.com/help/aspnet-ajax/window-application-is-page-in-radwindow.html
or generally into frame buster scripts/tricks.

Displaying a .pdf in WebBroser WP7

I have an application which has a listbox. When an item in the list is clicked the app takes us to a new page with a web browser which displays the contents of that particular item (we get these from a particular list which is previously parsed xml data) in a web browser (because they also contain html elements). This all works perfectly fine.
Now, there are a few items in the list which contain a link. The link displays in the browser and when clicked it takes us to a .pdf file (still in the webbrowser) which is not being displayed.
What I now wonder is:
How to check if the link is being clicked? Is there an event for that?
How can I display the .pdf within the webbrowser control without the aid of other application?
Thank you,
Should you need any code that's currently working and written just ask.
To know if the link is clicked, you can use the Navigating event of the webbrowser.
Unfortunately, you can't use the webbrowser to display the PDF. You'll have to use a WebBrowserTask instead.
To sum it up, in your case you can use the Navigating event to detect the click on the link (since it's apparently important from you), then cancel the navigation (by setting e.Cancel = true in the event handler), then call the WebBrowserTask to display the PDF document.

Ordering issue in modal window

I have a problem with a component that loads in to a modal window. I am using the Alpha User Points system and it has a component that gives you a full list of yous site's users. It also gives you the ability to order by username, by points etc. If I use it outside of modal window it works fine. If I use it in to modal window, ordering don't work!!! When I put my mouse over table's headers, outside of modal window gives this...javascript:tableOrdering('aup.referreid','asc','');In to modal window I see this...javascript:tableOrdering('aup.referreid','asc','');?ml=1 Using Firebug, I remove this ?ml=1 and it works into modal also!!! So the question is, why in to modal window gives this ?ml=1, what is this? And how will I remove it?
Well here is the answer... I use the Modalizer extension of nonumber.nl. I was loading my component through modalizer's modal box, this is why I had this issue. So, if anyone use Modalizer to popup components and have the same problem with me, just go to modalizer's Plugin Manager, find the option Convert Links inside Window and disable it!!! But, after this, if you want to add link in to modal window and you don't want to show-up the whole front page but only the component or what ever this is, you have to add at the end of the link this &ml=1.

Loading inline content from an iframe

First of all, I had all my buttons which opened the Colorbox using the "ajax" class. That class however caused me many problems:
1-When I open one window, it will appear, when I close it and re-click the same button, it will be loaded twice (so I need to click twice to close)
Is there a fix for this?
What I have done for the moment:
Use iframes; my only problem now is I cant load the other colorboxes that are linked in that iframe. I am using the inline class.
Let me re-phrase that: I click on button "generate" it opens first colorbox with the iframe class. Inside that iframe I have a "generate_2" button which has inline content. Once I click that second button nothing happens. This used to work when I had the first button set to ajax.
What can I do?
thanks!
I had the same problem before. Since JavaScript cannot affect iframes, you must add the JavaScript code inside a script tag in the iframe page itself.
when I close it and re-click the same button, it will be loaded twice (so I need to click twice to close) Is there a fix for this?
I'd wager you are using ajax to open a complete HTML document, aren't you? You shouldn't be doing that. It's not valid HTML to nest one HTML document inside another, and you are causing the scripts from both to be applied to the original document. Each time you load that content, those scripts are being loaded and executed all over again.

Resources