Skip to content

Instantly share code, notes, and snippets.

success: function (o) {
if (o.statusText == 'OK') {
//alert("Ok: " + o.responseText );
var sysNumList = [];
sysNumList = YAHOO.lang.JSON.parse(o.responseText);
console.log(o.responseText);
for (var i = 0, len = sysNumList.length; i < len; ++i) {
alert(sysNumList[i]);
}
success: function (o) {
if (o.statusText == 'OK') {
//alert("Ok: " + o.responseText );
var sysNumList = [];
sysNumList = YAHOO.lang.JSON.parse(o.responseText);
console.log(o.responseText);
for (var i = 0, len = sysNumList.length; i < len; ++i) {
alert(sysNumList[i]);
}
#Get the current commit edits are based on
-1) Obtain <ID> corresponding to tip of apporiate branch 'git rev-parse <branch>'.
#To obtain index file to record the edits to.
0) Read the commit: 'GIT_INDEX_FILE=foo.index git read-tree <ID>'. Save the <ID> (obtained in step -1).
#Add
#add file to git db from temp file or piped into hash-object -w --stdin
<!-- Embedded CSS -->
<style type="text/css">
#dlgAddTask .bd{height:20em;}
#dlgAddTask label{display:block; float:left; width:11em; clear:left}
#dlgAddTask select{margin:5px; width:12em}
#dlgAddTask input{margin:5px}
</style>
<?php
require_once "connections/oMyConn.php"; // DB Connection created
// validate Ajax request
function is_ajax() {
return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) AND strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest');
}
$ajaxState = is_ajax();
//$ajaxState = 1; // for testing
// callback functions
function my_save(id, content){
var postData = "action=writefile&content=" + content;
var cObj = YAHOO.util.Connect.asyncRequest(
'POST',
'editor_db.php',
{
success: function (o) {
var cObj = YAHOO.util.Connect.asyncRequest(
'POST',
'editor_db.php',
{
success: function (o) {
if (o.statusText == 'OK') {
alert(o.responseText);
} else {
alert(o.statusText );
}
function my_save(id, content){
$ourFileName = "testFile.txt";
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
fclose($ourFileHandle);
alert("Here is the content of the EditArea '"+ id +"' as received by the save callback function:\n"+content);
}
Using a Web based javascript editor (EditArea) to edit xml files I wish to allow:
User creates new file and saves it
User opens current version of file, makes edits, saves it with no conflicts.
User opens current version of file, makes edits, has conflict, merges edits, saves.
User compares current version of file to selected older version from list.
User creates new file and saves it
'git add path/filename', 'git commit -m "commit message" ?
User opens current version of file, makes edits, saves.
User opens current version of file, makes edits, merges edits, saves.