Last active
December 22, 2015 07:09
-
-
Save wshager/6436296 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var input = document.createElement("input"); | |
input.id = "path"; | |
input.value = "/db/file.xml"; | |
var eXideButton = document.createElement("button"); | |
eXideButton.innerHTML = "Open in eXide"; | |
eXideButton.title = "Open in eXide Code Editor"; | |
eXideButton.addEventListener("click", function() { | |
var path = input.value; | |
window.eXide_onload = function(app){ | |
// getEditor() needs patch eXide.js | |
var editor = app.getEditor(); | |
// small hack to select the right tab | |
var doc = editor.getActiveDocument(); | |
if(doc.path !== path) { | |
doc = editor.getDocument(path); | |
if(doc) editor.switchTo(doc); | |
} | |
editor.addEventListener("saved",function(doc){ | |
if(doc.getPath() === path){ | |
alert(path+" saved"); | |
} | |
}); | |
}; | |
window.open("/path/to/eXide/index.html?open="+path,"eXide"); | |
}); | |
document.body.insertBefore(eXideButton,document.body.firstChild); | |
document.body.insertBefore(input,eXideButton); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment