continue implementing notes
This commit is contained in:
parent
5e54cbb5aa
commit
86887e4a6e
|
@ -595,7 +595,12 @@ namespace SparkleLib {
|
||||||
git_notes.WaitForExit ();
|
git_notes.WaitForExit ();
|
||||||
|
|
||||||
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Added note to " + revision);
|
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Added note to " + revision);
|
||||||
|
SyncUpNotes ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public override void SyncUpNotes ()
|
||||||
|
{
|
||||||
while (Status != SyncStatus.Idle) {
|
while (Status != SyncStatus.Idle) {
|
||||||
System.Threading.Thread.Sleep (5 * 20);
|
System.Threading.Thread.Sleep (5 * 20);
|
||||||
}
|
}
|
||||||
|
@ -604,9 +609,15 @@ namespace SparkleLib {
|
||||||
git_push.Start ();
|
git_push.Start ();
|
||||||
git_push.WaitForExit ();
|
git_push.WaitForExit ();
|
||||||
|
|
||||||
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Notes pushed");
|
if (git_push.ExitCode == 0) {
|
||||||
|
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Notes pushed");
|
||||||
|
|
||||||
SparkleAnnouncement announcement = new SparkleAnnouncement (Identifier, note_namespace);
|
} else {
|
||||||
|
HasUnsyncedChanges = true;
|
||||||
|
SparkleHelpers.DebugInfo ("Git", "[" + Name + "] Pushing notes failed, trying again later");
|
||||||
|
}
|
||||||
|
|
||||||
|
SparkleAnnouncement announcement = new SparkleAnnouncement (Identifier, SHA1 (DateTime.Now.ToString ()));
|
||||||
base.listener.Announce (announcement);
|
base.listener.Announce (announcement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -111,8 +111,10 @@ namespace SparkleLib {
|
||||||
|
|
||||||
// In the unlikely case that we haven't synced up our
|
// In the unlikely case that we haven't synced up our
|
||||||
// changes or the server was down, sync up again
|
// changes or the server was down, sync up again
|
||||||
if (HasUnsyncedChanges)
|
if (HasUnsyncedChanges) {
|
||||||
SyncUpBase ();
|
SyncUpBase ();
|
||||||
|
SyncUpNotes ();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.remote_timer.Start ();
|
this.remote_timer.Start ();
|
||||||
|
@ -233,8 +235,10 @@ namespace SparkleLib {
|
||||||
SyncDownBase ();
|
SyncDownBase ();
|
||||||
|
|
||||||
// Push changes that were made since the last disconnect
|
// Push changes that were made since the last disconnect
|
||||||
if (HasUnsyncedChanges)
|
if (HasUnsyncedChanges) {
|
||||||
SyncUpBase ();
|
SyncUpBase ();
|
||||||
|
SyncUpNotes ();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Start polling when the connection to the irc channel is lost
|
// Start polling when the connection to the irc channel is lost
|
||||||
|
@ -449,6 +453,12 @@ namespace SparkleLib {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public virtual void SyncUpNotes ()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 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)
|
||||||
{
|
{
|
||||||
|
|
|
@ -397,11 +397,10 @@ namespace SparkleShare {
|
||||||
foreach (SparkleNote note in change_set.Notes) {
|
foreach (SparkleNote note in change_set.Notes) {
|
||||||
comments += "<tr>" +
|
comments += "<tr>" +
|
||||||
" <td class=\"comment-author\">" + note.UserName + "</td>" +
|
" <td class=\"comment-author\">" + note.UserName + "</td>" +
|
||||||
" <td class=\"comment-text\" rowspan=\"2\">" + note.Body + "</td>" +
|
" <td class=\"comment-timestamp\">" + note.Timestamp.ToString ("d MMM") + "</td>" +
|
||||||
"</tr>" +
|
"</tr>" +
|
||||||
"<tr>" +
|
"<tr>" +
|
||||||
" <td class=\"comment-timestamp\">" + note.Timestamp + "</td>" +
|
" <td class=\"comment-text\" colspan=\"2\">" + note.Body + "</td>" +
|
||||||
" <td></td>" +
|
|
||||||
"</tr>";
|
"</tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -451,7 +450,8 @@ namespace SparkleShare {
|
||||||
event_log += day_entry.Replace ("<!-- $day-entry-content -->", event_entries);
|
event_log += day_entry.Replace ("<!-- $day-entry-content -->", event_entries);
|
||||||
}
|
}
|
||||||
|
|
||||||
return event_log_html.Replace ("<!-- $event-log-content -->", event_log);
|
return event_log_html.Replace ("<!-- $event-log-content -->", event_log)
|
||||||
|
.Replace ("<!-- $username -->", UserName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,24 +8,16 @@
|
||||||
<b><!-- $event-user-name --></b><br/>
|
<b><!-- $event-user-name --></b><br/>
|
||||||
<small><!-- $event-time --></small>
|
<small><!-- $event-time --></small>
|
||||||
</div>
|
</div>
|
||||||
<div class='event-time' style='background-color: <!-- $event-folder-color -->'><!-- $event-folder --></div>
|
<div class='event-folder' style='background-color: <!-- $event-folder-color -->'><!-- $event-folder --></div>
|
||||||
</div>
|
</div>
|
||||||
<!-- $event-entry-content -->
|
<!-- $event-entry-content -->
|
||||||
<div style='clear: both'></div>
|
<div style='clear: both'></div>
|
||||||
<div style='margin-top: 9px;border-top: 1px #ccc solid;box-sizing: border-box;
|
<div class="comments-wrapper">
|
||||||
-webkit-box-sizing:border-box;
|
|
||||||
-moz-box-sizing: border-box; margin-top: 3px;width:100%;padding:12px;'>
|
|
||||||
|
|
||||||
<!-- $event-comments -->
|
<!-- $event-comments -->
|
||||||
|
<textarea class="comment-textarea"></textarea>
|
||||||
<textarea style="margin-top: 12px;box-sizing: border-box;
|
<div style='clear: both'></div>
|
||||||
-webkit-box-sizing:border-box;
|
<input class="comment-button" type="button" value="Add note"
|
||||||
-moz-box-sizing: border-box;
|
id="<!-- $event-folder -->~<!-- $event-revision -->">
|
||||||
width: 75%;float:right;height: 40px"></textarea>
|
|
||||||
<div style='clear: both'></div>
|
|
||||||
<input style="float:right; margin-top: 6px;margin-bottom: 6px;" type="button"
|
|
||||||
value="Add note" id="<!-- $event-folder -->~<!-- $event-revision -->">
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div style='clear: both'></div>
|
<div style='clear: both'></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -16,9 +16,13 @@
|
||||||
|
|
||||||
table = $(this).parent ().find ("table");
|
table = $(this).parent ().find ("table");
|
||||||
comments = table.html ();
|
comments = table.html ();
|
||||||
comments += '<tr><td class="comment-author">Hylke Bons</td><td class="comment-text" rowspan="2">' + text + '</td></tr>';
|
comments += '<tr>' +
|
||||||
comments += '<tr><td class="comment-timestamp">just now</td><td></td></tr>'
|
' <td class=\"comment-author\"><!-- $username --></td>' +
|
||||||
|
' <td class=\"comment-timestamp\">just now</td>' +
|
||||||
|
'</tr>' +
|
||||||
|
'<tr>' +
|
||||||
|
' <td class=\"comment-text\" colspan=\"2\">' + text + '</td>' +
|
||||||
|
'</tr>';
|
||||||
table.html (comments);
|
table.html (comments);
|
||||||
|
|
||||||
location = this.id + '~' + text;
|
location = this.id + '~' + text;
|
||||||
|
@ -48,11 +52,9 @@
|
||||||
|
|
||||||
td {
|
td {
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.day-entry-header {
|
.day-entry-header {
|
||||||
font-size: <!-- $day-entry-header-font-size -->;
|
font-size: <!-- $day-entry-header-font-size -->;
|
||||||
color: #444;
|
color: #444;
|
||||||
|
@ -62,7 +64,6 @@ font-size: 12px;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
a {
|
a {
|
||||||
color: <!-- $a-color -->;
|
color: <!-- $a-color -->;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
@ -72,8 +73,8 @@ font-size: 12px;
|
||||||
color: <!-- $a-hover-color -->;
|
color: <!-- $a-hover-color -->;
|
||||||
}
|
}
|
||||||
|
|
||||||
.event-time {
|
.event-folder {
|
||||||
margin: 15px;
|
margin: 6px;
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
font-size: 80%;
|
font-size: 80%;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
@ -81,15 +82,16 @@ font-size: 12px;
|
||||||
padding: 3px 15px;
|
padding: 3px 15px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
-webkit-border-radius: 100px;
|
-webkit-border-radius: 100px;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.event-entry-content {
|
.event-entry-content {
|
||||||
display: block;
|
display: block;
|
||||||
background-color: #f0f0f0;
|
background-color: #f0f0f0;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
padding: 0px;
|
padding: 0px;
|
||||||
padding-bottom: 6px;
|
padding-bottom: 6px;
|
||||||
border: #ccc 1px solid;
|
border: #ccc 1px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
|
@ -153,11 +155,14 @@ font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.event-info {
|
.event-info {
|
||||||
|
padding: 6px;
|
||||||
float: left;
|
float: left;
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-bottom: 1px #ccc solid;
|
border-bottom: 1px #ccc solid;
|
||||||
|
box-sizing: border-box;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comments {
|
.comments {
|
||||||
|
@ -166,12 +171,42 @@ font-size: 12px;
|
||||||
|
|
||||||
.comment-author {
|
.comment-author {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
width: 25%;
|
width: 75%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.comment-timestamp {
|
.comment-timestamp {
|
||||||
color: <!-- $secondary-font-color -->;
|
color: <!-- $secondary-font-color -->;
|
||||||
padding-bottom: 12px;
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment-button {
|
||||||
|
float:right;
|
||||||
|
margin-top: 6px;
|
||||||
|
margin-bottom: 6px;"
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment-textarea {
|
||||||
|
margin-top: 12px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
width: 100%;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comments-wrapper {
|
||||||
|
margin-top: 9px;
|
||||||
|
border-top: 1px #ccc solid;
|
||||||
|
box-sizing: border-box;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
-moz-box-sizing: border-box;
|
||||||
|
margin-top: 3px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment-text {
|
||||||
|
padding-bottom: 6px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
Loading…
Reference in a new issue