Be the first to write a review
Building Rich Text Editor. Part VII
Introduction
This is the final article of the series on building online Rich Text Editor.
While creating the application in the course of the series (Part I to Part VI) we have covered various development techniques utilizing both client-side and server-side technologies.
At this point our Editor resembles a lightweight desktop text editor not only by look and feel but also the impressive array of tools for editing, formatting and file manipulations.
In Part VI we have built the Server File Browser – a small widget for browsing dedicated web folder. This tool is designed to work in a manner similar to Windows Explorer, so we can load and save HTML-based documents from/to the server. Now we can select or enter the name for the file we want to open or save, but the actual functionality for saving and loading has not yet been built. We will cover this gap in the current article.
We will also tie up some loose ends so our application can be complete.
Building Open and Save functionality
We are going to start exactly where we left off – in the Server File Browser module.
At this stage when we run the application in the browser we can open the Server File Browser and select or enter the name for the file to be opened or saved.
Once a file has been selected the dialog will close and call the corresponding function (either openFile() or saveFile()) located in the main window. This is the function that performs the task in open_save.php:
function passValue(v,e){
if(v!=""){
if(window.opener!=null){
with(window.opener){
<?php if(isset($_GET['a']) && isset($_GET['a'])=="s"){?>
saveFile(v,e);
<?php } else{ ?>
openFile(v);
<?php } ?>
}
}
window.close();
}
}
Although at this point both functions are in place on the Editor page, they contain no code –something we need to take care of.
Alex July
Alex July is a Vancouver-based (Canada, British Columbia) Web Developer/ Graphic Artist who has an extensive experience in both creative realms.
He is also a host of Linecraft.com where he is showcasing his skills and sharing experience with the developers community. For the past 3 years Alex has been focusing on the development of Rich Internet Applications using Macromedia Flash technology.
When away from the computer Alex is practicing Martial Arts, playing guitar and enjoying time with his wonderful family.