wiki-plugin-rcngraph 0.1.21 → 0.1.22

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
@@ -519,6 +534,7 @@
519
534
  </div>
520
535
  <div style="padding:6px 0 0;display:flex;gap:6px;justify-content:center;">
521
536
  <button class="edit-graph" style="cursor:pointer;">Edit in Graph Tool ↗</button>
537
+ ${RL ? RL.togetherButton(item) : ''}
522
538
  </div>
523
539
  ${buildBar(item)}
524
540
  ${walkBar(item)}
@@ -720,6 +736,7 @@
720
736
  function bind($item, item) {
721
737
  aboutMark($item, 'rcngraph')
722
738
  bindNotes($item, item)
739
+ $item.on('click', '.rcn-together', e => { e.stopPropagation(); RL.openTogether(item) })
723
740
  $item.on('click', '.open-graph, .edit-graph', () => {
724
741
  pendingItem = item
725
742
  pending$item = $item
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wiki-plugin-rcngraph",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "Federated Wiki - RCN Graph Plug-in",
5
5
  "keywords": [
6
6
  "wiki",
@@ -36,6 +36,11 @@
36
36
  "id": "f2b474457cb3f7bd",
37
37
  "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 box and the timeline lights the bars about it, and the map their places. 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."
38
38
  },
39
+ {
40
+ "type": "paragraph",
41
+ "id": "eb1078f31385e806",
42
+ "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."
43
+ },
39
44
  {
40
45
  "type": "rcngraph",
41
46
  "id": "8d4e2a7f1c9b3065",
@@ -202,6 +207,17 @@
202
207
  },
203
208
  "after": "8e7e435485d56e9e",
204
209
  "date": 1794193621097
210
+ },
211
+ {
212
+ "type": "add",
213
+ "id": "eb1078f31385e806",
214
+ "item": {
215
+ "type": "paragraph",
216
+ "id": "eb1078f31385e806",
217
+ "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."
218
+ },
219
+ "after": "f2b474457cb3f7bd",
220
+ "date": 1794195627668
205
221
  }
206
222
  ]
207
223
  }