wiki-plugin-rcnmap 0.5.0 → 0.5.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.
package/client/rcnmap.js CHANGED
@@ -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
@@ -784,7 +799,7 @@
784
799
  <p class="caption" style="margin:4px 0 0;">${wiki.resolveLinks ? wiki.resolveLinks(esc(caption(item))) : esc(caption(item))}</p>
785
800
  ${controls}
786
801
  ${walkBar(item)}
787
- ${canOpen(item) ? `<div style="text-align:center;padding-top:6px"><button class="rcnm-open" style="cursor:pointer;font-size:12px;padding:2px 8px" title="Open this map in the full RCN Map to write or change its walks; Save to wiki there brings them back here">🗺 Open in RCN Map</button></div>` : ''}
802
+ ${canOpen(item) || (RL && RL.togetherButton(item)) ? `<div style="text-align:center;padding-top:6px">${canOpen(item) ? `<button class="rcnm-open" style="cursor:pointer;font-size:12px;padding:2px 8px" title="Open this map in the full RCN Map to write or change its walks; Save to wiki there brings them back here">🗺 Open in RCN Map</button> ` : ''}${RL ? RL.togetherButton(item) : ''}</div>` : ''}
788
803
  </div>
789
804
  <style>
790
805
  .rcnm-label{background:none;border:0}
@@ -918,6 +933,7 @@
918
933
  aboutMark($item, 'rcnmap')
919
934
  bindWalk($item, item)
920
935
  $item.on('click', '.rcnm-open', e => { e.stopPropagation(); openTool($item, item) })
936
+ $item.on('click', '.rcn-together', e => { e.stopPropagation(); RL.openTogether(item) })
921
937
  $item.dblclick(e => { if (!$(e.target).closest('button, .walk-bar').length) wiki.textEditor($item, item) })
922
938
  $item.on('click', '.rcnm-refresh', e => { e.stopPropagation(); emit($item, item) })
923
939
  $item.on('click', '.rcnm-freeze', e => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wiki-plugin-rcnmap",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "Federated Wiki plugin: a small RCN map on a page that draws points and the ties between them; each point opens its page",
5
5
  "keywords": ["wiki", "federated wiki", "plugin", "rcn", "map"],
6
6
  "author": "RCN Network <rcn@relocalizecreativity.net>",
@@ -138,6 +138,11 @@
138
138
  "id": "b6ab902739e74ee2",
139
139
  "text": "Following. Put this page in a lineup beside pages with an RCN timeline, map or drawing, and the items follow each other. Press \u25b6 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 point and the timeline lights the bars there, and the drawing their boxes. 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."
140
140
  },
141
+ {
142
+ "type": "paragraph",
143
+ "id": "167c2d7ef5bb6a19",
144
+ "text": "Opening the explorer. Give the item a set field naming a set file, for example \"set\": \"superior.set.json\", and it shows a \u29c9 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."
145
+ },
141
146
  {
142
147
  "type": "paragraph",
143
148
  "id": "22dca488818d034f",
@@ -366,6 +371,17 @@
366
371
  },
367
372
  "after": "acad2aaf540683fe",
368
373
  "date": 1794193621097
374
+ },
375
+ {
376
+ "type": "add",
377
+ "id": "167c2d7ef5bb6a19",
378
+ "item": {
379
+ "type": "paragraph",
380
+ "id": "167c2d7ef5bb6a19",
381
+ "text": "Opening the explorer. Give the item a set field naming a set file, for example \"set\": \"superior.set.json\", and it shows a \u29c9 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."
382
+ },
383
+ "after": "b6ab902739e74ee2",
384
+ "date": 1794195627668
369
385
  }
370
386
  ]
371
387
  }