@@ 628-628 (lines=1) @@ | ||
625 | z);v=q();v.appendChild(document.createTextNode("@namespace editinfo url(urn:webodf:names:editinfo);"));v.appendChild(document.createTextNode("@namespace dc url(http://purl.org/dc/elements/1.1/);"));u=q();z();K=core.Task.createRedrawTask(function(){var a=I.getAnnotationViewManager();a&&(a.rehighlightAnnotations(),A.fixCursorPositions())})}})(); |
|
626 | gui.SvgSelectionView=function(g){function k(){var a=d.getRootNode();m!==a&&(m=a,h=d.getCanvas().getSizer(),h.appendChild(x),x.setAttribute("class","webodf-selectionOverlay"),w.setAttribute("class","webodf-draggable"),v.setAttribute("class","webodf-draggable"),w.setAttribute("end","left"),v.setAttribute("end","right"),w.setAttribute("r",8),v.setAttribute("r",8),x.appendChild(z),x.appendChild(w),x.appendChild(v))}function c(a){a=a.getBoundingClientRect();return Boolean(a&&0!==a.height)}function b(a){var b= |
|
627 | u.getTextElements(a,!0,!1),d=a.cloneRange(),e=a.cloneRange();a=a.cloneRange();if(!b.length)return null;var f;a:{f=0;var h=b[f],g=d.startContainer===h?d.startOffset:0,m=g;d.setStart(h,g);for(d.setEnd(h,m);!c(d);){if(h.nodeType===Node.ELEMENT_NODE&&m<h.childNodes.length)m=h.childNodes.length;else if(h.nodeType===Node.TEXT_NODE&&m<h.length)m+=1;else if(b[f])h=b[f],f+=1,g=m=0;else{f=!1;break a}d.setStart(h,g);d.setEnd(h,m)}f=!0}if(!f)return null;a:{f=b.length-1;h=b[f];m=g=e.endContainer===h?e.endOffset: |
|
628 | h.nodeType===Node.TEXT_NODE?h.length:h.childNodes.length;e.setStart(h,g);for(e.setEnd(h,m);!c(e);){if(h.nodeType===Node.ELEMENT_NODE&&0<g)g=0;else if(h.nodeType===Node.TEXT_NODE&&0<g)--g;else if(b[f])h=b[f],--f,g=m=h.length||h.childNodes.length;else{b=!1;break a}e.setStart(h,g);e.setEnd(h,m)}b=!0}if(!b)return null;a.setStart(d.startContainer,d.startOffset);a.setEnd(e.endContainer,e.endOffset);return{firstRange:d,lastRange:e,fillerRange:a}}function f(a,b){var d={};d.top=Math.min(a.top,b.top);d.left= |
|
629 | Math.min(a.left,b.left);d.right=Math.max(a.right,b.right);d.bottom=Math.max(a.bottom,b.bottom);d.width=d.right-d.left;d.height=d.bottom-d.top;return d}function n(a,b){b&&0<b.width&&0<b.height&&(a=a?f(a,b):b);return a}function p(a){function b(a){K.setUnfilteredPosition(a,0);return v.acceptNode(a)===L&&x.acceptPosition(K)===L?L:E}function c(a){var d=null;b(a)===L&&(d=t.getBoundingClientRect(a));return d}var e=a.commonAncestorContainer,f=a.startContainer,h=a.endContainer,g=a.startOffset,m=a.endOffset, |
|
630 | k,l,p=null,q,r=y.createRange(),x,v=new odf.OdfNodeFilter,w;if(f===e||h===e)return r=a.cloneRange(),p=r.getBoundingClientRect(),r.detach(),p;for(a=f;a.parentNode!==e;)a=a.parentNode;for(l=h;l.parentNode!==e;)l=l.parentNode;x=d.createRootFilter(f);for(e=a.nextSibling;e&&e!==l;)q=c(e),p=n(p,q),e=e.nextSibling;if(u.isParagraph(a))p=n(p,t.getBoundingClientRect(a));else if(a.nodeType===Node.TEXT_NODE)e=a,r.setStart(e,g),r.setEnd(e,e===l?m:e.length),q=r.getBoundingClientRect(),p=n(p,q);else for(w=y.createTreeWalker(a, |
|
631 | NodeFilter.SHOW_TEXT,b,!1),e=w.currentNode=f;e&&e!==h;)r.setStart(e,g),r.setEnd(e,e.length),q=r.getBoundingClientRect(),p=n(p,q),k=e,g=0,e=w.nextNode();k||(k=f);if(u.isParagraph(l))p=n(p,t.getBoundingClientRect(l));else if(l.nodeType===Node.TEXT_NODE)e=l,r.setStart(e,e===a?g:0),r.setEnd(e,m),q=r.getBoundingClientRect(),p=n(p,q);else for(w=y.createTreeWalker(l,NodeFilter.SHOW_TEXT,b,!1),e=w.currentNode=h;e&&e!==k;)if(r.setStart(e,0),r.setEnd(e,m),q=r.getBoundingClientRect(),p=n(p,q),e=w.previousNode())m= |
|
@@ 627-627 (lines=1) @@ | ||
624 | m);A.subscribe(ops.Document.signalCursorRemoved,y);A.subscribe(ops.OdtDocument.signalParagraphChanged,x);A.subscribe(ops.Document.signalCursorMoved,h);A.subscribe(ops.OdtDocument.signalParagraphChanged,p.rerenderSelectionViews);A.subscribe(ops.OdtDocument.signalTableAdded,p.rerenderSelectionViews);A.subscribe(ops.OdtDocument.signalParagraphStyleModified,p.rerenderSelectionViews);f.subscribe(gui.CommonConstraints.EDIT.ANNOTATIONS.ONLY_DELETE_OWN,z);A.subscribe(ops.Document.signalMemberAdded,z);A.subscribe(ops.Document.signalMemberUpdated, |
|
625 | z);v=q();v.appendChild(document.createTextNode("@namespace editinfo url(urn:webodf:names:editinfo);"));v.appendChild(document.createTextNode("@namespace dc url(http://purl.org/dc/elements/1.1/);"));u=q();z();K=core.Task.createRedrawTask(function(){var a=I.getAnnotationViewManager();a&&(a.rehighlightAnnotations(),A.fixCursorPositions())})}})(); |
|
626 | gui.SvgSelectionView=function(g){function k(){var a=d.getRootNode();m!==a&&(m=a,h=d.getCanvas().getSizer(),h.appendChild(x),x.setAttribute("class","webodf-selectionOverlay"),w.setAttribute("class","webodf-draggable"),v.setAttribute("class","webodf-draggable"),w.setAttribute("end","left"),v.setAttribute("end","right"),w.setAttribute("r",8),v.setAttribute("r",8),x.appendChild(z),x.appendChild(w),x.appendChild(v))}function c(a){a=a.getBoundingClientRect();return Boolean(a&&0!==a.height)}function b(a){var b= |
|
627 | u.getTextElements(a,!0,!1),d=a.cloneRange(),e=a.cloneRange();a=a.cloneRange();if(!b.length)return null;var f;a:{f=0;var h=b[f],g=d.startContainer===h?d.startOffset:0,m=g;d.setStart(h,g);for(d.setEnd(h,m);!c(d);){if(h.nodeType===Node.ELEMENT_NODE&&m<h.childNodes.length)m=h.childNodes.length;else if(h.nodeType===Node.TEXT_NODE&&m<h.length)m+=1;else if(b[f])h=b[f],f+=1,g=m=0;else{f=!1;break a}d.setStart(h,g);d.setEnd(h,m)}f=!0}if(!f)return null;a:{f=b.length-1;h=b[f];m=g=e.endContainer===h?e.endOffset: |
|
628 | h.nodeType===Node.TEXT_NODE?h.length:h.childNodes.length;e.setStart(h,g);for(e.setEnd(h,m);!c(e);){if(h.nodeType===Node.ELEMENT_NODE&&0<g)g=0;else if(h.nodeType===Node.TEXT_NODE&&0<g)--g;else if(b[f])h=b[f],--f,g=m=h.length||h.childNodes.length;else{b=!1;break a}e.setStart(h,g);e.setEnd(h,m)}b=!0}if(!b)return null;a.setStart(d.startContainer,d.startOffset);a.setEnd(e.endContainer,e.endOffset);return{firstRange:d,lastRange:e,fillerRange:a}}function f(a,b){var d={};d.top=Math.min(a.top,b.top);d.left= |
|
629 | Math.min(a.left,b.left);d.right=Math.max(a.right,b.right);d.bottom=Math.max(a.bottom,b.bottom);d.width=d.right-d.left;d.height=d.bottom-d.top;return d}function n(a,b){b&&0<b.width&&0<b.height&&(a=a?f(a,b):b);return a}function p(a){function b(a){K.setUnfilteredPosition(a,0);return v.acceptNode(a)===L&&x.acceptPosition(K)===L?L:E}function c(a){var d=null;b(a)===L&&(d=t.getBoundingClientRect(a));return d}var e=a.commonAncestorContainer,f=a.startContainer,h=a.endContainer,g=a.startOffset,m=a.endOffset, |
|
630 | k,l,p=null,q,r=y.createRange(),x,v=new odf.OdfNodeFilter,w;if(f===e||h===e)return r=a.cloneRange(),p=r.getBoundingClientRect(),r.detach(),p;for(a=f;a.parentNode!==e;)a=a.parentNode;for(l=h;l.parentNode!==e;)l=l.parentNode;x=d.createRootFilter(f);for(e=a.nextSibling;e&&e!==l;)q=c(e),p=n(p,q),e=e.nextSibling;if(u.isParagraph(a))p=n(p,t.getBoundingClientRect(a));else if(a.nodeType===Node.TEXT_NODE)e=a,r.setStart(e,g),r.setEnd(e,e===l?m:e.length),q=r.getBoundingClientRect(),p=n(p,q);else for(w=y.createTreeWalker(a, |