mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-06 00:34:00 +01:00
ondrag over, if dir not expand or this, expand
Mean you can drag items to folders and they expand so you may drop to a sub dir inside
This commit is contained in:
@@ -152,7 +152,7 @@ for ($i=0;$i<count($finalArray);$i++) {
|
||||
}
|
||||
$type == "folder" ? $class = 'pft-directory' : $class = 'pft-file '.strtolower($ext);
|
||||
$loadParam = $type == "folder" ? "true" : "false";
|
||||
echo "<li class=\"".$class."\" draggable=\"false\" ondrag=\"top.ICEcoder.draggingWithKeyTest(event);if(top.ICEcoder.getcMInstance()){top.ICEcoder.editorFocusInstance.indexOf('diff') == -1 ? top.ICEcoder.getcMInstance().focus() : top.ICEcoder.getcMdiffInstance().focus()}\" ondragend=\"top.ICEcoder.dropFile(this)\"><a nohref title=\"$fileFolderName\" onMouseOver=\"parentNode.draggable=true;top.ICEcoder.overFileFolder('$type',this.childNodes[1].id)\" onMouseOut=\"parentNode.draggable=false;top.ICEcoder.overFileFolder('$type','')\" onClick=\"if(!event.ctrlKey && !top.ICEcoder.cmdKey) {top.ICEcoder.openCloseDir(this,$loadParam); if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {top.ICEcoder.openFile()}}\" style=\"position: relative; left:-22px\"> <span id=\"".str_replace($docRoot,"",str_replace("/","|",$fileFolderName))."\">".xssClean(basename($fileFolderName),"html")."</span> ";
|
||||
echo "<li class=\"".$class."\" draggable=\"false\" ondrag=\"top.ICEcoder.draggingWithKeyTest(event);if(top.ICEcoder.getcMInstance()){top.ICEcoder.editorFocusInstance.indexOf('diff') == -1 ? top.ICEcoder.getcMInstance().focus() : top.ICEcoder.getcMdiffInstance().focus()}\" ondragend=\"top.ICEcoder.dropFile(this)\"><a nohref title=\"$fileFolderName\" onMouseOver=\"parentNode.draggable=true;top.ICEcoder.overFileFolder('$type',this.childNodes[1].id)\" onMouseOut=\"parentNode.draggable=false;top.ICEcoder.overFileFolder('$type','')\" ondragover=\"if(parentNode.nextSibling && parentNode.nextSibling.tagName != 'UL' && top.ICEcoder.thisFileFolderLink != this.childNodes[1].id) {top.ICEcoder.openCloseDir(this,true);}\" onClick=\"if(!event.ctrlKey && !top.ICEcoder.cmdKey) {top.ICEcoder.openCloseDir(this,$loadParam); if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {top.ICEcoder.openFile()}}\" style=\"position: relative; left:-22px\"> <span id=\"".str_replace($docRoot,"",str_replace("/","|",$fileFolderName))."\">".xssClean(basename($fileFolderName),"html")."</span> ";
|
||||
$thisPermVal = $serverType=="Linux" ? substr(sprintf('%o', fileperms($docRoot.$iceRoot.$fileFolderName)), -3) : '';
|
||||
$permColors = $thisPermVal == 777 ? 'background: #800; color: #eee' : 'color: #888';
|
||||
echo '<span style="'.$permColors.'; font-size: 8px" id="'.str_replace($docRoot,"",str_replace("/","|",$fileFolderName)).'_perms">';
|
||||
|
||||
@@ -1401,7 +1401,7 @@ var ICEcoder = {
|
||||
locNest = targetElem.parentNode.parentNode.nextSibling;
|
||||
newText = document.createTextNode("\n");
|
||||
permColors = perms == 777 ? 'background: #800; color: #eee' : 'color: #888';
|
||||
innerLI = '<a nohref title="'+location.replace(/\/$/, "")+"/"+file+'" onMouseOver="parentNode.draggable=true;top.ICEcoder.overFileFolder(\''+actionElemType+'\',this.childNodes[1].id)" onMouseOut="parentNode.draggable=false;top.ICEcoder.overFileFolder(\''+actionElemType+'\',\'\')" onClick="if(!event.ctrlKey && !top.ICEcoder.cmdKey) {top.ICEcoder.openCloseDir(this,'+(actionElemType=="folder" ? 'true' : 'false')+'); if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {top.ICEcoder.openFile()}}" style="position: relative; left:-22px"> <span id="'+location.replace(/\/$/, "").replace(/\//g,"|")+"|"+file+'">'+file+'</span> <span style="'+permColors+'; font-size: 8px" id="'+location.replace(/\/$/, "").replace(/\//g,"|")+"|"+file+'_perms">'+perms+'</span></a>';
|
||||
innerLI = '<a nohref title="'+location.replace(/\/$/, "")+"/"+file+'" onMouseOver="parentNode.draggable=true;top.ICEcoder.overFileFolder(\''+actionElemType+'\',this.childNodes[1].id)" onMouseOut="parentNode.draggable=false;top.ICEcoder.overFileFolder(\''+actionElemType+'\',\'\')" ondragover="if(parentNode.nextSibling && parentNode.nextSibling.tagName != \'UL\' && top.ICEcoder.thisFileFolderLink != this.childNodes[1].id) {top.ICEcoder.openCloseDir(this,true);}" onClick="if(!event.ctrlKey && !top.ICEcoder.cmdKey) {top.ICEcoder.openCloseDir(this,'+(actionElemType=="folder" ? 'true' : 'false')+'); if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {top.ICEcoder.openFile()}}" style="position: relative; left:-22px"> <span id="'+location.replace(/\/$/, "").replace(/\//g,"|")+"|"+file+'">'+file+'</span> <span style="'+permColors+'; font-size: 8px" id="'+location.replace(/\/$/, "").replace(/\//g,"|")+"|"+file+'_perms">'+perms+'</span></a>';
|
||||
// If we don't have at least 3 DOM items in here, it's an empty folder
|
||||
if(locNest.childNodes.length<3) {
|
||||
// We now need to begin a new UL list
|
||||
|
||||
2
lib/ice-coder.min.js
vendored
2
lib/ice-coder.min.js
vendored
@@ -60,7 +60,7 @@ c.length;a++)top.ICEcoder.showHide("hide",top.get(c[a])),top.get(c[a]+"Nav").sty
|
||||
1].replace(/\//g,"|"))||top.ICEcoder.selectFileFolder(a);a=129;c=window.innerHeight;"undefined"!=typeof top.ICEcoder.thisFileFolderLink&&""!=top.ICEcoder.thisFileFolderLink&&(b=-1<top.ICEcoder.selectedFiles[0].indexOf(".")?"file":"folder",top.get("folderMenuItems").style.display="folder"==b&&1==top.ICEcoder.selectedFiles.length?"block":"none","folder"==b&&1==top.ICEcoder.selectedFiles.length&&(a+=67,"block"==top.get("fmMenuPasteOption").style.display&&(a+=19)),top.get("singleFileMenuItems").style.display=
|
||||
1<top.ICEcoder.selectedFiles.length?"none":"block",1==top.ICEcoder.selectedFiles.length&&(a+=43),top.get("fileMenu").style.display="inline-block",setTimeout(function(){top.get("fileMenu").style.opacity="1"},4),top.get("fileMenu").style.left=top.ICEcoder.mouseX+20+"px",b=top.ICEcoder.mouseY-top.ICEcoder.filesFrame.contentWindow.document.body.scrollTop-10,b+a>c&&(b-=b+a-c),top.get("fileMenu").style.top=b+"px");return!1},showFileMenu:function(){top.get("fileMenu").style.display="inline-block";setTimeout(function(){top.get("fileMenu").style.opacity=
|
||||
"1"},4)},hideFileMenu:function(){top.get("fileMenu").style.display="none";top.get("fileMenu").style.opacity="0"},updateFileManagerList:function(a,b,c,d,f,e,g){var k,h,l,n,p,m,r;if("add"==a&&!top.get("filesFrame").contentWindow.document.getElementById(b.replace(top.iceRoot,"").replace(/\/$/,"").replace(/\//g,"|")+"|"+c)){k="file"==g?"pft-file ext-"+c.substr(c.indexOf(".")+1):"pft-directory";d="file"==g?top.ICEcoder.newFilePerms:top.ICEcoder.newDirPerms;b||(b="/");b=b.replace(top.iceRoot,"/");b=b.replace("//",
|
||||
"/");h=top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\//g,"|"));l=h.parentNode.parentNode.nextSibling;n=document.createTextNode("\n");p=777==d?"background: #800; color: #eee":"color: #888";p='<a nohref title="'+b.replace(/\/$/,"")+"/"+c+'" onMouseOver="parentNode.draggable=true;top.ICEcoder.overFileFolder(\''+g+"',this.childNodes[1].id)\" onMouseOut=\"parentNode.draggable=false;top.ICEcoder.overFileFolder('"+g+"','')\" onClick=\"if(!event.ctrlKey && !top.ICEcoder.cmdKey) {top.ICEcoder.openCloseDir(this,"+
|
||||
"/");h=top.get("filesFrame").contentWindow.document.getElementById(b.replace(/\//g,"|"));l=h.parentNode.parentNode.nextSibling;n=document.createTextNode("\n");p=777==d?"background: #800; color: #eee":"color: #888";p='<a nohref title="'+b.replace(/\/$/,"")+"/"+c+'" onMouseOver="parentNode.draggable=true;top.ICEcoder.overFileFolder(\''+g+"',this.childNodes[1].id)\" onMouseOut=\"parentNode.draggable=false;top.ICEcoder.overFileFolder('"+g+"','')\" ondragover=\"if(parentNode.nextSibling && parentNode.nextSibling.tagName != 'UL' && top.ICEcoder.thisFileFolderLink != this.childNodes[1].id) {top.ICEcoder.openCloseDir(this,true);}\" onClick=\"if(!event.ctrlKey && !top.ICEcoder.cmdKey) {top.ICEcoder.openCloseDir(this,"+
|
||||
("folder"==g?"true":"false")+'); if (/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)) {top.ICEcoder.openFile()}}" style="position: relative; left:-22px"> <span id="'+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'">'+c+'</span> <span style="'+p+'; font-size: 8px" id="'+b.replace(/\/$/,"").replace(/\//g,"|")+"|"+c+'_perms">'+d+"</span></a>";if(3>l.childNodes.length)m=document.createElement("ul"),l=h.parentNode.parentNode,l.parentNode.insertBefore(m,
|
||||
l.nextSibling),m=document.createElement("li"),m.className=k,m.draggable=!1,m.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())},m.ondragend=function(){top.ICEcoder.dropFile(this)},m.innerHTML=p,l.nextSibling.appendChild(m),l.nextSibling.appendChild(n);else for(h=0;h<l.childNodes.length;h++)if(l.childNodes[h].className&&(m=0<l.childNodes[h].className.indexOf("directory")?
|
||||
"folder":"file",r=l.childNodes[h].getElementsByTagName("span")[0].innerHTML,m==g&&r>c||"folder"==g&&"file"==m||h==l.childNodes.length-1)){m=document.createElement("li");m.className=k;m.draggable=!1;m.ondrag=function(a){top.ICEcoder.draggingWithKeyTest(a);top.ICEcoder.getcMInstance()&&(-1==top.ICEcoder.editorFocusInstance.indexOf("diff")?top.ICEcoder.getcMInstance().focus():top.ICEcoder.getcMdiffInstance().focus())};m.ondragend=function(){top.ICEcoder.dropFile(this)};m.innerHTML=p;h==l.childNodes.length-
|
||||
|
||||
Reference in New Issue
Block a user