Prechádzať zdrojové kódy

Add files via upload

Capitan Cloud 1 rok pred
rodič
commit
3a92323464
3 zmenil súbory, kde vykonal 52 pridanie a 30 odobranie
  1. 7 0
      README.md
  2. 2 2
      radxide.tcl
  3. 43 28
      tree.tcl

+ 7 - 0
README.md

@@ -21,6 +21,13 @@ phpinfo();<br>
 <br>
 Please see "examples/_snippets"
 <br><br>
+RADXIDE enforce the following Project structure: 
+/Private 
+/Public 
+<br><br>
+You can add accessory folders you want them remaining external 
+from the project but remember to add their name in $dan(prjdirignore)
+<br><br>
 RADXIDE and most of code here presented and distributed contains excerpts 
 from [alited](https://github.com/aplsimple/alited) by Alex Plotnikov and 
 contributors to the project.

+ 2 - 2
radxide.tcl

@@ -28,7 +28,7 @@
 #
 ###########################################################
 
-set version "1.3.5" 
+set version "1.3.6" 
 set os "$::tcl_platform(os) $::tcl_platform(osVersion)"
 
 package provide radxide $version
@@ -89,7 +89,7 @@ namespace eval radxide {
   set dan(TEXTSELFG) "red"
   set dan(CURSORCOLOR) "red"
   set dan(CURSORWIDTH) "4"
-  set dan(prjdirignore) {.git .bak} ;# ignored subdirectories of project
+  set dan(prjdirignore) {.git nbproject} ;# ignored subdirectories of project
   
   set project(NAME) ""              ;# project default name
   set project(ROOT) ""              ;# project default root

+ 43 - 28
tree.tcl

@@ -275,10 +275,14 @@ namespace eval tree {
 		
 		$tree insert $parent end -id $itemID -text "$title" \
 		    -values [list $fc $fname $isfile $itemID] -open $isopen -image $imgopt
-		
+
 		foreach item [getDirectoryContent $project(ROOT)] {
-		  set itemID [newItemID [incr iit]]
+		  
 		  lassign $item lev isfile fname fcount iroot
+		  #if {([string first $project(ROOT)/Private $fname] eq -1) && ([string first $project(ROOT)/Public $fname] eq -1)} {
+		  #  continue
+		  #}  
+		  set itemID [newItemID [incr iit]]
 		  #if {$selfile eq $fname} {set selID $itemID}
 		  set title [file tail $fname]
 		  if {$iroot<0} {
@@ -286,6 +290,9 @@ namespace eval tree {
 		  } else {
 		    set parent [newItemID [incr iroot]]
 		  }
+		  #if {$parent eq 0 && ((!$isfile && ($title ne "Private") && ($title ne "Public")) || ($isfile))} {
+		  #  continue
+		  #}
 		  set isopen no
 		  if {$isfile} {
 		  
@@ -343,6 +350,8 @@ namespace eval tree {
 		}
 	}
 
+
+
 # ________________________ delete _________________________ #
 
 	proc deleteFile {ID} {
@@ -495,7 +504,7 @@ namespace eval tree {
 		return $_dirtree
 	}
 
-# ________________________ ignoredDir _________________________ #
+# ________________________ getTree _________________________ #
 
 	proc getTree {{parent {}}} {
 		# Gets a tree or its branch.
@@ -817,32 +826,38 @@ namespace eval tree {
 		set m6 "Open dir"  
 		
 		$popm add command -label $m1 -command { ::radxide::tree::refreshTree }
-		$popm add separator
-		if {$isfile} {
-		  $popm add command -label $m2 -command "::radxide::tree::addFile $ID" -state disabled
-		} else {
-		  $popm add command -label $m2 -command "::radxide::tree::addFile $ID" -state normal
-		}
-		if {$isfile} {  
-  		$popm add command -label $m3 -command "::radxide::tree::renameFile $ID"
-	  	$popm add command -label $m4 -command "::radxide::tree::deleteFile $ID" 
-	  } else {
-	    $popm add command -label $m2f -command "::radxide::tree::addFolder $ID"
-  		if {($fname eq "$project(ROOT)/Public") || ($fname eq "$project(ROOT)/Private")} {
-	  		$popm add command -label $m3f -command "::radxide::tree::renameFolder $ID" -state disabled
-  	  	$popm add command -label $m4f -command "::radxide::tree::delFolder $ID" -state disabled
-  	  } else {
-	  		$popm add command -label $m3f -command "::radxide::tree::renameFolder $ID" -state normal
-  	  	$popm add command -label $m4f -command "::radxide::tree::delFolder $ID" -state disabled
-      }  	  	
-	  }	
-		$popm add separator
-		if {$isfile} {
-		  $popm add command -label $m5 -command "::radxide::tree::openFile $ID" -state normal
-		} else {
-		  $popm add command -label $m5 -command { ::radxide::tree::openFile $ID } -state disabled
-		}  
 		
+		if {$ID ne 0} {
+		
+				$popm add separator
+				if {$isfile} {
+					$popm add command -label $m2 -command "::radxide::tree::addFile $ID" -state disabled
+				} else {
+					$popm add command -label $m2 -command "::radxide::tree::addFile $ID" -state normal
+				}
+				if {$isfile} {  
+					$popm add command -label $m3 -command "::radxide::tree::renameFile $ID"
+					$popm add command -label $m4 -command "::radxide::tree::deleteFile $ID" 
+				} else {
+					$popm add command -label $m2f -command "::radxide::tree::addFolder $ID"
+					if {($fname eq "$project(ROOT)/Public") || ($fname eq "$project(ROOT)/Private")} {
+						$popm add command -label $m3f -command "::radxide::tree::renameFolder $ID" -state disabled
+						$popm add command -label $m4f -command "::radxide::tree::delFolder $ID" -state disabled
+					} else {
+						$popm add command -label $m3f -command "::radxide::tree::renameFolder $ID" -state normal
+						$popm add command -label $m4f -command "::radxide::tree::delFolder $ID" -state disabled
+					}  	  	
+				}	
+				$popm add separator
+				
+				if {$isfile} {
+					$popm add command -label $m5 -command "::radxide::tree::openFile $ID" -state normal
+				} else {
+					$popm add command -label $m5 -command { ::radxide::tree::openFile $ID } -state disabled
+				}  
+    
+    }
+         		
 		set addsel {}
 		if {[llength [$tree selection]]>1} {
 		  if {[$tree tag has tagSel $ID]} {