add AddNote method
This commit is contained in:
parent
f44d26321c
commit
e3be84aedc
|
@ -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 {
|
||||
|
|
|
@ -438,6 +438,12 @@ namespace SparkleLib {
|
|||
}
|
||||
|
||||
|
||||
public virtual void AddNote (string revision, string note)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Recursively gets a folder's size in bytes
|
||||
private double CalculateFolderSize (DirectoryInfo parent)
|
||||
{
|
||||
|
|
|
@ -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 -->">
|
||||
|
||||
<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>
|
||||
|
|
|
@ -6,7 +6,22 @@
|
|||
<script type="text/javascript">
|
||||
$(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>
|
||||
|
|
Loading…
Reference in a new issue