summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/modules/after-the-deadline/install_atd_l10n.js')
-rw-r--r--plugins/jetpack/modules/after-the-deadline/install_atd_l10n.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/jetpack/modules/after-the-deadline/install_atd_l10n.js b/plugins/jetpack/modules/after-the-deadline/install_atd_l10n.js
new file mode 100644
index 00000000..7d18bb9a
--- /dev/null
+++ b/plugins/jetpack/modules/after-the-deadline/install_atd_l10n.js
@@ -0,0 +1,24 @@
+/* a quick poor man's sprintf */
+function atd_sprintf(format, values) {
+ var result = format;
+ for (var x = 0; x < values.length; x++)
+ result = result.replace(new RegExp('%' + (x + 1) + '\\$', 'g'), values[x]);
+ return result;
+}
+
+/* init the autoproofread options */
+function install_atd_l10n() {
+ /* install L10n strings into TinyMCE if it's present */
+ if ( typeof( tinyMCE ) != 'undefined' && typeof( tinyMCEPreInit ) != 'undefined' )
+ tinyMCE.addI18n(tinyMCEPreInit.mceInit.language + '.AtD', AtD_l10n_r0ar);
+
+ /* set the AtD l10n instance */
+ AtD.addI18n(AtD_l10n_r0ar);
+}
+
+/* document.ready() does not execute in IE6 unless it's at the bottom of the page. oi! */
+if (navigator.appName == 'Microsoft Internet Explorer')
+ setTimeout( install_atd_l10n, 2500 );
+else
+ jQuery( document ).ready( install_atd_l10n );
+