Typekit Fonts for WordPress - Version 1.4

Version Description

  • Use the new scheme-less typekit.net embed code format ( //use.typekit.net/xyz.js ).
Download this release

Release Info

Developer jamescollins
Plugin Icon 128x128 Typekit Fonts for WordPress
Version 1.4
Comparing to
See all releases

Code changes from version 1.3.1 to 1.4

languages/om4-typekit.pot CHANGED
@@ -1,14 +1,14 @@
1
- # Copyright (C) 2010
2
  # This file is distributed under the same license as the package.
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: \n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/typekit-fonts-for-wordpress\n"
7
- "POT-Creation-Date: 2011-03-28 01:09:19+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2010-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
@@ -92,13 +92,7 @@ msgstr ""
92
  msgid "Typekit Embed Code:"
93
  msgstr ""
94
 
95
- #: typekit-admin.php:105
96
- msgid ""
97
- "Note: If you website loads over SSL/HTTPS, then the SSL Typekit embed code "
98
- "is used automatically (regardless of which scheme is pasted above)."
99
- msgstr ""
100
-
101
- #: typekit-admin.php:108
102
  msgid ""
103
  "You can add selectors using the Typekit Kit Editor. Alternatively you can "
104
  "define your own CSS rules in your own style sheet or using the Custom CSS "
@@ -107,50 +101,50 @@ msgid ""
107
  "editor for ideas."
108
  msgstr ""
109
 
110
- #: typekit-admin.php:109
111
  msgid "Custom CSS Rules:"
112
  msgstr ""
113
 
114
- #: typekit-admin.php:110
115
  msgid "Click here for help on CSS"
116
  msgstr ""
117
 
118
- #: typekit-admin.php:115
119
  msgid "Save Settings"
120
  msgstr ""
121
 
122
- #: typekit-admin.php:117
123
  msgid "Help"
124
  msgstr ""
125
 
126
- #: typekit-admin.php:118
127
  msgid "Fonts not showing?"
128
  msgstr ""
129
 
130
- #: typekit-admin.php:120
131
  msgid ""
132
  "Have you created your Typekit account, added fonts to it and <strong>pressed "
133
  "Publish</strong>? Fonts aren't available until they are published."
134
  msgstr ""
135
 
136
- #: typekit-admin.php:121
137
  msgid ""
138
  "Have you <strong>waited a few minutes</strong> to allow Typekit time to send "
139
  "your fonts out around the world? Grab a cup of coffee and try again soon."
140
  msgstr ""
141
 
142
- #: typekit-admin.php:122
143
  msgid ""
144
  "Have you <strong>added CSS rules</strong> to display your fonts? If in "
145
  "doubt, just try the H2 rule shown in the example and see if that works for "
146
  "you."
147
  msgstr ""
148
 
149
- #: typekit-admin.php:124
150
  msgid "CSS"
151
  msgstr ""
152
 
153
- #: typekit-admin.php:125
154
  msgid ""
155
  "You can use CSS selectors to apply your new typekit fonts. The settings for "
156
  "this plugin allow you to add new CSS rules to your website to activate "
@@ -159,7 +153,7 @@ msgid ""
159
  "good way to access different font weights."
160
  msgstr ""
161
 
162
- #: typekit-admin.php:126
163
  msgid ""
164
  "There are many options for using CSS, but here are a few common scenarios. "
165
  "Note: we've used proxima-nova for our examples, you'll need to change "
@@ -167,44 +161,44 @@ msgid ""
167
  "names will be visible in the Kit Editor."
168
  msgstr ""
169
 
170
- #: typekit-admin.php:127
171
  msgid "Headings"
172
  msgstr ""
173
 
174
- #: typekit-admin.php:129
175
  msgid ""
176
  "If you want your Typekit fonts to be used for H2 headings, add a rule like "
177
  "this to your CSS Rules field:"
178
  msgstr ""
179
 
180
- #: typekit-admin.php:131
181
  msgid ""
182
  "(and you can add similar rules if you want to target other headings such as "
183
  "H3)"
184
  msgstr ""
185
 
186
- #: typekit-admin.php:133
187
  msgid "Sidebar Headings"
188
  msgstr ""
189
 
190
- #: typekit-admin.php:135
191
  msgid ""
192
  "If you want your Typekit fonts to be used for sidebar H2 headings, add a "
193
  "rule like this to your CSS Rules field:"
194
  msgstr ""
195
 
196
- #: typekit-admin.php:138
197
  msgid "Font Weights"
198
  msgstr ""
199
 
200
- #: typekit-admin.php:139
201
  msgid ""
202
  "If your Kit contains more than one weight and/or style for a particular "
203
  "font, you need to use numeric <code class=\"inline\">font-weight</code> "
204
  "values in your CSS rules to map to a font's weights."
205
  msgstr ""
206
 
207
- #: typekit-admin.php:140
208
  msgid ""
209
  "Typekit fonts have been assigned values from 100 to 900 based on information "
210
  "from the font's designer. Web browsers also do some guessing as to which "
@@ -215,15 +209,15 @@ msgid ""
215
  "corresponds to <code class=\"inline\">font-weight: normal;</code>"
216
  msgstr ""
217
 
218
- #: typekit-admin.php:141
219
  msgid "See <a href=\"%s\">this help article</a> for more details."
220
  msgstr ""
221
 
222
- #: typekit-admin.php:142
223
  msgid "Advanced targetting of fonts with CSS selectors"
224
  msgstr ""
225
 
226
- #: typekit-admin.php:144
227
  msgid ""
228
  "You can target your fonts to specific parts of your website if you know a "
229
  "bit more about your current WordPress theme and where the font family is "
@@ -235,33 +229,33 @@ msgid ""
235
  "for that selector to override that rule."
236
  msgstr ""
237
 
238
- #: typekit-admin.php:145
239
  msgid "For example, if your theme has this CSS rule:"
240
  msgstr ""
241
 
242
- #: typekit-admin.php:147
243
  msgid ""
244
  "you could create this rule to apply your new font to the body of your "
245
  "website:"
246
  msgstr ""
247
 
248
- #: typekit-admin.php:150
249
  msgid "Where to go to get help"
250
  msgstr ""
251
 
252
- #: typekit-admin.php:152
253
  msgid ""
254
  "<a href=\"http://getsatisfaction.com/typekit/\" target=\"_blank\">Typekit "
255
  "Support</a>"
256
  msgstr ""
257
 
258
- #: typekit-admin.php:153
259
  msgid ""
260
  "<a href=\"http://www.sitepoint.com/forums/forumdisplay.php?f=53\" target="
261
  "\"_blank\">Sitepoint CSS Forums</a>"
262
  msgstr ""
263
 
264
- #: typekit-admin.php:154
265
  msgid ""
266
  "<a href=\"http://www.w3schools.com/CSS/default.asp\" target=\"_blank"
267
  "\">W3Schools CSS Help</a>"
1
+ # Copyright (C) 2012
2
  # This file is distributed under the same license as the package.
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: \n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/typekit-fonts-for-wordpress\n"
7
+ "POT-Creation-Date: 2012-07-24 00:15:28+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2012-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
92
  msgid "Typekit Embed Code:"
93
  msgstr ""
94
 
95
+ #: typekit-admin.php:106
 
 
 
 
 
 
96
  msgid ""
97
  "You can add selectors using the Typekit Kit Editor. Alternatively you can "
98
  "define your own CSS rules in your own style sheet or using the Custom CSS "
101
  "editor for ideas."
102
  msgstr ""
103
 
104
+ #: typekit-admin.php:107
105
  msgid "Custom CSS Rules:"
106
  msgstr ""
107
 
108
+ #: typekit-admin.php:108
109
  msgid "Click here for help on CSS"
110
  msgstr ""
111
 
112
+ #: typekit-admin.php:113
113
  msgid "Save Settings"
114
  msgstr ""
115
 
116
+ #: typekit-admin.php:115
117
  msgid "Help"
118
  msgstr ""
119
 
120
+ #: typekit-admin.php:116
121
  msgid "Fonts not showing?"
122
  msgstr ""
123
 
124
+ #: typekit-admin.php:118
125
  msgid ""
126
  "Have you created your Typekit account, added fonts to it and <strong>pressed "
127
  "Publish</strong>? Fonts aren't available until they are published."
128
  msgstr ""
129
 
130
+ #: typekit-admin.php:119
131
  msgid ""
132
  "Have you <strong>waited a few minutes</strong> to allow Typekit time to send "
133
  "your fonts out around the world? Grab a cup of coffee and try again soon."
134
  msgstr ""
135
 
136
+ #: typekit-admin.php:120
137
  msgid ""
138
  "Have you <strong>added CSS rules</strong> to display your fonts? If in "
139
  "doubt, just try the H2 rule shown in the example and see if that works for "
140
  "you."
141
  msgstr ""
142
 
143
+ #: typekit-admin.php:122
144
  msgid "CSS"
145
  msgstr ""
146
 
147
+ #: typekit-admin.php:123
148
  msgid ""
149
  "You can use CSS selectors to apply your new typekit fonts. The settings for "
150
  "this plugin allow you to add new CSS rules to your website to activate "
153
  "good way to access different font weights."
154
  msgstr ""
155
 
156
+ #: typekit-admin.php:124
157
  msgid ""
158
  "There are many options for using CSS, but here are a few common scenarios. "
159
  "Note: we've used proxima-nova for our examples, you'll need to change "
161
  "names will be visible in the Kit Editor."
162
  msgstr ""
163
 
164
+ #: typekit-admin.php:125
165
  msgid "Headings"
166
  msgstr ""
167
 
168
+ #: typekit-admin.php:127
169
  msgid ""
170
  "If you want your Typekit fonts to be used for H2 headings, add a rule like "
171
  "this to your CSS Rules field:"
172
  msgstr ""
173
 
174
+ #: typekit-admin.php:129
175
  msgid ""
176
  "(and you can add similar rules if you want to target other headings such as "
177
  "H3)"
178
  msgstr ""
179
 
180
+ #: typekit-admin.php:131
181
  msgid "Sidebar Headings"
182
  msgstr ""
183
 
184
+ #: typekit-admin.php:133
185
  msgid ""
186
  "If you want your Typekit fonts to be used for sidebar H2 headings, add a "
187
  "rule like this to your CSS Rules field:"
188
  msgstr ""
189
 
190
+ #: typekit-admin.php:136
191
  msgid "Font Weights"
192
  msgstr ""
193
 
194
+ #: typekit-admin.php:137
195
  msgid ""
196
  "If your Kit contains more than one weight and/or style for a particular "
197
  "font, you need to use numeric <code class=\"inline\">font-weight</code> "
198
  "values in your CSS rules to map to a font's weights."
199
  msgstr ""
200
 
201
+ #: typekit-admin.php:138
202
  msgid ""
203
  "Typekit fonts have been assigned values from 100 to 900 based on information "
204
  "from the font's designer. Web browsers also do some guessing as to which "
209
  "corresponds to <code class=\"inline\">font-weight: normal;</code>"
210
  msgstr ""
211
 
212
+ #: typekit-admin.php:139
213
  msgid "See <a href=\"%s\">this help article</a> for more details."
214
  msgstr ""
215
 
216
+ #: typekit-admin.php:140
217
  msgid "Advanced targetting of fonts with CSS selectors"
218
  msgstr ""
219
 
220
+ #: typekit-admin.php:142
221
  msgid ""
222
  "You can target your fonts to specific parts of your website if you know a "
223
  "bit more about your current WordPress theme and where the font family is "
229
  "for that selector to override that rule."
230
  msgstr ""
231
 
232
+ #: typekit-admin.php:143
233
  msgid "For example, if your theme has this CSS rule:"
234
  msgstr ""
235
 
236
+ #: typekit-admin.php:145
237
  msgid ""
238
  "you could create this rule to apply your new font to the body of your "
239
  "website:"
240
  msgstr ""
241
 
242
+ #: typekit-admin.php:148
243
  msgid "Where to go to get help"
244
  msgstr ""
245
 
246
+ #: typekit-admin.php:150
247
  msgid ""
248
  "<a href=\"http://getsatisfaction.com/typekit/\" target=\"_blank\">Typekit "
249
  "Support</a>"
250
  msgstr ""
251
 
252
+ #: typekit-admin.php:151
253
  msgid ""
254
  "<a href=\"http://www.sitepoint.com/forums/forumdisplay.php?f=53\" target="
255
  "\"_blank\">Sitepoint CSS Forums</a>"
256
  msgstr ""
257
 
258
+ #: typekit-admin.php:152
259
  msgid ""
260
  "<a href=\"http://www.w3schools.com/CSS/default.asp\" target=\"_blank"
261
  "\">W3Schools CSS Help</a>"
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: jamescollins, glenn-om4
3
  Donate link: http://om4.com.au/wordpress-plugins/#donate
4
  Tags: typekit, fonts, font, design, wp, multisite, wpmu
5
  Requires at least: 3.1
6
- Tested up to: 3.4
7
- Stable tag: 1.3.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -49,7 +49,7 @@ Yes, see the plugin's description for more information.
49
 
50
  = Which web browser(s) does Typekit support? =
51
 
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).
53
 
54
  == Screenshots ==
55
  1. Settings/configuration page
@@ -57,6 +57,9 @@ Please see [this page](http://getsatisfaction.com/typekit/topics/typekit_browser
57
 
58
  == Changelog ==
59
 
 
 
 
60
  = 1.3.1 =
61
  * WordPress 3.4 compatibility.
62
  * Clarify license as GPLv2 or later.
@@ -92,6 +95,9 @@ Please see [this page](http://getsatisfaction.com/typekit/topics/typekit_browser
92
 
93
  == Upgrade Notice ==
94
 
 
 
 
95
  = 1.3.1 =
96
  * WordPress 3.4 compatibility, clarify license as GPLv2 or later.
97
 
3
  Donate link: http://om4.com.au/wordpress-plugins/#donate
4
  Tags: typekit, fonts, font, design, wp, multisite, wpmu
5
  Requires at least: 3.1
6
+ Tested up to: 3.4.1
7
+ Stable tag: 1.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
49
 
50
  = Which web browser(s) does Typekit support? =
51
 
52
+ Please 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).
53
 
54
  == Screenshots ==
55
  1. Settings/configuration page
57
 
58
  == Changelog ==
59
 
60
+ = 1.4 =
61
+ * Use the new scheme-less typekit.net embed code format ( //use.typekit.net/xyz.js ).
62
+
63
  = 1.3.1 =
64
  * WordPress 3.4 compatibility.
65
  * Clarify license as GPLv2 or later.
95
 
96
  == Upgrade Notice ==
97
 
98
+ = 1.4 =
99
+ * Adds support for Typekit's new embed code format.
100
+
101
  = 1.3.1 =
102
  * WordPress 3.4 compatibility, clarify license as GPLv2 or later.
103
 
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
typekit-admin.php CHANGED
@@ -102,8 +102,6 @@ class OM4_Typekit_Admin {
102
  <ol start="4">
103
  <li><?php _e('Enter the whole 2 lines of your embed code into the box below.', 'om4-typekit'); ?><br />
104
  <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
-
107
  </li>
108
  <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'); ?>
109
  <p class="option"><label for="css"><?php _e('Custom CSS Rules:', 'om4-typekit'); ?></label> <textarea name="css" rows="10" cols="80"><?php echo esc_textarea( $this->typekitInstance->GetCSSRules() ); ?></textarea><br />
102
  <ol start="4">
103
  <li><?php _e('Enter the whole 2 lines of your embed code into the box below.', 'om4-typekit'); ?><br />
104
  <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
  </li>
106
  <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'); ?>
107
  <p class="option"><label for="css"><?php _e('Custom CSS Rules:', 'om4-typekit'); ?></label> <textarea name="css" rows="10" cols="80"><?php echo esc_textarea( $this->typekitInstance->GetCSSRules() ); ?></textarea><br />
typekit.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Typekit Fonts for WordPress
4
  Plugin URI: http://om4.com.au/wordpress-plugins/typekit-fonts-for-wordpress-plugin/
5
  Description: 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
7
  Author: OM4
8
  Author URI: http://om4.com.au/
9
  Text Domain: om4-typekit
@@ -41,24 +41,26 @@ class OM4_Typekit {
41
 
42
  var $admin;
43
 
44
- var $embedcode = '<script type="text/javascript" src="%s://use.typekit.com/%s.js"></script>
45
  <script type="text/javascript">try{Typekit.load();}catch(e){}</script>';
46
 
47
  /**
48
  * Perl-based regular expression that is used to extract the ID from the typekit embed code
49
  *
50
  * The ID can contain numbers and letters only
 
 
51
  *
52
  * @var string
53
  */
54
- var $embedcoderegexp = '#http(s?)://use\.typekit\.com/([a-z0-9]*)\.js#i';
55
 
56
  /**
57
- * The format for the Typekit JS file URL
58
  *
59
  * @var string
60
  */
61
- var $embedcodeurl = '%s://use.typekit.com/%s.js';
62
 
63
  /*
64
  * Default settings
@@ -169,7 +171,7 @@ class OM4_Typekit {
169
  * @return string The typekit embed code if the unique account ID has been set, otherwise an empty string
170
  */
171
  function GetEmbedCode() {
172
- if ('' != $id = $this->GetAccountID()) return sprintf($this->embedcode, $this->scheme, $id);
173
  return '';
174
  }
175
 
@@ -191,8 +193,8 @@ class OM4_Typekit {
191
 
192
  $this->settings['id'] = '';
193
  // 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
  }
197
  }
198
 
@@ -230,11 +232,11 @@ class OM4_Typekit {
230
 
231
  <style type="text/css">
232
  <?php echo $this->settings['css']; ?>
233
-
234
  </style>
235
  <?php
236
  }
237
  ?>
 
238
  <!-- END Typekit Fonts for WordPress -->
239
 
240
  <?php
3
  Plugin Name: Typekit Fonts for WordPress
4
  Plugin URI: http://om4.com.au/wordpress-plugins/typekit-fonts-for-wordpress-plugin/
5
  Description: 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.4
7
  Author: OM4
8
  Author URI: http://om4.com.au/
9
  Text Domain: om4-typekit
41
 
42
  var $admin;
43
 
44
+ var $embedcode = '<script type="text/javascript" src="//use.typekit.net/%s.js"></script>
45
  <script type="text/javascript">try{Typekit.load();}catch(e){}</script>';
46
 
47
  /**
48
  * Perl-based regular expression that is used to extract the ID from the typekit embed code
49
  *
50
  * The ID can contain numbers and letters only
51
+ *
52
+ * Ref: http://core.trac.wordpress.org/changeset/21166
53
  *
54
  * @var string
55
  */
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
60
  *
61
  * @var string
62
  */
63
+ var $embedcodeurl = '%s://use.typekit.net/%s.js';
64
 
65
  /*
66
  * Default settings
171
  * @return string The typekit embed code if the unique account ID has been set, otherwise an empty string
172
  */
173
  function GetEmbedCode() {
174
+ if ('' != $id = $this->GetAccountID()) return sprintf($this->embedcode, $id);
175
  return '';
176
  }
177
 
193
 
194
  $this->settings['id'] = '';
195
  // Attempt to extract the kit ID from the embed code using our regular expression
196
+ if ( preg_match($this->embedcoderegexp, $code, $matches) && 4 == sizeof($matches) ) {
197
+ $this->settings['id'] = $matches[3];
198
  }
199
  }
200
 
232
 
233
  <style type="text/css">
234
  <?php echo $this->settings['css']; ?>
 
235
  </style>
236
  <?php
237
  }
238
  ?>
239
+
240
  <!-- END Typekit Fonts for WordPress -->
241
 
242
  <?php