make adding a note work

This commit is contained in:
Hylke Bons 2011-06-21 01:04:21 +01:00
parent f1ff61950c
commit 1d5dd2a8b0
3 changed files with 15 additions and 6 deletions

View file

@ -546,16 +546,16 @@ namespace SparkleLib {
" <name>" + SparkleConfig.DefaultConfig.UserName + "</name>" + n +
" <email>" + SparkleConfig.DefaultConfig.UserEmail + "</email>" + n +
" </user>" + n +
" <timestamp>" + (DateTime.UtcNow - new DateTime (1970, 1, 1)).TotalSeconds + "</timestamp>" + n +
" <timestamp>" + (int) (DateTime.UtcNow - new DateTime (1970, 1, 1)).TotalSeconds + "</timestamp>" + n +
" <body>" + note + "</body>" + n +
"</note>";
SparkleGit git = new SparkleGit (LocalPath, "note append -m " + note);
SparkleGit git = new SparkleGit (LocalPath, "notes append -m '" + note + "'");
git.Start ();
git.WaitForExit ();
while (Status != SyncStatus.Idle) {
Thread.Sleep (5 * 20);
System.Threading.Thread.Sleep (5 * 20);
}
SyncUp ();

View file

@ -219,8 +219,17 @@ namespace SparkleShare {
public override void DecidePolicyForNavigation (WebView web_view, NSDictionary action_info,
NSUrlRequest request, WebFrame frame, NSObject decision_token)
{Console.WriteLine ("fffffffffffff");
Console.WriteLine (request.Url.ToString ());
{
string url = request.Url.ToString ();
Console.WriteLine (url);
string id = url.Substring (0, url.IndexOf ("%20"));
string note = url.Substring (url.IndexOf ("%20") + 3);
Console.WriteLine (id + " " + note);
SparkleShare.Controller.Repositories [0].AddNote (id, note);
return;
string file_path = request.Url.ToString ();
file_path = file_path.Replace ("%20", " ");

View file

@ -21,7 +21,7 @@
table.html (comments);
location = '?' + this.id + '&text=' + text;
location = this.id + ' ' + text;
});
});
</script>