Skip to content
Browse files

symbols on actions in journal

  • Loading branch information...
1 parent b1e66b5 commit 354a66dace6e80dd01a5602a29f38714c0ea7a6a @hallahan hallahan committed May 10, 2012
Showing with 19 additions and 2 deletions.
  1. +9 −1 client/client.js
  2. +9 −1 client/lib/legacy.coffee
  3. +1 −0 client/style.css
View
10 client/client.js
@@ -420,6 +420,14 @@ require.define("/lib/legacy.coffee", function (require, module, exports, __dirna
};
return string.replace(/\[\[([^\]]+)\]\]/gi, renderInternalLink).replace(/\[(http.*?) (.*?)\]/gi, "<a class=\"external\" target=\"_blank\" href=\"$1\">$2</a>");
};
+ wiki.symbols = {
+ create: '',
+ add: '',
+ edit: '',
+ fork: '',
+ move: '',
+ remove: ''
+ };
addToJournal = wiki.addToJournal = function(journalElement, action) {
var actionElement, actionTitle, pageElement, prev;
pageElement = journalElement.parents('.page:first');
@@ -431,7 +439,7 @@ require.define("/lib/legacy.coffee", function (require, module, exports, __dirna
if (action.date != null) {
actionTitle += ": " + (util.formatDate(action.date));
}
- actionElement = $("<a href=\"\#\" /> ").addClass("action").addClass(action.type).text(action.type[0]).attr('title', actionTitle).attr('data-id', action.id || "0").appendTo(journalElement);
+ actionElement = $("<a href=\"\#\" /> ").addClass("action").addClass(action.type).text(wiki.symbols[action.type]).attr('title', actionTitle).attr('data-id', action.id || "0").appendTo(journalElement);
if (action.type === 'fork') {
return actionElement.css("background-image", "url(//" + action.site + "/favicon.png)").attr("href", "//" + action.site + "/" + (pageElement.attr('id')) + ".html").data("site", action.site).data("slug", pageElement.attr('id'));
}
View
10 client/lib/legacy.coffee
@@ -66,14 +66,22 @@ $ ->
.replace(/\[\[([^\]]+)\]\]/gi, renderInternalLink)
.replace(/\[(http.*?) (.*?)\]/gi, "<a class=\"external\" target=\"_blank\" href=\"$1\">$2</a>")
+ wiki.symbols =
+ create: ''
+ add: ''
+ edit: ''
+ fork: ''
+ move: ''
+ remove: ''
+
addToJournal = wiki.addToJournal = (journalElement, action) ->
pageElement = journalElement.parents('.page:first')
prev = journalElement.find(".edit[data-id=#{action.id || 0}]") if action.type == 'edit'
actionTitle = action.type
actionTitle += "(#{prev.length})" if action.type == 'edit'
actionTitle += ": #{util.formatDate(action.date)}" if action.date?
actionElement = $("<a href=\"\#\" /> ").addClass("action").addClass(action.type)
- .text(action.type[0])
+ .text(wiki.symbols[action.type])
.attr('title',actionTitle)
.attr('data-id', action.id || "0")
.appendTo(journalElement)
View
1 client/style.css
@@ -74,6 +74,7 @@ footer {
color: black; }
.action {
+ font-size: 0.9em;
background-color: #cccccc;
color: #666666;
text-align: center;

0 comments on commit 354a66d

Please sign in to comment.
Something went wrong with that request. Please try again.