Update of /cvsroot/sandweb/sandweb/bin
In directory usw-pr-cvs1:/tmp/cvs-serv3566
Modified Files:
sandweb.cgi
Log Message:
it is _really_ annoying when you accidently view/edit a big binary
file.
For now, viewing or editing non-text files inline is not permitted.
I think the correct way to do this is to ask the user if they are
sure ( maybe even have a checkbox for "Never ask this again"? would be
cool. We need a more generic mechanism, would be a cool pref though ).
Anyway, I think the user should just see the download button, and
maybe this warning, if the file does not appear to be text.
Index: sandweb.cgi
===================================================================
RCS file: /cvsroot/sandweb/sandweb/bin/sandweb.cgi,v
retrieving revision 1.88
retrieving revision 1.89
diff -U2 -r1.88 -r1.89
--- sandweb.cgi 2001/12/04 19:35:24 1.88
+++ sandweb.cgi 2001/12/05 19:42:08 1.89
@@ -396,6 +396,10 @@
}
elsif ( $command eq 'view' ) {
- if ( "$file->get_file_type()" eq "Binary" ) {
+ if ( "$file->get_file_type()" ne "Text" ) {
set_error("This does not appear to be a text file.");
+ browse_menu(
+ cookie => $cookie,
+ path => $location,
+ );
}
my @tmp;
@@ -435,6 +439,10 @@
);
}
- if ( $file->get_file_type() eq "Binary" ) {
+ if ( $file->get_file_type() ne "Text" ) {
set_error("This does not appear to be a text file.");
+ browse_menu(
+ cookie => $cookie,
+ path => $location,
+ );
}
my @tmp;
|