Google Groups Home
Help | Sign in
[WPSoC][Mid-term update] codeWord progress so far...
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Joel  
View profile
 More options Jul 9, 2:30 pm
From: Joel <joelstar...@gmail.com>
Date: Wed, 9 Jul 2008 19:30:56 +0100
Local: Wed, Jul 9 2008 2:30 pm
Subject: [wp-hackers] [WPSoC][Mid-term update] codeWord progress so far...
Evening everyone,

My summer of code project is a plugin named codeWord, it implements
CodePress into the WP theme code editor, but with a few additional
features and fixes.
 1. It now uses some simple jquery ajax code for saving, which avoids
having to reload the whole page.
 2. If you attempt to navigate away, but haven't saved your recent
changes it shows a prompt.
 3. It has an dropdown input that auto-completes WP functions.
 4. Plus a few little fixes here and there, notably I fixed the tab
key to insert a tab character.

I still have a fair bit of work left to do getting everything running
smoothly, but I'd appreciate any feedback on my work so far.

In my remaining time I hope to develop the function lookup, adding in
default parameters for each function and linking them through to the
relevant page on the codex.

If you'd like to take a look round the plugin, then checkout my code
from the WPSoC repository[1] and if you'd like to keep up to speed
with my progress then grab a feed from my blog[2].

Cheers Joel.
[1] http://code.google.com/p/wordpress-soc-2008/source/browse/trunk/joel/...
[2] http://joelstarnes.co.uk/blog
_______________________________________________
wp-hackers mailing list
wp-hack...@lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Otto  
View profile
 More options Jul 11, 11:17 am
From: Otto <o...@ottodestruct.com>
Date: Fri, 11 Jul 2008 10:17:09 -0500
Local: Fri, Jul 11 2008 11:17 am
Subject: Re: [wp-hackers] [WPSoC][Mid-term update] codeWord progress so far...
Gotta say that I'm not a fan of the way you're inserting the scripts...

Problem 1: A stylesheet link in the footer? Does not validate. Move it
to the header section.
Problem 2: Why are you not using wp_enqueue_script? Looks like you
made an abortive attempt at that? Try this sort of thing:

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_styles('jquery-autocomplete',
'/wp-content/plugins/codeword/autocomplete/jquery.autocomplete.css',
array(), '1.0.2' );

}

add_action('admin_menu', 'codeWord_scripts');

That will work for both the styles and the scripts. Note that the
enqueue style stuff is new to WordPress 2.6, I think.
_______________________________________________
wp-hackers mailing list
wp-hack...@lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Otto  
View profile
 More options Jul 11, 11:30 am
From: Otto <o...@ottodestruct.com>
Date: Fri, 11 Jul 2008 10:30:59 -0500
Local: Fri, Jul 11 2008 11:30 am
Subject: Re: [wp-hackers] [WPSoC][Mid-term update] codeWord progress so far...
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.
_______________________________________________
wp-hackers mailing list
wp-hack...@lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Otto  
View profile
 More options Jul 11, 11:41 am
From: Otto <o...@ottodestruct.com>
Date: Fri, 11 Jul 2008 10:41:34 -0500
Local: Fri, Jul 11 2008 11:41 am
Subject: Re: [wp-hackers] [WPSoC][Mid-term update] codeWord progress so far...
Other minor nitpicks:

That manual definition of the plugin directory/URL in codeword.php is
not needed. There's a constant of WP_PLUGIN_URL that holds the URL to
the plugins, so WP_PLUGIN_URL . 'codeword' would be good enough to
give you the URL you need.

The function search box has a few issues. When I tried to type "the_",
then it has trouble when I hit the shift key to type the underscore.

The Indent Guides button doesn't seem to do anything. Maybe I'm missing it?

-Otto
_______________________________________________
wp-hackers mailing list
wp-hack...@lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason Webster  
View profile
 More options Jul 11, 12:38 pm
From: Jason Webster <ja...@intraffic.net>
Date: Fri, 11 Jul 2008 09:38:30 -0700
Local: Fri, Jul 11 2008 12:38 pm
Subject: Re: [wp-hackers] [WPSoC][Mid-term update] codeWord progress so far...
I'm assuming that this is only in trunk, am I correct? Not in 2.5.x as
far as I know, and a grep of the source seems to confirm that.

Otto wrote:
>  There's a constant of WP_PLUGIN_URL that holds the URL to
> the plugins...

> -Otto
> _______________________________________________
> wp-hackers mailing list
> wp-hack...@lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

_______________________________________________
wp-hackers mailing list
wp-hack...@lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gaarai  
View profile
 More options Jul 11, 12:41 pm
From: Gaarai <gaa...@gaarai.com>
Date: Fri, 11 Jul 2008 11:41:44 -0500
Local: Fri, Jul 11 2008 12:41 pm
Subject: Re: [wp-hackers] [WPSoC][Mid-term update] codeWord progress so far...
That's correct, but you should start using it now. Planet Ozh has a
great tutorial
<http://planetozh.com/blog/2008/07/what-plugin-coders-must-know-about-...>
on how to handle the switchover while keeping your code pre-2.6 compatible.

- Chris Jean

_______________________________________________
wp-hackers mailing list
wp-hack...@lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason Webster  
View profile
 More options Jul 11, 12:46 pm
From: Jason Webster <ja...@intraffic.net>
Date: Fri, 11 Jul 2008 09:46:38 -0700
Local: Fri, Jul 11 2008 12:46 pm
Subject: Re: [wp-hackers] [WPSoC][Mid-term update] codeWord progress so far...
Thanks for the tip.

_______________________________________________
wp-hackers mailing list
wp-hack...@lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joel  
View profile
 More options Jul 11, 4:46 pm
From: Joel <joelstar...@gmail.com>
Date: Fri, 11 Jul 2008 21:46:44 +0100
Local: Fri, Jul 11 2008 4:46 pm
Subject: Re: [wp-hackers] [WPSoC][Mid-term update] codeWord progress so far...
Thanks for all the help Otto,

> Gotta say that I'm not a fan of the way you're inserting the scripts...

You're right I really should have been using wp_enqueue_script for the
other scripts that don't need to go in the document body and I'm not
sure why the stylesheet ended up there too, I'll update my code.

> That manual definition of the plugin directory/URL in codeword.php is

not needed. There's a constant of WP_PLUGIN_URL ...
I hadn't heard of the WP_PLUGIN_URL constant yet, so I'll use that
too, thanks Gaarai for the link on backwards compatibility there.

> The function search box has a few issues. When I tried to type "the_",

then it has trouble when I hit the shift key to type the underscore.
Yeah I just changed over the autocomplete script I was using, this one
still needs some work integrating, but I've sorted out the shift key
issue.

Cheers Joel.
_______________________________________________
wp-hackers mailing list
wp-hack...@lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeremy Clarke  
View profile
 More options Jul 13, 5:33 pm
From: "Jeremy Clarke" <jer-wphack...@simianuprising.com>
Date: Sun, 13 Jul 2008 17:33:10 -0400
Local: Sun, Jul 13 2008 5:33 pm
Subject: Re: [wp-hackers] [WPSoC][Mid-term update] codeWord progress so far...

On Fri, Jul 11, 2008 at 11:41 AM, Otto <o...@ottodestruct.com> wrote:
> Other minor nitpicks:

> That manual definition of the plugin directory/URL in codeword.php is
> not needed. There's a constant of WP_PLUGIN_URL that holds the URL to
> the plugins, so WP_PLUGIN_URL . 'codeword' would be good enough to
> give you the URL you need.

Awesome, everyone can appreciate that advice. Thanks.

--
Jeremy Clarke
Code and Design | globalvoicesonline.org
_______________________________________________
wp-hackers mailing list
wp-hack...@lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google