update log style
This commit is contained in:
parent
54a2667707
commit
045268ac3b
|
@ -77,17 +77,17 @@ namespace SparkleShare {
|
||||||
|
|
||||||
private void CreateEventLog ()
|
private void CreateEventLog ()
|
||||||
{
|
{
|
||||||
string name = Path.GetFileName (LocalPath);
|
|
||||||
Title = "Recent Events";
|
Title = "Recent Events";
|
||||||
|
|
||||||
Separator = new NSBox (new RectangleF (0, 559, 480, 1)) {
|
Separator = new NSBox (new RectangleF (0, 573, 480, 1)) {
|
||||||
BorderColor = NSColor.LightGray,
|
BorderColor = NSColor.LightGray,
|
||||||
BoxType = NSBoxType.NSBoxCustom
|
BoxType = NSBoxType.NSBoxCustom
|
||||||
};
|
};
|
||||||
|
|
||||||
ContentView.AddSubview (Separator);
|
ContentView.AddSubview (Separator);
|
||||||
|
|
||||||
this.popup_button = new NSPopUpButton (new RectangleF (100, 570, 200, 26), false);
|
this.popup_button = new NSPopUpButton (new RectangleF (480 - 156 - 8, 640 - 31 - 26, 156, 26), false);
|
||||||
|
//this.popup_button.
|
||||||
this.popup_button.AddItem ("All Folders");
|
this.popup_button.AddItem ("All Folders");
|
||||||
this.popup_button.Menu.AddItem (NSMenuItem.SeparatorItem);
|
this.popup_button.Menu.AddItem (NSMenuItem.SeparatorItem);
|
||||||
this.popup_button.AddItems (SparkleShare.Controller.Folders.ToArray ());
|
this.popup_button.AddItems (SparkleShare.Controller.Folders.ToArray ());
|
||||||
|
@ -106,7 +106,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
ProgressIndicator.StartAnimation (this);
|
ProgressIndicator.StartAnimation (this);
|
||||||
|
|
||||||
WebView = new WebView (new RectangleF (0, 0, 480, 559), "", ""){
|
WebView = new WebView (new RectangleF (0, 0, 480, 573 ), "", ""){
|
||||||
PolicyDelegate = new SparkleWebPolicyDelegate ()
|
PolicyDelegate = new SparkleWebPolicyDelegate ()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -135,8 +135,7 @@ namespace SparkleShare {
|
||||||
|
|
||||||
private void GenerateHTML ()
|
private void GenerateHTML ()
|
||||||
{
|
{
|
||||||
string folder_name = Path.GetFileName (LocalPath);
|
HTML = SparkleShare.Controller.GetHTMLLog ();
|
||||||
HTML = SparkleShare.Controller.GetHTMLLog ();
|
|
||||||
|
|
||||||
HTML = HTML.Replace ("<!-- $body-font-family -->", "Lucida Grande");
|
HTML = HTML.Replace ("<!-- $body-font-family -->", "Lucida Grande");
|
||||||
HTML = HTML.Replace ("<!-- $day-entry-header-font-size -->", "13.6px");
|
HTML = HTML.Replace ("<!-- $day-entry-header-font-size -->", "13.6px");
|
||||||
|
|
|
@ -154,7 +154,7 @@ namespace SparkleShare {
|
||||||
Menu.AddItem (NSMenuItem.SeparatorItem);
|
Menu.AddItem (NSMenuItem.SeparatorItem);
|
||||||
|
|
||||||
RecentEventsMenuItem = new NSMenuItem () {
|
RecentEventsMenuItem = new NSMenuItem () {
|
||||||
Title = "Show Recent Events"
|
Title = "Recent Events"
|
||||||
};
|
};
|
||||||
|
|
||||||
RecentEventsMenuItem.Activated +=delegate {
|
RecentEventsMenuItem.Activated +=delegate {
|
||||||
|
|
|
@ -320,54 +320,46 @@ namespace SparkleShare {
|
||||||
string event_entry = "<dl>";
|
string event_entry = "<dl>";
|
||||||
|
|
||||||
if (change_set.IsMerge) {
|
if (change_set.IsMerge) {
|
||||||
event_entry += "<dt>Merged a branch</dt>";
|
event_entry += "<dd>Merged a branch</dd>";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (change_set.Edited.Count > 0) {
|
if (change_set.Edited.Count > 0) {
|
||||||
event_entry += "<dt>Edited</dt>";
|
|
||||||
|
|
||||||
foreach (string file_path in change_set.Edited) {
|
foreach (string file_path in change_set.Edited) {
|
||||||
string absolute_file_path = SparkleHelpers.CombineMore (SparklePaths.SparklePath,
|
string absolute_file_path = SparkleHelpers.CombineMore (SparklePaths.SparklePath,
|
||||||
change_set.Folder, file_path);
|
change_set.Folder, file_path);
|
||||||
|
|
||||||
if (File.Exists (absolute_file_path))
|
if (File.Exists (absolute_file_path))
|
||||||
event_entry += "<dd><a href='" + absolute_file_path + "'>" + file_path + "</a></dd>";
|
event_entry += "<dd class='file-edited'><a href='" + absolute_file_path + "'>" + file_path + "</a></dd>";
|
||||||
else
|
else
|
||||||
event_entry += "<dd>" + file_path + "</dd>";
|
event_entry += "<dd class='file-edited'>" + file_path + "</dd>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (change_set.Added.Count > 0) {
|
if (change_set.Added.Count > 0) {
|
||||||
event_entry += "<dt>Added</dt>";
|
|
||||||
|
|
||||||
foreach (string file_path in change_set.Added) {
|
foreach (string file_path in change_set.Added) {
|
||||||
string absolute_file_path = SparkleHelpers.CombineMore (SparklePaths.SparklePath,
|
string absolute_file_path = SparkleHelpers.CombineMore (SparklePaths.SparklePath,
|
||||||
change_set.Folder, file_path);
|
change_set.Folder, file_path);
|
||||||
|
|
||||||
if (File.Exists (absolute_file_path))
|
if (File.Exists (absolute_file_path))
|
||||||
event_entry += "<dd><a href='" + absolute_file_path + "'>" + file_path + "</a></dd>";
|
event_entry += "<dd class='file-added'><a href='" + absolute_file_path + "'>" + file_path + "</a></dd>";
|
||||||
else
|
else
|
||||||
event_entry += "<dd>" + file_path + "</dd>";
|
event_entry += "<dd class='file-added'>" + file_path + "</dd>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (change_set.Deleted.Count > 0) {
|
if (change_set.Deleted.Count > 0) {
|
||||||
event_entry += "<dt>Deleted</dt>";
|
|
||||||
|
|
||||||
foreach (string file_path in change_set.Deleted) {
|
foreach (string file_path in change_set.Deleted) {
|
||||||
string absolute_file_path = SparkleHelpers.CombineMore (SparklePaths.SparklePath,
|
string absolute_file_path = SparkleHelpers.CombineMore (SparklePaths.SparklePath,
|
||||||
change_set.Folder, file_path);
|
change_set.Folder, file_path);
|
||||||
|
|
||||||
if (File.Exists (absolute_file_path))
|
if (File.Exists (absolute_file_path))
|
||||||
event_entry += "<dd><a href='" + absolute_file_path + "'>" + file_path + "</a></dd>";
|
event_entry += "<dd class='file-deleted'><a href='" + absolute_file_path + "'>" + file_path + "</a></dd>";
|
||||||
else
|
else
|
||||||
event_entry += "<dd>" + file_path + "</dd>";
|
event_entry += "<dd class='file-deleted'>" + file_path + "</dd>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (change_set.MovedFrom.Count > 0) {
|
if (change_set.MovedFrom.Count > 0) {
|
||||||
event_entry += "<dt>Moved</dt>";
|
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
foreach (string file_path in change_set.MovedFrom) {
|
foreach (string file_path in change_set.MovedFrom) {
|
||||||
string to_file_path = change_set.MovedTo [i];
|
string to_file_path = change_set.MovedTo [i];
|
||||||
|
@ -377,10 +369,10 @@ namespace SparkleShare {
|
||||||
change_set.Folder, to_file_path);
|
change_set.Folder, to_file_path);
|
||||||
|
|
||||||
if (File.Exists (absolute_file_path))
|
if (File.Exists (absolute_file_path))
|
||||||
event_entry += "<dd><a href='" + absolute_file_path + "'>" + file_path + "</a><br/>" +
|
event_entry += "<dd class='file-moved'><a href='" + absolute_file_path + "'>" + file_path + "</a><br/>" +
|
||||||
"<span class='moved-arrow'>→</span> ";
|
"<span class='moved-arrow'>→</span> ";
|
||||||
else
|
else
|
||||||
event_entry += "<dd>" + file_path + "<br/>" +
|
event_entry += "<dd class='file-moved'>" + file_path + "<br/>" +
|
||||||
"<span class='moved-arrow'>→</span> ";
|
"<span class='moved-arrow'>→</span> ";
|
||||||
|
|
||||||
if (File.Exists (absolute_to_file_path))
|
if (File.Exists (absolute_to_file_path))
|
||||||
|
@ -1037,15 +1029,14 @@ namespace SparkleShare {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private string [] tango_palette = new string [] {"#fce94f", "#edd400",
|
private string [] tango_palette = new string [] {"#eaab00", "#e37222",
|
||||||
"#c4a000", "#8ae234", "#73d216", "#4e9a06", "#fcaf3e", "#f57900",
|
"#3892ab", "#33c2cb", "#19b271", "#9eab05", "#8599a8", "#9ca696",
|
||||||
"#ce5c00", "#e9b96e", "#c17d11", "#8f5902", "#729fcf", "#3465a4",
|
"#b88454", "#cc0033", "#8f6678", "#8c6cd0", "#796cbf", "#4060af",
|
||||||
"#204a87", "#ad7fa8", "#75507b", "#5c3566", "#888a85", "#555753",
|
"#aa9c8f", "#818a8f"};
|
||||||
"#2e3436", "#ef2929", "#cc0000", "#a40000"};
|
|
||||||
|
|
||||||
private string AssignColor (string s)
|
private string AssignColor (string s)
|
||||||
{
|
{
|
||||||
string hash = GetMD5 (s).Substring (0, 6);
|
string hash = GetMD5 (s).Substring (0, 8);
|
||||||
string numbers = Regex.Replace (hash, "[a-z]", "");
|
string numbers = Regex.Replace (hash, "[a-z]", "");
|
||||||
int number = int.Parse (numbers);
|
int number = int.Parse (numbers);
|
||||||
return this.tango_palette [number % this.tango_palette.Length];
|
return this.tango_palette [number % this.tango_palette.Length];
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
<div class='event-entry'>
|
<div class='event-entry'>
|
||||||
|
|
||||||
<div class='event-entry-content' style='border-bottom: 3px <!-- $event-folder-color --> solid'>
|
<div class='event-entry-content'>
|
||||||
|
|
||||||
<div class='no-buddy-icon'>
|
|
||||||
<div class='buddy-icon' style='background-image: url("<!-- $event-avatar-url -->");'></div>
|
<div class='event-info'><div style="float:left;">
|
||||||
|
<div class='no-buddy-icon'>
|
||||||
|
<div class='buddy-icon' style='background-image: url("<!-- $event-avatar-url -->");'></div>
|
||||||
|
</div>
|
||||||
|
<b><!-- $event-user-name --></b><br/>
|
||||||
|
<small><!-- $event-time --></small>
|
||||||
|
</div>
|
||||||
|
<div class='event-time' style='opacity: 0.8;background-color: <!-- $event-folder-color -->'><!-- $event-folder --></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class='event-info'>
|
|
||||||
<b><!-- $event-user-name --></b>
|
|
||||||
<!-- $event-entry-content -->
|
<!-- $event-entry-content -->
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class='event-time' style='position: relative;float: right'><!-- $event-folder --> • <!-- $event-time --></div>
|
|
||||||
|
|
||||||
<div style='clear: both'></div>
|
<div style='clear: both'></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<title>SparkleShare Event Log</title>
|
<title>SparkleShare Event Log</title>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
background-color: #f0f0f0;
|
background-color: #dedede;
|
||||||
color: <!-- $body-color -->;
|
color: <!-- $body-color -->;
|
||||||
font-size: <!-- $body-font-size -->;
|
font-size: <!-- $body-font-size -->;
|
||||||
font-family: <!-- $body-font-family -->;
|
font-family: <!-- $body-font-family -->;
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
small {
|
small {
|
||||||
font-size: <!-- $small-font-size -->;
|
font-size: <!-- $small-font-size -->;
|
||||||
color: <!-- $small-color -->;
|
color: <!-- $secondary-font-color -->;
|
||||||
}
|
}
|
||||||
|
|
||||||
.moved-arrow {
|
.moved-arrow {
|
||||||
|
@ -25,13 +25,9 @@
|
||||||
|
|
||||||
.day-entry-header {
|
.day-entry-header {
|
||||||
font-size: <!-- $day-entry-header-font-size -->;
|
font-size: <!-- $day-entry-header-font-size -->;
|
||||||
color: #babdb6;
|
color: #444;
|
||||||
text-align: center;
|
|
||||||
width: 90%;
|
|
||||||
text-shadow: 0 1px 0 rgba(255, 255, 255, 1.0);
|
|
||||||
margin-bottom: 9px;
|
margin-bottom: 9px;
|
||||||
margin-left: auto;
|
margin-left: 40px;
|
||||||
margin-right: auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.day-entry-content {
|
.day-entry-content {
|
||||||
|
@ -49,42 +45,46 @@
|
||||||
|
|
||||||
.event-time {
|
.event-time {
|
||||||
font-size: 80%;
|
font-size: 80%;
|
||||||
color: <!-- $secondary-font-color -->;
|
color: #fff;
|
||||||
float: right;
|
float: right;
|
||||||
|
padding: 3px 15px;
|
||||||
|
font-weight: bold;
|
||||||
|
-webkit-border-radius: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.event-entry-content {
|
.event-entry-content {
|
||||||
display: block;
|
display: block;
|
||||||
width: 400px;
|
width: 440px;
|
||||||
background-color: #fff;
|
background-color: #f0f0f0;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
margin-bottom: 9px;
|
margin-bottom: 12px;
|
||||||
padding: 18px;
|
padding: 0px;
|
||||||
-webkit-border-radius: 6px 6px 0 0;
|
border: #ccc 1px solid;
|
||||||
border: #ddd 1px solid;
|
-webkit-border-radius: 0 0 3px 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
dl {
|
dl {
|
||||||
padding: 0;
|
padding : 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding-bottom: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
dt {
|
|
||||||
padding-bottom: 12px;
|
|
||||||
padding-top: 12px;
|
|
||||||
font-size: 80%;
|
|
||||||
color: <!-- $secondary-font-color -->;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dd {
|
dd {
|
||||||
width: 300px;
|
width: 90%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding-left: 0;
|
margin-left: 24px;
|
||||||
margin-left: 12px;
|
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
padding-bottom: 9px;
|
padding: 4px 0px;
|
||||||
|
border-bottom: 1px solid #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
dd:first-child {
|
||||||
|
padding-top: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
dd:last-child {
|
||||||
|
border: none;
|
||||||
|
padding-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.no-buddy-icon {
|
.no-buddy-icon {
|
||||||
|
@ -104,6 +104,11 @@
|
||||||
|
|
||||||
.event-info {
|
.event-info {
|
||||||
float: left;
|
float: left;
|
||||||
|
padding: 15px;
|
||||||
|
width: 410px;
|
||||||
|
background-color: #fff;
|
||||||
|
border-bottom: 1px #ccc solid;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
Loading…
Reference in a new issue