Plugin Directory

Changeset 1542243


Ignore:
Timestamp:
11/28/2016 07:45:15 PM (9 years ago)
Author:
mraliende
Message:

1.7 minor bugfix. Loading text did not disappear. Should be solved now.

Location:
good-url-preview-box/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • good-url-preview-box/trunk/gurlpb-start.php

    r1539906 r1542243  
    1010    static $_f_add_js = 0;
    1111    static $_str_srv_dialog = '';
     12    static $_f_include_javascript = false;
    1213    static $_str_first_url = ''; // needed for except
    1314
     
    5253
    5354    add_action( 'init', 'gurlpb_buttons' );
     55    add_action( 'wp_footer', 'gurlpb_javascript_include', 20 );
    5456
    5557    if ( get_option( 'gurlpb-showexcerpt' ) ) {
     
    173175            echo gurlpb_add_previewbox( $strUrl );
    174176        }
    175         add_action( 'wp_footer', 'gurlpb_javascript_include', 20 );
     177        Gurlpb::$_f_include_javascript = true;
     178        //add_action( 'wp_footer', 'gurlpb_javascript_include', 20 );
    176179    }
    177180
     
    180183
    181184function gurlpb_add_previewbox( $strUrl ) {
     185    Gurlpb::$_f_include_javascript = true;
    182186    $arrUrl = parse_url( $strUrl );
    183187    $arrDom = explode( '.' , $arrUrl['host']);
     
    187191
    188192    return
    189         '<br clear="all" /><span guteurls-remove="true" class="guteurlsRemove" style="display:block; width: 100%; max-width:600px; margin: auto; background-color: #fff">
    190         <span  style="width: 100%; line-height: 20px; font-size: 20px; height: 22px; padding:0; margin:20px 0 0 0; display: block; font-family: Oxygen, Arial,  Helvetica, sans-serif; font-weight: normal; font-style: normal; text-transform: uppercase; text-decoration: none; vertical-align: baseline;">
     193        '<br clear="all" /><span guteurls-remove="true" id="guteurlsLoading" class="guteurlsRemove" style="display:block; width: 100%; max-width:600px; margin: auto; background-color: #fff">
     194        <span style="width: 100%; line-height: 20px; font-size: 20px; height: 22px; padding:0; margin:20px 0 0 0; display: block; font-family: Oxygen, Arial,  Helvetica, sans-serif; font-weight: normal; font-style: normal; text-transform: uppercase; text-decoration: none; vertical-align: baseline;">
    191195            <img src="https://guteurls.de/favicon.ico" align="left" style="height: 20px; margin-right: 10px" />
    192196            GUTE-URLS
     
    200204            <a href="' . $strUrl .'" style="font-family: Oxygen, Arial, Helvetica, sans-serif; font-weight: normal; font-style: normal; font-size: 13px; line-height: 20px; text-decoration: none; border-bottom: none;">' . $arrUrl['host'] . $strPath  . '</a>
    201205        </span>
    202     </span><br clear="all" />';
     206    </span>
     207    <script type="text/javascript">
     208        var gurlpbLR = function () {
     209            var a=document.getElementsByClassName("guteurlsRemove");
     210            if (a) for( var i=0;i<a.length;i++) { a[i].style["display"]="none"; }
     211        };
     212        if ( window.addEventListener ) window.addEventListener("load", gurlpbLR, false);
     213        else window.setTimeout(gurlpbLR, 2000);
     214    </script>
     215    <br clear="all" />';
    203216}
    204217
    205218function gurlpb_javascript_include() {
    206219    Gurlpb_utils::log( __FUNCTION__ . '[' . __LINE__ . "]:" );
     220    if ( ! Gurlpb::$_f_include_javascript ) {
     221        return false;
     222    }
    207223    $post_id = get_the_ID(); //this may not work, depending on where code occurs
    208224    $post = $post_id? get_post( $post_id ) : '';
     
    398414
    399415                if ( in_the_loop() ) echo gurlpb_add_previewbox( Gurlpb::$_str_first_url );
    400                 add_action( 'wp_footer', 'gurlpb_javascript_include', 20 );
     416                //add_action( 'wp_footer', 'gurlpb_javascript_include', 20 );
     417                Gurlpb::$_f_include_javascript = true;
    401418            }
    402419        }
  • good-url-preview-box/trunk/gurlpb_editor-plugin.js

    r1533336 r1542243  
    1818                str = arr[0];
    1919                var shortcode = '[urlpreviewbox url="' + str + '"/]';
    20                 return_text = '<span class="gurlpb">' + shortcode + "</span>";
     20                return_text = '<span class="gurlpb">' + shortcode + "</span><br />";
    2121                ed.execCommand('mceInsertContent', 0, return_text);
    2222                try {
  • good-url-preview-box/trunk/readme.txt

    r1539906 r1542243  
    116116== Upgrade Notice ==
    117117
     118= 1.7 =
     119Nothing big. No new feature. no new functions. Only a bugfix.
     120Bugfix: Text "Guteurls loading..." did not disappear. Now a JS will hide it, after loading page.
     121
     122I love to hear your suggestions, to make it even better.
     123
     124
    118125= 1.6 =
    119126* Bugfix: Article title link to external URL
     
    142149== Changelog ==
    143150
     151= 1.7 =
     152* Bugfix: Text: "Guteurls loading..." did not disapear. Now a js will hide it, after loading page.
     153
    144154= 1.6 =
    145155* Bugfix: Article title link to external URL
Note: See TracChangeset for help on using the changeset viewer.