| 442 | | popupAreaObj._currentTarget = targetElement; |
| 443 | | var text = http.responseText; |
| 444 | | var xml = createHTMLDocumentByString(text); |
| 445 | | var elmContainer = document.createElement('DIV'); |
| 446 | | var elementList = getElementsByXPath(popupElementXPath, xml); |
| 447 | | // apply style |
| 448 | | if (option.style) { |
| 449 | | for (var j in option.style) { |
| 450 | | elmContainer.style[j] = option.style[j]; |
| 451 | | } |
| 452 | | } |
| 453 | | if (option.containerHTML) { |
| 454 | | elmContainer.innerHTML = option.containerHTML; |
| 455 | | var tmpList = elmContainer.getElementsByTagName('popup:container'); |
| 456 | | if (tmpList.length == 1) { |
| 457 | | for (var elementIndex in elementList) { |
| 458 | | tmpList[0].parentNode.insertBefore(elementList[elementIndex], tmpList[0]); |
| | 467 | popupAreaObj._currentTarget = targetElement; |
| | 468 | var text = http.responseText; |
| | 469 | var xml = createHTMLDocumentByString(text); |
| | 470 | var elmContainer = document.createElement('DIV'); |
| | 471 | // apply style |
| | 472 | if (option.style) { |
| | 473 | for (var j in option.style) { |
| | 474 | elmContainer.style[j] = option.style[j]; |
| 461 | | } else { |
| 462 | | for (var elementIndex in elementList) { |
| 463 | | elmContainer.appendChild(elementList[elementIndex]); |
| | 477 | if (http.status == 200) { |
| | 478 | var elementList = getElementsByXPath(popupElementXPath, xml); |
| | 479 | |
| | 480 | if (elementList.length > 0) { |
| | 481 | // "popupElement" found |
| | 482 | if (option.containerHTML) { |
| | 483 | elmContainer.innerHTML = option.containerHTML; |
| | 484 | var tmpList = elmContainer.getElementsByTagName('popup:container'); |
| | 485 | if (tmpList.length == 1) { |
| | 486 | for (var elementIndex in elementList) { |
| | 487 | tmpList[0].parentNode.insertBefore(elementList[elementIndex], tmpList[0]); |
| | 488 | } |
| | 489 | } |
| | 490 | } else { |
| | 491 | for (var elementIndex in elementList) { |
| | 492 | elmContainer.appendChild(elementList[elementIndex]); |
| | 493 | } |
| | 494 | } |
| | 495 | } else { |
| | 496 | // nothing matched to "popupElement" |
| | 497 | elmContainer.appendChild(document.createTextNode(ERROR_MESSAGE_POPUP_ELEMENT_EMPTY)); |
| 465 | | } |
| 466 | | targetElement._elementCache = elmContainer; |
| 467 | | elmContainer.addEventListener('mouseover', targetElement.lock, true); |
| 468 | | elmContainer.addEventListener('mouseout', targetElement.unlock, true); |
| 469 | | popupAreaObj.append(elmContainer); |
| 470 | | popupAreaObj.show(targetElement); |
| | 499 | targetElement._elementCache = elmContainer; |
| | 500 | } else { |
| | 501 | // HTTP Error |
| | 502 | elmContainer.appendChild(document.createTextNode(ERROR_MESSAGE_HTTP + http.status)); |
| | 503 | } |
| | 504 | elmContainer.addEventListener('mouseover', targetElement.lock, true); |
| | 505 | elmContainer.addEventListener('mouseout', targetElement.unlock, true); |
| | 506 | popupAreaObj.append(elmContainer); |
| | 507 | popupAreaObj.show(targetElement); |