make adding a note work
This commit is contained in:
parent
e3be84aedc
commit
d55a4a786d
|
@ -546,16 +546,16 @@ namespace SparkleLib {
|
||||||
" <name>" + SparkleConfig.DefaultConfig.UserName + "</name>" + n +
|
" <name>" + SparkleConfig.DefaultConfig.UserName + "</name>" + n +
|
||||||
" <email>" + SparkleConfig.DefaultConfig.UserEmail + "</email>" + n +
|
" <email>" + SparkleConfig.DefaultConfig.UserEmail + "</email>" + n +
|
||||||
" </user>" + 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 +
|
" <body>" + note + "</body>" + n +
|
||||||
"</note>";
|
"</note>";
|
||||||
|
|
||||||
SparkleGit git = new SparkleGit (LocalPath, "note append -m " + note);
|
SparkleGit git = new SparkleGit (LocalPath, "notes append -m '" + note + "'");
|
||||||
git.Start ();
|
git.Start ();
|
||||||
git.WaitForExit ();
|
git.WaitForExit ();
|
||||||
|
|
||||||
while (Status != SyncStatus.Idle) {
|
while (Status != SyncStatus.Idle) {
|
||||||
Thread.Sleep (5 * 20);
|
System.Threading.Thread.Sleep (5 * 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
SyncUp ();
|
SyncUp ();
|
||||||
|
|
|
@ -213,8 +213,17 @@ namespace SparkleShare {
|
||||||
|
|
||||||
public override void DecidePolicyForNavigation (WebView web_view, NSDictionary action_info,
|
public override void DecidePolicyForNavigation (WebView web_view, NSDictionary action_info,
|
||||||
NSUrlRequest request, WebFrame frame, NSObject decision_token)
|
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 ();
|
string file_path = request.Url.ToString ();
|
||||||
file_path = file_path.Replace ("%20", " ");
|
file_path = file_path.Replace ("%20", " ");
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
table.html (comments);
|
table.html (comments);
|
||||||
|
|
||||||
location = '?' + this.id + '&text=' + text;
|
location = this.id + ' ' + text;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue