add AddNote method
This commit is contained in:
parent
6d3064552d
commit
b1347297b5
|
@ -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
|
public override bool UsesNotificationCenter
|
||||||
{
|
{
|
||||||
get {
|
get {
|
||||||
|
|
|
@ -438,6 +438,12 @@ namespace SparkleLib {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public virtual void AddNote (string revision, string note)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Recursively gets a folder's size in bytes
|
// Recursively gets a folder's size in bytes
|
||||||
private double CalculateFolderSize (DirectoryInfo parent)
|
private double CalculateFolderSize (DirectoryInfo parent)
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,23 +16,20 @@
|
||||||
-webkit-box-sizing:border-box;
|
-webkit-box-sizing:border-box;
|
||||||
-moz-box-sizing: border-box; margin-top: 3px;width:100%;padding:12px;'>
|
-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-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-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-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-timestamp">date</td><td></td></tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<textarea style="margin-top: 12px;box-sizing: border-box;
|
<textarea style="margin-top: 12px;box-sizing: border-box;
|
||||||
-webkit-box-sizing:border-box;
|
-webkit-box-sizing:border-box;
|
||||||
-moz-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>
|
<div style='clear: both'></div>
|
||||||
<input style="float:right; margin-top: 6px;margin-bottom: 6px;" type="button"
|
<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>
|
||||||
<div style='clear: both'></div>
|
<div style='clear: both'></div>
|
||||||
|
|
|
@ -6,7 +6,22 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$("input").click(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>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue