wiki-plugin-rcntimeline 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -154,6 +154,21 @@
154
154
  if (f.seen.has(id)) return 0.42
155
155
  return f.click ? 0.3 : 0.13
156
156
  }
157
+ // "⧉ Open together": the Time Place Causality Explorer on an item's set file
158
+ // (item.set). A bare file name lives in the site's /assets/NDC/ folder beside
159
+ // the explorer and the full tools; a full address may point anywhere, and the
160
+ // explorer is then looked for in that set's own folder. A local wiki opens the
161
+ // working copy on :8765.
162
+ R.together = function (set) {
163
+ const local = /(^|\.)localhost$/.test(location.hostname)
164
+ const s = new URL(set, location.origin + '/assets/NDC/')
165
+ const page = local ? 'http://localhost:8765/tools/rcn-together.html' : new URL('rcn-together.html', s).href
166
+ return page + '?set=' + encodeURIComponent(new URL(page).origin === s.origin ? s.pathname : s.href)
167
+ }
168
+ R.togetherButton = item => item && typeof item.set === 'string' && item.set.trim()
169
+ ? '<button class="rcn-together" style="cursor:pointer;font-size:12px;padding:2px 8px" title="Open this with its timeline, map and sketch side by side in the Time Place Causality Explorer">⧉ Open together ↗</button>'
170
+ : ''
171
+ R.openTogether = item => { const w = window.open(R.together(item.set.trim()), 'rcntogether'); if (w) try { w.focus() } catch (e) {} }
157
172
  return R
158
173
  })()
159
174
  // END rcn-lineup-follow
@@ -971,7 +986,7 @@
971
986
  <div class="rcnt-card" style="display:none;margin:6px 0 0;padding:8px 26px 8px 10px;background:#fff;border:1px solid #c7d2fe;border-radius:6px;font-size:13px;line-height:1.45;position:relative"></div>
972
987
  ${rowsBar($item, item)}${walkBar(item)}
973
988
  <p class="caption" style="margin:4px 0 0;">${cap}</p>${note}
974
- <div style="padding:6px 0 0;text-align:center;">${controls}<button class="rcnt-open" style="cursor:pointer;">Open in RCN Timeline ↗</button></div></div>`)
989
+ <div style="padding:6px 0 0;text-align:center;">${controls}<button class="rcnt-open" style="cursor:pointer;">Open in RCN Timeline ↗</button> ${RL ? RL.togetherButton(item) : ''}</div></div>`)
975
990
  // Width is known only once the item is in the page. A walk step draws just
976
991
  // the years it is about and fades what it is not about.
977
992
  const el = $item.get(0)
@@ -1157,6 +1172,7 @@
1157
1172
  $item.dblclick(e => { if (!$(e.target).closest('button, .walk-bar').length) wiki.textEditor($item, item) })
1158
1173
  bindWalk($item, item)
1159
1174
  $item.on('click', '.rcnt-open', e => { e.stopPropagation(); openTool($item, item) })
1175
+ $item.on('click', '.rcn-together', e => { e.stopPropagation(); RL.openTogether(item) })
1160
1176
  $item.on('click', '.rcnt-refresh', e => { e.stopPropagation(); emit($item, item) })
1161
1177
  $item.on('click', '.rcnt-rows', function (e) { e.stopPropagation(); $item.get(0).rcntRows = this.getAttribute('data-how'); emit($item, item) })
1162
1178
  $item.on('click', '.rcnt-freeze', e => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wiki-plugin-rcntimeline",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Federated Wiki plugin: a small RCN timeline on a page — intervals with fuzzy edges, the links between them, a date axis; each bar opens its page",
5
5
  "keywords": [
6
6
  "wiki",
@@ -31,6 +31,11 @@
31
31
  "id": "97f4075d8a08e9e9",
32
32
  "text": "Following. Put this page in a lineup beside pages with an RCN timeline, map or drawing, and the items follow each other. Press ▶ Walk in any of them: each step lights what it is about there, and the others light what is related to it: full strength for this step, half for earlier steps, the rest faded. Click a bar and the map and the drawing light its place and its box. The others light where it is for them. Click empty space to let go. The timeline's bars are the bridges: each bar names a place on the map (place) and a box in the drawing (eip). One walk plays at a time, and starting one stops the others. A click that lights nothing beside it opens its page as before; beside items that follow, the page opens at the end of the lineup so they stay open, and shift-click always opens it. The full Timeline, Map and Graph Tool, opened from this wiki's assets in another tab, follow too, and lead too."
33
33
  },
34
+ {
35
+ "type": "paragraph",
36
+ "id": "2f54ea236c26e0ff",
37
+ "text": "Opening the explorer. Give the item a set field naming a set file, for example \"set\": \"superior.set.json\", and it shows a ⧉ Open together button. The button opens the Time Place Causality Explorer, which puts the timeline, the map and the sketch side by side on one page. A bare file name means the site's /assets/NDC/ folder, where the explorer and the full tools sit; a full address can point to a set anywhere."
38
+ },
34
39
  {
35
40
  "type": "paragraph",
36
41
  "text": "Below: the Northwest Agriculture Business Center, from the Co-ops of Whatcom County pages. Its help to the meat co-op sits inside the co-op’s organising years, and the food hub it ran became a farmer-owned co-op.",
@@ -318,6 +323,17 @@
318
323
  },
319
324
  "after": "1caf7fe1c5cc610a",
320
325
  "date": 1794193621097
326
+ },
327
+ {
328
+ "type": "add",
329
+ "id": "2f54ea236c26e0ff",
330
+ "item": {
331
+ "type": "paragraph",
332
+ "id": "2f54ea236c26e0ff",
333
+ "text": "Opening the explorer. Give the item a set field naming a set file, for example \"set\": \"superior.set.json\", and it shows a ⧉ Open together button. The button opens the Time Place Causality Explorer, which puts the timeline, the map and the sketch side by side on one page. A bare file name means the site's /assets/NDC/ folder, where the explorer and the full tools sit; a full address can point to a set anywhere."
334
+ },
335
+ "after": "97f4075d8a08e9e9",
336
+ "date": 1794195627668
321
337
  }
322
338
  ]
323
339
  }