Outputs thickboxL10.first/last/open only when needed (i.e. when selected "Mouse Click - Image - Next, !Prev/Next or Open" option)

This commit is contained in:
attosoft committed 2012-08-11 05:09:15 +00:00
1 parent 2ada5e6e39
commit f57309eeca
1 file changed
+8 -5
+8 -5
View File
@@ -138,19 +138,22 @@ class auto_thickbox {
}
wp_enqueue_script('thickbox');
if ( $this->options['builtin_res'] == 'off' ) {
wp_localize_script('thickbox', 'thickboxL10n', array(
$l10n = array(
'next' => $this->texts['next'],
'prev' => $this->texts['prev'],
'first' => $this->texts['first'],
'last' => $this->texts['last'],
'image' => $this->texts['image'],
'of' => $this->texts['of'],
'close' => $this->texts['close'],
'open' => $this->texts['open'],
'noiframes' => $this->util->__('This feature requires inline frames. You have iframes disabled or your browser does not support them.'),
'loadingAnimation' => $this->options['img_load'] != 'none' ? $this->options['img_load'] : $this->options_def['img_load'],
'closeImage' => $this->options['img_close_btn'] != 'none' ? $this->options['img_close_btn'] : $this->options_def['img_close_btn']
));
);
switch ($this->options['click_img']) {
case 'prev_next': $l10n['last'] = $this->texts['last']; // not break
case 'next': $l10n['first'] = $this->texts['first']; break;
case 'open': $l10n['open'] = $this->texts['open']; break;
}
wp_localize_script('thickbox', 'thickboxL10n', $l10n);
}
} # scripts()