add AddNote method
This commit is contained in:
parent
ed536ebd9f
commit
ad8c96e2f4
|
@ -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 {
|
||||||
|
|
|
@ -443,6 +443,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)
|
||||||
{
|
{
|
||||||
|
@ -456,7 +462,7 @@ namespace SparkleLib {
|
||||||
if (parent.Name.Equals ("rebase-apply"))
|
if (parent.Name.Equals ("rebase-apply"))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
foreach (FileInfo file in parent.GetFiles()) {
|
foreach (FileInfo file in parent.GetFiles ()) {
|
||||||
if (!file.Exists)
|
if (!file.Exists)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
@ -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-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>
|
</table>
|
||||||
<tr><td class="comment-timestamp">date</td><td></td></tr>
|
|
||||||
|
|
||||||
</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>
|
||||||
|
|
|
@ -4,9 +4,24 @@
|
||||||
<title>SparkleShare Event Log</title>
|
<title>SparkleShare Event Log</title>
|
||||||
<script type="text/javascript" src="<!-- $jquery-url -->"></script>
|
<script type="text/javascript" src="<!-- $jquery-url -->"></script>
|
||||||
<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