- <?php if ( user_can_richedit() ) {
- $language = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) );
- // Add TinyMCE languages
- @include_once( dirname(__FILE__).'/../wp-includes/js/tinymce/langs/wp-langs.php' );
- if ( isset($strings) ) echo $strings; ?>
- (function() {
- var base = tinymce.baseURL, sl = tinymce.ScriptLoader, ln = "<?php echo $language; ?>";
- sl.markDone(base + '/langs/' + ln + '.js');
- sl.markDone(base + '/themes/advanced/langs/' + ln + '.js');
- sl.markDone(base + '/themes/advanced/langs/' + ln + '_dlg.js');
- })();
-
- tinyMCE.init({
- mode: "textareas",
- editor_selector: "mceEditor",
- language : "<?php echo $language; ?>",
- width: "100%",
- height: "300",
- theme : "advanced",
- theme_advanced_buttons1 : "bold,italic,underline,blockquote,separator,strikethrough,bullist,numlist,undo,redo,link,unlink",
- theme_advanced_buttons2 : "",
- theme_advanced_buttons3 : "",
- theme_advanced_toolbar_location : "top",
- theme_advanced_toolbar_align : "left",
- theme_advanced_statusbar_location : "bottom",
- theme_advanced_resizing : true,
- theme_advanced_resize_horizontal : false,
- skin : "wp_theme",
- dialog_type : "modal",
- relative_urls : false,
- remove_script_host : false,
- convert_urls : false,
- apply_source_formatting : false,
- remove_linebreaks : true,
- accessibility_focus : false,
- tab_focus : ":next",
- plugins : "safari,inlinepopups",
- entities : "38,amp,60,lt,62,gt",
- force_p_newlines : true,
- save_callback : 'switchEditors.saveCallback'
- });
- <?php } ?>
-
- jQuery('#tags-input').hide();
-
- tag_update_quickclicks();
-
- // add the quickadd form
- jQuery('#jaxtag').prepend('<span id="ajaxtag"><input type="text" name="newtag" id="newtag" class="form-input-tip" size="16" autocomplete="off" value="'+postL10n.addTag+'" /><input type="submit" class="button" id="tagadd" value="' + postL10n.add + '" tabindex="3" onclick="return false;" /><input type="hidden"/><input type="hidden"/><span class="howto">'+postL10n.separate+'</span></span>');
-
- jQuery('#tagadd').click( tag_flush_to_text );
- jQuery('#newtag').focus(function() {
- if ( this.value == postL10n.addTag )
- jQuery(this).val( '' ).removeClass( 'form-input-tip' );
- });
- jQuery('#newtag').blur(function() {
- if ( this.value == '' )
- jQuery(this).val( postL10n.addTag ).addClass( 'form-input-tip' );
- });
-
- // auto-save tags on post save/publish
- jQuery('#publish').click( tag_save_on_publish );
- jQuery('#save-post').click( tag_save_on_publish );