Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

more consistent reference formatting

  • Loading branch information...
commit 68224e70d495e038b3940f9f52f69b96b280d7bd 1 parent e169fab
@WardCunningham authored
View
3  client/plugins/activity/activity.coffee
@@ -29,8 +29,7 @@ window.plugins.activity =
for each, i in sites
joint = if sites[i+1]?.page.date == each.page.date then "" else "&nbsp"
$item.append """
- <img width="16px" height="16px"
- class="remote"
+ <img class="remote"
title="#{each.site}\n#{wiki.util.formatElapsedTime each.page.date}"
src="http://#{each.site}/favicon.png"
data-site="#{each.site}"
View
2  client/plugins/activity/activity.js
@@ -55,7 +55,7 @@
for (i = _k = 0, _len2 = sites.length; _k < _len2; i = ++_k) {
each = sites[i];
joint = ((_ref = sites[i + 1]) != null ? _ref.page.date : void 0) === each.page.date ? "" : "&nbsp";
- $item.append("<img width=\"16px\" height=\"16px\"\n class=\"remote\"\n title=\"" + each.site + "\n" + (wiki.util.formatElapsedTime(each.page.date)) + "\"\n src=\"http://" + each.site + "/favicon.png\"\n data-site=\"" + each.site + "\"\n data-slug=\"" + each.page.slug + "\">" + joint);
+ $item.append("<img class=\"remote\"\n title=\"" + each.site + "\n" + (wiki.util.formatElapsedTime(each.page.date)) + "\"\n src=\"http://" + each.site + "/favicon.png\"\n data-site=\"" + each.site + "\"\n data-slug=\"" + each.page.slug + "\">" + joint);
}
context = sites[0].site === location.host ? "view" : "view => " + sites[0].site;
_results.push($item.append("<a class=\"internal\"\n href=\"/" + sites[0].page.slug + "\"\n data-page-name=\"" + sites[0].page.slug + "\"\n title=\"" + context + "\">\n " + (sites[0].page.title || sites[0].page.slug) + "\n</a><br>"));
View
26 client/plugins/federatedWiki/federatedWiki.coffee
@@ -1,13 +1,21 @@
window.plugins.federatedWiki =
- emit: (div, item) ->
+ emit: ($item, item) ->
slug = item.slug or 'welcome-visitors'
site = item.site
- wiki.log 'emit', slug, 'site', site
wiki.resolveFrom site, ->
- title = wiki.resolveLinks "[[#{item.title || slug}]]"
- div.append($("<h3 style='margin-bottom:3px;'><img src='//#{site}/favicon.png' class='remote' width='16px' height='16px' title='#{site}'> #{title}</h3>"))
- div.append($("<div>#{wiki.resolveLinks(item.text)}</div>"))
- # div.append($("<div class='cite' style='margin-top:3px;'>http://#{site}/view/#{slug}</div>"))
- div.find('img').data('slug', slug).data('site', site)
- bind: (div, item) ->
- div.dblclick -> wiki.textEditor div, item
+ $item.append """
+ <p style='margin-bottom:3px;'>
+ <img class='remote'
+ src='//#{site}/favicon.png'
+ title='#{site}'
+ data-site="#{site}"
+ data-slug="#{slug}"
+ >
+ #{wiki.resolveLinks "[[#{item.title or slug}]]"}
+ </p>
+ <div>
+ #{wiki.resolveLinks(item.text)}
+ </div>
+ """
+ bind: ($item, item) ->
+ $item.dblclick -> wiki.textEditor $item, item
View
15 client/plugins/federatedWiki/federatedWiki.js
@@ -2,22 +2,17 @@
(function() {
window.plugins.federatedWiki = {
- emit: function(div, item) {
+ emit: function($item, item) {
var site, slug;
slug = item.slug || 'welcome-visitors';
site = item.site;
- wiki.log('emit', slug, 'site', site);
return wiki.resolveFrom(site, function() {
- var title;
- title = wiki.resolveLinks("[[" + (item.title || slug) + "]]");
- div.append($("<h3 style='margin-bottom:3px;'><img src='//" + site + "/favicon.png' class='remote' width='16px' height='16px' title='" + site + "'> " + title + "</h3>"));
- div.append($("<div>" + (wiki.resolveLinks(item.text)) + "</div>"));
- return div.find('img').data('slug', slug).data('site', site);
+ return $item.append("<p style='margin-bottom:3px;'>\n <img class='remote'\n src='//" + site + "/favicon.png'\n title='" + site + "'\n data-site=\"" + site + "\"\n data-slug=\"" + slug + "\"\n >\n " + (wiki.resolveLinks("[[" + (item.title || slug) + "]]")) + "\n</p>\n<div>\n " + (wiki.resolveLinks(item.text)) + "\n</div>");
});
},
- bind: function(div, item) {
- return div.dblclick(function() {
- return wiki.textEditor(div, item);
+ bind: function($item, item) {
+ return $item.dblclick(function() {
+ return wiki.textEditor($item, item);
});
}
};
View
26 client/plugins/reference/reference.coffee
@@ -1,13 +1,21 @@
window.plugins.reference =
- emit: (div, item) ->
+ emit: ($item, item) ->
slug = item.slug or 'welcome-visitors'
site = item.site
- wiki.log 'emit', slug, 'site', site
wiki.resolveFrom site, ->
- title = wiki.resolveLinks "[[#{item.title || slug}]]"
- div.append($("<h3 style='margin-bottom:3px;'><img src='//#{site}/favicon.png' class='remote' width='16px' height='16px' title='#{site}'> #{title}</h3>"))
- div.append($("<div>#{wiki.resolveLinks(item.text)}</div>"))
- # div.append($("<div class='cite' style='margin-top:3px;'>http://#{site}/view/#{slug}</div>"))
- div.find('img').data('slug', slug).data('site', site)
- bind: (div, item) ->
- div.dblclick -> wiki.textEditor div, item
+ $item.append """
+ <p style='margin-bottom:3px;'>
+ <img class='remote'
+ src='//#{site}/favicon.png'
+ title='#{site}'
+ data-site="#{site}"
+ data-slug="#{slug}"
+ >
+ #{wiki.resolveLinks "[[#{item.title or slug}]]"}
+ </p>
+ <div>
+ #{wiki.resolveLinks(item.text)}
+ </div>
+ """
+ bind: ($item, item) ->
+ $item.dblclick -> wiki.textEditor $item, item
View
15 client/plugins/reference/reference.js
@@ -2,22 +2,17 @@
(function() {
window.plugins.reference = {
- emit: function(div, item) {
+ emit: function($item, item) {
var site, slug;
slug = item.slug || 'welcome-visitors';
site = item.site;
- wiki.log('emit', slug, 'site', site);
return wiki.resolveFrom(site, function() {
- var title;
- title = wiki.resolveLinks("[[" + (item.title || slug) + "]]");
- div.append($("<h3 style='margin-bottom:3px;'><img src='//" + site + "/favicon.png' class='remote' width='16px' height='16px' title='" + site + "'> " + title + "</h3>"));
- div.append($("<div>" + (wiki.resolveLinks(item.text)) + "</div>"));
- return div.find('img').data('slug', slug).data('site', site);
+ return $item.append("<p style='margin-bottom:3px;'>\n <img class='remote'\n src='//" + site + "/favicon.png'\n title='" + site + "'\n data-site=\"" + site + "\"\n data-slug=\"" + slug + "\"\n >\n " + (wiki.resolveLinks("[[" + (item.title || slug) + "]]")) + "\n</p>\n<div>\n " + (wiki.resolveLinks(item.text)) + "\n</div>");
});
},
- bind: function(div, item) {
- return div.dblclick(function() {
- return wiki.textEditor(div, item);
+ bind: function($item, item) {
+ return $item.dblclick(function() {
+ return wiki.textEditor($item, item);
});
}
};
View
8 client/style.css
@@ -189,10 +189,10 @@ footer {
color: gray;
font-size: 70%; }
-.federatedWiki .reference {
- margin-top: 0;
- color: gray;
- font-size: 70%; }
+image.remote {
+ width:16px;
+ height:26px;
+}
p.readout {
text-align: center;
Please sign in to comment.
Something went wrong with that request. Please try again.