edit.js

Go to the documentation of this file.
00001 //-*-C-*-
00002 /*
00003   This file is part of  DocBookWiki.  DocBookWiki is a web application
00004   that displays and edits DocBook documents.
00005 
00006   Copyright (C) 2004, 2005, 2006, 2007
00007   Dashamir Hoxha, dashohoxha@users.sourceforge.net
00008 
00009   DocBookWiki is free software;  you can redistribute it and/or modify
00010   it under the terms of the GNU General Public License as published by
00011   the Free  Software Foundation; either  version 2 of the  License, or
00012   (at your option) any later version.
00013 
00014   DocBookWiki is distributed  in the hope that it  will be useful, but
00015   WITHOUT  ANY   WARRANTY;  without  even  the   implied  warranty  of
00016   MERCHANTABILITY or  FITNESS FOR A  PARTICULAR PURPOSE.  See  the GNU
00017   General Public License for more details.
00018 
00019   You should  have received a copy  of the GNU  General Public License
00020   along  with  DocBookWiki;  if   not,  write  to  the  Free  Software
00021   Foundation, Inc., 59 Temple  Place, Suite 330, Boston, MA 02111-1307
00022   USA
00023 */
00024 
00025 function set_lock(lock)
00026 {
00027   SendEvent('edit', 'set_lock', 'lock='+lock);
00028 }
00029 
00030 function move_up(node_path)
00031 {
00032   SendEvent('edit', 'move_up', 'node_path='+node_path);
00033 }
00034 
00035 function move_down(node_path)
00036 {
00037   SendEvent('edit', 'move_down', 'node_path='+node_path);
00038 }
00039 
00040 function delete_node()
00041 {
00042   var msg = T_("You are deleting this node and all the subnodes.");
00043   if (confirm(msg))
00044     {
00045       SendEvent('edit', 'delete');
00046     }
00047 }
00048 
00049 function change_id()
00050 {
00051   var form = document.update;
00052   var id = form.id.value;
00053 
00054   if (id=='')
00055     {
00056       alert(T_("ID cannot be empty."));
00057       form.id.focus();
00058       return;
00059     }
00060 
00061   SendEvent('edit', 'change_id', 'id='+id);
00062 }
00063 
00064 function change_title()
00065 {
00066   var form = document.update;
00067   var title = form.title.value;
00068 
00069   if (title=='')
00070     {
00071       alert(T_("Title cannot be empty."));
00072       form.title.focus();
00073       return;
00074     }
00075 
00076   SendEvent('edit', 'change_title', 'title='+title);
00077 }
00078 
00079 function add_subnode()
00080 {
00081   var form = document.add;
00082   var id = form.id.value;
00083   var title = form.title.value;
00084   var idx = form.node_type.selectedIndex;
00085   var node_type = form.node_type.options[idx].value;
00086 
00087   if (id=='')
00088     {
00089       alert(T_("Please give an ID."));
00090       form.id.focus();
00091       return;
00092     }
00093   if (title=='')
00094     {
00095       alert(T_("Please give a title."));
00096       form.title.focus();
00097       return;
00098     }
00099 
00100   var event_args = 'id='+id+';title='+title+';type='+node_type;
00101   //alert(event_args);
00102   SendEvent('edit', 'add_subnode', event_args);
00103 }

Generated on Wed Jan 9 08:27:32 2008 for DokBookWiki by  doxygen 1.5.2