diff --git a/lib/file-control.php b/lib/file-control.php index b25fbc6..8f3475c 100644 --- a/lib/file-control.php +++ b/lib/file-control.php @@ -4,7 +4,6 @@ include("settings.php"); include("ftp-control.php"); $t = $text['file-control']; ?> - @@ -60,7 +59,7 @@ for ($i=0; $i"); + die("parent.parent.ICEcoder.message('Sorry! - problem with file requested');"); }; } @@ -75,7 +74,7 @@ if ($_GET['action']=="load") { } if (!$canOpen) { - echo 'fileType="nothing"; ICEcoder.message(\''.$t['Sorry, could not...'].' '.$fileLoc."/".$fileName.'\');'; + echo 'fileType="nothing"; parent.parent.ICEcoder.message(\''.$t['Sorry, could not...'].' '.$fileLoc."/".$fileName.'\');'; } elseif (isset($ftpSite) || file_exists($file)) { $finfo = "text"; // Determine what to do based on mime type @@ -91,14 +90,14 @@ if ($_GET['action']=="load") { } if (strpos($finfo,"text")===0 || strpos($finfo, "application/xml")===0 || strpos($finfo,"empty")!==false) { echo 'fileType="text";'; - echo 'ICEcoder.shortURL = ICEcoder.thisFileFolderLink = "'.$fileLoc."/".$fileName.'";'; + echo 'parent.parent.ICEcoder.shortURL = parent.parent.ICEcoder.thisFileFolderLink = "'.$fileLoc."/".$fileName.'";'; // Get file over FTP? if (isset($ftpSite)) { ftpStart(); // Show user warning if no good connection if (!$ftpConn || !$ftpLogin) { - die('ICEcoder.message("Sorry, no FTP connection to '.$ftpHost.' for user '.$ftpUser.'");ICEcoder.serverMessage();ICEcoder.serverQueue("del",0);'); + die('parent.parent.ICEcoder.message("Sorry, no FTP connection to '.$ftpHost.' for user '.$ftpUser.'");parent.parent.ICEcoder.serverMessage();parent.parent.ICEcoder.serverQueue("del",0);'); exit; } // Get our file contents and close the FTP connection @@ -126,7 +125,7 @@ if ($_GET['action']=="load") { echo 'fileType="other";window.open(\'http://'.$_SERVER['SERVER_NAME'].$fileLoc."/".$fileName.'\');'; }; } else { - echo 'fileType="nothing"; ICEcoder.message(\''.$t['Sorry'].', '.$fileLoc."/".$fileName.' '.$t['does not seem...'].'\');'; + echo 'fileType="nothing"; parent.parent.ICEcoder.message(\''.$t['Sorry'].', '.$fileLoc."/".$fileName.' '.$t['does not seem...'].'\');'; } }; @@ -136,26 +135,26 @@ if ($_GET['action']=="load") { if (action=="load") { if (fileType=="text") { setTimeout(function() { - if (!ICEcoder.content.contentWindow.createNewCMInstance) { + if (!parent.parent.ICEcoder.content.contentWindow.createNewCMInstance) { console.log(''); window.location.reload(true); } else { - ICEcoder.loadingFile = true; + parent.parent.ICEcoder.loadingFile = true; // Reset the various states back to their initial setting - selectedTab = ICEcoder.openFiles.length; // The tab that's currently selected + selectedTab = parent.parent.ICEcoder.openFiles.length; // The tab that's currently selected // Finally, store all data, show tabs etc - ICEcoder.createNewTab(); - ICEcoder.cMInstances.push(ICEcoder.nextcMInstance); - ICEcoder.setLayout(); - ICEcoder.content.contentWindow.createNewCMInstance(ICEcoder.nextcMInstance); + parent.parent.ICEcoder.createNewTab(); + parent.parent.ICEcoder.cMInstances.push(parent.parent.ICEcoder.nextcMInstance); + parent.parent.ICEcoder.setLayout(); + parent.parent.ICEcoder.content.contentWindow.createNewCMInstance(parent.parent.ICEcoder.nextcMInstance); // If we're in GitHub diff mode and have a split pane display, get the content for the diff pane - if (ICEcoder.githubDiff && ICEcoder.splitPane) { + if (parent.parent.ICEcoder.githubDiff && parent.parent.ICEcoder.splitPane) { - ICEcoder.filesFrame.contentWindow.frames['processControl'].location.href = "github.php?action=read&repo=&filePath=&csrf="+ICEcoder.csrf; + parent.parent.ICEcoder.filesFrame.contentWindow.frames['processControl'].location.href = "github.php?action=read&repo=&filePath=&csrf="+parent.parent.ICEcoder.csrf; } // Set the value & innerHTML of the code textarea to that of our loaded file plus make it visible (it's hidden on ICEcoder's load) - ICEcoder.switchMode(); - cM = ICEcoder.getcMInstance(); + parent.parent.ICEcoder.switchMode(); + cM = parent.parent.ICEcoder.getcMInstance(); cM.setValue(document.getElementById('loadedFile').value); - ICEcoder.savedPoints[ICEcoder.selectedTab-1] = cM.changeGeneration(); - ICEcoder.savedContents[ICEcoder.selectedTab-1] = cM.getValue(); + parent.parent.ICEcoder.savedPoints[parent.parent.ICEcoder.selectedTab-1] = cM.changeGeneration(); + parent.parent.ICEcoder.savedContents[parent.parent.ICEcoder.selectedTab-1] = cM.getValue(); parent.parent.document.getElementById('content').style.visibility='visible'; - ICEcoder.switchTab(ICEcoder.selectedTab,'noFocus'); - setTimeout(function(){ICEcoder.filesFrame.contentWindow.focus();},0); + parent.parent.ICEcoder.switchTab(parent.parent.ICEcoder.selectedTab,'noFocus'); + setTimeout(function(){parent.parent.ICEcoder.filesFrame.contentWindow.focus();},0); // Then clean it up, set the text cursor, update the display and get the character data - ICEcoder.contentCleanUp(); - ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[ICEcoder.selectedTab-1]].removeLineClass(ICEcoder['cMActiveLinecM'+ICEcoder.cMInstances[ICEcoder.selectedTab-1]], "background"); - ICEcoder['cMActiveLinecM'+ICEcoder.selectedTab] = ICEcoder.content.contentWindow['cM'+ICEcoder.cMInstances[ICEcoder.selectedTab-1]].addLineClass(0, "background", "cm-s-activeLine"); - ICEcoder.nextcMInstance++; - ICEcoder.openFileMDTs.push(''); - ICEcoder.openFileVersions.push('); + parent.parent.ICEcoder.openFileVersions.push(); - ICEcoder.updateVersionsDisplay(); + parent.parent.ICEcoder.updateVersionsDisplay(); - ICEcoder.goToLine(); - ICEcoder.loadingFile = false; + parent.parent.ICEcoder.goToLine(); + parent.parent.ICEcoder.loadingFile = false; @@ -218,24 +217,24 @@ if (action=="load") { if (fileType=="image") { parent.parent.document.getElementById('blackMask').style.visibility = "visible"; parent.parent.document.getElementById('mediaContainer').innerHTML = - "" + - " 700 || this.naturalHeight > 500) ? ', ' + this.width + ' x ' + this.height : ''; document.getElementById('imgInfo').innerHTML += ' (' + this.naturalWidth + ' x ' + this.naturalHeight + reducedImgMsg + ')'; ICEcoder.initCanvasImage(this); ICEcoder.interactCanvasImage(this)\">
" + - "
" + + "" + + " 700 || this.naturalHeight > 500) ? ', ' + this.width + ' x ' + this.height : ''; document.getElementById('imgInfo').innerHTML += ' (' + this.naturalWidth + ' x ' + this.naturalHeight + reducedImgMsg + ')'; parent.parent.ICEcoder.initCanvasImage(this); parent.parent.ICEcoder.interactCanvasImage(this)\">
" + + "
" + "" + "

" + "
"+ - "" + - "" + - "" + - ""+ + "" + + "" + + "" + + ""+ "
"+ "
CORS not enabled on resource site
"; parent.parent.document.getElementById('floatingContainer').style.background = "#fff url('') no-repeat 0 0"; } - ICEcoder.serverMessage();ICEcoder.serverQueue("del",0); + parent.parent.ICEcoder.serverMessage();parent.parent.ICEcoder.serverQueue("del",0); } // Finally, switch mode in case we have saved, renamed file etc -ICEcoder.switchMode(); +parent.parent.ICEcoder.switchMode();