Plugin Directory

Changeset 135530


Ignore:
Timestamp:
07/15/2009 07:41:55 PM (17 years ago)
Author:
linal
Message:

updated code to work in ie

Location:
post-to-facebook/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • post-to-facebook/trunk/post-to-facebook.js

    r135365 r135530  
    22{
    33    // create a popup display for an iframe to facebook
     4    try
     5    {
     6        jQuery('body').append(
     7            jQuery('<div id="p2fb_popup" style="display: none;"></div>')
     8        );
     9        var container = jQuery('<div id="p2fb_window" style="display: none;"></div>');
     10        jQuery('body').append(container);
    411
    5     jQuery('body').append(
    6         jQuery('<div id="p2fb_popup" style="display: none;"></div>')
    7     );
    8     var container = jQuery('<div id="p2fb_window" style="display: none;"></div>');
    9     jQuery('body').append(container);
     12        container.append(
     13            jQuery('<div id="p2fb_popup_title"><a href="#" onclick="p2fb_close_Popup();">Close</a></div>')
     14        );
     15        container.append(
     16            jQuery('<div id="p2fb_popup_content"><iframe name="p2fb" id="p2fb_iframe" style="height: 500px" height="500px"></iframe></div>')
     17        );
    1018
    11     container.append(
    12         jQuery('<div id="p2fb_popup_title"><a href="#" onclick="p2fb_close_Popup();">Close</a></div>')
    13     );
    14     container.append(
    15         jQuery('<div id="p2fb_popup_content"><iframe id="p2fb_iframe" style="height: 500px" height="500px"></iframe></div></div>')
    16     );
    17 
    18     p2fb_show_Popup(link);
     19        p2fb_show_Popup(link);
     20    }
     21    catch(ex)
     22    {
     23        alert(ex)
     24    }
    1925}
    2026function p2fb_show_Popup(link) {
    21     jQuery('#p2fb_popup').fadeIn('fast',function(){
    22             document.getElementById("p2fb_iframe").src = "http://www.facebook.com/share.php?u=" + link;
     27    // shits broken, but not in Fx 3.5, 3.0
     28    // only broken in IE, iframe is failing to be set correctly.
     29    // TODO: fit it!
     30    jQuery('#p2fb_window').fadeIn('fast',function(){
     31            //jQuery('#p2fb_iframe').attr("src","http://www.facebook.com/share.php?u=" + link);
     32            document.getElementById('p2fb_iframe').src = "http://www.facebook.com/share.php?u=" + link;
     33            //jQuery('iframe[name=p2fb]').attr('src',"http://www.facebook.com/share.php?u=" + link);
    2334    });
    24     jQuery('#p2fb_window').fadeIn('fast');
     35    //jQuery('#p2fb_popup').fadeIn('fast');
     36
    2537}
    2638function p2fb_close_Popup() {
  • post-to-facebook/trunk/post-to-facebook.php

    r135365 r135530  
    1515        ?>
    1616            <script type="text/javascript">
    17                 p2fb_init("<?php print $_SESSION['post_to_facebook'] ?>");
     17                jQuery(document).ready(function(){
     18                    p2fb_init("<?php print $_SESSION['post_to_facebook'] ?>");
     19                });
    1820            </script>
    1921        <?php
Note: See TracChangeset for help on using the changeset viewer.