make adding a note work
This commit is contained in:
parent
ad8c96e2f4
commit
14aba962e4
|
@ -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 ();
|
||||
|
|
|
@ -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", " ");
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
table.html (comments);
|
||||
|
||||
location = '?' + this.id + '&text=' + text;
|
||||
location = this.id + ' ' + text;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue