Would be so nice to edit content in textarea fields with this JavaScript implementation of Vi:
http://gpl.internetconnection.net/vi/

Yeah, I know, Vi is far from being WYSIWYG (well, actually, this is quite arguable ...), but as far as I can see in the Filters/Editors category for 6.x, there is no better place than here to ask for such a feature, i.e. support of one more editor for the textarea fields.

CommentFileSizeAuthor
#5 jsvi.patch3.05 KBacrollet

Comments

sun’s picture

Status: Active » Postponed
zephyr325’s picture

seconded!

sun’s picture

Component: Wysiwyg Editor » Code

Problem: Above link only points to a demo page in the meanwhile. To add support for this editor, we need a proper project homepage URL, download URL, and possibly also proper releases.

sun’s picture

Status: Postponed » Closed (won't fix)

The vi editor project is not listed on http://gpl.internetconnection.net/

Wysiwyg API can only support official editor libraries, which have their own issue trackers and (third party) project space.

acrollet’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Status: Closed (won't fix) » Needs review
StatusFileSize
new3.05 KB

Hi there,

I've decided to address the project space issue by forking vi.js and hosting it here:

http://github.com/acrollet/jsvi

Since the code is GPL, I believe I'm well within my rights doing so... This provides project space and an issue tracker. (not that I probably need to explain github to anyone here!)

patch for wysiwyg vi.js support attached - it's against 2.0 because the Debug module currently doesn't have any code, making it impossible to enable wysiwyg-3... I'll be happy to make any fixes needed to the patch, it's tested working on my end on the latest acquia drupal.

agentdcooper’s picture

i think this is a great project from what I could tell from playing around with jsvi @ http://gpl.internetconnection.net/vi/

so I tried this out myself on my drupal 6.14 site, with wysiwyg-6.x.2, as I love me some VI -- the patch worked great, the files got placed where they needed to be placed in the wyswyg module directories... I then downloaded vi.js and placed it in 2 locations = sites/all/libraries/ & sites/all/libraries/jsvi/ ... I was able to setup jsvi within drupal, from the wysiwyg admin profiles, and enabled it for multiple input formats. my trouble comes in when I goto create content, I get nothing ... no jsvi =(

am I doing something wrong? is there a file I am missing? or...? any help is much appreciated.

acrollet’s picture

@agentdcooper - I'm sorry to hear that you're having trouble getting it to work. Can you get any other editors to work? (nicedit, tinymce, what have you) Have you tried clearing your cache? (both browser and drupal site)

agentdcooper’s picture

oh yes, I've got fckeditor working, and ckeditor up and running under wysiwyg module 6.x-2.x-dev ... I am gonna give this a shot again, this time removing the module and all settings, and starting from scratch with wysiwyg module 6.x-2.x-dev and see how that works, as you sound pretty confident it SHOULD WORK =)

thanks for the suggestions, I will report back shortly...

agentdcooper’s picture

IT WORKS! I know what the issue was, I had wysiwyg-6.x-2.0, NOT wysiwyg-6.x-2.x-dev = which I now have (x-dev version)! thanks for the tip, much appreciated.

this plugin is even more awsome then I thought!

acrollet’s picture

great, glad to hear it!

twod’s picture

Wow, I've been using vim a lot lately and this is really cool. Not the best editor for WYSIWYG tho hehe.

Here's some pointers if you like to keep building on this.

+++ editors/css/jsvi.css	2009-10-16 14:57:43.000000000 -0500
@@ -0,0 +1,20 @@
+.editor {
+  color: #333;
+  background-color: #eee;
+}
+
+html,body {
+  margin: 0;
+  padding: 0;
+  height: 100%;
+}
+
+.print, .editor, .editorcursor { display: none; }
+@media print {
+  .editor { display:none !important; }
+  html,body { overflow:auto !important; }
+  .editorcursor { display:none !important; }
+  .print {position:absolute;top:0;left:0;display:block !important;font-family:monospace;height:100%;}
+  .editortools {display:none !important;}
+  textarea,input { display:none !important;}
+}
+++ editors/js/jsvi.js	2009-10-16 22:36:12.000000000 -0500
@@ -0,0 +1,24 @@
+  // vi.js is full screen, so it's not possible to click the 'switch to plaintext' link

We can't let editor styles change what the document looks like, especially the html and body elements, because we can't predict what the theme looks like. Add a selector like 'html.jsvi_active' to the styles so they can be toggled on/off when the editor activates.

+++ editors/js/jsvi.js	2009-10-16 22:36:12.000000000 -0500
@@ -0,0 +1,24 @@
+  scroll(0,0);
+  // fire 'er up
+  editor(body_object);

We can't let a 'fullscreen' widget activate on page load. This also does not work when there are multiple fields using the editor. You could use the attach method to put an event handler on the textarea so that it activates on focus/click, like in the demo, and then run this code.

+++ editors/js/jsvi.js	2009-10-16 22:36:12.000000000 -0500
@@ -0,0 +1,24 @@
+  // vi.js is full screen, so it's not possible to click the 'switch to plaintext' link

We do need this to be implemented in some way, other things can trigger a detach as well. How about using this to remove those event handlers?

It would alse be very nice if the library itself could be wrapped in its own scope to not pollute the global namespace.

This review is powered by Dreditor.

twod’s picture

Status: Needs review » Needs work

If not postponed, this does need some work.