My favorites | Sign in
Project Logo
                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/*
Plugin Name: codeWord
Plugin URI: http://codeword.joelstarnes.co.uk/
Description: A souped-up version of the CodePress editor to allow you to edit your themes in beautiful, syntax coloured, line numbered, auto-completing code.
Author: Joel Starnes
Version: 0.1
Author URI: http://joelstarnes.co.uk/

INSPIRATIONS/CREDITS:
Code Editor - naden.de
CodePress modified - T.Otani
and all the contributers to WordPress and CodePress.

WordPress Plugin ,, ,,
by Joel Starnes 7MM `7MMF' A `7MF' `7MM
.g8""bg, MM `MA ,MA ,V MM
.dP' ,pW"Wq. ,M""bMM .gP"Ya VM: ,VVM: ,V ,pW"Wq.`7Mb,od8 ,M""bMM
dM' 6W' `WbP MM d' Yb MM. M' MM. M'6W' `Wb MM' AP MM
MM. 8M MII M8 d"fwwa' `MM A' `MM A' 8M M8 MM 8MI MM
`Mb. YA. ,A,b MY A. ,, :MM; :MM; YA. ,A9 MM `Mb MM
`"bmmd'`Ybmd9' Wbmd"MD Mbmmd' VF VF `Ybmd9'.JMML. `Wbmd"MML.*/

// Pre-2.6 compatibility
if ( !defined('WP_CONTENT_URL') )
define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content');
if ( !defined('WP_CONTENT_DIR') )
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );

// Guess the location
$codeWord_path = WP_CONTENT_DIR.'/plugins/'.plugin_basename(dirname(__FILE__));
$codeWord_url = WP_CONTENT_URL.'/plugins/'.plugin_basename(dirname(__FILE__));

function codeWord_footer() {
global $codeWord_url;
// 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_url);
}

function codeWord_scripts() {
global $codeWord_url;
wp_enqueue_script('jquery-form');
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.js',array('jquery'), '1.0' );

if(function_exists('wp_enqueue_style')){
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');
}else{
// Pre-2.6 compatibility
printf('<link rel="stylesheet" type="text/css" href="%s/codeword.css" />', $codeWord_url);
printf('<link rel="stylesheet" type="text/css" href="%s/autocomplete/jquery.autocomplete.css" />', $codeWord_url);
}
}

// 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');
}






?>
Show details Hide details

Change log

r150 by JoelStarnes on Jul 12, 2008   Diff
12 jul updates
Go to: 
Project members, sign in to write a code review

Older revisions

r144 by JoelStarnes on Jul 07, 2008   Diff
re-written function lookup with jquery
autocomplete plugin
r143 by JoelStarnes on Jul 07, 2008   Diff
introduced ajax saving
r70 by JoelStarnes on Jul 03, 2008   Diff
v0.2
All revisions of this file

File info

Size: 3202 bytes, 70 lines
Hosted by Google Code