Update of /cvsroot/freevo/freevo/src/www/htdocs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24114
Modified Files:
library.rpy
Log Message:
Finally add confirm delete.
Index: library.rpy
===================================================================
RCS file: /cvsroot/freevo/freevo/src/www/htdocs/library.rpy,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** library.rpy 15 May 2004 02:08:34 -0000 1.24
--- library.rpy 9 Jun 2004 01:46:30 -0000 1.25
***************
*** 12,15 ****
--- 12,18 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.25 2004/06/09 01:46:30 rshortt
+ # Finally add confirm delete.
+ #
# Revision 1.24 2004/05/15 02:08:34 mikeruelle
# yet another unicode fix
***************
*** 256,262 ****
--- 259,271 ----
else:
messages += [ '<b>'+_('ERROR') + '</b>: ' +_('No new file
specified.') ]
+
elif action == 'delete':
messages += [ _( 'Delete %s.' ) % ('<b>'+file_loc+'</b>') ]
if os.path.exists(file_loc): os.unlink(file_loc)
+ file_loc_fxd = os.path.splitext(file_loc)[0] + '.fxd'
+ if os.path.exists(file_loc_fxd):
+ os.unlink(file_loc_fxd)
+ messages += [ _('Delete %s.') % file_loc_fxd ]
+
elif action == 'download':
sys.stderr.write('download %s\n' % String(file_loc))
***************
*** 264,267 ****
--- 273,277 ----
return static.File(file_loc).render(request)
#request.finish()
+
else:
messages += [ '<b>'+_('ERROR') + '</b>: ' + _( '%s does not exist.
No action taken.') % ('<b>'+file_loc+'</b>') ]
***************
*** 277,280 ****
--- 287,298 ----
fv.printHeader(_('Media Library'), 'styles/main.css', selected=_("Media
Library"))
fv.res += '<script language="JavaScript"><!--' + "\n"
+
+ fv.res += 'function deleteFile(basedir, file, mediatype) {' + "\n"
+ fv.res += ' okdelete=window.confirm("Do you wish to delete "+file+"
and its fxd?");' + "\n"
+ fv.res += ' if(!okdelete) return;' + "\n"
+ fv.res += ' document.location="' + action_script
+'?action=delete&file=" + escape(file) + "&dir=" + basedir + "&media=" + mediatype;' +
"\n"
+ #filelink = '<a
href="'+action_script+'?media=%s&dir=%s&action=%s&file=%s">%s</a>'
+ fv.res += '}' + "\n"
+
fv.res += 'function renameFile(basedir, file, mediatype) {' + "\n"
fv.res += ' newfile=window.prompt("New name please.", file);' + "\n"
***************
*** 282,285 ****
--- 300,304 ----
fv.res += ' document.location="' + action_script
+'?action=rename&file=" + escape(file) + "&newfile=" + escape(newfile) + "&dir=" +
basedir + "&media=" + mediatype;' + "\n"
fv.res += '}' + "\n"
+
fv.res += '//--></script>' + "\n"
fv.res += ' <br/>\n'
***************
*** 446,451 ****
file_esc = urllib.quote(String(file))
dllink = ('<a href="'+action_script+'%s">'+_('Download')+'</a>')
% Unicode(os.path.join(basedir,file))
! filelink = '<a
href="'+action_script+'?media=%s&dir=%s&action=%s&file=%s">%s</a>'
! delete = filelink % (action_mediatype, basedir, 'delete',
file_esc,_('Delete'))
rename = ('<a
href="javascript:renameFile(\'%s\',\'%s\',\'%s\')">'+_("Rename")+'</a>') % (basedir,
file_esc, action_mediatype)
fv.tableCell(rename + ' ' + delete + ' ' +
dllink, 'class="'+status+'" colspan="1"')
--- 465,471 ----
file_esc = urllib.quote(String(file))
dllink = ('<a href="'+action_script+'%s">'+_('Download')+'</a>')
% Unicode(os.path.join(basedir,file))
! #filelink = '<a
href="'+action_script+'?media=%s&dir=%s&action=%s&file=%s">%s</a>'
! # delete = filelink % (action_mediatype, basedir, 'delete',
file_esc,_('Delete'))
! delete = ('<a
href="javascript:deleteFile(\'%s\',\'%s\',\'%s\')">'+_("Delete")+'</a>') % (basedir,
file_esc, action_mediatype)
rename = ('<a
href="javascript:renameFile(\'%s\',\'%s\',\'%s\')">'+_("Rename")+'</a>') % (basedir,
file_esc, action_mediatype)
fv.tableCell(rename + ' ' + delete + ' ' +
dllink, 'class="'+status+'" colspan="1"')
-------------------------------------------------------
This SF.Net email is sponsored by: GNOME Foundation
Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event.
GNOME Users and Developers European Conference, 28-30th June in Norway
http://2004/guadec.org
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog