Forum closed. New forum available at http://community.wymeditor.org/

Firefox plugin

Discuss features, code, contributions, ideas, suggestions, ...
For bugs, patches and feature requests, please post on the Trac:
http://trac.wymeditor.org/

Firefox plugin

Postby dwees on Tue Aug 14, 2007 6:39 am

Hi folks,

I'm working on a Firefox plugin to allow for editing of code (including code syntax highlighting) inside the Firefox (or now Netscape 9.0) browser.

I'm using WYMeditor because I'm familiar with jQuery, and I love the jQuery library.

Anyway, I've got the editor successfully embedded within the Firefox browser (you just click on a menu item and it opens in a new tab). There seems to be some issues with the paths to various files, which I am trying to sort out. None of the pop up buttons currently work because of path problems.

If anyone wants to help me out with that, I would appreciate it. The link to the code is below:

Download fireeditor.xpi

On my todo list:

1. Integrate the Chili (jQuery) code highlighting plugin.
2. Create a 'Save', 'Save as', 'Load', 'New' file menu for the editor.
3. Fix the bug(s) described above.
4. Create an official project on the Firefox extensions page.

Anything else anyone can suggest?
dwees
 
Posts: 5
Joined: Tue Aug 14, 2007 6:28 am

Postby jfh on Mon Aug 20, 2007 8:57 am

Great! Thanks for sharing it, dwees.

About the path problem, perhaps you should rename jquery-1.1.3.1.pack.js to jquery.js, as I don't see jQueryPath in the options.

Quoted from http://trac.wymeditor.org/trac/wiki/0.3/Integration
Note: WYMeditor automagically detects the paths of required CSS and JS files.
You'll need to initialize basePath, cssPath and jQueryPath if you don't use default file names (i.e. jquery.wymeditor.js, wymeditor/skins/{skin name}/screen.css, jquery.js).


I think it'd be convenient to add your plugin to the SVN, so you'll benefit from the versioning and the Trac systems.

Please feel free to drop a mail to the dev mailing-list to announce the plugin to the other developers.

Thanks!
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

SVN is a good idea

Postby dwees on Wed Aug 22, 2007 11:07 am

Yeah, and I've love to find some help with some of the extras for this plugin. At the very least I should add a file open/save/close/new menu to the plugin, etc... to make it actually useful.

This is a total side project for me though so I don't know how regular I'll be making updates to it.

Dave
dwees
 
Posts: 5
Joined: Tue Aug 14, 2007 6:28 am

Re: SVN is a good idea

Postby jfh on Thu Aug 23, 2007 9:24 am

dwees wrote:Yeah, and I've love to find some help with some of the extras for this plugin. At the very least I should add a file open/save/close/new menu to the plugin, etc... to make it actually useful.

Cool - I'd like to help but I'm not used to writing Firefox extensions...

dwees wrote:This is a total side project for me though so I don't know how regular I'll be making updates to it.

OK. Could you please specify the copyright/license you want to distribute it under? Can I include it in the packages?
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

License

Postby dwees on Thu Aug 23, 2007 1:38 pm

GPL/Mozilla Public License is fine with me. I don't intend to try and force people to buy this.

I think I've got just the Mozilla Public license on the files now, but GPL makes sense to me as well.

Dave
dwees
 
Posts: 5
Joined: Tue Aug 14, 2007 6:28 am

Re: License

Postby jfh on Thu Aug 23, 2007 2:37 pm

dwees wrote:GPL/Mozilla Public License is fine with me. I don't intend to try and force people to buy this.

I think I've got just the Mozilla Public license on the files now, but GPL makes sense to me as well.

OK - I guess there aren't licensing issues if you choose MPL/GPL (WYMeditor is MIT/GPL).

Do you think it's possible to point the content/jquery and content/wymeditor directories to existing directories in the repo, so we avoid duplicates?

I mean something like:

wymeditor/trunk/src/apps/fireeditor/
wymeditor/trunk/src/apps/fireeditor/content/
wymeditor/trunk/src/apps/fireeditor/content/js/
wymeditor/trunk/src/apps/fireeditor/defaults/
wymeditor/trunk/src/apps/fireeditor/locale/
wymeditor/trunk/src/apps/fireeditor/skin/

with jquery and wymeditor available at
wymeditor/trunk/src/jquery/
wymeditor/trunk/src/wymeditor/

I guess the build scripts will need some customization.
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

re: modification of location of files

Postby dwees on Thu Aug 23, 2007 11:29 pm

The only issue I see with that is that when someone checks out FireEditor and attempts to install it as an add-on for Firefox (or Navigator 9 now too), the directory structure required for add-ons is quite a bit different. For add-ons, all of the files have to be in a subdirectory of the pluginname folder.

Not sure how to resolve that, because obviously having duplication of files is a problem as well (especially when we are using slightly different versions of jquery).

I don't anticipate jQuery becoming especially popular for Firefox add-ons so I doubt we'd be able to split this up easily.

Dave
dwees
 
Posts: 5
Joined: Tue Aug 14, 2007 6:28 am

Re: re: modification of location of files

Postby jfh on Fri Aug 24, 2007 2:23 pm

dwees wrote:The only issue I see with that is that when someone checks out FireEditor and attempts to install it as an add-on for Firefox (or Navigator 9 now too), the directory structure required for add-ons is quite a bit different. For add-ons, all of the files have to be in a subdirectory of the pluginname folder.

Actually I solved the problem by updating the Makefile.

I've uploaded fireeditor to svn://svn.wymeditor.org/trunk/src/apps/fireeditor

If someone checks out the trunk, he'll need to build Fire Editor by issuing:
Code: Select all
make fireeditor


I've modified fireeditor.html and wymeditor_init.js, mainly to correct the paths.

The XPI builds and installs OK, the editor works fine.

There's still a problem with the pop-ups, which don't load the JS.
I've made local tests and find out that replacing WYMeditor src by chrome://fireeditor/content/wymeditor/wymeditor/jquery.wymeditor.js in the dialogHtml option does the trick, but problems remain in WYM_INIT_DIALOG.
I guess it's related to the 'window' calls, but I'm no FF extension guru.
Any idea?
User avatar
jfh
Site Admin
 
Posts: 370
Joined: Sat Sep 23, 2006 8:43 pm
Location: Belgium

Problem

Postby dwees on Sat Aug 25, 2007 9:29 am

Well one of the src attributes of one of the script elements for each pop-up window has 'undefined' for its source. So I suppose we'd have to trace backwards to figure out where that variable is defined etc... I tried doing this but I'm not familiar enough with the structure of jquery.wymeditor.js to be effective at this type of debugging.

I started by trying to make some changes to jquery.wymeditor.js itself to see if I could figure out the error, but no such luck.

When I get a chance I'm going to focus on creating the file menu stuff next and hopefully inspiration will strike and one of us can solve the pop-up issue.

Dave
dwees
 
Posts: 5
Joined: Tue Aug 14, 2007 6:28 am


Return to Developers

Who is online

Users browsing this forum: No registered users and 0 guests

cron