add AddNote method

This commit is contained in:
Hylke Bons 2011-06-20 23:55:18 +01:00
parent 5c6d6c00b6
commit f1ff61950c
4 changed files with 56 additions and 14 deletions

View file

@ -538,6 +538,30 @@ namespace SparkleLib {
}
public override void AddNote (string revision, string note)
{
string n = Environment.NewLine;
note = "<note>" + n +
" <user>" + n +
" <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 +
" <body>" + note + "</body>" + n +
"</note>";
SparkleGit git = new SparkleGit (LocalPath, "note append -m " + note);
git.Start ();
git.WaitForExit ();
while (Status != SyncStatus.Idle) {
Thread.Sleep (5 * 20);
}
SyncUp ();
}
public override bool UsesNotificationCenter
{
get {

View file

@ -443,6 +443,12 @@ namespace SparkleLib {
}
public virtual void AddNote (string revision, string note)
{
}
// Recursively gets a folder's size in bytes
private double CalculateFolderSize (DirectoryInfo parent)
{
@ -456,7 +462,7 @@ namespace SparkleLib {
if (parent.Name.Equals ("rebase-apply"))
return 0;
foreach (FileInfo file in parent.GetFiles()) {
foreach (FileInfo file in parent.GetFiles ()) {
if (!file.Exists)
return 0;

View file

@ -16,23 +16,20 @@
-webkit-box-sizing:border-box;
-moz-box-sizing: border-box; margin-top: 3px;width:100%;padding:12px;'>
<table class="comments-<!-- $event-revision -->">
<tr><td class="comment-author">Hylke Bons</td><td class="comment-text" rowspan="2">this looks awesome!</td></tr>
<tr><td class="comment-timestamp">date</td><td></td></tr>
<tr><td class="comment-author">Hylke Bons</td><td class="comment-text" rowspan="2">this looks awesome!</td></tr>
<tr><td class="comment-timestamp">date</td><td></td></tr>
</table>
<table class="comments">
<tr><td class="comment-author">Hylke Bons</td><td class="comment-text" rowspan="2">this looks awesome!</td></tr>
<tr><td class="comment-timestamp">date</td><td></td></tr>
<tr><td class="comment-author">Hylke Bons</td><td class="comment-text" rowspan="2">this looks awesome!</td></tr>
<tr><td class="comment-timestamp">date</td><td></td></tr>
</table>
<textarea style="margin-top: 12px;box-sizing: border-box;
-webkit-box-sizing:border-box;
-moz-box-sizing: border-box;
width: 75%;float:right;height: 40px" id="message-<!-- $event-revision -->"></textarea>
width: 75%;float:right;height: 40px"></textarea>
<div style='clear: both'></div>
<input style="float:right; margin-top: 6px;margin-bottom: 6px;" type="button"
onclick="location='?message='+document.getElementById('message-<!-- $event-revision -->').value+'&revision=<!-- $event-revision -->';document.getElementById('message-<!-- $event-revision -->').value=''" value="Add comment">
value="Add comment" id="<!-- $event-revision -->">
</div>
<div style='clear: both'></div>

View file

@ -4,9 +4,24 @@
<title>SparkleShare Event Log</title>
<script type="text/javascript" src="<!-- $jquery-url -->"></script>
<script type="text/javascript">
$(document).ready(function() {
$(document).ready(function () {
$("input").click(function () {
alert('ff');
textarea = $(this).parent ().find ('textarea');
text = textarea.val ();
if (text == '')
return;
textarea.val ('');
table = $(this).parent ().find ("table");
comments = table.html ();
comments += '<tr><td class="comment-author">Hylke Bons</td><td class="comment-text" rowspan="2">' + text + '</td></tr>';
comments += '<tr><td class="comment-timestamp">just now</td><td></td></tr>'
table.html (comments);
location = '?' + this.id + '&text=' + text;
});
});
</script>