Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
par7133 committed Dec 19, 2023
1 parent 627b72c commit d10209f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
9 changes: 5 additions & 4 deletions radxide.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 ___________________ #
Expand Down
14 changes: 13 additions & 1 deletion tree.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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} {
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit d10209f

Please sign in to comment.