Plugin Directory

Changeset 1939274


Ignore:
Timestamp:
09/11/2018 12:30:30 PM (7 years ago)
Author:
luisfbmelo
Message:

Started using javascript for script include

Location:
azores-gov-banner
Files:
1 deleted
2 edited
3 copied

Legend:

Unmodified
Added
Removed
  • azores-gov-banner/tags/3.0/gov_banner.php

    r1838706 r1939274  
    33* Plugin Name: Azores Gov Banner
    44* Description: A custom plugin to enable Azores Gov Banner
    5 * Version: 2.0.2
     5* Version: 3.0
    66* Author: Luis Melo
    77* Author URI: http://luisfbmelo.com/
     
    1515//  Init header action
    1616function AZGB_init(){
    17     add_action('wp_head', 'AZGB_add_banner');
     17    add_action('wp_footer', 'AZGB_add_banner');
    1818    add_action('wp_enqueue_scripts', 'AZGB_assets');
    1919}
     
    2626
    2727//  Add view with HTML
    28 function AZGB_add_banner(){
    29     include(AZGB__PLUGIN_DIR . 'views/banner.php');
    30 }
     28function AZGB_add_banner(){ ?>
     29    <script src="https://cdnjs.cloudflare.com/ajax/libs/postscribe/2.0.8/postscribe.min.js"></script>
     30    <script>
     31        (function(){
     32            theParent = document.getElementsByTagName("body");
     33            theKid = document.createElement("div");
     34            theKid.setAttribute('class', 'gov-header');
     35            theKid.setAttribute('id', 'gov-header');
     36
     37            // prepend theKid to the beginning of theParent
     38            theParent[0].insertBefore(theKid, theParent[0].firstChild);
     39
     40            postscribe('#gov-header', '<script language="javascript" charset="ISO-8859-1" src="https://www.azores.gov.pt/PortalAzoresgov/external/comum/barra/2018/barraLive.center.static.div.pt.https.js" type="text/javascript" ><\/script>');
     41        })()
     42    </script>
     43<?php }
  • azores-gov-banner/tags/3.0/readme.txt

    r1838706 r1939274  
    55Tested up to: 4.9.4
    66Requires PHP: 5.6
    7 Stable tag: 2.0.2
     7Stable tag: 3.0
    88
    99A Azores Government Banner with links
     
    2121== Changelog ==
    2222
     23= 3.0 =
     24* Changed action to wp_footer;
     25* Stopped including via PHP include() and includes now via Javascript with "postscribe"
     26
    2327= 2.0.2 =
    2428* Changed script request to HTTPS
  • azores-gov-banner/trunk/gov_banner.php

    r1838706 r1939274  
    33* Plugin Name: Azores Gov Banner
    44* Description: A custom plugin to enable Azores Gov Banner
    5 * Version: 2.0.2
     5* Version: 3.0
    66* Author: Luis Melo
    77* Author URI: http://luisfbmelo.com/
     
    1515//  Init header action
    1616function AZGB_init(){
    17     add_action('wp_head', 'AZGB_add_banner');
     17    add_action('wp_footer', 'AZGB_add_banner');
    1818    add_action('wp_enqueue_scripts', 'AZGB_assets');
    1919}
     
    2626
    2727//  Add view with HTML
    28 function AZGB_add_banner(){
    29     include(AZGB__PLUGIN_DIR . 'views/banner.php');
    30 }
     28function AZGB_add_banner(){ ?>
     29    <script src="https://cdnjs.cloudflare.com/ajax/libs/postscribe/2.0.8/postscribe.min.js"></script>
     30    <script>
     31        (function(){
     32            theParent = document.getElementsByTagName("body");
     33            theKid = document.createElement("div");
     34            theKid.setAttribute('class', 'gov-header');
     35            theKid.setAttribute('id', 'gov-header');
     36
     37            // prepend theKid to the beginning of theParent
     38            theParent[0].insertBefore(theKid, theParent[0].firstChild);
     39
     40            postscribe('#gov-header', '<script language="javascript" charset="ISO-8859-1" src="https://www.azores.gov.pt/PortalAzoresgov/external/comum/barra/2018/barraLive.center.static.div.pt.https.js" type="text/javascript" ><\/script>');
     41        })()
     42    </script>
     43<?php }
  • azores-gov-banner/trunk/readme.txt

    r1838706 r1939274  
    55Tested up to: 4.9.4
    66Requires PHP: 5.6
    7 Stable tag: 2.0.2
     7Stable tag: 3.0
    88
    99A Azores Government Banner with links
     
    2121== Changelog ==
    2222
     23= 3.0 =
     24* Changed action to wp_footer;
     25* Stopped including via PHP include() and includes now via Javascript with "postscribe"
     26
    2327= 2.0.2 =
    2428* Changed script request to HTTPS
Note: See TracChangeset for help on using the changeset viewer.