| 4042 | }; |
| 4043 | |
| 4044 | function markTextShared(doc, from, to, options, type) { |
| 4045 | options = copyObj(options); |
| 4046 | options.shared = false; |
| 4047 | var markers = [markText(doc, from, to, options, type)], primary = markers[0]; |
| 4048 | var widget = options.replacedWith; |
| 4049 | linkedDocs(doc, function(doc) { |
| 4050 | if (widget) options.replacedWith = widget.cloneNode(true); |
| 4051 | markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)); |
| 4052 | for (var i = 0; i < doc.linked.length; ++i) |
| 4053 | if (doc.linked[i].isParent) return; |
| 4054 | primary = lst(markers); |
| 4055 | }); |
| 4056 | return new SharedTextMarker(markers, primary); |
| 4057 | } |
| 4058 | |
| 4059 | // TEXTMARKER SPANS |
| 4060 | |