|
@@ -280,6 +280,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
<script>
|
|
//Global variables
|
|
//Global variables
|
|
|
|
+var moduleRootPath = "NotepadA/";
|
|
var dragIn = "";
|
|
var dragIn = "";
|
|
var theme = 'github';
|
|
var theme = 'github';
|
|
var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
|
|
var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
|
|
@@ -291,7 +292,7 @@ var fontsize = 12;
|
|
var VDI = ao_module_virtualDesktop;
|
|
var VDI = ao_module_virtualDesktop;
|
|
var openedFilePath = [];
|
|
var openedFilePath = [];
|
|
var previousSavedState = true;
|
|
var previousSavedState = true;
|
|
-var currentSaveAsPath = "";
|
|
|
|
|
|
+var currentSaveAsPath = "user:/Desktop";
|
|
var insertTarget;
|
|
var insertTarget;
|
|
var currentTabWidth = 0;
|
|
var currentTabWidth = 0;
|
|
var mainCodingWindow = true;
|
|
var mainCodingWindow = true;
|
|
@@ -468,7 +469,35 @@ function saveToAOCC(){
|
|
}
|
|
}
|
|
|
|
|
|
function SetSaveAsPath(dirpath){
|
|
function SetSaveAsPath(dirpath){
|
|
- $("#directoryList").html("<tr><th>Loading...</th></tr>");
|
|
|
|
|
|
+ $("#directoryList").html("<tr><th>Loading...</th></tr>");
|
|
|
|
+ if (dirpath == ""){
|
|
|
|
+ dirpath = "user:/"
|
|
|
|
+ }
|
|
|
|
+ currentSaveAsPath = dirpath;
|
|
|
|
+ //Make sure there is always an ending / at the end of current savepath
|
|
|
|
+ if (currentSaveAsPath.substring(currentSaveAsPath.length - 1, currentSaveAsPath.length) != "/"){
|
|
|
|
+ currentSaveAsPath = currentSaveAsPath + "/";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //Listdir
|
|
|
|
+ ao_module_agirun(moduleRootPath + "backend/getDir.js", {listpath: currentSaveAsPath}, function(result){
|
|
|
|
+ if (result.error !== undefined){
|
|
|
|
+ onsole.log(result);
|
|
|
|
+ }else{
|
|
|
|
+ $("#directoryList").html("<tr><th>📂 " + currentSaveAsPath + "</th></tr>");
|
|
|
|
+ if (currentSaveAsPath.split("/").length >= 3){
|
|
|
|
+ //Not root
|
|
|
|
+ let parentPath = currentSaveAsPath.substr(0, currentSaveAsPath.length -1).split("/");
|
|
|
|
+ parentPath.pop();
|
|
|
|
+ parentPath = parentPath.join("/");
|
|
|
|
+ $("#directoryList").append(`<tr><td class="selectable" foldername="${parentPath}" onClick="changeSaveAsPath(this);">⏎ ../</td></tr>`);
|
|
|
|
+ }
|
|
|
|
+ for (var i = 0; i < result.length; i++){
|
|
|
|
+ $("#directoryList").append('<tr><td class="selectable" foldername="'+result[i][0]+'" onClick="changeSaveAsPath(this);"> 📂 '+result[i][1]+'</td></tr>');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ /*
|
|
if (dirpath == "../"){
|
|
if (dirpath == "../"){
|
|
currentSaveAsPath = currentSaveAsPath.split("/")
|
|
currentSaveAsPath = currentSaveAsPath.split("/")
|
|
while (currentSaveAsPath.pop() == ""){
|
|
while (currentSaveAsPath.pop() == ""){
|
|
@@ -510,6 +539,7 @@ function SetSaveAsPath(dirpath){
|
|
}
|
|
}
|
|
}});
|
|
}});
|
|
}
|
|
}
|
|
|
|
+ */
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -761,17 +791,26 @@ function handleFileMenu(itemText){
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
var id = getFocusedTab()[0];
|
|
var id = getFocusedTab()[0];
|
|
- var uid = Math.round((new Date()).getTime() / 1000);
|
|
|
|
- var url = $("#" + id)[0].contentWindow.getFilepath().replace("../","");
|
|
|
|
|
|
+ //var uid = Math.round((new Date()).getTime() / 1000);
|
|
|
|
+ var url = "./media?file=" + $("#" + id)[0].contentWindow.getFilepath().replace("../","");
|
|
var title = "NotepadA Runtime";
|
|
var title = "NotepadA Runtime";
|
|
var icon = "code";
|
|
var icon = "code";
|
|
- if (url.substr(0,14) == "/media/storage"){
|
|
|
|
- title += " (External Storage)";
|
|
|
|
- url = "SystemAOB/functions/extDiskAccess.php?file=" + url;
|
|
|
|
- newfw(url,title,icon,uid,1080,580);
|
|
|
|
- }else{
|
|
|
|
- newfw(url,title,icon,uid,1080,580);
|
|
|
|
- }
|
|
|
|
|
|
+ ao_module_newfw({
|
|
|
|
+ url: url,
|
|
|
|
+ width: 1080,
|
|
|
|
+ height: 580,
|
|
|
|
+ appicon: "NotepadA/img/small_icon.png",
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ if (url.substr(0,14) == "/media/storage"){
|
|
|
|
+ title += " (External Storage)";
|
|
|
|
+ url = "SystemAOB/functions/extDiskAccess.php?file=" + url;
|
|
|
|
+ newfw(url,title,icon,uid,1080,580);
|
|
|
|
+ }else{
|
|
|
|
+ newfw(url,title,icon,uid,1080,580);
|
|
|
|
+ }
|
|
|
|
+ */
|
|
break;
|
|
break;
|
|
case 3:
|
|
case 3:
|
|
//Open the current folder in explorer
|
|
//Open the current folder in explorer
|
|
@@ -779,9 +818,12 @@ function handleFileMenu(itemText){
|
|
if (base == undefined){
|
|
if (base == undefined){
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
+ /*
|
|
if (base.includes("../../")){
|
|
if (base.includes("../../")){
|
|
base = base.replace("../../","");
|
|
base = base.replace("../../","");
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
var url = "SystemAOB/functions/file_system/index.php?controlLv=2&finishing=embedded&subdir=" + base;
|
|
var url = "SystemAOB/functions/file_system/index.php?controlLv=2&finishing=embedded&subdir=" + base;
|
|
if (base.substr(0,14) == "/media/storage"){
|
|
if (base.substr(0,14) == "/media/storage"){
|
|
//This file is located in external storage location. Open file editor in ext mode
|
|
//This file is located in external storage location. Open file editor in ext mode
|
|
@@ -795,6 +837,9 @@ function handleFileMenu(itemText){
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
newfw(url,title,icon,uid,1080,580);
|
|
newfw(url,title,icon,uid,1080,580);
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+ ao_module_openPath(base);
|
|
break;
|
|
break;
|
|
case 4:
|
|
case 4:
|
|
//Reload is pressed
|
|
//Reload is pressed
|