Browse Source

Add files via upload

Capitan Cloud 1 year ago
parent
commit
d10209f48c
2 changed files with 18 additions and 5 deletions
  1. 5 4
      radxide.tcl
  2. 13 1
      tree.tcl

+ 5 - 4
radxide.tcl

@@ -28,7 +28,7 @@
 #
 ###########################################################
 
-set version "1.4.5" 
+set version "1.4.6" 
 set os "$::tcl_platform(os) $::tcl_platform(osVersion)"
 
 package provide radxide $version
@@ -189,12 +189,13 @@ namespace eval radxide {
   set menu(GOTO_ENTRY_IDX) 11;
   
   # a couplle of extension definitions..
-  set dan(PhpExts) {.php .php2 .php3 .php4 .php5 .funny .inc}     ;# extensions of php files
-  set dan(HtmlExts) {.html .htm}                                  ;# extensions of html files
+  set dan(PhpExts) {.php .php2 .php3 .php4 .php5 .inc}            ;# extensions of php files
+  set dan(HtmlExts) {.html .htm .xml .xsl}                        ;# extensions of html files
   set dan(CssExts) {.css}                                         ;# extensions of css files
   set dan(JsExts) {.js}                                           ;# extensions of js files
   set dan(TxtExts) {.txt .rtf}                                    ;# extensions of txt files
-  set dan(ImgExts) {.gif .png .jpg .jpeg}                         ;# extensions of images
+  set dan(ImgExts) {.gif .png .jpg .jpeg .ico}                    ;# extensions of images
+  set dan(OfficeExts) {.doc .docx .xls .xlsx .ppt .pptx}          ;# extensions of office files
   set dan(BinExts) {.so .o .exe}                                  ;# extensions of binary
      
 # __________________ iswindows ___________________ #

+ 13 - 1
tree.tcl

@@ -609,6 +609,18 @@ namespace eval tree {
 		return no
 	}
 
+# ________________________ isOfficeFile _________________________ #
+
+	proc isOfficeFile {fname} {
+		# Checks if a file is of isOfficeFile.
+		#   fname - file name
+
+		if {[string tolower [file extension $fname]] in $radxide::dan(OfficeExts)} {
+		  return yes
+		}
+		return no
+	}
+
 # ________________________ isPhp _________________________ #
 
 	proc isPhp {fname} {
@@ -669,7 +681,7 @@ namespace eval tree {
 	  			return
 				 }
 		
-				if {$isfile && (![isBin $fname]) && (![isImage $fname])} {
+				if {$isfile && (![isBin $fname]) && (![isOfficeFile $fname]) && (![isImage $fname])} {
 					 $dan(TEXT) config -state normal
 					 $dan(TEXT) delete 1.0 end 
 					 $dan(TEXT) insert 1.0 [::radxide::filelib::openFile $fname]