WordPress.org

Plugin Directory

Changeset 576400


Ignore:
Timestamp:
07/24/12 00:14:03 (21 months ago)
Author:
jamescollins
Message:

Typekit Fonts For WordPress v1.4: Use the new scheme-less typekit.net embed code format ( use.typekit.net/xyz.js ).
Thanks to cassiel for notifying me of the embed code format change.

Location:
typekit-fonts-for-wordpress/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • typekit-fonts-for-wordpress/trunk/readme.txt

    r538367 r576400  
    44Tags: typekit, fonts, font, design, wp, multisite, wpmu 
    55Requires at least: 3.1 
    6 Tested up to: 3.4 
    7 Stable tag: 1.3.1 
     6Tested up to: 3.4.1 
     7Stable tag: 1.4 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    5050= Which web browser(s) does Typekit support? = 
    5151 
    52 Please see [this page](http://getsatisfaction.com/typekit/topics/typekit_browser_support) for information on [Typekit web browser support](http://getsatisfaction.com/typekit/topics/typekit_browser_support).  
     52Please see [this page](http://help.typekit.com/customer/portal/articles/6786-browser-and-os-support) for information on [Typekit web browser support](http://help.typekit.com/customer/portal/articles/6786-browser-and-os-support). 
    5353 
    5454== Screenshots == 
     
    5757 
    5858== Changelog == 
     59 
     60= 1.4 = 
     61* Use the new scheme-less typekit.net embed code format ( //use.typekit.net/xyz.js ). 
    5962 
    6063= 1.3.1 = 
     
    9396== Upgrade Notice == 
    9497 
     98= 1.4 = 
     99* Adds support for Typekit's new embed code format. 
     100 
    95101= 1.3.1 = 
    96102* WordPress 3.4 compatibility, clarify license as GPLv2 or later. 
  • typekit-fonts-for-wordpress/trunk/typekit-admin.php

    r399063 r576400  
    103103            <li><?php _e('Enter the whole 2 lines of your embed code into the box below.', 'om4-typekit'); ?><br /> 
    104104                <p class="option"><label for="embedcode"><?php _e('Typekit Embed Code:', 'om4-typekit'); ?></label> <textarea name="embedcode" rows="3" cols="80"><?php echo esc_textarea( $this->typekitInstance->GetEmbedCode() ); ?></textarea><br /> 
    105                 <?php _e('Note: If you website loads over SSL/HTTPS, then the SSL Typekit embed code is used automatically (regardless of which scheme is pasted above).', 'om4-typekit'); ?></p> 
    106  
    107105            </li> 
    108106            <li><?php _e('You can add selectors using the Typekit Kit Editor. Alternatively you can define your own CSS rules in your own style sheet or using the Custom CSS Rules field below (technical note: these CSS rules will be embedded in the header of each page). Look at the advanced examples shown in the Typekit editor for ideas.', 'om4-typekit'); ?> 
  • typekit-fonts-for-wordpress/trunk/typekit.php

    r538367 r576400  
    44Plugin URI: http://om4.com.au/wordpress-plugins/typekit-fonts-for-wordpress-plugin/ 
    55Description: Use a range of hundreds of high quality fonts on your WordPress website by integrating the <a href="http://typekit.com">Typekit</a> font service into your WordPress blog. 
    6 Version: 1.3.1 
     6Version: 1.4 
    77Author: OM4 
    88Author URI: http://om4.com.au/ 
     
    4242    var $admin; 
    4343     
    44     var $embedcode = '<script type="text/javascript" src="%s://use.typekit.com/%s.js"></script> 
     44    var $embedcode = '<script type="text/javascript" src="//use.typekit.net/%s.js"></script> 
    4545<script type="text/javascript">try{Typekit.load();}catch(e){}</script>'; 
    4646     
     
    4949     *  
    5050     * The ID can contain numbers and letters only 
     51     * 
     52     * Ref: http://core.trac.wordpress.org/changeset/21166 
    5153     *  
    5254     * @var string 
    5355     */ 
    54     var $embedcoderegexp = '#http(s?)://use\.typekit\.com/([a-z0-9]*)\.js#i'; 
    55      
    56     /** 
    57      * The format for the Typekit JS file URL 
     56    var $embedcoderegexp = '#(https?:)?//use\.typekit\.(com|net)/([a-z0-9]*)\.js#i'; 
     57     
     58    /** 
     59     * The format for the Typekit JS file URL. Used in HTTP requests to verify that the URL doesn't produce a 404 error 
    5860     *  
    5961     * @var string 
    6062     */ 
    61     var $embedcodeurl = '%s://use.typekit.com/%s.js'; 
     63    var $embedcodeurl = '%s://use.typekit.net/%s.js'; 
    6264     
    6365    /* 
     
    170172     */ 
    171173    function GetEmbedCode() { 
    172         if ('' != $id = $this->GetAccountID()) return sprintf($this->embedcode, $this->scheme, $id); 
     174        if ('' != $id = $this->GetAccountID()) return sprintf($this->embedcode, $id); 
    173175        return ''; 
    174176    } 
     
    192194        $this->settings['id'] = ''; 
    193195        // Attempt to extract the kit ID from the embed code using our regular expression 
    194         if (preg_match($this->embedcoderegexp, $code, $matches) && sizeof($matches) == 3) { 
    195             $this->settings['id'] = $matches[2]; 
     196        if ( preg_match($this->embedcoderegexp, $code, $matches) && 4 == sizeof($matches) ) { 
     197            $this->settings['id'] = $matches[3]; 
    196198        } 
    197199    } 
     
    231233<style type="text/css"> 
    232234<?php echo $this->settings['css']; ?> 
    233  
    234235</style> 
    235236<?php 
    236237        } 
    237238?> 
     239 
    238240<!-- END Typekit Fonts for WordPress --> 
    239241 
Note: See TracChangeset for help on using the changeset viewer.