[wp-hackers] [WPSoC][Mid-term update] codeWord progress so far...

Otto otto at ottodestruct.com
Fri Jul 11 15:30:59 GMT 2008


Additional: Just tried it, this code works with 2.6 beta 3:

function codeWord_footer() {	
	global $codeWord_abs_dir;
	// the codeWord_url variable must be set incase WordPress is not
installed in the base url.
	printf('<script type="text/javascript">var codeWord_url =
\'%s\';</script>', get_bloginfo('wpurl'));
	// add main js file to determine the current filetype and browser and
serve the according codePress engine.
	printf('<script type="text/javascript"
src="%s/codeword.js"></script>', $codeWord_abs_dir);
}

function codeWord_scripts() {
       wp_enqueue_script('jquery-form'); // already defined by wordpress
       wp_enqueue_script('jquery-bgiframe',
'/wp-content/plugins/codeword/autocomplete/jquery.bgiframe.min.js',
array('jquery'), '2.1.1' );
       wp_enqueue_script('jquery-autocomplete',
'/wp-content/plugins/codeword/autocomplete/jquery.autocomplete.js',
array('jquery'), '1.0.2' );
       wp_enqueue_script('localdata',
'/wp-content/plugins/codeword/autocomplete/localdata',
array('jquery'), '1.0' );
       wp_enqueue_style('jquery-autocomplete',
'/wp-content/plugins/codeword/autocomplete/jquery.autocomplete.css',
array(), '1.0.2' );
       wp_enqueue_style('codeword',
'/wp-content/plugins/codeword/codeword.css', array(), '1.0');
}

// check the url to see if the current page is the theme editor, if so
then chocks away..
if(strpos($_SERVER[ 'REQUEST_URI' ], 'theme-editor.php') !== false) {
	add_action('admin_footer', 'codeWord_footer');
	add_action('admin_menu', 'codeWord_scripts');
}


It's very neat, actually. I like the syntax highlighting and the
ability to use the Tab key correctly in the theme editor.


More information about the wp-hackers mailing list