| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
ve.ce.Node = function VeCeNode() { |
| 19 |
|
| 20 |
ve.ce.Node.super.apply( this, arguments ); |
| 21 |
|
| 22 |
|
| 23 |
ve.Node.call( this ); |
| 24 |
}; |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
OO.inheritClass( ve.ce.Node, ve.ce.View ); |
| 29 |
|
| 30 |
OO.mixinClass( ve.ce.Node, ve.Node ); |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
ve.ce.Node.static.splitOnEnter = false; |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
ve.ce.Node.static.removeEmptyLastChildOnEnter = false; |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
ve.ce.Node.static.isMultiline = null; |
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
ve.ce.Node.static.autoFocus = true; |
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
ve.ce.Node.static.trapsCursor = false; |
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
ve.ce.Node.static.getDescription = function () { |
| 102 |
return ''; |
| 103 |
}; |
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
ve.ce.Node.prototype.getChildNodeTypes = function () { |
| 112 |
return this.model.getChildNodeTypes(); |
| 113 |
}; |
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
ve.ce.Node.prototype.getParentNodeTypes = function () { |
| 120 |
return this.model.getParentNodeTypes(); |
| 121 |
}; |
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
ve.ce.Node.prototype.getSuggestedParentNodeTypes = function () { |
| 128 |
return this.model.getSuggestedParentNodeTypes(); |
| 129 |
}; |
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
ve.ce.Node.prototype.canHaveChildren = function () { |
| 136 |
return this.model.canHaveChildren(); |
| 137 |
}; |
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
ve.ce.Node.prototype.canHaveChildrenNotContent = function () { |
| 144 |
return this.model.canHaveChildrenNotContent(); |
| 145 |
}; |
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
ve.ce.Node.prototype.isInternal = function () { |
| 152 |
return this.model.isInternal(); |
| 153 |
}; |
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
ve.ce.Node.prototype.isMetaData = function () { |
| 160 |
return this.model.isMetaData(); |
| 161 |
}; |
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
|
| 166 |
|
| 167 |
ve.ce.Node.prototype.isWrapped = function () { |
| 168 |
return this.model.isWrapped(); |
| 169 |
}; |
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
ve.ce.Node.prototype.isUnwrappable = function () { |
| 176 |
return this.model.isUnwrappable(); |
| 177 |
}; |
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
ve.ce.Node.prototype.canContainContent = function () { |
| 184 |
return this.model.canContainContent(); |
| 185 |
}; |
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
|
| 190 |
|
| 191 |
ve.ce.Node.prototype.isContent = function () { |
| 192 |
return this.model.isContent(); |
| 193 |
}; |
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
ve.ce.Node.prototype.isFocusable = function () { |
| 205 |
return this.model.isFocusable(); |
| 206 |
}; |
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
ve.ce.Node.prototype.isAlignable = function () { |
| 213 |
return this.model.isAlignable(); |
| 214 |
}; |
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
ve.ce.Node.prototype.isCellable = function () { |
| 221 |
return this.model.isCellable(); |
| 222 |
}; |
| 223 |
|
| 224 |
|
| 225 |
|
| 226 |
|
| 227 |
|
| 228 |
ve.ce.Node.prototype.isCellEditable = function () { |
| 229 |
return this.model.isCellEditable(); |
| 230 |
}; |
| 231 |
|
| 232 |
|
| 233 |
|
| 234 |
|
| 235 |
|
| 236 |
ve.ce.Node.prototype.hasSignificantWhitespace = function () { |
| 237 |
return this.model.hasSignificantWhitespace(); |
| 238 |
}; |
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
ve.ce.Node.prototype.handlesOwnChildren = function () { |
| 245 |
return this.model.handlesOwnChildren(); |
| 246 |
}; |
| 247 |
|
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
|
| 252 |
ve.ce.Node.prototype.shouldIgnoreChildren = function () { |
| 253 |
return this.model.shouldIgnoreChildren(); |
| 254 |
}; |
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
ve.ce.Node.prototype.getLength = function () { |
| 261 |
return this.model.getLength(); |
| 262 |
}; |
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
ve.ce.Node.prototype.getOuterLength = function () { |
| 269 |
return this.model.getOuterLength(); |
| 270 |
}; |
| 271 |
|
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
ve.ce.Node.prototype.getOffset = function () { |
| 277 |
return this.model.getOffset(); |
| 278 |
}; |
| 279 |
|
| 280 |
|
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
ve.ce.Node.prototype.splitOnEnter = function () { |
| 286 |
return this.constructor.static.splitOnEnter; |
| 287 |
}; |
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
|
| 292 |
|
| 293 |
|
| 294 |
ve.ce.Node.prototype.removeEmptyLastChildOnEnter = function () { |
| 295 |
return this.constructor.static.removeEmptyLastChildOnEnter; |
| 296 |
}; |
| 297 |
|
| 298 |
|
| 299 |
|
| 300 |
|
| 301 |
|
| 302 |
|
| 303 |
|
| 304 |
|
| 305 |
|
| 306 |
ve.ce.Node.prototype.isMultiline = function () { |
| 307 |
const booleanNode = this.traverseUpstream( ( node ) => node.constructor.static.isMultiline === null ); |
| 308 |
if ( booleanNode ) { |
| 309 |
return booleanNode.constructor.static.isMultiline; |
| 310 |
} else { |
| 311 |
return !this.root || this.getRoot().getSurface().getSurface().isMultiline(); |
| 312 |
} |
| 313 |
}; |
| 314 |
|
| 315 |
|
| 316 |
|
| 317 |
|
| 318 |
|
| 319 |
|
| 320 |
ve.ce.Node.prototype.autoFocus = function () { |
| 321 |
return this.constructor.static.autoFocus; |
| 322 |
}; |
| 323 |
|
| 324 |
|
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
|
| 329 |
ve.ce.Node.prototype.trapsCursor = function () { |
| 330 |
return this.constructor.static.trapsCursor; |
| 331 |
}; |
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
|
| 336 |
ve.ce.Node.prototype.destroy = function () { |
| 337 |
this.parent = null; |
| 338 |
this.root = null; |
| 339 |
this.doc = null; |
| 340 |
|
| 341 |
|
| 342 |
ve.ce.Node.super.prototype.destroy.call( this ); |
| 343 |
}; |
| 344 |
|
| 345 |
|
| 346 |
|
| 347 |
|
| 348 |
|
| 349 |
|
| 350 |
ve.ce.Node.prototype.getModelHtmlDocument = function () { |
| 351 |
return this.model.getDocument() && this.model.getDocument().getHtmlDocument(); |
| 352 |
}; |