edit_media.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 rename_mitem(item)
00026 {
00027   var msg = T_("Rename 'v_item' to:").replace(/v_item/, item);
00028   var new_item = prompt(msg);
00029   if (new_item==null || new_item=='')  return;
00030   var event_args =  'item='+item+';new_item='+new_item;
00031   SendEvent('edit_media', 'rename', event_args);
00032 }
00033 
00034 function delete_mitem(item)
00035 {
00036   var msg = T_("Your are deleting 'v_item'!").replace(/v_item/, item);
00037   if (confirm(msg))
00038     {
00039       SendEvent('edit_media', 'delete', 'item='+item);
00040     }
00041 }
00042 
00043 function upload_file()
00044 {
00045   var new_win = window.open('', 'upload_message', 'width=200,height=150');
00046   var file = document.upload.media_file.value;
00047   var uploading = T_("Uploading:");
00048   var please_wait = T_("Please wait...");
00049   var win_content = "<html>\n"
00050     + "<head>\n"
00051     + " <title>" + uploading + " " + file + " </title>\n"
00052     + " <style>\n"
00053     + "   body \n"
00054     + "   { \n"
00055     + "     background-color: #f8fff8; \n"
00056     + "     margin: 10px; \n"
00057     + "     font-family: sans-serif; \n"
00058     + "     font-size: 10pt; \n"
00059     + "     color: #000066; \n"
00060     + "   } \n"
00061     + "   h1 { font-size: 12pt; color: #000066; } \n"
00062     + "   h2 { font-size: 10pt; color: #aa0000; } \n"
00063     + " </style>\n"
00064     + "</head>\n"
00065     + "<body>\n"
00066     + "  <h1>" + uploading + " " + file + " </h1>\n"
00067     + "  <h2>" + please_wait + "<h2>\n"
00068     + "</body>\n"
00069     + "</html>\n";
00070   new_win.document.write(win_content);
00071 
00072   document.upload.submit();
00073   SendEvent('edit_media', 'upload', 'file='+file);
00074 }

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