The main goal for this project is to create a new framework to implement multi user edition using AJAX into Drupal. Although there are some tools to do collaborative edition so far, almost all of them are proprietary software and the presence in the open source world is still scarce. In addition, none of them has been intended to integrate with any content management system yet, probably until Google decides to use writely everywhere.
Another important challenge for the project is implement new prototypes with COMET technology and use them where appropriate. COMET uses the http streaming pattern to push information from server to client, providing real synchronous communication between client and server whereas AJAX pulls the information with periodic refreshes to emulate the same.
This group will focus on discussions and feedback to support the Google Summer of Code project. The accepted project description at http://www.ernestdelgado.com/wiki/index.php/Drupal
Project page: http://drupal.org/project/collaborative_editor
CVS repository viewer: http://cvs.drupal.org/viewcvs/drupal/contributions/modules/collaborative_editor/
IMPORTANT: If you want to test the module it's better to read this before -> How to test the module
XHTML Strict in drupal
The first idea for this project was using iframe element (Iframe element) to build the editor instead of using textareas. Despite of it would have been more difficult to write the cross browser functions, it gave us the chance to use design mode and in the future to extend the possible content inside the iframe to use as rich text editor handling the DOM structure that would be inside
However, the use of HTML Strict in Drupal didn't let me to try this, at least this way. As of the version 1.6 of the module I've changed the point of view, functions, tests and drafts to use textareas and plain text. Not too bad
Read moreHeartbeat pattern
Once the iframe is created and after the design mode is activated I call the activateHearBeat() function. This function does the refresh loop of the document calling itself with the setTimeOut() js function and calling the updateDocument() on each iteration.
<?php
function activateHeartBeat()
{
updateDocument();
setTimeout(function () { activateHeartBeat(); }, 3000);
}
?>The updateDocument() is now very simple but it will have to set all post vars to send them to the server in each async call.
<?php
function updateDocument()
{
// set post vars
// (...)
.
// do async call
a bit of history might be helpful
Below you'll find a summary of some the email exchange between me and Ernest. It would be good if anyone interested commented on the various issues discussed there. Reading through that again makes me feel like a chatterbox. No one is perfect :)
Ernest: I'll go back to the crossbrowser details once we see the collaborative edition working on the screen as we said, even if it's only in FF for now.
Vlado: Are the cross-browser problems mainly related to design mode? Can the design mode be avoided, at least for the time being?
Ernest The issues I posted yesterday concerned only to the iform creation and design mode. I don't see now a means to avoid the design mode, do you?
Read moreIframe element
The files uploaded for this project so far are collaborative_editor.module and drupal.collaborative_editor.js under collaborative_editor module folder
Brief summary of the first steps:
- Test different hook functions: Done
- Test asyncronous calls: Done
- Insert iframe (create content subsection): Done - Current phase // it works in FF
- Insert asyncrounous calls to refresh the iframe content (heartbeat): Comming soon
The current stage (insert iframe) has the following pending issues in order to be crossbrowser:
Read more