I have been trying to make the Publish Stream preview modal that appears when i click on Publish Button, to appear in a pop window instead of a javascript modal.
Here is how you might go:
1: Create a html page
2: Put all your FB publish stream code in above created page
3: Use the window.open with the path to above created page to it in popup window.
Example:
<a href="#" onclick="window.open('popup.html', 'win', 'toolbar=0, menubar=0'); return false;">
In the callback for your FB.ensureInit, add this:
FB.Connect.get_status().waitUntilReady(function(status)
{
FB.Connect._openFeedDialogIframe = function(b, a, f)
{
FB.Connect._openFeedDialogWindow(b, a, f);
};
});
This will cause the call to _openFeedDialogIframe to actually call _openFeedDialogWindow, so your feed dialog will be in a popup instead of in an iframe.
Good luck!
Related
I think I need your help here... On my site, I've done all the articles open in modal window by clicking on the link "read more" that exists in every article.
Also, each article has a button that shares this article on facebook.
But, when the user who will see my article on facebook, click this link to read the article, it come back to my page, but the article (logical) not open in modal window!!!
Is there any way, in the "return" of the user on my site, after having pressed the link of facebook, automatically open this article in modal window? Or, if the question above can't be done, is there any way by customizing the link I send to facebook, to set it in the "return" of the user to my site, after having pressed the facebook's link ofcourse, to show the article in intro view and not in full view?
Thank you very much for your time!
I'm using modal windows in my website and I utilize the following HTML code to open an article in a popup:
<a class="modal" rel="{handler: 'iframe', size: {x: 680, y: 370}}" href="yourarticleid=759&tmpl=component&task=preview">Open a link in modal</a>
The method above uses the native function for creating the modal window and calls the article you need to display. However, since Facebook formats all posted links I don't think you'll be able to include the crucial piece of code (below) that triggers the modal window.
class="modal" rel="{handler: 'iframe', size: {x: 680, y: 370}}"
Here is a kind of solution, an idea in other words, that make your articles open in modal window, after a user click on facebook share link and then come back to your site.
In my case I did this...
To open modal windows in my site, I am using the extension modalizer from nonumber.nl. This extension adds something like that &ml=1 at the end of article's url. The link that comes from facebook don't contain this &ml=1 at the end. So...
1. First of all, in to my article's content, I should include modal's behavior.
2. Then, I should make my code check if the url has this &ml=1 at the end or not.
3. After, I should decide what my code will do in those two cases. So, I want to do nothing if &ml=1 already exists and I want to open facebook's url in modal window if &ml=1 doesn't exist. I also want everytime that I close my modal window to load index.php, else user will see my article on frontend view.
Here is the code for all this:
<?php JHTML::_('behavior.modal');
$url= 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
if (strstr($url, "&ml=1")){/* Do nothing */}
else {?> <a class="modal" id="modalWindowLink" href="<?php echo $url ?>"></a>
<script>
window.addEvent('domready', function(){
window.addEvent('load', function(){ SqueezeBox.fromElement($('modalWindowLink')); });
});
SqueezeBox.addEvent('onClose', function(){ window.location = 'index.php'; });
</script>
}
<?php } ?>
If you have any better idea, or if you see something that could work better in other way, please let me know!!!
I'm using fancybox with ajax request to open multilpe fancybox instances on same page:
This is html code:
User
and this is Javascript i've used:
<script type="text/javascript">
$(document).ready(function()
{
$(".comment_button_fancy").click(function(){
var element = $(this);
var Ide = element.attr("id");
$("#"+Ide).fancybox();
return false;});});
</script>
Everything could be ok, just 1 problem... first time i load the page, i need to click 2 times over "User" to open fancybox...
If i open fancybox and then i close it, the second time i can click just 1 time...
why?
Thanks
The first click registers the event to the DOM, and the second (and subsequent ones) show the Fancybox.
If using multiple Fancyboxes, you should avoid using ID's like you have there and change it to classes. Not sure why you've got all that code to launch the fancybox, when this should work:
$(".comment_button_fancy").fancybox();
This will Fancybox all elements with the class "comment_button_fancy" and should fix your two-clicks issue. You don't need to put a 'click' event handler around the Fancybox code, as it inherently has that event attached to it.
I'm trying to figure out how to validate a form opened using nyroModal.
The page is being opened as below on click of a button:
$(function() {
$('.btnedit').click(function() {
$.nmManual('form_page.php);
});
});
On the form that opens up, I have a few fields that are mandatory and a cancel & submit button.
<a class="nyroModalClose button" href="#" id="btn_submit">Submit</a>
On clicking of the submit button, I want to make sure the mandatory fields have value. If no, an error message should be displayed & the modal window should not close.
I'm trying to use the jquery validation plugin, but without success. The modal window always closes irrespective of the validation scripts.
I haven't found much info regarding form validation in a modal window. Is this not a preferred approach?
Thanks in advance.
I'm not able to help you about the jquery validation plugin in a modal window, but I know that using the instruction $.nmManual in that way, the form will not be placed inside the iframe tag, and if I remember correctly the content of new page will be added without header and body tags, so in a word incorrectly. I guess this can produce no validation.
To successfully open an iframe you need to use filters as described here:
Open iframe manually in nyroModal?
I hope this can help you.
I have a modal dialog in Wicket that contains a link. I need to open an external web page (for example, http://www.google.com) by clicking on the link. The target of the link is set dynamically. How can I do this?
I think that my question hasn't been so clear(I apologize for that). I need to open Web page from modal dialog. Actually, I can explain the problem in the example of modal dialog that #Don Roby has proposed me (wicketstuff.org/wicket14/ajax/modal-window.0). If we click the "Show modal dialog with a page" link in the example, there will be shown the modal dialog with another link called "Open another modal dialog". By clicking on that link, I want to open Web page (for example: www.google.com). My question is: how to open a Web page in this situation?
You can use a PageCreator (instead of setContent()), and return a RedirectPage:
ModalWindow modal = new ModalWindow("modal");
modal.setPageCreator(new ModalWindow.PageCreator() {
#Override
public Page createPage() {
return new RedirectPage("http://www.google.com");
}
});
add(modal);
I understand what you mean.
I have found the solution here :
http://apache-wicket.1842946.n4.nabble.com/How-to-redirect-from-a-ModalWindow-td1889646.html
onClick( AjaxRequestTarget target ){
target.appendJavascript( "Wicket.Window.unloadConfirmation = false;" );
modal.show( target);
}
It sounds like you already know how to deal with the modal, but there's an example of doing it here. Opening an external link is not difficult, and there's an example of doing it here.
how do you create your link ?
did you tried with an externalLink ?
new ExternalLink("applicationLink","http://www.google.com");
I'm implementing Facebook connect for a website. The Facebook Connect code is inside an iframe. Everything works well but when Facebook is supposed to show a popup dialog (for example FB.Connect.showFeedDialog or FB.Connect.streamPublish) The popup shows inside the iframe.
Since its a small iframe window the popup is half hidden.
Any idea on how to solve it is very much appreciated.
Note: the FB login and logout popups do show well.
My window was too small to show the FB iframe properly, so I overrode the private _openFeedDialogIframe function to call the _openFeedDialogWindow:
var init = function()
{
FB.Connect.get_status().waitUntilReady(function(status)
{
FB.Connect._openFeedDialogIframe = function(b, a, f)
{
FB.Connect._openFeedDialogWindow(b, a, f);
};
});
};
FB.ensureInit(init);
This forces a popup every time an iframe is to be shown.