Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/edit.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -2338,7 +2338,7 @@ version="3.0">
<xsl:call-template name="rdfae:disarm-sweep"/>
<ixsl:set-property name="draggedBlock" select="." object="rdfae:editor-state()"/>
<ixsl:set-property name="effectAllowed" select="'move'" object="$transfer"/>
<xsl:sequence select="ixsl:call($transfer, 'setData', [ 'application/x-rdfa-editor-block', '' ])[current-date() lt xs:date('2000-01-01')]"/>
<xsl:sequence select="ixsl:call($transfer, 'setData', [ 'application/vnd.atomgraph.rdfa-editor.block', '' ])[current-date() lt xs:date('2000-01-01')]"/>
<xsl:sequence select="ixsl:call($transfer, 'setDragImage', [ ., 0, 0 ])[current-date() lt xs:date('2000-01-01')]"/>
<xsl:sequence select="ixsl:call(ixsl:get(., 'classList'), 'add', [ 'dragging' ])[current-date() lt xs:date('2000-01-01')]"/>
</xsl:template>
Expand All @@ -2364,7 +2364,7 @@ version="3.0">
<xsl:for-each select="ancestor-or-self::*[rdfae:draggable-block(.)][1]">
<ixsl:set-property name="draggedBlock" select="." object="rdfae:editor-state()"/>
<ixsl:set-property name="effectAllowed" select="'move'" object="$transfer"/>
<xsl:sequence select="ixsl:call($transfer, 'setData', [ 'application/x-rdfa-editor-block', '' ])[current-date() lt xs:date('2000-01-01')]"/>
<xsl:sequence select="ixsl:call($transfer, 'setData', [ 'application/vnd.atomgraph.rdfa-editor.block', '' ])[current-date() lt xs:date('2000-01-01')]"/>
<xsl:sequence select="ixsl:call($transfer, 'setDragImage', [ ., 0, 0 ])[current-date() lt xs:date('2000-01-01')]"/>
<xsl:sequence select="ixsl:call(ixsl:get(., 'classList'), 'add', [ 'dragging' ])[current-date() lt xs:date('2000-01-01')]"/>
</xsl:for-each>
Expand All @@ -2375,7 +2375,7 @@ version="3.0">
<xsl:variable name="dragged" select="ixsl:get(rdfae:editor-state(), 'draggedBlock')"/>
<xsl:variable name="target" as="element()?" select="rdfae:drop-target-of(., $event)"/>
<xsl:if test="exists($dragged) and exists($target)
and rdfae:has-transfer-type($event, 'application/x-rdfa-editor-block')">
and rdfae:has-transfer-type($event, 'application/vnd.atomgraph.rdfa-editor.block')">
<xsl:sequence select="ixsl:call($event, 'preventDefault', [])[current-date() lt xs:date('2000-01-01')]"/>
<ixsl:set-property name="dropEffect" select="'move'" object="ixsl:get($event, 'dataTransfer')"/>
<xsl:call-template name="rdfae:clear-drop-marks"/>
Expand All @@ -2393,7 +2393,7 @@ version="3.0">
<xsl:variable name="dragged" select="ixsl:get(rdfae:editor-state(), 'draggedBlock')"/>
<xsl:variable name="target" as="element()?" select="rdfae:drop-target-of(., $event)"/>
<xsl:if test="exists($dragged) and exists($target)
and rdfae:has-transfer-type($event, 'application/x-rdfa-editor-block')">
and rdfae:has-transfer-type($event, 'application/vnd.atomgraph.rdfa-editor.block')">
<xsl:sequence select="ixsl:call($event, 'preventDefault', [])[current-date() lt xs:date('2000-01-01')]"/>
<xsl:call-template name="rdfae:clear-drop-marks"/>
<!-- transient drag state must not reach the undo snapshot -->
Expand Down
6 changes: 3 additions & 3 deletions src/navigate.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,14 @@ version="3.0">
<ixsl:set-property name="draggedSectionHeading"
select="(ixsl:get(rdfae:editor-state(), 'tocRoot')/(h1 | h2 | h3))[$index]" object="rdfae:editor-state()"/>
<ixsl:set-property name="effectAllowed" select="'move'" object="$transfer"/>
<xsl:sequence select="ixsl:call($transfer, 'setData', [ 'application/x-rdfa-editor-section', '' ])[current-date() lt xs:date('2000-01-01')]"/>
<xsl:sequence select="ixsl:call($transfer, 'setData', [ 'application/vnd.atomgraph.rdfa-editor.section', '' ])[current-date() lt xs:date('2000-01-01')]"/>
<xsl:sequence select="ixsl:call(ixsl:get(., 'classList'), 'add', [ 'dragging' ])[current-date() lt xs:date('2000-01-01')]"/>
</xsl:template>

<xsl:template match="li[contains-token(@class, 'toc-item')]" mode="ixsl:ondragover">
<xsl:variable name="event" select="ixsl:event()"/>
<xsl:if test="exists(ixsl:get(rdfae:editor-state(), 'draggedSectionHeading'))
and rdfae:has-transfer-type($event, 'application/x-rdfa-editor-section')">
and rdfae:has-transfer-type($event, 'application/vnd.atomgraph.rdfa-editor.section')">
<xsl:sequence select="ixsl:call($event, 'preventDefault', [])[current-date() lt xs:date('2000-01-01')]"/>
<ixsl:set-property name="dropEffect" select="'move'" object="ixsl:get($event, 'dataTransfer')"/>
<xsl:call-template name="rdfae:clear-drop-marks">
Expand All @@ -203,7 +203,7 @@ version="3.0">
<xsl:call-template name="rdfae:clear-drop-marks">
<xsl:with-param name="scope" select="id('toc-list', ixsl:page())//li"/>
</xsl:call-template>
<xsl:if test="exists($source) and rdfae:has-transfer-type($event, 'application/x-rdfa-editor-section')">
<xsl:if test="exists($source) and rdfae:has-transfer-type($event, 'application/vnd.atomgraph.rdfa-editor.section')">
<xsl:sequence select="ixsl:call($event, 'preventDefault', [])[current-date() lt xs:date('2000-01-01')]"/>
<!-- bare-variable positional predicate: SaxonJS evaluates computed numeric
predicates as booleans in this context -->
Expand Down
2 changes: 1 addition & 1 deletion tests/browser/editor.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ results.dnd = await page.evaluate(async () => {
handle.dispatchEvent(new MouseEvent('mousedown', { bubbles: true }));
const draggableSet = dragged.getAttribute('draggable') === 'true';
const dt = new DataTransfer();
dt.setData('application/x-rdfa-editor-block', '');
dt.setData('application/vnd.atomgraph.rdfa-editor.block', '');
dragged.dispatchEvent(new DragEvent('dragstart', { bubbles: true, dataTransfer: dt }));
const rect = target.getBoundingClientRect();
target.dispatchEvent(new DragEvent('dragover', { bubbles: true, cancelable: true, dataTransfer: dt,
Expand Down
6 changes: 3 additions & 3 deletions tests/browser/features.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ await page.evaluate(() => {
const target = content.querySelector(':scope > blockquote');
dragged.querySelector('.drag-handle').dispatchEvent(new MouseEvent('mousedown', { bubbles: true }));
const dt = new DataTransfer();
dt.setData('application/x-rdfa-editor-block', '');
dt.setData('application/vnd.atomgraph.rdfa-editor.block', '');
dragged.dispatchEvent(new DragEvent('dragstart', { bubbles: true, dataTransfer: dt }));
const rect = target.getBoundingClientRect();
target.dispatchEvent(new DragEvent('dragover', { bubbles: true, cancelable: true, dataTransfer: dt, clientY: rect.bottom - 2 }));
Expand Down Expand Up @@ -164,7 +164,7 @@ await page.evaluate(() => {
const byLabel = t => items.find(li => li.querySelector(':scope > .toc-label').textContent === t);
const source = byLabel('Company'), target = byLabel('Publications');
const dt = new DataTransfer();
dt.setData('application/x-rdfa-editor-section', '');
dt.setData('application/vnd.atomgraph.rdfa-editor.section', '');
source.dispatchEvent(new DragEvent('dragstart', { bubbles: true, dataTransfer: dt }));
const rect = target.getBoundingClientRect();
target.dispatchEvent(new DragEvent('dragover', { bubbles: true, cancelable: true, dataTransfer: dt, clientY: rect.bottom - 1 }));
Expand Down Expand Up @@ -195,7 +195,7 @@ await page.evaluate(() => {
const byLabel = t => items.find(li => li.querySelector(':scope > .toc-label').textContent === t);
const source = byLabel('Demo document'), target = byLabel('Queries');
const dt = new DataTransfer();
dt.setData('application/x-rdfa-editor-section', '');
dt.setData('application/vnd.atomgraph.rdfa-editor.section', '');
source.dispatchEvent(new DragEvent('dragstart', { bubbles: true, dataTransfer: dt }));
const rect = target.getBoundingClientRect();
target.dispatchEvent(new DragEvent('drop', { bubbles: true, cancelable: true, dataTransfer: dt, clientY: rect.bottom - 1 }));
Expand Down
2 changes: 1 addition & 1 deletion tests/browser/multiinstance.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ await page.evaluate(() => {
const target = document.querySelector('#notes > p');
block.querySelector('.drag-handle').dispatchEvent(new MouseEvent('mousedown', { bubbles: true }));
const dt = new DataTransfer();
dt.setData('application/x-rdfa-editor-block', '');
dt.setData('application/vnd.atomgraph.rdfa-editor.block', '');
block.dispatchEvent(new DragEvent('dragstart', { bubbles: true, dataTransfer: dt }));
const rect = target.getBoundingClientRect();
for (const type of ['dragover', 'drop']) {
Expand Down
2 changes: 1 addition & 1 deletion tests/browser/tables.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ results.drag = await page.evaluate(() => {
dragged.querySelector('.drag-handle').dispatchEvent(new MouseEvent('mousedown', { bubbles: true }));
const draggableSet = dragged.getAttribute('draggable') === 'true';
const dt = new DataTransfer();
dt.setData('application/x-rdfa-editor-block', '');
dt.setData('application/vnd.atomgraph.rdfa-editor.block', '');
dragged.dispatchEvent(new DragEvent('dragstart', { bubbles: true, dataTransfer: dt }));
const rect = target.getBoundingClientRect();
target.dispatchEvent(new DragEvent('dragover', { bubbles: true, cancelable: true, dataTransfer: dt, clientY: rect.bottom - 2 }));
Expand Down
Loading